JBoss-OSGI SVN: r93310 - projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi151.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-09-09 08:03:21 -0400 (Wed, 09 Sep 2009)
New Revision: 93310
Modified:
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi151/OSGI151TestCase.java
Log:
[JBOSGI-151] Cannot resolve circular dependencies
Add reverse order install test
Modified: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi151/OSGI151TestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi151/OSGI151TestCase.java 2009-09-09 11:51:41 UTC (rev 93309)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi151/OSGI151TestCase.java 2009-09-09 12:03:21 UTC (rev 93310)
@@ -40,7 +40,7 @@
/**
* [JBOSGI-151] Cannot resolve circular dependencies
*
- * https://jira.jboss.org/jira/browse/JBOSGI-143
+ * https://jira.jboss.org/jira/browse/JBOSGI-151
*
* BundleA
* exports A
@@ -95,8 +95,6 @@
Bundle bundleB = sysContext.installBundle(getBundleLocation("jbosgi151-bundleB.jar"));
assertEquals("INSTALLED expected", Bundle.INSTALLED, bundleB.getState());
- System.out.println("FIXME [JBOSGI-151] Cannot resolve circular dependencies");
- /*
bundleB.start();
assertEquals("ACTIVE expected", Bundle.ACTIVE, bundleB.getState());
assertEquals("RESOLVED expected", Bundle.RESOLVED, bundleA.getState());
@@ -108,35 +106,61 @@
Class<?> classBA = bundleA.loadClass(BeanB.class.getName());
Class<?> classBB = bundleB.loadClass(BeanB.class.getName());
assertEquals("Class for BeanB", classBA, classBB);
- */
bundleB.uninstall();
bundleA.uninstall();
}
@Test
- public void testCircularWithSelfDependency() throws Exception
+ public void testCircularInstallCbeforeD() throws Exception
{
BundleContext sysContext = framework.getBundleContext();
+ Bundle bundleC = sysContext.installBundle(getBundleLocation("jbosgi151-bundleC.jar"));
+ assertEquals("INSTALLED expected", Bundle.INSTALLED, bundleC.getState());
+
Bundle bundleD = sysContext.installBundle(getBundleLocation("jbosgi151-bundleD.jar"));
assertEquals("INSTALLED expected", Bundle.INSTALLED, bundleD.getState());
- Bundle bundleC = sysContext.installBundle(getBundleLocation("jbosgi151-bundleC.jar"));
- assertEquals("INSTALLED expected", Bundle.INSTALLED, bundleC.getState());
-
bundleD.start();
assertEquals("ACTIVE expected", Bundle.ACTIVE, bundleD.getState());
assertEquals("RESOLVED expected", Bundle.RESOLVED, bundleC.getState());
+ Class<?> classBC = bundleC.loadClass(BeanB.class.getName());
+ Class<?> classBD = bundleD.loadClass(BeanB.class.getName());
+ assertEquals("Class for BeanB", classBC, classBD);
+
Class<?> classAC = bundleC.loadClass(BeanA.class.getName());
Class<?> classAD = bundleD.loadClass(BeanA.class.getName());
assertEquals("Class for BeanA", classAC, classAD);
+ bundleD.uninstall();
+ bundleC.uninstall();
+ }
+
+ @Test
+ public void testCircularInstallDbeforeC() throws Exception
+ {
+ BundleContext sysContext = framework.getBundleContext();
+
+ Bundle bundleD = sysContext.installBundle(getBundleLocation("jbosgi151-bundleD.jar"));
+ assertEquals("INSTALLED expected", Bundle.INSTALLED, bundleD.getState());
+
+ Bundle bundleC = sysContext.installBundle(getBundleLocation("jbosgi151-bundleC.jar"));
+ assertEquals("INSTALLED expected", Bundle.INSTALLED, bundleC.getState());
+
+ bundleD.start();
+ assertEquals("ACTIVE expected", Bundle.ACTIVE, bundleD.getState());
+ assertEquals("RESOLVED expected", Bundle.RESOLVED, bundleC.getState());
+
Class<?> classBC = bundleC.loadClass(BeanB.class.getName());
Class<?> classBD = bundleD.loadClass(BeanB.class.getName());
assertEquals("Class for BeanB", classBC, classBD);
+ Class<?> classAC = bundleC.loadClass(BeanA.class.getName());
+ Class<?> classAD = bundleD.loadClass(BeanA.class.getName());
+ assertEquals("Class for BeanA", classAC, classAD);
+
bundleD.uninstall();
bundleC.uninstall();
}
16 years, 10 months
JBoss-OSGI SVN: r93308 - in projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/plugins/facade: classloading and 1 other directory.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-09-09 06:32:15 -0400 (Wed, 09 Sep 2009)
New Revision: 93308
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/classloading/OSGiBundleCapability.java
projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/plugins/facade/classloading/OSGiBundleClassLoadingDeployer.java
projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/plugins/facade/classloading/OSGiBundleRequirement.java
projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/plugins/facade/classloading/OSGiPackageCapability.java
projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/plugins/facade/classloading/OSGiPackageCapabilityCache.java
projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/plugins/facade/classloading/OSGiPackageRequirement.java
Log:
[JBCL-24] Circular and self dependencies
Extended the Capability interface such that it allows capability/requirement matching in the context of both modules
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-09 10:29:32 UTC (rev 93307)
+++ projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/plugins/facade/bundle/OSGiBundleManager.java 2009-09-09 10:32:15 UTC (rev 93308)
@@ -61,6 +61,7 @@
import org.jboss.osgi.plugins.facade.api.PackageAdminServicePlugin;
import org.jboss.osgi.plugins.facade.api.Plugin;
import org.jboss.osgi.plugins.facade.api.ServicePlugin;
+import org.jboss.osgi.plugins.facade.classloading.OSGiPackageCapabilityCache;
import org.jboss.osgi.plugins.filter.NoFilter;
import org.jboss.osgi.plugins.metadata.AbstractOSGiMetaData;
import org.jboss.osgi.spi.metadata.OSGiMetaData;
@@ -83,6 +84,7 @@
* OSGiBundleManager.
*
* @author <a href="adrian(a)jboss.com">Adrian Brock</a>
+ * @author Thomas.Diesler(a)jboss.com
* @version $Revision: 1.1 $
*/
public class OSGiBundleManager
@@ -638,10 +640,12 @@
ControllerState requiredState = context.getRequiredState();
DeploymentStage requiredStage = unit.getRequiredStage();
+ OSGiPackageCapabilityCache capabilityCache = OSGiPackageCapabilityCache.getInstance(bundleState);
try
{
deployerClient.change(unit.getName(), DeploymentStages.CLASSLOADER);
deployerClient.checkComplete(unit.getName());
+ capabilityCache.commitPreliminaryMatches();
bundleState.changeState(Bundle.RESOLVED);
return true;
}
@@ -650,6 +654,8 @@
unit.setRequiredStage(requiredStage);
context.setRequiredState(requiredState);
+ capabilityCache.rollbackPreliminaryMatches();
+
if (errorOnFail)
throw new IllegalStateException("Error resolving bundle: " + bundleState, ex);
Modified: projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/plugins/facade/classloading/OSGiBundleCapability.java
===================================================================
--- projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/plugins/facade/classloading/OSGiBundleCapability.java 2009-09-09 10:29:32 UTC (rev 93307)
+++ projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/plugins/facade/classloading/OSGiBundleCapability.java 2009-09-09 10:32:15 UTC (rev 93308)
@@ -37,6 +37,7 @@
*
* todo BundlePermission/PROVIDE
* @author <a href="adrian(a)jboss.com">Adrian Brock</a>
+ * @author Thomas.Diesler(a)jboss.com
* @version $Revision: 1.1 $
*/
public class OSGiBundleCapability extends ModuleCapability
@@ -92,9 +93,9 @@
}
@Override
- public boolean resolves(Module module, Requirement requirement)
+ public boolean resolves(Module capModule, Module reqModule, Requirement requirement)
{
- if (super.resolves(module, requirement) == false)
+ if (super.resolves(capModule, reqModule, requirement) == false)
return false;
if (requirement instanceof OSGiBundleRequirement == false)
return true;
Modified: projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/plugins/facade/classloading/OSGiBundleClassLoadingDeployer.java
===================================================================
--- projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/plugins/facade/classloading/OSGiBundleClassLoadingDeployer.java 2009-09-09 10:29:32 UTC (rev 93307)
+++ projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/plugins/facade/classloading/OSGiBundleClassLoadingDeployer.java 2009-09-09 10:32:15 UTC (rev 93308)
@@ -108,7 +108,7 @@
{
for (PackageAttribute packageAttribute : exported)
{
- OSGiPackageCapability packageCapability = OSGiPackageCapability.create(osgiMetaData, packageAttribute);
+ OSGiPackageCapability packageCapability = OSGiPackageCapability.create(bundleState, packageAttribute);
capabilities.addCapability(packageCapability);
}
}
Modified: projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/plugins/facade/classloading/OSGiBundleRequirement.java
===================================================================
--- projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/plugins/facade/classloading/OSGiBundleRequirement.java 2009-09-09 10:29:32 UTC (rev 93307)
+++ projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/plugins/facade/classloading/OSGiBundleRequirement.java 2009-09-09 10:32:15 UTC (rev 93308)
@@ -35,6 +35,7 @@
*
* todo BundlePermission/REQUIRE
* @author <a href="adrian(a)jboss.com">Adrian Brock</a>
+ * @author Thomas.Diesler(a)jboss.com
* @version $Revision: 1.1 $
*/
public class OSGiBundleRequirement extends ModuleRequirement
@@ -110,8 +111,8 @@
return false;
if (super.equals(obj) ==false)
return false;
- OSGiBundleRequirement other = (OSGiBundleRequirement) obj;
- return getRequireBundle().equals(other.getRequireBundle());
+
+ return true;
}
@Override
Modified: projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/plugins/facade/classloading/OSGiPackageCapability.java
===================================================================
--- projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/plugins/facade/classloading/OSGiPackageCapability.java 2009-09-09 10:29:32 UTC (rev 93307)
+++ projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/plugins/facade/classloading/OSGiPackageCapability.java 2009-09-09 10:32:15 UTC (rev 93308)
@@ -28,6 +28,8 @@
import org.jboss.classloading.spi.dependency.Module;
import org.jboss.classloading.spi.metadata.Requirement;
import org.jboss.classloading.spi.version.VersionRange;
+import org.jboss.logging.Logger;
+import org.jboss.osgi.plugins.facade.bundle.OSGiBundleState;
import org.jboss.osgi.plugins.metadata.AbstractVersionRange;
import org.jboss.osgi.spi.metadata.OSGiMetaData;
import org.jboss.osgi.spi.metadata.PackageAttribute;
@@ -43,19 +45,23 @@
* todo uses
* todo include/exclude
* @author <a href="adrian(a)jboss.com">Adrian Brock</a>
+ * @author Thomas.Diesler(a)jboss.com
* @version $Revision: 1.1 $
*/
public class OSGiPackageCapability extends PackageCapability
{
/** The serialVersionUID */
- private static final long serialVersionUID = 6047222760667029014L;
+ private static final long serialVersionUID = 3940667616588052822L;
+
+ /** The log */
+ private static final Logger log = Logger.getLogger(OSGiPackageCapability.class);
+
+ /** The bundle state */
+ private OSGiBundleState bundleState;
- /** The metadata */
- private OSGiMetaData metadata;
-
/** The export package */
private PackageAttribute exportPackage;
-
+
/** The mandatory attributes */
private String[] mandatoryAttributes;
@@ -68,54 +74,44 @@
* @throws IllegalArgumentException for null metadata
*/
@SuppressWarnings("deprecation")
- public static OSGiPackageCapability create(OSGiMetaData metadata, PackageAttribute exportPackage)
+ public static OSGiPackageCapability create(OSGiBundleState bundleState, PackageAttribute exportPackage)
{
- if (metadata == null)
- throw new IllegalArgumentException("Null metadata");
+ if (bundleState == null)
+ throw new IllegalArgumentException("Null bundle");
String name = exportPackage.getAttribute();
String versionString = exportPackage.getParameterValue(Constants.VERSION_ATTRIBUTE, String.class);
-
+
String oldVersionString = exportPackage.getParameterValue(Constants.PACKAGE_SPECIFICATION_VERSION, String.class);
if (oldVersionString != null)
{
if (versionString != null && versionString.equals(oldVersionString) == false)
- throw new IllegalStateException(Constants.VERSION_ATTRIBUTE + " of " + versionString + " does not match " + Constants.PACKAGE_SPECIFICATION_VERSION + " of " + oldVersionString);
+ throw new IllegalStateException(Constants.VERSION_ATTRIBUTE + " of " + versionString + " does not match " + Constants.PACKAGE_SPECIFICATION_VERSION
+ + " of " + oldVersionString);
if (versionString == null)
versionString = oldVersionString;
}
-
+
Version version = null;
if (versionString != null)
{
// Handle version strings with quotes
if (versionString.startsWith("\"") && versionString.endsWith("\""))
versionString = versionString.substring(1, versionString.length() - 1);
-
+
version = Version.parseVersion(versionString);
}
-
- OSGiPackageCapability capability = new OSGiPackageCapability(name, version, metadata, exportPackage);
+
+ OSGiPackageCapability capability = new OSGiPackageCapability(bundleState, name, version, exportPackage);
capability.setSplitPackagePolicy(SplitPackagePolicy.First);
-
+
return capability;
}
-
- /**
- * Create a new OSGiPackageCapability.
- *
- * @param name the name
- * @param version the version pass null of the default version
- * @param metadata the metadata
- * @param exportPackage the export information
- * @throws IllegalArgumentException for a null name metadata or exportPackage
- */
- public OSGiPackageCapability(String name, Version version, OSGiMetaData metadata, PackageAttribute exportPackage)
+
+ private OSGiPackageCapability(OSGiBundleState bundleState, String name, Version version, PackageAttribute exportPackage)
{
super(name, version);
- if (metadata == null)
- throw new IllegalArgumentException("Null metadata");
- this.metadata = metadata;
+ this.bundleState = bundleState;
this.exportPackage = exportPackage;
String mandatory = exportPackage.getParameterValue(Constants.MANDATORY_DIRECTIVE, String.class);
@@ -133,77 +129,93 @@
if (exportPackage.getParameter(Constants.BUNDLE_VERSION_ATTRIBUTE) != null)
throw new IllegalStateException("You cannot specify " + Constants.BUNDLE_VERSION_ATTRIBUTE + " on an Export-Package");
}
-
- /**
- * Get the metadata.
- *
- * @return the metadata.
- */
- public OSGiMetaData getMetaData()
- {
- return metadata;
- }
+ @Override
@SuppressWarnings("deprecation")
- @Override
- public boolean resolves(Module module, Requirement requirement)
+ public boolean resolves(Module capModule, Module reqModule, Requirement requirement)
{
- if (super.resolves(module, requirement) == false)
+ if (super.resolves(capModule, reqModule, requirement) == false)
return false;
if (requirement instanceof OSGiPackageRequirement == false)
return true;
-
- OSGiPackageRequirement packageRequirement = (OSGiPackageRequirement) requirement;
- OSGiMetaData metaData = getMetaData();
+
+ OSGiPackageRequirement packageRequirement = (OSGiPackageRequirement)requirement;
+ OSGiMetaData metaData = bundleState.getOSGiMetaData();
PackageAttribute ourParameters = exportPackage;
PackageAttribute otherParameters = packageRequirement.getRequirePackage();
+
+ OSGiPackageCapabilityCache capabilityCache = OSGiPackageCapabilityCache.getInstance(bundleState);
+ if (capabilityCache.isBlacklistedMatch(requirement, capModule))
+ {
+ log.debug("Blacklisted: " + requirement + " " + capModule);
+ return false;
+ }
+
+ Module cachedModule = capabilityCache.getCachedMatch(requirement);
+ if (cachedModule == capModule)
+ {
+ log.debug("Cached: " + requirement + " " + capModule);
+ return true;
+ }
+
+ boolean validMatch = true;
+
// Check all the manadatory attributes are present
- if (mandatoryAttributes != null)
+ if (validMatch == true && mandatoryAttributes != null)
{
- if (otherParameters == null)
- return false;
-
- for (String mand : mandatoryAttributes)
+ if (otherParameters != null)
{
- if (otherParameters.getParameter(mand) == null)
- return false;
+ for (String mand : mandatoryAttributes)
+ {
+ if (otherParameters.getParameter(mand) == null)
+ {
+ validMatch = false;
+ break;
+ }
+ }
}
}
- if (otherParameters != null)
+
+ if (validMatch == true && otherParameters != null)
{
Map<String, Parameter> params = otherParameters.getParameters();
if (params != null && params.isEmpty() == false)
{
for (String name : params.keySet())
{
+ String otherValue = otherParameters.getParameterValue(name, String.class);
+ String ourValue = ourParameters.getParameterValue(name, String.class);
+
// todo we shouldn't mix attributes and directives in the metadata
if (Constants.BUNDLE_SYMBOLICNAME_ATTRIBUTE.equals(name))
{
- String otherValue = otherParameters.getParameterValue(name, String.class);
- return otherValue.equals(metaData.getBundleSymbolicName());
+ if (otherValue.equals(metaData.getBundleSymbolicName()) == false)
+ validMatch = false;
}
else if (Constants.BUNDLE_VERSION_ATTRIBUTE.equals(name))
{
- String otherValue = otherParameters.getParameterValue(name, String.class);
- VersionRange range = (VersionRange) AbstractVersionRange.valueOf(otherValue);
- return range.isInRange(metaData.getBundleVersion());
+ VersionRange range = (VersionRange)AbstractVersionRange.valueOf(otherValue);
+ if (range.isInRange(metaData.getBundleVersion()) == false)
+ validMatch = false;
}
- if (Constants.RESOLUTION_DIRECTIVE.equals(name) == false
- && Constants.PACKAGE_SPECIFICATION_VERSION.equals(name) == false
- && Constants.VERSION_ATTRIBUTE.equals(name) == false)
+ else if (Constants.RESOLUTION_DIRECTIVE.equals(name) == false
+ && Constants.PACKAGE_SPECIFICATION_VERSION.equals(name) == false
+ && Constants.VERSION_ATTRIBUTE.equals(name) == false)
{
- if (ourParameters == null)
- return false;
- String ourValue = ourParameters.getParameterValue(name, String.class);
- if (ourValue == null)
- return false;
- if (ourValue.equals(otherParameters.getParameterValue(name, String.class)) == false)
- return false;
+ if (ourValue == null || ourValue.equals(otherValue) == false)
+ validMatch = false;
}
+
+ if (validMatch == false)
+ break;
}
}
}
- return true;
+
+ if (validMatch == true && capModule == reqModule)
+ capabilityCache.addPreliminaryMatch(requirement, capModule);
+
+ return validMatch;
}
@Override
@@ -213,16 +225,17 @@
return true;
if (obj == null || obj instanceof OSGiPackageCapability == false)
return false;
- if (super.equals(obj) ==false)
+ if (super.equals(obj) == false)
return false;
- OSGiPackageCapability other = (OSGiPackageCapability) obj;
- return getMetaData().equals(other.getMetaData());
+
+ return true;
}
@Override
protected void toString(StringBuffer buffer)
{
super.toString(buffer);
+ OSGiMetaData metadata = bundleState.getOSGiMetaData();
ParameterizedAttribute parameters = metadata.getBundleParameters();
if (parameters != null)
{
Modified: projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/plugins/facade/classloading/OSGiPackageCapabilityCache.java
===================================================================
--- projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/plugins/facade/classloading/OSGiPackageCapabilityCache.java 2009-09-09 10:29:32 UTC (rev 93307)
+++ projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/plugins/facade/classloading/OSGiPackageCapabilityCache.java 2009-09-09 10:32:15 UTC (rev 93308)
@@ -25,38 +25,49 @@
import java.util.Map;
import org.jboss.classloading.spi.dependency.Module;
+import org.jboss.classloading.spi.dependency.RequirementDependencyItem;
import org.jboss.classloading.spi.metadata.Requirement;
+import org.jboss.dependency.spi.ControllerContext;
+import org.jboss.dependency.spi.DependencyInfo;
+import org.jboss.dependency.spi.DependencyItem;
+import org.jboss.deployers.structure.spi.DeploymentUnit;
+import org.jboss.osgi.plugins.facade.bundle.OSGiBundleState;
/**
- * [TODO]
+ * A package capabilty cache that helps the OSGiPackageCapability to decide
+ * if a given requirement matches against a capability in the context of both
+ * modules.
*
* @author Thomas.Diesler(a)jboss.com
* @since 08-Sep-2009
*/
public class OSGiPackageCapabilityCache
{
- // [TODO] remove static usage
- private static OSGiPackageCapabilityCache cacheInstance;
-
+ private OSGiBundleState bundleState;
private Map<Requirement, Module> preliminaryMatches = new HashMap<Requirement, Module>();
private Map<Requirement, Module> blacklistedMatches = new HashMap<Requirement, Module>();
private Map<Requirement, Module> cachedMatches = new HashMap<Requirement, Module>();
- private OSGiPackageCapabilityCache()
+ public static OSGiPackageCapabilityCache getInstance(OSGiBundleState bundleState)
{
- cacheInstance = this;
- }
-
- public static OSGiPackageCapabilityCache getInstance()
- {
+ DeploymentUnit unit = bundleState.getDeploymentUnit();
+ OSGiPackageCapabilityCache cacheInstance = unit.getAttachment(OSGiPackageCapabilityCache.class);
if (cacheInstance == null)
{
- cacheInstance = new OSGiPackageCapabilityCache();
+ cacheInstance = new OSGiPackageCapabilityCache(bundleState);
+ unit.addAttachment(OSGiPackageCapabilityCache.class, cacheInstance);
}
- return cacheInstance;
+ return cacheInstance;
}
+ private OSGiPackageCapabilityCache(OSGiBundleState bundleState)
+ {
+ if (bundleState == null)
+ throw new IllegalArgumentException("Null bundle");
+ this.bundleState = bundleState;
+ }
+
public Module getCachedMatch(Requirement requirement)
{
return cachedMatches.get(requirement);
@@ -67,21 +78,32 @@
preliminaryMatches.put(requirement, module);
}
- public boolean isValidMatch(Requirement requirement, Module module)
+ public boolean isBlacklistedMatch(Requirement requirement, Module module)
{
Module other = blacklistedMatches.get(requirement);
- return module != other;
+ return module == other;
}
- public void storePreliminaryMatches()
+ public void commitPreliminaryMatches()
{
cachedMatches.putAll(preliminaryMatches);
preliminaryMatches.clear();
}
- public void blacklistPreliminaryMatches()
+ public void rollbackPreliminaryMatches()
{
blacklistedMatches.putAll(preliminaryMatches);
preliminaryMatches.clear();
+
+ // Reset all resolved dependency items
+ // [JBKERNEL-54] DependencyItem inconsistency when multiple possible matches
+ DeploymentUnit unit = bundleState.getDeploymentUnit();
+ ControllerContext context = unit.getAttachment(ControllerContext.class);
+ DependencyInfo di = context.getDependencyInfo();
+ for (DependencyItem iDependOn : di.getIDependOn(RequirementDependencyItem.class))
+ {
+ if (iDependOn.isResolved())
+ iDependOn.unresolved(context.getController());
+ }
}
}
Modified: projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/plugins/facade/classloading/OSGiPackageRequirement.java
===================================================================
--- projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/plugins/facade/classloading/OSGiPackageRequirement.java 2009-09-09 10:29:32 UTC (rev 93307)
+++ projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/plugins/facade/classloading/OSGiPackageRequirement.java 2009-09-09 10:32:15 UTC (rev 93308)
@@ -36,6 +36,7 @@
*
* todo PackagePermission/IMPORT
* @author <a href="adrian(a)jboss.com">Adrian Brock</a>
+ * @author Thomas.Diesler(a)jboss.com
* @version $Revision: 1.1 $
*/
public class OSGiPackageRequirement extends PackageRequirement
@@ -120,8 +121,8 @@
return false;
if (super.equals(obj) == false)
return false;
- OSGiPackageRequirement other = (OSGiPackageRequirement)obj;
- return getRequirePackage().equals(other.getRequirePackage());
+
+ return true;
}
@Override
16 years, 10 months
JBoss-OSGI SVN: r93286 - in projects/jboss-osgi/trunk/testsuite/functional/src/test: resources/META-INF and 1 other directories.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-09-08 12:33:54 -0400 (Tue, 08 Sep 2009)
New Revision: 93286
Modified:
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi151/OSGI151TestCase.java
projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/META-INF/jboss-osgi-bootstrap.xml
projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi151/jbosgi151-bundleC.bnd
projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi151/jbosgi151-bundleD.bnd
Log:
[JBOSGI-151] Cannot resolve circular dependencies
Simulate compendium + jetty issue
Modified: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi151/OSGI151TestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi151/OSGI151TestCase.java 2009-09-08 16:33:03 UTC (rev 93285)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi151/OSGI151TestCase.java 2009-09-08 16:33:54 UTC (rev 93286)
@@ -30,6 +30,8 @@
import org.jboss.osgi.spi.testing.OSGiTestHelper;
import org.jboss.test.osgi.jbosgi151.bundleA.BeanA;
import org.jboss.test.osgi.jbosgi151.bundleB.BeanB;
+import org.junit.BeforeClass;
+import org.junit.Ignore;
import org.junit.Test;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
@@ -40,24 +42,51 @@
*
* https://jira.jboss.org/jira/browse/JBOSGI-143
*
- * A imports B
- * B imports A
+ * BundleA
+ * exports A
+ * imports B
+ *
+ * BundleB
+ * exports B
+ * imports A
+ *
+ * BundleC
+ * exports A, B
+ * imports A
*
- * C exports/imports A,B
- * D exports/imports A,B
+ * BundleD
+ * exports A,
+ * imports A, B
*
* @author thomas.diesler(a)jboss.com
* @since 07-Sep-2009
*/
public class OSGI151TestCase
{
+ private static Framework framework;
+
+ @BeforeClass
+ public static void beforeClass() throws Exception
+ {
+ OSGiBootstrapProvider bootProvider = OSGiBootstrap.getBootstrapProvider();
+ framework = bootProvider.getFramework();
+ framework.start();
+ }
+
+ @BeforeClass
+ public static void afterClass() throws Exception
+ {
+ if (framework != null)
+ {
+ framework.stop();
+ framework.waitForStop(2000);
+ }
+ }
+
@Test
+ @Ignore
public void testCircularNoSelfDependency() throws Exception
{
- OSGiBootstrapProvider bootProvider = OSGiBootstrap.getBootstrapProvider();
- Framework framework = bootProvider.getFramework();
- framework.start();
-
BundleContext sysContext = framework.getBundleContext();
Bundle bundleA = sysContext.installBundle(getBundleLocation("jbosgi151-bundleA.jar"));
@@ -67,37 +96,35 @@
assertEquals("INSTALLED expected", Bundle.INSTALLED, bundleB.getState());
System.out.println("FIXME [JBOSGI-151] Cannot resolve circular dependencies");
-// bundleB.start();
-// assertEquals("ACTIVE expected", Bundle.ACTIVE, bundleB.getState());
-// assertEquals("RESOLVED expected", Bundle.RESOLVED, bundleA.getState());
+ /*
+ bundleB.start();
+ assertEquals("ACTIVE expected", Bundle.ACTIVE, bundleB.getState());
+ assertEquals("RESOLVED expected", Bundle.RESOLVED, bundleA.getState());
-// Class<?> classAA = bundleA.loadClass(BeanA.class.getName());
-// Class<?> classAB = bundleB.loadClass(BeanA.class.getName());
-// assertEquals("Class for BeanA", classAA, classAB);
-//
-// Class<?> classBA = bundleA.loadClass(BeanB.class.getName());
-// Class<?> classBB = bundleB.loadClass(BeanB.class.getName());
-// assertEquals("Class for BeanB", classBA, classBB);
+ Class<?> classAA = bundleA.loadClass(BeanA.class.getName());
+ Class<?> classAB = bundleB.loadClass(BeanA.class.getName());
+ assertEquals("Class for BeanA", classAA, classAB);
- framework.stop();
- framework.waitForStop(1000);
+ Class<?> classBA = bundleA.loadClass(BeanB.class.getName());
+ Class<?> classBB = bundleB.loadClass(BeanB.class.getName());
+ assertEquals("Class for BeanB", classBA, classBB);
+ */
+
+ bundleB.uninstall();
+ bundleA.uninstall();
}
@Test
public void testCircularWithSelfDependency() throws Exception
{
- OSGiBootstrapProvider bootProvider = OSGiBootstrap.getBootstrapProvider();
- Framework framework = bootProvider.getFramework();
- framework.start();
-
BundleContext sysContext = framework.getBundleContext();
+ Bundle bundleD = sysContext.installBundle(getBundleLocation("jbosgi151-bundleD.jar"));
+ assertEquals("INSTALLED expected", Bundle.INSTALLED, bundleD.getState());
+
Bundle bundleC = sysContext.installBundle(getBundleLocation("jbosgi151-bundleC.jar"));
assertEquals("INSTALLED expected", Bundle.INSTALLED, bundleC.getState());
- Bundle bundleD = sysContext.installBundle(getBundleLocation("jbosgi151-bundleD.jar"));
- assertEquals("INSTALLED expected", Bundle.INSTALLED, bundleD.getState());
-
bundleD.start();
assertEquals("ACTIVE expected", Bundle.ACTIVE, bundleD.getState());
assertEquals("RESOLVED expected", Bundle.RESOLVED, bundleC.getState());
@@ -110,8 +137,8 @@
Class<?> classBD = bundleD.loadClass(BeanB.class.getName());
assertEquals("Class for BeanB", classBC, classBD);
- framework.stop();
- framework.waitForStop(1000);
+ bundleD.uninstall();
+ bundleC.uninstall();
}
private String getBundleLocation(String jarname)
Modified: projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/META-INF/jboss-osgi-bootstrap.xml
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/META-INF/jboss-osgi-bootstrap.xml 2009-09-08 16:33:03 UTC (rev 93285)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/META-INF/jboss-osgi-bootstrap.xml 2009-09-08 16:33:54 UTC (rev 93286)
@@ -52,20 +52,6 @@
********************************
-->
- <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">
- <value>${test.archive.directory}/bundles/org.osgi.compendium.jar</value>
- </list>
- </property>
- <property name="autoStart">
- <list elementClass="java.net.URL">
- <value>${test.archive.directory}/bundles/org.apache.felix.log.jar</value>
- <value>${test.archive.directory}/bundles/jboss-osgi-common.jar</value>
- </list>
- </property>
- </bean>
<bean name="OSGiFrameworkEventsPlugin" class="org.jboss.osgi.plugins.facade.plugins.FrameworkEventsPluginImpl">
<constructor><parameter><inject bean="OSGiBundleManager" /></parameter></constructor>
</bean>
Modified: projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi151/jbosgi151-bundleC.bnd
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi151/jbosgi151-bundleC.bnd 2009-09-08 16:33:03 UTC (rev 93285)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi151/jbosgi151-bundleC.bnd 2009-09-08 16:33:54 UTC (rev 93286)
@@ -2,4 +2,4 @@
Bundle-SymbolicName: jbosgi151-bundleC
Export-Package: org.jboss.test.osgi.jbosgi151.bundleA, org.jboss.test.osgi.jbosgi151.bundleB
-Import-Package: org.jboss.test.osgi.jbosgi151.bundleA, org.jboss.test.osgi.jbosgi151.bundleB
+Import-Package: org.jboss.test.osgi.jbosgi151.bundleA
Modified: projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi151/jbosgi151-bundleD.bnd
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi151/jbosgi151-bundleD.bnd 2009-09-08 16:33:03 UTC (rev 93285)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi151/jbosgi151-bundleD.bnd 2009-09-08 16:33:54 UTC (rev 93286)
@@ -1,5 +1,5 @@
# bnd build -classpath target/test-classes -output target/test-libs/jbosgi151-bundleD.jar src/test/resources/jbosgi151/bundleD.bnd
Bundle-SymbolicName: jbosgi151-bundleD
-Export-Package: org.jboss.test.osgi.jbosgi151.bundleA, org.jboss.test.osgi.jbosgi151.bundleB
+Export-Package: org.jboss.test.osgi.jbosgi151.bundleA
Import-Package: org.jboss.test.osgi.jbosgi151.bundleA, org.jboss.test.osgi.jbosgi151.bundleB
16 years, 10 months
JBoss-OSGI SVN: r93285 - projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/plugins/facade/classloading.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-09-08 12:33:03 -0400 (Tue, 08 Sep 2009)
New Revision: 93285
Added:
projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/plugins/facade/classloading/OSGiPackageCapabilityCache.java
Log:
Add capability cache - wip
Added: projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/plugins/facade/classloading/OSGiPackageCapabilityCache.java
===================================================================
--- projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/plugins/facade/classloading/OSGiPackageCapabilityCache.java (rev 0)
+++ projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/plugins/facade/classloading/OSGiPackageCapabilityCache.java 2009-09-08 16:33:03 UTC (rev 93285)
@@ -0,0 +1,87 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2009, Red Hat Middleware LLC, and individual contributors
+* as indicated by the @author tags. See the copyright.txt file 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.osgi.plugins.facade.classloading;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.jboss.classloading.spi.dependency.Module;
+import org.jboss.classloading.spi.metadata.Requirement;
+
+
+/**
+ * [TODO]
+ *
+ * @author Thomas.Diesler(a)jboss.com
+ * @since 08-Sep-2009
+ */
+public class OSGiPackageCapabilityCache
+{
+ // [TODO] remove static usage
+ private static OSGiPackageCapabilityCache cacheInstance;
+
+ private Map<Requirement, Module> preliminaryMatches = new HashMap<Requirement, Module>();
+ private Map<Requirement, Module> blacklistedMatches = new HashMap<Requirement, Module>();
+ private Map<Requirement, Module> cachedMatches = new HashMap<Requirement, Module>();
+
+ private OSGiPackageCapabilityCache()
+ {
+ cacheInstance = this;
+ }
+
+ public static OSGiPackageCapabilityCache getInstance()
+ {
+ if (cacheInstance == null)
+ {
+ cacheInstance = new OSGiPackageCapabilityCache();
+ }
+ return cacheInstance;
+ }
+
+ public Module getCachedMatch(Requirement requirement)
+ {
+ return cachedMatches.get(requirement);
+ }
+
+ public void addPreliminaryMatch(Requirement requirement, Module module)
+ {
+ preliminaryMatches.put(requirement, module);
+ }
+
+ public boolean isValidMatch(Requirement requirement, Module module)
+ {
+ Module other = blacklistedMatches.get(requirement);
+ return module != other;
+ }
+
+ public void storePreliminaryMatches()
+ {
+ cachedMatches.putAll(preliminaryMatches);
+ preliminaryMatches.clear();
+ }
+
+ public void blacklistPreliminaryMatches()
+ {
+ blacklistedMatches.putAll(preliminaryMatches);
+ preliminaryMatches.clear();
+ }
+}
16 years, 10 months
JBoss-OSGI SVN: r93213 - projects/jboss-osgi/trunk/distribution/installer/src/main/resources/jbossas.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-09-04 12:49:40 -0400 (Fri, 04 Sep 2009)
New Revision: 93213
Modified:
projects/jboss-osgi/trunk/distribution/installer/src/main/resources/jbossas/jboss-beans-jbossmc.xml
Log:
[JBOSGI-148] Autostart bundles when deployed in JBossAS
Use DeployersWrapper
Modified: projects/jboss-osgi/trunk/distribution/installer/src/main/resources/jbossas/jboss-beans-jbossmc.xml
===================================================================
--- projects/jboss-osgi/trunk/distribution/installer/src/main/resources/jbossas/jboss-beans-jbossmc.xml 2009-09-04 16:44:06 UTC (rev 93212)
+++ projects/jboss-osgi/trunk/distribution/installer/src/main/resources/jbossas/jboss-beans-jbossmc.xml 2009-09-04 16:49:40 UTC (rev 93213)
@@ -49,6 +49,13 @@
<entry><key>org.osgi.service.http.port</key><value>8090</value></entry>
<!-- Config Admin Service -->
<entry><key>felix.cm.dir</key><value>${jboss.server.data.dir}/data/osgi-configadmin</value></entry>
+ <!-- JMX bundle properties -->
+ <entry><key>org.jboss.osgi.jmx.host</key><value>${jboss.bind.address}</value></entry>
+ <entry><key>org.jboss.osgi.jmx.port</key><value>1098</value></entry>
+ <!-- JNDI bundle properties -->
+ <entry><key>org.jboss.osgi.jndi.host</key><value>${jboss.bind.address}</value></entry>
+ <entry><key>org.jboss.osgi.jndi.rmi.port</key><value>1098</value></entry>
+ <entry><key>org.jboss.osgi.jndi.port</key><value>1099</value></entry>
</map>
</property>
<incallback method="addPlugin" />
@@ -98,10 +105,14 @@
********************************
-->
- <!-- Bundle Structure -->
- <bean name="BundleStructure" class="org.jboss.osgi.deployer.BundleStructureDeployer" />
-
- <!-- OSGI Deployment -->
+ <bean name="OSGiDeployersWrapper" class="org.jboss.osgi.plugins.deployers.bundle.OSGiDeployersWrapper" >
+ <constructor>
+ <parameter><inject bean="MainDeployer"/></parameter>
+ <parameter><inject bean="OSGiBundleManager"/></parameter>
+ </constructor>
+ </bean>
+
+ <bean name="OSGiBundleStructure" class="org.jboss.osgi.deployer.BundleStructureDeployer" />
<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>
@@ -120,8 +131,9 @@
-->
<bean name="OSGiClassLoaderDomain" class="org.jboss.osgi.plugins.facade.classloading.OSGiClassLoaderDomain" >
- <constructor><parameter><inject bean="OSGiBundleManager" /></parameter><parameter>OSGiDomain</parameter></constructor>
+ <constructor><parameter>OSGiClassLoaderDomain</parameter></constructor>
<property name="classLoaderSystem"><inject bean="ClassLoaderSystem"/></property>
+ <property name="bundleManager"><inject bean="OSGiBundleManager" /></property>
</bean>
<!--
16 years, 10 months
JBoss-OSGI SVN: r93212 - in projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/plugins: facade/classloading and 1 other directory.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-09-04 12:44:06 -0400 (Fri, 04 Sep 2009)
New Revision: 93212
Added:
projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/plugins/deployers/bundle/OSGiDeployersWrapper.java
Modified:
projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/plugins/facade/classloading/OSGiClassLoaderSystem.java
Log:
[JBOSGI-148] Autostart bundles when deployed in JBossAS
Use DeployersWrapper
Added: projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/plugins/deployers/bundle/OSGiDeployersWrapper.java
===================================================================
--- projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/plugins/deployers/bundle/OSGiDeployersWrapper.java (rev 0)
+++ projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/plugins/deployers/bundle/OSGiDeployersWrapper.java 2009-09-04 16:44:06 UTC (rev 93212)
@@ -0,0 +1,203 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2009, Red Hat Middleware LLC, and individual contributors
+* as indicated by the @author tags. See the copyright.txt file 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.osgi.plugins.deployers.bundle;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+import java.util.Map;
+
+import org.jboss.deployers.client.spi.Deployment;
+import org.jboss.deployers.client.spi.main.MainDeployer;
+import org.jboss.deployers.plugins.main.MainDeployerImpl;
+import org.jboss.deployers.spi.DeploymentException;
+import org.jboss.deployers.spi.deployer.Deployers;
+import org.jboss.deployers.spi.deployer.DeploymentStage;
+import org.jboss.deployers.spi.deployer.DeploymentStages;
+import org.jboss.deployers.structure.spi.DeploymentContext;
+import org.jboss.deployers.structure.spi.DeploymentUnit;
+import org.jboss.logging.Logger;
+import org.jboss.managed.api.ManagedObject;
+import org.jboss.osgi.plugins.facade.bundle.OSGiBundleManager;
+import org.jboss.osgi.plugins.facade.bundle.OSGiBundleState;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceReference;
+import org.osgi.service.packageadmin.PackageAdmin;
+
+/**
+ * A Deployers implementation that wraps the deployers that are associated with the MainDeployer.
+ *
+ * @author Thomas.Diesler(a)jboss.com
+ * @since 04-Sep-2009
+ */
+public class OSGiDeployersWrapper implements Deployers
+{
+ /** The log */
+ private static final Logger log = Logger.getLogger(OSGiDeployersWrapper.class);
+
+ private MainDeployer mainDeployer;
+ private Deployers deployers;
+ private OSGiBundleManager bundleManager;
+ private PackageAdmin packageAdmin;
+
+ /** The list of unresolved bundles */
+ private List<OSGiBundleState> unresolvedBundles = new ArrayList<OSGiBundleState>();
+
+ public OSGiDeployersWrapper(MainDeployer mainDeployer, OSGiBundleManager bundleManager)
+ {
+ if (bundleManager == null)
+ throw new IllegalArgumentException("Null bundleManager");
+ if (mainDeployer instanceof MainDeployerImpl == false)
+ throw new IllegalStateException("Cannot instrument: " + mainDeployer);
+
+ this.mainDeployer = mainDeployer;
+ this.bundleManager = bundleManager;
+
+ // Swap the deployers implementation
+ MainDeployerImpl mainDeployerImpl = (MainDeployerImpl)mainDeployer;
+ this.deployers = mainDeployerImpl.getDeployers();
+ mainDeployerImpl.setDeployers(this);
+ }
+
+ private PackageAdmin getPackageAdmin()
+ {
+ if (packageAdmin == null)
+ {
+ BundleContext sysContext = bundleManager.getSystemContext();
+ ServiceReference sref = sysContext.getServiceReference(PackageAdmin.class.getName());
+ if (sref == null)
+ throw new IllegalStateException("Cannot obtain PackageAdmin");
+
+ packageAdmin = (PackageAdmin)sysContext.getService(sref);
+ }
+ return packageAdmin;
+ }
+
+ public void process(List<DeploymentContext> deploy, List<DeploymentContext> undeploy)
+ {
+ // Delegate to the original deployers
+ deployers.process(deploy, undeploy);
+
+ // OSGi bundles resolve phase
+ afterDeployersProcess(deploy, undeploy);
+ }
+
+ private void afterDeployersProcess(List<DeploymentContext> deploy, List<DeploymentContext> undeploy)
+ {
+ // Process undeploy contexts
+ if (undeploy != null)
+ {
+ for (DeploymentContext context : undeploy)
+ {
+ DeploymentUnit unit = context.getDeploymentUnit();
+ OSGiBundleState bundle = unit.getAttachment(OSGiBundleState.class);
+ if (bundle != null)
+ {
+ unresolvedBundles.remove(bundle);
+ }
+ }
+ }
+
+ // Process deploy contexts
+ if (deploy != null)
+ {
+ // Collect unresolved bundles
+ for (DeploymentContext context : deploy)
+ {
+ DeploymentUnit unit = context.getDeploymentUnit();
+ OSGiBundleState bundle = unit.getAttachment(OSGiBundleState.class);
+ if (bundle != null && bundle.getState() == Bundle.INSTALLED)
+ {
+ unresolvedBundles.add(0, bundle);
+ }
+ }
+
+ // Try to resolve all unresolved bundles
+ if (unresolvedBundles.isEmpty() == false)
+ {
+ OSGiBundleState[] unresolved = new OSGiBundleState[unresolvedBundles.size()];
+ unresolvedBundles.toArray(unresolved);
+
+ // Use PackageAdmin to resolve the bundles
+ getPackageAdmin().resolveBundles(unresolved);
+
+ for (OSGiBundleState aux : unresolved)
+ {
+ if (aux.getState() != Bundle.RESOLVED)
+ log.info("Unresolved: " + aux);
+
+ if (aux.getState() == Bundle.RESOLVED)
+ {
+ unresolvedBundles.remove(aux);
+
+ try
+ {
+ // When resolved progress to INSTALLED
+ String name = aux.getDeploymentUnit().getName();
+ mainDeployer.change(name, DeploymentStages.INSTALLED);
+ }
+ catch (DeploymentException ex)
+ {
+ log.error(ex);
+ }
+ }
+ }
+ }
+ }
+ }
+
+ public void change(DeploymentContext context, DeploymentStage stage) throws DeploymentException
+ {
+ deployers.change(context, stage);
+ }
+
+ public void checkComplete(DeploymentContext... contexts) throws DeploymentException
+ {
+ deployers.checkComplete(contexts);
+ }
+
+ public void checkComplete(Collection<DeploymentContext> errors, Collection<Deployment> missingDeployer) throws DeploymentException
+ {
+ deployers.checkComplete(errors, missingDeployer);
+ }
+
+ public void checkStructureComplete(DeploymentContext... contexts) throws DeploymentException
+ {
+ deployers.checkStructureComplete(contexts);
+ }
+
+ public DeploymentStage getDeploymentStage(DeploymentContext context) throws DeploymentException
+ {
+ return deployers.getDeploymentStage(context);
+ }
+
+ public Map<String, ManagedObject> getManagedObjects(DeploymentContext context) throws DeploymentException
+ {
+ return deployers.getManagedObjects(context);
+ }
+
+ public void shutdown()
+ {
+ deployers.shutdown();
+ }
+}
Property changes on: projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/plugins/deployers/bundle/OSGiDeployersWrapper.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/plugins/facade/classloading/OSGiClassLoaderSystem.java
===================================================================
--- projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/plugins/facade/classloading/OSGiClassLoaderSystem.java 2009-09-04 15:12:18 UTC (rev 93211)
+++ projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/plugins/facade/classloading/OSGiClassLoaderSystem.java 2009-09-04 16:44:06 UTC (rev 93212)
@@ -41,7 +41,6 @@
{
/**
* Create a new OSGiClassLoaderSystem.
- * @param bundleManager the bundleManager
* @throws IllegalArgumentException for a null bundle manager
*/
public OSGiClassLoaderSystem()
16 years, 10 months
JBoss-OSGI SVN: r93199 - in projects/jboss-osgi/projects/runtime/microcontainer/trunk/src: main/java/org/jboss/osgi/plugins/facade/bundle and 3 other directories.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-09-04 05:40:06 -0400 (Fri, 04 Sep 2009)
New Revision: 93199
Added:
projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/plugins/deployers/bundle/BundleRequiredStageDeployer.java
projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/plugins/deployers/bundle/BundleResetDeployer.java
projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/plugins/deployers/bundle/BundleResolveDeployer.java
projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/plugins/deployers/bundle/BundleResolver.java
projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/plugins/deployers/bundle/BundleStartStopDeployer.java
projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/test/resources/log4j-example.xml
Modified:
projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/plugins/deployers/bundle/OSGiBundleActivatorDeployer.java
projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/plugins/deployers/bundle/OSGiBundleResolverDeployer.java
projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/plugins/deployers/bundle/OSGiBundleStateDeployer.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/facade/service/PackageAdminImpl.java
Log:
[JBOSGI-148] Autostart bundles when deployed in JBossAS
Added: projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/plugins/deployers/bundle/BundleRequiredStageDeployer.java
===================================================================
--- projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/plugins/deployers/bundle/BundleRequiredStageDeployer.java (rev 0)
+++ projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/plugins/deployers/bundle/BundleRequiredStageDeployer.java 2009-09-04 09:40:06 UTC (rev 93199)
@@ -0,0 +1,54 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.osgi.plugins.deployers.bundle;
+
+import org.jboss.deployers.spi.DeploymentException;
+import org.jboss.deployers.spi.deployer.DeploymentStages;
+import org.jboss.deployers.spi.deployer.helpers.AbstractSimpleRealDeployer;
+import org.jboss.deployers.structure.spi.DeploymentUnit;
+import org.jboss.osgi.spi.metadata.OSGiMetaData;
+
+/**
+ * Change required stage to reset.
+ *
+ * @author <a href="mailto:ales.justin@jboss.org">Ales Justin</a>
+ */
+public class BundleRequiredStageDeployer extends AbstractSimpleRealDeployer<OSGiMetaData>
+{
+ public BundleRequiredStageDeployer()
+ {
+ super(OSGiMetaData.class);
+ setStage(DeploymentStages.POST_CLASSLOADER);
+ setTopLevelOnly(true);
+ }
+
+ public void deploy(DeploymentUnit unit, OSGiMetaData deployment) throws DeploymentException
+ {
+ unit.setRequiredStage(BundleResolver.RESET_STAGE);
+ }
+
+ @Override
+ public void undeploy(DeploymentUnit unit, OSGiMetaData deployment)
+ {
+ unit.setRequiredStage(DeploymentStages.INSTALLED);
+ }
+}
\ No newline at end of file
Property changes on: projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/plugins/deployers/bundle/BundleRequiredStageDeployer.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/plugins/deployers/bundle/BundleResetDeployer.java
===================================================================
--- projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/plugins/deployers/bundle/BundleResetDeployer.java (rev 0)
+++ projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/plugins/deployers/bundle/BundleResetDeployer.java 2009-09-04 09:40:06 UTC (rev 93199)
@@ -0,0 +1,55 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.osgi.plugins.deployers.bundle;
+
+import org.jboss.deployers.spi.DeploymentException;
+import org.jboss.deployers.spi.deployer.helpers.AbstractSimpleRealDeployer;
+import org.jboss.deployers.structure.spi.DeploymentUnit;
+import org.jboss.osgi.spi.metadata.OSGiMetaData;
+
+/**
+ * Simple bundle reset deployer.
+ *
+ * @author <a href="mailto:ales.justin@jboss.org">Ales Justin</a>
+ */
+public class BundleResetDeployer extends AbstractSimpleRealDeployer<OSGiMetaData>
+{
+ private BundleResolver resolver;
+
+ public BundleResetDeployer(BundleResolver resolver)
+ {
+ super(OSGiMetaData.class);
+
+ if (resolver == null)
+ throw new IllegalArgumentException("Null resolver");
+
+ this.resolver = resolver;
+
+ setStage(BundleResolver.RESET_STAGE);
+ setTopLevelOnly(true);
+ }
+
+ public void deploy(DeploymentUnit unit, OSGiMetaData deployment) throws DeploymentException
+ {
+ resolver.reset(unit);
+ }
+}
\ No newline at end of file
Property changes on: projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/plugins/deployers/bundle/BundleResetDeployer.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/plugins/deployers/bundle/BundleResolveDeployer.java
===================================================================
--- projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/plugins/deployers/bundle/BundleResolveDeployer.java (rev 0)
+++ projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/plugins/deployers/bundle/BundleResolveDeployer.java 2009-09-04 09:40:06 UTC (rev 93199)
@@ -0,0 +1,58 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.osgi.plugins.deployers.bundle;
+
+import org.jboss.classloading.spi.dependency.Module;
+import org.jboss.deployers.spi.DeploymentException;
+import org.jboss.deployers.spi.deployer.DeploymentStages;
+import org.jboss.deployers.spi.deployer.helpers.AbstractSimpleRealDeployer;
+import org.jboss.deployers.structure.spi.DeploymentUnit;
+import org.jboss.osgi.spi.metadata.OSGiMetaData;
+
+/**
+ * Simple bundle resolve deployer.
+ *
+ * @author <a href="mailto:ales.justin@jboss.org">Ales Justin</a>
+ */
+public class BundleResolveDeployer extends AbstractSimpleRealDeployer<OSGiMetaData>
+{
+ private BundleResolver resolver;
+
+ public BundleResolveDeployer(BundleResolver resolver)
+ {
+ super(OSGiMetaData.class);
+
+ if (resolver == null)
+ throw new IllegalArgumentException("Null resolver");
+
+ this.resolver = resolver;
+
+ addInput(Module.class);
+ setStage(DeploymentStages.DESCRIBE);
+ setTopLevelOnly(true);
+ }
+
+ public void deploy(DeploymentUnit unit, OSGiMetaData deployment) throws DeploymentException
+ {
+ resolver.resolve(unit);
+ }
+}
\ No newline at end of file
Property changes on: projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/plugins/deployers/bundle/BundleResolveDeployer.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/plugins/deployers/bundle/BundleResolver.java
===================================================================
--- projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/plugins/deployers/bundle/BundleResolver.java (rev 0)
+++ projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/plugins/deployers/bundle/BundleResolver.java 2009-09-04 09:40:06 UTC (rev 93199)
@@ -0,0 +1,125 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.osgi.plugins.deployers.bundle;
+
+import java.util.HashSet;
+import java.util.Set;
+import java.util.concurrent.CopyOnWriteArraySet;
+
+import org.jboss.dependency.spi.Controller;
+import org.jboss.dependency.spi.ControllerContext;
+import org.jboss.dependency.spi.ControllerState;
+import org.jboss.dependency.spi.DependencyInfo;
+import org.jboss.dependency.spi.DependencyItem;
+import org.jboss.deployers.spi.deployer.DeploymentStage;
+import org.jboss.deployers.spi.deployer.DeploymentStages;
+import org.jboss.deployers.structure.spi.DeploymentUnit;
+
+/**
+ * Simple bundle resolve helper.
+ *
+ * @author <a href="mailto:ales.justin@jboss.org">Ales Justin</a>
+ */
+public class BundleResolver
+{
+ static final ControllerState DESCRIBED_STATE = new ControllerState(DeploymentStages.DESCRIBE.getName());
+ static final ControllerState CLASSLOADER_STATE = new ControllerState(DeploymentStages.CLASSLOADER.getName());
+
+ static final ControllerState RESET_STATE = new ControllerState("Reset");
+ static final DeploymentStage RESET_STAGE = new DeploymentStage("Reset", "Installed");
+
+ private Set<DeploymentUnit> units = new CopyOnWriteArraySet<DeploymentUnit>();
+
+ public BundleResolver(Controller controller)
+ {
+ controller.addState(RESET_STATE, null);
+ }
+
+ void resolve(DeploymentUnit unit)
+ {
+ run(unit, new Action()
+ {
+ public void resolved(DeploymentUnit unit)
+ {
+ unit.setRequiredStage(DeploymentStages.CLASSLOADER);
+ for (DeploymentUnit unresolved : units)
+ {
+ unresolved.setRequiredStage(DeploymentStages.CLASSLOADER); // try moving
+ ControllerContext context = unresolved.getAttachment(ControllerContext.class);
+ if (context != null)
+ context.setRequiredState(CLASSLOADER_STATE);
+ }
+ }
+
+ public void unresolved(DeploymentUnit unit)
+ {
+ units.add(unit);
+ }
+ });
+ }
+
+ void reset(DeploymentUnit unit)
+ {
+ units.remove(unit); // remove, as we're clearly resolved
+
+ Set<DeploymentUnit> copy = new HashSet<DeploymentUnit>(units);
+ for (DeploymentUnit unresolved : copy)
+ {
+ run(unresolved, new Action()
+ {
+ public void resolved(DeploymentUnit unit)
+ {
+ units.remove(unit);
+ }
+
+ public void unresolved(DeploymentUnit unit)
+ {
+ unit.setRequiredStage(DeploymentStages.DESCRIBE); // move back
+ ControllerContext context = unit.getAttachment(ControllerContext.class);
+ if (context != null)
+ context.setRequiredState(DESCRIBED_STATE);
+ }
+ });
+ }
+ }
+
+ protected void run(DeploymentUnit unit, Action action)
+ {
+ ControllerContext context = unit.getAttachment(ControllerContext.class);
+ if (context != null)
+ {
+ DependencyInfo info = context.getDependencyInfo();
+ Set<DependencyItem> unresolvedDependencies = info.getUnresolvedDependencies(CLASSLOADER_STATE);
+ if (unresolvedDependencies == null || unresolvedDependencies.isEmpty())
+ action.resolved(unit);
+ else
+ action.unresolved(unit);
+ }
+ }
+
+ private interface Action
+ {
+ void resolved(DeploymentUnit unit);
+
+ void unresolved(DeploymentUnit unit);
+ }
+}
\ No newline at end of file
Property changes on: projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/plugins/deployers/bundle/BundleResolver.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/plugins/deployers/bundle/BundleStartStopDeployer.java
===================================================================
--- projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/plugins/deployers/bundle/BundleStartStopDeployer.java (rev 0)
+++ projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/plugins/deployers/bundle/BundleStartStopDeployer.java 2009-09-04 09:40:06 UTC (rev 93199)
@@ -0,0 +1,69 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.osgi.plugins.deployers.bundle;
+
+import org.jboss.deployers.spi.DeploymentException;
+import org.jboss.deployers.spi.deployer.DeploymentStages;
+import org.jboss.deployers.spi.deployer.helpers.AbstractSimpleRealDeployer;
+import org.jboss.deployers.structure.spi.DeploymentUnit;
+import org.jboss.osgi.plugins.facade.bundle.OSGiBundleState;
+import org.osgi.framework.BundleException;
+
+/**
+ * Simple bundle start/stop deployer.
+ *
+ * @author <a href="mailto:ales.justin@jboss.org">Ales Justin</a>
+ */
+public class BundleStartStopDeployer extends AbstractSimpleRealDeployer<OSGiBundleState>
+{
+ public BundleStartStopDeployer()
+ {
+ super(OSGiBundleState.class);
+ setStage(DeploymentStages.CLASSLOADER);
+ setTopLevelOnly(true);
+ }
+
+ public void deploy(DeploymentUnit unit, OSGiBundleState deployment) throws DeploymentException
+ {
+ try
+ {
+ deployment.start();
+ }
+ catch (BundleException e)
+ {
+ throw DeploymentException.rethrowAsDeploymentException("Cannot start bundle.", e);
+ }
+ }
+
+ @Override
+ public void undeploy(DeploymentUnit unit, OSGiBundleState deployment)
+ {
+ try
+ {
+ deployment.stop();
+ }
+ catch (BundleException e)
+ {
+ log.warn("Exception stopping bundle: " + e);
+ }
+ }
+}
Property changes on: projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/plugins/deployers/bundle/BundleStartStopDeployer.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/plugins/deployers/bundle/OSGiBundleActivatorDeployer.java
===================================================================
--- projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/plugins/deployers/bundle/OSGiBundleActivatorDeployer.java 2009-09-04 09:32:11 UTC (rev 93198)
+++ projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/plugins/deployers/bundle/OSGiBundleActivatorDeployer.java 2009-09-04 09:40:06 UTC (rev 93199)
@@ -30,16 +30,15 @@
* OSGiBundleActivatorDeployer.
*
* @author <a href="adrian(a)jboss.com">Adrian Brock</a>
+ * @author Thomas.Diesler(a)jboss.com
* @version $Revision: 1.1 $
*/
public class OSGiBundleActivatorDeployer extends AbstractSimpleRealDeployer<OSGiBundleState>
{
- /**
- * Create a new BundleStateDeployer.
- */
public OSGiBundleActivatorDeployer()
{
super(OSGiBundleState.class);
+ setTopLevelOnly(true);
}
@Override
Modified: projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/plugins/deployers/bundle/OSGiBundleResolverDeployer.java
===================================================================
--- projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/plugins/deployers/bundle/OSGiBundleResolverDeployer.java 2009-09-04 09:32:11 UTC (rev 93198)
+++ projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/plugins/deployers/bundle/OSGiBundleResolverDeployer.java 2009-09-04 09:40:06 UTC (rev 93199)
@@ -21,13 +21,25 @@
*/
package org.jboss.osgi.plugins.deployers.bundle;
-import org.jboss.classloading.spi.metadata.ClassLoadingMetaData;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.jboss.dependency.spi.ControllerContext;
+import org.jboss.dependency.spi.ControllerState;
+import org.jboss.dependency.spi.DependencyInfo;
+import org.jboss.dependency.spi.LifecycleCallbackItem;
+import org.jboss.deployers.client.spi.DeployerClient;
+import org.jboss.deployers.client.spi.main.MainDeployer;
import org.jboss.deployers.spi.DeploymentException;
import org.jboss.deployers.spi.deployer.DeploymentStages;
import org.jboss.deployers.spi.deployer.helpers.AbstractSimpleRealDeployer;
import org.jboss.deployers.structure.spi.DeploymentUnit;
-import org.jboss.osgi.plugins.facade.bundle.OSGiBundleManager;
+import org.jboss.logging.Logger;
import org.jboss.osgi.plugins.facade.bundle.OSGiBundleState;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceReference;
+import org.osgi.service.packageadmin.PackageAdmin;
/**
* OSGiBundleResolverDeployer.
@@ -37,22 +49,120 @@
*/
public class OSGiBundleResolverDeployer extends AbstractSimpleRealDeployer<OSGiBundleState>
{
- /**
- * Create a new BundleStateDeployer.
- */
+ /** The log */
+ private static final Logger log = Logger.getLogger(OSGiBundleResolverDeployer.class);
+
+ /** The list of unresolved bundles */
+ private List<OSGiBundleState> unresolvedBundles = new ArrayList<OSGiBundleState>();
+
public OSGiBundleResolverDeployer()
{
super(OSGiBundleState.class);
+ setStage(DeploymentStages.DESCRIBE);
setTopLevelOnly(true);
- addInput(ClassLoadingMetaData.class);
- setStage(DeploymentStages.POST_PARSE);
}
@Override
public void deploy(DeploymentUnit unit, OSGiBundleState bundleState) throws DeploymentException
{
- unit.setRequiredStage(DeploymentStages.INSTALLED);
- OSGiBundleManager bundleManager = bundleState.getBundleManager();
- bundleManager.resolve(bundleState, false);
+ bundleState.getBundleManager();
+
+ ControllerContext context = unit.getAttachment(ControllerContext.class);
+ DependencyInfo di = context.getDependencyInfo();
+
+ LifecycleCallbackItem lifecycleCallbackItem = new LifecycleCallback(unit);
+ di.addLifecycleCallback(lifecycleCallbackItem);
}
+
+ private class LifecycleCallback implements LifecycleCallbackItem
+ {
+ private DeploymentUnit unit;
+ private PackageAdmin packageAdmin;
+ private DeployerClient deployerClient;
+
+ public LifecycleCallback(DeploymentUnit unit)
+ {
+ this.unit = unit;
+
+ OSGiBundleState bundleState = unit.getAttachment(OSGiBundleState.class);
+ BundleContext sysContext = bundleState.getBundleManager().getSystemContext();
+ ServiceReference sref = sysContext.getServiceReference(PackageAdmin.class.getName());
+ packageAdmin = (PackageAdmin)sysContext.getService(sref);
+
+ deployerClient = unit.getAttachment(MainDeployer.class);
+ }
+
+ public void uninstall(ControllerContext ctx)
+ {
+ OSGiBundleState bundleState = unit.getAttachment(OSGiBundleState.class);
+ unresolvedBundles.remove(bundleState);
+ }
+
+ public void install(ControllerContext ctx) throws Exception
+ {
+ Runnable runnable = new Runnable()
+ {
+ public void run()
+ {
+ try
+ {
+ // [TODO] remove this hack and find a way to trigger
+ // PackageAdmin after the context has been deployed
+ Thread.sleep(100);
+ }
+ catch (InterruptedException e)
+ {
+ // ignore
+ }
+
+ OSGiBundleState bundleState = unit.getAttachment(OSGiBundleState.class);
+
+ // Add the new bundle to the list of unresolved
+ unresolvedBundles.add(0, bundleState);
+ OSGiBundleState[] unresolved = new OSGiBundleState[unresolvedBundles.size()];
+ unresolvedBundles.toArray(unresolved);
+
+ // Try to resolve all unresolved bundles
+ packageAdmin.resolveBundles(unresolved);
+ if (bundleState.getState() != Bundle.RESOLVED)
+ log.info("Unresolved: " + bundleState);
+
+ for (OSGiBundleState aux : unresolved)
+ {
+ if (aux.getState() == Bundle.RESOLVED)
+ {
+ unresolvedBundles.remove(aux);
+
+ try
+ {
+ // When resolved progress to INSTALLED
+ String name = aux.getDeploymentUnit().getName();
+ deployerClient.change(name, DeploymentStages.INSTALLED);
+ }
+ catch (DeploymentException ex)
+ {
+ log.error(ex);
+ }
+ }
+ }
+ }
+ };
+ new Thread(runnable).start();
+ }
+
+ public ControllerState getWhenRequired()
+ {
+ return new ControllerState(getStage().getName());
+ }
+
+ public ControllerState getDependentState()
+ {
+ return null;
+ }
+
+ public Object getBean()
+ {
+ return null;
+ }
+ }
}
Modified: projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/plugins/deployers/bundle/OSGiBundleStateDeployer.java
===================================================================
--- projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/plugins/deployers/bundle/OSGiBundleStateDeployer.java 2009-09-04 09:32:11 UTC (rev 93198)
+++ projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/plugins/deployers/bundle/OSGiBundleStateDeployer.java 2009-09-04 09:40:06 UTC (rev 93199)
@@ -21,6 +21,7 @@
*/
package org.jboss.osgi.plugins.deployers.bundle;
+import org.jboss.dependency.spi.ControllerContext;
import org.jboss.deployers.spi.DeploymentException;
import org.jboss.deployers.spi.deployer.DeploymentStage;
import org.jboss.deployers.spi.deployer.DeploymentStages;
@@ -78,6 +79,10 @@
OSGiBundleState bundleState = bundleManager.addDeployment(unit);
unit.addAttachment(OSGiBundleState.class, bundleState);
+
+ ControllerContext context = unit.getAttachment(ControllerContext.class);
+ if (context == null)
+ throw new IllegalStateException("Cannot obtain ControllerContext");
}
@Override
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-04 09:32:11 UTC (rev 93198)
+++ projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/plugins/facade/bundle/OSGiBundleManager.java 2009-09-04 09:40:06 UTC (rev 93199)
@@ -40,8 +40,11 @@
import java.util.jar.Manifest;
import java.util.jar.Attributes.Name;
+import org.jboss.dependency.spi.ControllerContext;
+import org.jboss.dependency.spi.ControllerState;
import org.jboss.deployers.client.spi.DeployerClient;
import org.jboss.deployers.spi.DeploymentException;
+import org.jboss.deployers.spi.deployer.DeploymentStage;
import org.jboss.deployers.spi.deployer.DeploymentStages;
import org.jboss.deployers.structure.spi.DeploymentUnit;
import org.jboss.deployers.structure.spi.main.MainDeployerStructure;
@@ -63,6 +66,7 @@
import org.jboss.virtual.VFS;
import org.jboss.virtual.VirtualFile;
import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
import org.osgi.framework.BundleException;
import org.osgi.framework.Constants;
import org.osgi.framework.Filter;
@@ -554,6 +558,16 @@
}
/**
+ * Get the system bundle context
+ *
+ * @return the system bundle context
+ */
+ public BundleContext getSystemContext()
+ {
+ return systemBundle.getBundleContext();
+ }
+
+ /**
* Get a deployment
*
* @param id the id of the bundle
@@ -594,18 +608,26 @@
if (state == Bundle.RESOLVED || state == Bundle.ACTIVE)
return true;
+ DeploymentUnit unit = bundleState.getDeploymentUnit();
+ ControllerContext context = unit.getAttachment(ControllerContext.class);
+
+ ControllerState requiredState = context.getRequiredState();
+ DeploymentStage requiredStage = unit.getRequiredStage();
+
try
{
- String name = bundleState.getDeploymentUnit().getName();
- deployerClient.change(name, DeploymentStages.CLASSLOADER);
- deployerClient.checkComplete(name);
+ deployerClient.change(unit.getName(), DeploymentStages.CLASSLOADER);
+ deployerClient.checkComplete(unit.getName());
bundleState.changeState(Bundle.RESOLVED);
return true;
}
- catch (DeploymentException e)
+ catch (DeploymentException ex)
{
+ unit.setRequiredStage(requiredStage);
+ context.setRequiredState(requiredState);
+
if (errorOnFail)
- throw new IllegalStateException("Error resolving bundle: " + bundleState, e);
+ throw new IllegalStateException("Error resolving bundle: " + bundleState, ex);
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-04 09:32:11 UTC (rev 93198)
+++ projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/plugins/facade/plugins/FrameworkEventsPluginImpl.java 2009-09-04 09:40:06 UTC (rev 93199)
@@ -226,6 +226,13 @@
{
synchronized (bundleListeners)
{
+ // Expose the wrapper not the state itself
+ bundle = assertBundle(bundle);
+ BundleEvent event = new BundleEvent(type, bundle);
+ String typeName = ConstantsHelper.bundleEvent(event.getType());
+
+ log.info("Bundle " + typeName + ": " + bundle);
+
// Nobody is interested
if (bundleListeners.isEmpty())
return;
@@ -234,13 +241,6 @@
if (getBundleManager().isActive() == false)
return;
- // Expose the wrapper not the state itself
- bundle = assertBundle(bundle);
- BundleEvent event = new BundleEvent(type, bundle);
- String typeName = ConstantsHelper.bundleEvent(event.getType());
-
- log.info("Bundle event: " + typeName + " for bundle " + bundle);
-
// Synchronous listeners first
for (Entry<Bundle, List<BundleListener>> entry : bundleListeners.entrySet())
{
@@ -253,7 +253,7 @@
}
catch (Throwable t)
{
- log.warn("Error while firing bundle event: " + typeName + " for bundle " + bundle, t);
+ log.warn("Error while firing " + typeName + " for bundle " + bundle, t);
}
}
}
@@ -272,7 +272,7 @@
}
catch (Throwable t)
{
- log.warn("Error while firing bundle event: " + typeName + " for bundle " + this, t);
+ log.warn("Error while firing " + typeName + " for bundle " + this, t);
}
}
}
@@ -284,6 +284,13 @@
{
synchronized (frameworkListeners)
{
+ // Expose the wrapper not the state itself
+ bundle = assertBundle(bundle);
+ FrameworkEvent event = new FrameworkEvent(type, bundle, throwable);
+ String typeName = ConstantsHelper.frameworkEvent(event.getType());
+
+ log.info("Framwork " + typeName);
+
// Nobody is interested
if (frameworkListeners.isEmpty())
return;
@@ -292,13 +299,6 @@
if (getBundleManager().isActive() == false)
return;
- // Expose the wrapper not the state itself
- bundle = assertBundle(bundle);
- FrameworkEvent event = new FrameworkEvent(type, bundle, throwable);
- String typeName = ConstantsHelper.frameworkEvent(event.getType());
-
- log.info("Framwork event: " + typeName + " for bundle " + bundle);
-
// Call the listeners
for (Entry<Bundle, List<FrameworkListener>> entry : frameworkListeners.entrySet())
{
@@ -310,7 +310,7 @@
}
catch (Throwable t)
{
- log.warn("Error while firing framework event: " + typeName + " for bundle " + bundle, t);
+ log.warn("Error while firing " + typeName + " for framework", t);
}
}
}
@@ -321,6 +321,13 @@
{
synchronized (serviceListeners)
{
+ // Expose the wrapper not the state itself
+ bundle = assertBundle(bundle);
+ ServiceEvent event = new ServiceEvent(type, service.getReferenceInternal());
+ String typeName = ConstantsHelper.serviceEvent(event.getType());
+
+ log.info("Service " + typeName + ": " + service);
+
// Nobody is interested
if (serviceListeners.isEmpty())
return;
@@ -329,16 +336,6 @@
if (getBundleManager().isActive() == false)
return;
- if (service == null)
- throw new IllegalArgumentException("No serviceReference");
-
- // Expose the wrapper not the state itself
- bundle = assertBundle(bundle);
- ServiceEvent event = new ServiceEvent(type, service.getReferenceInternal());
- String typeName = ConstantsHelper.serviceEvent(event.getType());
-
- log.info("Service event: " + typeName + " for " + service);
-
// Call the listeners
for (Entry<Bundle, List<ServiceListenerRegistration>> entry : serviceListeners.entrySet())
{
@@ -355,7 +352,7 @@
}
catch (Throwable t)
{
- log.warn("Error while firing service event: " + typeName + " for service " + service, t);
+ log.warn("Error while firing " + typeName + " for service " + service, t);
}
}
}
Modified: projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/plugins/facade/service/PackageAdminImpl.java
===================================================================
--- projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/plugins/facade/service/PackageAdminImpl.java 2009-09-04 09:32:11 UTC (rev 93198)
+++ projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/plugins/facade/service/PackageAdminImpl.java 2009-09-04 09:40:06 UTC (rev 93199)
@@ -210,6 +210,7 @@
return capability.getName();
}
+ @SuppressWarnings("deprecation")
public String getSpecificationVersion()
{
throw new NotImplementedException();
Added: projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/test/resources/log4j-example.xml
===================================================================
--- projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/test/resources/log4j-example.xml (rev 0)
+++ projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/test/resources/log4j-example.xml 2009-09-04 09:40:06 UTC (rev 93199)
@@ -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/projects/runtime/microcontainer/trunk/src/test/resources/log4j-example.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
16 years, 10 months
JBoss-OSGI SVN: r93198 - in projects/jboss-osgi/projects: bundles/hotdeploy/trunk/src/main/java/org/jboss/osgi/hotdeploy/internal and 2 other directories.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-09-04 05:32:11 -0400 (Fri, 04 Sep 2009)
New Revision: 93198
Modified:
projects/jboss-osgi/projects/bundles/common/trunk/src/main/java/org/jboss/osgi/common/internal/DeploymentRegistryServiceImpl.java
projects/jboss-osgi/projects/bundles/common/trunk/src/main/java/org/jboss/osgi/common/internal/SystemDeployerService.java
projects/jboss-osgi/projects/bundles/hotdeploy/trunk/src/main/java/org/jboss/osgi/hotdeploy/internal/DeploymentScannerImpl.java
projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/service/DeploymentRegistryService.java
projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/util/BundleDeployment.java
projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/util/BundleDeploymentFactory.java
Log:
Use 4.2 Version instead of String
Modified: projects/jboss-osgi/projects/bundles/common/trunk/src/main/java/org/jboss/osgi/common/internal/DeploymentRegistryServiceImpl.java
===================================================================
--- projects/jboss-osgi/projects/bundles/common/trunk/src/main/java/org/jboss/osgi/common/internal/DeploymentRegistryServiceImpl.java 2009-09-04 08:51:14 UTC (rev 93197)
+++ projects/jboss-osgi/projects/bundles/common/trunk/src/main/java/org/jboss/osgi/common/internal/DeploymentRegistryServiceImpl.java 2009-09-04 09:32:11 UTC (rev 93198)
@@ -31,6 +31,7 @@
import org.jboss.osgi.spi.service.DeploymentRegistryService;
import org.jboss.osgi.spi.util.BundleDeployment;
import org.osgi.framework.BundleContext;
+import org.osgi.framework.Version;
/**
* A {@link DeployerService} that installs/uninstalls the bundles directly on the OSGi framework without going through the MC registered deployers.
@@ -56,7 +57,7 @@
deployments.remove(dep);
}
- public BundleDeployment getBundleDeployment(String symbolicName, String version)
+ public BundleDeployment getBundleDeployment(String symbolicName, Version version)
{
if (symbolicName == null)
throw new IllegalArgumentException("Cannot obtain bundle deployment for null symbolic name");
@@ -65,8 +66,8 @@
for (BundleDeployment auxDep : deployments)
{
String auxName = auxDep.getSymbolicName();
- String auxVersion = auxDep.getVersion();
- if (symbolicName.equals(auxName) && (version == null || version.equals(auxVersion)))
+ Version auxVersion = auxDep.getVersion();
+ if (symbolicName.equals(auxName) && version.equals(auxVersion))
{
dep = auxDep;
break;
Modified: projects/jboss-osgi/projects/bundles/common/trunk/src/main/java/org/jboss/osgi/common/internal/SystemDeployerService.java
===================================================================
--- projects/jboss-osgi/projects/bundles/common/trunk/src/main/java/org/jboss/osgi/common/internal/SystemDeployerService.java 2009-09-04 08:51:14 UTC (rev 93197)
+++ projects/jboss-osgi/projects/bundles/common/trunk/src/main/java/org/jboss/osgi/common/internal/SystemDeployerService.java 2009-09-04 09:32:11 UTC (rev 93198)
@@ -37,8 +37,8 @@
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;
import org.osgi.service.packageadmin.PackageAdmin;
import org.osgi.service.startlevel.StartLevel;
@@ -187,15 +187,15 @@
private Bundle getBundle(BundleDeployment dep)
{
String symbolicName = dep.getSymbolicName();
- String version = dep.getVersion();
+ Version version = dep.getVersion();
Bundle bundle = null;
for (Bundle aux : context.getBundles())
{
if (aux.getSymbolicName().equals(symbolicName))
{
- String auxVersion = (String)aux.getHeaders().get(Constants.BUNDLE_VERSION);
- if (version == null || version.equals(auxVersion))
+ Version auxVersion = aux.getVersion();
+ if (version.equals(auxVersion))
{
bundle = aux;
break;
Modified: projects/jboss-osgi/projects/bundles/hotdeploy/trunk/src/main/java/org/jboss/osgi/hotdeploy/internal/DeploymentScannerImpl.java
===================================================================
--- projects/jboss-osgi/projects/bundles/hotdeploy/trunk/src/main/java/org/jboss/osgi/hotdeploy/internal/DeploymentScannerImpl.java 2009-09-04 08:51:14 UTC (rev 93197)
+++ projects/jboss-osgi/projects/bundles/hotdeploy/trunk/src/main/java/org/jboss/osgi/hotdeploy/internal/DeploymentScannerImpl.java 2009-09-04 09:32:11 UTC (rev 93198)
@@ -44,8 +44,8 @@
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;
/**
@@ -180,12 +180,19 @@
if (currScan.contains(dep) == false)
{
Bundle bundle = getBundle(dep);
- int state = bundle.getState();
- if (state == Bundle.INSTALLED || state == Bundle.RESOLVED || state == Bundle.ACTIVE)
+ if (bundle == null)
{
deploymentCache.remove(dep.getLocation().toExternalForm());
- diff.add(dep);
}
+ else
+ {
+ int state = bundle.getState();
+ if (state == Bundle.INSTALLED || state == Bundle.RESOLVED || state == Bundle.ACTIVE)
+ {
+ deploymentCache.remove(dep.getLocation().toExternalForm());
+ diff.add(dep);
+ }
+ }
}
}
@@ -311,15 +318,15 @@
private Bundle getBundle(BundleDeployment dep)
{
String symbolicName = dep.getSymbolicName();
- String version = dep.getVersion();
+ Version version = dep.getVersion();
Bundle bundle = null;
for (Bundle aux : context.getBundles())
{
if (aux.getSymbolicName().equals(symbolicName))
{
- String auxVersion = (String)aux.getHeaders().get(Constants.BUNDLE_VERSION);
- if (version == null || version.equals(auxVersion))
+ Version auxVersion = aux.getVersion();
+ if (version.equals(auxVersion))
{
bundle = aux;
break;
Modified: projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/service/DeploymentRegistryService.java
===================================================================
--- projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/service/DeploymentRegistryService.java 2009-09-04 08:51:14 UTC (rev 93197)
+++ projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/service/DeploymentRegistryService.java 2009-09-04 09:32:11 UTC (rev 93198)
@@ -26,6 +26,7 @@
import java.net.URL;
import org.jboss.osgi.spi.util.BundleDeployment;
+import org.osgi.framework.Version;
/**
* A Service to register/unregister bundle deployments.
@@ -45,7 +46,7 @@
* Get the bundle deployment for the given bundle symbolicName and version
* @return null, if this service does not maintain the bundle deployment
*/
- BundleDeployment getBundleDeployment(String symbolicName, String version);
+ BundleDeployment getBundleDeployment(String symbolicName, Version version);
/**
* Register a bundle deployment
Modified: projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/util/BundleDeployment.java
===================================================================
--- projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/util/BundleDeployment.java 2009-09-04 08:51:14 UTC (rev 93197)
+++ projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/util/BundleDeployment.java 2009-09-04 09:32:11 UTC (rev 93198)
@@ -24,6 +24,8 @@
import java.io.Serializable;
import java.net.URL;
+import org.osgi.framework.Version;
+
//$Id$
/**
@@ -38,12 +40,12 @@
private URL location;
private String symbolicName;
- private String version;
+ private Version version;
private int startLevel;
private boolean autoStart;
private Object metadata;
- public BundleDeployment(URL location, String symbolicName, String version)
+ public BundleDeployment(URL location, String symbolicName, Version version)
{
if (location == null)
throw new IllegalArgumentException("Location cannot be null");
@@ -52,8 +54,7 @@
this.symbolicName = symbolicName;
this.location = location;
-
- this.version = (version != null ? version : "0.0.0");
+ this.version = version;
}
/**
@@ -75,7 +76,7 @@
/**
* Get the bundle version
*/
- public String getVersion()
+ public Version getVersion()
{
return version;
}
Modified: projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/util/BundleDeploymentFactory.java
===================================================================
--- projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/util/BundleDeploymentFactory.java 2009-09-04 08:51:14 UTC (rev 93197)
+++ projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/util/BundleDeploymentFactory.java 2009-09-04 09:32:11 UTC (rev 93198)
@@ -31,6 +31,7 @@
import org.osgi.framework.BundleException;
import org.osgi.framework.Constants;
+import org.osgi.framework.Version;
/**
* A factory for bundle deployments.
@@ -60,7 +61,8 @@
if (symbolicName == null)
throw new BundleException("Cannot obtain Bundle-SymbolicName for: " + url);
- String version = attribs.getValue(Constants.BUNDLE_VERSION);
+ String versionStr = attribs.getValue(Constants.BUNDLE_VERSION);
+ Version version = Version.parseVersion(versionStr);
return new BundleDeployment(url, symbolicName, version);
}
}
\ No newline at end of file
16 years, 10 months
JBoss-OSGI SVN: r93183 - projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/plugins/deployers/bundle.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-09-03 12:32:43 -0400 (Thu, 03 Sep 2009)
New Revision: 93183
Modified:
projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/plugins/deployers/bundle/OSGiBundleStateDeployer.java
Log:
Inject required deployment state
Modified: projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/plugins/deployers/bundle/OSGiBundleStateDeployer.java
===================================================================
--- projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/plugins/deployers/bundle/OSGiBundleStateDeployer.java 2009-09-03 16:32:24 UTC (rev 93182)
+++ projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/plugins/deployers/bundle/OSGiBundleStateDeployer.java 2009-09-03 16:32:43 UTC (rev 93183)
@@ -65,10 +65,9 @@
setTopLevelOnly(true);
}
- public void setAutoInstall(boolean autoInstall)
+ public void setRequiredStage(String stage)
{
- if (autoInstall == true)
- requiredStage = DeploymentStages.INSTALLED;
+ requiredStage = new DeploymentStage(stage);
}
@Override
16 years, 10 months
JBoss-OSGI SVN: r93182 - in projects/jboss-osgi/trunk/distribution/installer/src/main/resources: jbossas and 1 other directories.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-09-03 12:32:24 -0400 (Thu, 03 Sep 2009)
New Revision: 93182
Added:
projects/jboss-osgi/trunk/distribution/installer/src/main/resources/runtime/server/conf/jboss-osgi-bootstrap.xml
Removed:
projects/jboss-osgi/trunk/distribution/installer/src/main/resources/runtime/server/conf/jboss-osgi-bootstrap-all.xml
projects/jboss-osgi/trunk/distribution/installer/src/main/resources/runtime/server/conf/jboss-osgi-bootstrap-default.xml
projects/jboss-osgi/trunk/distribution/installer/src/main/resources/runtime/server/conf/jboss-osgi-bootstrap-minimal.xml
projects/jboss-osgi/trunk/distribution/installer/src/main/resources/runtime/server/conf/jboss-osgi-bootstrap-web.xml
Modified:
projects/jboss-osgi/trunk/distribution/installer/src/main/resources/installer/install-definition.xml
projects/jboss-osgi/trunk/distribution/installer/src/main/resources/jbossas/jboss-beans-jbossmc.xml
Log:
Remove redundant scripts
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-03 16:23:55 UTC (rev 93181)
+++ projects/jboss-osgi/trunk/distribution/installer/src/main/resources/installer/install-definition.xml 2009-09-03 16:32:24 UTC (rev 93182)
@@ -267,10 +267,10 @@
<!-- JBossMC Integration -->
- <singlefile condition="isJBossMC" src="@{runtime.dir}/server/conf/jboss-osgi-bootstrap-minimal.xml" target="$INSTALL_PATH/runtime/server/minimal/conf/jboss-osgi-bootstrap.xml" override="true"/>
- <singlefile condition="isJBossMC" src="@{runtime.dir}/server/conf/jboss-osgi-bootstrap-default.xml" target="$INSTALL_PATH/runtime/server/default/conf/jboss-osgi-bootstrap.xml" override="true"/>
- <singlefile condition="isJBossMC" src="@{runtime.dir}/server/conf/jboss-osgi-bootstrap-web.xml" target="$INSTALL_PATH/runtime/server/web/conf/jboss-osgi-bootstrap.xml" override="true"/>
- <singlefile condition="isJBossMC" src="@{runtime.dir}/server/conf/jboss-osgi-bootstrap-all.xml" target="$INSTALL_PATH/runtime/server/all/conf/jboss-osgi-bootstrap.xml" override="true"/>
+ <singlefile condition="isJBossMC" src="@{runtime.dir}/server/conf/jboss-osgi-bootstrap.xml" target="$INSTALL_PATH/runtime/server/minimal/conf/jboss-osgi-bootstrap.xml" override="true"/>
+ <singlefile condition="isJBossMC" src="@{runtime.dir}/server/conf/jboss-osgi-bootstrap.xml" target="$INSTALL_PATH/runtime/server/default/conf/jboss-osgi-bootstrap.xml" override="true"/>
+ <singlefile condition="isJBossMC" src="@{runtime.dir}/server/conf/jboss-osgi-bootstrap.xml" target="$INSTALL_PATH/runtime/server/web/conf/jboss-osgi-bootstrap.xml" override="true"/>
+ <singlefile condition="isJBossMC" src="@{runtime.dir}/server/conf/jboss-osgi-bootstrap.xml" target="$INSTALL_PATH/runtime/server/all/conf/jboss-osgi-bootstrap.xml" override="true"/>
<fileset condition="isJBossMC" dir="@{deploy.artifacts.dir}/lib" targetdir="$INSTALL_PATH/runtime/lib" override="true">
<include name="jaxb-api.jar" />
<include name="jboss-classloader.jar" />
Modified: projects/jboss-osgi/trunk/distribution/installer/src/main/resources/jbossas/jboss-beans-jbossmc.xml
===================================================================
--- projects/jboss-osgi/trunk/distribution/installer/src/main/resources/jbossas/jboss-beans-jbossmc.xml 2009-09-03 16:23:55 UTC (rev 93181)
+++ projects/jboss-osgi/trunk/distribution/installer/src/main/resources/jbossas/jboss-beans-jbossmc.xml 2009-09-03 16:32:24 UTC (rev 93182)
@@ -105,7 +105,6 @@
<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>
- <property name="autoInstall">true</property>
</bean>
<bean name="OSGiBundleClassLoadingDeployer" class="org.jboss.osgi.plugins.facade.classloading.OSGiBundleClassLoadingDeployer">
<property name="domain"><inject bean="OSGiClassLoaderDomain"/></property>
Deleted: projects/jboss-osgi/trunk/distribution/installer/src/main/resources/runtime/server/conf/jboss-osgi-bootstrap-all.xml
===================================================================
--- projects/jboss-osgi/trunk/distribution/installer/src/main/resources/runtime/server/conf/jboss-osgi-bootstrap-all.xml 2009-09-03 16:23:55 UTC (rev 93181)
+++ projects/jboss-osgi/trunk/distribution/installer/src/main/resources/runtime/server/conf/jboss-osgi-bootstrap-all.xml 2009-09-03 16:32:24 UTC (rev 93182)
@@ -1,180 +0,0 @@
-<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>${osgi.server.home}/data/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>
- <!-- Husky socket connector properties -->
- <entry><key>org.jboss.osgi.husky.runtime.connector.host</key><value>${jboss.bind.address}</value></entry>
- <entry><key>org.jboss.osgi.husky.runtime.connector.port</key><value>5401</value></entry>
- <!-- HTTP Service Port -->
- <entry><key>org.osgi.service.http.port</key><value>8090</value></entry>
- <!-- Config Admin Service -->
- <entry><key>felix.cm.dir</key><value>${osgi.server.home}/data/osgi-configadmin</value></entry>
- <!-- JMX bundle properties -->
- <entry><key>org.jboss.osgi.jmx.host</key><value>${jboss.bind.address}</value></entry>
- <entry><key>org.jboss.osgi.jmx.port</key><value>1098</value></entry>
- <!-- JNDI bundle properties -->
- <entry><key>org.jboss.osgi.jndi.host</key><value>${jboss.bind.address}</value></entry>
- <entry><key>org.jboss.osgi.jndi.rmi.port</key><value>1098</value></entry>
- <entry><key>org.jboss.osgi.jndi.port</key><value>1099</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">
- <value>${osgi.home}/server/minimal/deploy/org.osgi.compendium.jar</value>
- </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">
- <property name="domain"><inject bean="OSGiClassLoaderDomain"/></property>
- </bean>
- <bean name="OSGiBundleActivatorDeployer" class="org.jboss.osgi.plugins.deployers.bundle.OSGiBundleActivatorDeployer" />
-
- <!--
- ********************************
- * *
- * OSGi Classloading *
- * *
- ********************************
- -->
-
- <bean name="OSGiClassLoaderSystem" class="org.jboss.osgi.plugins.facade.classloading.OSGiClassLoaderSystem" />
- <bean name="OSGiClassLoaderDomain" class="org.jboss.osgi.plugins.facade.classloading.OSGiClassLoaderDomain" >
- <constructor><parameter>OSGiClassLoaderDomain</parameter></constructor>
- <property name="classLoaderSystem"><inject bean="OSGiClassLoaderSystem"/></property>
- <property name="bundleManager"><inject bean="OSGiBundleManager" /></property>
- </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="OSGiClassLoaderSystem" /></property>
- </bean>
-
-</deployment>
\ No newline at end of file
Deleted: projects/jboss-osgi/trunk/distribution/installer/src/main/resources/runtime/server/conf/jboss-osgi-bootstrap-default.xml
===================================================================
--- projects/jboss-osgi/trunk/distribution/installer/src/main/resources/runtime/server/conf/jboss-osgi-bootstrap-default.xml 2009-09-03 16:23:55 UTC (rev 93181)
+++ projects/jboss-osgi/trunk/distribution/installer/src/main/resources/runtime/server/conf/jboss-osgi-bootstrap-default.xml 2009-09-03 16:32:24 UTC (rev 93182)
@@ -1,169 +0,0 @@
-<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>${osgi.server.home}/data/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>
- <!-- Husky socket connector properties -->
- <entry><key>org.jboss.osgi.husky.runtime.connector.host</key><value>${jboss.bind.address}</value></entry>
- <entry><key>org.jboss.osgi.husky.runtime.connector.port</key><value>5401</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">
- <value>${osgi.home}/server/minimal/deploy/org.osgi.compendium.jar</value>
- </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">
- <property name="domain"><inject bean="OSGiClassLoaderDomain"/></property>
- </bean>
- <bean name="OSGiBundleActivatorDeployer" class="org.jboss.osgi.plugins.deployers.bundle.OSGiBundleActivatorDeployer" />
-
- <!--
- ********************************
- * *
- * OSGi Classloading *
- * *
- ********************************
- -->
-
- <bean name="OSGiClassLoaderSystem" class="org.jboss.osgi.plugins.facade.classloading.OSGiClassLoaderSystem" />
- <bean name="OSGiClassLoaderDomain" class="org.jboss.osgi.plugins.facade.classloading.OSGiClassLoaderDomain" >
- <constructor><parameter>OSGiClassLoaderDomain</parameter></constructor>
- <property name="classLoaderSystem"><inject bean="OSGiClassLoaderSystem"/></property>
- <property name="bundleManager"><inject bean="OSGiBundleManager" /></property>
- </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="OSGiClassLoaderSystem" /></property>
- </bean>
-
-</deployment>
\ No newline at end of file
Deleted: projects/jboss-osgi/trunk/distribution/installer/src/main/resources/runtime/server/conf/jboss-osgi-bootstrap-minimal.xml
===================================================================
--- projects/jboss-osgi/trunk/distribution/installer/src/main/resources/runtime/server/conf/jboss-osgi-bootstrap-minimal.xml 2009-09-03 16:23:55 UTC (rev 93181)
+++ projects/jboss-osgi/trunk/distribution/installer/src/main/resources/runtime/server/conf/jboss-osgi-bootstrap-minimal.xml 2009-09-03 16:32:24 UTC (rev 93182)
@@ -1,166 +0,0 @@
-<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>${osgi.server.home}/data/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">
- <value>${osgi.home}/server/minimal/deploy/org.osgi.compendium.jar</value>
- </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">
- <property name="domain"><inject bean="OSGiClassLoaderDomain"/></property>
- </bean>
- <bean name="OSGiBundleActivatorDeployer" class="org.jboss.osgi.plugins.deployers.bundle.OSGiBundleActivatorDeployer" />
-
- <!--
- ********************************
- * *
- * OSGi Classloading *
- * *
- ********************************
- -->
-
- <bean name="OSGiClassLoaderSystem" class="org.jboss.osgi.plugins.facade.classloading.OSGiClassLoaderSystem" />
- <bean name="OSGiClassLoaderDomain" class="org.jboss.osgi.plugins.facade.classloading.OSGiClassLoaderDomain" >
- <constructor><parameter>OSGiClassLoaderDomain</parameter></constructor>
- <property name="classLoaderSystem"><inject bean="OSGiClassLoaderSystem"/></property>
- <property name="bundleManager"><inject bean="OSGiBundleManager" /></property>
- </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="OSGiClassLoaderSystem" /></property>
- </bean>
-
-</deployment>
\ No newline at end of file
Deleted: projects/jboss-osgi/trunk/distribution/installer/src/main/resources/runtime/server/conf/jboss-osgi-bootstrap-web.xml
===================================================================
--- projects/jboss-osgi/trunk/distribution/installer/src/main/resources/runtime/server/conf/jboss-osgi-bootstrap-web.xml 2009-09-03 16:23:55 UTC (rev 93181)
+++ projects/jboss-osgi/trunk/distribution/installer/src/main/resources/runtime/server/conf/jboss-osgi-bootstrap-web.xml 2009-09-03 16:32:24 UTC (rev 93182)
@@ -1,180 +0,0 @@
-<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>${osgi.server.home}/data/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>
- <!-- Husky socket connector properties -->
- <entry><key>org.jboss.osgi.husky.runtime.connector.host</key><value>${jboss.bind.address}</value></entry>
- <entry><key>org.jboss.osgi.husky.runtime.connector.port</key><value>5401</value></entry>
- <!-- HTTP Service Port -->
- <entry><key>org.osgi.service.http.port</key><value>8090</value></entry>
- <!-- Config Admin Service -->
- <entry><key>felix.cm.dir</key><value>${osgi.server.home}/data/osgi-configadmin</value></entry>
- <!-- JMX bundle properties -->
- <entry><key>org.jboss.osgi.jmx.host</key><value>${jboss.bind.address}</value></entry>
- <entry><key>org.jboss.osgi.jmx.port</key><value>1098</value></entry>
- <!-- JNDI bundle properties -->
- <entry><key>org.jboss.osgi.jndi.host</key><value>${jboss.bind.address}</value></entry>
- <entry><key>org.jboss.osgi.jndi.rmi.port</key><value>1098</value></entry>
- <entry><key>org.jboss.osgi.jndi.port</key><value>1099</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">
- <value>${osgi.home}/server/minimal/deploy/org.osgi.compendium.jar</value>
- </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">
- <property name="domain"><inject bean="OSGiClassLoaderDomain"/></property>
- </bean>
- <bean name="OSGiBundleActivatorDeployer" class="org.jboss.osgi.plugins.deployers.bundle.OSGiBundleActivatorDeployer" />
-
- <!--
- ********************************
- * *
- * OSGi Classloading *
- * *
- ********************************
- -->
-
- <bean name="OSGiClassLoaderSystem" class="org.jboss.osgi.plugins.facade.classloading.OSGiClassLoaderSystem" />
- <bean name="OSGiClassLoaderDomain" class="org.jboss.osgi.plugins.facade.classloading.OSGiClassLoaderDomain" >
- <constructor><parameter>OSGiClassLoaderDomain</parameter></constructor>
- <property name="classLoaderSystem"><inject bean="OSGiClassLoaderSystem"/></property>
- <property name="bundleManager"><inject bean="OSGiBundleManager" /></property>
- </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="OSGiClassLoaderSystem" /></property>
- </bean>
-
-</deployment>
\ No newline at end of file
Copied: projects/jboss-osgi/trunk/distribution/installer/src/main/resources/runtime/server/conf/jboss-osgi-bootstrap.xml (from rev 93176, projects/jboss-osgi/trunk/distribution/installer/src/main/resources/runtime/server/conf/jboss-osgi-bootstrap-all.xml)
===================================================================
--- projects/jboss-osgi/trunk/distribution/installer/src/main/resources/runtime/server/conf/jboss-osgi-bootstrap.xml (rev 0)
+++ projects/jboss-osgi/trunk/distribution/installer/src/main/resources/runtime/server/conf/jboss-osgi-bootstrap.xml 2009-09-03 16:32:24 UTC (rev 93182)
@@ -0,0 +1,180 @@
+<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>${osgi.server.home}/data/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>
+ <!-- Husky socket connector properties -->
+ <entry><key>org.jboss.osgi.husky.runtime.connector.host</key><value>${jboss.bind.address}</value></entry>
+ <entry><key>org.jboss.osgi.husky.runtime.connector.port</key><value>5401</value></entry>
+ <!-- HTTP Service Port -->
+ <entry><key>org.osgi.service.http.port</key><value>8090</value></entry>
+ <!-- Config Admin Service -->
+ <entry><key>felix.cm.dir</key><value>${osgi.server.home}/data/osgi-configadmin</value></entry>
+ <!-- JMX bundle properties -->
+ <entry><key>org.jboss.osgi.jmx.host</key><value>${jboss.bind.address}</value></entry>
+ <entry><key>org.jboss.osgi.jmx.port</key><value>1098</value></entry>
+ <!-- JNDI bundle properties -->
+ <entry><key>org.jboss.osgi.jndi.host</key><value>${jboss.bind.address}</value></entry>
+ <entry><key>org.jboss.osgi.jndi.rmi.port</key><value>1098</value></entry>
+ <entry><key>org.jboss.osgi.jndi.port</key><value>1099</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">
+ <value>${osgi.home}/server/minimal/deploy/org.osgi.compendium.jar</value>
+ </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">
+ <property name="domain"><inject bean="OSGiClassLoaderDomain"/></property>
+ </bean>
+ <bean name="OSGiBundleActivatorDeployer" class="org.jboss.osgi.plugins.deployers.bundle.OSGiBundleActivatorDeployer" />
+
+ <!--
+ ********************************
+ * *
+ * OSGi Classloading *
+ * *
+ ********************************
+ -->
+
+ <bean name="OSGiClassLoaderSystem" class="org.jboss.osgi.plugins.facade.classloading.OSGiClassLoaderSystem" />
+ <bean name="OSGiClassLoaderDomain" class="org.jboss.osgi.plugins.facade.classloading.OSGiClassLoaderDomain" >
+ <constructor><parameter>OSGiClassLoaderDomain</parameter></constructor>
+ <property name="classLoaderSystem"><inject bean="OSGiClassLoaderSystem"/></property>
+ <property name="bundleManager"><inject bean="OSGiBundleManager" /></property>
+ </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="OSGiClassLoaderSystem" /></property>
+ </bean>
+
+</deployment>
\ No newline at end of file
16 years, 10 months