Made sure the OSGi bundle is loaded even when there's no LogService available

This commit is contained in:
Trustin Lee 2009-01-12 10:38:14 +00:00
parent 5c02a13be0
commit 6e264f3bd0
2 changed files with 4 additions and 4 deletions

View File

@ -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>

View File

@ -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;