JBoss-OSGI SVN: r97328 - projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/bundle.
by jboss-osgi-commits@lists.jboss.org
Author: alesj
Date: 2009-12-02 17:08:19 -0500 (Wed, 02 Dec 2009)
New Revision: 97328
Modified:
projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/bundle/OSGiBundleManager.java
Log:
Synch on unit.
Modified: projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/bundle/OSGiBundleManager.java
===================================================================
--- projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/bundle/OSGiBundleManager.java 2009-12-02 22:02:38 UTC (rev 97327)
+++ projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/bundle/OSGiBundleManager.java 2009-12-02 22:08:19 UTC (rev 97328)
@@ -151,7 +151,7 @@
private MainDeployerStructure deployerStructure;
/** The deployment registry */
- private final DeploymentRegistry registry;
+ private DeploymentRegistry registry;
/** The instance metadata factory */
private MetaDataRetrievalFactory factory;
@@ -366,7 +366,7 @@
DeploymentUnit unit = registry.getDeployment(context);
if (unit != null)
{
- synchronized (registry)
+ synchronized (unit)
{
OSGiBundleState bundleState = unit.getAttachment(OSGiBundleState.class);
if (bundleState == null)
16 years, 7 months
JBoss-OSGI SVN: r97312 - 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-12-02 13:21:08 -0500 (Wed, 02 Dec 2009)
New Revision: 97312
Modified:
projects/jboss-osgi/trunk/distribution/installer/src/main/resources/jbossas/jboss-beans-equinox.xml
projects/jboss-osgi/trunk/distribution/installer/src/main/resources/jbossas/jboss-beans-felix.xml
Log:
Remove system cl delegation for jbossxb
Modified: projects/jboss-osgi/trunk/distribution/installer/src/main/resources/jbossas/jboss-beans-equinox.xml
===================================================================
--- projects/jboss-osgi/trunk/distribution/installer/src/main/resources/jbossas/jboss-beans-equinox.xml 2009-12-02 17:32:42 UTC (rev 97311)
+++ projects/jboss-osgi/trunk/distribution/installer/src/main/resources/jbossas/jboss-beans-equinox.xml 2009-12-02 18:21:08 UTC (rev 97312)
@@ -31,9 +31,9 @@
org.apache.log4j;version=1.2,
<!-- jboss-osgi -->
- org.jboss.osgi.deployment.common;version=1.0,
- org.jboss.osgi.deployment.deployer;version=1.0,
- org.jboss.osgi.deployment.interceptor;version=1.0,
+ org.jboss.osgi.deployment.common;version=1.0,
+ org.jboss.osgi.deployment.deployer;version=1.0,
+ org.jboss.osgi.deployment.interceptor;version=1.0,
org.jboss.osgi.microcontainer;version=1.0,
org.jboss.osgi.spi;version=1.0,
org.jboss.osgi.spi.capability;version=1.0,
Modified: projects/jboss-osgi/trunk/distribution/installer/src/main/resources/jbossas/jboss-beans-felix.xml
===================================================================
--- projects/jboss-osgi/trunk/distribution/installer/src/main/resources/jbossas/jboss-beans-felix.xml 2009-12-02 17:32:42 UTC (rev 97311)
+++ projects/jboss-osgi/trunk/distribution/installer/src/main/resources/jbossas/jboss-beans-felix.xml 2009-12-02 18:21:08 UTC (rev 97312)
@@ -22,6 +22,8 @@
<entry><key>org.osgi.framework.storage.clean</key><value>onFirstInit</value></entry>
<entry><key>org.osgi.service.http.port</key><value>8090</value></entry>
<entry><key>felix.cm.dir</key><value>${jboss.server.data.dir}/osgi-configadmin</value></entry>
+ <entry><key>felix.bootdelegation.implicit</key><value>false</value></entry>
+ <entry><key>org.osgi.framework.bootdelegation</key><value>sun.reflect</value></entry>
<entry>
<key>org.osgi.framework.system.packages.extra</key>
<value>
@@ -37,7 +39,6 @@
<!-- jboss-osgi -->
org.jboss.osgi.deployment.deployer;version=1.0,
org.jboss.osgi.deployment.interceptor;version=1.0,
- org.jboss.osgi.jbossxb;version=2.0,
org.jboss.osgi.microcontainer;version=1.0,
org.jboss.osgi.spi;version=1.0,
org.jboss.osgi.spi.capability;version=1.0,
@@ -55,14 +56,11 @@
org.jboss.logging,
org.jboss.reflect.spi;version=2.0,
org.jboss.util.xml;version=2.2,
- org.jboss.virtual;version=2.1,
- org.jboss.virtual.plugins.registry;version=2.1,
- org.jboss.virtual.plugins.context.jar;version=2.1,
- org.jboss.virtual.plugins.vfs.helpers;version=2.1,
- org.jboss.virtual.protocol;version=2.1,
- org.jboss.xb.annotations;version=2.0,
- org.jboss.xb.binding;version=2.0,
- org.jboss.xb.binding.sunday.unmarshalling;version=2.0,
+ org.jboss.virtual;version=2.1,
+ org.jboss.virtual.plugins.registry;version=2.1,
+ org.jboss.virtual.plugins.context.jar;version=2.1,
+ org.jboss.virtual.plugins.vfs.helpers;version=2.1,
+ org.jboss.virtual.protocol;version=2.1,
</value>
</entry>
<!--
16 years, 7 months
JBoss-OSGI SVN: r97311 - 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-12-02 12:32:42 -0500 (Wed, 02 Dec 2009)
New Revision: 97311
Modified:
projects/jboss-osgi/trunk/distribution/installer/src/main/resources/jbossas/jboss-beans-equinox.xml
Log:
Add org.osgi.framework.storage
Modified: projects/jboss-osgi/trunk/distribution/installer/src/main/resources/jbossas/jboss-beans-equinox.xml
===================================================================
--- projects/jboss-osgi/trunk/distribution/installer/src/main/resources/jbossas/jboss-beans-equinox.xml 2009-12-02 17:24:55 UTC (rev 97310)
+++ projects/jboss-osgi/trunk/distribution/installer/src/main/resources/jbossas/jboss-beans-equinox.xml 2009-12-02 17:32:42 UTC (rev 97311)
@@ -18,6 +18,7 @@
<bean name="jboss.osgi:service=Framework" class="org.jboss.osgi.equinox.EquinoxIntegration">
<property name="properties">
<map keyClass="java.lang.String" valueClass="java.lang.String">
+ <entry><key>org.osgi.framework.storage</key><value>${jboss.server.data.dir}/osgi-store</value></entry>
<entry><key>org.osgi.framework.storage.clean</key><value>onFirstInit</value></entry>
<entry><key>org.osgi.service.http.port</key><value>8090</value></entry>
<entry><key>osgi.framework</key><value>${jboss.server.home.url}/deployers/osgi.deployer/org.eclipse.osgi.jar</value></entry>
16 years, 7 months
JBoss-OSGI SVN: r97309 - projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/bundle.
by jboss-osgi-commits@lists.jboss.org
Author: alesj
Date: 2009-12-02 12:04:08 -0500 (Wed, 02 Dec 2009)
New Revision: 97309
Modified:
projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/bundle/MDRUtils.java
Log:
Get classloader info.
Modified: projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/bundle/MDRUtils.java
===================================================================
--- projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/bundle/MDRUtils.java 2009-12-02 16:53:07 UTC (rev 97308)
+++ projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/bundle/MDRUtils.java 2009-12-02 17:04:08 UTC (rev 97309)
@@ -172,8 +172,8 @@
boolean equals = source.equals(otherSource);
if (equals == false)
{
- ClassLoader otherLoader = otherSource.getClass().getClassLoader();
- ClassLoader sourceLoader = source.getClass().getClassLoader();
+ ClassLoader otherLoader = getClassLoader(otherSource);
+ ClassLoader sourceLoader = getClassLoader(source);
StringBuffer buffer = new StringBuffer("Cannot assign '" + className + "' comming from different exporters");
buffer.append("\n service: ").append(sourceLoader);
buffer.append("\n request: ").append(otherLoader);
@@ -183,6 +183,17 @@
}
/**
+ * Get classloader.
+ *
+ * @param instance the instance
+ * @return instance's classloader
+ */
+ private static ClassLoader getClassLoader(Object instance)
+ {
+ return (instance instanceof Class) ? Class.class.cast(instance).getClassLoader() : instance.getClass().getClassLoader();
+ }
+
+ /**
* Match class.
*
* @param context the context
16 years, 7 months
JBoss-OSGI SVN: r97308 - projects/jboss-osgi/trunk/reactor/framework/src/test/java/org/jboss/test/osgi/service.
by jboss-osgi-commits@lists.jboss.org
Author: alesj
Date: 2009-12-02 11:53:07 -0500 (Wed, 02 Dec 2009)
New Revision: 97308
Modified:
projects/jboss-osgi/trunk/reactor/framework/src/test/java/org/jboss/test/osgi/service/ServiceMixUnitTestCase.java
Log:
typo
Modified: projects/jboss-osgi/trunk/reactor/framework/src/test/java/org/jboss/test/osgi/service/ServiceMixUnitTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/reactor/framework/src/test/java/org/jboss/test/osgi/service/ServiceMixUnitTestCase.java 2009-12-02 16:51:32 UTC (rev 97307)
+++ projects/jboss-osgi/trunk/reactor/framework/src/test/java/org/jboss/test/osgi/service/ServiceMixUnitTestCase.java 2009-12-02 16:53:07 UTC (rev 97308)
@@ -199,7 +199,7 @@
ServiceReference mcRef = refs[0];
// OSGi service should bubble on top
- assertEquals("OSgi service has not bubbled on top", osgiRef, bundleContext1.getServiceReference(A.class.getName()));
+ assertEquals("OSGi service has not bubbled on top", osgiRef, bundleContext1.getServiceReference(A.class.getName()));
// compare
assertTrue(osgiRef.compareTo(mcRef) < 0);
16 years, 7 months
JBoss-OSGI SVN: r97307 - in projects/jboss-osgi/trunk/reactor/framework/src: test/java/org/jboss/test/osgi/service and 1 other directory.
by jboss-osgi-commits@lists.jboss.org
Author: alesj
Date: 2009-12-02 11:51:32 -0500 (Wed, 02 Dec 2009)
New Revision: 97307
Modified:
projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/bundle/ContextComparator.java
projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/bundle/KernelDictionaryFactory.java
projects/jboss-osgi/trunk/reactor/framework/src/test/java/org/jboss/test/osgi/service/ServiceMixUnitTestCase.java
Log:
Fix order bug.
Modified: projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/bundle/ContextComparator.java
===================================================================
--- projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/bundle/ContextComparator.java 2009-12-02 16:37:13 UTC (rev 97306)
+++ projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/bundle/ContextComparator.java 2009-12-02 16:51:32 UTC (rev 97307)
@@ -43,7 +43,7 @@
{
Long id1 = MDRUtils.getId(c1);
Long id2 = MDRUtils.getId(c2);
- if (id1 == null || id2 == null)
+ if (id1 == null && id2 == null)
return 0;
if (id1 != null && id2 == null)
return -1;
Modified: projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/bundle/KernelDictionaryFactory.java
===================================================================
--- projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/bundle/KernelDictionaryFactory.java 2009-12-02 16:37:13 UTC (rev 97306)
+++ projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/bundle/KernelDictionaryFactory.java 2009-12-02 16:51:32 UTC (rev 97307)
@@ -24,7 +24,9 @@
import java.util.Dictionary;
import java.util.Enumeration;
import java.util.HashSet;
+import java.util.Map;
import java.util.Set;
+import java.util.concurrent.ConcurrentHashMap;
import org.jboss.beans.info.spi.BeanInfo;
import org.jboss.kernel.spi.config.KernelConfigurator;
@@ -78,19 +80,20 @@
private class KernelDictionary extends Dictionary<String, Object>
{
+ private Map<Object, Object> map;
private KernelControllerContext context;
- private Object name;
- private String[] classes = EMPTY;
private KernelDictionary(KernelControllerContext context)
{
this.context = context;
- this.name = context.getName();
+ this.map = new ConcurrentHashMap<Object, Object>(2);
+ map.put(NAME, context.getName());
+ map.put(Constants.OBJECTCLASS, EMPTY);
}
public int size()
{
- return 2;
+ return map.size();
}
public boolean isEmpty()
@@ -101,63 +104,52 @@
@SuppressWarnings({"unchecked"})
public Enumeration<String> keys()
{
- Set<String> keys = new HashSet<String>();
- keys.add(Constants.OBJECTCLASS);
- keys.add(NAME);
- return Iterators.toEnumeration(keys.iterator());
+ return Iterators.toEnumeration(map.keySet().iterator());
}
@SuppressWarnings({"unchecked"})
public Enumeration<Object> elements()
{
- Set<Object> elements = new HashSet<Object>();
- elements.add(name);
- elements.add(classes);
- return Iterators.toEnumeration(elements.iterator());
+ return Iterators.toEnumeration(map.values().iterator());
}
public Object get(Object key)
{
- if (NAME.equals(key))
+ Object value = map.get(key);
+ if (value != EMPTY)
+ return value;
+
+ ClassInfo clazz = null;
+ Object target = context.getTarget();
+ BeanInfo info = context.getBeanInfo();
+ if (target != null)
{
- return name;
+ clazz = getClassInfo(target.getClass());
}
- else if (Constants.OBJECTCLASS.equals(key))
+ else if (info != null)
{
- if (classes == EMPTY)
- {
- ClassInfo clazz = null;
- Object target = context.getTarget();
- BeanInfo info = context.getBeanInfo();
- if (target != null)
- {
- clazz = getClassInfo(target.getClass());
- }
- else if (info != null)
- {
- clazz = info.getClassInfo();
- }
+ clazz = info.getClassInfo();
+ }
- if (clazz != null)
- {
- Set<String> clazzes = new HashSet<String>();
- traverseClass(clazz, clazzes);
- classes = clazzes.toArray(new String[clazzes.size()]);
- }
- }
- return classes;
+ String[] classes = EMPTY;
+ if (clazz != null)
+ {
+ Set<String> clazzes = new HashSet<String>();
+ traverseClass(clazz, clazzes);
+ classes = clazzes.toArray(new String[clazzes.size()]);
+ map.put(Constants.OBJECTCLASS, classes);
}
- return null;
+ return classes;
}
public Object put(String key, Object value)
{
- return null;
+ return map.put(key, value);
}
public Object remove(Object key)
{
- return null;
+ return map.remove(key);
}
protected void traverseClass(ClassInfo clazz, Set<String> classes)
Modified: projects/jboss-osgi/trunk/reactor/framework/src/test/java/org/jboss/test/osgi/service/ServiceMixUnitTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/reactor/framework/src/test/java/org/jboss/test/osgi/service/ServiceMixUnitTestCase.java 2009-12-02 16:37:13 UTC (rev 97306)
+++ projects/jboss-osgi/trunk/reactor/framework/src/test/java/org/jboss/test/osgi/service/ServiceMixUnitTestCase.java 2009-12-02 16:51:32 UTC (rev 97307)
@@ -188,25 +188,29 @@
assertNotNull(reg1);
try
{
- // OSGi service should bubble on top
- ServiceReference osgiRef = bundleContext1.getServiceReference(A.class.getName());
- assertNotNull(osgiRef);
-
- ServiceReference[] refs = bundleContext1.getServiceReferences(A.class.getName(), null);
+ ServiceReference[] refs = bundleContext1.getServiceReferences(A.class.getName(), "(a=b)");
assertNotNull(refs);
- assertEquals(2, refs.length);
- assertSame(osgiRef, refs[0]);
- ServiceReference mcRef = refs[1];
+ assertEquals(1, refs.length);
+ ServiceReference osgiRef = refs[0];
- refs = bundleContext1.getServiceReferences(A.class.getName(), "(a=b)");
+ refs = bundleContext1.getServiceReferences(A.class.getName(), "(bean.name=A)");
assertNotNull(refs);
assertEquals(1, refs.length);
- assertSame(osgiRef, refs[0]);
+ ServiceReference mcRef = refs[0];
- refs = bundleContext1.getServiceReferences(A.class.getName(), "(bean.name=A)");
+ // OSGi service should bubble on top
+ assertEquals("OSgi service has not bubbled on top", osgiRef, bundleContext1.getServiceReference(A.class.getName()));
+
+ // compare
+ assertTrue(osgiRef.compareTo(mcRef) < 0);
+ assertTrue(0 < mcRef.compareTo(osgiRef));
+
+ // ranking order first
+ refs = bundleContext1.getServiceReferences(A.class.getName(), null);
assertNotNull(refs);
- assertEquals(1, refs.length);
- assertEquals(mcRef, refs[0]);
+ assertEquals(2, refs.length);
+ assertEquals(osgiRef, refs[0]);
+ assertEquals(mcRef, refs[1]);
}
finally
{
16 years, 7 months
JBoss-OSGI SVN: r97305 - in projects/jboss-osgi/trunk/reactor/framework/src: test/java/org/jboss/test/osgi/service and 1 other directory.
by jboss-osgi-commits@lists.jboss.org
Author: alesj
Date: 2009-12-02 11:13:58 -0500 (Wed, 02 Dec 2009)
New Revision: 97305
Modified:
projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/bundle/KernelDictionaryFactory.java
projects/jboss-osgi/trunk/reactor/framework/src/test/java/org/jboss/test/osgi/service/ServiceMixUnitTestCase.java
Log:
Filter by bean name.
Modified: projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/bundle/KernelDictionaryFactory.java
===================================================================
--- projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/bundle/KernelDictionaryFactory.java 2009-12-02 16:09:53 UTC (rev 97304)
+++ projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/bundle/KernelDictionaryFactory.java 2009-12-02 16:13:58 UTC (rev 97305)
@@ -21,7 +21,6 @@
*/
package org.jboss.osgi.framework.bundle;
-import java.util.Collections;
import java.util.Dictionary;
import java.util.Enumeration;
import java.util.HashSet;
@@ -41,6 +40,7 @@
*/
public class KernelDictionaryFactory implements DictionaryFactory<KernelControllerContext>
{
+ private static final String NAME = "bean.name";
private static final String[] EMPTY = new String[0];
private KernelConfigurator configurator;
private final ClassInfo OBJECT;
@@ -79,16 +79,18 @@
private class KernelDictionary extends Dictionary<String, Object>
{
private KernelControllerContext context;
+ private Object name;
private String[] classes = EMPTY;
private KernelDictionary(KernelControllerContext context)
{
this.context = context;
+ this.name = context.getName();
}
public int size()
{
- return 1;
+ return 2;
}
public boolean isEmpty()
@@ -99,19 +101,29 @@
@SuppressWarnings({"unchecked"})
public Enumeration<String> keys()
{
- return Iterators.toEnumeration(Collections.singleton(Constants.OBJECTCLASS).iterator());
+ Set<String> keys = new HashSet<String>();
+ keys.add(Constants.OBJECTCLASS);
+ keys.add(NAME);
+ return Iterators.toEnumeration(keys.iterator());
}
@SuppressWarnings({"unchecked"})
public Enumeration<Object> elements()
{
- return Iterators.toEnumeration(Collections.singleton(classes).iterator());
+ Set<Object> elements = new HashSet<Object>();
+ elements.add(name);
+ elements.add(classes);
+ return Iterators.toEnumeration(elements.iterator());
}
public Object get(Object key)
{
- if (Constants.OBJECTCLASS.equals(key))
+ if (NAME.equals(key))
{
+ return name;
+ }
+ else if (Constants.OBJECTCLASS.equals(key))
+ {
if (classes == EMPTY)
{
ClassInfo clazz = null;
Modified: projects/jboss-osgi/trunk/reactor/framework/src/test/java/org/jboss/test/osgi/service/ServiceMixUnitTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/reactor/framework/src/test/java/org/jboss/test/osgi/service/ServiceMixUnitTestCase.java 2009-12-02 16:09:53 UTC (rev 97304)
+++ projects/jboss-osgi/trunk/reactor/framework/src/test/java/org/jboss/test/osgi/service/ServiceMixUnitTestCase.java 2009-12-02 16:13:58 UTC (rev 97305)
@@ -196,11 +196,17 @@
assertNotNull(refs);
assertEquals(2, refs.length);
assertSame(osgiRef, refs[0]);
+ ServiceReference mcRef = refs[1];
refs = bundleContext1.getServiceReferences(A.class.getName(), "(a=b)");
assertNotNull(refs);
assertEquals(1, refs.length);
assertSame(osgiRef, refs[0]);
+
+ refs = bundleContext1.getServiceReferences(A.class.getName(), "(bean.name=A)");
+ assertNotNull(refs);
+ assertEquals(1, refs.length);
+ assertEquals(mcRef, refs[0]);
}
finally
{
16 years, 7 months
JBoss-OSGI SVN: r97299 - projects/jboss-osgi/trunk/reactor/framework/src/test/java/org/jboss/test/osgi/service.
by jboss-osgi-commits@lists.jboss.org
Author: alesj
Date: 2009-12-02 11:05:02 -0500 (Wed, 02 Dec 2009)
New Revision: 97299
Modified:
projects/jboss-osgi/trunk/reactor/framework/src/test/java/org/jboss/test/osgi/service/ServiceMixUnitTestCase.java
Log:
Test mix filtering.
Modified: projects/jboss-osgi/trunk/reactor/framework/src/test/java/org/jboss/test/osgi/service/ServiceMixUnitTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/reactor/framework/src/test/java/org/jboss/test/osgi/service/ServiceMixUnitTestCase.java 2009-12-02 15:45:59 UTC (rev 97298)
+++ projects/jboss-osgi/trunk/reactor/framework/src/test/java/org/jboss/test/osgi/service/ServiceMixUnitTestCase.java 2009-12-02 16:05:02 UTC (rev 97299)
@@ -22,6 +22,8 @@
package org.jboss.test.osgi.service;
import java.lang.reflect.Method;
+import java.util.Dictionary;
+import java.util.Hashtable;
import junit.framework.Test;
@@ -31,9 +33,9 @@
import org.jboss.deployers.client.spi.Deployment;
import org.jboss.kernel.spi.dependency.KernelControllerContext;
import org.jboss.test.osgi.DeployersTest;
+import org.jboss.test.osgi.service.support.LazyBundle;
import org.jboss.test.osgi.service.support.a.A;
import org.jboss.test.osgi.service.support.c.C;
-import org.jboss.test.osgi.service.support.LazyBundle;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceReference;
@@ -117,6 +119,8 @@
Deployment bean = addBean("beanA", C.class, bmd, A.class);
try
{
+ KernelControllerContext kcc = getControllerContext("C", null);
+
Bundle bundle1 = assembleBundle("simple2", "/bundles/service/service-bundle3");
try
{
@@ -138,15 +142,20 @@
ServiceReference ref1 = bundleContext1.getServiceReference(A.class.getName());
assertUsingBundles(ref1, LazyBundle.getBundle(getDeploymentUnit(bean)));
- KernelControllerContext kcc = getControllerContext("C");
change(kcc, ControllerState.DESCRIBED);
// we did un-injection, should be removed now
assertUsingBundles(ref1);
+
+ change(kcc, ControllerState.INSTALLED);
+ assertEquals(ControllerState.INSTALLED, kcc.getState());
}
finally
{
reg1.unregister();
}
+
+ // check if the bean was unwinded as well
+ assertEquals(ControllerState.DESCRIBED, kcc.getState());
}
finally
{
@@ -158,4 +167,54 @@
undeploy(bean);
}
}
+
+ public void testFiltering() throws Throwable
+ {
+ Deployment bean = addBean("beanA", A.class);
+ try
+ {
+ Bundle bundle1 = assembleBundle("simple2", "/bundles/service/service-bundle1");
+ try
+ {
+ bundle1.start();
+ BundleContext bundleContext1 = bundle1.getBundleContext();
+ assertNotNull(bundleContext1);
+
+ Class<?> aClass = bundle1.loadClass(A.class.getName());
+ Object a = aClass.newInstance();
+ Dictionary<String, Object> dictionary = new Hashtable<String, Object>();
+ dictionary.put("a", "b");
+ ServiceRegistration reg1 = bundleContext1.registerService(A.class.getName(), a, dictionary);
+ assertNotNull(reg1);
+ try
+ {
+ // OSGi service should bubble on top
+ ServiceReference osgiRef = bundleContext1.getServiceReference(A.class.getName());
+ assertNotNull(osgiRef);
+
+ ServiceReference[] refs = bundleContext1.getServiceReferences(A.class.getName(), null);
+ assertNotNull(refs);
+ assertEquals(2, refs.length);
+ assertSame(osgiRef, refs[0]);
+
+ refs = bundleContext1.getServiceReferences(A.class.getName(), "(a=b)");
+ assertNotNull(refs);
+ assertEquals(1, refs.length);
+ assertSame(osgiRef, refs[0]);
+ }
+ finally
+ {
+ reg1.unregister();
+ }
+ }
+ finally
+ {
+ uninstall(bundle1);
+ }
+ }
+ finally
+ {
+ undeploy(bean);
+ }
+ }
}
16 years, 7 months
JBoss-OSGI SVN: r97298 - projects/jboss-osgi/projects/bundles/husky/trunk/src/main/java/org/jboss/osgi/testing/internal.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-12-02 10:45:59 -0500 (Wed, 02 Dec 2009)
New Revision: 97298
Added:
projects/jboss-osgi/projects/bundles/husky/trunk/src/main/java/org/jboss/osgi/testing/internal/DeployerServiceClient.java
Modified:
projects/jboss-osgi/projects/bundles/husky/trunk/src/main/java/org/jboss/osgi/testing/internal/EmbeddedRuntime.java
projects/jboss-osgi/projects/bundles/husky/trunk/src/main/java/org/jboss/osgi/testing/internal/OSGiRuntimeImpl.java
projects/jboss-osgi/projects/bundles/husky/trunk/src/main/java/org/jboss/osgi/testing/internal/RemoteRuntime.java
Log:
Delegate to the Deployer service registered in JMX
Added: projects/jboss-osgi/projects/bundles/husky/trunk/src/main/java/org/jboss/osgi/testing/internal/DeployerServiceClient.java
===================================================================
--- projects/jboss-osgi/projects/bundles/husky/trunk/src/main/java/org/jboss/osgi/testing/internal/DeployerServiceClient.java (rev 0)
+++ projects/jboss-osgi/projects/bundles/husky/trunk/src/main/java/org/jboss/osgi/testing/internal/DeployerServiceClient.java 2009-12-02 15:45:59 UTC (rev 97298)
@@ -0,0 +1,99 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.osgi.testing.internal;
+
+// $Id$
+
+import java.net.URL;
+import java.util.Arrays;
+
+import javax.management.MBeanException;
+import javax.management.ObjectName;
+
+import org.jboss.osgi.deployment.deployer.AbstractDeployerService;
+import org.jboss.osgi.deployment.deployer.Deployment;
+import org.jboss.osgi.testing.OSGiRuntime;
+import org.osgi.framework.BundleException;
+
+/**
+ * An abstract implementation of the {@link OSGiRuntime}
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 25-Sep-2008
+ */
+class DeployerServiceClient extends AbstractDeployerService
+{
+ private final OSGiRuntime runtime;
+ private ObjectName oname;
+
+ DeployerServiceClient(OSGiRuntime runtime, ObjectName oname)
+ {
+ this.runtime = runtime;
+ this.oname = oname;
+ }
+
+ public void deploy(Deployment[] deps) throws BundleException
+ {
+ invokeDeployerMBean(oname, "deploy", deps, Deployment[].class.getName());
+ }
+
+ public void deploy(URL url) throws BundleException
+ {
+ invokeDeployerMBean(oname, "deploy", url, URL.class.getName());
+ }
+
+ public void undeploy(Deployment[] deps) throws BundleException
+ {
+ invokeDeployerMBean(oname, "undeploy", deps, Deployment[].class.getName());
+ }
+
+ public void undeploy(URL url) throws BundleException
+ {
+ invokeDeployerMBean(oname, "undeploy", url, URL.class.getName());
+ }
+
+ private void invokeDeployerMBean(ObjectName oname, String method, Object arg, String type) throws BundleException
+ {
+ try
+ {
+ this.runtime.getMBeanServer().invoke(oname, method, new Object[] { arg }, new String[] { type });
+ }
+ catch (RuntimeException rte)
+ {
+ throw rte;
+ }
+ catch (Exception ex)
+ {
+ if (ex instanceof MBeanException)
+ {
+ ex = ((MBeanException)ex).getTargetException();
+ if (ex instanceof BundleException)
+ throw (BundleException)ex;
+ }
+
+ if (arg instanceof Deployment[])
+ arg = Arrays.asList((Deployment[])arg);
+
+ throw new BundleException("Cannot " + method + ": " + arg, ex);
+ }
+ }
+}
\ No newline at end of file
Property changes on: projects/jboss-osgi/projects/bundles/husky/trunk/src/main/java/org/jboss/osgi/testing/internal/DeployerServiceClient.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: projects/jboss-osgi/projects/bundles/husky/trunk/src/main/java/org/jboss/osgi/testing/internal/EmbeddedRuntime.java
===================================================================
--- projects/jboss-osgi/projects/bundles/husky/trunk/src/main/java/org/jboss/osgi/testing/internal/EmbeddedRuntime.java 2009-12-02 15:38:01 UTC (rev 97297)
+++ projects/jboss-osgi/projects/bundles/husky/trunk/src/main/java/org/jboss/osgi/testing/internal/EmbeddedRuntime.java 2009-12-02 15:45:59 UTC (rev 97298)
@@ -34,6 +34,7 @@
import javax.management.MBeanServerFactory;
import org.jboss.osgi.deployment.deployer.DeployerService;
+import org.jboss.osgi.deployment.deployer.Deployment;
import org.jboss.osgi.spi.capability.Capability;
import org.jboss.osgi.spi.framework.OSGiBootstrapProvider;
import org.jboss.osgi.spi.util.BundleInfo;
@@ -77,8 +78,19 @@
ServiceReference sref = context.getServiceReference(DeployerService.class.getName());
if (sref != null)
{
- DeployerService service = (DeployerService)context.getService(sref);
- service.deploy(rootURL);
+ Object obj = context.getService(sref);
+ if (obj instanceof DeployerService)
+ {
+ DeployerService service = (DeployerService)obj;
+ service.deploy(rootURL);
+ }
+ else
+ {
+ DeployerServiceClient deployer = new DeployerServiceClient(this, DeployerService.MBEAN_DEPLOYER_SERVICE);
+ Deployment dep = deployer.createDeployment(info);
+ dep.setAutoStart(false);
+ deployer.deploy(new Deployment[] { dep });
+ }
bundle = getBundle(symbolicName, version, true);
}
else
Modified: projects/jboss-osgi/projects/bundles/husky/trunk/src/main/java/org/jboss/osgi/testing/internal/OSGiRuntimeImpl.java
===================================================================
--- projects/jboss-osgi/projects/bundles/husky/trunk/src/main/java/org/jboss/osgi/testing/internal/OSGiRuntimeImpl.java 2009-12-02 15:38:01 UTC (rev 97297)
+++ projects/jboss-osgi/projects/bundles/husky/trunk/src/main/java/org/jboss/osgi/testing/internal/OSGiRuntimeImpl.java 2009-12-02 15:45:59 UTC (rev 97298)
@@ -36,14 +36,10 @@
import java.util.jar.JarFile;
import java.util.jar.Manifest;
-import javax.management.MBeanException;
-import javax.management.ObjectName;
import javax.naming.InitialContext;
import javax.naming.NamingException;
-import org.jboss.osgi.deployment.deployer.AbstractDeployerService;
import org.jboss.osgi.deployment.deployer.DeployerService;
-import org.jboss.osgi.deployment.deployer.Deployment;
import org.jboss.osgi.spi.capability.Capability;
import org.jboss.osgi.spi.util.BundleInfo;
import org.jboss.osgi.testing.OSGiBundle;
@@ -170,13 +166,13 @@
protected void deploy(URL archiveURL) throws Exception
{
- DeployerServiceClient deployer = new DeployerServiceClient(DeployerService.MBEAN_DEPLOYER_SERVICE);
+ DeployerServiceClient deployer = new DeployerServiceClient(this, DeployerService.MBEAN_DEPLOYER_SERVICE);
deployer.deploy(archiveURL);
}
protected void undeploy(URL archiveURL) throws Exception
{
- DeployerServiceClient deployer = new DeployerServiceClient(DeployerService.MBEAN_DEPLOYER_SERVICE);
+ DeployerServiceClient deployer = new DeployerServiceClient(this, DeployerService.MBEAN_DEPLOYER_SERVICE);
deployer.undeploy(archiveURL);
}
@@ -308,60 +304,4 @@
}
}
}
-
- class DeployerServiceClient extends AbstractDeployerService
- {
- private ObjectName oname;
-
- DeployerServiceClient(ObjectName oname)
- {
- this.oname = oname;
- }
-
- public void deploy(Deployment[] deps) throws BundleException
- {
- invokeDeployerMBean(oname, "deploy", deps, Deployment[].class.getName());
- }
-
- public void deploy(URL url) throws BundleException
- {
- invokeDeployerMBean(oname, "deploy", url, URL.class.getName());
- }
-
- public void undeploy(Deployment[] deps) throws BundleException
- {
- invokeDeployerMBean(oname, "undeploy", deps, Deployment[].class.getName());
- }
-
- public void undeploy(URL url) throws BundleException
- {
- invokeDeployerMBean(oname, "undeploy", url, URL.class.getName());
- }
-
- private void invokeDeployerMBean(ObjectName oname, String method, Object arg, String type) throws BundleException
- {
- try
- {
- getMBeanServer().invoke(oname, method, new Object[] { arg }, new String[] { type });
- }
- catch (RuntimeException rte)
- {
- throw rte;
- }
- catch (Exception ex)
- {
- if (ex instanceof MBeanException)
- {
- ex = ((MBeanException)ex).getTargetException();
- if (ex instanceof BundleException)
- throw (BundleException)ex;
- }
-
- if (arg instanceof Deployment[])
- arg = Arrays.asList((Deployment[])arg);
-
- throw new BundleException("Cannot " + method + ": " + arg, ex);
- }
- }
- }
}
Modified: projects/jboss-osgi/projects/bundles/husky/trunk/src/main/java/org/jboss/osgi/testing/internal/RemoteRuntime.java
===================================================================
--- projects/jboss-osgi/projects/bundles/husky/trunk/src/main/java/org/jboss/osgi/testing/internal/RemoteRuntime.java 2009-12-02 15:38:01 UTC (rev 97297)
+++ projects/jboss-osgi/projects/bundles/husky/trunk/src/main/java/org/jboss/osgi/testing/internal/RemoteRuntime.java 2009-12-02 15:45:59 UTC (rev 97298)
@@ -72,7 +72,7 @@
BundleInfo info = BundleInfo.createBundleInfo(location);
// Create the deployment from the info
- DeployerServiceClient deployer = new DeployerServiceClient(DeployerService.MBEAN_DEPLOYER_SERVICE);
+ DeployerServiceClient deployer = new DeployerServiceClient(this, DeployerService.MBEAN_DEPLOYER_SERVICE);
Deployment dep = deployer.createDeployment(info);
dep.setAutoStart(false);
@@ -115,7 +115,7 @@
{
URL archiveURL = getTestHelper().getTestArchiveURL(location);
ObjectName oname = getDeployerServiceName(archiveURL);
- DeployerServiceClient deployer = new DeployerServiceClient(oname);
+ DeployerServiceClient deployer = new DeployerServiceClient(this, oname);
deployer.deploy(archiveURL);
}
@@ -123,7 +123,7 @@
{
URL archiveURL = getTestHelper().getTestArchiveURL(location);
ObjectName oname = getDeployerServiceName(archiveURL);
- DeployerServiceClient deployer = new DeployerServiceClient(oname);
+ DeployerServiceClient deployer = new DeployerServiceClient(this, oname);
deployer.undeploy(archiveURL);
}
16 years, 7 months
JBoss-OSGI SVN: r97297 - in projects/jboss-osgi/trunk/reactor/framework/src: main/java/org/jboss/osgi/framework/bundle and 8 other directories.
by jboss-osgi-commits@lists.jboss.org
Author: alesj
Date: 2009-12-02 10:38:01 -0500 (Wed, 02 Dec 2009)
New Revision: 97297
Added:
projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/deployers/AbstractOSGiBundleStateDeployer.java
projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/deployers/OSGiBundleStateAddDeployer.java
projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/deployers/OSGiBundleStateRemoveDeployer.java
projects/jboss-osgi/trunk/reactor/framework/src/test/java/org/jboss/test/osgi/service/support/LazyBundle.java
projects/jboss-osgi/trunk/reactor/framework/src/test/resources/bundles/service/service-bundle4/
projects/jboss-osgi/trunk/reactor/framework/src/test/resources/bundles/service/service-bundle4/META-INF/
projects/jboss-osgi/trunk/reactor/framework/src/test/resources/bundles/service/service-bundle4/META-INF/MANIFEST.MF
Removed:
projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/deployers/OSGiBundleStateDeployer.java
Modified:
projects/jboss-osgi/trunk/reactor/framework/src/etc/osgitck/jboss-osgi-bootstrap.xml
projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/bundle/OSGiBundleManager.java
projects/jboss-osgi/trunk/reactor/framework/src/test/java/org/jboss/test/osgi/DeployersTest.java
projects/jboss-osgi/trunk/reactor/framework/src/test/java/org/jboss/test/osgi/DeployersTestDelegate.java
projects/jboss-osgi/trunk/reactor/framework/src/test/java/org/jboss/test/osgi/FrameworkTest.java
projects/jboss-osgi/trunk/reactor/framework/src/test/java/org/jboss/test/osgi/service/ServiceMixUnitTestCase.java
projects/jboss-osgi/trunk/reactor/framework/src/test/resources/bootstrap/jboss-osgi-bootstrap.xml
Log:
More service-mix tests.
Modified: projects/jboss-osgi/trunk/reactor/framework/src/etc/osgitck/jboss-osgi-bootstrap.xml
===================================================================
--- projects/jboss-osgi/trunk/reactor/framework/src/etc/osgitck/jboss-osgi-bootstrap.xml 2009-12-02 14:57:34 UTC (rev 97296)
+++ projects/jboss-osgi/trunk/reactor/framework/src/etc/osgitck/jboss-osgi-bootstrap.xml 2009-12-02 15:38:01 UTC (rev 97297)
@@ -136,9 +136,12 @@
<!-- OSGI Deployment -->
<bean name="OSGiManifestParsingDeployer" class="org.jboss.osgi.framework.deployers.OSGiManifestParsingDeployer" />
- <bean name="OSGiBundleStateDeployer" class="org.jboss.osgi.framework.deployers.OSGiBundleStateDeployer">
+ <bean name="OSGiBundleStateAddDeployer" class="org.jboss.osgi.framework.deployers.OSGiBundleStateAddDeployer">
<constructor><parameter><inject bean="OSGiBundleManager" /></parameter></constructor>
</bean>
+ <bean name="OSGiBundleStateRemoveDeployer" class="org.jboss.osgi.framework.deployers.OSGiBundleStateRemoveDeployer">
+ <constructor><parameter><inject bean="OSGiBundleManager" /></parameter></constructor>
+ </bean>
<bean name="OSGiBundleActivatorDeployer" class="org.jboss.osgi.framework.deployers.OSGiBundleActivatorDeployer" />
<bean name="OSGiContextTrackerDeployer" class="org.jboss.osgi.framework.deployers.OSGiContextTrackerDeployer" />
Modified: projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/bundle/OSGiBundleManager.java
===================================================================
--- projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/bundle/OSGiBundleManager.java 2009-12-02 14:57:34 UTC (rev 97296)
+++ projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/bundle/OSGiBundleManager.java 2009-12-02 15:38:01 UTC (rev 97297)
@@ -151,7 +151,7 @@
private MainDeployerStructure deployerStructure;
/** The deployment registry */
- private DeploymentRegistry registry;
+ private final DeploymentRegistry registry;
/** The instance metadata factory */
private MetaDataRetrievalFactory factory;
@@ -366,14 +366,17 @@
DeploymentUnit unit = registry.getDeployment(context);
if (unit != null)
{
- OSGiBundleState bundleState = unit.getAttachment(OSGiBundleState.class);
- if (bundleState == null)
+ synchronized (registry)
{
- bundleState = addDeployment(unit);
- bundleState.changeState(Bundle.ACTIVE);
- unit.addAttachment(OSGiBundleState.class, bundleState);
+ OSGiBundleState bundleState = unit.getAttachment(OSGiBundleState.class);
+ if (bundleState == null)
+ {
+ bundleState = addDeployment(unit);
+ bundleState.changeState(Bundle.ACTIVE);
+ unit.addAttachment(OSGiBundleState.class, bundleState);
+ }
+ return bundleState;
}
- return bundleState;
}
return systemBundle;
Added: projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/deployers/AbstractOSGiBundleStateDeployer.java
===================================================================
--- projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/deployers/AbstractOSGiBundleStateDeployer.java (rev 0)
+++ projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/deployers/AbstractOSGiBundleStateDeployer.java 2009-12-02 15:38:01 UTC (rev 97297)
@@ -0,0 +1,65 @@
+/*
+* 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.framework.deployers;
+
+import org.jboss.deployers.spi.deployer.DeploymentStages;
+import org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer;
+import org.jboss.deployers.spi.DeploymentException;
+import org.jboss.deployers.structure.spi.DeploymentUnit;
+import org.jboss.osgi.framework.bundle.OSGiBundleManager;
+import org.jboss.osgi.framework.bundle.OSGiBundleState;
+import org.jboss.osgi.framework.metadata.OSGiMetaData;
+
+/**
+ * AbstractOSGiBundleStateDeployer.<p>
+ *
+ * @author <a href="adrian(a)jboss.com">Adrian Brock</a>
+ * @author <a href="ales.justin(a)jboss.org">Ales Justin</a>
+ */
+public abstract class AbstractOSGiBundleStateDeployer extends AbstractRealDeployer
+{
+ /** The bundle manager */
+ protected OSGiBundleManager bundleManager;
+
+ /**
+ * Create a new BundleStateDeployer.
+ *
+ * @param bundleManager the bundleManager
+ * @throws IllegalArgumentException for a null bundle manager
+ */
+ protected AbstractOSGiBundleStateDeployer(OSGiBundleManager bundleManager)
+ {
+ if (bundleManager == null)
+ throw new IllegalArgumentException("Null bundle manager");
+
+ setOutput(OSGiBundleState.class);
+ setStage(DeploymentStages.POST_PARSE);
+ setTopLevelOnly(true);
+
+ this.bundleManager = bundleManager;
+ }
+
+ protected void internalDeploy(DeploymentUnit unit) throws DeploymentException
+ {
+ // do nothing
+ }
+}
\ No newline at end of file
Copied: projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/deployers/OSGiBundleStateAddDeployer.java (from rev 97282, projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/deployers/OSGiBundleStateDeployer.java)
===================================================================
--- projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/deployers/OSGiBundleStateAddDeployer.java (rev 0)
+++ projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/deployers/OSGiBundleStateAddDeployer.java 2009-12-02 15:38:01 UTC (rev 97297)
@@ -0,0 +1,81 @@
+/*
+* 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.framework.deployers;
+
+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.osgi.framework.bundle.OSGiBundleManager;
+import org.jboss.osgi.framework.bundle.OSGiBundleState;
+import org.jboss.osgi.framework.metadata.OSGiMetaData;
+
+/**
+ * OSGiBundleStateDeployer.<p>
+ *
+ * This deployer creates a bundle state object for all top level deployments
+ * regardless of whether they are OSGi deployments or not. TODO - this is not true!
+ *
+ * Note: undeploy/remove part is in a separate deployer.
+ *
+ * @author <a href="adrian(a)jboss.com">Adrian Brock</a>
+ * @author <a href="ales.justin(a)jboss.org">Ales Justin</a>
+ * @version $Revision: 1.1 $
+ */
+public class OSGiBundleStateAddDeployer extends AbstractOSGiBundleStateDeployer
+{
+ /** The required stage */
+ private DeploymentStage requiredStage;
+
+ /**
+ * Create a new BundleStateDeployer.
+ *
+ * @param bundleManager the bundleManager
+ * @throws IllegalArgumentException for a null bundle manager
+ */
+ public OSGiBundleStateAddDeployer(OSGiBundleManager bundleManager)
+ {
+ super(bundleManager);
+ setInput(OSGiMetaData.class);
+ this.requiredStage = DeploymentStages.DESCRIBE;
+ }
+
+ @Override
+ protected void internalDeploy(DeploymentUnit unit) throws DeploymentException
+ {
+ // [TODO] look at manifest headers and persistent state for this
+ unit.setRequiredStage(requiredStage);
+
+ OSGiBundleState bundleState = bundleManager.addDeployment(unit);
+ unit.addAttachment(OSGiBundleState.class, bundleState);
+ }
+
+ /**
+ * Set required stage.
+ *
+ * @param stage the required stage
+ */
+ public void setRequiredStage(String stage)
+ {
+ requiredStage = new DeploymentStage(stage);
+ }
+}
Deleted: projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/deployers/OSGiBundleStateDeployer.java
===================================================================
--- projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/deployers/OSGiBundleStateDeployer.java 2009-12-02 14:57:34 UTC (rev 97296)
+++ projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/deployers/OSGiBundleStateDeployer.java 2009-12-02 15:38:01 UTC (rev 97297)
@@ -1,90 +0,0 @@
-/*
-* 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.framework.deployers;
-
-import org.jboss.deployers.spi.DeploymentException;
-import org.jboss.deployers.spi.deployer.DeploymentStage;
-import org.jboss.deployers.spi.deployer.DeploymentStages;
-import org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer;
-import org.jboss.deployers.structure.spi.DeploymentUnit;
-import org.jboss.osgi.framework.bundle.OSGiBundleManager;
-import org.jboss.osgi.framework.bundle.OSGiBundleState;
-import org.jboss.osgi.framework.metadata.OSGiMetaData;
-
-/**
- * OSGiBundleStateDeployer.<p>
- *
- * This deployer creates a bundle state object for all top level deployments
- * regardless of whether they are OSGi deployments or not.
- *
- * @author <a href="adrian(a)jboss.com">Adrian Brock</a>
- * @version $Revision: 1.1 $
- */
-public class OSGiBundleStateDeployer extends AbstractRealDeployer
-{
- /** The bundle manager */
- private OSGiBundleManager bundleManager;
- private DeploymentStage requiredStage;
-
- /**
- * Create a new BundleStateDeployer.
- *
- * @param bundleManager the bundleManager
- * @throws IllegalArgumentException for a null bundle manager
- */
- public OSGiBundleStateDeployer(OSGiBundleManager bundleManager)
- {
- if (bundleManager == null)
- throw new IllegalArgumentException("Null bundle manager");
-
- this.bundleManager = bundleManager;
- this.requiredStage = DeploymentStages.DESCRIBE;
-
- setInput(OSGiMetaData.class);
- setOutput(OSGiBundleState.class);
- setStage(DeploymentStages.POST_PARSE);
- setTopLevelOnly(true);
- }
-
- public void setRequiredStage(String stage)
- {
- requiredStage = new DeploymentStage(stage);
- }
-
- @Override
- protected void internalDeploy(DeploymentUnit unit) throws DeploymentException
- {
- // [TODO] look at manifest headers and persistent state for this
- unit.setRequiredStage(requiredStage);
-
- OSGiBundleState bundleState = bundleManager.addDeployment(unit);
- unit.addAttachment(OSGiBundleState.class, bundleState);
- }
-
- @Override
- protected void internalUndeploy(DeploymentUnit unit)
- {
- OSGiBundleState bundleState = unit.getAttachment(OSGiBundleState.class);
- if (bundleState != null)
- bundleManager.removeBundle(bundleState);
- }
-}
Copied: projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/deployers/OSGiBundleStateRemoveDeployer.java (from rev 97282, projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/deployers/OSGiBundleStateDeployer.java)
===================================================================
--- projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/deployers/OSGiBundleStateRemoveDeployer.java (rev 0)
+++ projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/deployers/OSGiBundleStateRemoveDeployer.java 2009-12-02 15:38:01 UTC (rev 97297)
@@ -0,0 +1,57 @@
+/*
+* 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.framework.deployers;
+
+import org.jboss.deployers.spi.DeploymentException;
+import org.jboss.deployers.structure.spi.DeploymentUnit;
+import org.jboss.osgi.framework.bundle.OSGiBundleManager;
+import org.jboss.osgi.framework.bundle.OSGiBundleState;
+import org.jboss.osgi.framework.metadata.OSGiMetaData;
+
+/**
+ * This deployer removes any osgi state bundle from manager.
+ *
+ * @author <a href="adrian(a)jboss.com">Adrian Brock</a>
+ * @author <a href="ales.justin(a)jboss.org">Ales Justin</a>
+ */
+public class OSGiBundleStateRemoveDeployer extends AbstractOSGiBundleStateDeployer
+{
+ /**
+ * Create a new BundleStateDeployer.
+ *
+ * @param bundleManager the bundleManager
+ * @throws IllegalArgumentException for a null bundle manager
+ */
+ public OSGiBundleStateRemoveDeployer(OSGiBundleManager bundleManager)
+ {
+ super(bundleManager);
+ addInput(OSGiMetaData.class);
+ }
+
+ @Override
+ protected void internalUndeploy(DeploymentUnit unit)
+ {
+ OSGiBundleState bundleState = unit.getAttachment(OSGiBundleState.class);
+ if (bundleState != null)
+ bundleManager.removeBundle(bundleState);
+ }
+}
\ No newline at end of file
Modified: projects/jboss-osgi/trunk/reactor/framework/src/test/java/org/jboss/test/osgi/DeployersTest.java
===================================================================
--- projects/jboss-osgi/trunk/reactor/framework/src/test/java/org/jboss/test/osgi/DeployersTest.java 2009-12-02 14:57:34 UTC (rev 97296)
+++ projects/jboss-osgi/trunk/reactor/framework/src/test/java/org/jboss/test/osgi/DeployersTest.java 2009-12-02 15:38:01 UTC (rev 97297)
@@ -52,6 +52,21 @@
return (DeployersTestDelegate)super.getDelegate();
}
+ protected void checkComplete() throws Exception
+ {
+ getDelegate().checkComplete();
+ }
+
+ protected Deployment addDeployment(VirtualFile file) throws Exception
+ {
+ return getDelegate().addDeployment(file);
+ }
+
+ protected <T> Deployment addDeployment(VirtualFile file, T metadata, Class<T> expectedType) throws Exception
+ {
+ return getDelegate().addDeployment(file, metadata, expectedType);
+ }
+
protected Deployment assertDeploy(VirtualFile file) throws Exception
{
return getDelegate().assertDeploy(file);
@@ -72,14 +87,50 @@
getDelegate().undeploy(deployment);
}
- protected Deployment assertBean(String name, Class<?> beanClass) throws Exception
+ protected Deployment addBean(String name, Class<?> beanClass, Class<?> ... references) throws Exception
{
+ return addBean(name, beanClass, null, references);
+ }
+
+ protected Deployment addBean(String name, Class<?> beanClass, BeanMetaData bmd, Class<?> ... references) throws Exception
+ {
AssembledDirectory dir = createAssembledDirectory(name, "");
addPackage(dir, beanClass);
- BeanMetaDataBuilder builder = BeanMetaDataBuilder.createBuilder(beanClass.getSimpleName(), beanClass.getName());
- return assertDeploy(dir, builder.getBeanMetaData(), BeanMetaData.class);
+ if (references != null)
+ {
+ for (Class<?> reference : references)
+ addPackage(dir, reference);
+ }
+ if (bmd == null)
+ {
+ BeanMetaDataBuilder builder = BeanMetaDataBuilder.createBuilder(beanClass.getSimpleName(), beanClass.getName());
+ bmd = builder.getBeanMetaData();
+ }
+ return addDeployment(dir, bmd, BeanMetaData.class);
}
+ protected Deployment deployBean(String name, Class<?> beanClass, Class<?> ... references) throws Exception
+ {
+ return deployBean(name, beanClass, null, references);
+ }
+
+ protected Deployment deployBean(String name, Class<?> beanClass, BeanMetaData bmd, Class<?> ... references) throws Exception
+ {
+ AssembledDirectory dir = createAssembledDirectory(name, "");
+ addPackage(dir, beanClass);
+ if (references != null)
+ {
+ for (Class<?> reference : references)
+ addPackage(dir, reference);
+ }
+ if (bmd == null)
+ {
+ BeanMetaDataBuilder builder = BeanMetaDataBuilder.createBuilder(beanClass.getSimpleName(), beanClass.getName());
+ bmd = builder.getBeanMetaData();
+ }
+ return assertDeploy(dir, bmd, BeanMetaData.class);
+ }
+
protected Bundle getBundle(Deployment deployment) throws Exception
{
return getBundle(getDeploymentUnit(deployment));
@@ -89,6 +140,6 @@
{
OSGiBundleState bundle = unit.getAttachment(OSGiBundleState.class);
assertNotNull(bundle);
- return bundle;
+ return bundle.getBundleInternal();
}
}
\ No newline at end of file
Modified: projects/jboss-osgi/trunk/reactor/framework/src/test/java/org/jboss/test/osgi/DeployersTestDelegate.java
===================================================================
--- projects/jboss-osgi/trunk/reactor/framework/src/test/java/org/jboss/test/osgi/DeployersTestDelegate.java 2009-12-02 14:57:34 UTC (rev 97296)
+++ projects/jboss-osgi/trunk/reactor/framework/src/test/java/org/jboss/test/osgi/DeployersTestDelegate.java 2009-12-02 15:38:01 UTC (rev 97297)
@@ -39,6 +39,25 @@
super(clazz);
}
+ public void checkComplete() throws Exception
+ {
+ getDeployerClient().checkComplete();
+ }
+
+ public Deployment addDeployment(VirtualFile file) throws Exception
+ {
+ return addDeployment(file, null, null);
+ }
+
+ public <T> Deployment addDeployment(VirtualFile file, T metadata, Class<T> expectedType) throws Exception
+ {
+ Deployment deployment = createDeployment(file, metadata, expectedType);
+ DeployerClient deployerClient = getDeployerClient();
+ deployerClient.addDeployment(deployment);
+ deployerClient.process();
+ return deployment;
+ }
+
public Deployment assertDeploy(VirtualFile file) throws Exception
{
return assertDeploy(file, null, null);
@@ -49,7 +68,7 @@
Deployment deployment = createDeployment(file, metadata, expectedType);
DeployerClient deployerClient = getDeployerClient();
deployerClient.deploy(deployment);
- return deployment;
+ return deployment;
}
public DeploymentUnit getDeploymentUnit(Deployment deployment) throws Exception
Modified: projects/jboss-osgi/trunk/reactor/framework/src/test/java/org/jboss/test/osgi/FrameworkTest.java
===================================================================
--- projects/jboss-osgi/trunk/reactor/framework/src/test/java/org/jboss/test/osgi/FrameworkTest.java 2009-12-02 14:57:34 UTC (rev 97296)
+++ projects/jboss-osgi/trunk/reactor/framework/src/test/java/org/jboss/test/osgi/FrameworkTest.java 2009-12-02 15:38:01 UTC (rev 97297)
@@ -413,17 +413,18 @@
protected void assertUsingBundles(ServiceReference reference, Bundle... bundles)
{
- Set<Bundle> expected = new HashSet<Bundle>();
- expected.addAll(Arrays.asList(bundles));
-
Set<Bundle> actual = new HashSet<Bundle>();
Bundle[] users = reference.getUsingBundles();
if (users != null)
actual.addAll(Arrays.asList(users));
+ Set<Bundle> expected = new HashSet<Bundle>();
+ expected.addAll(Arrays.asList(bundles));
+
getLog().debug(reference + " users=" + actual);
- assertEquals(expected, actual);
+ // switch - check expected on actual, since actual might be proxy
+ assertEquals(actual, expected);
}
protected void assertBundle(Bundle b1, Bundle b2)
Modified: projects/jboss-osgi/trunk/reactor/framework/src/test/java/org/jboss/test/osgi/service/ServiceMixUnitTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/reactor/framework/src/test/java/org/jboss/test/osgi/service/ServiceMixUnitTestCase.java 2009-12-02 14:57:34 UTC (rev 97296)
+++ projects/jboss-osgi/trunk/reactor/framework/src/test/java/org/jboss/test/osgi/service/ServiceMixUnitTestCase.java 2009-12-02 15:38:01 UTC (rev 97297)
@@ -21,16 +21,23 @@
*/
package org.jboss.test.osgi.service;
+import java.lang.reflect.Method;
+
import junit.framework.Test;
+import org.jboss.beans.metadata.spi.BeanMetaData;
+import org.jboss.beans.metadata.spi.builder.BeanMetaDataBuilder;
+import org.jboss.dependency.spi.ControllerState;
import org.jboss.deployers.client.spi.Deployment;
+import org.jboss.kernel.spi.dependency.KernelControllerContext;
import org.jboss.test.osgi.DeployersTest;
import org.jboss.test.osgi.service.support.a.A;
-import org.jboss.kernel.spi.dependency.KernelControllerContext;
-import org.jboss.dependency.spi.ControllerState;
+import org.jboss.test.osgi.service.support.c.C;
+import org.jboss.test.osgi.service.support.LazyBundle;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceReference;
+import org.osgi.framework.ServiceRegistration;
/**
* Test MC's service mixture.
@@ -51,10 +58,10 @@
public void testGetServiceReferenceFromMC() throws Throwable
{
- Deployment bean = assertBean("beanA", A.class);
+ Deployment bean = deployBean("beanA", A.class);
try
{
- Bundle bundle1 = assembleBundle("simple1", "/bundles/service/service-bundle1", A.class);
+ Bundle bundle1 = assembleBundle("simple1", "/bundles/service/service-bundle1");
try
{
bundle1.start();
@@ -70,6 +77,9 @@
assertNotNull(bundleContext1.getService(ref1));
assertUsingBundles(ref1, bundle1);
+
+ ServiceReference[] inUse = bundle1.getServicesInUse();
+ assertEquals(new ServiceReference[]{ref1}, inUse);
}
finally
{
@@ -91,4 +101,61 @@
undeploy(bean);
}
}
+
+ private static Object invoke(Object target, String getter) throws Throwable
+ {
+ Class<?> clazz = target.getClass();
+ Method m = clazz.getDeclaredMethod(getter);
+ return m.invoke(target);
+ }
+
+ public void testInjectionToMC() throws Throwable
+ {
+ BeanMetaDataBuilder builder = BeanMetaDataBuilder.createBuilder("C", C.class.getName());
+ builder.addPropertyMetaData("a", builder.createContextualInject());
+ BeanMetaData bmd = builder.getBeanMetaData();
+ Deployment bean = addBean("beanA", C.class, bmd, A.class);
+ try
+ {
+ Bundle bundle1 = assembleBundle("simple2", "/bundles/service/service-bundle3");
+ try
+ {
+ bundle1.start();
+ BundleContext bundleContext1 = bundle1.getBundleContext();
+ assertNotNull(bundleContext1);
+
+ Class<?> aClass = bundle1.loadClass(A.class.getName());
+ Object a = aClass.newInstance();
+ ServiceRegistration reg1 = bundleContext1.registerService(A.class.getName(), a, null);
+ assertNotNull(reg1);
+ try
+ {
+ checkComplete();
+
+ Object c = getBean("C");
+ assertSame(a, invoke(c, "getA"));
+
+ ServiceReference ref1 = bundleContext1.getServiceReference(A.class.getName());
+ assertUsingBundles(ref1, LazyBundle.getBundle(getDeploymentUnit(bean)));
+
+ KernelControllerContext kcc = getControllerContext("C");
+ change(kcc, ControllerState.DESCRIBED);
+ // we did un-injection, should be removed now
+ assertUsingBundles(ref1);
+ }
+ finally
+ {
+ reg1.unregister();
+ }
+ }
+ finally
+ {
+ uninstall(bundle1);
+ }
+ }
+ finally
+ {
+ undeploy(bean);
+ }
+ }
}
Added: projects/jboss-osgi/trunk/reactor/framework/src/test/java/org/jboss/test/osgi/service/support/LazyBundle.java
===================================================================
--- projects/jboss-osgi/trunk/reactor/framework/src/test/java/org/jboss/test/osgi/service/support/LazyBundle.java (rev 0)
+++ projects/jboss-osgi/trunk/reactor/framework/src/test/java/org/jboss/test/osgi/service/support/LazyBundle.java 2009-12-02 15:38:01 UTC (rev 97297)
@@ -0,0 +1,71 @@
+/*
+ * 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.test.osgi.service.support;
+
+import java.lang.reflect.InvocationHandler;
+import java.lang.reflect.Method;
+import java.lang.reflect.Proxy;
+
+import org.jboss.deployers.structure.spi.DeploymentUnit;
+import org.jboss.osgi.framework.bundle.OSGiBundleState;
+import org.osgi.framework.Bundle;
+
+/**
+ * @author <a href="mailto:ales.justin@jboss.org">Ales Justin</a>
+ */
+public class LazyBundle
+{
+ public static Bundle getBundle(DeploymentUnit unit) throws Exception
+ {
+ return (Bundle)Proxy.newProxyInstance(Bundle.class.getClassLoader(),
+ new Class<?>[]{Bundle.class},
+ new LazyBundleHandler(unit));
+ }
+
+ private static class LazyBundleHandler implements InvocationHandler
+ {
+ private DeploymentUnit unit;
+ private Bundle bundle;
+
+ private LazyBundleHandler(DeploymentUnit unit)
+ {
+ this.unit = unit;
+ }
+
+ public Object invoke(Object proxy, Method method, Object[] args) throws Throwable
+ {
+ return method.invoke(getBundle(), args);
+ }
+
+ private Bundle getBundle()
+ {
+ if (bundle == null)
+ {
+ OSGiBundleState bundle = unit.getAttachment(OSGiBundleState.class);
+ if (bundle == null)
+ throw new IllegalArgumentException("No such OSGiBundleState attachment: " + unit);
+ this.bundle = bundle.getBundleInternal();
+ }
+ return bundle;
+ }
+ }
+}
Modified: projects/jboss-osgi/trunk/reactor/framework/src/test/resources/bootstrap/jboss-osgi-bootstrap.xml
===================================================================
--- projects/jboss-osgi/trunk/reactor/framework/src/test/resources/bootstrap/jboss-osgi-bootstrap.xml 2009-12-02 14:57:34 UTC (rev 97296)
+++ projects/jboss-osgi/trunk/reactor/framework/src/test/resources/bootstrap/jboss-osgi-bootstrap.xml 2009-12-02 15:38:01 UTC (rev 97297)
@@ -136,9 +136,12 @@
<!-- OSGI Deployment -->
<bean name="OSGiManifestParsingDeployer" class="org.jboss.osgi.framework.deployers.OSGiManifestParsingDeployer" />
- <bean name="OSGiBundleStateDeployer" class="org.jboss.osgi.framework.deployers.OSGiBundleStateDeployer">
+ <bean name="OSGiBundleStateAddDeployer" class="org.jboss.osgi.framework.deployers.OSGiBundleStateAddDeployer">
<constructor><parameter><inject bean="OSGiBundleManager" /></parameter></constructor>
</bean>
+ <bean name="OSGiBundleStateRemoveDeployer" class="org.jboss.osgi.framework.deployers.OSGiBundleStateRemoveDeployer">
+ <constructor><parameter><inject bean="OSGiBundleManager" /></parameter></constructor>
+ </bean>
<bean name="OSGiBundleActivatorDeployer" class="org.jboss.osgi.framework.deployers.OSGiBundleActivatorDeployer" />
<bean name="OSGiContextTrackerDeployer" class="org.jboss.osgi.framework.deployers.OSGiContextTrackerDeployer" />
Copied: projects/jboss-osgi/trunk/reactor/framework/src/test/resources/bundles/service/service-bundle4/META-INF/MANIFEST.MF (from rev 97290, projects/jboss-osgi/trunk/reactor/framework/src/test/resources/bundles/service/service-bundle3/META-INF/MANIFEST.MF)
===================================================================
--- projects/jboss-osgi/trunk/reactor/framework/src/test/resources/bundles/service/service-bundle4/META-INF/MANIFEST.MF (rev 0)
+++ projects/jboss-osgi/trunk/reactor/framework/src/test/resources/bundles/service/service-bundle4/META-INF/MANIFEST.MF 2009-12-02 15:38:01 UTC (rev 97297)
@@ -0,0 +1,7 @@
+Manifest-Version: 1.0
+Implementation-Title: JBoss OSGi tests
+Implementation-Version: test
+Implementation-Vendor: jboss.org
+Bundle-Name: Service4
+Bundle-SymbolicName: org.jboss.test.osgi.service4
+Export-Package: org.jboss.test.osgi.service.support.a;org.jboss.test.osgi.service.support.c
16 years, 7 months