Made sure the OSGi bundle is loaded even when there's no LogService available
This commit is contained in:
parent
5c02a13be0
commit
6e264f3bd0
3
pom.xml
3
pom.xml
@ -201,9 +201,6 @@
|
||||
<Import-Package>
|
||||
*;resolution:=optional
|
||||
</Import-Package>
|
||||
<!--
|
||||
org.slf4j.*;resolution:=optional,org.apache.commons.logging.*;resolution:=optional,org.jboss.logging.*;resolution:=optional,org.apache.log4j.*;resolution:=optional,*</Import-Package>
|
||||
-->
|
||||
</instructions>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
@ -59,6 +59,8 @@ public class NettyBundleActivator implements BundleActivator {
|
||||
|
||||
public void start(BundleContext ctx) throws Exception {
|
||||
initLoggerFactory(ctx);
|
||||
InternalLoggerFactory.getInstance(NettyBundleActivator.class).info("YAY");
|
||||
|
||||
executor = Executors.newCachedThreadPool();
|
||||
|
||||
// The default transport is NIO.
|
||||
@ -80,7 +82,8 @@ public class NettyBundleActivator implements BundleActivator {
|
||||
}
|
||||
|
||||
private void initLoggerFactory(BundleContext ctx) {
|
||||
ServiceReference logServiceRef = ctx.getServiceReference(LogService.class.getName());
|
||||
ServiceReference logServiceRef =
|
||||
ctx.getServiceReference("org.osgi.service.log.LogService");
|
||||
if (logServiceRef == null) {
|
||||
// LogService is not available.
|
||||
return;
|
||||
|
Loading…
x
Reference in New Issue
Block a user