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>
|
<Import-Package>
|
||||||
*;resolution:=optional
|
*;resolution:=optional
|
||||||
</Import-Package>
|
</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>
|
</instructions>
|
||||||
</configuration>
|
</configuration>
|
||||||
</plugin>
|
</plugin>
|
||||||
|
@ -59,6 +59,8 @@ public class NettyBundleActivator implements BundleActivator {
|
|||||||
|
|
||||||
public void start(BundleContext ctx) throws Exception {
|
public void start(BundleContext ctx) throws Exception {
|
||||||
initLoggerFactory(ctx);
|
initLoggerFactory(ctx);
|
||||||
|
InternalLoggerFactory.getInstance(NettyBundleActivator.class).info("YAY");
|
||||||
|
|
||||||
executor = Executors.newCachedThreadPool();
|
executor = Executors.newCachedThreadPool();
|
||||||
|
|
||||||
// The default transport is NIO.
|
// The default transport is NIO.
|
||||||
@ -80,7 +82,8 @@ public class NettyBundleActivator implements BundleActivator {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void initLoggerFactory(BundleContext ctx) {
|
private void initLoggerFactory(BundleContext ctx) {
|
||||||
ServiceReference logServiceRef = ctx.getServiceReference(LogService.class.getName());
|
ServiceReference logServiceRef =
|
||||||
|
ctx.getServiceReference("org.osgi.service.log.LogService");
|
||||||
if (logServiceRef == null) {
|
if (logServiceRef == null) {
|
||||||
// LogService is not available.
|
// LogService is not available.
|
||||||
return;
|
return;
|
||||||
|
Loading…
Reference in New Issue
Block a user