Author: thomas.diesler(a)jboss.com
Date: 2009-11-11 19:34:53 -0500 (Wed, 11 Nov 2009)
New Revision: 96286
Modified:
projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/deployers/OSGiBundleStateDeployer.java
projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/deployers/OSGiDeployersWrapper.java
projects/jboss-osgi/trunk/reactor/framework/src/test/java/org/jboss/test/osgi/smoke/OSGiSmokeTestCase.java
Log:
Restore PROPERTY_AUTO_START which is (currently) required for AS integration.
Revert to ignore non-osgi deployments since this also breaks AS integration.
Modified:
projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/deployers/OSGiBundleStateDeployer.java
===================================================================
---
projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/deployers/OSGiBundleStateDeployer.java 2009-11-11
22:59:08 UTC (rev 96285)
+++
projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/deployers/OSGiBundleStateDeployer.java 2009-11-12
00:34:53 UTC (rev 96286)
@@ -59,6 +59,7 @@
this.bundleManager = bundleManager;
this.requiredStage = DeploymentStages.DESCRIBE;
+ setInput(OSGiMetaData.class);
setOutput(OSGiBundleState.class);
setStage(DeploymentStages.POST_PARSE);
setTopLevelOnly(true);
@@ -73,8 +74,7 @@
protected void internalDeploy(DeploymentUnit unit) throws DeploymentException
{
// [TODO] look at manifest headers and persistent state for this
- if (unit.getAttachment(OSGiMetaData.class) != null)
- unit.setRequiredStage(requiredStage);
+ unit.setRequiredStage(requiredStage);
OSGiBundleState bundleState = bundleManager.addDeployment(unit);
unit.addAttachment(OSGiBundleState.class, bundleState);
Modified:
projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/deployers/OSGiDeployersWrapper.java
===================================================================
---
projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/deployers/OSGiDeployersWrapper.java 2009-11-11
22:59:08 UTC (rev 96285)
+++
projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/deployers/OSGiDeployersWrapper.java 2009-11-12
00:34:53 UTC (rev 96286)
@@ -21,6 +21,8 @@
*/
package org.jboss.osgi.framework.deployers;
+import static org.jboss.osgi.spi.OSGiConstants.PROPERTY_AUTO_START;
+
import java.util.Collection;
import java.util.List;
import java.util.Map;
@@ -128,8 +130,11 @@
OSGiBundleState bundle = unit.getAttachment(OSGiBundleState.class);
if (bundle == null)
continue;
-
- boolean autoStart =
DeploymentStages.INSTALLED.equals(unit.getRequiredStage());
+
+ Boolean autoStart = (Boolean)unit.getAttachment(PROPERTY_AUTO_START);
+ if (autoStart == null)
+ autoStart = Boolean.TRUE;
+
if (autoStart == true && bundle.getState() == Bundle.INSTALLED)
{
unresolvedBundles.add(0, bundle);
Modified:
projects/jboss-osgi/trunk/reactor/framework/src/test/java/org/jboss/test/osgi/smoke/OSGiSmokeTestCase.java
===================================================================
---
projects/jboss-osgi/trunk/reactor/framework/src/test/java/org/jboss/test/osgi/smoke/OSGiSmokeTestCase.java 2009-11-11
22:59:08 UTC (rev 96285)
+++
projects/jboss-osgi/trunk/reactor/framework/src/test/java/org/jboss/test/osgi/smoke/OSGiSmokeTestCase.java 2009-11-12
00:34:53 UTC (rev 96286)
@@ -56,12 +56,14 @@
public void testNoManifest() throws Exception
{
- testBundle("smoke-no-manifest", Bundle.ACTIVE);
+ // [TODO] discuss
+ // testBundle("smoke-no-manifest", Bundle.ACTIVE);
}
public void testNonOSGiManifest() throws Exception
{
- testBundle("smoke-non-osgi-manifest", Bundle.ACTIVE);
+ // [TODO] discuss
+ // testBundle("smoke-non-osgi-manifest", Bundle.ACTIVE);
}
public void testOSGiManifest() throws Exception
@@ -88,12 +90,14 @@
public void testDeployedNoManifest() throws Exception
{
- testDeployedBundle("smoke-no-manifest", Bundle.ACTIVE);
+ // [TODO] discuss
+ // testDeployedBundle("smoke-no-manifest", Bundle.ACTIVE);
}
public void testDeployedNonOSGiManifest() throws Exception
{
- testDeployedBundle("smoke-non-osgi-manifest", Bundle.ACTIVE);
+ // [TODO] discuss
+ // testDeployedBundle("smoke-non-osgi-manifest", Bundle.ACTIVE);
}
public void testDeployedOSGiManifest() throws Exception
@@ -125,6 +129,8 @@
public void testAssembledNonOSGiDeployment() throws Exception
{
+ // [TODO] discuss
+ /*
Bundle bundle = deployBundle("smoke-non-osgi-deployment", A.class);
try
{
@@ -137,6 +143,7 @@
{
bundle.uninstall();
}
+ */
}
protected void testBundle(String name, int expectedState) throws Exception