Search in sources :

Example 16 with LogService

use of org.osgi.service.log.LogService in project narayana by jbosstm.

the class OsgiServer method warn.

protected void warn(String message, Throwable t) {
    ServiceReference<LogService> ref = bundleContext.getServiceReference(LogService.class);
    if (ref != null) {
        LogService svc = bundleContext.getService(ref);
        svc.log(LogService.LOG_WARNING, message, t);
        bundleContext.ungetService(ref);
    }
}
Also used : LogService(org.osgi.service.log.LogService)

Example 17 with LogService

use of org.osgi.service.log.LogService in project ecf by eclipse.

the class Activator method getLogService.

protected LogService getLogService() {
    if (logServiceTracker == null) {
        logServiceTracker = new ServiceTracker(this.context, LogService.class.getName(), null);
        logServiceTracker.open();
    }
    return (LogService) logServiceTracker.getService();
}
Also used : ServiceTracker(org.osgi.util.tracker.ServiceTracker) LogService(org.osgi.service.log.LogService)

Example 18 with LogService

use of org.osgi.service.log.LogService in project ecf by eclipse.

the class Activator method getLogService.

protected LogService getLogService() {
    if (logServiceTracker == null) {
        logServiceTracker = new ServiceTracker(this.context, LogService.class.getName(), null);
        logServiceTracker.open();
    }
    return (LogService) logServiceTracker.getService();
}
Also used : ServiceTracker(org.osgi.util.tracker.ServiceTracker) LogService(org.osgi.service.log.LogService)

Example 19 with LogService

use of org.osgi.service.log.LogService in project ecf by eclipse.

the class Activator method getLogService.

private synchronized LogService getLogService() {
    if (logServiceTracker == null) {
        logServiceTracker = new ServiceTracker(this.context, LogService.class.getName(), null);
        logServiceTracker.open();
    }
    return (LogService) logServiceTracker.getService();
}
Also used : ServiceTracker(org.osgi.util.tracker.ServiceTracker) LogService(org.osgi.service.log.LogService)

Example 20 with LogService

use of org.osgi.service.log.LogService in project ecf by eclipse.

the class DiscoveryPlugin method getLogService.

public LogService getLogService() {
    if (logServiceTracker == null) {
        logServiceTracker = new ServiceTracker(this.context, LogService.class.getName(), null);
        logServiceTracker.open();
    }
    return (LogService) logServiceTracker.getService();
}
Also used : ServiceTracker(org.osgi.util.tracker.ServiceTracker) LogService(org.osgi.service.log.LogService)

Aggregations

LogService (org.osgi.service.log.LogService)57 ServiceTracker (org.osgi.util.tracker.ServiceTracker)15 File (java.io.File)10 ServiceReference (org.osgi.framework.ServiceReference)10 AbstractDeploymentPackage (org.apache.felix.deploymentadmin.AbstractDeploymentPackage)7 Bundle (org.osgi.framework.Bundle)7 HashMap (java.util.HashMap)6 PrintStream (java.io.PrintStream)5 StringWriter (java.io.StringWriter)5 Builder (aQute.bnd.osgi.Builder)4 Jar (aQute.bnd.osgi.Jar)4 Resource (aQute.bnd.osgi.Resource)4 XmlTester (aQute.bnd.test.XmlTester)4 Attributes (java.util.jar.Attributes)4 BundleInfoImpl (org.apache.felix.deploymentadmin.BundleInfoImpl)4 Before (org.junit.Before)4 BundleContext (org.osgi.framework.BundleContext)4 IOException (java.io.IOException)3 Date (java.util.Date)3 Matchers.anyString (org.mockito.Matchers.anyString)3