[jboss-osgi-commits] JBoss-OSGI SVN: r97427 - projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/bundle.
jboss-osgi-commits at lists.jboss.org
jboss-osgi-commits at lists.jboss.org
Thu Dec 3 13:38:05 EST 2009
Author: alesj
Date: 2009-12-03 13:38:04 -0500 (Thu, 03 Dec 2009)
New Revision: 97427
Modified:
projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/bundle/OSGiServiceState.java
Log:
Enable proper service factory usage.
Modified: projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/bundle/OSGiServiceState.java
===================================================================
--- projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/bundle/OSGiServiceState.java 2009-12-03 18:19:20 UTC (rev 97426)
+++ projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/bundle/OSGiServiceState.java 2009-12-03 18:38:04 UTC (rev 97427)
@@ -48,8 +48,8 @@
import org.jboss.osgi.framework.plugins.FrameworkEventsPlugin;
import org.jboss.osgi.framework.util.CaseInsensitiveDictionary;
import org.jboss.osgi.spi.util.BundleClassLoader;
+import org.jboss.util.collection.CollectionsFactory;
import org.jboss.util.id.GUID;
-import org.jboss.util.collection.CollectionsFactory;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleException;
import org.osgi.framework.Constants;
@@ -277,16 +277,20 @@
return getService(bundleState);
}
- protected Object getTargetForTracker(ContextTracker tracker)
+ protected Object getActualUser(ControllerContext context)
{
- if (tracker instanceof AbstractBundleState)
- {
- AbstractBundleState abs = (AbstractBundleState)tracker;
- return getService(abs);
- }
- return getTarget();
+ OSGiBundleManager manager = bundleState.getBundleManager();
+ return manager.getBundleForContext(context);
}
+ protected Object getTargetForActualUser(Object user)
+ {
+ if (user instanceof AbstractBundleState)
+ return getService(AbstractBundleState.class.cast(user));
+ else
+ return getTarget();
+ }
+
public Object invoke(String name, Object[] parameters, String[] signature) throws Throwable
{
return getBeanInfo().invoke(getTarget(), name, signature, parameters);
More information about the jboss-osgi-commits
mailing list