JBoss-OSGI SVN: r97484 - projects/jboss-osgi/projects/runtime/framework/trunk/src/main/java/org/jboss/osgi/framework/bundle.
by jboss-osgi-commits@lists.jboss.org
Author: alesj
Date: 2009-12-05 16:10:55 -0500 (Sat, 05 Dec 2009)
New Revision: 97484
Modified:
projects/jboss-osgi/projects/runtime/framework/trunk/src/main/java/org/jboss/osgi/framework/bundle/OSGiServiceState.java
Log:
Proper service unget. TODO more tests.
Modified: projects/jboss-osgi/projects/runtime/framework/trunk/src/main/java/org/jboss/osgi/framework/bundle/OSGiServiceState.java
===================================================================
--- projects/jboss-osgi/projects/runtime/framework/trunk/src/main/java/org/jboss/osgi/framework/bundle/OSGiServiceState.java 2009-12-05 20:03:56 UTC (rev 97483)
+++ projects/jboss-osgi/projects/runtime/framework/trunk/src/main/java/org/jboss/osgi/framework/bundle/OSGiServiceState.java 2009-12-05 21:10:55 UTC (rev 97484)
@@ -431,7 +431,7 @@
ContextTracker ct = getContextTracker();
int count = ct.getUsedByCount(this, bundleState);
- if (count == 1 || (count == 2 && ct == bundleState)) // remove & unget, double count if tracker == bundle
+ if (count == 0) // remove & unget
{
serviceCache.remove(bundleState);
ServiceFactory serviceFactory = (ServiceFactory)serviceOrFactory;
@@ -674,11 +674,20 @@
Set<Object> users = ct.getUsers(this);
if (users.isEmpty() == false)
{
+ Set<AbstractBundleState> used = new HashSet<AbstractBundleState>();
OSGiBundleManager manager = bundleState.getBundleManager();
for (Object user : users)
{
AbstractBundleState using = manager.getBundleForUser(user);
- using.ungetContex(this); // ungetService will cleanup service cache
+ if (used.add(using)) // add so we don't do duplicate work
+ {
+ int count = ct.getUsedByCount(this, using);
+ while(count > 0)
+ {
+ using.ungetContex(this); // ungetService will cleanup service cache
+ count--;
+ }
+ }
}
}
}
16 years, 7 months
JBoss-OSGI SVN: r97474 - projects/jboss-osgi/projects/runtime/framework/trunk/src/main/java/org/jboss/osgi/framework/bundle.
by jboss-osgi-commits@lists.jboss.org
Author: alesj
Date: 2009-12-04 14:09:55 -0500 (Fri, 04 Dec 2009)
New Revision: 97474
Modified:
projects/jboss-osgi/projects/runtime/framework/trunk/src/main/java/org/jboss/osgi/framework/bundle/OSGiServiceState.java
Log:
TODO - on servicefactory unget.
Modified: projects/jboss-osgi/projects/runtime/framework/trunk/src/main/java/org/jboss/osgi/framework/bundle/OSGiServiceState.java
===================================================================
--- projects/jboss-osgi/projects/runtime/framework/trunk/src/main/java/org/jboss/osgi/framework/bundle/OSGiServiceState.java 2009-12-04 18:26:13 UTC (rev 97473)
+++ projects/jboss-osgi/projects/runtime/framework/trunk/src/main/java/org/jboss/osgi/framework/bundle/OSGiServiceState.java 2009-12-04 19:09:55 UTC (rev 97474)
@@ -67,6 +67,7 @@
* @author <a href="ales.justin(a)jboss.org">Ales Justin</a>
* @version $Revision: 1.1 $
*/
+@SuppressWarnings({"ThrowableInstanceNeverThrown"})
public class OSGiServiceState extends AbstractControllerContext implements ServiceReference, ServiceRegistration, InvokeDispatchContext
{
/** The alias constant */
@@ -426,14 +427,14 @@
if (serviceCache == null)
return null;
- ServiceFactory serviceFactory = (ServiceFactory)serviceOrFactory;
service = serviceCache.get(bundleState);
+
ContextTracker ct = getContextTracker();
int count = ct.getUsedByCount(this, bundleState);
- if (count == 1) // remove
- serviceCache.remove(bundleState);
- if (count > 0) // unget
+ if (count == 1 || (count == 2 && ct == bundleState)) // remove & unget, double count if tracker == bundle
{
+ serviceCache.remove(bundleState);
+ ServiceFactory serviceFactory = (ServiceFactory)serviceOrFactory;
try
{
serviceFactory.ungetService(bundleState, getRegistration(), service);
@@ -674,15 +675,10 @@
if (users.isEmpty() == false)
{
OSGiBundleManager manager = bundleState.getBundleManager();
- Set<AbstractBundleState> used = new HashSet<AbstractBundleState>();
for (Object user : users)
{
AbstractBundleState using = manager.getBundleForUser(user);
- if (used.contains(using) == false)
- {
- used.add(using); // add so we don't remove duplicates
- using.ungetContex(this); // ungetService will cleanup service cache
- }
+ using.ungetContex(this); // ungetService will cleanup service cache
}
}
}
16 years, 7 months
JBoss-OSGI SVN: r97473 - in projects/jboss-osgi/projects/runtime/framework/trunk/src: test/java/org/jboss/test/osgi/service and 1 other directories.
by jboss-osgi-commits@lists.jboss.org
Author: alesj
Date: 2009-12-04 13:26:13 -0500 (Fri, 04 Dec 2009)
New Revision: 97473
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/OSGiServiceState.java
projects/jboss-osgi/projects/runtime/framework/trunk/src/test/java/org/jboss/test/osgi/service/ServiceMixUnitTestCase.java
projects/jboss-osgi/projects/runtime/framework/trunk/src/test/java/org/jboss/test/osgi/service/support/d/D.java
Log:
Re-fix the order of install/register/uninstall/unregister.
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 2009-12-04 17:35:06 UTC (rev 97472)
+++ projects/jboss-osgi/projects/runtime/framework/trunk/src/main/java/org/jboss/osgi/framework/bundle/OSGiBundleManager.java 2009-12-04 18:26:13 UTC (rev 97473)
@@ -1395,6 +1395,7 @@
OSGiServiceState registerService(AbstractBundleState bundleState, String[] clazzes, Object service, Dictionary properties)
{
OSGiServiceState result = new OSGiServiceState(bundleState, clazzes, service, properties);
+ result.internalRegister();
try
{
Controller controller = kernel.getController();
@@ -1405,7 +1406,6 @@
fireError(bundleState, "installing service to MC in", t);
throw new RuntimeException(t);
}
- result.internalRegister();
FrameworkEventsPlugin plugin = getPlugin(FrameworkEventsPlugin.class);
plugin.fireServiceEvent(bundleState, ServiceEvent.REGISTERED, result);
@@ -1420,13 +1420,13 @@
*/
void unregisterService(OSGiServiceState serviceState)
{
+ Controller controller = kernel.getController();
+ controller.uninstall(serviceState.getName());
+
serviceState.internalUnregister();
FrameworkEventsPlugin plugin = getPlugin(FrameworkEventsPlugin.class);
plugin.fireServiceEvent(serviceState.getBundleState(), ServiceEvent.UNREGISTERING, serviceState);
-
- Controller controller = kernel.getController();
- controller.uninstall(serviceState.getName());
}
/**
Modified: projects/jboss-osgi/projects/runtime/framework/trunk/src/main/java/org/jboss/osgi/framework/bundle/OSGiServiceState.java
===================================================================
--- projects/jboss-osgi/projects/runtime/framework/trunk/src/main/java/org/jboss/osgi/framework/bundle/OSGiServiceState.java 2009-12-04 17:35:06 UTC (rev 97472)
+++ projects/jboss-osgi/projects/runtime/framework/trunk/src/main/java/org/jboss/osgi/framework/bundle/OSGiServiceState.java 2009-12-04 18:26:13 UTC (rev 97473)
@@ -300,6 +300,14 @@
return getTarget();
}
+ protected Object ungetTargetForActualUser(Object user)
+ {
+ if (user instanceof AbstractBundleState)
+ return ungetService(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);
@@ -402,6 +410,46 @@
}
/**
+ * Unget from cache.
+ *
+ * @param bundleState the bundle state
+ * @return ungot service
+ */
+ Object ungetService(AbstractBundleState bundleState)
+ {
+ if (isUnregistered())
+ return null;
+
+ Object service = serviceOrFactory;
+ if (isServiceFactory)
+ {
+ if (serviceCache == null)
+ return null;
+
+ ServiceFactory serviceFactory = (ServiceFactory)serviceOrFactory;
+ service = serviceCache.get(bundleState);
+ ContextTracker ct = getContextTracker();
+ int count = ct.getUsedByCount(this, bundleState);
+ if (count == 1) // remove
+ serviceCache.remove(bundleState);
+ if (count > 0) // unget
+ {
+ try
+ {
+ serviceFactory.ungetService(bundleState, getRegistration(), service);
+ }
+ catch (Throwable t)
+ {
+ log.warn("Error from ungetService for " + this, t);
+ FrameworkEventsPlugin plugin = bundleState.getBundleManager().getPlugin(FrameworkEventsPlugin.class);
+ plugin.fireFrameworkEvent(bundleState, FrameworkEvent.WARNING, new BundleException("Error using service factory:" + serviceFactory, t));
+ }
+ }
+ }
+ return service;
+ }
+
+ /**
* Get the service registration
*
* @return the service registration
@@ -633,25 +681,7 @@
if (used.contains(using) == false)
{
used.add(using); // add so we don't remove duplicates
-
- if (using.ungetContex(this) == false)
- {
- if (isServiceFactory)
- {
- ServiceFactory serviceFactory = (ServiceFactory)serviceOrFactory;
- try
- {
- Object service = serviceCache.remove(using);
- serviceFactory.ungetService(using.getBundle(), getRegistration(), service);
- }
- catch (Throwable t)
- {
- log.warn("Error from ungetService for " + this, t);
- FrameworkEventsPlugin plugin = bundleState.getBundleManager().getPlugin(FrameworkEventsPlugin.class);
- plugin.fireFrameworkEvent(bundleState, FrameworkEvent.WARNING, new BundleException("Error using service factory:" + serviceFactory, t));
- }
- }
- }
+ using.ungetContex(this); // ungetService will cleanup service cache
}
}
}
Modified: projects/jboss-osgi/projects/runtime/framework/trunk/src/test/java/org/jboss/test/osgi/service/ServiceMixUnitTestCase.java
===================================================================
--- projects/jboss-osgi/projects/runtime/framework/trunk/src/test/java/org/jboss/test/osgi/service/ServiceMixUnitTestCase.java 2009-12-04 17:35:06 UTC (rev 97472)
+++ projects/jboss-osgi/projects/runtime/framework/trunk/src/test/java/org/jboss/test/osgi/service/ServiceMixUnitTestCase.java 2009-12-04 18:26:13 UTC (rev 97473)
@@ -24,7 +24,7 @@
import java.lang.reflect.Method;
import java.util.Dictionary;
import java.util.Hashtable;
-import java.util.Set;
+import java.util.List;
import junit.framework.Test;
@@ -279,8 +279,9 @@
reg1.unregister();
}
- Set as = assertInstanceOf(invoke(d, "getAs", "A"), Set.class);
+ List as = assertInstanceOf(invoke(d, "getAs", "A"), List.class);
assertNotNull(as);
+ assertEquals(2, as.size());
assertTrue(as.contains(a1));
assertTrue(as.contains(a2));
}
Modified: projects/jboss-osgi/projects/runtime/framework/trunk/src/test/java/org/jboss/test/osgi/service/support/d/D.java
===================================================================
--- projects/jboss-osgi/projects/runtime/framework/trunk/src/test/java/org/jboss/test/osgi/service/support/d/D.java 2009-12-04 17:35:06 UTC (rev 97472)
+++ projects/jboss-osgi/projects/runtime/framework/trunk/src/test/java/org/jboss/test/osgi/service/support/d/D.java 2009-12-04 18:26:13 UTC (rev 97473)
@@ -21,8 +21,8 @@
*/
package org.jboss.test.osgi.service.support.d;
-import java.util.Set;
-import java.util.HashSet;
+import java.util.ArrayList;
+import java.util.List;
import org.jboss.test.osgi.service.support.a.A;
import org.osgi.framework.Bundle;
@@ -34,7 +34,7 @@
*/
public class D implements ServiceFactory
{
- private Set<Object> as = new HashSet<Object>();
+ private List<Object> as = new ArrayList<Object>();
public Object getService(Bundle bundle, ServiceRegistration registration)
{
@@ -48,7 +48,7 @@
as.add(service);
}
- public Set<Object> getAs()
+ public List<Object> getAs()
{
return as;
}
16 years, 7 months
JBoss-OSGI SVN: r97469 - in projects/jboss-osgi/trunk/testsuite/functional: src/test/java/org/jboss/test/osgi/jbosgi214 and 2 other directories.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-12-04 11:39:11 -0500 (Fri, 04 Dec 2009)
New Revision: 97469
Added:
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi214/SomeService.java
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi214/bundle/SomeServiceImpl.java
Removed:
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi214/bundle/SomeService.java
Modified:
projects/jboss-osgi/trunk/testsuite/functional/pom.xml
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi214/OSGI214TestCase.java
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi214/bundle/OSGI214Activator.java
projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi214/jbosgi214-bundle.bnd
Log:
[JBOSGI-214] Cannot repeatedly register service bound to an interface from the system classpath
Simplify test case
Modified: projects/jboss-osgi/trunk/testsuite/functional/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/pom.xml 2009-12-04 16:22:13 UTC (rev 97468)
+++ projects/jboss-osgi/trunk/testsuite/functional/pom.xml 2009-12-04 16:39:11 UTC (rev 97469)
@@ -255,6 +255,8 @@
<exclude>org/jboss/test/osgi/jbosgi108/**</exclude>
<!-- [JBOSGI-207] Implement persistent file storage -->
<exclude>org/jboss/test/osgi/jbosgi41/**</exclude>
+ <!-- [JBOSGI-214] Cannot repeatedly register service bound to an interface from the system classpath -->
+ <exclude>org/jboss/test/osgi/jbosgi214/**</exclude>
</excludes>
</configuration>
</plugin>
@@ -306,6 +308,8 @@
<exclude>org/jboss/test/osgi/jbosgi108/**</exclude>
<!-- [JBOSGI-207] Implement persistent file storage -->
<exclude>org/jboss/test/osgi/jbosgi41/**</exclude>
+ <!-- [JBOSGI-214] Cannot repeatedly register service bound to an interface from the system classpath -->
+ <exclude>org/jboss/test/osgi/jbosgi214/**</exclude>
</excludes>
</configuration>
</plugin>
Modified: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi214/OSGI214TestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi214/OSGI214TestCase.java 2009-12-04 16:22:13 UTC (rev 97468)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi214/OSGI214TestCase.java 2009-12-04 16:39:11 UTC (rev 97469)
@@ -21,20 +21,23 @@
*/
package org.jboss.test.osgi.jbosgi214;
-//$Id:$
+//$Id$
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertNotNull;
import java.net.URL;
+import java.util.HashMap;
+import java.util.Map;
-import org.jboss.osgi.spi.framework.OSGiBootstrap;
-import org.jboss.osgi.spi.framework.OSGiBootstrapProvider;
+import org.jboss.osgi.spi.util.ServiceLoader;
import org.jboss.osgi.testing.OSGiTest;
import org.junit.Test;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
+import org.osgi.framework.BundleException;
import org.osgi.framework.ServiceReference;
import org.osgi.framework.launch.Framework;
+import org.osgi.framework.launch.FrameworkFactory;
import org.osgi.util.tracker.ServiceTracker;
/**
@@ -50,49 +53,30 @@
@Test
public void testFirstRun() throws Exception
{
- // Bootstrap and start the framework
- OSGiBootstrapProvider bootProvider = OSGiBootstrap.getBootstrapProvider();
- Framework framework = bootProvider.getFramework();
- framework.start();
-
- // Start the ServiceTracker
- BundleContext context = framework.getBundleContext();
- new SystemServiceTracker(context).open();
-
- try
- {
- // Install and start the test bundle
- URL bundleURL = getTestArchiveURL("jbosgi214-bundle.jar");
- Bundle bundle = context.installBundle(bundleURL.toExternalForm());
- bundle.start();
-
- // Verify that the service is there and can be cast to an interface from the system classpath
- ServiceReference sref = context.getServiceReference(OSGiBootstrapProvider.class.getName());
- OSGiBootstrapProvider service = (OSGiBootstrapProvider)context.getService(sref);
- assertNotNull("Service not null", service);
-
- // Uninstall the test bundle
- bundle.uninstall();
- }
- finally
- {
- // Stop the framework
- framework.stop();
- framework.waitForStop(5000);
- }
+ runSystemServiceTest();
}
-
+
@Test
public void testSecondRun() throws Exception
{
+ runSystemServiceTest();
+ }
+
+ private void runSystemServiceTest() throws BundleException, InterruptedException
+ {
+ // Setup some package on the system classpath
+ Map<String, String> props = new HashMap<String, String>();
+ props.put("org.osgi.framework.system.packages.extra", SomeService.class.getPackage().getName());
+ props.put("felix.bootdelegation.implicit", "false");
+
// Bootstrap and start the framework
- OSGiBootstrapProvider bootProvider = OSGiBootstrap.getBootstrapProvider();
- Framework framework = bootProvider.getFramework();
+ FrameworkFactory factory = ServiceLoader.loadService(FrameworkFactory.class);
+ Framework framework = factory.newFramework(props);
framework.start();
// Start the ServiceTracker
BundleContext context = framework.getBundleContext();
- new SystemServiceTracker(context).open();
+ new SomeServiceTracker(context).open();
try
{
@@ -102,8 +86,8 @@
bundle.start();
// Verify that the service is there and can be cast to an interface from the system classpath
- ServiceReference sref = context.getServiceReference(OSGiBootstrapProvider.class.getName());
- OSGiBootstrapProvider service = (OSGiBootstrapProvider)context.getService(sref);
+ ServiceReference sref = context.getServiceReference(SomeService.class.getName());
+ SomeService service = (SomeService)context.getService(sref);
assertNotNull("Service not null", service);
// Uninstall the test bundle
@@ -117,11 +101,11 @@
}
}
- class SystemServiceTracker extends ServiceTracker
+ class SomeServiceTracker extends ServiceTracker
{
- public SystemServiceTracker(BundleContext context)
+ public SomeServiceTracker(BundleContext context)
{
- super(context, OSGiBootstrapProvider.class.getName(), null);
+ super(context, SomeService.class.getName(), null);
}
@Override
@@ -129,7 +113,7 @@
{
Object serviceObj = super.addingService(sref);
//System.out.println("addingService: " + serviceObj);
- return (OSGiBootstrapProvider)serviceObj;
+ return (SomeService)serviceObj;
}
@Override
Added: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi214/SomeService.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi214/SomeService.java (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi214/SomeService.java 2009-12-04 16:39:11 UTC (rev 97469)
@@ -0,0 +1,35 @@
+/*
+ * 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.test.osgi.jbosgi214;
+
+//$Id: SomeService.java 97340 2009-12-03 12:57:01Z thomas.diesler(a)jboss.com $
+
+
+/**
+ * A service interface on the system classpath
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 24-Apr-2009
+ */
+public interface SomeService
+{
+}
Modified: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi214/bundle/OSGI214Activator.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi214/bundle/OSGI214Activator.java 2009-12-04 16:22:13 UTC (rev 97468)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi214/bundle/OSGI214Activator.java 2009-12-04 16:39:11 UTC (rev 97469)
@@ -23,7 +23,7 @@
//$Id$
-import org.jboss.osgi.spi.framework.OSGiBootstrapProvider;
+import org.jboss.test.osgi.jbosgi214.SomeService;
import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;
@@ -38,7 +38,7 @@
public void start(BundleContext context)
{
// Register a service that is bound to an interface from the system classpath
- context.registerService(OSGiBootstrapProvider.class.getName(), new SomeService(), null);
+ context.registerService(SomeService.class.getName(), new SomeServiceImpl(), null);
}
public void stop(BundleContext context)
Deleted: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi214/bundle/SomeService.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi214/bundle/SomeService.java 2009-12-04 16:22:13 UTC (rev 97468)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi214/bundle/SomeService.java 2009-12-04 16:39:11 UTC (rev 97469)
@@ -1,60 +0,0 @@
-/*
- * 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.test.osgi.jbosgi214.bundle;
-
-//$Id$
-
-import java.io.InputStream;
-import java.net.URL;
-
-import org.jboss.osgi.spi.framework.OSGiBootstrapProvider;
-import org.osgi.framework.launch.Framework;
-
-/**
- * A service that implements an interface from the system classpath
- *
- * @author thomas.diesler(a)jboss.com
- * @since 24-Apr-2009
- */
-public class SomeService implements OSGiBootstrapProvider
-{
- public void configure()
- {
- }
-
- public void configure(URL urlConfig)
- {
- }
-
- public void configure(String resourceConfig)
- {
- }
-
- public void configure(InputStream streamConfig)
- {
- }
-
- public Framework getFramework()
- {
- return null;
- }
-}
Copied: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi214/bundle/SomeServiceImpl.java (from rev 97467, projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi214/bundle/SomeService.java)
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi214/bundle/SomeServiceImpl.java (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi214/bundle/SomeServiceImpl.java 2009-12-04 16:39:11 UTC (rev 97469)
@@ -0,0 +1,36 @@
+/*
+ * 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.test.osgi.jbosgi214.bundle;
+
+//$Id$
+
+import org.jboss.test.osgi.jbosgi214.SomeService;
+
+/**
+ * A service that implements an interface from the system classpath
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 24-Apr-2009
+ */
+public class SomeServiceImpl implements SomeService
+{
+}
Modified: projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi214/jbosgi214-bundle.bnd
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi214/jbosgi214-bundle.bnd 2009-12-04 16:22:13 UTC (rev 97468)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi214/jbosgi214-bundle.bnd 2009-12-04 16:39:11 UTC (rev 97469)
@@ -3,4 +3,4 @@
Bundle-SymbolicName: jbosgi214-bundle
Bundle-Activator: org.jboss.test.osgi.jbosgi214.bundle.OSGI214Activator
Export-Package: org.jboss.test.osgi.jbosgi214.bundle
-Import-Package: org.jboss.osgi.spi.framework, org.osgi.framework, org.osgi.framework.launch
+Import-Package: org.jboss.test.osgi.jbosgi214, org.osgi.framework
16 years, 7 months
JBoss-OSGI SVN: r97465 - in projects/jboss-osgi/trunk/distribution/docbook/en: modules and 1 other directory.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-12-04 10:38:52 -0500 (Fri, 04 Dec 2009)
New Revision: 97465
Added:
projects/jboss-osgi/trunk/distribution/docbook/en/images/izpack25-jboss-home.png
Removed:
projects/jboss-osgi/trunk/distribution/docbook/en/images/izpack25-jboss-home.jpg
Modified:
projects/jboss-osgi/trunk/distribution/docbook/en/images/hudson-matrix-equinox.png
projects/jboss-osgi/trunk/distribution/docbook/en/images/hudson-matrix-felix.png
projects/jboss-osgi/trunk/distribution/docbook/en/images/hudson-matrix-jbossmc.png
projects/jboss-osgi/trunk/distribution/docbook/en/images/izpack01-welcome.png
projects/jboss-osgi/trunk/distribution/docbook/en/images/izpack05-installpath.png
projects/jboss-osgi/trunk/distribution/docbook/en/images/izpack10-packs.png
projects/jboss-osgi/trunk/distribution/docbook/en/images/izpack20-target-container.png
projects/jboss-osgi/trunk/distribution/docbook/en/images/izpack30-verify.png
projects/jboss-osgi/trunk/distribution/docbook/en/images/izpack35-done.png
projects/jboss-osgi/trunk/distribution/docbook/en/images/runtime-structure.png
projects/jboss-osgi/trunk/distribution/docbook/en/modules/ch020-getting-started.xml
projects/jboss-osgi/trunk/distribution/docbook/en/modules/ch030-runtime.xml
projects/jboss-osgi/trunk/distribution/docbook/en/modules/ch040-framework-integration.xml
projects/jboss-osgi/trunk/distribution/docbook/en/modules/ch050-developer-guide.xml
projects/jboss-osgi/trunk/distribution/docbook/en/modules/ch060-husky-testing.xml
projects/jboss-osgi/trunk/distribution/docbook/en/modules/ch070-provided-bundles.xml
projects/jboss-osgi/trunk/distribution/docbook/en/modules/ch080-provided-examples.xml
Log:
Start work on userguide
Modified: projects/jboss-osgi/trunk/distribution/docbook/en/images/hudson-matrix-equinox.png
===================================================================
(Binary files differ)
Modified: projects/jboss-osgi/trunk/distribution/docbook/en/images/hudson-matrix-felix.png
===================================================================
(Binary files differ)
Modified: projects/jboss-osgi/trunk/distribution/docbook/en/images/hudson-matrix-jbossmc.png
===================================================================
(Binary files differ)
Modified: projects/jboss-osgi/trunk/distribution/docbook/en/images/izpack01-welcome.png
===================================================================
(Binary files differ)
Modified: projects/jboss-osgi/trunk/distribution/docbook/en/images/izpack05-installpath.png
===================================================================
(Binary files differ)
Modified: projects/jboss-osgi/trunk/distribution/docbook/en/images/izpack10-packs.png
===================================================================
(Binary files differ)
Modified: projects/jboss-osgi/trunk/distribution/docbook/en/images/izpack20-target-container.png
===================================================================
(Binary files differ)
Deleted: projects/jboss-osgi/trunk/distribution/docbook/en/images/izpack25-jboss-home.jpg
===================================================================
(Binary files differ)
Added: projects/jboss-osgi/trunk/distribution/docbook/en/images/izpack25-jboss-home.png
===================================================================
(Binary files differ)
Property changes on: projects/jboss-osgi/trunk/distribution/docbook/en/images/izpack25-jboss-home.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: projects/jboss-osgi/trunk/distribution/docbook/en/images/izpack30-verify.png
===================================================================
(Binary files differ)
Modified: projects/jboss-osgi/trunk/distribution/docbook/en/images/izpack35-done.png
===================================================================
(Binary files differ)
Modified: projects/jboss-osgi/trunk/distribution/docbook/en/images/runtime-structure.png
===================================================================
(Binary files differ)
Modified: projects/jboss-osgi/trunk/distribution/docbook/en/modules/ch020-getting-started.xml
===================================================================
--- projects/jboss-osgi/trunk/distribution/docbook/en/modules/ch020-getting-started.xml 2009-12-04 15:34:41 UTC (rev 97464)
+++ projects/jboss-osgi/trunk/distribution/docbook/en/modules/ch020-getting-started.xml 2009-12-04 15:38:52 UTC (rev 97465)
@@ -21,7 +21,7 @@
<para>To run the installer execute the following command:</para>
<programlisting>
- java -jar jboss-osgi-installer-1.0.0.Beta4.jar
+ java -jar jboss-osgi-installer-1.0.0.Beta5.jar
</programlisting>
<para>The installer first shows a welcome screen</para>
@@ -63,7 +63,7 @@
</imageobject>
</mediaobject>
- <para>In case you have selected 'JBoss OSGi Integration', you will be presented with the choice of supported target containers.</para>
+ <para>In case you have selected 'JBossAS Integration', you will be presented with the choice of supported target containers.</para>
<mediaobject>
<imageobject>
@@ -75,12 +75,12 @@
<tip>
<title>Supported JBossAS versions</title>
- <para>The Microcontainer based OSGi Framework is only supported on JBoss-5.2.0 and above.</para>
+ <para>The Microcontainer based OSGi Framework is only supported on JBoss-6.0.0 and above.</para>
</tip>
<mediaobject>
<imageobject>
- <imagedata fileref="images/izpack25-jboss-home.jpg"/>
+ <imagedata fileref="images/izpack25-jboss-home.png"/>
</imageobject>
</mediaobject>
@@ -132,7 +132,7 @@
JBoss OSGi Bootstrap Environment
- OSGI_HOME: /home/tdiesler/jboss-osgi-1.0.0.Beta4/runtime
+ OSGI_HOME: /home/tdiesler/jboss-osgi-1.0.0.Beta5/runtime
JAVA: /usr/java/jdk1.6/bin/java
@@ -140,22 +140,18 @@
=========================================================================
- 15:36:52,683 INFO [OSGiBundleManager] JBossOSGi Framework - 1.0.0.Alpha1
- 15:36:53,161 INFO [FrameworkEventsPluginImpl] Bundle INSTALLED: Bundle{osgi.cmpn:4.2.0.200908310645}
- 15:36:53,280 INFO [FrameworkEventsPluginImpl] Bundle INSTALLED: Bundle{org.apache.felix.log:1.0.0}
- 15:36:53,403 INFO [FrameworkEventsPluginImpl] Bundle INSTALLED: Bundle{jboss-osgi-common:1.0.2.SNAPSHOT}
- 15:36:53,442 INFO [FrameworkEventsPluginImpl] Bundle INSTALLED: Bundle{jboss-osgi-hotdeploy:1.0.2.SNAPSHOT}
- 15:36:54,431 INFO [jboss-osgi-hotdeploy] Start DeploymentScanner: [scandir=.../server/default/deploy,interval=2000ms]
- 15:36:54,462 INFO [OSGiBootstrap] JBossOSGi Runtime booted in 1.773sec
+ 16:20:27,991 INFO [OSGiBundleManager] JBossOSGi - Framework - 1.0.0.Alpha2
...
- 15:36:54,515 INFO [FrameworkEventsPluginImpl] Bundle INSTALLED: Bundle{jboss-osgi-jndi:1.0.1}
- 15:36:54,551 INFO [FrameworkEventsPluginImpl] Bundle INSTALLED: Bundle{jboss-osgi-jmx:1.0.1}
- 15:36:54,783 INFO [FrameworkEventsPluginImpl] Bundle INSTALLED: Bundle{jboss-osgi-common-core:2.2.13.GA}
+ 16:20:29,203 INFO [FrameworkEventsPluginImpl] Bundle STARTED: Bundle{system.bundle-0.0.0}
+ 16:20:29,243 INFO [OSGiBootstrapBean] JBossOSGi Runtime booted in 1.241sec
+ 16:20:29,569 INFO [FrameworkEventsPluginImpl] Bundle INSTALLED: Bundle{jboss-osgi-jndi-1.0.2}
+ 16:20:29,843 INFO [FrameworkEventsPluginImpl] Bundle INSTALLED: Bundle{jboss-osgi-common-core-2.2.13.GA}
+ 16:20:29,866 INFO [FrameworkEventsPluginImpl] Bundle INSTALLED: Bundle{jboss-osgi-jmx-1.0.2}
+ 16:20:30,512 INFO [FrameworkEventsPluginImpl] Bundle STARTED: Bundle{jboss-osgi-jndi-1.0.2}
+ 16:20:30,789 INFO [FrameworkEventsPluginImpl] Bundle STARTED: Bundle{jboss-osgi-jmx-1.0.2}
+ 16:20:30,806 INFO [FrameworkEventsPluginImpl] Bundle STARTED: Bundle{jboss-osgi-common-core-2.2.13.GA}
...
- 15:36:55,353 INFO [jboss-osgi-jndi] JNDI started: JNP=localhost:1099, RMI=localhost:1098
- 15:36:55,687 INFO [jboss-osgi-jmx] MBeanServerConnection bound to: jmx/invoker/RMIAdaptor
- ...
- <emphasis role="bold">15:36:57,705 INFO [OSGiBootstrap] JBossOSGi Runtime started in 3.021sec</emphasis>
+ <emphasis role="bold">16:20:30,824 INFO [DeploymentScannerImpl] JBossOSGi Runtime started in 1.64sec</emphasis>
</programlisting>
</sect1>
@@ -176,6 +172,7 @@
<listitem><emphasis role="bold">SAXParserTestCase</emphasis> - A test that uses a SAX parser to read an XML document</listitem>
<listitem><emphasis role="bold">SimpleHuskyTestCase</emphasis> - Accesses a service from within the test case</listitem>
<listitem><emphasis role="bold">SimpleTestCase</emphasis> - A simple bundle lifecycle test</listitem>
+ <listitem><emphasis role="bold">TransactionTestCase</emphasis> - A simple transaction test</listitem>
<listitem><emphasis role="bold">WebAppTestCase</emphasis> - A web application (WAR) test</listitem>
</itemizedlist>
@@ -307,7 +304,7 @@
Buildfile: build.xml
init:
- [echo] V1.0.0.Beta4
+ [echo] V1.0.0.Beta5
init-hudson:
[echo]
@@ -335,7 +332,7 @@
Buildfile: build.xml
init:
- [echo] V1.0.0.Beta4
+ [echo] V1.0.0.Beta5
init-hudson:
[echo]
@@ -361,7 +358,7 @@
Buildfile: build.xml
init:
- [echo] V1.0.0.Beta4
+ [echo] V1.0.0.Beta5
init-hudson:
[echo]
Modified: projects/jboss-osgi/trunk/distribution/docbook/en/modules/ch030-runtime.xml
===================================================================
--- projects/jboss-osgi/trunk/distribution/docbook/en/modules/ch030-runtime.xml 2009-12-04 15:34:41 UTC (rev 97464)
+++ projects/jboss-osgi/trunk/distribution/docbook/en/modules/ch030-runtime.xml 2009-12-04 15:38:52 UTC (rev 97465)
@@ -135,7 +135,7 @@
JBossOSGi Bootstrap Environment
- OSGI_HOME: /home/tdiesler/jboss-osgi-1.0.0.Beta4/runtime
+ OSGI_HOME: /home/tdiesler/jboss-osgi-1.0.0.Beta5/runtime
JAVA: /usr/java/jdk1.6/bin/java
Modified: projects/jboss-osgi/trunk/distribution/docbook/en/modules/ch040-framework-integration.xml
===================================================================
--- projects/jboss-osgi/trunk/distribution/docbook/en/modules/ch040-framework-integration.xml 2009-12-04 15:34:41 UTC (rev 97464)
+++ projects/jboss-osgi/trunk/distribution/docbook/en/modules/ch040-framework-integration.xml 2009-12-04 15:38:52 UTC (rev 97465)
@@ -8,7 +8,7 @@
<sect1 xml:id="SecIntegrationJBossMC">
<title>JBossMC Framework Integration</title>
- <para>Starting from 1.0.0.Beta4 JBoss OSGi provides integration for our native <ulink url="http://www.jboss.org/jbossmc/">Microcontainer based</ulink>
+ <para>Starting from 1.0.0.Beta5 JBoss OSGi provides integration for our native <ulink url="http://www.jboss.org/jbossmc/">Microcontainer based</ulink>
OSGi Framework. When deployed in JBossAS this Framework will eventually allow us to integrate with components from other programming models.
(i.e. OSGi services can access MC beans, EJB3 can access OSGi services, etc.)</para>
Modified: projects/jboss-osgi/trunk/distribution/docbook/en/modules/ch050-developer-guide.xml
===================================================================
--- projects/jboss-osgi/trunk/distribution/docbook/en/modules/ch050-developer-guide.xml 2009-12-04 15:34:41 UTC (rev 97464)
+++ projects/jboss-osgi/trunk/distribution/docbook/en/modules/ch050-developer-guide.xml 2009-12-04 15:38:52 UTC (rev 97465)
@@ -24,17 +24,17 @@
</imageobject>
</mediaobject>
- <para>The latest version of the <ulink url="http://jbmuc.dyndns.org/jboss-osgi-1.0.0.Beta4/apidocs">JBoss OSGi SPI</ulink>.</para>
+ <para>The latest version of the <ulink url="http://jbmuc.dyndns.org/jboss-osgi-1.0.0.Beta5/apidocs">JBoss OSGi SPI</ulink>.</para>
<itemizedlist>
- <listitem><ulink url="http://jbmuc.dyndns.org/jboss-osgi-1.0.0.Beta4/apidocs/org/jboss/osgi/spi...">org.jboss.osgi.spi</ulink> - Common classes and interfaces.</listitem>
- <listitem><ulink url="http://jbmuc.dyndns.org/jboss-osgi-1.0.0.Beta4/apidocs/org/jboss/osgi/spi...">org.jboss.osgi.spi.capability</ulink> - Capabilities that can be installed in the OSGi framework.</listitem>
- <listitem><ulink url="http://jbmuc.dyndns.org/jboss-osgi-1.0.0.Beta4/apidocs/org/jboss/osgi/spi...">org.jboss.osgi.spi.framework</ulink> - Framework integration and bootstrap.</listitem>
- <listitem><ulink url="http://jbmuc.dyndns.org/jboss-osgi-1.0.0.Beta4/apidocs/org/jboss/osgi/spi...">org.jboss.osgi.spi.logging</ulink> - Support for Bundle logging.</listitem>
- <listitem><ulink url="http://jbmuc.dyndns.org/jboss-osgi-1.0.0.Beta4/apidocs/org/jboss/osgi/spi...">org.jboss.osgi.spi.management</ulink> - Management view on deployed bundles.</listitem>
- <listitem><ulink url="http://jbmuc.dyndns.org/jboss-osgi-1.0.0.Beta4/apidocs/org/jboss/osgi/spi...">org.jboss.osgi.spi.service</ulink> - A collection of SPI provided services.</listitem>
- <listitem><ulink url="http://jbmuc.dyndns.org/jboss-osgi-1.0.0.Beta4/apidocs/org/jboss/osgi/spi...">org.jboss.osgi.spi.testing</ulink> - OSGi test support classes and interfaces.</listitem>
- <listitem><ulink url="http://jbmuc.dyndns.org/jboss-osgi-1.0.0.Beta4/apidocs/org/jboss/osgi/spi...">org.jboss.osgi.spi.util</ulink> - A collection of SPI provided utilities.</listitem>
+ <listitem><ulink url="http://jbmuc.dyndns.org/jboss-osgi-1.0.0.Beta5/apidocs/org/jboss/osgi/spi...">org.jboss.osgi.spi</ulink> - Common classes and interfaces.</listitem>
+ <listitem><ulink url="http://jbmuc.dyndns.org/jboss-osgi-1.0.0.Beta5/apidocs/org/jboss/osgi/spi...">org.jboss.osgi.spi.capability</ulink> - Capabilities that can be installed in the OSGi framework.</listitem>
+ <listitem><ulink url="http://jbmuc.dyndns.org/jboss-osgi-1.0.0.Beta5/apidocs/org/jboss/osgi/spi...">org.jboss.osgi.spi.framework</ulink> - Framework integration and bootstrap.</listitem>
+ <listitem><ulink url="http://jbmuc.dyndns.org/jboss-osgi-1.0.0.Beta5/apidocs/org/jboss/osgi/spi...">org.jboss.osgi.spi.logging</ulink> - Support for Bundle logging.</listitem>
+ <listitem><ulink url="http://jbmuc.dyndns.org/jboss-osgi-1.0.0.Beta5/apidocs/org/jboss/osgi/spi...">org.jboss.osgi.spi.management</ulink> - Management view on deployed bundles.</listitem>
+ <listitem><ulink url="http://jbmuc.dyndns.org/jboss-osgi-1.0.0.Beta5/apidocs/org/jboss/osgi/spi...">org.jboss.osgi.spi.service</ulink> - A collection of SPI provided services.</listitem>
+ <listitem><ulink url="http://jbmuc.dyndns.org/jboss-osgi-1.0.0.Beta5/apidocs/org/jboss/osgi/spi...">org.jboss.osgi.spi.testing</ulink> - OSGi test support classes and interfaces.</listitem>
+ <listitem><ulink url="http://jbmuc.dyndns.org/jboss-osgi-1.0.0.Beta5/apidocs/org/jboss/osgi/spi...">org.jboss.osgi.spi.util</ulink> - A collection of SPI provided utilities.</listitem>
</itemizedlist>
<emphasis role="bold">Bootstrapping JBoss OSGi</emphasis>
@@ -72,8 +72,8 @@
<para>The JBoss OSGi SPI comes with two bootstrap providers:</para>
<itemizedlist>
- <listitem><ulink url="http://jbmuc.dyndns.org/jboss-osgi-1.0.0.Beta4/apidocs/org/jboss/osgi/spi...">PropertiesBootstrapProvider</ulink></listitem>
- <listitem><ulink url="http://jbmuc.dyndns.org/jboss-osgi-1.0.0.Beta4/apidocs/org/jboss/osgi/spi...">MicrocontainerBootstrapProvider</ulink></listitem>
+ <listitem><ulink url="http://jbmuc.dyndns.org/jboss-osgi-1.0.0.Beta5/apidocs/org/jboss/osgi/spi...">PropertiesBootstrapProvider</ulink></listitem>
+ <listitem><ulink url="http://jbmuc.dyndns.org/jboss-osgi-1.0.0.Beta5/apidocs/org/jboss/osgi/spi...">MicrocontainerBootstrapProvider</ulink></listitem>
</itemizedlist>
<para>OSGiBootstrapProvider implementations that read their configurtation from some other source are possible, but currently not
@@ -94,7 +94,7 @@
<emphasis role="bold">The ManagedFramework</emphasis>
- <para>The <ulink url="http://jbmuc.dyndns.org/jboss-osgi-1.0.0.Beta4/apidocs/org/jboss/osgi/spi...">
+ <para>The <ulink url="http://jbmuc.dyndns.org/jboss-osgi-1.0.0.Beta5/apidocs/org/jboss/osgi/spi...">
ManagedFramework</ulink> gives you access to the MBean views of the deployed Bundles. It is registerd under the name:</para>
<itemizedlist>
@@ -103,7 +103,7 @@
<emphasis role="bold">The ManagedBundle</emphasis>
- <para>The <ulink url="http://jbmuc.dyndns.org/jboss-osgi-1.0.0.Beta4/apidocs/org/jboss/osgi/spi...">
+ <para>The <ulink url="http://jbmuc.dyndns.org/jboss-osgi-1.0.0.Beta5/apidocs/org/jboss/osgi/spi...">
ManagedBundle</ulink> gives you access to the MBean views of a deployed Bundle. It is registerd under the name:</para>
<itemizedlist>
@@ -113,7 +113,7 @@
<emphasis role="bold">Accessing the Management Objects</emphasis>
<para>If you work with the JBoss OSGi Testsuite you get access to the Managed Objects through the JBoss OSGi SPI provided
- <ulink url="http://junit.sourceforge.net/">JUnit</ulink> support package <ulink url="http://jbmuc.dyndns.org/jboss-osgi-1.0.0.Beta4/apidocs/org/jboss/osgi/spi...">org.jboss.osgi.spi.testing</ulink>.
+ <ulink url="http://junit.sourceforge.net/">JUnit</ulink> support package <ulink url="http://jbmuc.dyndns.org/jboss-osgi-1.0.0.Beta5/apidocs/org/jboss/osgi/spi...">org.jboss.osgi.spi.testing</ulink>.
</para>
<para>If you install JBoss OSGi in an already existing JBossAS instance you also get access to the Managed Objects through the JBoss provided
@@ -134,7 +134,7 @@
<title>Writing Test Cases</title>
<para>JBoss OSGi comes with <ulink url="http://www.junit.org">JUnit</ulink> test support as part of the SPI provided
- <ulink url="http://jbmuc.dyndns.org/jboss-osgi-1.0.0.Beta4/apidocs/org/jboss/osgi/spi...">org.jboss.osgi.spi.testing</ulink>
+ <ulink url="http://jbmuc.dyndns.org/jboss-osgi-1.0.0.Beta5/apidocs/org/jboss/osgi/spi...">org.jboss.osgi.spi.testing</ulink>
package. There are two distinct test scenarios that we support:</para>
<itemizedlist>
Modified: projects/jboss-osgi/trunk/distribution/docbook/en/modules/ch060-husky-testing.xml
===================================================================
--- projects/jboss-osgi/trunk/distribution/docbook/en/modules/ch060-husky-testing.xml 2009-12-04 15:34:41 UTC (rev 97464)
+++ projects/jboss-osgi/trunk/distribution/docbook/en/modules/ch060-husky-testing.xml 2009-12-04 15:38:52 UTC (rev 97465)
@@ -64,39 +64,39 @@
<para>Here is how it works </para>
<orderedlist>
- <listitem>A <ulink url="http://jbmuc.dyndns.org/jboss-osgi-1.0.0.Beta4/apidocs/org/jboss/osgi/hus...">Bridge</ulink>
+ <listitem>A <ulink url="http://jbmuc.dyndns.org/jboss-osgi-1.0.0.Beta5/apidocs/org/jboss/osgi/hus...">Bridge</ulink>
intercepts a test and determines the FQN of the test case and the test method from the call stack. It then delegates the execution to the same
(or another) test in and isolated test environment. An isolated test environment is one that does not have the same class loading space as
the test itself.</listitem>
- <listitem>A Bridge is associated with an <ulink url="http://jbmuc.dyndns.org/jboss-osgi-1.0.0.Beta4/apidocs/org/jboss/osgi/hus...">
+ <listitem>A Bridge is associated with an <ulink url="http://jbmuc.dyndns.org/jboss-osgi-1.0.0.Beta5/apidocs/org/jboss/osgi/hus...">
Invoker</ulink>. Invokers may be arbitarily complex. Local 'in proccess' invokers are possible just as well as remote invokers. </listitem>
- <listitem>The Invoker sends the <ulink url="http://jbmuc.dyndns.org/jboss-osgi-1.0.0.Beta4/apidocs/org/jboss/osgi/hus...">
- Request</ulink> to a <ulink url="http://jbmuc.dyndns.org/jboss-osgi-1.0.0.Beta4/apidocs/org/jboss/osgi/hus...">
+ <listitem>The Invoker sends the <ulink url="http://jbmuc.dyndns.org/jboss-osgi-1.0.0.Beta5/apidocs/org/jboss/osgi/hus...">
+ Request</ulink> to a <ulink url="http://jbmuc.dyndns.org/jboss-osgi-1.0.0.Beta5/apidocs/org/jboss/osgi/hus...">
Connector</ulink> in the isolated test environment.</listitem>
- <listitem>A Connector has associated <ulink url="http://jbmuc.dyndns.org/jboss-osgi-1.0.0.Beta4/apidocs/org/jboss/osgi/hus...">
+ <listitem>A Connector has associated <ulink url="http://jbmuc.dyndns.org/jboss-osgi-1.0.0.Beta5/apidocs/org/jboss/osgi/hus...">
PackageListeners</ulink> that are responsible for processing test cases for their respective test packages.</listitem>
- <listitem>A PackageListeners delegates the Request to a test <ulink url="http://jbmuc.dyndns.org/jboss-osgi-1.0.0.Beta4/apidocs/org/jboss/osgi/hus...">
- Runner</ulink>, typicaly this would be a <ulink url="http://jbmuc.dyndns.org/jboss-osgi-1.0.0.Beta4/apidocs/org/jboss/osgi/hus...">
+ <listitem>A PackageListeners delegates the Request to a test <ulink url="http://jbmuc.dyndns.org/jboss-osgi-1.0.0.Beta5/apidocs/org/jboss/osgi/hus...">
+ Runner</ulink>, typicaly this would be a <ulink url="http://jbmuc.dyndns.org/jboss-osgi-1.0.0.Beta5/apidocs/org/jboss/osgi/hus...">
JUnitRunner</ulink>.</listitem>
- <listitem>The Runner injects the <ulink url="http://jbmuc.dyndns.org/jboss-osgi-1.0.0.Beta4/apidocs/org/jboss/osgi/hus...">
- Context</ulink> into the test case and returns a <ulink url="http://jbmuc.dyndns.org/jboss-osgi-1.0.0.Beta4/apidocs/org/jboss/osgi/hus...">
+ <listitem>The Runner injects the <ulink url="http://jbmuc.dyndns.org/jboss-osgi-1.0.0.Beta5/apidocs/org/jboss/osgi/hus...">
+ Context</ulink> into the test case and returns a <ulink url="http://jbmuc.dyndns.org/jboss-osgi-1.0.0.Beta5/apidocs/org/jboss/osgi/hus...">
Response</ulink>, which the Connector returns to the Invoker.</listitem>
- <listitem>The Bridge finally translates potential <ulink url="http://jbmuc.dyndns.org/jboss-osgi-1.0.0.Beta4/apidocs/org/jboss/osgi/hus...">
+ <listitem>The Bridge finally translates potential <ulink url="http://jbmuc.dyndns.org/jboss-osgi-1.0.0.Beta5/apidocs/org/jboss/osgi/hus...">
Failures</ulink> that may be contained in the Result, to test failures on the client side.</listitem>
</orderedlist>
<para>The JBoss OSGi <emphasis role="bold">jboss-osgi-husky.jar</emphasis> bundle registers the Connectors.
- The <ulink url="http://jbmuc.dyndns.org/jboss-osgi-1.0.0.Beta4/apidocs/org/jboss/osgi/hus...">
+ The <ulink url="http://jbmuc.dyndns.org/jboss-osgi-1.0.0.Beta5/apidocs/org/jboss/osgi/hus...">
JMXConnector</ulink> is always registered.
- The <ulink url="http://jbmuc.dyndns.org/jboss-osgi-1.0.0.Beta4/apidocs/org/jboss/osgi/hus...">
+ The <ulink url="http://jbmuc.dyndns.org/jboss-osgi-1.0.0.Beta5/apidocs/org/jboss/osgi/hus...">
SocketConnector</ulink> is registered when the appropriate configuration options are set. It then registers the
- <ulink url="http://jbmuc.dyndns.org/jboss-osgi-1.0.0.Beta4/apidocs/org/jboss/osgi/hus...">HuskyExtender</ulink>,
+ <ulink url="http://jbmuc.dyndns.org/jboss-osgi-1.0.0.Beta5/apidocs/org/jboss/osgi/hus...">HuskyExtender</ulink>,
which is a <ulink url="http://www.osgi.org/javadoc/r4v41/org/osgi/framework/BundleListener.html">BundleListener</ulink> that inspects every
incomming bundle for the <emphasis role="bold">Test-Package</emphasis> manifest header. The Extender creates a PackageListener
for every package in the 'Test-Package' manifest header and registers them with the available Connectors.</para>
Modified: projects/jboss-osgi/trunk/distribution/docbook/en/modules/ch070-provided-bundles.xml
===================================================================
--- projects/jboss-osgi/trunk/distribution/docbook/en/modules/ch070-provided-bundles.xml 2009-12-04 15:34:41 UTC (rev 97464)
+++ projects/jboss-osgi/trunk/distribution/docbook/en/modules/ch070-provided-bundles.xml 2009-12-04 15:38:52 UTC (rev 97465)
@@ -20,8 +20,8 @@
<emphasis role="bold">Blueprint Reflection</emphasis> packages.</para>
<itemizedlist>
- <listitem><emphasis role="bold"><ulink url="http://jbmuc.dyndns.org/jboss-osgi-1.0.0.Beta4/apidocs/org/osgi/service/b...">org.osgi.service.blueprint.container</ulink></emphasis></listitem>
- <listitem><emphasis role="bold"><ulink url="http://jbmuc.dyndns.org/jboss-osgi-1.0.0.Beta4/apidocs/org/osgi/service/b...">org.osgi.service.blueprint.reflect</ulink></emphasis></listitem>
+ <listitem><emphasis role="bold"><ulink url="http://jbmuc.dyndns.org/jboss-osgi-1.0.0.Beta5/apidocs/org/osgi/service/b...">org.osgi.service.blueprint.container</ulink></emphasis></listitem>
+ <listitem><emphasis role="bold"><ulink url="http://jbmuc.dyndns.org/jboss-osgi-1.0.0.Beta5/apidocs/org/osgi/service/b...">org.osgi.service.blueprint.reflect</ulink></emphasis></listitem>
</itemizedlist>
</sect1>
@@ -48,7 +48,7 @@
<para>The service is registered with the Framework under the name</para>
<itemizedlist>
- <listitem><emphasis role="bold"><ulink url="http://jbmuc.dyndns.org/jboss-osgi-1.0.0.Beta4/apidocs/org/jboss/osgi/jax...">org.jboss.osgi.jaxb.JAXBService</ulink></emphasis></listitem>
+ <listitem><emphasis role="bold"><ulink url="http://jbmuc.dyndns.org/jboss-osgi-1.0.0.Beta5/apidocs/org/jboss/osgi/jax...">org.jboss.osgi.jaxb.JAXBService</ulink></emphasis></listitem>
</itemizedlist>
</sect1>
@@ -85,7 +85,7 @@
<itemizedlist>
<listitem><emphasis role="bold"><ulink url="http://java.sun.com/javase/6/docs/api/javax/management/MBeanServer.html">javax.management.MBeanServer</ulink></emphasis></listitem>
- <listitem><emphasis role="bold"><ulink url="http://jbmuc.dyndns.org/jboss-osgi-1.0.0.Beta4/apidocs/org/jboss/osgi/spi...">org.jboss.osgi.spi.management.ManagedBundleService</ulink></emphasis></listitem>
+ <listitem><emphasis role="bold"><ulink url="http://jbmuc.dyndns.org/jboss-osgi-1.0.0.Beta5/apidocs/org/jboss/osgi/spi...">org.jboss.osgi.spi.management.ManagedBundleService</ulink></emphasis></listitem>
<!-- https://jira.jboss.org/jira/browse/JBOSGI-125 -->
</itemizedlist>
@@ -157,7 +157,7 @@
The service is registered with the Framework under the name</para>
<itemizedlist>
- <listitem><emphasis role="bold"><ulink url="http://jbmuc.dyndns.org/jboss-osgi-1.0.0.Beta4/apidocs/org/jboss/osgi/mic...">org.jboss.osgi.microcontainer.MicrocontainerService</ulink></emphasis></listitem>
+ <listitem><emphasis role="bold"><ulink url="http://jbmuc.dyndns.org/jboss-osgi-1.0.0.Beta5/apidocs/org/jboss/osgi/mic...">org.jboss.osgi.microcontainer.MicrocontainerService</ulink></emphasis></listitem>
</itemizedlist>
<para>Here is an example of how an OSGi component can access an arbitrary MC bean.</para>
Modified: projects/jboss-osgi/trunk/distribution/docbook/en/modules/ch080-provided-examples.xml
===================================================================
--- projects/jboss-osgi/trunk/distribution/docbook/en/modules/ch080-provided-examples.xml 2009-12-04 15:34:41 UTC (rev 97464)
+++ projects/jboss-osgi/trunk/distribution/docbook/en/modules/ch080-provided-examples.xml 2009-12-04 15:38:52 UTC (rev 97465)
@@ -260,7 +260,7 @@
<note>
<para>Please note that access to the MBeanServer from the test case is part of the
- <ulink url="http://jbmuc.dyndns.org/jboss-osgi-1.0.0.Beta4/apidocs/org/jboss/osgi/spi...">
+ <ulink url="http://jbmuc.dyndns.org/jboss-osgi-1.0.0.Beta5/apidocs/org/jboss/osgi/spi...">
OSGiRuntime</ulink> abstraction.</para>
</note>
@@ -306,7 +306,7 @@
<note>
<para>Please note that access to the InitialContext from the test case is part of the
- <ulink url="http://jbmuc.dyndns.org/jboss-osgi-1.0.0.Beta4/apidocs/org/jboss/osgi/spi...">
+ <ulink url="http://jbmuc.dyndns.org/jboss-osgi-1.0.0.Beta5/apidocs/org/jboss/osgi/spi...">
OSGiRuntime</ulink> abstraction.</para>
</note>
16 years, 7 months
JBoss-OSGI SVN: r97464 - projects/jboss-osgi/trunk/hudson/hudson-home/jobs/jbossosgi-matrix-jbossmc.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-12-04 10:34:41 -0500 (Fri, 04 Dec 2009)
New Revision: 97464
Modified:
projects/jboss-osgi/trunk/hudson/hudson-home/jobs/jbossosgi-matrix-jbossmc/config.xml
Log:
Add combination filter for jdk1.6
Modified: projects/jboss-osgi/trunk/hudson/hudson-home/jobs/jbossosgi-matrix-jbossmc/config.xml
===================================================================
--- projects/jboss-osgi/trunk/hudson/hudson-home/jobs/jbossosgi-matrix-jbossmc/config.xml 2009-12-04 15:34:29 UTC (rev 97463)
+++ projects/jboss-osgi/trunk/hudson/hudson-home/jobs/jbossosgi-matrix-jbossmc/config.xml 2009-12-04 15:34:41 UTC (rev 97464)
@@ -49,9 +49,11 @@
<name>jdk</name>
<values>
<string>jdk1.6</string>
+ <string>jdk1.5</string>
</values>
</axis>
</axes>
+ <combinationFilter>jdk=='jdk1.6'</combinationFilter>
<builders>
<hudson.tasks.Shell>
<command>
16 years, 7 months
JBoss-OSGI SVN: r97462 - in projects/jboss-osgi/projects/runtime/framework/trunk/src: test/java/org/jboss/test/osgi/service and 1 other directories.
by jboss-osgi-commits@lists.jboss.org
Author: alesj
Date: 2009-12-04 10:21:15 -0500 (Fri, 04 Dec 2009)
New Revision: 97462
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/OSGiServiceState.java
projects/jboss-osgi/projects/runtime/framework/trunk/src/test/java/org/jboss/test/osgi/service/ServiceMixUnitTestCase.java
projects/jboss-osgi/projects/runtime/framework/trunk/src/test/java/org/jboss/test/osgi/service/support/d/D.java
Log:
Fix the order of install/register/uninstall/unregister.
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 2009-12-04 15:01:02 UTC (rev 97461)
+++ projects/jboss-osgi/projects/runtime/framework/trunk/src/main/java/org/jboss/osgi/framework/bundle/OSGiBundleManager.java 2009-12-04 15:21:15 UTC (rev 97462)
@@ -1395,8 +1395,6 @@
OSGiServiceState registerService(AbstractBundleState bundleState, String[] clazzes, Object service, Dictionary properties)
{
OSGiServiceState result = new OSGiServiceState(bundleState, clazzes, service, properties);
- result.internalRegister();
-
try
{
Controller controller = kernel.getController();
@@ -1405,9 +1403,9 @@
catch (Throwable t)
{
fireError(bundleState, "installing service to MC in", t);
- result.internalUnregister();
throw new RuntimeException(t);
}
+ result.internalRegister();
FrameworkEventsPlugin plugin = getPlugin(FrameworkEventsPlugin.class);
plugin.fireServiceEvent(bundleState, ServiceEvent.REGISTERED, result);
@@ -1422,13 +1420,13 @@
*/
void unregisterService(OSGiServiceState serviceState)
{
- Controller controller = kernel.getController();
- controller.uninstall(serviceState.getName());
+ serviceState.internalUnregister();
FrameworkEventsPlugin plugin = getPlugin(FrameworkEventsPlugin.class);
plugin.fireServiceEvent(serviceState.getBundleState(), ServiceEvent.UNREGISTERING, serviceState);
- serviceState.internalUnregister();
+ Controller controller = kernel.getController();
+ controller.uninstall(serviceState.getName());
}
/**
Modified: projects/jboss-osgi/projects/runtime/framework/trunk/src/main/java/org/jboss/osgi/framework/bundle/OSGiServiceState.java
===================================================================
--- projects/jboss-osgi/projects/runtime/framework/trunk/src/main/java/org/jboss/osgi/framework/bundle/OSGiServiceState.java 2009-12-04 15:01:02 UTC (rev 97461)
+++ projects/jboss-osgi/projects/runtime/framework/trunk/src/main/java/org/jboss/osgi/framework/bundle/OSGiServiceState.java 2009-12-04 15:21:15 UTC (rev 97462)
@@ -615,6 +615,10 @@
*/
void internalUnregister()
{
+ // let's remove us from our bundle first
+ // so, we're not "mistaken" for a real user
+ getBundleState().removeRegisteredService(this);
+
ContextTracker ct = getContextTracker();
if (ct != null) // nobody used us?
{
@@ -653,7 +657,6 @@
}
}
- getBundleState().removeRegisteredService(this);
serviceOrFactory = null;
}
Modified: projects/jboss-osgi/projects/runtime/framework/trunk/src/test/java/org/jboss/test/osgi/service/ServiceMixUnitTestCase.java
===================================================================
--- projects/jboss-osgi/projects/runtime/framework/trunk/src/test/java/org/jboss/test/osgi/service/ServiceMixUnitTestCase.java 2009-12-04 15:01:02 UTC (rev 97461)
+++ projects/jboss-osgi/projects/runtime/framework/trunk/src/test/java/org/jboss/test/osgi/service/ServiceMixUnitTestCase.java 2009-12-04 15:21:15 UTC (rev 97462)
@@ -24,6 +24,7 @@
import java.lang.reflect.Method;
import java.util.Dictionary;
import java.util.Hashtable;
+import java.util.Set;
import junit.framework.Test;
@@ -257,17 +258,19 @@
ServiceRegistration reg1 = bundleContext1.registerService(A.class.getName(), d, table);
assertNotNull(reg1);
+ Object a1 = null;
+ Object a2 = null;
try
{
checkComplete();
Object c1 = getBean("C1");
- Object a1 = invoke(c1, "getA", "C1");
+ a1 = invoke(c1, "getA", "C1");
Object msg1 = invoke(a1, "getMsg", "A1");
assertEquals(msg1, getBundle(bean1).getSymbolicName());
Object c2 = getBean("C2");
- Object a2 = invoke(c2, "getA", "C2");
+ a2 = invoke(c2, "getA", "C2");
Object msg2 = invoke(a2, "getMsg", "A2");
assertEquals(msg2, getBundle(bean2).getSymbolicName());
}
@@ -275,6 +278,11 @@
{
reg1.unregister();
}
+
+ Set as = assertInstanceOf(invoke(d, "getAs", "A"), Set.class);
+ assertNotNull(as);
+ assertTrue(as.contains(a1));
+ assertTrue(as.contains(a2));
}
finally
{
Modified: projects/jboss-osgi/projects/runtime/framework/trunk/src/test/java/org/jboss/test/osgi/service/support/d/D.java
===================================================================
--- projects/jboss-osgi/projects/runtime/framework/trunk/src/test/java/org/jboss/test/osgi/service/support/d/D.java 2009-12-04 15:01:02 UTC (rev 97461)
+++ projects/jboss-osgi/projects/runtime/framework/trunk/src/test/java/org/jboss/test/osgi/service/support/d/D.java 2009-12-04 15:21:15 UTC (rev 97462)
@@ -21,6 +21,9 @@
*/
package org.jboss.test.osgi.service.support.d;
+import java.util.Set;
+import java.util.HashSet;
+
import org.jboss.test.osgi.service.support.a.A;
import org.osgi.framework.Bundle;
import org.osgi.framework.ServiceFactory;
@@ -31,6 +34,8 @@
*/
public class D implements ServiceFactory
{
+ private Set<Object> as = new HashSet<Object>();
+
public Object getService(Bundle bundle, ServiceRegistration registration)
{
A a = new A();
@@ -40,5 +45,11 @@
public void ungetService(Bundle bundle, ServiceRegistration registration, Object service)
{
+ as.add(service);
}
+
+ public Set<Object> getAs()
+ {
+ return as;
+ }
}
16 years, 7 months
JBoss-OSGI SVN: r97459 - in projects/jboss-osgi/projects/runtime/framework/trunk/src: test/java/org/jboss/test/osgi/service/support/d and 1 other directory.
by jboss-osgi-commits@lists.jboss.org
Author: alesj
Date: 2009-12-04 08:43:11 -0500 (Fri, 04 Dec 2009)
New Revision: 97459
Modified:
projects/jboss-osgi/projects/runtime/framework/trunk/src/main/java/org/jboss/osgi/framework/classloading/OSGiClassLoaderSystem.java
projects/jboss-osgi/projects/runtime/framework/trunk/src/test/java/org/jboss/test/osgi/service/support/d/D.java
Log:
Fix broken CLSystem usage.
It explains previous service-mix issues.
Modified: projects/jboss-osgi/projects/runtime/framework/trunk/src/main/java/org/jboss/osgi/framework/classloading/OSGiClassLoaderSystem.java
===================================================================
--- projects/jboss-osgi/projects/runtime/framework/trunk/src/main/java/org/jboss/osgi/framework/classloading/OSGiClassLoaderSystem.java 2009-12-04 13:36:12 UTC (rev 97458)
+++ projects/jboss-osgi/projects/runtime/framework/trunk/src/main/java/org/jboss/osgi/framework/classloading/OSGiClassLoaderSystem.java 2009-12-04 13:43:11 UTC (rev 97459)
@@ -21,10 +21,13 @@
*/
package org.jboss.osgi.framework.classloading;
+import org.jboss.classloader.plugins.filter.PatternClassFilter;
import org.jboss.classloader.plugins.jdk.AbstractJDKChecker;
import org.jboss.classloader.spi.ClassLoaderDomain;
import org.jboss.classloader.spi.ClassLoaderSystem;
import org.jboss.classloader.spi.ParentPolicy;
+import org.jboss.classloader.spi.filter.ClassFilterUtils;
+import org.jboss.classloader.spi.filter.RecursivePackageClassFilter;
import org.jboss.osgi.framework.bundle.AbstractBundleState;
import org.jboss.osgi.framework.bundle.OSGiBundleState;
@@ -44,7 +47,10 @@
{
ClassLoaderDomain domain = getDefaultDomain();
- domain.setParentPolicy(ParentPolicy.BEFORE_BUT_JAVA_ONLY);
+ PatternClassFilter filter = RecursivePackageClassFilter.createRecursivePackageClassFilterFromString("org.osgi");
+ filter.setIncludeJava(true);
+ domain.setParentPolicy(new ParentPolicy(filter, ClassFilterUtils.NOTHING));
+
AbstractJDKChecker.getExcluded().add(AbstractBundleState.class);
AbstractJDKChecker.getExcluded().add(OSGiBundleState.class);
}
Modified: projects/jboss-osgi/projects/runtime/framework/trunk/src/test/java/org/jboss/test/osgi/service/support/d/D.java
===================================================================
--- projects/jboss-osgi/projects/runtime/framework/trunk/src/test/java/org/jboss/test/osgi/service/support/d/D.java 2009-12-04 13:36:12 UTC (rev 97458)
+++ projects/jboss-osgi/projects/runtime/framework/trunk/src/test/java/org/jboss/test/osgi/service/support/d/D.java 2009-12-04 13:43:11 UTC (rev 97459)
@@ -21,8 +21,6 @@
*/
package org.jboss.test.osgi.service.support.d;
-import java.lang.reflect.Method;
-
import org.jboss.test.osgi.service.support.a.A;
import org.osgi.framework.Bundle;
import org.osgi.framework.ServiceFactory;
@@ -33,27 +31,10 @@
*/
public class D implements ServiceFactory
{
- private static Object invoke(Object target, String getter)
- {
- try
- {
- Class<?> clazz = target.getClass();
- Method m = clazz.getDeclaredMethod(getter);
- return m.invoke(target);
- }
- catch (Exception e)
- {
- throw new RuntimeException(e);
- }
- }
-
public Object getService(Bundle bundle, ServiceRegistration registration)
{
A a = new A();
- // TODO -- why this doesn't work? java.lang.NoClassDefFoundError: org/osgi/framework/Bundle
- // a.msg = bundle.getSymbolicName();
- // TODO - but this does ...
- a.msg = invoke(bundle, "getSymbolicName").toString();
+ a.msg = bundle.getSymbolicName();
return a;
}
16 years, 7 months
JBoss-OSGI SVN: r97454 - in projects/jboss-osgi/projects/runtime/framework/trunk/src/test/resources/bundles/service: service-bundle4/META-INF and 1 other directory.
by jboss-osgi-commits@lists.jboss.org
Author: alesj
Date: 2009-12-04 07:23:44 -0500 (Fri, 04 Dec 2009)
New Revision: 97454
Modified:
projects/jboss-osgi/projects/runtime/framework/trunk/src/test/resources/bundles/service/service-bundle3/META-INF/MANIFEST.MF
projects/jboss-osgi/projects/runtime/framework/trunk/src/test/resources/bundles/service/service-bundle4/META-INF/MANIFEST.MF
Log:
Fix manifest headers - , instead of ;.
Modified: projects/jboss-osgi/projects/runtime/framework/trunk/src/test/resources/bundles/service/service-bundle3/META-INF/MANIFEST.MF
===================================================================
--- projects/jboss-osgi/projects/runtime/framework/trunk/src/test/resources/bundles/service/service-bundle3/META-INF/MANIFEST.MF 2009-12-04 12:17:22 UTC (rev 97453)
+++ projects/jboss-osgi/projects/runtime/framework/trunk/src/test/resources/bundles/service/service-bundle3/META-INF/MANIFEST.MF 2009-12-04 12:23:44 UTC (rev 97454)
@@ -4,4 +4,4 @@
Implementation-Vendor: jboss.org
Bundle-Name: Service3
Bundle-SymbolicName: org.jboss.test.osgi.service3
-Import-Package: org.jboss.test.osgi.service.support.a;org.jboss.test.osgi.service.support.c
+Import-Package: org.jboss.test.osgi.service.support.a,org.jboss.test.osgi.service.support.c
Modified: projects/jboss-osgi/projects/runtime/framework/trunk/src/test/resources/bundles/service/service-bundle4/META-INF/MANIFEST.MF
===================================================================
--- projects/jboss-osgi/projects/runtime/framework/trunk/src/test/resources/bundles/service/service-bundle4/META-INF/MANIFEST.MF 2009-12-04 12:17:22 UTC (rev 97453)
+++ projects/jboss-osgi/projects/runtime/framework/trunk/src/test/resources/bundles/service/service-bundle4/META-INF/MANIFEST.MF 2009-12-04 12:23:44 UTC (rev 97454)
@@ -4,4 +4,4 @@
Implementation-Vendor: jboss.org
Bundle-Name: Service4
Bundle-SymbolicName: org.jboss.test.osgi.service4
-Import-Package: org.jboss.test.osgi.service.support.a;org.jboss.test.osgi.service.support.c;org.jboss.test.osgi.service.support.d;org.osgi.framework
+Import-Package: org.jboss.test.osgi.service.support.a,org.jboss.test.osgi.service.support.c,org.jboss.test.osgi.service.support.d,org.osgi.framework
16 years, 7 months
JBoss-OSGI SVN: r97453 - in projects/jboss-osgi/projects/runtime/framework/trunk/src/test/java/org/jboss/test/osgi: service and 1 other directories.
by jboss-osgi-commits@lists.jboss.org
Author: alesj
Date: 2009-12-04 07:17:22 -0500 (Fri, 04 Dec 2009)
New Revision: 97453
Modified:
projects/jboss-osgi/projects/runtime/framework/trunk/src/test/java/org/jboss/test/osgi/DeployersTest.java
projects/jboss-osgi/projects/runtime/framework/trunk/src/test/java/org/jboss/test/osgi/service/ServiceMixUnitTestCase.java
projects/jboss-osgi/projects/runtime/framework/trunk/src/test/java/org/jboss/test/osgi/service/support/d/D.java
Log:
Hack the test with reflection. TODO - find real fix.
Modified: projects/jboss-osgi/projects/runtime/framework/trunk/src/test/java/org/jboss/test/osgi/DeployersTest.java
===================================================================
--- projects/jboss-osgi/projects/runtime/framework/trunk/src/test/java/org/jboss/test/osgi/DeployersTest.java 2009-12-04 12:06:19 UTC (rev 97452)
+++ projects/jboss-osgi/projects/runtime/framework/trunk/src/test/java/org/jboss/test/osgi/DeployersTest.java 2009-12-04 12:17:22 UTC (rev 97453)
@@ -95,7 +95,8 @@
protected Deployment addBean(String name, Class<?> beanClass, BeanMetaData bmd, Class<?> ... references) throws Exception
{
AssembledDirectory dir = createAssembledDirectory(name, "");
- addPackage(dir, beanClass);
+ if (beanClass != null)
+ addPackage(dir, beanClass);
if (references != null)
{
for (Class<?> reference : references)
Modified: projects/jboss-osgi/projects/runtime/framework/trunk/src/test/java/org/jboss/test/osgi/service/ServiceMixUnitTestCase.java
===================================================================
--- projects/jboss-osgi/projects/runtime/framework/trunk/src/test/java/org/jboss/test/osgi/service/ServiceMixUnitTestCase.java 2009-12-04 12:06:19 UTC (rev 97452)
+++ projects/jboss-osgi/projects/runtime/framework/trunk/src/test/java/org/jboss/test/osgi/service/ServiceMixUnitTestCase.java 2009-12-04 12:17:22 UTC (rev 97453)
@@ -107,7 +107,7 @@
private static Object invoke(Object target, String getter, String name) throws Throwable
{
- assertNotNull("Target" + name + " is not null", target);
+ assertNotNull("Target " + name + " is not null", target);
Class<?> clazz = target.getClass();
Method m = clazz.getDeclaredMethod(getter);
return m.invoke(target);
@@ -240,7 +240,7 @@
builder = BeanMetaDataBuilder.createBuilder("C2", C.class.getName());
builder.addPropertyMetaData("a", builder.createInject("A"));
bmd = builder.getBeanMetaData();
- Deployment bean2 = addBean("beanA2", C.class, bmd, A.class, D.class);
+ Deployment bean2 = addBean("beanA2", null, bmd);
try
{
Bundle bundle1 = assembleBundle("simple2", "/bundles/service/service-bundle4");
Modified: projects/jboss-osgi/projects/runtime/framework/trunk/src/test/java/org/jboss/test/osgi/service/support/d/D.java
===================================================================
--- projects/jboss-osgi/projects/runtime/framework/trunk/src/test/java/org/jboss/test/osgi/service/support/d/D.java 2009-12-04 12:06:19 UTC (rev 97452)
+++ projects/jboss-osgi/projects/runtime/framework/trunk/src/test/java/org/jboss/test/osgi/service/support/d/D.java 2009-12-04 12:17:22 UTC (rev 97453)
@@ -21,6 +21,8 @@
*/
package org.jboss.test.osgi.service.support.d;
+import java.lang.reflect.Method;
+
import org.jboss.test.osgi.service.support.a.A;
import org.osgi.framework.Bundle;
import org.osgi.framework.ServiceFactory;
@@ -31,11 +33,27 @@
*/
public class D implements ServiceFactory
{
+ private static Object invoke(Object target, String getter)
+ {
+ try
+ {
+ Class<?> clazz = target.getClass();
+ Method m = clazz.getDeclaredMethod(getter);
+ return m.invoke(target);
+ }
+ catch (Exception e)
+ {
+ throw new RuntimeException(e);
+ }
+ }
+
public Object getService(Bundle bundle, ServiceRegistration registration)
{
A a = new A();
// TODO -- why this doesn't work? java.lang.NoClassDefFoundError: org/osgi/framework/Bundle
- a.msg = bundle.getSymbolicName();
+ // a.msg = bundle.getSymbolicName();
+ // TODO - but this does ...
+ a.msg = invoke(bundle, "getSymbolicName").toString();
return a;
}
16 years, 7 months