JBoss-OSGI SVN: r96323 - in projects/jboss-osgi/trunk/testsuite/functional: src/test/java/org/jboss/test/osgi/jbosgi99 and 2 other directories.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-11-12 21:42:01 -0500 (Thu, 12 Nov 2009)
New Revision: 96323
Added:
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi99/bundle/
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi99/bundle/Activator99.java
projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi99/jbosgi99-dontfail.bnd
projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi99/jbosgi99-failonresolve.bnd
projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi99/jbosgi99-failonstart.bnd
Removed:
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi99/bundle/ActivatorBundleA.java
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi99/bundleA/
projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi99/jbosgi99-bundleA.bnd
Modified:
projects/jboss-osgi/trunk/testsuite/functional/scripts/antrun-test-jars.xml
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi99/OSGI99TestCase.java
Log:
[JBOSGI-99] No explicit control over bundle.start()
Add comprehensive test coverage
Modified: projects/jboss-osgi/trunk/testsuite/functional/scripts/antrun-test-jars.xml
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/scripts/antrun-test-jars.xml 2009-11-13 01:16:46 UTC (rev 96322)
+++ projects/jboss-osgi/trunk/testsuite/functional/scripts/antrun-test-jars.xml 2009-11-13 02:42:01 UTC (rev 96323)
@@ -100,7 +100,9 @@
<bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/jbosgi92-bundleA.jar" files="${tests.resources.dir}/jbosgi92/jbosgi92-bundleA.bnd" />
<!-- jbosgi99 -->
- <bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/jbosgi99-bundleA.jar" files="${tests.resources.dir}/jbosgi99/jbosgi99-bundleA.bnd" />
+ <bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/jbosgi99-dontfail.jar" files="${tests.resources.dir}/jbosgi99/jbosgi99-dontfail.bnd" />
+ <bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/jbosgi99-failonresolve.jar" files="${tests.resources.dir}/jbosgi99/jbosgi99-failonresolve.bnd" />
+ <bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/jbosgi99-failonstart.jar" files="${tests.resources.dir}/jbosgi99/jbosgi99-failonstart.bnd" />
<!-- jbosgi108 -->
<bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/jbosgi108-bundleA.jar" files="${tests.resources.dir}/jbosgi108/jbosgi108-bundleA.bnd" />
Modified: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi99/OSGI99TestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi99/OSGI99TestCase.java 2009-11-13 01:16:46 UTC (rev 96322)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi99/OSGI99TestCase.java 2009-11-13 02:42:01 UTC (rev 96323)
@@ -24,13 +24,17 @@
//$Id: OSGI39TestCase.java 87103 2009-04-09 22:18:31Z thomas.diesler(a)jboss.com $
import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.fail;
-import org.jboss.osgi.spi.capability.LogServiceCapability;
+import org.jboss.osgi.spi.util.ConstantsHelper;
import org.jboss.osgi.testing.OSGiBundle;
import org.jboss.osgi.testing.OSGiRuntime;
import org.jboss.osgi.testing.OSGiTestHelper;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
import org.junit.Test;
import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleException;
/**
* [JBOSGI-99] No explicit control over bundle.start()
@@ -42,25 +46,87 @@
*/
public class OSGI99TestCase
{
+ private static OSGiRuntime runtime;
+
+ @BeforeClass
+ public static void beforeClass()
+ {
+ runtime = new OSGiTestHelper().getDefaultRuntime();
+ }
+
+ @AfterClass
+ public static void afterClass()
+ {
+ if (runtime != null)
+ {
+ runtime.shutdown();
+ runtime = null;
+ }
+ }
+
@Test
- public void testInstallOnly() throws Exception
+ public void testDontFail() throws Exception
{
- OSGiRuntime runtime = new OSGiTestHelper().getDefaultRuntime();
+ OSGiBundle bundle = runtime.installBundle("jbosgi99-dontfail.jar");
+ assertBundleState(bundle, Bundle.INSTALLED);
+
+ bundle.start();
+ assertBundleState(bundle, Bundle.ACTIVE);
+
+ bundle.uninstall();
+
+ if (runtime.isRemoteRuntime() == false)
+ assertBundleState(bundle, Bundle.UNINSTALLED);
+ }
+
+ @Test
+ public void testFailOnResolve() throws Exception
+ {
+ OSGiBundle bundle = runtime.installBundle("jbosgi99-failonresolve.jar");
+ assertBundleState(bundle, Bundle.INSTALLED);
+
try
{
- runtime.addCapability(new LogServiceCapability());
+ bundle.start();
+ fail("BundleException expected");
+ }
+ catch (BundleException e)
+ {
+ assertBundleState(bundle, Bundle.INSTALLED);
+ }
+
+ bundle.uninstall();
- OSGiBundle bundleA = runtime.installBundle("jbosgi99-bundleA.jar");
- assertEquals("Bundle installed", Bundle.INSTALLED, bundleA.getState());
+ if (runtime.isRemoteRuntime() == false)
+ assertBundleState(bundle, Bundle.UNINSTALLED);
+ }
- bundleA.start();
- assertEquals("Bundle active", Bundle.ACTIVE, bundleA.getState());
+ @Test
+ public void testFailOnStart() throws Exception
+ {
+ OSGiBundle bundle = runtime.installBundle("jbosgi99-failonstart.jar");
+ assertBundleState(bundle, Bundle.INSTALLED);
- bundleA.uninstall();
+ try
+ {
+ bundle.start();
+ fail("BundleException expected");
}
- finally
+ catch (BundleException e)
{
- runtime.shutdown();
+ assertBundleState(bundle, Bundle.RESOLVED);
}
+
+ bundle.uninstall();
+
+ if (runtime.isRemoteRuntime() == false)
+ assertBundleState(bundle, Bundle.UNINSTALLED);
}
+
+ private void assertBundleState(OSGiBundle bundle, int expState)
+ {
+ String exp = ConstantsHelper.bundleState(expState);
+ String was = ConstantsHelper.bundleState(bundle.getState());
+ assertEquals("Bundle " + exp, exp, was);
+ }
}
\ No newline at end of file
Copied: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi99/bundle (from rev 96307, projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi99/bundleA)
Copied: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi99/bundle/Activator99.java (from rev 96307, projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi99/bundleA/ActivatorBundleA.java)
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi99/bundle/Activator99.java (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi99/bundle/Activator99.java 2009-11-13 02:42:01 UTC (rev 96323)
@@ -0,0 +1,39 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.osgi.jbosgi99.bundle;
+
+//$Id: ServiceActivator.java 87064 2009-04-09 11:08:56Z thomas.diesler(a)jboss.com $
+
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+
+public class Activator99 implements BundleActivator
+{
+ public void start(BundleContext context)
+ {
+ throw new IllegalStateException("Fail on start");
+ }
+
+ public void stop(BundleContext context)
+ {
+ }
+}
\ No newline at end of file
Deleted: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi99/bundle/ActivatorBundleA.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi99/bundleA/ActivatorBundleA.java 2009-11-12 14:01:14 UTC (rev 96307)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi99/bundle/ActivatorBundleA.java 2009-11-13 02:42:01 UTC (rev 96323)
@@ -1,50 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.test.osgi.jbosgi99.bundleA;
-
-//$Id: ServiceActivator.java 87064 2009-04-09 11:08:56Z thomas.diesler(a)jboss.com $
-
-import org.osgi.framework.BundleActivator;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.ServiceReference;
-import org.osgi.service.log.LogService;
-
-public class ActivatorBundleA implements BundleActivator
-{
- private LogService log;
-
- public void start(BundleContext context)
- {
- ServiceReference sref = context.getServiceReference(LogService.class.getName());
- if (sref != null)
- {
- log = (LogService)context.getService(sref);
- log.log(LogService.LOG_INFO, "ActivatorBundleA.start()");
- }
- }
-
- public void stop(BundleContext context)
- {
- if (log != null)
- log.log(LogService.LOG_INFO, "ActivatorBundleA.stop()");
- }
-}
\ No newline at end of file
Deleted: projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi99/jbosgi99-bundleA.bnd
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi99/jbosgi99-bundleA.bnd 2009-11-13 01:16:46 UTC (rev 96322)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi99/jbosgi99-bundleA.bnd 2009-11-13 02:42:01 UTC (rev 96323)
@@ -1,6 +0,0 @@
-# bnd build -classpath target/test-classes -output target/test-libs/jbosgi99-bundleA.jar src/test/resources/jbosgi99/jbosgi99-bundleA.bnd
-
-Bundle-SymbolicName: jbosgi99-bundleA
-Bundle-Activator: org.jboss.test.osgi.jbosgi99.bundleA.ActivatorBundleA
-Export-Package: org.jboss.test.osgi.jbosgi99.bundleA
-
Copied: projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi99/jbosgi99-dontfail.bnd (from rev 96307, projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi99/jbosgi99-bundleA.bnd)
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi99/jbosgi99-dontfail.bnd (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi99/jbosgi99-dontfail.bnd 2009-11-13 02:42:01 UTC (rev 96323)
@@ -0,0 +1,5 @@
+# bnd build -classpath target/test-classes -output target/test-libs/jbosgi99-bundleA.jar src/test/resources/jbosgi99/jbosgi99-bundleA.bnd
+
+Bundle-SymbolicName: jbosgi99-dontfail
+Export-Package: org.jboss.test.osgi.jbosgi99.bundle
+
Added: projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi99/jbosgi99-failonresolve.bnd
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi99/jbosgi99-failonresolve.bnd (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi99/jbosgi99-failonresolve.bnd 2009-11-13 02:42:01 UTC (rev 96323)
@@ -0,0 +1,6 @@
+# bnd build -classpath target/test-classes -output target/test-libs/jbosgi99-bundleA.jar src/test/resources/jbosgi99/jbosgi99-bundleA.bnd
+
+Bundle-SymbolicName: jbosgi99-failonresolve
+Export-Package: org.jboss.test.osgi.jbosgi99.bundle
+Import-Package: org.osgi.framework, org.jboss.test.osgi.jbosgi99.package.does.not.exist
+
Added: projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi99/jbosgi99-failonstart.bnd
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi99/jbosgi99-failonstart.bnd (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi99/jbosgi99-failonstart.bnd 2009-11-13 02:42:01 UTC (rev 96323)
@@ -0,0 +1,6 @@
+# bnd build -classpath target/test-classes -output target/test-libs/jbosgi99-bundleA.jar src/test/resources/jbosgi99/jbosgi99-bundleA.bnd
+
+Bundle-SymbolicName: jbosgi99-failonstart
+Bundle-Activator: org.jboss.test.osgi.jbosgi99.bundle.Activator99
+Private-Package: org.jboss.test.osgi.jbosgi99.bundle
+
14 years, 8 months
JBoss-OSGI SVN: r96322 - projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/service/internal.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-11-12 20:16:46 -0500 (Thu, 12 Nov 2009)
New Revision: 96322
Modified:
projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/service/internal/DeployerServiceImpl.java
Log:
Framework's DeployerService delegates to SystemDeployerService which respects autoStart on the Deployment
Modified: projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/service/internal/DeployerServiceImpl.java
===================================================================
--- projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/service/internal/DeployerServiceImpl.java 2009-11-13 00:59:34 UTC (rev 96321)
+++ projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/service/internal/DeployerServiceImpl.java 2009-11-13 01:16:46 UTC (rev 96322)
@@ -39,7 +39,6 @@
import org.jboss.virtual.VirtualFile;
import org.osgi.framework.BundleContext;
import org.osgi.framework.BundleException;
-import org.osgi.framework.ServiceReference;
/**
* A plugin that manages bundle deployments.
@@ -94,20 +93,12 @@
public void deploy(Deployment[] bundleDeps) throws BundleException
{
- DeploymentRegistryService registry = getDeploymentRegistry();
- for (Deployment dep : bundleDeps)
- {
- getBundleManager().installBundle(dep);
- registry.registerDeployment(dep);
- }
+ delegate.deploy(bundleDeps);
}
public void deploy(URL url) throws BundleException
{
- DeploymentRegistryService registry = getDeploymentRegistry();
- Deployment dep = createDeployment(url);
- getBundleManager().installBundle(dep);
- registry.registerDeployment(dep);
+ delegate.deploy(url);
}
public void undeploy(Deployment[] bundleDeps) throws BundleException
@@ -119,14 +110,4 @@
{
delegate.undeploy(url);
}
-
- private DeploymentRegistryService getDeploymentRegistry()
- {
- BundleContext context = getSystemContext();
- ServiceReference sref = context.getServiceReference(DeploymentRegistryService.class.getName());
- if (sref == null)
- throw new IllegalStateException("Cannot obtain DeploymentRegistryService");
-
- return (DeploymentRegistryService)context.getService(sref);
- }
}
\ No newline at end of file
14 years, 8 months
JBoss-OSGI SVN: r96321 - projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/webapp.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-11-12 19:59:34 -0500 (Thu, 12 Nov 2009)
New Revision: 96321
Modified:
projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/webapp/WebAppNegativeTestCase.java
Log:
[JBOSGI-204] Failure in Bundle.start() uninstalls the bundle in AS
Modified: projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/webapp/WebAppNegativeTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/webapp/WebAppNegativeTestCase.java 2009-11-13 00:49:24 UTC (rev 96320)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/webapp/WebAppNegativeTestCase.java 2009-11-13 00:59:34 UTC (rev 96321)
@@ -34,6 +34,7 @@
import org.jboss.osgi.webapp.WebAppCapability;
import org.junit.AfterClass;
import org.junit.BeforeClass;
+import org.junit.Ignore;
import org.junit.Test;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleException;
@@ -44,6 +45,7 @@
* @author thomas.diesler(a)jboss.com
* @since 26-Oct-2009
*/
+@Ignore("[JBOSGI-204] Failure in Bundle.start() uninstalls the bundle in AS")
public class WebAppNegativeTestCase extends AbstractWebAppTestCase
{
private static OSGiRuntime runtime;
14 years, 8 months
JBoss-OSGI SVN: r96320 - in projects/jboss-osgi: projects/spi/trunk/src/main/java/org/jboss/osgi/spi/util and 8 other directories.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-11-12 19:49:24 -0500 (Thu, 12 Nov 2009)
New Revision: 96320
Added:
projects/jboss-osgi/trunk/reactor/deployment/scripts/
projects/jboss-osgi/trunk/reactor/deployment/scripts/antrun-test-jars.xml
projects/jboss-osgi/trunk/reactor/deployment/src/test/java/org/jboss/test/osgi/deployment/simple/
projects/jboss-osgi/trunk/reactor/deployment/src/test/java/org/jboss/test/osgi/deployment/simple/DeploymentSerializationTestCase.java
projects/jboss-osgi/trunk/reactor/deployment/src/test/resources/
projects/jboss-osgi/trunk/reactor/deployment/src/test/resources/log4j.xml
projects/jboss-osgi/trunk/reactor/deployment/src/test/resources/simple/
projects/jboss-osgi/trunk/reactor/deployment/src/test/resources/simple/simple.bnd
Modified:
projects/jboss-osgi/projects/bundles/husky/trunk/harness/src/main/java/org/jboss/osgi/testing/internal/OSGiRuntimeImpl.java
projects/jboss-osgi/projects/bundles/husky/trunk/harness/src/main/java/org/jboss/osgi/testing/internal/RemoteRuntime.java
projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/util/BundleInfo.java
projects/jboss-osgi/trunk/reactor/deployment/.classpath
projects/jboss-osgi/trunk/reactor/deployment/pom.xml
projects/jboss-osgi/trunk/reactor/deployment/src/main/java/org/jboss/osgi/deployment/internal/DeploymentImpl.java
Log:
Husky remote test client uses serializable Deployment to explicitly control autoStart behaviour.
So far this relied on the default autoStart value when constructed on the server side.
Modified: projects/jboss-osgi/projects/bundles/husky/trunk/harness/src/main/java/org/jboss/osgi/testing/internal/OSGiRuntimeImpl.java
===================================================================
--- projects/jboss-osgi/projects/bundles/husky/trunk/harness/src/main/java/org/jboss/osgi/testing/internal/OSGiRuntimeImpl.java 2009-11-12 23:46:59 UTC (rev 96319)
+++ projects/jboss-osgi/projects/bundles/husky/trunk/harness/src/main/java/org/jboss/osgi/testing/internal/OSGiRuntimeImpl.java 2009-11-13 00:49:24 UTC (rev 96320)
@@ -36,10 +36,14 @@
import java.util.jar.JarFile;
import java.util.jar.Manifest;
+import javax.management.MBeanException;
import javax.management.ObjectName;
import javax.naming.InitialContext;
import javax.naming.NamingException;
+import org.jboss.osgi.deployment.deployer.AbstractDeployerService;
+import org.jboss.osgi.deployment.deployer.DeployerService;
+import org.jboss.osgi.deployment.deployer.Deployment;
import org.jboss.osgi.spi.capability.Capability;
import org.jboss.osgi.testing.OSGiBundle;
import org.jboss.osgi.testing.OSGiRuntime;
@@ -84,12 +88,12 @@
addCapability(dependency);
OSGiServiceReference[] srefs = null;
-
+
// Check if the service provided by the capability exists already
String serviceName = capability.getServiceName();
if (serviceName != null)
srefs = getServiceReferences(serviceName, capability.getFilter());
-
+
if (srefs == null || srefs.length == 0)
{
log.debug("Add capability: " + capability);
@@ -143,7 +147,7 @@
// Uninstall the registered bundles
ArrayList<String> locations = new ArrayList<String>(bundles.keySet());
Collections.reverse(locations);
-
+
while (locations.size() > 0)
{
String location = locations.remove(0);
@@ -164,21 +168,17 @@
protected void deploy(String location) throws Exception
{
URL archiveURL = getTestHelper().getTestArchiveURL(location);
- invokeDeployerService("deploy", archiveURL);
+ DeployerServiceClient deployer = new DeployerServiceClient(DeployerService.MBEAN_DEPLOYER_SERVICE);
+ deployer.deploy(archiveURL);
}
protected void undeploy(String location) throws Exception
{
URL archiveURL = getTestHelper().getTestArchiveURL(location);
- invokeDeployerService("undeploy", archiveURL);
+ DeployerServiceClient deployer = new DeployerServiceClient(DeployerService.MBEAN_DEPLOYER_SERVICE);
+ deployer.undeploy(archiveURL);
}
- protected void invokeDeployerService(String method, URL archiveURL) throws Exception
- {
- ObjectName oname = new ObjectName("jboss.osgi:service=DeployerService");
- getMBeanServer().invoke(oname, method, new Object[] { archiveURL }, new String[] { URL.class.getName() });
- }
-
public InitialContext getInitialContext() throws NamingException
{
return helper.getInitialContext();
@@ -198,9 +198,9 @@
public OSGiServiceReference getServiceReference(String clazz, long timeout)
{
int fraktion = 200;
- timeout = timeout/fraktion;
+ timeout = timeout / fraktion;
OSGiServiceReference sref = getServiceReference(clazz);
- while (sref == null && 0 < timeout--)
+ while (sref == null && 0 < timeout--)
{
try
{
@@ -214,7 +214,7 @@
}
return sref;
}
-
+
protected OSGiBundle getBundle(String symbolicName, Version version, boolean mustExist)
{
OSGiBundle bundle = null;
@@ -230,13 +230,13 @@
}
}
}
-
+
if (bundle == null && mustExist == true)
throw new IllegalStateException("Cannot obtain bundle: " + symbolicName + "-" + version + ". We have " + bundles);
-
+
return bundle;
}
-
+
protected String getManifestEntry(String location, String key)
{
Manifest manifest = getManifest(location);
@@ -267,7 +267,7 @@
{
if (bundle == null)
throw new IllegalArgumentException("Cannot register null bundle for: " + location);
-
+
bundles.put(location, bundle);
return bundle;
}
@@ -276,7 +276,7 @@
{
if (bundle == null)
throw new IllegalArgumentException("Cannot unregister null bundle");
-
+
if (bundles.containsValue(bundle))
{
Set<Entry<String, OSGiBundle>> entrySet = bundles.entrySet();
@@ -307,4 +307,58 @@
}
}
}
+
+ class DeployerServiceClient extends AbstractDeployerService
+ {
+ private ObjectName oname;
+
+ DeployerServiceClient(ObjectName oname)
+ {
+ this.oname = oname;
+ }
+
+ public void deploy(Deployment[] bundleDeps) throws BundleException
+ {
+ invokeDeployerMBean(oname, "deploy", bundleDeps, Deployment[].class.getName());
+ }
+
+ public void deploy(URL url) throws BundleException
+ {
+ invokeDeployerMBean(oname, "deploy", url, URL.class.getName());
+ }
+
+ public void undeploy(Deployment[] bundleDeps) throws BundleException
+ {
+ invokeDeployerMBean(oname, "undeploy", bundleDeps, Deployment[].class.getName());
+ }
+
+ public void undeploy(URL url) throws BundleException
+ {
+ invokeDeployerMBean(oname, "undeploy", url, URL.class.getName());
+ }
+
+ private void invokeDeployerMBean(ObjectName oname, String method, Object arg, String type) throws BundleException
+ {
+ try
+ {
+ getMBeanServer().invoke(oname, method, new Object[] { arg }, new String[] { type });
+ }
+ catch (RuntimeException rte)
+ {
+ throw rte;
+ }
+ catch (MBeanException ex)
+ {
+ Exception target = ex.getTargetException();
+ if (target instanceof BundleException)
+ throw (BundleException)target;
+
+ throw new BundleException("Cannot " + method + ": " + arg, target);
+ }
+ catch (Exception ex)
+ {
+ throw new BundleException("Cannot " + method + ": " + arg, ex);
+ }
+ }
+ }
}
Modified: projects/jboss-osgi/projects/bundles/husky/trunk/harness/src/main/java/org/jboss/osgi/testing/internal/RemoteRuntime.java
===================================================================
--- projects/jboss-osgi/projects/bundles/husky/trunk/harness/src/main/java/org/jboss/osgi/testing/internal/RemoteRuntime.java 2009-11-12 23:46:59 UTC (rev 96319)
+++ projects/jboss-osgi/projects/bundles/husky/trunk/harness/src/main/java/org/jboss/osgi/testing/internal/RemoteRuntime.java 2009-11-13 00:49:24 UTC (rev 96320)
@@ -27,12 +27,14 @@
import java.util.HashSet;
import java.util.Set;
-import javax.management.MBeanException;
import javax.management.MBeanServerConnection;
+import javax.management.MalformedObjectNameException;
import javax.management.ObjectName;
import javax.naming.InitialContext;
import javax.naming.NamingException;
+import org.jboss.osgi.deployment.deployer.DeployerService;
+import org.jboss.osgi.deployment.deployer.Deployment;
import org.jboss.osgi.spi.management.MBeanProxy;
import org.jboss.osgi.spi.management.MBeanProxyException;
import org.jboss.osgi.spi.management.ManagedBundleMBean;
@@ -66,13 +68,21 @@
{
try
{
+ // Get the bundle info from the location
URL bundleURL = getTestHelper().getTestArchiveURL(location);
- BundleInfo bundleInfo = BundleInfo.createBundleInfo(bundleURL);
- String symbolicName = bundleInfo.getSymbolicName();
- String version = bundleInfo.getVersion().toString();
+ BundleInfo info = BundleInfo.createBundleInfo(bundleURL);
- deployInternal(location, true);
+ // Create the deployment from the info
+ DeployerServiceClient deployer = new DeployerServiceClient(DeployerService.MBEAN_DEPLOYER_SERVICE);
+ Deployment dep = deployer.createDeployment(info);
+ dep.setAutoStart(false);
+
+ // Deploy the deployemnt through the DeployerService
+ deployer.deploy(new Deployment[] { dep });
+ String symbolicName = info.getSymbolicName();
+ String version = info.getVersion().toString();
+
// The remote framework uses a BundleTracker that works of an asynchronous
// event to register the installed bundle. It is not available immediately.
int timeout = 50;
@@ -92,13 +102,9 @@
{
throw rte;
}
- catch (MBeanException ex)
+ catch (BundleException ex)
{
- Exception target = ex.getTargetException();
- if (target instanceof BundleException)
- throw (BundleException)target;
-
- throw new BundleException("Cannot install: " + location, target);
+ throw ex;
}
catch (Exception ex)
{
@@ -108,41 +114,20 @@
public void deploy(String location) throws Exception
{
- deployInternal(location, false);
- }
-
- private void deployInternal(String location, boolean isBundle) throws Exception
- {
URL archiveURL = getTestHelper().getTestArchiveURL(location);
- if (isBundle)
- invokeDeployerService("deploy", archiveURL);
- else
- invokeMainDeployer("deploy", archiveURL);
+ ObjectName oname = getDeployerServiceName(archiveURL);
+ DeployerServiceClient deployer = new DeployerServiceClient(oname);
+ deployer.deploy(archiveURL);
}
public void undeploy(String location) throws Exception
{
URL archiveURL = getTestHelper().getTestArchiveURL(location);
- if (isBundleArchive(location))
- invokeDeployerService("undeploy", archiveURL);
- else
- invokeMainDeployer("undeploy", archiveURL);
+ ObjectName oname = getDeployerServiceName(archiveURL);
+ DeployerServiceClient deployer = new DeployerServiceClient(oname);
+ deployer.undeploy(archiveURL);
}
- private boolean isBundleArchive(String location)
- {
- try
- {
- URL archiveURL = getTestHelper().getTestArchiveURL(location);
- BundleInfo.createBundleInfo(archiveURL);
- return true;
- }
- catch (RuntimeException ex)
- {
- return false;
- }
- }
-
public OSGiBundle[] getBundles()
{
try
@@ -298,9 +283,22 @@
};
}
- private void invokeMainDeployer(String method, URL archiveURL) throws Exception
+ /**
+ * Return ObjectName of the DeployerService MBean if hte archive is a bundle
+ * otherwise if returns the ObjectName of the MainDeployer
+ */
+ private ObjectName getDeployerServiceName(URL archiveURL) throws MalformedObjectNameException
{
- ObjectName oname = new ObjectName("jboss.system:service=MainDeployer");
- getMBeanServer().invoke(oname, method, new Object[] { archiveURL }, new String[] { URL.class.getName() });
+ ObjectName oname;
+ try
+ {
+ BundleInfo.createBundleInfo(archiveURL);
+ oname = DeployerService.MBEAN_DEPLOYER_SERVICE;
+ }
+ catch (Exception e)
+ {
+ oname = new ObjectName("jboss.system:service=MainDeployer");
+ }
+ return oname;
}
}
Modified: projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/util/BundleInfo.java
===================================================================
--- projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/util/BundleInfo.java 2009-11-12 23:46:59 UTC (rev 96319)
+++ projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/util/BundleInfo.java 2009-11-13 00:49:24 UTC (rev 96320)
@@ -25,6 +25,7 @@
import java.io.File;
import java.io.IOException;
+import java.io.Serializable;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.jar.Attributes;
@@ -42,13 +43,16 @@
* @author thomas.diesler(a)jboss.com
* @since 16-Oct-2009
*/
-public class BundleInfo
+public class BundleInfo implements Serializable
{
+ private static final long serialVersionUID = 2196462922955338109L;
+
private VirtualFile root;
private String location;
- private Manifest manifest;
private String symbolicName;
- private Version version;
+ private String version;
+
+ private transient Manifest manifest;
public static BundleInfo createBundleInfo(String location)
{
@@ -146,30 +150,20 @@
}
this.location = location;
- // Get the Manifest
- try
- {
- manifest = VFSUtils.getManifest(root);
- }
- catch (Exception ex)
- {
- throw new IllegalArgumentException("Cannot get manifest from: " + root, ex);
- }
-
symbolicName = getManifestHeader(Constants.BUNDLE_SYMBOLICNAME);
if (symbolicName == null)
throw new IllegalArgumentException("Cannot obtain Bundle-SymbolicName for: " + root);
- String versionStr = getManifestHeader(Constants.BUNDLE_VERSION);
- version = Version.parseVersion(versionStr);
+ version = getManifestHeader(Constants.BUNDLE_VERSION);
+ version = Version.parseVersion(version).toString();
}
-
+
/**
* Get the manifest header for the given key.
*/
public String getManifestHeader(String key)
{
- Attributes attribs = manifest.getMainAttributes();
+ Attributes attribs = getManifest().getMainAttributes();
String value = attribs.getValue(key);
return value;
}
@@ -203,9 +197,30 @@
*/
public Version getVersion()
{
- return version;
+ return Version.parseVersion(version);
}
+ private Manifest getManifest()
+ {
+ if (manifest == null)
+ {
+ try
+ {
+ manifest = VFSUtils.getManifest(root);
+ }
+ catch (Exception ex)
+ {
+ throw new IllegalArgumentException("Cannot get manifest from: " + root, ex);
+ }
+ }
+ return manifest;
+ }
+
+ private String toEqualString()
+ {
+ return "[" + symbolicName + "-" + version + ",url=" + location + "]";
+ }
+
@Override
public boolean equals(Object obj)
{
@@ -213,18 +228,18 @@
return false;
BundleInfo other = (BundleInfo)obj;
- return root.equals(other.root);
+ return toEqualString().equals(other.toEqualString());
}
@Override
public int hashCode()
{
- return toString().hashCode();
+ return toEqualString().hashCode();
}
@Override
public String toString()
{
- return "[" + symbolicName + "-" + version + ",url=" + root + "]";
+ return toEqualString();
}
}
\ No newline at end of file
Modified: projects/jboss-osgi/trunk/reactor/deployment/.classpath
===================================================================
--- projects/jboss-osgi/trunk/reactor/deployment/.classpath 2009-11-12 23:46:59 UTC (rev 96319)
+++ projects/jboss-osgi/trunk/reactor/deployment/.classpath 2009-11-13 00:49:24 UTC (rev 96320)
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="target/classes" path="src/main/java"/>
+ <classpathentry kind="src" output="target/test-classes" path="src/test/resources"/>
<classpathentry kind="src" output="target/test-classes" path="src/test/java"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
<classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
Modified: projects/jboss-osgi/trunk/reactor/deployment/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/reactor/deployment/pom.xml 2009-11-12 23:46:59 UTC (rev 96319)
+++ projects/jboss-osgi/trunk/reactor/deployment/pom.xml 2009-11-13 00:49:24 UTC (rev 96320)
@@ -36,6 +36,10 @@
<!-- Dependencies -->
<dependencies>
<dependency>
+ <groupId>biz.aQute</groupId>
+ <artifactId>bnd</artifactId>
+ </dependency>
+ <dependency>
<groupId>org.jboss.osgi</groupId>
<artifactId>jboss-osgi-spi</artifactId>
</dependency>
@@ -96,6 +100,25 @@
</execution>
</executions>
</plugin>
+ <plugin>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>build-test-jars</id>
+ <phase>test-compile</phase>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ <configuration>
+ <tasks>
+ <property name="maven.runtime.classpath" refid="maven.runtime.classpath" />
+ <property name="tests.output.dir" value="${project.build.directory}" />
+ <ant antfile="scripts/antrun-test-jars.xml" />
+ </tasks>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
</plugins>
</build>
Added: projects/jboss-osgi/trunk/reactor/deployment/scripts/antrun-test-jars.xml
===================================================================
--- projects/jboss-osgi/trunk/reactor/deployment/scripts/antrun-test-jars.xml (rev 0)
+++ projects/jboss-osgi/trunk/reactor/deployment/scripts/antrun-test-jars.xml 2009-11-13 00:49:24 UTC (rev 96320)
@@ -0,0 +1,52 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!-- ============================================================ -->
+<!-- JBoss, the OpenSource J2EE webOS -->
+<!-- Distributable under LGPL license. -->
+<!-- See terms of license at http://www.gnu.org. -->
+<!-- ============================================================ -->
+
+<!-- $Id$ -->
+
+<project default="build-test-jars">
+
+ <description>OSGi test archive builder</description>
+
+ <!-- ================================================================== -->
+ <!-- Init -->
+ <!-- ================================================================== -->
+
+ <target name="init">
+
+ <!-- Property override when not called from maven -->
+ <property name="maven.runtime.classpath" value="/usr/java/bnd.jar" />
+ <property name="tests.output.dir" value="${basedir}/../target" />
+
+ <mkdir dir="${tests.output.dir}/test-libs" />
+ <property name="tests.classes.dir" value="${tests.output.dir}/test-classes" />
+ <property name="tests.resources.dir" value="${tests.output.dir}/test-classes" />
+
+ <taskdef resource="aQute/bnd/ant/taskdef.properties">
+ <classpath>
+ <pathelement path="${maven.runtime.classpath}" />
+ </classpath>
+ </taskdef>
+
+ </target>
+
+ <!-- ================================================================== -->
+ <!-- Building -->
+ <!-- ================================================================== -->
+
+ <target name="build-test-jars" depends="init" description="Build the test deployments">
+
+ <!-- Please add alphabetically -->
+
+ <!-- simple -->
+ <bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/simple-bundle.jar" files="${tests.resources.dir}/simple/simple.bnd" />
+
+ <!-- Please add alphabetically -->
+
+ </target>
+
+</project>
Property changes on: projects/jboss-osgi/trunk/reactor/deployment/scripts/antrun-test-jars.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: projects/jboss-osgi/trunk/reactor/deployment/src/main/java/org/jboss/osgi/deployment/internal/DeploymentImpl.java
===================================================================
--- projects/jboss-osgi/trunk/reactor/deployment/src/main/java/org/jboss/osgi/deployment/internal/DeploymentImpl.java 2009-11-12 23:46:59 UTC (rev 96319)
+++ projects/jboss-osgi/trunk/reactor/deployment/src/main/java/org/jboss/osgi/deployment/internal/DeploymentImpl.java 2009-11-13 00:49:24 UTC (rev 96320)
@@ -40,7 +40,7 @@
*/
public class DeploymentImpl extends AttachmentSupport implements Deployment, Serializable
{
- private static final long serialVersionUID = 1L;
+ private static final long serialVersionUID = 6216977125749367927L;
private BundleInfo info;
private URL location;
Added: projects/jboss-osgi/trunk/reactor/deployment/src/test/java/org/jboss/test/osgi/deployment/simple/DeploymentSerializationTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/reactor/deployment/src/test/java/org/jboss/test/osgi/deployment/simple/DeploymentSerializationTestCase.java (rev 0)
+++ projects/jboss-osgi/trunk/reactor/deployment/src/test/java/org/jboss/test/osgi/deployment/simple/DeploymentSerializationTestCase.java 2009-11-13 00:49:24 UTC (rev 96320)
@@ -0,0 +1,94 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.osgi.deployment.simple;
+
+//$Id$
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.File;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+import java.net.MalformedURLException;
+
+import org.jboss.osgi.deployment.deployer.Deployment;
+import org.jboss.osgi.deployment.internal.DeploymentImpl;
+import org.jboss.osgi.spi.util.BundleInfo;
+import org.junit.Test;
+
+/**
+ * Test Deployment serialization
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 12-Nov-2009
+ */
+public class DeploymentSerializationTestCase
+{
+ @Test
+ public void testSerializeBundleInfo() throws Exception
+ {
+ BundleInfo info = getBundleInfo();
+
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
+ ObjectOutputStream oos = new ObjectOutputStream(baos);
+ oos.writeObject(info);
+ baos.close();
+
+ ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
+ ObjectInputStream ois = new ObjectInputStream(bais);
+ Object res = ois.readObject();
+ assertTrue("Instance of BundleInfo: " + res, res instanceof BundleInfo);
+
+ assertEquals(info, res);
+ }
+
+ @Test
+ public void testSerializeDeployment() throws Exception
+ {
+ BundleInfo info = getBundleInfo();
+ Deployment dep = new DeploymentImpl(info);
+
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
+ ObjectOutputStream oos = new ObjectOutputStream(baos);
+ oos.writeObject(dep);
+ baos.close();
+
+ ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
+ ObjectInputStream ois = new ObjectInputStream(bais);
+ Object res = ois.readObject();
+ assertTrue("Instance of Deployment: " + res, res instanceof Deployment);
+
+ assertEquals(dep, res);
+ }
+
+ private BundleInfo getBundleInfo() throws MalformedURLException
+ {
+ File file = new File("target/test-libs/simple-bundle.jar");
+ assertTrue("File exists: " + file, file.exists());
+
+ BundleInfo info = BundleInfo.createBundleInfo(file.toURL());
+ return info;
+ }
+}
Property changes on: projects/jboss-osgi/trunk/reactor/deployment/src/test/java/org/jboss/test/osgi/deployment/simple/DeploymentSerializationTestCase.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: projects/jboss-osgi/trunk/reactor/deployment/src/test/resources/log4j.xml
===================================================================
--- projects/jboss-osgi/trunk/reactor/deployment/src/test/resources/log4j.xml (rev 0)
+++ projects/jboss-osgi/trunk/reactor/deployment/src/test/resources/log4j.xml 2009-11-13 00:49:24 UTC (rev 96320)
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
+
+<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="false">
+
+ <!-- ================================= -->
+ <!-- Preserve messages in a local file -->
+ <!-- ================================= -->
+
+ <appender name="FILE" class="org.apache.log4j.FileAppender">
+ <param name="File" value="${log4j.output.dir}/test.log"/>
+ <param name="Append" value="false"/>
+ <layout class="org.apache.log4j.PatternLayout">
+ <!-- The default pattern: Date Priority [Category] Message\n -->
+ <param name="ConversionPattern" value="%d %-5p [%c] %m%n"/>
+ </layout>
+ </appender>
+
+ <!-- ============================== -->
+ <!-- Append messages to the console -->
+ <!-- ============================== -->
+
+ <appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
+ <param name="Target" value="System.out" />
+ <param name="Threshold" value="INFO" />
+ <layout class="org.apache.log4j.PatternLayout">
+ <param name="ConversionPattern" value="%d{HH:mm:ss,SSS} %-5p [%c{1}] %m%n" />
+ </layout>
+ </appender>
+
+ <!-- ================ -->
+ <!-- Limit categories -->
+ <!-- ================ -->
+
+ <!-- Show jboss deployer traces
+ <category name="org.jboss.deployer">
+ <priority value="TRACE" />
+ </category>
+ -->
+
+ <!-- ======================= -->
+ <!-- Setup the Root category -->
+ <!-- ======================= -->
+
+ <root>
+ <!--appender-ref ref="CONSOLE"/-->
+ <appender-ref ref="FILE"/>
+ </root>
+
+</log4j:configuration>
Property changes on: projects/jboss-osgi/trunk/reactor/deployment/src/test/resources/log4j.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: projects/jboss-osgi/trunk/reactor/deployment/src/test/resources/simple/simple.bnd
===================================================================
--- projects/jboss-osgi/trunk/reactor/deployment/src/test/resources/simple/simple.bnd (rev 0)
+++ projects/jboss-osgi/trunk/reactor/deployment/src/test/resources/simple/simple.bnd 2009-11-13 00:49:24 UTC (rev 96320)
@@ -0,0 +1,4 @@
+# bnd build -classpath target/test-classes -output target/test-libs/simple-bundle.jar src/test/resources/simple/simple.bnd
+
+Bundle-SymbolicName: simple-bundle
+Export-Package: org.jboss.test.osgi.deployment.simple
14 years, 8 months
JBoss-OSGI SVN: r96315 - in projects/jboss-osgi/trunk: reactor/deployment/src/main/java/org/jboss/osgi/deployment/internal and 2 other directories.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-11-12 16:35:42 -0500 (Thu, 12 Nov 2009)
New Revision: 96315
Modified:
projects/jboss-osgi/trunk/reactor/deployment/src/main/java/org/jboss/osgi/deployment/deployer/DeploymentRegistryService.java
projects/jboss-osgi/trunk/reactor/deployment/src/main/java/org/jboss/osgi/deployment/internal/DeploymentRegistryServiceImpl.java
projects/jboss-osgi/trunk/reactor/deployment/src/main/java/org/jboss/osgi/deployment/internal/SystemDeployerService.java
projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/service/internal/DeployerServiceImpl.java
projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/webapp/WebAppNegativeTestCase.java
Log:
Fix missing deployment registring when deployed through the DeployerService
Modified: projects/jboss-osgi/trunk/reactor/deployment/src/main/java/org/jboss/osgi/deployment/deployer/DeploymentRegistryService.java
===================================================================
--- projects/jboss-osgi/trunk/reactor/deployment/src/main/java/org/jboss/osgi/deployment/deployer/DeploymentRegistryService.java 2009-11-12 19:39:18 UTC (rev 96314)
+++ projects/jboss-osgi/trunk/reactor/deployment/src/main/java/org/jboss/osgi/deployment/deployer/DeploymentRegistryService.java 2009-11-12 21:35:42 UTC (rev 96315)
@@ -24,6 +24,7 @@
//$Id: DeployerService.java 90894 2009-07-07 11:58:40Z thomas.diesler(a)jboss.com $
import java.net.URL;
+import java.util.List;
import org.osgi.framework.Version;
@@ -36,6 +37,12 @@
public interface DeploymentRegistryService
{
/**
+ * Get the list of registered deployments.
+ * @return An empty list if this service does not maintain any bundle deployments
+ */
+ List<Deployment> getDeployments();
+
+ /**
* Get the bundle deployment for the given bundle URL
* @return null, if this service does not maintain the bundle deployment
*/
Modified: projects/jboss-osgi/trunk/reactor/deployment/src/main/java/org/jboss/osgi/deployment/internal/DeploymentRegistryServiceImpl.java
===================================================================
--- projects/jboss-osgi/trunk/reactor/deployment/src/main/java/org/jboss/osgi/deployment/internal/DeploymentRegistryServiceImpl.java 2009-11-12 19:39:18 UTC (rev 96314)
+++ projects/jboss-osgi/trunk/reactor/deployment/src/main/java/org/jboss/osgi/deployment/internal/DeploymentRegistryServiceImpl.java 2009-11-12 21:35:42 UTC (rev 96315)
@@ -24,14 +24,17 @@
//$Id: SystemDeployerService.java 90894 2009-07-07 11:58:40Z thomas.diesler(a)jboss.com $
import java.net.URL;
-import java.util.HashSet;
-import java.util.Set;
+import java.util.Collections;
+import java.util.List;
+import java.util.concurrent.CopyOnWriteArrayList;
import org.jboss.osgi.deployment.deployer.DeployerService;
import org.jboss.osgi.deployment.deployer.Deployment;
import org.jboss.osgi.deployment.deployer.DeploymentRegistryService;
import org.osgi.framework.BundleContext;
import org.osgi.framework.Version;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/**
* A {@link DeployerService} that installs/uninstalls the bundles directly on the OSGi framework without going through the MC registered deployers.
@@ -41,19 +44,29 @@
*/
public class DeploymentRegistryServiceImpl implements DeploymentRegistryService
{
- private Set<Deployment> deployments = new HashSet<Deployment>();
+ // Provide logging
+ private Logger log = LoggerFactory.getLogger(DeploymentRegistryServiceImpl.class);
+
+ private List<Deployment> deployments = new CopyOnWriteArrayList<Deployment>();
public DeploymentRegistryServiceImpl(BundleContext context)
{
}
+ public List<Deployment> getDeployments()
+ {
+ return Collections.unmodifiableList(deployments);
+ }
+
public void registerDeployment(Deployment dep)
{
+ log.debug("Register: " + dep);
deployments.add(dep);
}
public void unregisterDeployment(Deployment dep)
{
+ log.debug("Unregister: " + dep);
deployments.remove(dep);
}
Modified: projects/jboss-osgi/trunk/reactor/deployment/src/main/java/org/jboss/osgi/deployment/internal/SystemDeployerService.java
===================================================================
--- projects/jboss-osgi/trunk/reactor/deployment/src/main/java/org/jboss/osgi/deployment/internal/SystemDeployerService.java 2009-11-12 19:39:18 UTC (rev 96314)
+++ projects/jboss-osgi/trunk/reactor/deployment/src/main/java/org/jboss/osgi/deployment/internal/SystemDeployerService.java 2009-11-12 21:35:42 UTC (rev 96315)
@@ -114,7 +114,7 @@
}
catch (BundleException ex)
{
- log.error( "Cannot install bundle: " + dep, ex);
+ log.error("Cannot install bundle: " + dep, ex);
}
}
@@ -147,7 +147,7 @@
{
try
{
- log.debug( "Start: " + bundle);
+ log.debug("Start: " + bundle);
// Added support for Bundle.START_ACTIVATION_POLICY on start
// http://issues.apache.org/jira/browse/FELIX-1317
@@ -160,7 +160,7 @@
}
catch (BundleException ex)
{
- log.error( "Cannot start bundle: " + bundle, ex);
+ log.error("Cannot start bundle: " + bundle, ex);
}
}
}
@@ -184,7 +184,7 @@
}
else
{
- log.warn( "Cannot obtain bundle for: " + dep);
+ log.warn("Cannot obtain bundle for: " + dep);
}
}
}
@@ -205,7 +205,7 @@
}
else
{
- log.warn( "Cannot find deployment for: " + url);
+ log.warn("Cannot find deployment for: " + url);
}
}
Modified: projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/service/internal/DeployerServiceImpl.java
===================================================================
--- projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/service/internal/DeployerServiceImpl.java 2009-11-12 19:39:18 UTC (rev 96314)
+++ projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/service/internal/DeployerServiceImpl.java 2009-11-12 21:35:42 UTC (rev 96315)
@@ -39,6 +39,7 @@
import org.jboss.virtual.VirtualFile;
import org.osgi.framework.BundleContext;
import org.osgi.framework.BundleException;
+import org.osgi.framework.ServiceReference;
/**
* A plugin that manages bundle deployments.
@@ -93,14 +94,20 @@
public void deploy(Deployment[] bundleDeps) throws BundleException
{
+ DeploymentRegistryService registry = getDeploymentRegistry();
for (Deployment dep : bundleDeps)
+ {
getBundleManager().installBundle(dep);
+ registry.registerDeployment(dep);
+ }
}
public void deploy(URL url) throws BundleException
{
+ DeploymentRegistryService registry = getDeploymentRegistry();
Deployment dep = createDeployment(url);
getBundleManager().installBundle(dep);
+ registry.registerDeployment(dep);
}
public void undeploy(Deployment[] bundleDeps) throws BundleException
@@ -112,4 +119,14 @@
{
delegate.undeploy(url);
}
+
+ private DeploymentRegistryService getDeploymentRegistry()
+ {
+ BundleContext context = getSystemContext();
+ ServiceReference sref = context.getServiceReference(DeploymentRegistryService.class.getName());
+ if (sref == null)
+ throw new IllegalStateException("Cannot obtain DeploymentRegistryService");
+
+ return (DeploymentRegistryService)context.getService(sref);
+ }
}
\ No newline at end of file
Modified: projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/webapp/WebAppNegativeTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/webapp/WebAppNegativeTestCase.java 2009-11-12 19:39:18 UTC (rev 96314)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/webapp/WebAppNegativeTestCase.java 2009-11-12 21:35:42 UTC (rev 96315)
@@ -34,7 +34,6 @@
import org.jboss.osgi.webapp.WebAppCapability;
import org.junit.AfterClass;
import org.junit.BeforeClass;
-import org.junit.Ignore;
import org.junit.Test;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleException;
@@ -45,7 +44,6 @@
* @author thomas.diesler(a)jboss.com
* @since 26-Oct-2009
*/
-@Ignore("[JBOSGI-204] Failure in Bundle.start() uninstalls the bundle in AS")
public class WebAppNegativeTestCase extends AbstractWebAppTestCase
{
private static OSGiRuntime runtime;
14 years, 8 months
JBoss-OSGI SVN: r96314 - in projects/jboss-osgi/trunk: reactor/framework/src/main/java/org/jboss/osgi/framework/bundle and 6 other directories.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-11-12 14:39:18 -0500 (Thu, 12 Nov 2009)
New Revision: 96314
Added:
projects/jboss-osgi/trunk/testsuite/example/src/test/resources/webapp/manifest-negative.mf
projects/jboss-osgi/trunk/testsuite/example/src/test/resources/webapp/manifest.mf
Removed:
projects/jboss-osgi/trunk/testsuite/example/src/test/resources/webapp/MANIFEST.MF
Modified:
projects/jboss-osgi/trunk/reactor/deployment/.classpath
projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/bundle/AbstractBundleState.java
projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/bundle/OSGiBundleManager.java
projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/plugins/internal/FrameworkEventsPluginImpl.java
projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/service/internal/WebXMLVerifierInterceptor.java
projects/jboss-osgi/trunk/reactor/framework/src/test/java/org/jboss/test/osgi/FrameworkTestDelegate.java
projects/jboss-osgi/trunk/testsuite/example/scripts/antrun-test-jars.xml
projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/webapp/WebAppNegativeTestCase.java
Log:
Simplify plugin key handling
Modified: projects/jboss-osgi/trunk/reactor/deployment/.classpath
===================================================================
--- projects/jboss-osgi/trunk/reactor/deployment/.classpath 2009-11-12 19:36:12 UTC (rev 96313)
+++ projects/jboss-osgi/trunk/reactor/deployment/.classpath 2009-11-12 19:39:18 UTC (rev 96314)
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="target/classes" path="src/main/java"/>
- <classpathentry kind="src" path="src/test/java"/>
+ <classpathentry kind="src" output="target/test-classes" path="src/test/java"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
<classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
<classpathentry kind="output" path="target/classes"/>
Modified: projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/bundle/AbstractBundleState.java
===================================================================
--- projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/bundle/AbstractBundleState.java 2009-11-12 19:36:12 UTC (rev 96313)
+++ projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/bundle/AbstractBundleState.java 2009-11-12 19:39:18 UTC (rev 96314)
@@ -686,7 +686,7 @@
}
// Invoke the bundle lifecycle interceptors
- if (getBundleManager().isActive() && getBundleId() != 0)
+ if (getBundleManager().isFrameworkActive() && getBundleId() != 0)
{
LifecycleInterceptorServicePlugin plugin = getBundleManager().getPlugin(LifecycleInterceptorServicePlugin.class);
plugin.handleStateChange(state, getBundleInternal());
@@ -696,7 +696,7 @@
log.debug(this + " change state=" + ConstantsHelper.bundleState(state));
// Fire the bundle event
- if (getBundleManager().isActive())
+ if (getBundleManager().isFrameworkActive())
{
FrameworkEventsPlugin plugin = getBundleManager().getPlugin(FrameworkEventsPlugin.class);
plugin.fireBundleEvent(this, bundleEventType);
Modified: projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/bundle/OSGiBundleManager.java
===================================================================
--- projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/bundle/OSGiBundleManager.java 2009-11-12 19:36:12 UTC (rev 96313)
+++ projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/bundle/OSGiBundleManager.java 2009-11-12 19:39:18 UTC (rev 96314)
@@ -337,17 +337,12 @@
*/
public void addPlugin(Plugin plugin)
{
- Class<?> clazz = plugin.getClass();
- if (addPlugin(plugin, clazz) == false)
- {
- // If the plugin could not be added by Interface, use the clazz directly
- log.debug("Add plugin: " + clazz.getName());
- plugins.put(clazz, plugin);
- }
+ Class<?> key = getPluginKey(plugin);
+ log.debug("Add plugin: " + key.getName());
+ plugins.put(key, plugin);
// In case a service plugin gets added after the framework is started
- boolean isFrameworkActive = systemBundle.getState() == Bundle.ACTIVE;
- if (isFrameworkActive == true && plugin instanceof ServicePlugin)
+ if (isFrameworkActive() == true && plugin instanceof ServicePlugin)
{
ServicePlugin servicePlugin = (ServicePlugin)plugin;
servicePlugin.startService();
@@ -355,11 +350,23 @@
}
/**
- * Add a plugin by scanning the interfaces for the given clazz.
- * The plugin is added with the key of the first interface that extends Plugin.
+ * Get the key for a given plugin
*/
- private boolean addPlugin(Plugin plugin, Class<?> clazz)
+ private Class<?> getPluginKey(Plugin plugin)
{
+ Class<?> clazz = plugin.getClass();
+ Class<?> key = getPluginKey(plugin, clazz);
+
+ // If the plugin could not be added by Interface, use the clazz directly
+ return (key != null ? key : clazz);
+ }
+
+ /**
+ * Get the plugin key by scanning the interfaces for the given clazz.
+ * @return The first interface that extends Plugin.
+ */
+ private Class<?> getPluginKey(Plugin plugin, Class<?> clazz)
+ {
// Scan the interfaces on the class
for (Class<?> interf : clazz.getInterfaces())
{
@@ -368,18 +375,16 @@
if (Plugin.class.isAssignableFrom(interf))
{
- log.debug("Add plugin: " + interf.getName());
- plugins.put(interf, plugin);
- return true;
+ return interf;
}
}
// Interface not found, try the plugin's superclass
Class<?> superclass = clazz.getSuperclass();
if (Plugin.class.isAssignableFrom(superclass))
- return addPlugin(plugin, superclass);
+ return getPluginKey(plugin, superclass);
- return false;
+ return null;
}
/**
@@ -389,27 +394,20 @@
*/
public void removePlugin(Plugin plugin)
{
- Class<? extends Plugin> clazz = plugin.getClass();
- for (Class<?> interf : clazz.getInterfaces())
- {
- if (Plugin.class.isAssignableFrom(interf))
- {
- log.debug("Remove plugin: " + clazz.getName());
- plugins.remove(interf);
- }
- }
+ Class<?> key = getPluginKey(plugin);
+ log.debug("Remove plugin: " + key.getName());
+ plugins.remove(key);
}
/**
* Are we active
- *
* @return true when the system is active
*/
- public boolean isActive()
+ public boolean isFrameworkActive()
{
- // We are active if the system bundle is at least in the starting/stopping state
+ // We are active if the system bundle is ACTIVE
AbstractBundleState bundleState = getSystemBundle();
- return bundleState.getState() >= Bundle.STARTING;
+ return bundleState.getState() == Bundle.ACTIVE;
}
/**
Modified: projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/plugins/internal/FrameworkEventsPluginImpl.java
===================================================================
--- projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/plugins/internal/FrameworkEventsPluginImpl.java 2009-11-12 19:36:12 UTC (rev 96313)
+++ projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/plugins/internal/FrameworkEventsPluginImpl.java 2009-11-12 19:39:18 UTC (rev 96314)
@@ -272,7 +272,7 @@
return;
// Are we active?
- if (getBundleManager().isActive() == false)
+ if (getBundleManager().isFrameworkActive() == false)
return;
Runnable runnable = new Runnable()
@@ -336,7 +336,7 @@
return;
// Are we active?
- if (getBundleManager().isActive() == false)
+ if (getBundleManager().isFrameworkActive() == false)
return;
Runnable runnable = new Runnable()
@@ -354,7 +354,7 @@
return;
// Are we active?
- if (getBundleManager().isActive() == false)
+ if (getBundleManager().isFrameworkActive() == false)
return;
// Call the listeners
@@ -402,7 +402,7 @@
return;
// Are we active?
- if (getBundleManager().isActive() == false)
+ if (getBundleManager().isFrameworkActive() == false)
return;
Runnable runnable = new Runnable()
Modified: projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/service/internal/WebXMLVerifierInterceptor.java
===================================================================
--- projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/service/internal/WebXMLVerifierInterceptor.java 2009-11-12 19:36:12 UTC (rev 96313)
+++ projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/service/internal/WebXMLVerifierInterceptor.java 2009-11-12 19:39:18 UTC (rev 96314)
@@ -62,7 +62,9 @@
{
VirtualFile root = context.getRoot();
VirtualFile webXML = root.getChild("/WEB-INF/web.xml");
- if (root.getName().endsWith(".war") && webXML == null)
+ String contextPath = (String)context.getBundle().getHeaders().get("Web-ContextPath");
+ boolean isWebApp = contextPath != null || root.getName().endsWith(".war");
+ if (isWebApp == true && webXML == null)
throw new LifecycleInterceptorException("Cannot obtain web.xml from: " + root.toURL());
}
catch (RuntimeException rte)
Modified: projects/jboss-osgi/trunk/reactor/framework/src/test/java/org/jboss/test/osgi/FrameworkTestDelegate.java
===================================================================
--- projects/jboss-osgi/trunk/reactor/framework/src/test/java/org/jboss/test/osgi/FrameworkTestDelegate.java 2009-11-12 19:36:12 UTC (rev 96313)
+++ projects/jboss-osgi/trunk/reactor/framework/src/test/java/org/jboss/test/osgi/FrameworkTestDelegate.java 2009-11-12 19:39:18 UTC (rev 96314)
@@ -145,7 +145,7 @@
bundleManager = getBean("OSGiBundleManager", ControllerState.INSTALLED, OSGiBundleManager.class);
try
{
- if (bundleManager.isActive() == false)
+ if (bundleManager.isFrameworkActive() == false)
bundleManager.startFramework();
}
catch (BundleException ex)
Modified: projects/jboss-osgi/trunk/testsuite/example/scripts/antrun-test-jars.xml
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/scripts/antrun-test-jars.xml 2009-11-12 19:36:12 UTC (rev 96313)
+++ projects/jboss-osgi/trunk/testsuite/example/scripts/antrun-test-jars.xml 2009-11-12 19:39:18 UTC (rev 96314)
@@ -70,7 +70,7 @@
<!-- webapp -->
<war destfile="${tests.output.dir}/test-libs/example-webapp.war"
- manifest="${tests.resources.dir}/webapp/MANIFEST.MF"
+ manifest="${tests.resources.dir}/webapp/manifest.mf"
webxml="${tests.resources.dir}/webapp/web.xml">
<classes dir="${tests.classes.dir}">
<include name="**/example/webapp/bundle/*.class"/>
@@ -80,7 +80,7 @@
</fileset>
</war>
<jar destfile="${tests.output.dir}/test-libs/example-webapp-negative.war"
- manifest="${tests.resources.dir}/webapp/MANIFEST.MF">
+ manifest="${tests.resources.dir}/webapp/manifest-negative.mf">
<zipfileset dir="${tests.classes.dir}" prefix="WEB-INF/classes">
<include name="**/example/webapp/bundle/*.class"/>
</zipfileset>
Modified: projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/webapp/WebAppNegativeTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/webapp/WebAppNegativeTestCase.java 2009-11-12 19:36:12 UTC (rev 96313)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/webapp/WebAppNegativeTestCase.java 2009-11-12 19:39:18 UTC (rev 96314)
@@ -34,6 +34,7 @@
import org.jboss.osgi.webapp.WebAppCapability;
import org.junit.AfterClass;
import org.junit.BeforeClass;
+import org.junit.Ignore;
import org.junit.Test;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleException;
@@ -44,6 +45,7 @@
* @author thomas.diesler(a)jboss.com
* @since 26-Oct-2009
*/
+@Ignore("[JBOSGI-204] Failure in Bundle.start() uninstalls the bundle in AS")
public class WebAppNegativeTestCase extends AbstractWebAppTestCase
{
private static OSGiRuntime runtime;
Deleted: projects/jboss-osgi/trunk/testsuite/example/src/test/resources/webapp/MANIFEST.MF
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/resources/webapp/MANIFEST.MF 2009-11-12 19:36:12 UTC (rev 96313)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/resources/webapp/MANIFEST.MF 2009-11-12 19:39:18 UTC (rev 96314)
@@ -1,6 +0,0 @@
-Manifest-Version: 1.0
-Bundle-Name: example-webapp
-Bundle-ManifestVersion: 2
-Bundle-SymbolicName: example-webapp
-Bundle-ClassPath: .,WEB-INF/classes
-Import-Package: javax.servlet,javax.servlet.http,org.osgi.service.http,org.ops4j.pax.web.service
\ No newline at end of file
Added: projects/jboss-osgi/trunk/testsuite/example/src/test/resources/webapp/manifest-negative.mf
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/resources/webapp/manifest-negative.mf (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/resources/webapp/manifest-negative.mf 2009-11-12 19:39:18 UTC (rev 96314)
@@ -0,0 +1,5 @@
+Bundle-ManifestVersion: 2
+Bundle-SymbolicName: example-webapp-negative
+Bundle-ClassPath: .,WEB-INF/classes
+Web-ContextPath: example-webapp
+Import-Package: javax.servlet,javax.servlet.http,org.osgi.service.http,org.ops4j.pax.web.service
\ No newline at end of file
Copied: projects/jboss-osgi/trunk/testsuite/example/src/test/resources/webapp/manifest.mf (from rev 96307, projects/jboss-osgi/trunk/testsuite/example/src/test/resources/webapp/MANIFEST.MF)
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/resources/webapp/manifest.mf (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/resources/webapp/manifest.mf 2009-11-12 19:39:18 UTC (rev 96314)
@@ -0,0 +1,5 @@
+Bundle-ManifestVersion: 2
+Bundle-SymbolicName: example-webapp
+Bundle-ClassPath: .,WEB-INF/classes
+Web-ContextPath: example-webapp
+Import-Package: javax.servlet,javax.servlet.http,org.osgi.service.http,org.ops4j.pax.web.service
\ No newline at end of file
14 years, 8 months
JBoss-OSGI SVN: r96313 - in projects/jboss-osgi/projects/bundles/webconsole/trunk: src/main/java/org/jboss/osgi/webconsole/internal/plugins and 1 other directory.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-11-12 14:36:12 -0500 (Thu, 12 Nov 2009)
New Revision: 96313
Modified:
projects/jboss-osgi/projects/bundles/webconsole/trunk/pom.xml
projects/jboss-osgi/projects/bundles/webconsole/trunk/src/main/java/org/jboss/osgi/webconsole/internal/plugins/BundlesPlugin.java
projects/jboss-osgi/projects/bundles/webconsole/trunk/src/main/java/org/jboss/osgi/webconsole/internal/plugins/InstallActionExt.java
Log:
Update deployment API
Modified: projects/jboss-osgi/projects/bundles/webconsole/trunk/pom.xml
===================================================================
--- projects/jboss-osgi/projects/bundles/webconsole/trunk/pom.xml 2009-11-12 19:30:30 UTC (rev 96312)
+++ projects/jboss-osgi/projects/bundles/webconsole/trunk/pom.xml 2009-11-12 19:36:12 UTC (rev 96313)
@@ -27,7 +27,7 @@
<parent>
<groupId>org.jboss.osgi</groupId>
<artifactId>jboss-osgi-parent</artifactId>
- <version>1.0.3</version>
+ <version>1.0.4-SNAPSHOT</version>
</parent>
<!-- SCM -->
@@ -46,9 +46,10 @@
<version.felix.scr>1.0.0</version.felix.scr>
<version.felix.webconsole>1.2.10</version.felix.webconsole>
<version.javax.servlet>2.4</version.javax.servlet>
- <version.jboss.osgi.spi>1.0.2</version.jboss.osgi.spi>
+ <version.jboss.osgi.deployment>1.0.0-SNAPSHOT</version.jboss.osgi.deployment>
+ <version.jboss.osgi.spi>1.0.3-SNAPSHOT</version.jboss.osgi.spi>
<version.json>20070829</version.json>
- <version.osgi>r4v42</version.osgi>
+ <version.osgi>4.2.0</version.osgi>
</properties>
<!-- Dependencies -->
@@ -60,6 +61,12 @@
<scope>provided</scope>
</dependency>
<dependency>
+ <groupId>org.jboss.osgi.runtime</groupId>
+ <artifactId>jboss-osgi-deployment</artifactId>
+ <version>${version.jboss.osgi.deployment}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>${version.javax.servlet}</version>
Modified: projects/jboss-osgi/projects/bundles/webconsole/trunk/src/main/java/org/jboss/osgi/webconsole/internal/plugins/BundlesPlugin.java
===================================================================
--- projects/jboss-osgi/projects/bundles/webconsole/trunk/src/main/java/org/jboss/osgi/webconsole/internal/plugins/BundlesPlugin.java 2009-11-12 19:30:30 UTC (rev 96312)
+++ projects/jboss-osgi/projects/bundles/webconsole/trunk/src/main/java/org/jboss/osgi/webconsole/internal/plugins/BundlesPlugin.java 2009-11-12 19:36:12 UTC (rev 96313)
@@ -28,9 +28,9 @@
import javax.servlet.http.HttpServletRequest;
import org.apache.felix.webconsole.internal.core.BundlesServlet;
-import org.jboss.osgi.spi.service.DeployerService;
-import org.jboss.osgi.spi.service.DeploymentRegistryService;
-import org.jboss.osgi.spi.util.BundleDeployment;
+import org.jboss.osgi.deployment.deployer.DeployerService;
+import org.jboss.osgi.deployment.deployer.Deployment;
+import org.jboss.osgi.deployment.deployer.DeploymentRegistryService;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
import org.osgi.framework.BundleException;
@@ -71,7 +71,7 @@
String symbolicName = bundle.getSymbolicName();
Version version = bundle.getVersion();
- BundleDeployment dep = registry.getBundleDeployment(symbolicName, version);
+ Deployment dep = registry.getDeployment(symbolicName, version);
if (dep == null)
{
getLog().log(LogService.LOG_WARNING, "Cannot find bundle deployment for: " + bundle);
@@ -80,7 +80,7 @@
try
{
- service.undeploy(new BundleDeployment[] { dep });
+ service.undeploy(new Deployment[] { dep });
return true;
}
catch (BundleException be)
Modified: projects/jboss-osgi/projects/bundles/webconsole/trunk/src/main/java/org/jboss/osgi/webconsole/internal/plugins/InstallActionExt.java
===================================================================
--- projects/jboss-osgi/projects/bundles/webconsole/trunk/src/main/java/org/jboss/osgi/webconsole/internal/plugins/InstallActionExt.java 2009-11-12 19:30:30 UTC (rev 96312)
+++ projects/jboss-osgi/projects/bundles/webconsole/trunk/src/main/java/org/jboss/osgi/webconsole/internal/plugins/InstallActionExt.java 2009-11-12 19:36:12 UTC (rev 96313)
@@ -29,13 +29,11 @@
import java.net.URL;
import org.apache.felix.webconsole.internal.core.InstallAction;
-import org.jboss.osgi.spi.service.DeployerService;
-import org.jboss.osgi.spi.util.BundleDeployment;
-import org.jboss.osgi.spi.util.BundleDeploymentFactory;
+import org.jboss.osgi.deployment.deployer.DeployerService;
+import org.jboss.osgi.deployment.deployer.Deployment;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
import org.osgi.framework.BundleException;
-import org.osgi.framework.Constants;
import org.osgi.framework.ServiceReference;
import org.osgi.framework.Version;
import org.osgi.service.log.LogService;
@@ -59,19 +57,19 @@
return;
}
final DeployerService deployer = (DeployerService)context.getService(sref);
-
+
Thread t = new InstallHelper(this, "Background Install " + bundleFile, bundleFile, refreshPackages)
{
protected Bundle doRun(InputStream bundleStream) throws BundleException
{
URL bundleURL = getBundleURL(bundleFile);
-
- BundleDeployment dep = BundleDeploymentFactory.createBundleDeployment(bundleURL);
+
+ Deployment dep = deployer.createDeployment(bundleURL);
dep.setStartLevel(startlevel);
dep.setAutoStart(doStart);
- deployer.deploy(new BundleDeployment[] { dep });
-
+ deployer.deploy(new Deployment[] { dep });
+
Bundle bundle = getBundle(dep);
if (bundle == null)
throw new IllegalStateException("Cannot obtain installed bundle: " + dep);
@@ -84,27 +82,23 @@
t.start();
}
- private Bundle getBundle(BundleDeployment info)
+ private Bundle getBundle(Deployment dep)
{
- String symbolicName = info.getSymbolicName();
- Version version = Version.parseVersion(info.getVersion());
+ String symbolicName = dep.getSymbolicName();
+ Version version = Version.parseVersion(dep.getVersion());
Bundle bundle = null;
for (Bundle aux : getBundleContext().getBundles())
{
- if (aux.getSymbolicName().equals(symbolicName))
+ if (aux.getSymbolicName().equals(symbolicName) && version.equals(aux.getVersion()))
{
- String auxVersion = (String)aux.getHeaders().get(Constants.BUNDLE_VERSION);
- if (version == null || version.equals(auxVersion))
- {
- bundle = aux;
- break;
- }
+ bundle = aux;
+ break;
}
}
return bundle;
}
-
+
private URL getBundleURL(final File bundleFile) throws BundleException
{
URL bundleURL;
14 years, 8 months
JBoss-OSGI SVN: r96312 - projects/jboss-osgi/projects/bundles/husky/trunk/harness/src/main/java/org/jboss/osgi/testing/internal.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-11-12 14:30:30 -0500 (Thu, 12 Nov 2009)
New Revision: 96312
Modified:
projects/jboss-osgi/projects/bundles/husky/trunk/harness/src/main/java/org/jboss/osgi/testing/internal/RemoteRuntime.java
Log:
Don't bootstrap the EmbeddedRuntime in RemoteRuntime
Modified: projects/jboss-osgi/projects/bundles/husky/trunk/harness/src/main/java/org/jboss/osgi/testing/internal/RemoteRuntime.java
===================================================================
--- projects/jboss-osgi/projects/bundles/husky/trunk/harness/src/main/java/org/jboss/osgi/testing/internal/RemoteRuntime.java 2009-11-12 18:54:22 UTC (rev 96311)
+++ projects/jboss-osgi/projects/bundles/husky/trunk/harness/src/main/java/org/jboss/osgi/testing/internal/RemoteRuntime.java 2009-11-12 19:30:30 UTC (rev 96312)
@@ -33,7 +33,6 @@
import javax.naming.InitialContext;
import javax.naming.NamingException;
-import org.jboss.osgi.spi.framework.OSGiBootstrapProvider;
import org.jboss.osgi.spi.management.MBeanProxy;
import org.jboss.osgi.spi.management.MBeanProxyException;
import org.jboss.osgi.spi.management.ManagedBundleMBean;
@@ -71,9 +70,9 @@
BundleInfo bundleInfo = BundleInfo.createBundleInfo(bundleURL);
String symbolicName = bundleInfo.getSymbolicName();
String version = bundleInfo.getVersion().toString();
-
+
deployInternal(location, true);
-
+
// The remote framework uses a BundleTracker that works of an asynchronous
// event to register the installed bundle. It is not available immediately.
int timeout = 50;
@@ -85,7 +84,7 @@
}
if (bundleMBean == null)
throw new IllegalStateException("Cannot find installed bundle: " + symbolicName + "-" + version);
-
+
RemoteBundle bundle = new RemoteBundle(this, bundleMBean, location);
return registerBundle(location, bundle);
}
@@ -98,7 +97,7 @@
Exception target = ex.getTargetException();
if (target instanceof BundleException)
throw (BundleException)target;
-
+
throw new BundleException("Cannot install: " + location, target);
}
catch (Exception ex)
@@ -106,12 +105,12 @@
throw new BundleException("Cannot install: " + location, ex);
}
}
-
+
public void deploy(String location) throws Exception
{
deployInternal(location, false);
}
-
+
private void deployInternal(String location, boolean isBundle) throws Exception
{
URL archiveURL = getTestHelper().getTestArchiveURL(location);
@@ -120,7 +119,7 @@
else
invokeMainDeployer("deploy", archiveURL);
}
-
+
public void undeploy(String location) throws Exception
{
URL archiveURL = getTestHelper().getTestArchiveURL(location);
@@ -168,7 +167,7 @@
ManagedBundleMBean bundle = getRemoteFramework().getBundle(bundleId);
return bundle != null ? new RemoteBundle(this, bundle, null) : null;
}
-
+
public OSGiServiceReference getServiceReference(String clazz)
{
ManagedServiceReference manref = getRemoteFramework().getServiceReference(clazz);
@@ -215,13 +214,8 @@
@Override
public void shutdown()
{
- OSGiBootstrapProvider bootProvider = getTestHelper().getBootstrapProvider();
- if (bootProvider != null)
- {
- super.shutdown();
- getPackageAdmin().refreshPackages(null);
- getTestHelper().ungetBootstrapProvider();
- }
+ super.shutdown();
+ getPackageAdmin().refreshPackages(null);
}
private RemoteFramework getRemoteFramework()
14 years, 8 months
JBoss-OSGI SVN: r96301 - in projects/jboss-osgi: trunk/reactor/deployment/src/main/java/org/jboss/osgi/deployment/deployer and 2 other directories.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-11-12 02:42:58 -0500 (Thu, 12 Nov 2009)
New Revision: 96301
Modified:
projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/util/BundleInfo.java
projects/jboss-osgi/trunk/reactor/deployment/src/main/java/org/jboss/osgi/deployment/deployer/AbstractDeployerService.java
projects/jboss-osgi/trunk/reactor/deployment/src/main/java/org/jboss/osgi/deployment/deployer/DeployerService.java
projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/bundle/OSGiBundleManager.java
projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/service/internal/DeployerServiceImpl.java
Log:
Allow clients of the DeployerService to set autoStart behaviour.
Instead of hard coding PROPERTY_AUTO_START=false into the BundleManager.
Modified: projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/util/BundleInfo.java
===================================================================
--- projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/util/BundleInfo.java 2009-11-12 07:34:09 UTC (rev 96300)
+++ projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/util/BundleInfo.java 2009-11-12 07:42:58 UTC (rev 96301)
@@ -120,6 +120,11 @@
return new BundleInfo(root, null);
}
+ public static BundleInfo createBundleInfo(VirtualFile root, String location)
+ {
+ return new BundleInfo(root, location);
+ }
+
private BundleInfo(VirtualFile root, String location)
{
if (root == null)
Modified: projects/jboss-osgi/trunk/reactor/deployment/src/main/java/org/jboss/osgi/deployment/deployer/AbstractDeployerService.java
===================================================================
--- projects/jboss-osgi/trunk/reactor/deployment/src/main/java/org/jboss/osgi/deployment/deployer/AbstractDeployerService.java 2009-11-12 07:34:09 UTC (rev 96300)
+++ projects/jboss-osgi/trunk/reactor/deployment/src/main/java/org/jboss/osgi/deployment/deployer/AbstractDeployerService.java 2009-11-12 07:42:58 UTC (rev 96301)
@@ -48,4 +48,9 @@
BundleInfo info = BundleInfo.createBundleInfo(file);
return new DeploymentImpl(info);
}
+
+ public Deployment createDeployment(BundleInfo info)
+ {
+ return new DeploymentImpl(info);
+ }
}
\ No newline at end of file
Modified: projects/jboss-osgi/trunk/reactor/deployment/src/main/java/org/jboss/osgi/deployment/deployer/DeployerService.java
===================================================================
--- projects/jboss-osgi/trunk/reactor/deployment/src/main/java/org/jboss/osgi/deployment/deployer/DeployerService.java 2009-11-12 07:34:09 UTC (rev 96300)
+++ projects/jboss-osgi/trunk/reactor/deployment/src/main/java/org/jboss/osgi/deployment/deployer/DeployerService.java 2009-11-12 07:42:58 UTC (rev 96301)
@@ -28,6 +28,7 @@
import javax.management.ObjectName;
import org.jboss.osgi.spi.management.ObjectNameFactory;
+import org.jboss.osgi.spi.util.BundleInfo;
import org.jboss.virtual.VirtualFile;
import org.osgi.framework.BundleException;
@@ -54,6 +55,11 @@
*/
Deployment createDeployment(VirtualFile file);
+ /**
+ * Create a deployment from the given bundle info.
+ */
+ Deployment createDeployment(BundleInfo info);
+
/**
* Deploy an array of bundles
*/
Modified: projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/bundle/OSGiBundleManager.java
===================================================================
--- projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/bundle/OSGiBundleManager.java 2009-11-12 07:34:09 UTC (rev 96300)
+++ projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/bundle/OSGiBundleManager.java 2009-11-12 07:42:58 UTC (rev 96301)
@@ -65,6 +65,7 @@
import org.jboss.deployers.vfs.spi.client.VFSDeploymentFactory;
import org.jboss.kernel.Kernel;
import org.jboss.logging.Logger;
+import org.jboss.osgi.deployment.deployer.Deployment;
import org.jboss.osgi.framework.metadata.OSGiMetaData;
import org.jboss.osgi.framework.metadata.PackageAttribute;
import org.jboss.osgi.framework.metadata.internal.AbstractOSGiMetaData;
@@ -427,7 +428,7 @@
}
/**
- * Install a bundle from
+ * Install a bundle from an input stream.
*
* @param location the bundle's location identifier
* @param input an optional input stream to read the bundle content from
@@ -478,11 +479,12 @@
throw new BundleException("Invalid bundle location=" + locationURL, e);
}
- return install(root, location);
+ return install(root, location, false);
}
/**
- * Install a bundle
+ * Install a bundle from a virtual file.
+ *
* @param root the virtual file that point to the bundle
*
* @return the bundle state
@@ -490,17 +492,30 @@
*/
public AbstractBundleState installBundle(VirtualFile root) throws BundleException
{
- return install(root, null);
+ return install(root, root.toString(), false);
}
+ /**
+ * Install a bundle from a deployment.
+ *
+ * @param dep the deployment that represents the bundle
+ *
+ * @return the bundle state
+ * @throws BundleException for any error
+ */
+ public AbstractBundleState installBundle(Deployment dep) throws BundleException
+ {
+ String location = dep.getLocation().toExternalForm();
+ return install(dep.getRoot(), location, dep.isAutoStart());
+ }
+
/*
- * Installs a bundle from the given virtual file. If the location is not explicitly
- * given, it'll be derived from the virtual file.
+ * Installs a bundle from the given virtual file.
*/
- private AbstractBundleState install(VirtualFile root, String location) throws BundleException
+ private AbstractBundleState install(VirtualFile root, String location, boolean autoStart) throws BundleException
{
if (location == null)
- location = root.toString();
+ throw new IllegalArgumentException("Null location");
// Create the deployment and deploy it
try
@@ -508,7 +523,7 @@
VFSDeployment deployment = VFSDeploymentFactory.getInstance().createVFSDeployment(root);
MutableAttachments att = (MutableAttachments)deployment.getPredeterminedManagedObjects();
att.addAttachment(PROPERTY_BUNDLE_LOCATION, location);
- att.addAttachment(PROPERTY_AUTO_START, Boolean.FALSE);
+ att.addAttachment(PROPERTY_AUTO_START, autoStart);
deployerClient.deploy(deployment);
try
Modified: projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/service/internal/DeployerServiceImpl.java
===================================================================
--- projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/service/internal/DeployerServiceImpl.java 2009-11-12 07:34:09 UTC (rev 96300)
+++ projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/service/internal/DeployerServiceImpl.java 2009-11-12 07:42:58 UTC (rev 96301)
@@ -35,6 +35,7 @@
import org.jboss.osgi.framework.bundle.OSGiBundleManager;
import org.jboss.osgi.framework.plugins.DeployerServicePlugin;
import org.jboss.osgi.framework.plugins.internal.AbstractServicePlugin;
+import org.jboss.osgi.spi.util.BundleInfo;
import org.jboss.virtual.VirtualFile;
import org.osgi.framework.BundleContext;
import org.osgi.framework.BundleException;
@@ -60,13 +61,13 @@
public void startService()
{
BundleContext context = getSystemContext();
+ delegate = new SystemDeployerService(context);
DeploymentRegistryService registry = new DeploymentRegistryServiceImpl(context);
context.registerService(DeploymentRegistryService.class.getName(), registry, null);
Properties props = new Properties();
props.put("provider", "system");
- delegate = new SystemDeployerService(context);
context.registerService(DeployerService.class.getName(), this, props);
}
@@ -85,14 +86,21 @@
return delegate.createDeployment(file);
}
+ public Deployment createDeployment(BundleInfo info)
+ {
+ return delegate.createDeployment(info);
+ }
+
public void deploy(Deployment[] bundleDeps) throws BundleException
{
- delegate.deploy(bundleDeps);
+ for (Deployment dep : bundleDeps)
+ getBundleManager().installBundle(dep);
}
public void deploy(URL url) throws BundleException
{
- delegate.deploy(url);
+ Deployment dep = createDeployment(url);
+ getBundleManager().installBundle(dep);
}
public void undeploy(Deployment[] bundleDeps) throws BundleException
14 years, 8 months
JBoss-OSGI SVN: r96300 - projects/jboss-osgi/projects/runtime/deployers/trunk/src/main/java/org/jboss/osgi/deployer.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-11-12 02:34:09 -0500 (Thu, 12 Nov 2009)
New Revision: 96300
Modified:
projects/jboss-osgi/projects/runtime/deployers/trunk/src/main/java/org/jboss/osgi/deployer/BundleStartStopDeployer.java
Log:
Better readability of PROPERTY_AUTO_START default
Modified: projects/jboss-osgi/projects/runtime/deployers/trunk/src/main/java/org/jboss/osgi/deployer/BundleStartStopDeployer.java
===================================================================
--- projects/jboss-osgi/projects/runtime/deployers/trunk/src/main/java/org/jboss/osgi/deployer/BundleStartStopDeployer.java 2009-11-12 07:03:28 UTC (rev 96299)
+++ projects/jboss-osgi/projects/runtime/deployers/trunk/src/main/java/org/jboss/osgi/deployer/BundleStartStopDeployer.java 2009-11-12 07:34:09 UTC (rev 96300)
@@ -66,8 +66,11 @@
public void deploy(DeploymentUnit unit, Bundle bundle) throws DeploymentException
{
- Boolean propAutoStart = unit.getAttachment(OSGiConstants.PROPERTY_AUTO_START, Boolean.class);
- if (propAutoStart == null || Boolean.TRUE.equals(propAutoStart))
+ Boolean autoStart = unit.getAttachment(OSGiConstants.PROPERTY_AUTO_START, Boolean.class);
+ if (autoStart == null)
+ autoStart = Boolean.TRUE;
+
+ if (autoStart == true)
{
String propDeferredStart = systemContext.getProperty(OSGiConstants.PROPERTY_DEFERRED_START);
if (Boolean.parseBoolean(propDeferredStart != null ? propDeferredStart : "true") == true)
14 years, 8 months