Author: thomas.diesler(a)jboss.com
Date: 2010-02-04 14:42:39 -0500 (Thu, 04 Feb 2010)
New Revision: 100433
Modified:
projects/jboss-osgi/projects/runtime/framework/trunk/src/main/java/org/jboss/osgi/framework/bundle/OSGiBundleManager.java
projects/jboss-osgi/projects/runtime/framework/trunk/src/main/java/org/jboss/osgi/framework/classloading/OSGiPackageCapability.java
Log:
Fix Fragment support in AS6
Modified:
projects/jboss-osgi/projects/runtime/framework/trunk/src/main/java/org/jboss/osgi/framework/bundle/OSGiBundleManager.java
===================================================================
---
projects/jboss-osgi/projects/runtime/framework/trunk/src/main/java/org/jboss/osgi/framework/bundle/OSGiBundleManager.java 2010-02-04
19:11:22 UTC (rev 100432)
+++
projects/jboss-osgi/projects/runtime/framework/trunk/src/main/java/org/jboss/osgi/framework/bundle/OSGiBundleManager.java 2010-02-04
19:42:39 UTC (rev 100433)
@@ -1038,7 +1038,7 @@
}
// Fallback to the deployment name
- else if (aux instanceof OSGiBundleState)
+ else if (aux instanceof AbstractDeployedBundleState)
{
DeploymentUnit unit =
((AbstractDeployedBundleState)aux).getDeploymentUnit();
if (location.equals(unit.getName()))
Modified:
projects/jboss-osgi/projects/runtime/framework/trunk/src/main/java/org/jboss/osgi/framework/classloading/OSGiPackageCapability.java
===================================================================
---
projects/jboss-osgi/projects/runtime/framework/trunk/src/main/java/org/jboss/osgi/framework/classloading/OSGiPackageCapability.java 2010-02-04
19:11:22 UTC (rev 100432)
+++
projects/jboss-osgi/projects/runtime/framework/trunk/src/main/java/org/jboss/osgi/framework/classloading/OSGiPackageCapability.java 2010-02-04
19:42:39 UTC (rev 100433)
@@ -32,6 +32,7 @@
import org.jboss.osgi.framework.bundle.AbstractBundleState;
import org.jboss.osgi.framework.bundle.AbstractDeployedBundleState;
import org.jboss.osgi.framework.bundle.OSGiBundleManager;
+import org.jboss.osgi.framework.bundle.OSGiBundleState;
import org.jboss.osgi.framework.metadata.OSGiMetaData;
import org.jboss.osgi.framework.metadata.PackageAttribute;
import org.jboss.osgi.framework.metadata.Parameter;
@@ -144,26 +145,24 @@
OSGiBundleManager bundleManager = bundleState.getBundleManager();
Resolver bundleResolver = bundleManager.getOptionalPlugin(ResolverPlugin.class);
if (bundleResolver != null)
- return resolverMatch(bundleResolver, reqModule, osgiPackageRequirement);
+ {
+ // Get the bundle associated with the requirement
+ String reqLocation = reqModule.getContextName();
+ AbstractBundleState reqBundle = bundleManager.getBundleByLocation(reqLocation);
+ if (reqBundle == null)
+ throw new IllegalStateException("Cannot get bundle for: " +
reqLocation);
+
+ // Get the exporter for this requirement
+ if (reqBundle instanceof OSGiBundleState)
+ {
+ String packageName = osgiPackageRequirement.getName();
+ return bundleResolver.match(reqBundle, bundleState, packageName);
+ }
+ }
return true;
}
- // Return true if the given requirement matches in the external resolver
- private boolean resolverMatch(Resolver bundleResolver, Module reqModule,
OSGiPackageRequirement packageRequirement)
- {
- // Get the bundle associated with the requirement
- String reqLocation = reqModule.getContextName();
- OSGiBundleManager bundleManager = bundleState.getBundleManager();
- AbstractBundleState reqBundle = bundleManager.getBundleByLocation(reqLocation);
- if (reqBundle == null)
- throw new IllegalStateException("Cannot get bundle for: " +
reqLocation);
-
- // Get the exporter for this requirement
- String packageName = packageRequirement.getName();
- return bundleResolver.match(reqBundle, bundleState, packageName);
- }
-
/**
* Get the Module associated with this capability
*