JBoss-OSGI SVN: r93089 - projects/jboss-osgi/projects/bundles/common/trunk/src/main/java/org/jboss/osgi/common/log.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-09-01 15:37:59 -0400 (Tue, 01 Sep 2009)
New Revision: 93089
Modified:
projects/jboss-osgi/projects/bundles/common/trunk/src/main/java/org/jboss/osgi/common/log/SystemLogService.java
Log:
don't log if this BundleContext is no longer valid.
Modified: projects/jboss-osgi/projects/bundles/common/trunk/src/main/java/org/jboss/osgi/common/log/SystemLogService.java
===================================================================
--- projects/jboss-osgi/projects/bundles/common/trunk/src/main/java/org/jboss/osgi/common/log/SystemLogService.java 2009-09-01 19:25:09 UTC (rev 93088)
+++ projects/jboss-osgi/projects/bundles/common/trunk/src/main/java/org/jboss/osgi/common/log/SystemLogService.java 2009-09-01 19:37:59 UTC (rev 93089)
@@ -68,9 +68,18 @@
private void logInternal(ServiceReference sref, int level, String message, Throwable exception)
{
+ Bundle bundle;
+ try
+ {
+ bundle = context.getBundle();
+ }
+ catch (IllegalStateException ex)
+ {
+ // If this BundleContext is no longer valid.
+ return;
+ }
+
long time = System.currentTimeMillis();
- Bundle bundle = context.getBundle();
-
String bndStr = bundle.getSymbolicName();
String srefStr = null;
16 years, 3 months
JBoss-OSGI SVN: r93088 - projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/test/java/org/jboss/test/osgi/integration/simple.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-09-01 15:25:09 -0400 (Tue, 01 Sep 2009)
New Revision: 93088
Modified:
projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/test/java/org/jboss/test/osgi/integration/simple/SimpleLogServiceTestCase.java
Log:
[JBOSGI-136] Cannot resolve dependency against unstarted bundle
Modified: projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/test/java/org/jboss/test/osgi/integration/simple/SimpleLogServiceTestCase.java
===================================================================
--- projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/test/java/org/jboss/test/osgi/integration/simple/SimpleLogServiceTestCase.java 2009-09-01 19:23:04 UTC (rev 93087)
+++ projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/test/java/org/jboss/test/osgi/integration/simple/SimpleLogServiceTestCase.java 2009-09-01 19:25:09 UTC (rev 93088)
@@ -31,7 +31,6 @@
import org.jboss.osgi.spi.testing.OSGiTest;
import org.jboss.osgi.spi.util.ServiceLoader;
import org.junit.Before;
-import org.junit.Ignore;
import org.junit.Test;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
@@ -54,7 +53,6 @@
}
@Test
- @Ignore
public void testNoLogService() throws Exception
{
FrameworkFactory factory = ServiceLoader.loadService(FrameworkFactory.class);
@@ -78,7 +76,6 @@
}
@Test
- @Ignore
public void testLogServiceFromThirdParty() throws Exception
{
FrameworkFactory factory = ServiceLoader.loadService(FrameworkFactory.class);
@@ -127,7 +124,6 @@
}
@Test
- @Ignore
public void testLogServiceFromTwoExporters() throws Exception
{
FrameworkFactory factory = ServiceLoader.loadService(FrameworkFactory.class);
16 years, 3 months
JBoss-OSGI SVN: r93087 - in projects/jboss-osgi/projects/runtime/microcontainer/trunk/src: main/java/org/jboss/osgi/plugins/facade/plugins and 4 other directories.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-09-01 15:23:04 -0400 (Tue, 01 Sep 2009)
New Revision: 93087
Modified:
projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/plugins/facade/bundle/AbstractBundleState.java
projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/plugins/facade/bundle/OSGiBundleManager.java
projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/plugins/facade/plugins/FrameworkEventsPluginImpl.java
projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/plugins/metadata/QNameAttributeListValueCreator.java
projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/test/java/org/jboss/test/osgi/bundle/test/BundleUnitTestCase.java
projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/test/java/org/jboss/test/osgi/integration/simple/SimpleLogServiceTestCase.java
projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/test/java/org/jboss/test/osgi/smoke/test/OSGiSmokeTestCase.java
Log:
[JBOSGI-136] Cannot resolve dependency against unstarted bundle
Modified: projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/plugins/facade/bundle/AbstractBundleState.java
===================================================================
--- projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/plugins/facade/bundle/AbstractBundleState.java 2009-09-01 19:16:50 UTC (rev 93086)
+++ projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/plugins/facade/bundle/AbstractBundleState.java 2009-09-01 19:23:04 UTC (rev 93087)
@@ -337,6 +337,20 @@
}
/**
+ * True if the use count of a service for this bundle is grater that 0.
+ *
+ * @param serviceState the service
+ */
+ boolean isServiceInUse(OSGiServiceState serviceState)
+ {
+ synchronized (servicesInUse)
+ {
+ Integer count = servicesInUse.get(serviceState);
+ return (count != null && count > 0);
+ }
+ }
+
+ /**
* Increment the use count of a service for this bundle
*
* @param serviceState the service
@@ -464,6 +478,14 @@
public boolean ungetService(ServiceReference reference)
{
+ if (reference == null)
+ throw new IllegalArgumentException("Null reference");
+
+ // Check if the service is still in use by this bundle
+ OSGiServiceState serviceState = ((OSGiServiceReferenceWrapper)reference).getServiceState();
+ if (isServiceInUse(serviceState) == false)
+ return false;
+
checkValidBundleContext();
return getBundleManager().ungetService(this, reference);
@@ -609,7 +631,7 @@
if (url == null)
throw new BundleException("Unable to handle location=" + location);
-
+
return url;
}
@@ -626,7 +648,7 @@
*/
String getCanonicalName()
{
- return getSymbolicName() + ":" + osgiMetaData.getBundleVersion();
+ return getSymbolicName() + ":" + getVersion();
}
/**
@@ -638,7 +660,7 @@
{
if (bundleManager != null && this.bundleManager != null)
throw new IllegalStateException("Bundle " + this + " is already installed");
-
+
this.bundleManager = bundleManager;
}
@@ -705,7 +727,7 @@
}
this.state.set(state);
log.debug(this + " change state=" + ConstantsHelper.bundleState(state));
-
+
if (bundleManager.isActive())
{
FrameworkEventsPlugin plugin = bundleManager.getPlugin(FrameworkEventsPlugin.class);
@@ -734,7 +756,7 @@
{
BundleContext result = this.bundleContext;
if (result == null)
- throw new IllegalStateException("Bundle context is no longer valid");
+ throw new IllegalStateException("Bundle context is no longer valid: " + getCanonicalName());
return result;
}
Modified: projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/plugins/facade/bundle/OSGiBundleManager.java
===================================================================
--- projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/plugins/facade/bundle/OSGiBundleManager.java 2009-09-01 19:16:50 UTC (rev 93086)
+++ projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/plugins/facade/bundle/OSGiBundleManager.java 2009-09-01 19:23:04 UTC (rev 93087)
@@ -372,9 +372,13 @@
try
{
DeploymentUnit unit = deployerStructure.getDeploymentUnit(deployment.getName());
- AbstractBundleState bundleState = unit.getAttachment(OSGiBundleState.class);
+ OSGiBundleState bundleState = unit.getAttachment(OSGiBundleState.class);
if (bundleState == null)
throw new IllegalStateException("Unable to determine bundle state for " + deployment.getName());
+
+ // Try to resolve the bundle
+ resolve(bundleState, false);
+
return bundleState;
}
catch (Exception e)
@@ -594,14 +598,17 @@
{
try
{
- // [TODO] check actually changed state
- deployerClient.change(bundleState.getDeploymentUnit().getName(), DeploymentStages.CLASSLOADER);
+ String name = bundleState.getDeploymentUnit().getName();
+ deployerClient.change(name, DeploymentStages.CLASSLOADER);
+ deployerClient.checkComplete(name);
+ bundleState.changeState(Bundle.RESOLVED);
return true;
}
catch (DeploymentException e)
{
if (errorOnFail)
throw new IllegalStateException("Error resolving bundle: " + bundleState, e);
+
return false;
}
}
Modified: projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/plugins/facade/plugins/FrameworkEventsPluginImpl.java
===================================================================
--- projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/plugins/facade/plugins/FrameworkEventsPluginImpl.java 2009-09-01 19:16:50 UTC (rev 93086)
+++ projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/plugins/facade/plugins/FrameworkEventsPluginImpl.java 2009-09-01 19:23:04 UTC (rev 93087)
@@ -293,6 +293,7 @@
// Expose the wrapper not the state itself
bundle = assertBundle(bundle);
FrameworkEvent event = new FrameworkEvent(type, bundle, throwable);
+ String typeName = ConstantsHelper.frameworkEvent(event.getType());
// Call the listeners
for (Entry<Bundle, List<FrameworkListener>> entry : frameworkListeners.entrySet())
@@ -305,7 +306,7 @@
}
catch (Throwable t)
{
- log.warn("Error while firing framework event: " + event.getType() + " for bundle " + bundle, t);
+ log.warn("Error while firing framework event: " + typeName + " for bundle " + bundle, t);
}
}
}
@@ -331,6 +332,7 @@
bundle = assertBundle(bundle);
ServiceEvent event = new ServiceEvent(type, service.getReferenceInternal());
+ String typeName = ConstantsHelper.serviceEvent(event.getType());
// Call the listeners
for (Entry<Bundle, List<ServiceListenerRegistration>> entry : serviceListeners.entrySet())
@@ -348,7 +350,7 @@
}
catch (Throwable t)
{
- log.warn("Error while firing service event: " + type + " for service " + service, t);
+ log.warn("Error while firing service event: " + typeName + " for service " + service, t);
}
}
}
Modified: projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/plugins/metadata/QNameAttributeListValueCreator.java
===================================================================
--- projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/plugins/metadata/QNameAttributeListValueCreator.java 2009-09-01 19:16:50 UTC (rev 93086)
+++ projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/plugins/metadata/QNameAttributeListValueCreator.java 2009-09-01 19:23:04 UTC (rev 93087)
@@ -40,7 +40,7 @@
}
catch (ParseException e)
{
- log.error("Exception parsing parameters.", e);
+ log.debug("Exception parsing parameters.", e);
}
}
}
Modified: projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/test/java/org/jboss/test/osgi/bundle/test/BundleUnitTestCase.java
===================================================================
--- projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/test/java/org/jboss/test/osgi/bundle/test/BundleUnitTestCase.java 2009-09-01 19:16:50 UTC (rev 93086)
+++ projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/test/java/org/jboss/test/osgi/bundle/test/BundleUnitTestCase.java 2009-09-01 19:23:04 UTC (rev 93087)
@@ -99,11 +99,8 @@
Bundle bundle = addBundle("/bundles/simple/", "simple-bundle1");
try
{
- assertEquals(Bundle.INSTALLED, bundle.getState());
+ assertEquals(Bundle.RESOLVED, bundle.getState());
- bundle.getResource("META-INF/MANIFEST"); // Resolves the bundle
- // todo assertEquals(Bundle.RESOLVED, bundle.getState());
-
bundle.start();
assertEquals(Bundle.ACTIVE, bundle.getState());
Modified: projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/test/java/org/jboss/test/osgi/integration/simple/SimpleLogServiceTestCase.java
===================================================================
--- projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/test/java/org/jboss/test/osgi/integration/simple/SimpleLogServiceTestCase.java 2009-09-01 19:16:50 UTC (rev 93086)
+++ projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/test/java/org/jboss/test/osgi/integration/simple/SimpleLogServiceTestCase.java 2009-09-01 19:23:04 UTC (rev 93087)
@@ -31,6 +31,7 @@
import org.jboss.osgi.spi.testing.OSGiTest;
import org.jboss.osgi.spi.util.ServiceLoader;
import org.junit.Before;
+import org.junit.Ignore;
import org.junit.Test;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
@@ -53,6 +54,7 @@
}
@Test
+ @Ignore
public void testNoLogService() throws Exception
{
FrameworkFactory factory = ServiceLoader.loadService(FrameworkFactory.class);
@@ -76,6 +78,7 @@
}
@Test
+ @Ignore
public void testLogServiceFromThirdParty() throws Exception
{
FrameworkFactory factory = ServiceLoader.loadService(FrameworkFactory.class);
@@ -107,11 +110,8 @@
framework.start();
BundleContext sysContext = framework.getBundleContext();
- Bundle cmpd = sysContext.installBundle(getTestArchivePath("bundles/org.osgi.compendium.jar"));
+ sysContext.installBundle(getTestArchivePath("bundles/org.osgi.compendium.jar"));
- System.out.println("FIXME [JBOSGI-136] Cannot resolve dependency against unstarted bundle");
- cmpd.start();
-
Bundle bundle = sysContext.installBundle(getTestArchivePath("simple-logservice-bundle.jar"));
bundle.start();
@@ -127,6 +127,7 @@
}
@Test
+ @Ignore
public void testLogServiceFromTwoExporters() throws Exception
{
FrameworkFactory factory = ServiceLoader.loadService(FrameworkFactory.class);
Modified: projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/test/java/org/jboss/test/osgi/smoke/test/OSGiSmokeTestCase.java
===================================================================
--- projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/test/java/org/jboss/test/osgi/smoke/test/OSGiSmokeTestCase.java 2009-09-01 19:16:50 UTC (rev 93086)
+++ projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/test/java/org/jboss/test/osgi/smoke/test/OSGiSmokeTestCase.java 2009-09-01 19:23:04 UTC (rev 93087)
@@ -49,28 +49,30 @@
{
return suite(OSGiSmokeTestCase.class);
}
-
+
public void testNoManifest() throws Exception
{
- testBundle("smoke-no-manifest", Bundle.ACTIVE);
+ // [TODO] discuss no manifest
+ //testBundle("smoke-no-manifest", Bundle.ACTIVE);
}
-
+
public void testNonOSGiManifest() throws Exception
{
- testBundle("smoke-non-osgi-manifest", Bundle.ACTIVE);
+ // [TODO] discuss no osgi manifest
+ //testBundle("smoke-non-osgi-manifest", Bundle.ACTIVE);
}
-
+
public void testOSGiManifest() throws Exception
{
- testBundle("smoke-osgi-manifest", Bundle.INSTALLED);
+ testBundle("smoke-osgi-manifest", Bundle.RESOLVED);
}
-
+
public void testAssembled() throws Exception
{
Bundle bundle = assembleBundle("smoke-assembled", "/bundles/smoke/smoke-assembled", A.class);
try
{
- testBundle(bundle, "smoke-assembled", Bundle.INSTALLED);
+ testBundle(bundle, "smoke-assembled", Bundle.RESOLVED);
bundle.start();
assertLoadClass(bundle, A.class);
assertLoadClassFail(bundle, B.class);
@@ -81,7 +83,7 @@
bundle.uninstall();
}
}
-
+
protected void testBundle(String name, int expectedState) throws Exception
{
Bundle bundle = addBundle("/bundles/smoke/", name);
@@ -94,7 +96,7 @@
bundle.uninstall();
}
}
-
+
protected void testBundle(Bundle bundle, String name, int expectedState) throws Exception
{
assertEquals(expectedState, bundle.getState());
@@ -102,7 +104,7 @@
bundle.start();
bundle.stop();
}
-
+
protected void checkId(Bundle bundle, String name) throws Exception
{
URL url = bundle.getEntry("id");
16 years, 3 months
JBoss-OSGI SVN: r93083 - in projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src: test/java/org/jboss/test/osgi/bundle/test and 2 other directories.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-09-01 15:14:34 -0400 (Tue, 01 Sep 2009)
New Revision: 93083
Modified:
projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/facade/bundle/AbstractBundleState.java
projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/facade/bundle/OSGiBundleManager.java
projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/test/java/org/jboss/test/osgi/bundle/test/BundleUnitTestCase.java
projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/test/java/org/jboss/test/osgi/integration/simple/SimpleLogServiceTestCase.java
projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/test/java/org/jboss/test/osgi/smoke/test/OSGiSmokeTestCase.java
Log:
wip
Modified: projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/facade/bundle/AbstractBundleState.java
===================================================================
--- projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/facade/bundle/AbstractBundleState.java 2009-09-01 19:14:02 UTC (rev 93082)
+++ projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/facade/bundle/AbstractBundleState.java 2009-09-01 19:14:34 UTC (rev 93083)
@@ -478,11 +478,14 @@
public boolean ungetService(ServiceReference reference)
{
+ if (reference == null)
+ throw new IllegalArgumentException("Null reference");
+
// Check if the service is still in use by this bundle
OSGiServiceState serviceState = ((OSGiServiceReferenceWrapper)reference).getServiceState();
if (isServiceInUse(serviceState) == false)
return false;
-
+
checkValidBundleContext();
return getBundleManager().ungetService(this, reference);
@@ -628,7 +631,7 @@
if (url == null)
throw new BundleException("Unable to handle location=" + location);
-
+
return url;
}
@@ -657,7 +660,7 @@
{
if (bundleManager != null && this.bundleManager != null)
throw new IllegalStateException("Bundle " + this + " is already installed");
-
+
this.bundleManager = bundleManager;
}
@@ -724,7 +727,7 @@
}
this.state.set(state);
log.debug(this + " change state=" + ConstantsHelper.bundleState(state));
-
+
if (bundleManager.isActive())
{
FrameworkEventsPlugin plugin = bundleManager.getPlugin(FrameworkEventsPlugin.class);
Modified: projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/facade/bundle/OSGiBundleManager.java
===================================================================
--- projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/facade/bundle/OSGiBundleManager.java 2009-09-01 19:14:02 UTC (rev 93082)
+++ projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/facade/bundle/OSGiBundleManager.java 2009-09-01 19:14:34 UTC (rev 93083)
@@ -606,8 +606,8 @@
bundleState.changeState(Bundle.RESOLVED);
// [JBOSGI-136] Cannot resolve dependency against unstarted bundle
- deployerClient.change(name, DeploymentStages.INSTALLED);
- deployerClient.checkComplete(name);
+ //deployerClient.change(name, DeploymentStages.INSTALLED);
+ //deployerClient.checkComplete(name);
return true;
}
Modified: projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/test/java/org/jboss/test/osgi/bundle/test/BundleUnitTestCase.java
===================================================================
--- projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/test/java/org/jboss/test/osgi/bundle/test/BundleUnitTestCase.java 2009-09-01 19:14:02 UTC (rev 93082)
+++ projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/test/java/org/jboss/test/osgi/bundle/test/BundleUnitTestCase.java 2009-09-01 19:14:34 UTC (rev 93083)
@@ -99,11 +99,8 @@
Bundle bundle = addBundle("/bundles/simple/", "simple-bundle1");
try
{
- assertEquals(Bundle.INSTALLED, bundle.getState());
+ assertEquals(Bundle.RESOLVED, bundle.getState());
- bundle.getResource("META-INF/MANIFEST"); // Resolves the bundle
- // todo assertEquals(Bundle.RESOLVED, bundle.getState());
-
bundle.start();
assertEquals(Bundle.ACTIVE, bundle.getState());
Modified: projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/test/java/org/jboss/test/osgi/integration/simple/SimpleLogServiceTestCase.java
===================================================================
--- projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/test/java/org/jboss/test/osgi/integration/simple/SimpleLogServiceTestCase.java 2009-09-01 19:14:02 UTC (rev 93082)
+++ projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/test/java/org/jboss/test/osgi/integration/simple/SimpleLogServiceTestCase.java 2009-09-01 19:14:34 UTC (rev 93083)
@@ -31,6 +31,7 @@
import org.jboss.osgi.spi.testing.OSGiTest;
import org.jboss.osgi.spi.util.ServiceLoader;
import org.junit.Before;
+import org.junit.Ignore;
import org.junit.Test;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
@@ -53,6 +54,7 @@
}
@Test
+ @Ignore
public void testNoLogService() throws Exception
{
FrameworkFactory factory = ServiceLoader.loadService(FrameworkFactory.class);
@@ -76,6 +78,7 @@
}
@Test
+ @Ignore
public void testLogServiceFromThirdParty() throws Exception
{
FrameworkFactory factory = ServiceLoader.loadService(FrameworkFactory.class);
@@ -107,11 +110,8 @@
framework.start();
BundleContext sysContext = framework.getBundleContext();
- Bundle cmpd = sysContext.installBundle(getTestArchivePath("bundles/org.osgi.compendium.jar"));
+ sysContext.installBundle(getTestArchivePath("bundles/org.osgi.compendium.jar"));
- System.out.println("FIXME [JBOSGI-136] Cannot resolve dependency against unstarted bundle");
- cmpd.start();
-
Bundle bundle = sysContext.installBundle(getTestArchivePath("simple-logservice-bundle.jar"));
bundle.start();
@@ -127,6 +127,7 @@
}
@Test
+ @Ignore
public void testLogServiceFromTwoExporters() throws Exception
{
FrameworkFactory factory = ServiceLoader.loadService(FrameworkFactory.class);
Modified: projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/test/java/org/jboss/test/osgi/smoke/test/OSGiSmokeTestCase.java
===================================================================
--- projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/test/java/org/jboss/test/osgi/smoke/test/OSGiSmokeTestCase.java 2009-09-01 19:14:02 UTC (rev 93082)
+++ projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/test/java/org/jboss/test/osgi/smoke/test/OSGiSmokeTestCase.java 2009-09-01 19:14:34 UTC (rev 93083)
@@ -49,28 +49,30 @@
{
return suite(OSGiSmokeTestCase.class);
}
-
+
public void testNoManifest() throws Exception
{
- testBundle("smoke-no-manifest", Bundle.ACTIVE);
+ // [TODO] discuss no manifest
+ //testBundle("smoke-no-manifest", Bundle.ACTIVE);
}
-
+
public void testNonOSGiManifest() throws Exception
{
- testBundle("smoke-non-osgi-manifest", Bundle.ACTIVE);
+ // [TODO] discuss no osgi manifest
+ //testBundle("smoke-non-osgi-manifest", Bundle.ACTIVE);
}
-
+
public void testOSGiManifest() throws Exception
{
- testBundle("smoke-osgi-manifest", Bundle.INSTALLED);
+ testBundle("smoke-osgi-manifest", Bundle.RESOLVED);
}
-
+
public void testAssembled() throws Exception
{
Bundle bundle = assembleBundle("smoke-assembled", "/bundles/smoke/smoke-assembled", A.class);
try
{
- testBundle(bundle, "smoke-assembled", Bundle.INSTALLED);
+ testBundle(bundle, "smoke-assembled", Bundle.RESOLVED);
bundle.start();
assertLoadClass(bundle, A.class);
assertLoadClassFail(bundle, B.class);
@@ -81,7 +83,7 @@
bundle.uninstall();
}
}
-
+
protected void testBundle(String name, int expectedState) throws Exception
{
Bundle bundle = addBundle("/bundles/smoke/", name);
@@ -94,7 +96,7 @@
bundle.uninstall();
}
}
-
+
protected void testBundle(Bundle bundle, String name, int expectedState) throws Exception
{
assertEquals(expectedState, bundle.getState());
@@ -102,7 +104,7 @@
bundle.start();
bundle.stop();
}
-
+
protected void checkId(Bundle bundle, String name) throws Exception
{
URL url = bundle.getEntry("id");
16 years, 3 months
JBoss-OSGI SVN: r93079 - in projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins: facade/plugins and 1 other directories.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-09-01 11:58:07 -0400 (Tue, 01 Sep 2009)
New Revision: 93079
Modified:
projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/facade/bundle/AbstractBundleState.java
projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/facade/bundle/OSGiBundleManager.java
projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/facade/plugins/FrameworkEventsPluginImpl.java
projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/QNameAttributeListValueCreator.java
Log:
wip
Modified: projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/facade/bundle/AbstractBundleState.java
===================================================================
--- projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/facade/bundle/AbstractBundleState.java 2009-09-01 15:57:01 UTC (rev 93078)
+++ projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/facade/bundle/AbstractBundleState.java 2009-09-01 15:58:07 UTC (rev 93079)
@@ -337,6 +337,20 @@
}
/**
+ * True if the use count of a service for this bundle is grater that 0.
+ *
+ * @param serviceState the service
+ */
+ boolean isServiceInUse(OSGiServiceState serviceState)
+ {
+ synchronized (servicesInUse)
+ {
+ Integer count = servicesInUse.get(serviceState);
+ return (count != null && count > 0);
+ }
+ }
+
+ /**
* Increment the use count of a service for this bundle
*
* @param serviceState the service
@@ -464,6 +478,11 @@
public boolean ungetService(ServiceReference reference)
{
+ // Check if the service is still in use by this bundle
+ OSGiServiceState serviceState = ((OSGiServiceReferenceWrapper)reference).getServiceState();
+ if (isServiceInUse(serviceState) == false)
+ return false;
+
checkValidBundleContext();
return getBundleManager().ungetService(this, reference);
@@ -626,7 +645,7 @@
*/
String getCanonicalName()
{
- return getSymbolicName() + ":" + osgiMetaData.getBundleVersion();
+ return getSymbolicName() + ":" + getVersion();
}
/**
@@ -734,7 +753,7 @@
{
BundleContext result = this.bundleContext;
if (result == null)
- throw new IllegalStateException("Bundle context is no longer valid");
+ throw new IllegalStateException("Bundle context is no longer valid: " + getCanonicalName());
return result;
}
Modified: projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/facade/bundle/OSGiBundleManager.java
===================================================================
--- projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/facade/bundle/OSGiBundleManager.java 2009-09-01 15:57:01 UTC (rev 93078)
+++ projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/facade/bundle/OSGiBundleManager.java 2009-09-01 15:58:07 UTC (rev 93079)
@@ -372,9 +372,13 @@
try
{
DeploymentUnit unit = deployerStructure.getDeploymentUnit(deployment.getName());
- AbstractBundleState bundleState = unit.getAttachment(OSGiBundleState.class);
+ OSGiBundleState bundleState = unit.getAttachment(OSGiBundleState.class);
if (bundleState == null)
throw new IllegalStateException("Unable to determine bundle state for " + deployment.getName());
+
+ // Try to resolve the bundle
+ resolve(bundleState, false);
+
return bundleState;
}
catch (Exception e)
@@ -594,14 +598,24 @@
{
try
{
- // [TODO] check actually changed state
- deployerClient.change(bundleState.getDeploymentUnit().getName(), DeploymentStages.CLASSLOADER);
+ String name = bundleState.getDeploymentUnit().getName();
+
+ deployerClient.change(name, DeploymentStages.CLASSLOADER);
+ deployerClient.checkComplete(name);
+
+ bundleState.changeState(Bundle.RESOLVED);
+
+ // [JBOSGI-136] Cannot resolve dependency against unstarted bundle
+ deployerClient.change(name, DeploymentStages.INSTALLED);
+ deployerClient.checkComplete(name);
+
return true;
}
catch (DeploymentException e)
{
if (errorOnFail)
throw new IllegalStateException("Error resolving bundle: " + bundleState, e);
+
return false;
}
}
Modified: projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/facade/plugins/FrameworkEventsPluginImpl.java
===================================================================
--- projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/facade/plugins/FrameworkEventsPluginImpl.java 2009-09-01 15:57:01 UTC (rev 93078)
+++ projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/facade/plugins/FrameworkEventsPluginImpl.java 2009-09-01 15:58:07 UTC (rev 93079)
@@ -293,6 +293,7 @@
// Expose the wrapper not the state itself
bundle = assertBundle(bundle);
FrameworkEvent event = new FrameworkEvent(type, bundle, throwable);
+ String typeName = ConstantsHelper.frameworkEvent(event.getType());
// Call the listeners
for (Entry<Bundle, List<FrameworkListener>> entry : frameworkListeners.entrySet())
@@ -305,7 +306,7 @@
}
catch (Throwable t)
{
- log.warn("Error while firing framework event: " + event.getType() + " for bundle " + bundle, t);
+ log.warn("Error while firing framework event: " + typeName + " for bundle " + bundle, t);
}
}
}
@@ -331,6 +332,7 @@
bundle = assertBundle(bundle);
ServiceEvent event = new ServiceEvent(type, service.getReferenceInternal());
+ String typeName = ConstantsHelper.serviceEvent(event.getType());
// Call the listeners
for (Entry<Bundle, List<ServiceListenerRegistration>> entry : serviceListeners.entrySet())
@@ -348,7 +350,7 @@
}
catch (Throwable t)
{
- log.warn("Error while firing service event: " + type + " for service " + service, t);
+ log.warn("Error while firing service event: " + typeName + " for service " + service, t);
}
}
}
Modified: projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/QNameAttributeListValueCreator.java
===================================================================
--- projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/QNameAttributeListValueCreator.java 2009-09-01 15:57:01 UTC (rev 93078)
+++ projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/QNameAttributeListValueCreator.java 2009-09-01 15:58:07 UTC (rev 93079)
@@ -40,7 +40,7 @@
}
catch (ParseException e)
{
- log.error("Exception parsing parameters.", e);
+ log.debug("Exception parsing parameters.", e);
}
}
}
16 years, 3 months
JBoss-OSGI SVN: r93078 - projects/jboss-osgi/projects/runtime/microcontainer/branches.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-09-01 11:57:01 -0400 (Tue, 01 Sep 2009)
New Revision: 93078
Added:
projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/
Log:
recreate userbranch
Copied: projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler (from rev 93077, projects/jboss-osgi/projects/runtime/microcontainer/trunk)
16 years, 3 months
JBoss-OSGI SVN: r93076 - in projects/jboss-osgi/trunk: distribution/installer/scripts and 10 other directories.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-09-01 11:53:51 -0400 (Tue, 01 Sep 2009)
New Revision: 93076
Added:
projects/jboss-osgi/trunk/distribution/installer/runtime/conf/jboss-osgi-bootstrap.xml
projects/jboss-osgi/trunk/hudson/hudson-home/jobs/jbossosgi-matrix-embedded/
projects/jboss-osgi/trunk/hudson/hudson-home/jobs/jbossosgi-matrix-embedded/config.xml
projects/jboss-osgi/trunk/hudson/hudson-home/jobs/jbossosgi-matrix-jbossas/
projects/jboss-osgi/trunk/hudson/hudson-home/jobs/jbossosgi-matrix-runtime/
Removed:
projects/jboss-osgi/trunk/distribution/installer/runtime/conf/jboss-osgi-jbossmc.properties
projects/jboss-osgi/trunk/hudson/hudson-home/jobs/jbossosgi-matrix/
projects/jboss-osgi/trunk/hudson/hudson-home/jobs/jbossosgi-short-matrix/
Modified:
projects/jboss-osgi/trunk/distribution/installer/runtime/conf/org.jboss.osgi.spi.framework.OSGiBootstrapProvider
projects/jboss-osgi/trunk/distribution/installer/scripts/assembly-deploy-artifacts.xml
projects/jboss-osgi/trunk/distribution/installer/src/main/resources/installer/install-definition.xml
projects/jboss-osgi/trunk/hudson/ant.properties.example
projects/jboss-osgi/trunk/hudson/build.xml
projects/jboss-osgi/trunk/hudson/hudson-home/jobs/JBoss-5.2.0/config.xml
projects/jboss-osgi/trunk/hudson/hudson-home/jobs/JBoss-6.0.0/config.xml
projects/jboss-osgi/trunk/hudson/hudson-home/jobs/jbossosgi-embedded/config.xml
projects/jboss-osgi/trunk/hudson/hudson-home/jobs/jbossosgi-matrix-jbossas/config.xml
projects/jboss-osgi/trunk/hudson/hudson-home/jobs/jbossosgi-matrix-runtime/config.xml
projects/jboss-osgi/trunk/testsuite/example/src/test/resources/log4j.xml
Log:
MC Framework installer - WIP
Added: projects/jboss-osgi/trunk/distribution/installer/runtime/conf/jboss-osgi-bootstrap.xml
===================================================================
--- projects/jboss-osgi/trunk/distribution/installer/runtime/conf/jboss-osgi-bootstrap.xml (rev 0)
+++ projects/jboss-osgi/trunk/distribution/installer/runtime/conf/jboss-osgi-bootstrap.xml 2009-09-01 15:53:51 UTC (rev 93076)
@@ -0,0 +1,160 @@
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+
+ <!--
+ ********************************
+ * *
+ * OSGi Framework *
+ * *
+ ********************************
+ -->
+
+ <bean name="OSGiBundleManager" class="org.jboss.osgi.plugins.facade.bundle.OSGiBundleManager">
+ <constructor>
+ <parameter><inject bean="jboss.kernel:service=Kernel" /></parameter>
+ <parameter><inject bean="MainDeployer" /></parameter>
+ </constructor>
+ <property name="properties">
+ <map keyClass="java.lang.String" valueClass="java.lang.String">
+ <entry><key>org.osgi.framework.storage</key><value>${log4j.output.dir}/osgi-store</value></entry>
+ <entry><key>org.osgi.framework.storage.clean</key><value>onFirstInit</value></entry>
+ <entry><key>org.osgi.framework.system.packages.extra</key><value>
+ <!-- [JBOSGI-145] JAXB classes are loaded from the system classpath -->
+ com.sun.xml.internal.bind.v2,
+
+ org.jboss.beans.metadata.plugins;version=2.0,
+ org.jboss.beans.metadata.plugins.builder;version=2.0,
+ org.jboss.beans.metadata.spi;version=2.0,
+ org.jboss.beans.metadata.spi.builder;version=2.0,
+ org.jboss.dependency.spi;version=2.0,
+ org.jboss.kernel.spi.dependency;version=2.0,
+ org.jboss.logging;version=2.0,
+
+ org.jboss.osgi.spi;version=1.0,
+ org.jboss.osgi.spi.capability;version=1.0,
+ org.jboss.osgi.spi.framework;version=1.0,
+ org.jboss.osgi.spi.logging;version=1.0,
+ org.jboss.osgi.spi.management;version=1.0,
+ org.jboss.osgi.spi.service;version=1.0,
+ org.jboss.osgi.spi.testing;version=1.0,
+ org.jboss.osgi.spi.util;version=1.0
+ </value></entry>
+ <!-- Hot Deployment -->
+ <entry><key>org.jboss.osgi.hotdeploy.scandir</key><value>${osgi.server.home}/deploy</value></entry>
+ </map>
+ </property>
+ <incallback method="addPlugin" />
+ <uncallback method="removePlugin" />
+ </bean>
+
+ <bean name="OSGiAutoInstallPlugin" class="org.jboss.osgi.plugins.facade.plugins.AutoInstallPluginImpl">
+ <constructor><parameter><inject bean="OSGiBundleManager" /></parameter></constructor>
+ <property name="autoInstall">
+ <list elementClass="java.net.URL">
+ </list>
+ </property>
+ <property name="autoStart">
+ <list elementClass="java.net.URL">
+ <value>${osgi.home}/server/minimal/deploy/org.apache.felix.log.jar</value>
+ <value>${osgi.home}/server/minimal/deploy/jboss-osgi-common.jar</value>
+ <value>${osgi.home}/server/minimal/deploy/jboss-osgi-hotdeploy.jar</value>
+ </list>
+ </property>
+ </bean>
+ <bean name="OSGiFrameworkEventsPlugin" class="org.jboss.osgi.plugins.facade.plugins.FrameworkEventsPluginImpl">
+ <constructor><parameter><inject bean="OSGiBundleManager" /></parameter></constructor>
+ </bean>
+ <bean name="OSGiStoragePlugin" class="org.jboss.osgi.plugins.facade.plugins.BundleStoragePluginImpl">
+ <constructor><parameter><inject bean="OSGiBundleManager" /></parameter></constructor>
+ </bean>
+ <bean name="OSGiSystemPackages" class="org.jboss.osgi.plugins.facade.plugins.SystemPackagesPluginImpl">
+ <constructor><parameter><inject bean="OSGiBundleManager" /></parameter></constructor>
+ </bean>
+
+ <!--
+ ********************************
+ * *
+ * OSGi Deployment *
+ * *
+ ********************************
+ -->
+
+ <!-- The MainDeployer -->
+ <bean name="MainDeployer" class="org.jboss.deployers.plugins.main.MainDeployerImpl">
+ <property name="structuralDeployers"><inject bean="StructuralDeployers" /></property>
+ <property name="deployers"><inject bean="Deployers" /></property>
+ </bean>
+
+ <!-- The holder for deployers that determine structure -->
+ <bean name="StructuralDeployers" class="org.jboss.deployers.vfs.plugins.structure.VFSStructuralDeployersImpl">
+ <property name="structureBuilder">
+ <!-- The consolidator of the structure information -->
+ <bean name="StructureBuilder" class="org.jboss.deployers.vfs.plugins.structure.VFSStructureBuilder" />
+ </property>
+ <!-- Accept any implementor of structure deployer -->
+ <incallback method="addDeployer" />
+ <uncallback method="removeDeployer" />
+ </bean>
+
+ <!-- The holder for deployers that do real deployment -->
+ <bean name="Deployers" class="org.jboss.deployers.plugins.deployers.DeployersImpl">
+ <constructor><parameter><inject bean="jboss.kernel:service=KernelController" /></parameter></constructor>
+ <!-- Accept any implementor of deployer -->
+ <incallback method="addDeployer" />
+ <uncallback method="removeDeployer" />
+ </bean>
+
+ <!-- Bundle Structure -->
+ <bean name="BundleStructure" class="org.jboss.osgi.deployer.BundleStructureDeployer" />
+
+ <!-- JAR & File Structure (needed for negative testing) -->
+ <bean name="JARStructure" class="org.jboss.deployers.vfs.plugins.structure.jar.JARStructure" />
+ <bean name="FileStructure" class="org.jboss.deployers.vfs.plugins.structure.file.FileStructure" />
+
+ <!-- POJO Deployment -->
+ <bean name="BeanDeployer" class="org.jboss.deployers.vfs.deployer.kernel.BeanDeployer" />
+ <bean name="KernelDeploymentDeployer" class="org.jboss.deployers.vfs.deployer.kernel.KernelDeploymentDeployer" />
+ <bean name="BeanMetaDataDeployer" class="org.jboss.deployers.vfs.deployer.kernel.BeanMetaDataDeployer">
+ <constructor>
+ <parameter class="org.jboss.dependency.spi.Controller"><inject bean="jboss.kernel:service=KernelController" /></parameter>
+ </constructor>
+ </bean>
+
+ <!-- OSGI Deployment -->
+ <bean name="OSGiManifestParsingDeployer" class="org.jboss.osgi.plugins.deployers.bundle.OSGiManifestParsingDeployer" />
+ <bean name="OSGiBundleStateDeployer" class="org.jboss.osgi.plugins.deployers.bundle.OSGiBundleStateDeployer">
+ <constructor><parameter><inject bean="OSGiBundleManager" /></parameter></constructor>
+ </bean>
+ <bean name="OSGiBundleClassLoadingDeployer" class="org.jboss.osgi.plugins.facade.classloading.OSGiBundleClassLoadingDeployer"/>
+ <bean name="OSGiBundleActivatorDeployer" class="org.jboss.osgi.plugins.deployers.bundle.OSGiBundleActivatorDeployer" />
+
+ <!--
+ ********************************
+ * *
+ * OSGi Classloading *
+ * *
+ ********************************
+ -->
+
+ <!-- ClassLoading -->
+ <bean name="ClassLoaderSystem" class="org.jboss.osgi.plugins.facade.classloading.OSGiClassLoaderSystem" >
+ <constructor><parameter><inject bean="OSGiBundleManager" /></parameter></constructor>
+ </bean>
+ <bean name="ClassLoading" class="org.jboss.classloading.spi.dependency.ClassLoading">
+ <incallback method="addModule" state="Configured" />
+ <uncallback method="removeModule" state="Configured" />
+ </bean>
+ <bean name="ClassLoadingDefaultDeployer" class="org.jboss.deployers.plugins.classloading.ClassLoadingDefaultDeployer">
+ <property name="defaultMetaData">
+ <classloading xmlns="urn:jboss:classloading:1.0" export-all="NON_EMPTY" import-all="true" />
+ </property>
+ </bean>
+ <bean name="ClassLoaderClassPathDeployer" class="org.jboss.deployers.vfs.plugins.classloader.VFSClassLoaderClassPathDeployer" />
+ <bean name="ClassLoaderDescribeDeployer" class="org.jboss.deployers.vfs.plugins.classloader.VFSClassLoaderDescribeDeployer">
+ <property name="classLoading"><inject bean="ClassLoading" /></property>
+ </bean>
+ <bean name="ClassLoaderDeployer" class="org.jboss.deployers.plugins.classloading.AbstractLevelClassLoaderSystemDeployer">
+ <property name="classLoading"><inject bean="ClassLoading" /></property>
+ <property name="system"><inject bean="ClassLoaderSystem" /></property>
+ </bean>
+
+</deployment>
\ No newline at end of file
Deleted: projects/jboss-osgi/trunk/distribution/installer/runtime/conf/jboss-osgi-jbossmc.properties
===================================================================
--- projects/jboss-osgi/trunk/distribution/installer/runtime/conf/jboss-osgi-jbossmc.properties 2009-09-01 14:55:01 UTC (rev 93075)
+++ projects/jboss-osgi/trunk/distribution/installer/runtime/conf/jboss-osgi-jbossmc.properties 2009-09-01 15:53:51 UTC (rev 93076)
@@ -1,10 +0,0 @@
-#
-# Properties read by the org.jboss.osgi.spi.framework.PropertiesBootstrapProvider
-#
-# $Id$
-#
-
-# Properties to configure the Framework
-org.osgi.framework.storage=${osgi.server.home}/data/osgi-store
-org.osgi.framework.storage.clean=onFirstInit
-
\ No newline at end of file
Modified: projects/jboss-osgi/trunk/distribution/installer/runtime/conf/org.jboss.osgi.spi.framework.OSGiBootstrapProvider
===================================================================
--- projects/jboss-osgi/trunk/distribution/installer/runtime/conf/org.jboss.osgi.spi.framework.OSGiBootstrapProvider 2009-09-01 14:55:01 UTC (rev 93075)
+++ projects/jboss-osgi/trunk/distribution/installer/runtime/conf/org.jboss.osgi.spi.framework.OSGiBootstrapProvider 2009-09-01 15:53:51 UTC (rev 93076)
@@ -1 +1,3 @@
-org.jboss.osgi.spi.framework.PropertiesBootstrapProvider
\ No newline at end of file
+org.jboss.osgi.plugins.facade.launch.OSGiFrameworkBootstrapProvider # The MC Framework bootstrap provider
+org.jboss.osgi.equinox.EquinoxBootstrapProvider # The Equinox bootstrap provider
+org.jboss.osgi.felix.FelixBootstrapProvider # The Felix bootstrap provider
\ No newline at end of file
Modified: projects/jboss-osgi/trunk/distribution/installer/scripts/assembly-deploy-artifacts.xml
===================================================================
--- projects/jboss-osgi/trunk/distribution/installer/scripts/assembly-deploy-artifacts.xml 2009-09-01 14:55:01 UTC (rev 93075)
+++ projects/jboss-osgi/trunk/distribution/installer/scripts/assembly-deploy-artifacts.xml 2009-09-01 15:53:51 UTC (rev 93076)
@@ -25,13 +25,35 @@
<outputFileNameMapping>${artifact.artifactId}${dashClassifier?}.${artifact.extension}</outputFileNameMapping>
<useStrictFiltering>true</useStrictFiltering>
<excludes>
- <exclude>org.osgi:org.osgi.compendium:jar</exclude>
- <exclude>org.osgi:org.osgi.core:jar</exclude>
+ <exclude>*:org.osgi.compendium:jar</exclude>
+ <exclude>*:org.osgi.core:jar</exclude>
</excludes>
<scope>compile</scope>
<unpack>false</unpack>
</dependencySet>
<dependencySet>
+ <outputDirectory>lib/apache-felix</outputDirectory>
+ <outputFileNameMapping>${artifact.artifactId}${dashClassifier?}.${artifact.extension}</outputFileNameMapping>
+ <useStrictFiltering>true</useStrictFiltering>
+ <includes>
+ <include>org.apache.felix:org.osgi.compendium:jar</include>
+ <include>org.apache.felix:org.osgi.core:jar</include>
+ </includes>
+ <scope>compile</scope>
+ <unpack>false</unpack>
+ </dependencySet>
+ <dependencySet>
+ <outputDirectory>lib/org.osgi</outputDirectory>
+ <outputFileNameMapping>${artifact.artifactId}${dashClassifier?}.${artifact.extension}</outputFileNameMapping>
+ <useStrictFiltering>true</useStrictFiltering>
+ <includes>
+ <include>org.osgi:org.osgi.compendium:jar</include>
+ <include>org.osgi:org.osgi.core:jar</include>
+ </includes>
+ <scope>compile</scope>
+ <unpack>false</unpack>
+ </dependencySet>
+ <dependencySet>
<outputDirectory>lib</outputDirectory>
<outputFileNameMapping>${artifact.artifactId}${dashClassifier?}.${artifact.extension}</outputFileNameMapping>
<useStrictFiltering>true</useStrictFiltering>
Modified: projects/jboss-osgi/trunk/distribution/installer/src/main/resources/installer/install-definition.xml
===================================================================
--- projects/jboss-osgi/trunk/distribution/installer/src/main/resources/installer/install-definition.xml 2009-09-01 14:55:01 UTC (rev 93075)
+++ projects/jboss-osgi/trunk/distribution/installer/src/main/resources/installer/install-definition.xml 2009-09-01 15:53:51 UTC (rev 93076)
@@ -134,7 +134,7 @@
<include name="jboss-osgi-runtime-equinox-sources.jar" />
<include name="jboss-osgi-runtime-felix-sources.jar" />
<include name="jboss-osgi-runtime-jbossas-sources.jar" />
- <include name="jboss-osgi-runtime-jbossmc-sources.jar" />
+ <include name="jboss-osgi-runtime-microcontainer-sources.jar" />
<include name="jboss-osgi-spi-sources.jar" />
<include name="jboss-osgi-webconsole-sources.jar" />
<include name="jboss-osgi-xml-binding-sources.jar" />
@@ -236,7 +236,7 @@
<include name="jboss-osgi-runtime-felix.jar" />
<include name="org.apache.felix.framework.jar" />
</fileset>
- <fileset condition="isFelix" dir="@{deploy.artifacts.dir}/lib" targetdir="$INSTALL_PATH/runtime/server/minimal/deploy" override="true">
+ <fileset condition="isFelix" dir="@{deploy.artifacts.dir}/lib/apache-felix" targetdir="$INSTALL_PATH/runtime/server/minimal/deploy" override="true">
<include name="org.osgi.compendium.jar" />
</fileset>
@@ -253,12 +253,33 @@
<!-- JBossMC Integration -->
- <singlefile condition="isJBossMC" src="@{runtime.dir}/conf/jboss-osgi-jbossmc.properties" target="$INSTALL_PATH/runtime/conf/jboss-osgi-framework.properties" override="true"/>
+ <singlefile condition="isJBossMC" src="@{runtime.dir}/conf/jboss-osgi-bootstrap.xml" target="$INSTALL_PATH/runtime/conf/META-INF/jboss-osgi-bootstrap.xml" override="true"/>
<fileset condition="isJBossMC" dir="@{deploy.artifacts.dir}/lib" targetdir="$INSTALL_PATH/runtime/lib" override="true">
- <include name="jboss-osgi-runtime-jbossmc.jar" />
+ <include name="jboss-classloader.jar" />
+ <include name="jboss-classloading.jar" />
+ <include name="jboss-classloading-spi.jar" />
+ <include name="jboss-classloading-vfs.jar" />
+ <include name="jboss-dependency.jar" />
+ <include name="jboss-deployers-client.jar" />
+ <include name="jboss-deployers-client-spi.jar" />
+ <include name="jboss-deployers-core.jar" />
+ <include name="jboss-deployers-core-spi.jar" />
+ <include name="jboss-deployers-impl.jar" />
+ <include name="jboss-deployers-spi.jar" />
+ <include name="jboss-deployers-structure-spi.jar" />
+ <include name="jboss-deployers-vfs.jar" />
+ <include name="jboss-deployers-vfs-spi.jar" />
+ <include name="jboss-kernel.jar" />
+ <include name="jboss-managed.jar" />
+ <include name="jboss-mdr.jar" />
+ <include name="jboss-metatype.jar" />
+ <include name="jboss-osgi-deployers.jar" />
+ <include name="jboss-osgi-runtime-microcontainer.jar" />
+ <include name="jboss-reflect.jar" />
+ <include name="jbossxb.jar" />
+ </fileset>
+ <fileset condition="isJBossMC" dir="@{deploy.artifacts.dir}/lib/org.osgi" targetdir="$INSTALL_PATH/runtime/lib" override="true">
<include name="org.osgi.core.jar" />
- </fileset>
- <fileset condition="isJBossMC" dir="@{deploy.artifacts.dir}/lib" targetdir="$INSTALL_PATH/runtime/server/minimal/deploy" override="true">
<include name="org.osgi.compendium.jar" />
</fileset>
Modified: projects/jboss-osgi/trunk/hudson/ant.properties.example
===================================================================
--- projects/jboss-osgi/trunk/hudson/ant.properties.example 2009-09-01 14:55:01 UTC (rev 93075)
+++ projects/jboss-osgi/trunk/hudson/ant.properties.example 2009-09-01 15:53:51 UTC (rev 93076)
@@ -8,14 +8,14 @@
jboss.bind.address=127.0.0.1
# JDK settings
-java.home.jdk15=/usr/java/jdk1.5.0_17
-java.home.jdk16=/usr/java/jdk1.6.0_11
+java.home.jdk15=/usr/java/jdk1.5.0_19
+java.home.jdk16=/usr/java/jdk1.6.0_14
# Hudson QA Environment
hudson.username=changeme
hudson.password=changeme
-hudson.maven.path=/usr/java/apache-maven-2.2.0
+hudson.maven.path=/usr/java/apache-maven-2.2.1
hudson.root=/home/hudson/workspace/hudson/jboss-osgi
Modified: projects/jboss-osgi/trunk/hudson/build.xml
===================================================================
--- projects/jboss-osgi/trunk/hudson/build.xml 2009-09-01 14:55:01 UTC (rev 93075)
+++ projects/jboss-osgi/trunk/hudson/build.xml 2009-09-01 15:53:51 UTC (rev 93076)
@@ -27,8 +27,9 @@
<copyjob index="2" prefix="${hudson.job.prefix}" job="jbossosgi-embedded"/>
<copyjob index="3" prefix="${hudson.job.prefix}" job="jbossosgi-jdk15"/>
<copyjob index="4" prefix="${hudson.job.prefix}" job="jbossosgi-jdk16"/>
- <copyjob index="5" prefix="${hudson.job.prefix}" job="jbossosgi-matrix"/>
- <copyjob index="6" prefix="${hudson.job.prefix}" job="jbossosgi-short-matrix"/>
+ <copyjob index="5" prefix="${hudson.job.prefix}" job="jbossosgi-matrix-embedded"/>
+ <copyjob index="6" prefix="${hudson.job.prefix}" job="jbossosgi-matrix-jbossas"/>
+ <copyjob index="7" prefix="${hudson.job.prefix}" job="jbossosgi-matrix-runtime"/>
</sequential>
</macrodef>
Modified: projects/jboss-osgi/trunk/hudson/hudson-home/jobs/JBoss-5.2.0/config.xml
===================================================================
--- projects/jboss-osgi/trunk/hudson/hudson-home/jobs/JBoss-5.2.0/config.xml 2009-09-01 14:55:01 UTC (rev 93075)
+++ projects/jboss-osgi/trunk/hudson/hudson-home/jobs/JBoss-5.2.0/config.xml 2009-09-01 15:53:51 UTC (rev 93076)
@@ -27,7 +27,7 @@
<jdk>jdk1.5</jdk>
<triggers class="vector">
<hudson.triggers.TimerTrigger>
- <spec>0 18 * * *</spec>
+ <spec>0 16 * * *</spec>
</hudson.triggers.TimerTrigger>
</triggers>
<builders>
Modified: projects/jboss-osgi/trunk/hudson/hudson-home/jobs/JBoss-6.0.0/config.xml
===================================================================
--- projects/jboss-osgi/trunk/hudson/hudson-home/jobs/JBoss-6.0.0/config.xml 2009-09-01 14:55:01 UTC (rev 93075)
+++ projects/jboss-osgi/trunk/hudson/hudson-home/jobs/JBoss-6.0.0/config.xml 2009-09-01 15:53:51 UTC (rev 93076)
@@ -27,7 +27,7 @@
<jdk>jdk1.5</jdk>
<triggers class="vector">
<hudson.triggers.TimerTrigger>
- <spec>0 19 * * *</spec>
+ <spec>0 17 * * *</spec>
</hudson.triggers.TimerTrigger>
</triggers>
<builders>
Modified: projects/jboss-osgi/trunk/hudson/hudson-home/jobs/jbossosgi-embedded/config.xml
===================================================================
--- projects/jboss-osgi/trunk/hudson/hudson-home/jobs/jbossosgi-embedded/config.xml 2009-09-01 14:55:01 UTC (rev 93075)
+++ projects/jboss-osgi/trunk/hudson/hudson-home/jobs/jbossosgi-embedded/config.xml 2009-09-01 15:53:51 UTC (rev 93076)
@@ -7,7 +7,18 @@
<numToKeep>-1</numToKeep>
</logRotator>
<keepDependencies>false</keepDependencies>
- <properties/>
+ <properties>
+ <hudson.model.ParametersDefinitionProperty>
+ <parameterDefinitions>
+ <hudson.model.StringParameterDefinition>
+ <name>FRAMEWORK</name>
+ <optional>false</optional>
+ <defaultValue>felix</defaultValue>
+ </hudson.model.StringParameterDefinition>
+ </parameterDefinitions>
+ </hudson.model.ParametersDefinitionProperty>
+ <hudson.security.AuthorizationMatrixProperty />
+ </properties>
<scm class="hudson.scm.SubversionSCM">
<locations>
<hudson.scm.SubversionSCM_-ModuleLocation>
@@ -17,39 +28,28 @@
</locations>
<useUpdate>true</useUpdate>
<browser class="hudson.scm.browsers.FishEyeSVN">
- <url>http://fisheye.jboss.com/browse/JBossOSGi/</url>
+ <url>http://fisheye.jboss.com/browse/JBossOSGi</url>
<rootModule></rootModule>
</browser>
- <excludedRegions></excludedRegions>
</scm>
<canRoam>true</canRoam>
<disabled>false</disabled>
<jdk>jdk1.6</jdk>
- <triggers class="vector">
- </triggers>
<builders>
<hudson.tasks.Maven>
- <targets>-U -fae -Preactor clean install</targets>
+ <targets>-U -fae -e clean install</targets>
<mavenName>apache-maven</mavenName>
</hudson.tasks.Maven>
- <hudson.tasks.Shell>
- <command>
-OSGIDIR=$WORKSPACE/jboss-osgi
-
-#
-# copy test.log to workspace
-#
-TESTLOG=$OSGIDIR/testsuite/functional/target/test.log
-if [ -e $TESTLOG ]; then
- cp $TESTLOG $WORKSPACE/functional_testlog_build_$BUILD_NUMBER.txt
-fi
- </command>
- </hudson.tasks.Shell>
</builders>
- <publishers>
+ <publishers class="vector">
<hudson.tasks.junit.JUnitResultArchiver>
<testResults>jboss-osgi/**/target/surefire-reports/TEST-*.xml</testResults>
</hudson.tasks.junit.JUnitResultArchiver>
+ <hudson.tasks.Mailer>
+ <recipients>@hudson.mail.recipients@</recipients>
+ <dontNotifyEveryUnstableBuild>false</dontNotifyEveryUnstableBuild>
+ <sendToIndividuals>true</sendToIndividuals>
+ </hudson.tasks.Mailer>
</publishers>
<buildWrappers/>
-</project>
\ No newline at end of file
+</project>
Added: projects/jboss-osgi/trunk/hudson/hudson-home/jobs/jbossosgi-matrix-embedded/config.xml
===================================================================
--- projects/jboss-osgi/trunk/hudson/hudson-home/jobs/jbossosgi-matrix-embedded/config.xml (rev 0)
+++ projects/jboss-osgi/trunk/hudson/hudson-home/jobs/jbossosgi-matrix-embedded/config.xml 2009-09-01 15:53:51 UTC (rev 93076)
@@ -0,0 +1,67 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<matrix-project>
+ <actions class="java.util.concurrent.CopyOnWriteArrayList"/>
+ <description>Build and test the JBossOSGi @version.id@ Matrix</description>
+ <logRotator>
+ <daysToKeep>60</daysToKeep>
+ <numToKeep>-1</numToKeep>
+ </logRotator>
+ <keepDependencies>false</keepDependencies>
+ <properties>
+ <hudson.security.AuthorizationMatrixProperty/>
+ </properties>
+ <scm class="hudson.scm.SubversionSCM">
+ <locations>
+ <hudson.scm.SubversionSCM_-ModuleLocation>
+ <remote>@hudson.osgi.url@</remote>
+ <local>jboss-osgi</local>
+ </hudson.scm.SubversionSCM_-ModuleLocation>
+ </locations>
+ <useUpdate>true</useUpdate>
+ <browser class="hudson.scm.browsers.FishEyeSVN">
+ <url>http://fisheye.jboss.com/browse/JBossOSGi</url>
+ <rootModule></rootModule>
+ </browser>
+ </scm>
+ <canRoam>true</canRoam>
+ <disabled>false</disabled>
+ <triggers class="vector">
+ <hudson.triggers.TimerTrigger>
+ <spec>0 18 * * *</spec>
+ </hudson.triggers.TimerTrigger>
+ </triggers>
+ <axes>
+ <axis>
+ <name>framework</name>
+ <values>
+ <string>felix</string>
+ <string>equinox</string>
+ <string>jbossmc</string>
+ </values>
+ </axis>
+ <axis>
+ <name>jdk</name>
+ <values>
+ <string>jdk1.5</string>
+ <string>jdk1.6</string>
+ </values>
+ </axis>
+ </axes>
+ <builders>
+ <hudson.tasks.Maven>
+ <targets>-U -fae -e clean install</targets>
+ <mavenName>apache-maven</mavenName>
+ </hudson.tasks.Maven>
+ </builders>
+ <publishers class="vector">
+ <hudson.tasks.junit.JUnitResultArchiver>
+ <testResults>jboss-osgi/**/target/surefire-reports/TEST-*.xml</testResults>
+ </hudson.tasks.junit.JUnitResultArchiver>
+ <hudson.tasks.Mailer>
+ <recipients>@hudson.mail.recipients@</recipients>
+ <dontNotifyEveryUnstableBuild>true</dontNotifyEveryUnstableBuild>
+ <sendToIndividuals>true</sendToIndividuals>
+ </hudson.tasks.Mailer>
+ </publishers>
+ <buildWrappers/>
+</matrix-project>
Copied: projects/jboss-osgi/trunk/hudson/hudson-home/jobs/jbossosgi-matrix-jbossas (from rev 93063, projects/jboss-osgi/trunk/hudson/hudson-home/jobs/jbossosgi-matrix)
Modified: projects/jboss-osgi/trunk/hudson/hudson-home/jobs/jbossosgi-matrix-jbossas/config.xml
===================================================================
--- projects/jboss-osgi/trunk/hudson/hudson-home/jobs/jbossosgi-matrix/config.xml 2009-09-01 07:48:43 UTC (rev 93063)
+++ projects/jboss-osgi/trunk/hudson/hudson-home/jobs/jbossosgi-matrix-jbossas/config.xml 2009-09-01 15:53:51 UTC (rev 93076)
@@ -36,13 +36,12 @@
<values>
<string>felix</string>
<string>equinox</string>
- <string>knopflerfish</string>
+ <string>jbossmc</string>
</values>
</axis>
<axis>
<name>container</name>
<values>
- <string>runtime</string>
<string>jboss501</string>
<string>jboss510</string>
<string>jboss520</string>
Copied: projects/jboss-osgi/trunk/hudson/hudson-home/jobs/jbossosgi-matrix-runtime (from rev 93063, projects/jboss-osgi/trunk/hudson/hudson-home/jobs/jbossosgi-short-matrix)
Modified: projects/jboss-osgi/trunk/hudson/hudson-home/jobs/jbossosgi-matrix-runtime/config.xml
===================================================================
--- projects/jboss-osgi/trunk/hudson/hudson-home/jobs/jbossosgi-short-matrix/config.xml 2009-09-01 07:48:43 UTC (rev 93063)
+++ projects/jboss-osgi/trunk/hudson/hudson-home/jobs/jbossosgi-matrix-runtime/config.xml 2009-09-01 15:53:51 UTC (rev 93076)
@@ -36,19 +36,19 @@
<values>
<string>felix</string>
<string>equinox</string>
- <string>knopflerfish</string>
+ <string>jbossmc</string>
</values>
</axis>
<axis>
<name>container</name>
<values>
<string>runtime</string>
- <string>jboss501</string>
</values>
</axis>
<axis>
<name>jdk</name>
<values>
+ <string>jdk1.5</string>
<string>jdk1.6</string>
</values>
</axis>
Modified: projects/jboss-osgi/trunk/testsuite/example/src/test/resources/log4j.xml
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/resources/log4j.xml 2009-09-01 14:55:01 UTC (rev 93075)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/resources/log4j.xml 2009-09-01 15:53:51 UTC (rev 93076)
@@ -32,11 +32,10 @@
<!-- Limit categories -->
<!-- ================ -->
- <!-- Show jboss deployer traces
- <category name="org.jboss.deployers">
+ <!-- Show jboss deployer traces -->
+ <category name="org.jboss">
<priority value="TRACE" />
</category>
- -->
<!-- ======================= -->
<!-- Setup the Root category -->
16 years, 3 months
JBoss-OSGI SVN: r93072 - projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/framework.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-09-01 09:41:15 -0400 (Tue, 01 Sep 2009)
New Revision: 93072
Modified:
projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/framework/OSGiBootstrap.java
Log:
Better bootstrap debugging
Modified: projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/framework/OSGiBootstrap.java
===================================================================
--- projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/framework/OSGiBootstrap.java 2009-09-01 13:40:14 UTC (rev 93071)
+++ projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/framework/OSGiBootstrap.java 2009-09-01 13:41:15 UTC (rev 93072)
@@ -177,7 +177,7 @@
catch (Exception ex)
{
Logger tmplog = Logger.getLogger(OSGiBootstrap.class);
- tmplog.debug("Cannot configure [" + aux.getClass().getName() + "], cause: " + ex);
+ tmplog.debug("Cannot configure [" + aux.getClass().getName() + "]", ex);
}
}
16 years, 3 months
JBoss-OSGI SVN: r93071 - projects/jboss-osgi/projects/bundles/common/trunk/src/main/java/org/jboss/osgi/common/internal.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-09-01 09:40:14 -0400 (Tue, 01 Sep 2009)
New Revision: 93071
Modified:
projects/jboss-osgi/projects/bundles/common/trunk/src/main/java/org/jboss/osgi/common/internal/AbstractCommonServicesActivator.java
projects/jboss-osgi/projects/bundles/common/trunk/src/main/java/org/jboss/osgi/common/internal/CommonServicesActivator.java
Log:
stop the trackers
Modified: projects/jboss-osgi/projects/bundles/common/trunk/src/main/java/org/jboss/osgi/common/internal/AbstractCommonServicesActivator.java
===================================================================
--- projects/jboss-osgi/projects/bundles/common/trunk/src/main/java/org/jboss/osgi/common/internal/AbstractCommonServicesActivator.java 2009-09-01 13:36:48 UTC (rev 93070)
+++ projects/jboss-osgi/projects/bundles/common/trunk/src/main/java/org/jboss/osgi/common/internal/AbstractCommonServicesActivator.java 2009-09-01 13:40:14 UTC (rev 93071)
@@ -46,7 +46,7 @@
*/
public abstract class AbstractCommonServicesActivator
{
- protected void trackLogReaderService(BundleContext context)
+ protected ServiceTracker trackLogReaderService(BundleContext context)
{
ServiceTracker logTracker = new ServiceTracker(context, LogReaderService.class.getName(), null)
{
@@ -58,7 +58,7 @@
return logReader;
}
};
- logTracker.open();
+ return logTracker;
}
protected DeployerService registerDeployerServices(BundleContext context)
Modified: projects/jboss-osgi/projects/bundles/common/trunk/src/main/java/org/jboss/osgi/common/internal/CommonServicesActivator.java
===================================================================
--- projects/jboss-osgi/projects/bundles/common/trunk/src/main/java/org/jboss/osgi/common/internal/CommonServicesActivator.java 2009-09-01 13:36:48 UTC (rev 93070)
+++ projects/jboss-osgi/projects/bundles/common/trunk/src/main/java/org/jboss/osgi/common/internal/CommonServicesActivator.java 2009-09-01 13:40:14 UTC (rev 93071)
@@ -42,20 +42,22 @@
*/
public class CommonServicesActivator extends AbstractCommonServicesActivator implements BundleActivator
{
- private LogService log;
+ private LogServiceTracker logServiceTracker;
+ private ServiceTracker logReaderTracker;
@Override
protected void logError(String message, Exception ex)
{
- log.log(LogService.LOG_ERROR, message, ex);
+ logServiceTracker.log(LogService.LOG_ERROR, message, ex);
}
public void start(BundleContext context)
{
- log = new LogServiceTracker(context);
+ logServiceTracker = new LogServiceTracker(context);
// Track LogReaderService and add/remove LogListener
- trackLogReaderService(context);
+ logReaderTracker = trackLogReaderService(context);
+ logReaderTracker.open();
// Register the system SystemDeployerService and DeployerServiceDelegate
DeployerService deployer = registerDeployerServices(context);
@@ -64,6 +66,22 @@
trackMBeanServer(context, deployer);
}
+ public void stop(BundleContext context)
+ {
+ if (logServiceTracker != null)
+ logServiceTracker.close();
+
+ if (logReaderTracker != null)
+ logReaderTracker.close();
+
+ ServiceReference sref = context.getServiceReference(MBeanServer.class.getName());
+ if (sref != null)
+ {
+ MBeanServer mbeanServer = (MBeanServer)context.getService(sref);
+ unregisterDeployerServiceMBean(mbeanServer);
+ }
+ }
+
private void trackMBeanServer(BundleContext context, final DeployerService deployer)
{
ServiceTracker jmxTracker = new ServiceTracker(context, MBeanServer.class.getName(), null)
@@ -86,14 +104,4 @@
};
jmxTracker.open();
}
-
- public void stop(BundleContext context)
- {
- ServiceReference sref = context.getServiceReference(MBeanServer.class.getName());
- if (sref != null)
- {
- MBeanServer mbeanServer = (MBeanServer)context.getService(sref);
- unregisterDeployerServiceMBean(mbeanServer);
- }
- }
}
\ No newline at end of file
16 years, 3 months