JBoss-OSGI SVN: r95823 - in projects/jboss-osgi/trunk: distribution/installer/src/main/resources/runtime/server/conf and 4 other directories.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-10-30 08:29:02 -0400 (Fri, 30 Oct 2009)
New Revision: 95823
Modified:
projects/jboss-osgi/trunk/distribution/installer/src/main/resources/jbossas/jboss-beans-felix.xml
projects/jboss-osgi/trunk/distribution/installer/src/main/resources/runtime/server/conf/jboss-osgi-felix-all.properties
projects/jboss-osgi/trunk/distribution/installer/src/main/resources/runtime/server/conf/jboss-osgi-felix-default.properties
projects/jboss-osgi/trunk/distribution/installer/src/main/resources/runtime/server/conf/jboss-osgi-felix-minimal.properties
projects/jboss-osgi/trunk/distribution/installer/src/main/resources/runtime/server/conf/jboss-osgi-felix-web.properties
projects/jboss-osgi/trunk/reactor/blueprint/testsuite/src/test/resources/jboss-osgi-felix.properties
projects/jboss-osgi/trunk/testsuite/example/src/test/resources/jboss-osgi-equinox.properties
projects/jboss-osgi/trunk/testsuite/example/src/test/resources/jboss-osgi-felix.properties
projects/jboss-osgi/trunk/testsuite/functional/pom.xml
projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jboss-osgi-equinox.properties
projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jboss-osgi-felix.properties
Log:
User explicit version qualifier for deployment imports
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-10-30 11:09:19 UTC (rev 95822)
+++ projects/jboss-osgi/trunk/distribution/installer/src/main/resources/jbossas/jboss-beans-felix.xml 2009-10-30 12:29:02 UTC (rev 95823)
@@ -34,8 +34,8 @@
org.apache.log4j;version=1.2,
<!-- jboss-osgi -->
- org.jboss.osgi.deployment.deployer,
- org.jboss.osgi.deployment.internal,
+ org.jboss.osgi.deployment.deployer;version=1.0,
+ org.jboss.osgi.deployment.internal;version=1.0,
org.jboss.osgi.jbossxb;version=2.0,
org.jboss.osgi.microcontainer;version=1.0,
org.jboss.osgi.spi;version=1.0,
Modified: projects/jboss-osgi/trunk/distribution/installer/src/main/resources/runtime/server/conf/jboss-osgi-felix-all.properties
===================================================================
--- projects/jboss-osgi/trunk/distribution/installer/src/main/resources/runtime/server/conf/jboss-osgi-felix-all.properties 2009-10-30 11:09:19 UTC (rev 95822)
+++ projects/jboss-osgi/trunk/distribution/installer/src/main/resources/runtime/server/conf/jboss-osgi-felix-all.properties 2009-10-30 12:29:02 UTC (rev 95823)
@@ -33,8 +33,8 @@
org.apache.log4j;version=1.2, \
org.jboss.logging, \
org.jboss.net.protocol, \
- org.jboss.osgi.deployment.deployer, \
- org.jboss.osgi.deployment.interceptor, \
+ org.jboss.osgi.deployment.deployer;version=1.0, \
+ org.jboss.osgi.deployment.interceptor;version=1.0, \
org.jboss.osgi.spi;version=1.0, \
org.jboss.osgi.spi.capability;version=1.0, \
org.jboss.osgi.spi.framework;version=1.0, \
Modified: projects/jboss-osgi/trunk/distribution/installer/src/main/resources/runtime/server/conf/jboss-osgi-felix-default.properties
===================================================================
--- projects/jboss-osgi/trunk/distribution/installer/src/main/resources/runtime/server/conf/jboss-osgi-felix-default.properties 2009-10-30 11:09:19 UTC (rev 95822)
+++ projects/jboss-osgi/trunk/distribution/installer/src/main/resources/runtime/server/conf/jboss-osgi-felix-default.properties 2009-10-30 12:29:02 UTC (rev 95823)
@@ -24,8 +24,8 @@
org.apache.log4j;version=1.2, \
org.jboss.logging, \
org.jboss.net.protocol, \
- org.jboss.osgi.deployment.deployer, \
- org.jboss.osgi.deployment.interceptor, \
+ org.jboss.osgi.deployment.deployer;version=1.0, \
+ org.jboss.osgi.deployment.interceptor;version=1.0, \
org.jboss.osgi.spi;version=1.0, \
org.jboss.osgi.spi.capability;version=1.0, \
org.jboss.osgi.spi.framework;version=1.0, \
Modified: projects/jboss-osgi/trunk/distribution/installer/src/main/resources/runtime/server/conf/jboss-osgi-felix-minimal.properties
===================================================================
--- projects/jboss-osgi/trunk/distribution/installer/src/main/resources/runtime/server/conf/jboss-osgi-felix-minimal.properties 2009-10-30 11:09:19 UTC (rev 95822)
+++ projects/jboss-osgi/trunk/distribution/installer/src/main/resources/runtime/server/conf/jboss-osgi-felix-minimal.properties 2009-10-30 12:29:02 UTC (rev 95823)
@@ -10,8 +10,8 @@
org.osgi.framework.system.packages.extra=\
org.apache.log4j;version=1.2, \
org.jboss.logging, \
- org.jboss.osgi.deployment.deployer, \
- org.jboss.osgi.deployment.interceptor, \
+ org.jboss.osgi.deployment.deployer;version=1.0, \
+ org.jboss.osgi.deployment.interceptor;version=1.0, \
org.jboss.osgi.spi;version=1.0, \
org.jboss.osgi.spi.capability;version=1.0, \
org.jboss.osgi.spi.framework;version=1.0, \
Modified: projects/jboss-osgi/trunk/distribution/installer/src/main/resources/runtime/server/conf/jboss-osgi-felix-web.properties
===================================================================
--- projects/jboss-osgi/trunk/distribution/installer/src/main/resources/runtime/server/conf/jboss-osgi-felix-web.properties 2009-10-30 11:09:19 UTC (rev 95822)
+++ projects/jboss-osgi/trunk/distribution/installer/src/main/resources/runtime/server/conf/jboss-osgi-felix-web.properties 2009-10-30 12:29:02 UTC (rev 95823)
@@ -30,8 +30,8 @@
org.apache.log4j;version=1.2, \
org.jboss.logging, \
org.jboss.net.protocol, \
- org.jboss.osgi.deployment.deployer, \
- org.jboss.osgi.deployment.interceptor, \
+ org.jboss.osgi.deployment.deployer;version=1.0, \
+ org.jboss.osgi.deployment.interceptor;version=1.0, \
org.jboss.osgi.spi;version=1.0, \
org.jboss.osgi.spi.capability;version=1.0, \
org.jboss.osgi.spi.framework;version=1.0, \
Modified: projects/jboss-osgi/trunk/reactor/blueprint/testsuite/src/test/resources/jboss-osgi-felix.properties
===================================================================
--- projects/jboss-osgi/trunk/reactor/blueprint/testsuite/src/test/resources/jboss-osgi-felix.properties 2009-10-30 11:09:19 UTC (rev 95822)
+++ projects/jboss-osgi/trunk/reactor/blueprint/testsuite/src/test/resources/jboss-osgi-felix.properties 2009-10-30 12:29:02 UTC (rev 95823)
@@ -18,9 +18,9 @@
org.osgi.framework.system.packages.extra=\
org.apache.log4j;version=1.2, \
org.jboss.logging, \
- org.jboss.osgi.deployment.common, \
- org.jboss.osgi.deployment.deployer, \
- org.jboss.osgi.deployment.interceptor, \
+ 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.spi;version=1.0, \
org.jboss.osgi.spi.capability;version=1.0, \
org.jboss.osgi.spi.framework;version=1.0, \
Modified: projects/jboss-osgi/trunk/testsuite/example/src/test/resources/jboss-osgi-equinox.properties
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/resources/jboss-osgi-equinox.properties 2009-10-30 11:09:19 UTC (rev 95822)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/resources/jboss-osgi-equinox.properties 2009-10-30 12:29:02 UTC (rev 95823)
@@ -16,9 +16,9 @@
org.apache.log4j;version=1.2, \
org.jboss.logging, \
org.jboss.net.protocol, \
- org.jboss.osgi.deployment.common, \
- org.jboss.osgi.deployment.deployer, \
- org.jboss.osgi.deployment.interceptor, \
+ 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.spi;version=1.0, \
org.jboss.osgi.spi.capability;version=1.0, \
org.jboss.osgi.spi.framework;version=1.0, \
Modified: projects/jboss-osgi/trunk/testsuite/example/src/test/resources/jboss-osgi-felix.properties
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/resources/jboss-osgi-felix.properties 2009-10-30 11:09:19 UTC (rev 95822)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/resources/jboss-osgi-felix.properties 2009-10-30 12:29:02 UTC (rev 95823)
@@ -20,9 +20,9 @@
org.jboss.logging, \
org.jboss.net.protocol, \
org.jboss.osgi.common.log;version=1.0, \
- org.jboss.osgi.deployment.common, \
- org.jboss.osgi.deployment.deployer, \
- org.jboss.osgi.deployment.interceptor, \
+ 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.spi;version=1.0, \
org.jboss.osgi.spi.capability;version=1.0, \
org.jboss.osgi.spi.framework;version=1.0, \
Modified: projects/jboss-osgi/trunk/testsuite/functional/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/pom.xml 2009-10-30 11:09:19 UTC (rev 95822)
+++ projects/jboss-osgi/trunk/testsuite/functional/pom.xml 2009-10-30 12:29:02 UTC (rev 95823)
@@ -159,6 +159,7 @@
<exclude>org/jboss/test/osgi/jbosgi142/**</exclude>
<exclude>org/jboss/test/osgi/jbosgi143/**</exclude>
<exclude>org/jboss/test/osgi/jbosgi151/**</exclude>
+ <exclude>org/jboss/test/osgi/jbosgi161/**</exclude>
<exclude>org/jboss/test/osgi/service/microcontainer/**</exclude>
<exclude>org/jboss/test/osgi/service/startlevel/**</exclude>
</excludes>
Modified: projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jboss-osgi-equinox.properties
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jboss-osgi-equinox.properties 2009-10-30 11:09:19 UTC (rev 95822)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jboss-osgi-equinox.properties 2009-10-30 12:29:02 UTC (rev 95823)
@@ -17,9 +17,9 @@
org.apache.log4j;version=1.2, \
org.jboss.logging, \
org.jboss.net.protocol, \
- org.jboss.osgi.deployment.common, \
- org.jboss.osgi.deployment.deployer, \
- org.jboss.osgi.deployment.interceptor, \
+ 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.spi;version=1.0, \
org.jboss.osgi.spi.capability;version=1.0, \
org.jboss.osgi.spi.framework;version=1.0, \
Modified: projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jboss-osgi-felix.properties
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jboss-osgi-felix.properties 2009-10-30 11:09:19 UTC (rev 95822)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jboss-osgi-felix.properties 2009-10-30 12:29:02 UTC (rev 95823)
@@ -16,9 +16,9 @@
org.apache.log4j;version=1.2, \
org.jboss.logging, \
org.jboss.net.protocol, \
- org.jboss.osgi.deployment.common, \
- org.jboss.osgi.deployment.deployer, \
- org.jboss.osgi.deployment.interceptor, \
+ 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.spi;version=1.0, \
org.jboss.osgi.spi.capability;version=1.0, \
org.jboss.osgi.spi.framework;version=1.0, \
16 years, 1 month
JBoss-OSGI SVN: r95822 - in projects/jboss-osgi: projects/bundles/husky/trunk/harness/src/main/java/org/jboss/osgi/husky and 21 other directories.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-10-30 07:09:19 -0400 (Fri, 30 Oct 2009)
New Revision: 95822
Added:
projects/jboss-osgi/projects/bundles/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/PackageListener.java
projects/jboss-osgi/projects/bundles/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/runtime/osgi/HuskyInterceptor.java
projects/jboss-osgi/projects/bundles/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/runtime/osgi/ManifestProcessor.java
Removed:
projects/jboss-osgi/projects/bundles/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/internal/LocalInvocation.java
projects/jboss-osgi/projects/bundles/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/runtime/PackageListener.java
Modified:
projects/jboss-osgi/projects/bundles/husky/trunk/harness/pom.xml
projects/jboss-osgi/projects/bundles/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/internal/AbstractConnector.java
projects/jboss-osgi/projects/bundles/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/internal/AbstractPackageListener.java
projects/jboss-osgi/projects/bundles/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/internal/OSGiInvoker.java
projects/jboss-osgi/projects/bundles/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/runtime/Connector.java
projects/jboss-osgi/projects/bundles/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/runtime/osgi/HuskyActivator.java
projects/jboss-osgi/projects/bundles/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/runtime/osgi/HuskyExtender.java
projects/jboss-osgi/projects/bundles/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/runtime/osgi/JMXConnector.java
projects/jboss-osgi/projects/bundles/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/runtime/osgi/SocketConnector.java
projects/jboss-osgi/projects/bundles/husky/trunk/testsuite/pom.xml
projects/jboss-osgi/projects/bundles/husky/trunk/testsuite/src/test/resources/jboss-osgi-framework.properties
projects/jboss-osgi/projects/bundles/webapp/trunk/pom.xml
projects/jboss-osgi/projects/bundles/webapp/trunk/src/main/java/org/jboss/osgi/webapp/internal/WebAppActivator.java
projects/jboss-osgi/projects/bundles/webapp/trunk/src/main/java/org/jboss/osgi/webapp/internal/WebAppPublisherInterceptor.java
projects/jboss-osgi/projects/bundles/webapp/trunk/src/main/java/org/jboss/osgi/webapp/internal/WebXMLParserInterceptor.java
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
projects/jboss-osgi/trunk/distribution/installer/src/main/resources/jbossas/jboss-beans-jbossmc.xml
projects/jboss-osgi/trunk/distribution/installer/src/main/resources/runtime/conf/jboss-osgi-equinox.properties
projects/jboss-osgi/trunk/distribution/installer/src/main/resources/runtime/server/conf/jboss-osgi-bootstrap.xml
projects/jboss-osgi/trunk/distribution/installer/src/main/resources/runtime/server/conf/jboss-osgi-felix-all.properties
projects/jboss-osgi/trunk/distribution/installer/src/main/resources/runtime/server/conf/jboss-osgi-felix-default.properties
projects/jboss-osgi/trunk/distribution/installer/src/main/resources/runtime/server/conf/jboss-osgi-felix-minimal.properties
projects/jboss-osgi/trunk/distribution/installer/src/main/resources/runtime/server/conf/jboss-osgi-felix-web.properties
projects/jboss-osgi/trunk/reactor/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/extender/BlueprintInterceptor.java
projects/jboss-osgi/trunk/reactor/deployment/src/main/java/org/jboss/osgi/deployment/interceptor/AbstractLifecycleInterceptorService.java
projects/jboss-osgi/trunk/reactor/deployment/src/main/java/org/jboss/osgi/deployment/interceptor/LifecycleInterceptorService.java
projects/jboss-osgi/trunk/reactor/deployment/src/main/java/org/jboss/osgi/deployment/internal/LifecycleInterceptorServiceImpl.java
projects/jboss-osgi/trunk/reactor/deployment/src/test/java/org/jboss/test/osgi/deployment/interceptor/InterceptorOrderTestCase.java
projects/jboss-osgi/trunk/reactor/framework/pom.xml
projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/service/internal/LifecycleInterceptorServiceImpl.java
projects/jboss-osgi/trunk/reactor/pom.xml
projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/interceptor/processor/InterceptorActivator.java
projects/jboss-osgi/trunk/testsuite/example/src/test/resources/META-INF/jboss-osgi-bootstrap.xml
projects/jboss-osgi/trunk/testsuite/example/src/test/resources/jboss-osgi-equinox.properties
projects/jboss-osgi/trunk/testsuite/example/src/test/resources/jboss-osgi-felix.properties
projects/jboss-osgi/trunk/testsuite/example/src/test/resources/mcservice/example-mcservice-bundleA.bnd
Log:
Use WhiteboardPattern in interceptor and husky API
Modified: projects/jboss-osgi/projects/bundles/husky/trunk/harness/pom.xml
===================================================================
--- projects/jboss-osgi/projects/bundles/husky/trunk/harness/pom.xml 2009-10-30 07:00:49 UTC (rev 95821)
+++ projects/jboss-osgi/projects/bundles/husky/trunk/harness/pom.xml 2009-10-30 11:09:19 UTC (rev 95822)
@@ -73,11 +73,13 @@
<Import-Package>
javax.management,
javax.naming,
+ org.jboss.osgi.deployment.interceptor;version="[1.0,1.1)",
org.jboss.osgi.spi.capability;version="[1.0,1.1)",
org.jboss.osgi.spi.management;version="[1.0,1.1)",
org.jboss.osgi.spi.util;version="[1.0,1.1)",
org.junit;version="[4.6,5.0)",
org.osgi.framework,
+ org.osgi.util.tracker,
org.slf4j;version="[1.5,1.6)",
<!-- ignore client side -->
Copied: projects/jboss-osgi/projects/bundles/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/PackageListener.java (from rev 95821, projects/jboss-osgi/projects/bundles/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/runtime/PackageListener.java)
===================================================================
--- projects/jboss-osgi/projects/bundles/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/PackageListener.java (rev 0)
+++ projects/jboss-osgi/projects/bundles/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/PackageListener.java 2009-10-30 11:09:19 UTC (rev 95822)
@@ -0,0 +1,59 @@
+/*
+ * 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.husky;
+
+import java.util.List;
+
+import org.jboss.osgi.husky.runtime.Connector;
+
+// $Id$
+
+/**
+ * A PackageListener that is associated with a {@link Connector}.
+ *
+ * The PackageListener matches test {@link Request}s with the package names
+ * that it can handle. On a successful match the {@link Connector} will invoke
+ * the {@link #runTests(Request)} method.
+ *
+ * @author Thomas.Diesler(a)jboss.com
+ * @since 16-May-2009
+ */
+public interface PackageListener
+{
+ /**
+ * Return the list of packages that this listener can handle.
+ */
+ List<String> getPackageNames();
+
+ /**
+ * Return true if the given {@link Request} is from a package
+ * that this listener can handle.
+ */
+ boolean match(Request request);
+
+ /**
+ * Called by {@link Connector} when this listener indicated that it can
+ * handle the test request.
+ */
+ Response runTests(Request request) throws Throwable;
+
+}
\ No newline at end of file
Modified: projects/jboss-osgi/projects/bundles/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/internal/AbstractConnector.java
===================================================================
--- projects/jboss-osgi/projects/bundles/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/internal/AbstractConnector.java 2009-10-30 07:00:49 UTC (rev 95821)
+++ projects/jboss-osgi/projects/bundles/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/internal/AbstractConnector.java 2009-10-30 11:09:19 UTC (rev 95822)
@@ -29,14 +29,14 @@
import java.io.InputStream;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
+import org.jboss.osgi.husky.PackageListener;
import org.jboss.osgi.husky.Request;
import org.jboss.osgi.husky.Response;
import org.jboss.osgi.husky.runtime.Connector;
-import org.jboss.osgi.husky.runtime.PackageListener;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceReference;
+import org.osgi.util.tracker.ServiceTracker;
/**
* An abstract {@link Connector} implementation
@@ -46,67 +46,86 @@
*/
public abstract class AbstractConnector implements Connector
{
- private List<PackageListener> listeners = new ArrayList<PackageListener>();
+ private BundleContext context;
- public void addPackageListener(PackageListener listener)
+ public AbstractConnector(BundleContext context)
{
- synchronized (listeners)
- {
- listeners.add(listener);
- listeners.notifyAll();
- }
+ this.context = context;
}
- public List<PackageListener> getPackageListeners()
+ public BundleContext getBundleContext()
{
- return Collections.unmodifiableList(listeners);
+ return context;
}
- public void removePackageListener(PackageListener listener)
+ protected void start() throws Exception
{
- synchronized (listeners)
- {
- listeners.remove(listener);
- }
}
- public Response process(Request req) throws ClassNotFoundException
+ protected void stop() throws Exception
{
- String testClass = req.getClassName();
+ }
- int timeout = 50;
- PackageListener listener = null;
- while (listener == null && 0 < timeout--)
+ public Response process(final Request req) throws Throwable
+ {
+ class PackageListenerTracker extends ServiceTracker
{
- synchronized (listeners)
+ Throwable error;
+ Response response;
+ boolean done;
+
+ PackageListenerTracker(BundleContext context)
{
- for (PackageListener aux : listeners)
- {
- if (aux.match(req))
- {
- listener = aux;
- break;
- }
- }
+ super(context, PackageListener.class.getName(), null);
+ }
- if (listener == null)
+ @Override
+ public Object addingService(ServiceReference reference)
+ {
+ PackageListener service = (PackageListener)super.addingService(reference);
+ if (service.match(req))
{
try
{
- listeners.wait(200);
+ response = service.runTests(req);
}
- catch (InterruptedException e)
+ catch (Throwable th)
{
- // ignore
+ error = th;
}
+ finally
+ {
+ done = true;
+ }
}
+ return service;
}
+ };
+
+ PackageListenerTracker tracker = new PackageListenerTracker(context);
+ tracker.open();
+
+ int timeout = 50;
+ while (tracker.done == false && 0 < timeout--)
+ {
+ try
+ {
+ Thread.currentThread().wait(200);
+ }
+ catch (InterruptedException e)
+ {
+ // ignore
+ }
}
+ tracker.close();
+
+ if (tracker.error != null)
+ throw tracker.error;
- if (listener == null)
- throw new IllegalStateException("Cannot find listener to handle: " + testClass + ", we have " + listeners);
+ if (tracker.response != null)
+ return tracker.response;
- return listener.runTests(req);
+ throw new IllegalStateException("Cannot find listener to handle: " + req.getClassName());
}
protected InputStream process(InputStream reqStream)
@@ -122,10 +141,10 @@
// Field the request through the abstract connector
response = process(request);
}
- catch (Exception ex)
+ catch (Throwable th)
{
response = new BasicResponse();
- BasicFailure failure = new BasicFailure(ex.getMessage(), ex);
+ BasicFailure failure = new BasicFailure(th.getMessage(), th);
if (request != null)
{
failure.setClassName(request.getClassName());
Modified: projects/jboss-osgi/projects/bundles/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/internal/AbstractPackageListener.java
===================================================================
--- projects/jboss-osgi/projects/bundles/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/internal/AbstractPackageListener.java 2009-10-30 07:00:49 UTC (rev 95821)
+++ projects/jboss-osgi/projects/bundles/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/internal/AbstractPackageListener.java 2009-10-30 11:09:19 UTC (rev 95822)
@@ -27,9 +27,9 @@
import java.util.List;
import org.jboss.osgi.husky.Context;
+import org.jboss.osgi.husky.PackageListener;
import org.jboss.osgi.husky.Request;
import org.jboss.osgi.husky.Response;
-import org.jboss.osgi.husky.runtime.PackageListener;
import org.jboss.osgi.husky.runtime.Runner;
/**
Deleted: projects/jboss-osgi/projects/bundles/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/internal/LocalInvocation.java
===================================================================
--- projects/jboss-osgi/projects/bundles/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/internal/LocalInvocation.java 2009-10-30 07:00:49 UTC (rev 95821)
+++ projects/jboss-osgi/projects/bundles/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/internal/LocalInvocation.java 2009-10-30 11:09:19 UTC (rev 95822)
@@ -1,78 +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.osgi.husky.internal;
-
-// $Id$
-
-import java.util.Arrays;
-
-import org.jboss.osgi.husky.Context;
-import org.jboss.osgi.husky.Request;
-import org.jboss.osgi.husky.Response;
-import org.jboss.osgi.husky.runtime.Connector;
-import org.jboss.osgi.husky.runtime.Runner;
-import org.jboss.osgi.husky.runtime.junit.JUnitRunner;
-
-/**
- * An 'in-memory' invocation.
- *
- * @author Thomas.Diesler(a)jboss.com
- * @since 16-May-2009
- */
-public class LocalInvocation
-{
- public Response invoke(Request req) throws Exception
- {
- Connector connector = new LocalConnector();
- connector.addPackageListener(new MatchAllJUnitPackageListener());
- return connector.process(req);
- }
-
- class LocalConnector extends AbstractConnector
- {
- }
-
- class MatchAllJUnitPackageListener extends AbstractPackageListener
- {
- public MatchAllJUnitPackageListener()
- {
- super(Arrays.asList(new String[] { "org.jboss.test" }));
- }
-
- public Context getContext()
- {
- return new BasicContext();
- }
-
- @Override
- public Runner getRunner()
- {
- return new JUnitRunner();
- }
-
- @Override
- public Class<?> loadTestClass(String className)
- {
- return Util.loadClass(className);
- }
- }
-}
Modified: projects/jboss-osgi/projects/bundles/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/internal/OSGiInvoker.java
===================================================================
--- projects/jboss-osgi/projects/bundles/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/internal/OSGiInvoker.java 2009-10-30 07:00:49 UTC (rev 95821)
+++ projects/jboss-osgi/projects/bundles/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/internal/OSGiInvoker.java 2009-10-30 11:09:19 UTC (rev 95822)
@@ -32,7 +32,6 @@
import org.jboss.osgi.husky.Invoker;
import org.jboss.osgi.husky.Request;
import org.jboss.osgi.husky.Response;
-import org.jboss.osgi.husky.runtime.osgi.JMXConnector;
/**
* An {@link Invoker} suitable for OSGi bundle testing.
@@ -41,7 +40,6 @@
*
* #1 {@link SocketInvocation}
* #2 {@link JMXInvocation}
- * #3 {@link LocalInvocation}
*
* @author Thomas.Diesler(a)jboss.com
* @since 16-May-2009
@@ -57,14 +55,10 @@
{
return new SocketInvocation().invoke(req);
}
- else if (server.isRegistered(JMXConnector.OBJECT_NAME))
+ else
{
return new JMXInvocation().invoke(server, req);
}
- else
- {
- return new LocalInvocation().invoke(req);
- }
}
catch (RuntimeException rte)
{
Modified: projects/jboss-osgi/projects/bundles/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/runtime/Connector.java
===================================================================
--- projects/jboss-osgi/projects/bundles/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/runtime/Connector.java 2009-10-30 07:00:49 UTC (rev 95821)
+++ projects/jboss-osgi/projects/bundles/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/runtime/Connector.java 2009-10-30 11:09:19 UTC (rev 95822)
@@ -21,14 +21,12 @@
*/
package org.jboss.osgi.husky.runtime;
+//$Id$
-import java.util.List;
-
+import org.jboss.osgi.husky.PackageListener;
import org.jboss.osgi.husky.Request;
import org.jboss.osgi.husky.Response;
-// $Id$
-
/**
* A Connector is the receiving side of a test request.
*
@@ -46,23 +44,6 @@
/**
* Handles the test request by dispatching to one of the
* associated {@link PackageListener}s.
- *
- * @throws RuntimeException if no {@link PackageListener} can be found
*/
- Response process(Request req) throws ClassNotFoundException;
-
- /**
- * Get the set of registered {@link PackageListener}s for this connector
- */
- List<PackageListener> getPackageListeners();
-
- /**
- * Add a {@link PackageListener} to this connector
- */
- void addPackageListener(PackageListener listener);
-
- /**
- * Remove a {@link PackageListener} from this connector
- */
- void removePackageListener(PackageListener listener);
+ Response process(Request req) throws Throwable;
}
Deleted: projects/jboss-osgi/projects/bundles/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/runtime/PackageListener.java
===================================================================
--- projects/jboss-osgi/projects/bundles/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/runtime/PackageListener.java 2009-10-30 07:00:49 UTC (rev 95821)
+++ projects/jboss-osgi/projects/bundles/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/runtime/PackageListener.java 2009-10-30 11:09:19 UTC (rev 95822)
@@ -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.osgi.husky.runtime;
-
-import java.util.List;
-
-import org.jboss.osgi.husky.Request;
-import org.jboss.osgi.husky.Response;
-
-// $Id$
-
-/**
- * A PackageListener that is associated with a {@link Connector}.
- *
- * The PackageListener matches test {@link Request}s with the package names
- * that it can handle. On a successful match the {@link Connector} will invoke
- * the {@link #runTests(Request)} method.
- *
- * @author Thomas.Diesler(a)jboss.com
- * @since 16-May-2009
- */
-public interface PackageListener
-{
- /**
- * Return the list of packages that this listener can handle.
- */
- List<String> getPackageNames();
-
- /**
- * Return true if the given {@link Request} is from a package
- * that this listener can handle.
- */
- boolean match(Request request);
-
- /**
- * Called by {@link Connector} when this listener indicated that it can
- * handle the test request.
- */
- Response runTests(Request request) throws ClassNotFoundException;
-
-}
\ No newline at end of file
Modified: projects/jboss-osgi/projects/bundles/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/runtime/osgi/HuskyActivator.java
===================================================================
--- projects/jboss-osgi/projects/bundles/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/runtime/osgi/HuskyActivator.java 2009-10-30 07:00:49 UTC (rev 95821)
+++ projects/jboss-osgi/projects/bundles/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/runtime/osgi/HuskyActivator.java 2009-10-30 11:09:19 UTC (rev 95822)
@@ -23,6 +23,7 @@
// $Id$
+import org.jboss.osgi.deployment.interceptor.LifecycleInterceptor;
import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;
import org.osgi.framework.BundleListener;
@@ -47,19 +48,22 @@
{
private SocketConnector socketConnector;
private JMXConnector jmxConnector;
-
+
public void start(BundleContext context) throws Exception
{
jmxConnector = new JMXConnector(context);
jmxConnector.start();
-
+
if (SocketConnector.isRemoteConnection(context))
{
socketConnector = new SocketConnector(context);
socketConnector.start();
}
-
- context.addBundleListener(new HuskyExtender(context));
+
+ ManifestProcessor processor = new ManifestProcessor(context);
+ LifecycleInterceptor interceptor = new HuskyInterceptor(processor);
+ context.registerService(LifecycleInterceptor.class.getName(), interceptor, null);
+ context.addBundleListener(new HuskyExtender(processor));
}
public void stop(BundleContext context) throws Exception
@@ -69,7 +73,7 @@
socketConnector.stop();
socketConnector = null;
}
-
+
if (jmxConnector != null)
{
jmxConnector.stop();
Modified: projects/jboss-osgi/projects/bundles/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/runtime/osgi/HuskyExtender.java
===================================================================
--- projects/jboss-osgi/projects/bundles/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/runtime/osgi/HuskyExtender.java 2009-10-30 07:00:49 UTC (rev 95821)
+++ projects/jboss-osgi/projects/bundles/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/runtime/osgi/HuskyExtender.java 2009-10-30 11:09:19 UTC (rev 95822)
@@ -23,120 +23,37 @@
// $Id$
-import java.util.ArrayList;
-import java.util.Arrays;
import java.util.List;
-import org.jboss.osgi.husky.runtime.Connector;
-import org.jboss.osgi.husky.runtime.PackageListener;
-import org.jboss.osgi.husky.runtime.junit.JUnitPackageListener;
import org.osgi.framework.Bundle;
-import org.osgi.framework.BundleContext;
import org.osgi.framework.BundleEvent;
import org.osgi.framework.BundleListener;
-import org.osgi.framework.InvalidSyntaxException;
-import org.osgi.framework.ServiceReference;
import org.osgi.framework.SynchronousBundleListener;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
/**
- * The Husky extender is a {@link BundleListener} that checkes the {@link #HEADER_TEST_PACKAGE}
+ * The Husky extender is a {@link BundleListener} that processes
+ * the {@link ManifestProcessor#HEADER_TEST_PACKAGE}.
*
* @author Thomas.Diesler(a)jboss.com
* @since 17-May-2009
*/
public class HuskyExtender implements SynchronousBundleListener
{
- /** The manifest header that identifies a bundle as Husky test bundle: 'Test-Package' */
- public static final String HEADER_TEST_PACKAGE = "Test-Package";
+ private ManifestProcessor processor;
- // Provide Logging
- private Logger log = LoggerFactory.getLogger(HuskyExtender.class);
-
- private BundleContext context;
-
- public HuskyExtender(BundleContext context)
+ public HuskyExtender(ManifestProcessor processor)
{
- this.context = context;
+ this.processor = processor;
}
public void bundleChanged(BundleEvent event)
{
- if (event.getType() == BundleEvent.STARTED)
+ if (event.getType() == BundleEvent.STARTING)
{
Bundle bundle = event.getBundle();
- List<String> packages = getTestPackages(bundle);
+ List<String> packages = processor.getTestPackages(bundle);
if (packages != null)
- registerPackageListener(bundle, packages);
+ processor.registerPackageListener(bundle, packages);
}
- else if (event.getType() == BundleEvent.STOPPED)
- {
- Bundle bundle = event.getBundle();
- List<String> packages = getTestPackages(bundle);
- if (packages != null)
- unregisterPackageListener(bundle, packages);
- }
}
-
- private void registerPackageListener(Bundle bundle, List<String> packages)
- {
- ServiceReference[] srefs = null;
- try
- {
- srefs = context.getServiceReferences(Connector.class.getName(), null);
- }
- catch (InvalidSyntaxException ex)
- {
- // cannot get here
- }
-
- if (srefs != null)
- {
- log.info("Register test packages " + packages);
- for (ServiceReference sref : srefs)
- {
- Connector connector = (Connector)context.getService(sref);
- JUnitPackageListener listener = new OSGiJUnitPackageListener(bundle, packages);
- connector.addPackageListener(listener);
- }
- }
- }
-
- private void unregisterPackageListener(Bundle bundle, List<String> packages)
- {
- ServiceReference[] srefs = null;
- try
- {
- srefs = context.getServiceReferences(Connector.class.getName(), null);
- }
- catch (InvalidSyntaxException ex)
- {
- // cannot get here
- }
-
- if (srefs != null)
- {
- log.info("Unregister test packages " + packages);
- for (ServiceReference sref : srefs)
- {
- Connector connector = (Connector)context.getService(sref);
- for (PackageListener listener : new ArrayList<PackageListener>(connector.getPackageListeners()))
- {
- List<String> auxNames = listener.getPackageNames();
- if (auxNames.equals(packages))
- connector.removePackageListener(listener);
- }
- }
- }
- }
-
- private List<String> getTestPackages(Bundle bundle)
- {
- String testPackage = (String)bundle.getHeaders().get(HEADER_TEST_PACKAGE);
- if (testPackage != null)
- return Arrays.asList(testPackage.split("[,\\s]"));
-
- return null;
- }
}
\ No newline at end of file
Added: projects/jboss-osgi/projects/bundles/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/runtime/osgi/HuskyInterceptor.java
===================================================================
--- projects/jboss-osgi/projects/bundles/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/runtime/osgi/HuskyInterceptor.java (rev 0)
+++ projects/jboss-osgi/projects/bundles/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/runtime/osgi/HuskyInterceptor.java 2009-10-30 11:09:19 UTC (rev 95822)
@@ -0,0 +1,58 @@
+/*
+ * 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.husky.runtime.osgi;
+
+// $Id$
+
+import java.util.List;
+
+import org.jboss.osgi.deployment.interceptor.AbstractLifecycleInterceptor;
+import org.jboss.osgi.deployment.interceptor.InvocationContext;
+import org.jboss.osgi.deployment.interceptor.LifecycleInterceptorException;
+import org.osgi.framework.Bundle;
+
+/**
+ * The Husky interceptor processes the {@link ManifestProcessor#HEADER_TEST_PACKAGE}.
+ *
+ * @author Thomas.Diesler(a)jboss.com
+ * @since 30-Oct-2009
+ */
+public class HuskyInterceptor extends AbstractLifecycleInterceptor
+{
+ private ManifestProcessor processor;
+
+ public HuskyInterceptor(ManifestProcessor processor)
+ {
+ this.processor = processor;
+ }
+
+ public void invoke(int state, InvocationContext context) throws LifecycleInterceptorException
+ {
+ if (Bundle.STARTING == state)
+ {
+ Bundle bundle = context.getBundle();
+ List<String> packages = processor.getTestPackages(bundle);
+ if (packages != null)
+ processor.registerPackageListener(bundle, packages);
+ }
+ }
+}
\ No newline at end of file
Property changes on: projects/jboss-osgi/projects/bundles/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/runtime/osgi/HuskyInterceptor.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: projects/jboss-osgi/projects/bundles/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/runtime/osgi/JMXConnector.java
===================================================================
--- projects/jboss-osgi/projects/bundles/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/runtime/osgi/JMXConnector.java 2009-10-30 07:00:49 UTC (rev 95821)
+++ projects/jboss-osgi/projects/bundles/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/runtime/osgi/JMXConnector.java 2009-10-30 11:09:19 UTC (rev 95822)
@@ -49,10 +49,8 @@
public class JMXConnector extends AbstractConnector implements JMXConnectorMBean
{
// Provide Logging
- private Logger log = LoggerFactory.getLogger(HuskyExtender.class);
+ private Logger log = LoggerFactory.getLogger(JMXConnector.class);
- private BundleContext context;
-
/** The ObjectName for this service: jboss.osgi.husky:service=jmx-connector */
public static ObjectName OBJECT_NAME;
static
@@ -69,23 +67,29 @@
public JMXConnector(BundleContext context)
{
- this.context = context;
+ super(context);
}
+ @Override
public void start() throws Exception
{
+ super.start();
+
MBeanServer mbeanServer = getMBeanServer();
mbeanServer.registerMBean(this, OBJECT_NAME);
Properties props = new Properties();
props.setProperty("transport", "jmx");
- context.registerService(Connector.class.getName(), this, props);
+ getBundleContext().registerService(Connector.class.getName(), this, props);
log.info("JMXConnector registered: " + OBJECT_NAME);
}
+ @Override
public void stop() throws Exception
{
+ super.stop();
+
MBeanServer mbeanServer = getMBeanServer();
if (mbeanServer.isRegistered(OBJECT_NAME))
mbeanServer.unregisterMBean(OBJECT_NAME);
@@ -101,6 +105,7 @@
private MBeanServer getMBeanServer()
{
MBeanServer mbeanServer = null;
+ BundleContext context = getBundleContext();
// Check if there is an MBeanServer service already
ServiceReference sref = context.getServiceReference(MBeanServer.class.getName());
Added: projects/jboss-osgi/projects/bundles/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/runtime/osgi/ManifestProcessor.java
===================================================================
--- projects/jboss-osgi/projects/bundles/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/runtime/osgi/ManifestProcessor.java (rev 0)
+++ projects/jboss-osgi/projects/bundles/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/runtime/osgi/ManifestProcessor.java 2009-10-30 11:09:19 UTC (rev 95822)
@@ -0,0 +1,91 @@
+/*
+ * 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.husky.runtime.osgi;
+
+// $Id$
+
+import java.util.Arrays;
+import java.util.Hashtable;
+import java.util.List;
+
+import org.jboss.osgi.husky.PackageListener;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.InvalidSyntaxException;
+import org.osgi.framework.ServiceReference;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Processed the {@link #HEADER_TEST_PACKAGE} and registers the listeners.
+ *
+ * @author Thomas.Diesler(a)jboss.com
+ * @since 30-Oct-2009
+ */
+public class ManifestProcessor
+{
+ // Provide Logging
+ private Logger log = LoggerFactory.getLogger(ManifestProcessor.class);
+
+ /** The manifest header that identifies a bundle as Husky test bundle: 'Test-Package' */
+ public static final String HEADER_TEST_PACKAGE = "Test-Package";
+
+ private BundleContext context;
+
+ public ManifestProcessor(BundleContext context)
+ {
+ this.context = context;
+ }
+
+ public void registerPackageListener(Bundle bundle, List<String> packages)
+ {
+ // Check if we already have PackageListener serices for this bundle
+ ServiceReference[] srefs = null;
+ try
+ {
+ String filter = "(bundle=" + bundle.getSymbolicName() + ")";
+ srefs = context.getServiceReferences(PackageListener.class.getName(), filter);
+ }
+ catch (InvalidSyntaxException ex)
+ {
+ // cannot get here
+ }
+
+ if (srefs == null)
+ {
+ log.info("Register test packages " + packages);
+ Hashtable<String, String> properties = new Hashtable<String, String>();
+ properties.put("bundle", bundle.getSymbolicName());
+ PackageListener listener = new OSGiJUnitPackageListener(bundle, packages);
+ bundle.getBundleContext().registerService(PackageListener.class.getName(), listener, properties);
+ }
+ }
+
+ public List<String> getTestPackages(Bundle bundle)
+ {
+ String testPackage = (String)bundle.getHeaders().get(HEADER_TEST_PACKAGE);
+ if (testPackage != null)
+ return Arrays.asList(testPackage.split("[,\\s]"));
+
+ return null;
+ }
+}
\ No newline at end of file
Property changes on: projects/jboss-osgi/projects/bundles/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/runtime/osgi/ManifestProcessor.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: projects/jboss-osgi/projects/bundles/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/runtime/osgi/SocketConnector.java
===================================================================
--- projects/jboss-osgi/projects/bundles/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/runtime/osgi/SocketConnector.java 2009-10-30 07:00:49 UTC (rev 95821)
+++ projects/jboss-osgi/projects/bundles/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/runtime/osgi/SocketConnector.java 2009-10-30 11:09:19 UTC (rev 95822)
@@ -52,20 +52,19 @@
public class SocketConnector extends AbstractConnector
{
// Provide Logging
- private Logger log = LoggerFactory.getLogger(HuskyExtender.class);
+ private Logger log = LoggerFactory.getLogger(SocketConnector.class);
/** The Husky socket connector host poperty: 'org.jboss.osgi.husky.runtime.connector.host' */
public static final String PROP_SOCKET_CONNECTOR_HOST = Connector.class.getName().toLowerCase() + ".host";
/** The Husky socket connector port poperty: 'org.jboss.osgi.husky.runtime.connector.port' */
public static final String PROP_SOCKET_CONNECTOR_PORT = Connector.class.getName().toLowerCase() + ".port";
- private BundleContext context;
private ServiceRegistration sreg;
private ListenerThread listenerThread;
public SocketConnector(BundleContext context)
{
- this.context = context;
+ super(context);
}
public static boolean isRemoteConnection(BundleContext context)
@@ -85,8 +84,12 @@
return host;
}
+ @Override
public void start() throws Exception
{
+ super.start();
+
+ BundleContext context = getBundleContext();
String host = getHost(context);
String port = getPort(context);
@@ -102,8 +105,11 @@
log.info("SocketConnector registered: " + props);
}
+ @Override
public void stop() throws Exception
{
+ super.stop();
+
if (sreg != null)
sreg.unregister();
@@ -166,12 +172,22 @@
{
InputStream resStream = process(socket.getInputStream());
Util.copyStream(resStream, socket.getOutputStream());
- socket.close();
}
catch (Exception ex)
{
- log.warn("Cannot process request", ex);
+ log.error("Cannot process request", ex);
}
+ finally
+ {
+ try
+ {
+ socket.close();
+ }
+ catch (IOException ex)
+ {
+ log.error("Cannot close socket", ex);
+ }
+ }
}
}
}
Modified: projects/jboss-osgi/projects/bundles/husky/trunk/testsuite/pom.xml
===================================================================
--- projects/jboss-osgi/projects/bundles/husky/trunk/testsuite/pom.xml 2009-10-30 07:00:49 UTC (rev 95821)
+++ projects/jboss-osgi/projects/bundles/husky/trunk/testsuite/pom.xml 2009-10-30 11:09:19 UTC (rev 95822)
@@ -28,6 +28,11 @@
<version>1.0.2-SNAPSHOT</version>
</parent>
+ <!-- Properties -->
+ <properties>
+ <surefire.jpda.args></surefire.jpda.args>
+ </properties>
+
<!-- Dependencies -->
<dependencies>
<dependency>
@@ -100,6 +105,7 @@
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
+ <argLine>${surefire.jpda.args}</argLine>
<systemProperties>
<property>
<name>java.protocol.handler.pkgs</name>
@@ -127,53 +133,21 @@
<profiles>
<!--
- Name: framework-equinox
- Descr: Setup for Equinox framework integration testing
+ Name: jpda
+ Descr: Enable JPDA remote debuging
-->
<profile>
- <id>framework-equinox</id>
+ <id>jpda</id>
<activation>
<property>
- <name>framework</name>
- <value>equinox</value>
+ <name>jpda</name>
</property>
</activation>
- <build>
- <plugins>
- <plugin>
- <artifactId>maven-surefire-plugin</artifactId>
- <configuration>
- <skipTests>true</skipTests>
- </configuration>
- </plugin>
- </plugins>
- </build>
+ <properties>
+ <surefire.jpda.args>-Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=y</surefire.jpda.args>
+ </properties>
</profile>
- <!--
- Name: framework-knopflerfish
- Descr: Setup for Knopflerfish framework integration testing
- -->
- <profile>
- <id>framework-knopflerfish</id>
- <activation>
- <property>
- <name>framework</name>
- <value>knopflerfish</value>
- </property>
- </activation>
- <build>
- <plugins>
- <plugin>
- <artifactId>maven-surefire-plugin</artifactId>
- <configuration>
- <skipTests>true</skipTests>
- </configuration>
- </plugin>
- </plugins>
- </build>
- </profile>
-
</profiles>
</project>
Modified: projects/jboss-osgi/projects/bundles/husky/trunk/testsuite/src/test/resources/jboss-osgi-framework.properties
===================================================================
--- projects/jboss-osgi/projects/bundles/husky/trunk/testsuite/src/test/resources/jboss-osgi-framework.properties 2009-10-30 07:00:49 UTC (rev 95821)
+++ projects/jboss-osgi/projects/bundles/husky/trunk/testsuite/src/test/resources/jboss-osgi-framework.properties 2009-10-30 11:09:19 UTC (rev 95822)
@@ -17,6 +17,7 @@
# Extra System Packages
org.osgi.framework.system.packages.extra=\
+ org.jboss.osgi.deployment.interceptor;version=1.0, \
org.jboss.osgi.spi;version=1.0, \
org.jboss.osgi.spi.capability;version=1.0, \
org.jboss.osgi.spi.management;version=1.0, \
Modified: projects/jboss-osgi/projects/bundles/webapp/trunk/pom.xml
===================================================================
--- projects/jboss-osgi/projects/bundles/webapp/trunk/pom.xml 2009-10-30 07:00:49 UTC (rev 95821)
+++ projects/jboss-osgi/projects/bundles/webapp/trunk/pom.xml 2009-10-30 11:09:19 UTC (rev 95822)
@@ -39,7 +39,7 @@
<!-- Properties -->
<properties>
- <version.jboss.osgi.deployment>0.0.1-SNAPSHOT</version.jboss.osgi.deployment>
+ <version.jboss.osgi.deployment>1.0.0-SNAPSHOT</version.jboss.osgi.deployment>
<version.ops4j.pax.web>0.7.2-SNAPSHOT</version.ops4j.pax.web>
<version.osgi>4.2.0</version.osgi>
</properties>
@@ -84,7 +84,6 @@
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
- <extensions>true</extensions>
<configuration>
<instructions>
<Bundle-SymbolicName>${artifactId}</Bundle-SymbolicName>
@@ -101,7 +100,7 @@
javax.servlet.http,
javax.xml.parsers,
org.apache.commons.logging;version=1.1,
- org.jboss.osgi.deployment.interceptor,
+ org.jboss.osgi.deployment.interceptor;version=1.0,
org.jboss.osgi.spi.capability;version=1.0,
org.jboss.virtual,
org.ops4j.pax.web.service,
Modified: projects/jboss-osgi/projects/bundles/webapp/trunk/src/main/java/org/jboss/osgi/webapp/internal/WebAppActivator.java
===================================================================
--- projects/jboss-osgi/projects/bundles/webapp/trunk/src/main/java/org/jboss/osgi/webapp/internal/WebAppActivator.java 2009-10-30 07:00:49 UTC (rev 95821)
+++ projects/jboss-osgi/projects/bundles/webapp/trunk/src/main/java/org/jboss/osgi/webapp/internal/WebAppActivator.java 2009-10-30 11:09:19 UTC (rev 95822)
@@ -23,6 +23,7 @@
//$Id$
+import org.jboss.osgi.deployment.interceptor.LifecycleInterceptor;
import org.jboss.osgi.webapp.WebAppService;
import org.ops4j.pax.web.extender.war.internal.WebAppPublisherExt;
import org.osgi.framework.BundleActivator;
@@ -36,9 +37,6 @@
*/
public class WebAppActivator implements BundleActivator
{
- private WebXMLParserInterceptor webappParserInterceptor;
- private WebAppPublisherInterceptor webappPublishInterceptor;
-
public void start(BundleContext context)
{
// Register the marker service
@@ -46,27 +44,16 @@
context.registerService(WebAppService.class.getName(), service, null);
// Register the web.xml parser interceptor
- webappParserInterceptor = new WebXMLParserInterceptor();
- webappParserInterceptor.start(context);
+ LifecycleInterceptor webappParser = new WebXMLParserInterceptor();
+ context.registerService(LifecycleInterceptor.class.getName(), webappParser, null);
// Register the WebApp publisher interceptor
WebAppPublisherExt publisher = new WebAppPublisherExt();
- webappPublishInterceptor = new WebAppPublisherInterceptor(publisher);
- webappPublishInterceptor.start(context);
+ LifecycleInterceptor webappPublisher = new WebAppPublisherInterceptor(publisher);
+ context.registerService(LifecycleInterceptor.class.getName(), webappPublisher, null);
}
public void stop(BundleContext context)
{
- if (webappParserInterceptor != null)
- {
- webappParserInterceptor.stop();
- webappParserInterceptor = null;
- }
-
- if (webappPublishInterceptor != null)
- {
- webappPublishInterceptor.stop();
- webappPublishInterceptor = null;
- }
}
}
\ No newline at end of file
Modified: projects/jboss-osgi/projects/bundles/webapp/trunk/src/main/java/org/jboss/osgi/webapp/internal/WebAppPublisherInterceptor.java
===================================================================
--- projects/jboss-osgi/projects/bundles/webapp/trunk/src/main/java/org/jboss/osgi/webapp/internal/WebAppPublisherInterceptor.java 2009-10-30 07:00:49 UTC (rev 95821)
+++ projects/jboss-osgi/projects/bundles/webapp/trunk/src/main/java/org/jboss/osgi/webapp/internal/WebAppPublisherInterceptor.java 2009-10-30 11:09:19 UTC (rev 95822)
@@ -27,13 +27,9 @@
import org.jboss.osgi.deployment.interceptor.InvocationContext;
import org.jboss.osgi.deployment.interceptor.LifecycleInterceptor;
import org.jboss.osgi.deployment.interceptor.LifecycleInterceptorException;
-import org.jboss.osgi.deployment.interceptor.LifecycleInterceptorService;
import org.ops4j.pax.web.extender.war.internal.WebAppPublisherExt;
import org.ops4j.pax.web.extender.war.internal.model.WebApp;
import org.osgi.framework.Bundle;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.ServiceReference;
-import org.osgi.util.tracker.ServiceTracker;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -48,7 +44,6 @@
// Provide logging
private Logger log = LoggerFactory.getLogger(WebAppPublisherInterceptor.class);
- private ServiceTracker serviceTracker;
private WebAppPublisherExt publisher;
public WebAppPublisherInterceptor(WebAppPublisherExt publisher)
@@ -59,38 +54,6 @@
addInput(WebApp.class);
}
- public void start(BundleContext context)
- {
- final LifecycleInterceptor interceptor = this;
- serviceTracker = new ServiceTracker(context, LifecycleInterceptorService.class.getName(), null)
- {
- @Override
- public Object addingService(ServiceReference reference)
- {
- LifecycleInterceptorService service = (LifecycleInterceptorService)super.addingService(reference);
- service.addInterceptor(interceptor);
- return service;
- }
-
- @Override
- public void removedService(ServiceReference reference, Object service)
- {
- ((LifecycleInterceptorService)service).removeInterceptor(interceptor);
- super.removedService(reference, service);
- }
- };
- serviceTracker.open();
- }
-
- public void stop()
- {
- if (serviceTracker != null)
- {
- serviceTracker.close();
- serviceTracker = null;
- }
- }
-
public void invoke(int state, InvocationContext context) throws LifecycleInterceptorException
{
if (state == Bundle.STARTING)
Modified: projects/jboss-osgi/projects/bundles/webapp/trunk/src/main/java/org/jboss/osgi/webapp/internal/WebXMLParserInterceptor.java
===================================================================
--- projects/jboss-osgi/projects/bundles/webapp/trunk/src/main/java/org/jboss/osgi/webapp/internal/WebXMLParserInterceptor.java 2009-10-30 07:00:49 UTC (rev 95821)
+++ projects/jboss-osgi/projects/bundles/webapp/trunk/src/main/java/org/jboss/osgi/webapp/internal/WebXMLParserInterceptor.java 2009-10-30 11:09:19 UTC (rev 95822)
@@ -29,14 +29,10 @@
import org.jboss.osgi.deployment.interceptor.InvocationContext;
import org.jboss.osgi.deployment.interceptor.LifecycleInterceptor;
import org.jboss.osgi.deployment.interceptor.LifecycleInterceptorException;
-import org.jboss.osgi.deployment.interceptor.LifecycleInterceptorService;
import org.jboss.virtual.VirtualFile;
import org.ops4j.pax.web.extender.war.internal.model.WebApp;
import org.ops4j.pax.web.extender.war.internal.parser.dom.DOMWebXmlParser;
import org.osgi.framework.Bundle;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.ServiceReference;
-import org.osgi.util.tracker.ServiceTracker;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -51,46 +47,12 @@
// Provide logging
private Logger log = LoggerFactory.getLogger(WebXMLParserInterceptor.class);
- private ServiceTracker serviceTracker;
-
public WebXMLParserInterceptor()
{
// Advertise output
addOutput(WebApp.class);
}
- public void start(BundleContext context)
- {
- final LifecycleInterceptor interceptor = this;
- serviceTracker = new ServiceTracker(context, LifecycleInterceptorService.class.getName(), null)
- {
- @Override
- public Object addingService(ServiceReference reference)
- {
- LifecycleInterceptorService service = (LifecycleInterceptorService)super.addingService(reference);
- service.addInterceptor(interceptor);
- return service;
- }
-
- @Override
- public void removedService(ServiceReference reference, Object service)
- {
- ((LifecycleInterceptorService)service).removeInterceptor(interceptor);
- super.removedService(reference, service);
- }
- };
- serviceTracker.open();
- }
-
- public void stop()
- {
- if (serviceTracker != null)
- {
- serviceTracker.close();
- serviceTracker = null;
- }
- }
-
public void invoke(int state, InvocationContext context) throws LifecycleInterceptorException
{
WebApp webApp = context.getAttachment(WebApp.class);
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-10-30 07:00:49 UTC (rev 95821)
+++ projects/jboss-osgi/trunk/distribution/installer/src/main/resources/jbossas/jboss-beans-equinox.xml 2009-10-30 11:09:19 UTC (rev 95822)
@@ -36,7 +36,6 @@
org.jboss.osgi.spi.management;version=1.0,
org.jboss.osgi.spi.service;version=1.0,
org.jboss.osgi.spi.util;version=1.0,
- org.jboss.osgi.testing,
<!-- jboss -->
org.jboss.logging
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-10-30 07:00:49 UTC (rev 95821)
+++ projects/jboss-osgi/trunk/distribution/installer/src/main/resources/jbossas/jboss-beans-felix.xml 2009-10-30 11:09:19 UTC (rev 95822)
@@ -35,7 +35,7 @@
<!-- jboss-osgi -->
org.jboss.osgi.deployment.deployer,
- org.jboss.osgi.deployment.interceptor,
+ org.jboss.osgi.deployment.internal,
org.jboss.osgi.jbossxb;version=2.0,
org.jboss.osgi.microcontainer;version=1.0,
org.jboss.osgi.spi;version=1.0,
@@ -43,7 +43,6 @@
org.jboss.osgi.spi.management;version=1.0,
org.jboss.osgi.spi.service;version=1.0,
org.jboss.osgi.spi.util;version=1.0,
- org.jboss.osgi.testing,
<!-- jboss -->
org.jboss.beans.metadata.plugins;version=2.0,
Modified: projects/jboss-osgi/trunk/distribution/installer/src/main/resources/jbossas/jboss-beans-jbossmc.xml
===================================================================
--- projects/jboss-osgi/trunk/distribution/installer/src/main/resources/jbossas/jboss-beans-jbossmc.xml 2009-10-30 07:00:49 UTC (rev 95821)
+++ projects/jboss-osgi/trunk/distribution/installer/src/main/resources/jbossas/jboss-beans-jbossmc.xml 2009-10-30 11:09:19 UTC (rev 95822)
@@ -49,8 +49,6 @@
org.jboss.osgi.spi.management;version=1.0,
org.jboss.osgi.spi.service;version=1.0,
org.jboss.osgi.spi.util;version=1.0,
- org.jboss.osgi.testing
-
</value></entry>
<!-- Husky socket connector properties -->
<entry><key>org.jboss.osgi.husky.runtime.connector.host</key><value>${jboss.bind.address}</value></entry>
Modified: projects/jboss-osgi/trunk/distribution/installer/src/main/resources/runtime/conf/jboss-osgi-equinox.properties
===================================================================
--- projects/jboss-osgi/trunk/distribution/installer/src/main/resources/runtime/conf/jboss-osgi-equinox.properties 2009-10-30 07:00:49 UTC (rev 95821)
+++ projects/jboss-osgi/trunk/distribution/installer/src/main/resources/runtime/conf/jboss-osgi-equinox.properties 2009-10-30 11:09:19 UTC (rev 95822)
@@ -69,7 +69,6 @@
org.jboss.osgi.spi.management;version=1.0, \
org.jboss.osgi.spi.service;version=1.0, \
org.jboss.osgi.spi.util;version=1.0, \
- org.jboss.osgi.testing, \
org.jboss.virtual, \
org.jboss.virtual.plugins.registry, \
org.jboss.virtual.plugins.context.jar, \
Modified: projects/jboss-osgi/trunk/distribution/installer/src/main/resources/runtime/server/conf/jboss-osgi-bootstrap.xml
===================================================================
--- projects/jboss-osgi/trunk/distribution/installer/src/main/resources/runtime/server/conf/jboss-osgi-bootstrap.xml 2009-10-30 07:00:49 UTC (rev 95821)
+++ projects/jboss-osgi/trunk/distribution/installer/src/main/resources/runtime/server/conf/jboss-osgi-bootstrap.xml 2009-10-30 11:09:19 UTC (rev 95822)
@@ -42,7 +42,6 @@
org.jboss.osgi.spi.management;version=1.0,
org.jboss.osgi.spi.service;version=1.0,
org.jboss.osgi.spi.util;version=1.0,
- org.jboss.osgi.testing,
</value></entry>
<!-- Hot Deployment -->
<entry><key>org.jboss.osgi.hotdeploy.scandir</key><value>${osgi.server.home}/deploy</value></entry>
Modified: projects/jboss-osgi/trunk/distribution/installer/src/main/resources/runtime/server/conf/jboss-osgi-felix-all.properties
===================================================================
--- projects/jboss-osgi/trunk/distribution/installer/src/main/resources/runtime/server/conf/jboss-osgi-felix-all.properties 2009-10-30 07:00:49 UTC (rev 95821)
+++ projects/jboss-osgi/trunk/distribution/installer/src/main/resources/runtime/server/conf/jboss-osgi-felix-all.properties 2009-10-30 11:09:19 UTC (rev 95822)
@@ -41,7 +41,6 @@
org.jboss.osgi.spi.management;version=1.0, \
org.jboss.osgi.spi.service;version=1.0, \
org.jboss.osgi.spi.util;version=1.0, \
- org.jboss.osgi.testing, \
org.jboss.virtual, \
org.jboss.virtual.plugins.registry, \
org.jboss.virtual.plugins.context.jar, \
Modified: projects/jboss-osgi/trunk/distribution/installer/src/main/resources/runtime/server/conf/jboss-osgi-felix-default.properties
===================================================================
--- projects/jboss-osgi/trunk/distribution/installer/src/main/resources/runtime/server/conf/jboss-osgi-felix-default.properties 2009-10-30 07:00:49 UTC (rev 95821)
+++ projects/jboss-osgi/trunk/distribution/installer/src/main/resources/runtime/server/conf/jboss-osgi-felix-default.properties 2009-10-30 11:09:19 UTC (rev 95822)
@@ -32,7 +32,6 @@
org.jboss.osgi.spi.management;version=1.0, \
org.jboss.osgi.spi.service;version=1.0, \
org.jboss.osgi.spi.util;version=1.0, \
- org.jboss.osgi.testing, \
org.jboss.virtual, \
org.jboss.virtual.plugins.registry, \
org.jboss.virtual.plugins.context.jar, \
Modified: projects/jboss-osgi/trunk/distribution/installer/src/main/resources/runtime/server/conf/jboss-osgi-felix-minimal.properties
===================================================================
--- projects/jboss-osgi/trunk/distribution/installer/src/main/resources/runtime/server/conf/jboss-osgi-felix-minimal.properties 2009-10-30 07:00:49 UTC (rev 95821)
+++ projects/jboss-osgi/trunk/distribution/installer/src/main/resources/runtime/server/conf/jboss-osgi-felix-minimal.properties 2009-10-30 11:09:19 UTC (rev 95822)
@@ -17,6 +17,5 @@
org.jboss.osgi.spi.framework;version=1.0, \
org.jboss.osgi.spi.management;version=1.0, \
org.jboss.osgi.spi.service;version=1.0, \
- org.jboss.osgi.spi.util;version=1.0, \
- org.jboss.osgi.testing
+ org.jboss.osgi.spi.util;version=1.0
\ No newline at end of file
Modified: projects/jboss-osgi/trunk/distribution/installer/src/main/resources/runtime/server/conf/jboss-osgi-felix-web.properties
===================================================================
--- projects/jboss-osgi/trunk/distribution/installer/src/main/resources/runtime/server/conf/jboss-osgi-felix-web.properties 2009-10-30 07:00:49 UTC (rev 95821)
+++ projects/jboss-osgi/trunk/distribution/installer/src/main/resources/runtime/server/conf/jboss-osgi-felix-web.properties 2009-10-30 11:09:19 UTC (rev 95822)
@@ -38,7 +38,6 @@
org.jboss.osgi.spi.management;version=1.0, \
org.jboss.osgi.spi.service;version=1.0, \
org.jboss.osgi.spi.util;version=1.0, \
- org.jboss.osgi.testing, \
org.jboss.virtual, \
org.jboss.virtual.plugins.registry, \
org.jboss.virtual.plugins.context.jar, \
Modified: projects/jboss-osgi/trunk/reactor/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/extender/BlueprintInterceptor.java
===================================================================
--- projects/jboss-osgi/trunk/reactor/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/extender/BlueprintInterceptor.java 2009-10-30 07:00:49 UTC (rev 95821)
+++ projects/jboss-osgi/trunk/reactor/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/extender/BlueprintInterceptor.java 2009-10-30 11:09:19 UTC (rev 95822)
@@ -28,11 +28,8 @@
import org.jboss.osgi.deployment.interceptor.InvocationContext;
import org.jboss.osgi.deployment.interceptor.LifecycleInterceptor;
import org.jboss.osgi.deployment.interceptor.LifecycleInterceptorException;
-import org.jboss.osgi.deployment.interceptor.LifecycleInterceptorService;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
-import org.osgi.framework.ServiceReference;
-import org.osgi.util.tracker.ServiceTracker;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -48,7 +45,6 @@
private Logger log = LoggerFactory.getLogger(BlueprintInterceptor.class);
private BlueprintProcessor processor;
- private ServiceTracker serviceTracker;
public BlueprintInterceptor(BlueprintProcessor processor)
{
@@ -59,36 +55,12 @@
{
BlueprintContext bpContext = processor.getBlueprintContext();
BundleContext context = bpContext.getBundleContext();
-
- final LifecycleInterceptor interceptor = this;
- serviceTracker = new ServiceTracker(context, LifecycleInterceptorService.class.getName(), null)
- {
- @Override
- public Object addingService(ServiceReference reference)
- {
- LifecycleInterceptorService service = (LifecycleInterceptorService)super.addingService(reference);
- service.addInterceptor(interceptor);
- return service;
- }
-
- @Override
- public void removedService(ServiceReference reference, Object service)
- {
- ((LifecycleInterceptorService)service).removeInterceptor(interceptor);
- super.removedService(reference, service);
- }
- };
- serviceTracker.open();
+ context.registerService(LifecycleInterceptor.class.getName(), this, null);
}
public void stop()
{
processor.stopAllContainers();
- if (serviceTracker != null)
- {
- serviceTracker.close();
- serviceTracker = null;
- }
}
public void invoke(int state, InvocationContext context) throws LifecycleInterceptorException
Modified: projects/jboss-osgi/trunk/reactor/deployment/src/main/java/org/jboss/osgi/deployment/interceptor/AbstractLifecycleInterceptorService.java
===================================================================
--- projects/jboss-osgi/trunk/reactor/deployment/src/main/java/org/jboss/osgi/deployment/interceptor/AbstractLifecycleInterceptorService.java 2009-10-30 07:00:49 UTC (rev 95821)
+++ projects/jboss-osgi/trunk/reactor/deployment/src/main/java/org/jboss/osgi/deployment/interceptor/AbstractLifecycleInterceptorService.java 2009-10-30 11:09:19 UTC (rev 95822)
@@ -34,6 +34,8 @@
import org.jboss.osgi.spi.util.ConstantsHelper;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceReference;
+import org.osgi.util.tracker.ServiceTracker;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -59,6 +61,27 @@
if (context == null)
throw new IllegalStateException("Null context");
this.context = context;
+
+ // Track the LifecycleInterceptor services
+ ServiceTracker tracker = new ServiceTracker(context, LifecycleInterceptor.class.getName(), null)
+ {
+ @Override
+ public Object addingService(ServiceReference reference)
+ {
+ LifecycleInterceptor interceptor = (LifecycleInterceptor)super.addingService(reference);
+ addInterceptor(interceptor);
+ return interceptor;
+ }
+
+ @Override
+ public void removedService(ServiceReference reference, Object service)
+ {
+ super.removedService(reference, service);
+ LifecycleInterceptor interceptor = (LifecycleInterceptor)service;
+ removeInterceptor(interceptor);
+ }
+ };
+ tracker.open();
}
public BundleContext getSystemContext()
@@ -74,7 +97,7 @@
*
* @param interceptor The interceptor
*/
- public void addInterceptor(LifecycleInterceptor interceptor)
+ protected void addInterceptor(LifecycleInterceptor interceptor)
{
if (interceptor == null)
throw new IllegalArgumentException("Null interceptor");
@@ -181,7 +204,7 @@
*
* @param interceptor The interceptor
*/
- public void removeInterceptor(LifecycleInterceptor interceptor)
+ protected void removeInterceptor(LifecycleInterceptor interceptor)
{
if (interceptor == null)
throw new IllegalArgumentException("Null interceptor");
Modified: projects/jboss-osgi/trunk/reactor/deployment/src/main/java/org/jboss/osgi/deployment/interceptor/LifecycleInterceptorService.java
===================================================================
--- projects/jboss-osgi/trunk/reactor/deployment/src/main/java/org/jboss/osgi/deployment/interceptor/LifecycleInterceptorService.java 2009-10-30 07:00:49 UTC (rev 95821)
+++ projects/jboss-osgi/trunk/reactor/deployment/src/main/java/org/jboss/osgi/deployment/interceptor/LifecycleInterceptorService.java 2009-10-30 11:09:19 UTC (rev 95822)
@@ -23,30 +23,25 @@
//$Id$
+import org.osgi.framework.Bundle;
/**
- * A service that manages bundle lifecycle interceptors.
+ * A service that invokes lifecycle interceptors.
*
+ * This service tracks {@link LifecycleInterceptor} services and orders them
+ * to an interceptor chain according to their input/output requirements and relative order.
+ *
* @author thomas.diesler(a)jboss.com
* @since 15-Oct-2009
*/
public interface LifecycleInterceptorService
{
/**
- * Add a LifecycleInterceptor to the service.
- *
- * The interceptor is added according to its input requirements
- * and relative order.
- *
- * @param interceptor The interceptor
+ * Invoke the registered set of interceptors for the given bundle state change.
+ *
+ * @param state The future state of the bundle
+ * @param bundle The bundle that changes state
+ * @throws LifecycleInterceptorException if the invocation of an interceptor fails
*/
- void addInterceptor(LifecycleInterceptor interceptor);
-
- /**
- * Remove an LifecycleInterceptor to the service.
- *
- * @param interceptor The interceptor
- */
- void removeInterceptor(LifecycleInterceptor interceptor);
-
+ void handleStateChange(int state, Bundle bundle);
}
\ No newline at end of file
Modified: projects/jboss-osgi/trunk/reactor/deployment/src/main/java/org/jboss/osgi/deployment/internal/LifecycleInterceptorServiceImpl.java
===================================================================
--- projects/jboss-osgi/trunk/reactor/deployment/src/main/java/org/jboss/osgi/deployment/internal/LifecycleInterceptorServiceImpl.java 2009-10-30 07:00:49 UTC (rev 95821)
+++ projects/jboss-osgi/trunk/reactor/deployment/src/main/java/org/jboss/osgi/deployment/internal/LifecycleInterceptorServiceImpl.java 2009-10-30 11:09:19 UTC (rev 95822)
@@ -54,6 +54,18 @@
}
@Override
+ protected void addInterceptor(LifecycleInterceptor interceptor)
+ {
+ super.addInterceptor(interceptor);
+ }
+
+ @Override
+ protected void removeInterceptor(LifecycleInterceptor interceptor)
+ {
+ super.removeInterceptor(interceptor);
+ }
+
+ @Override
protected InvocationContext getInvocationContext(Bundle bundle)
{
DeploymentRegistryService service = getDeploymentRegistryService();
Modified: projects/jboss-osgi/trunk/reactor/deployment/src/test/java/org/jboss/test/osgi/deployment/interceptor/InterceptorOrderTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/reactor/deployment/src/test/java/org/jboss/test/osgi/deployment/interceptor/InterceptorOrderTestCase.java 2009-10-30 07:00:49 UTC (rev 95821)
+++ projects/jboss-osgi/trunk/reactor/deployment/src/test/java/org/jboss/test/osgi/deployment/interceptor/InterceptorOrderTestCase.java 2009-10-30 11:09:19 UTC (rev 95822)
@@ -29,12 +29,13 @@
import java.util.List;
import org.jboss.osgi.deployment.interceptor.AbstractLifecycleInterceptor;
+import org.jboss.osgi.deployment.interceptor.AbstractLifecycleInterceptorService;
import org.jboss.osgi.deployment.interceptor.InvocationContext;
import org.jboss.osgi.deployment.interceptor.LifecycleInterceptor;
import org.jboss.osgi.deployment.interceptor.LifecycleInterceptorException;
import org.jboss.osgi.deployment.interceptor.LifecycleInterceptorService;
-import org.jboss.osgi.deployment.internal.LifecycleInterceptorServiceImpl;
import org.junit.Test;
+import org.osgi.framework.Bundle;
/**
* Test the {@link LifecycleInterceptorService}
@@ -49,8 +50,8 @@
@Test
public void testRelativeOrder()
{
- LifecycleInterceptor rel0000 = new BasicLifecycleInterceptor();
- LifecycleInterceptor rel2000 = new BasicLifecycleInterceptor()
+ LifecycleInterceptor rel0000 = new MockLifecycleInterceptor();
+ LifecycleInterceptor rel2000 = new MockLifecycleInterceptor()
{
public int getRelativeOrder()
{
@@ -59,7 +60,7 @@
};
// Add ordered
- LifecycleInterceptorServiceImpl service = new LifecycleInterceptorServiceImpl(new MockBundleContext());
+ MockLifecycleInterceptorService service = new MockLifecycleInterceptorService();
service.addInterceptor(rel0000);
service.addInterceptor(rel2000);
@@ -69,7 +70,7 @@
assertEquals(RELATIVE_ORDER, chain.get(1).getRelativeOrder());
// Add unordered
- service = new LifecycleInterceptorServiceImpl(new MockBundleContext());
+ service = new MockLifecycleInterceptorService();
service.addInterceptor(rel2000);
service.addInterceptor(rel0000);
@@ -86,14 +87,14 @@
{
}
- AbstractLifecycleInterceptor inA = new BasicLifecycleInterceptor();
+ AbstractLifecycleInterceptor inA = new MockLifecycleInterceptor();
inA.addInput(A.class);
- AbstractLifecycleInterceptor outA = new BasicLifecycleInterceptor();
+ AbstractLifecycleInterceptor outA = new MockLifecycleInterceptor();
outA.addOutput(A.class);
// Add ordered
- LifecycleInterceptorServiceImpl service = new LifecycleInterceptorServiceImpl(new MockBundleContext());
+ MockLifecycleInterceptorService service = new MockLifecycleInterceptorService();
service.addInterceptor(outA);
service.addInterceptor(inA);
@@ -103,7 +104,7 @@
assertEquals(inA, chain.get(1));
// Add unordered
- service = new LifecycleInterceptorServiceImpl(new MockBundleContext());
+ service = new MockLifecycleInterceptorService();
service.addInterceptor(inA);
service.addInterceptor(outA);
@@ -113,11 +114,44 @@
assertEquals(inA, chain.get(1));
}
- class BasicLifecycleInterceptor extends AbstractLifecycleInterceptor
+ class MockLifecycleInterceptor extends AbstractLifecycleInterceptor
{
public void invoke(int state, InvocationContext context) throws LifecycleInterceptorException
{
// do nothing
}
}
+
+ class MockLifecycleInterceptorService extends AbstractLifecycleInterceptorService
+ {
+ protected MockLifecycleInterceptorService()
+ {
+ super(new MockBundleContext());
+ }
+
+ @Override
+ public void addInterceptor(LifecycleInterceptor interceptor)
+ {
+ super.addInterceptor(interceptor);
+ }
+
+ @Override
+ public void removeInterceptor(LifecycleInterceptor interceptor)
+ {
+ super.removeInterceptor(interceptor);
+ }
+
+ @Override
+ public List<LifecycleInterceptor> getInterceptorChain()
+ {
+ return super.getInterceptorChain();
+ }
+
+ @Override
+ protected InvocationContext getInvocationContext(Bundle bundle)
+ {
+ // do nothing
+ return null;
+ }
+ }
}
Modified: projects/jboss-osgi/trunk/reactor/framework/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/reactor/framework/pom.xml 2009-10-30 07:00:49 UTC (rev 95821)
+++ projects/jboss-osgi/trunk/reactor/framework/pom.xml 2009-10-30 11:09:19 UTC (rev 95822)
@@ -343,6 +343,7 @@
<configuration>
<instructions>
<Bundle-SymbolicName>org.jboss.osgi.framework</Bundle-SymbolicName>
+ <Bundle-Name>JBossOSGi Framework</Bundle-Name>
<Bundle-Version>${version}</Bundle-Version>
<Export-Package>
org.osgi.framework;version="1.5",
Modified: projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/service/internal/LifecycleInterceptorServiceImpl.java
===================================================================
--- projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/service/internal/LifecycleInterceptorServiceImpl.java 2009-10-30 07:00:49 UTC (rev 95821)
+++ projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/service/internal/LifecycleInterceptorServiceImpl.java 2009-10-30 11:09:19 UTC (rev 95822)
@@ -113,14 +113,12 @@
}
else
{
- delegate.addInterceptor(interceptor);
+ getSystemContext().registerService(LifecycleInterceptor.class.getName(), interceptor, null);
}
}
public void removeInterceptor(LifecycleInterceptor interceptor)
{
- if (delegate != null)
- delegate.removeInterceptor(interceptor);
}
public void handleStateChange(int state, Bundle bundle)
Modified: projects/jboss-osgi/trunk/reactor/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/reactor/pom.xml 2009-10-30 07:00:49 UTC (rev 95821)
+++ projects/jboss-osgi/trunk/reactor/pom.xml 2009-10-30 11:09:19 UTC (rev 95822)
@@ -44,9 +44,9 @@
<modules>
<module>deployment</module>
- <module>blueprint</module>
<module>jmx</module>
<module>jta</module>
+ <module>blueprint</module>
</modules>
<profiles>
Modified: projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/interceptor/processor/InterceptorActivator.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/interceptor/processor/InterceptorActivator.java 2009-10-30 07:00:49 UTC (rev 95821)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/interceptor/processor/InterceptorActivator.java 2009-10-30 11:09:19 UTC (rev 95822)
@@ -23,10 +23,10 @@
//$Id$
+import org.jboss.osgi.deployment.interceptor.LifecycleInterceptor;
import org.jboss.osgi.deployment.interceptor.LifecycleInterceptorService;
import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;
-import org.osgi.framework.ServiceReference;
/**
* Registers the interceptors with the {@link LifecycleInterceptorService}
@@ -36,29 +36,17 @@
*/
public class InterceptorActivator implements BundleActivator
{
- private LifecycleInterceptorService service;
- private PublisherInterceptor publisher;
- private ParserInterceptor parser;
-
public void start(BundleContext context)
{
- publisher = new PublisherInterceptor();
- parser = new ParserInterceptor();
+ LifecycleInterceptor publisher = new PublisherInterceptor();
+ LifecycleInterceptor parser = new ParserInterceptor();
- // This is a system service, which should always be available
- ServiceReference sref = context.getServiceReference(LifecycleInterceptorService.class.getName());
- if (sref == null)
- throw new IllegalStateException("Required LifecycleInterceptorService not available");
-
// Add the interceptors, the order of which is handles by the service
- service = (LifecycleInterceptorService)context.getService(sref);
- service.addInterceptor(publisher);
- service.addInterceptor(parser);
+ context.registerService(LifecycleInterceptor.class.getName(), publisher, null);
+ context.registerService(LifecycleInterceptor.class.getName(), parser, null);
}
public void stop(BundleContext context)
{
- service.removeInterceptor(publisher);
- service.removeInterceptor(parser);
}
}
\ No newline at end of file
Modified: projects/jboss-osgi/trunk/testsuite/example/src/test/resources/META-INF/jboss-osgi-bootstrap.xml
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/resources/META-INF/jboss-osgi-bootstrap.xml 2009-10-30 07:00:49 UTC (rev 95821)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/resources/META-INF/jboss-osgi-bootstrap.xml 2009-10-30 11:09:19 UTC (rev 95822)
@@ -42,7 +42,6 @@
org.jboss.osgi.spi.management;version=1.0,
org.jboss.osgi.spi.service;version=1.0,
org.jboss.osgi.spi.util;version=1.0,
- org.jboss.osgi.testing,
</value></entry>
</map>
</property>
Modified: projects/jboss-osgi/trunk/testsuite/example/src/test/resources/jboss-osgi-equinox.properties
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/resources/jboss-osgi-equinox.properties 2009-10-30 07:00:49 UTC (rev 95821)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/resources/jboss-osgi-equinox.properties 2009-10-30 11:09:19 UTC (rev 95822)
@@ -25,7 +25,6 @@
org.jboss.osgi.spi.management;version=1.0, \
org.jboss.osgi.spi.service;version=1.0, \
org.jboss.osgi.spi.util;version=1.0, \
- org.jboss.osgi.testing, \
org.jboss.virtual, \
org.jboss.virtual.plugins.registry, \
org.jboss.virtual.plugins.context.jar, \
Modified: projects/jboss-osgi/trunk/testsuite/example/src/test/resources/jboss-osgi-felix.properties
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/resources/jboss-osgi-felix.properties 2009-10-30 07:00:49 UTC (rev 95821)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/resources/jboss-osgi-felix.properties 2009-10-30 11:09:19 UTC (rev 95822)
@@ -29,7 +29,6 @@
org.jboss.osgi.spi.management;version=1.0, \
org.jboss.osgi.spi.service;version=1.0, \
org.jboss.osgi.spi.util;version=1.0, \
- org.jboss.osgi.testing, \
org.jboss.virtual, \
org.jboss.virtual.plugins.registry, \
org.jboss.virtual.plugins.context.jar, \
Modified: projects/jboss-osgi/trunk/testsuite/example/src/test/resources/mcservice/example-mcservice-bundleA.bnd
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/resources/mcservice/example-mcservice-bundleA.bnd 2009-10-30 07:00:49 UTC (rev 95821)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/resources/mcservice/example-mcservice-bundleA.bnd 2009-10-30 11:09:19 UTC (rev 95822)
@@ -3,6 +3,6 @@
Bundle-SymbolicName: example-mcservice-bundleA
Bundle-Activator: org.jboss.test.osgi.example.microcontainer.bundleA.SomeServiceActivator
Export-Package: org.jboss.test.osgi.example.microcontainer.bundleA
-Import-Package: org.jboss.osgi.spi.management, org.jboss.osgi.spi.service, org.jboss.osgi.testing, org.osgi.framework, javax.management
+Import-Package: javax.management, org.jboss.osgi.spi.management, org.jboss.osgi.spi.service, org.osgi.framework
Include-Resource: META-INF/mcservice-jboss-beans.xml=META-INF/mcservice-jboss-beans.xml
-removeheaders: Include-Resource
16 years, 1 month
JBoss-OSGI SVN: r95821 - in projects/jboss-osgi/projects/runtime: felix/trunk and 1 other directory.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-10-30 03:00:49 -0400 (Fri, 30 Oct 2009)
New Revision: 95821
Modified:
projects/jboss-osgi/projects/runtime/equinox/trunk/pom.xml
projects/jboss-osgi/projects/runtime/felix/trunk/pom.xml
Log:
Remove dependency on jboss-osgi-testing
Modified: projects/jboss-osgi/projects/runtime/equinox/trunk/pom.xml
===================================================================
--- projects/jboss-osgi/projects/runtime/equinox/trunk/pom.xml 2009-10-30 06:22:01 UTC (rev 95820)
+++ projects/jboss-osgi/projects/runtime/equinox/trunk/pom.xml 2009-10-30 07:00:49 UTC (rev 95821)
@@ -39,9 +39,9 @@
<!-- Properties -->
<properties>
<version.eclipse.equinox>3.5</version.eclipse.equinox>
- <version.jboss.osgi.deployment>0.0.1-SNAPSHOT</version.jboss.osgi.deployment>
+ <version.jboss.osgi.deployment>1.0.0-SNAPSHOT</version.jboss.osgi.deployment>
+ <version.jboss.osgi.husky>1.0.2-SNAPSHOT</version.jboss.osgi.husky>
<version.jboss.osgi.spi>1.0.3-SNAPSHOT</version.jboss.osgi.spi>
- <version.jboss.osgi.testing>0.0.1-SNAPSHOT</version.jboss.osgi.testing>
</properties>
<!-- Dependencies -->
@@ -69,10 +69,10 @@
</dependency>
<dependency>
- <groupId>org.jboss.osgi</groupId>
- <artifactId>jboss-osgi-testing</artifactId>
- <version>${version.jboss.osgi.testing}</version>
- <scope>provided</scope>
+ <groupId>org.jboss.osgi.bundles</groupId>
+ <artifactId>jboss-osgi-husky</artifactId>
+ <version>${version.jboss.osgi.husky}</version>
+ <scope>test</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
Modified: projects/jboss-osgi/projects/runtime/felix/trunk/pom.xml
===================================================================
--- projects/jboss-osgi/projects/runtime/felix/trunk/pom.xml 2009-10-30 06:22:01 UTC (rev 95820)
+++ projects/jboss-osgi/projects/runtime/felix/trunk/pom.xml 2009-10-30 07:00:49 UTC (rev 95821)
@@ -38,9 +38,9 @@
<properties>
<version.felix.framework>2.0.0</version.felix.framework>
- <version.jboss.osgi.deployment>0.0.1-SNAPSHOT</version.jboss.osgi.deployment>
+ <version.jboss.osgi.deployment>1.0.0-SNAPSHOT</version.jboss.osgi.deployment>
+ <version.jboss.osgi.husky>1.0.2-SNAPSHOT</version.jboss.osgi.husky>
<version.jboss.osgi.spi>1.0.3-SNAPSHOT</version.jboss.osgi.spi>
- <version.jboss.osgi.testing>0.0.1-SNAPSHOT</version.jboss.osgi.testing>
<version.osgi>4.2.0</version.osgi>
</properties>
@@ -84,10 +84,10 @@
</dependency>
<dependency>
- <groupId>org.jboss.osgi</groupId>
- <artifactId>jboss-osgi-testing</artifactId>
- <version>${version.jboss.osgi.testing}</version>
- <scope>provided</scope>
+ <groupId>org.jboss.osgi.bundles</groupId>
+ <artifactId>jboss-osgi-husky</artifactId>
+ <version>${version.jboss.osgi.husky}</version>
+ <scope>test</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
16 years, 1 month
JBoss-OSGI SVN: r95816 - in projects/jboss-osgi/trunk: distribution/javadoc/scripts and 1 other directories.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-10-30 01:27:30 -0400 (Fri, 30 Oct 2009)
New Revision: 95816
Removed:
projects/jboss-osgi/trunk/reactor/testing/
Modified:
projects/jboss-osgi/trunk/distribution/installer/src/main/resources/installer/install-definition.xml
projects/jboss-osgi/trunk/distribution/javadoc/scripts/assembly-javadoc-src.xml
Log:
Remove jboss-osgi-testing
Modified: projects/jboss-osgi/trunk/distribution/installer/src/main/resources/installer/install-definition.xml
===================================================================
--- projects/jboss-osgi/trunk/distribution/installer/src/main/resources/installer/install-definition.xml 2009-10-30 05:25:36 UTC (rev 95815)
+++ projects/jboss-osgi/trunk/distribution/installer/src/main/resources/installer/install-definition.xml 2009-10-30 05:27:30 UTC (rev 95816)
@@ -151,7 +151,6 @@
<include name="jboss-osgi-runtime-felix-sources.jar" />
<include name="jboss-osgi-runtime-jbossas-sources.jar" />
<include name="jboss-osgi-spi-sources.jar" />
- <include name="jboss-osgi-testing-sources.jar" />
<include name="jboss-osgi-webapp-sources.jar" />
<include name="jboss-osgi-webconsole-sources.jar" />
<include name="jboss-osgi-xml-binding-sources.jar" />
@@ -188,7 +187,6 @@
<include name="jboss-logging-log4j.jar" />
<include name="jboss-osgi-deployment.jar" />
<include name="jboss-osgi-spi.jar" />
- <include name="jboss-osgi-testing.jar" />
<include name="jboss-vfs.jar" />
<include name="log4j.jar" />
<include name="slf4j-api.jar" />
@@ -369,7 +367,6 @@
<include name="jboss-osgi-deployers.jar" />
<include name="jboss-osgi-deployment.jar" />
<include name="jboss-osgi-spi.jar" />
- <include name="jboss-osgi-testing.jar" />
</fileset>
<!-- deploy/osgi -->
Modified: projects/jboss-osgi/trunk/distribution/javadoc/scripts/assembly-javadoc-src.xml
===================================================================
--- projects/jboss-osgi/trunk/distribution/javadoc/scripts/assembly-javadoc-src.xml 2009-10-30 05:25:36 UTC (rev 95815)
+++ projects/jboss-osgi/trunk/distribution/javadoc/scripts/assembly-javadoc-src.xml 2009-10-30 05:27:30 UTC (rev 95816)
@@ -24,7 +24,6 @@
<include>*:jboss-osgi-jta:jar:sources</include>
<include>*:jboss-osgi-microcontainer:jar:sources</include>
<include>*:jboss-osgi-spi:jar:sources</include>
- <include>*:jboss-osgi-testing:jar:sources</include>
<include>*:jboss-osgi-webapp:jar:sources</include>
<include>*:jboss-osgi-xml-binding:jar:sources</include>
</includes>
16 years, 1 month
JBoss-OSGI SVN: r95814 - in projects/jboss-osgi/trunk: testsuite/functional/src/test/java/org/jboss/test/osgi/service/microcontainer and 1 other directory.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-10-30 01:21:36 -0400 (Fri, 30 Oct 2009)
New Revision: 95814
Modified:
projects/jboss-osgi/trunk/reactor/jta/pom.xml
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/service/microcontainer/MicrocontainerServiceTestCase.java
Log:
Fix embedded on felix
Modified: projects/jboss-osgi/trunk/reactor/jta/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/reactor/jta/pom.xml 2009-10-30 03:15:05 UTC (rev 95813)
+++ projects/jboss-osgi/trunk/reactor/jta/pom.xml 2009-10-30 05:21:36 UTC (rev 95814)
@@ -101,7 +101,7 @@
javax.management,
javax.naming,
javax.naming.spi,
- javax.transaction;version="[1.0,1.2)",
+ javax.transaction,
javax.xml.parsers,
org.apache.commons.logging,
org.jboss.osgi.spi.capability;version="[1.0,1.1)",
Modified: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/service/microcontainer/MicrocontainerServiceTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/service/microcontainer/MicrocontainerServiceTestCase.java 2009-10-30 03:15:05 UTC (rev 95813)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/service/microcontainer/MicrocontainerServiceTestCase.java 2009-10-30 05:21:36 UTC (rev 95814)
@@ -103,12 +103,16 @@
{
DeployerService deployer = MBeanProxy.get(DeployerService.class, MBEAN_DEPLOYER_SERVICE, runtime.getMBeanServer());
deployer.deploy(getTestArchiveURL("service/mcservice-bundleA.jar"));
-
- ManagedFrameworkMBean frameworkMBean = MBeanProxy.get(ManagedFrameworkMBean.class, MBEAN_MANAGED_FRAMEWORK, runtime.getMBeanServer());
- Set<ObjectName> bundles = frameworkMBean.getBundles();
- assertTrue("Managed bundle registered", bundles.toString().indexOf("bundle=mcservice-bundleA") > 0);
-
- deployer.undeploy(getTestArchiveURL("service/mcservice-bundleA.jar"));
+ try
+ {
+ ManagedFrameworkMBean frameworkMBean = MBeanProxy.get(ManagedFrameworkMBean.class, MBEAN_MANAGED_FRAMEWORK, runtime.getMBeanServer());
+ Set<ObjectName> bundles = frameworkMBean.getBundles();
+ assertTrue("Managed bundle registered", bundles.toString().indexOf("name=mcservice-bundleA") > 0);
+ }
+ finally
+ {
+ deployer.undeploy(getTestArchiveURL("service/mcservice-bundleA.jar"));
+ }
}
/**
@@ -122,22 +126,27 @@
deployer.deploy(getTestArchiveURL("service/mcservice-bundleB.jar"));
- ManagedFrameworkMBean frameworkMBean = MBeanProxy.get(ManagedFrameworkMBean.class, MBEAN_MANAGED_FRAMEWORK, runtime.getMBeanServer());
- Set<ObjectName> bundles = frameworkMBean.getBundles();
- assertTrue("Managed bundle registered", bundles.toString().indexOf("bundle=mcservice-bundleB") > 0);
-
// Check whether the bean is registered
- List<String> registeredBeans = mcService.getRegisteredBeans();
- assertTrue("SomeBean registered", registeredBeans.contains("SomeBean"));
+ try
+ {
+ ManagedFrameworkMBean frameworkMBean = MBeanProxy.get(ManagedFrameworkMBean.class, MBEAN_MANAGED_FRAMEWORK, runtime.getMBeanServer());
+ Set<ObjectName> bundles = frameworkMBean.getBundles();
+ assertTrue("Managed bundle registered", bundles.toString().indexOf("name=mcservice-bundleB") > 0);
- // Access the bean through JMX
- SomeBeanMBean someBean = MBeanProxy.get(SomeBeanMBean.class, MBEAN_NAME, runtime.getMBeanServer());
- assertEquals("hello", someBean.echo("hello"));
-
- deployer.undeploy(getTestArchiveURL("service/mcservice-bundleB.jar"));
+ List<String> registeredBeans = mcService.getRegisteredBeans();
+ assertTrue("SomeBean registered", registeredBeans.contains("SomeBean"));
+ // Access the bean through JMX
+ SomeBeanMBean someBean = MBeanProxy.get(SomeBeanMBean.class, MBEAN_NAME, runtime.getMBeanServer());
+ assertEquals("hello", someBean.echo("hello"));
+ }
+ finally
+ {
+ deployer.undeploy(getTestArchiveURL("service/mcservice-bundleB.jar"));
+ }
+
// Check whether the bean is unregistered
- registeredBeans = mcService.getRegisteredBeans();
+ List<String> registeredBeans = mcService.getRegisteredBeans();
assertFalse("SomeBean unregistered", registeredBeans.contains("SomeBean"));
}
}
\ No newline at end of file
16 years, 1 month
JBoss-OSGI SVN: r95762 - in projects/jboss-osgi/projects/bundles/husky/trunk: harness and 4 other directories.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-10-29 10:55:57 -0400 (Thu, 29 Oct 2009)
New Revision: 95762
Added:
projects/jboss-osgi/projects/bundles/husky/trunk/harness/src/main/java/org/jboss/osgi/testing/
projects/jboss-osgi/projects/bundles/husky/trunk/harness/src/main/java/org/jboss/osgi/testing/internal/RemotePackageAdmin.java
Removed:
projects/jboss-osgi/projects/bundles/husky/trunk/harness/src/main/java/org/jboss/osgi/testing/internal/RemotePackageAdmin.java
Modified:
projects/jboss-osgi/projects/bundles/husky/trunk/harness/pom.xml
projects/jboss-osgi/projects/bundles/husky/trunk/pom.xml
projects/jboss-osgi/projects/bundles/husky/trunk/testsuite/pom.xml
projects/jboss-osgi/projects/bundles/husky/trunk/testsuite/src/test/resources/jboss-osgi-framework.properties
Log:
Remove dependency on jboss-osgi-testing
Modified: projects/jboss-osgi/projects/bundles/husky/trunk/harness/pom.xml
===================================================================
--- projects/jboss-osgi/projects/bundles/husky/trunk/harness/pom.xml 2009-10-29 14:54:29 UTC (rev 95761)
+++ projects/jboss-osgi/projects/bundles/husky/trunk/harness/pom.xml 2009-10-29 14:55:57 UTC (rev 95762)
@@ -35,6 +35,10 @@
<artifactId>jboss-osgi-spi</artifactId>
</dependency>
<dependency>
+ <groupId>org.jboss.osgi.runtime</groupId>
+ <artifactId>jboss-osgi-deployment</artifactId>
+ </dependency>
+ <dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
</dependency>
@@ -61,14 +65,33 @@
<instructions>
<Bundle-SymbolicName>${artifactId}</Bundle-SymbolicName>
<Bundle-Activator>org.jboss.osgi.husky.runtime.osgi.HuskyActivator</Bundle-Activator>
+ <Export-Package>
+ org.jboss.osgi.husky;version=${version},
+ org.jboss.osgi.husky.annotation;version=${version},
+ org.jboss.osgi.testing;version=${version},
+ </Export-Package>
+ <Import-Package>
+ javax.management,
+ javax.naming,
+ org.jboss.osgi.spi.capability;version="[1.0,1.1)",
+ org.jboss.osgi.spi.management;version="[1.0,1.1)",
+ org.jboss.osgi.spi.util;version="[1.0,1.1)",
+ org.junit;version="[4.6,5.0)",
+ org.osgi.framework,
+ org.slf4j;version="[1.5,1.6)",
+
+ <!-- ignore client side -->
+ !org.jboss.osgi.deployment.deployer,
+ !org.jboss.osgi.spi.framework,
+ !org.jboss.virtual,
+ !org.osgi.framework.launch,
+ !org.osgi.service.packageadmin,
+ </Import-Package>
<Private-Package>
org.jboss.osgi.husky.internal,
org.jboss.osgi.husky.runtime*,
+ org.jboss.osgi.testing.internal,
</Private-Package>
- <Export-Package>
- org.jboss.osgi.husky;version=${version},
- org.jboss.osgi.husky.annotation;version=${version}
- </Export-Package>
<Embed-Transitive>true</Embed-Transitive>
<Embed-Dependency>
junit;inline=false,
Copied: projects/jboss-osgi/projects/bundles/husky/trunk/harness/src/main/java/org/jboss/osgi/testing (from rev 95731, projects/jboss-osgi/trunk/reactor/testing/src/main/java/org/jboss/osgi/testing)
Deleted: projects/jboss-osgi/projects/bundles/husky/trunk/harness/src/main/java/org/jboss/osgi/testing/internal/RemotePackageAdmin.java
===================================================================
--- projects/jboss-osgi/trunk/reactor/testing/src/main/java/org/jboss/osgi/testing/internal/RemotePackageAdmin.java 2009-10-29 06:57:36 UTC (rev 95731)
+++ projects/jboss-osgi/projects/bundles/husky/trunk/harness/src/main/java/org/jboss/osgi/testing/internal/RemotePackageAdmin.java 2009-10-29 14:55:57 UTC (rev 95762)
@@ -1,66 +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.osgi.testing.internal;
-
-import org.jboss.osgi.spi.management.MBeanProxy;
-import org.jboss.osgi.spi.management.MBeanProxyException;
-import org.jboss.osgi.spi.management.ManagedFrameworkMBean;
-import org.jboss.osgi.testing.OSGiBundle;
-import org.jboss.osgi.testing.OSGiPackageAdmin;
-
-/**
- * A remote implementation of the {@link OSGiPackageAdmin}
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 25-Sep-2008
- */
-public class RemotePackageAdmin implements OSGiPackageAdmin
-{
- private OSGiRuntimeImpl runtime;
-
- public RemotePackageAdmin(OSGiRuntimeImpl runtime)
- {
- this.runtime = runtime;
- }
-
- public void refreshPackages(OSGiBundle[] bundles)
- {
- String[] bundleArr = null;
- if (bundles != null)
- {
- bundleArr = new String[bundles.length];
- for (int i=0; i < bundles.length; i++)
- {
- bundleArr[i] = bundles[i].getSymbolicName();
- }
- }
- try
- {
- ManagedFrameworkMBean mbeanProxy = MBeanProxy.get(ManagedFrameworkMBean.class, ManagedFrameworkMBean.MBEAN_MANAGED_FRAMEWORK, runtime.getMBeanServer());
- mbeanProxy.refreshPackages(bundleArr);
- }
- catch (MBeanProxyException ex)
- {
- throw new IllegalStateException("Cannot refresh packages", ex);
- }
- }
-}
Copied: projects/jboss-osgi/projects/bundles/husky/trunk/harness/src/main/java/org/jboss/osgi/testing/internal/RemotePackageAdmin.java (from rev 95736, projects/jboss-osgi/trunk/reactor/testing/src/main/java/org/jboss/osgi/testing/internal/RemotePackageAdmin.java)
===================================================================
--- projects/jboss-osgi/projects/bundles/husky/trunk/harness/src/main/java/org/jboss/osgi/testing/internal/RemotePackageAdmin.java (rev 0)
+++ projects/jboss-osgi/projects/bundles/husky/trunk/harness/src/main/java/org/jboss/osgi/testing/internal/RemotePackageAdmin.java 2009-10-29 14:55:57 UTC (rev 95762)
@@ -0,0 +1,74 @@
+/*
+ * 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;
+
+import javax.management.ObjectName;
+
+import org.jboss.osgi.spi.management.MBeanProxy;
+import org.jboss.osgi.spi.management.MBeanProxyException;
+import org.jboss.osgi.spi.management.ManagedBundle;
+import org.jboss.osgi.spi.management.ManagedFrameworkMBean;
+import org.jboss.osgi.testing.OSGiBundle;
+import org.jboss.osgi.testing.OSGiPackageAdmin;
+import org.osgi.framework.Version;
+
+/**
+ * A remote implementation of the {@link OSGiPackageAdmin}
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 25-Sep-2008
+ */
+public class RemotePackageAdmin implements OSGiPackageAdmin
+{
+ private OSGiRuntimeImpl runtime;
+
+ public RemotePackageAdmin(OSGiRuntimeImpl runtime)
+ {
+ this.runtime = runtime;
+ }
+
+ public void refreshPackages(OSGiBundle[] bundles)
+ {
+ ObjectName[] bundleArr = null;
+ if (bundles != null)
+ {
+ bundleArr = new ObjectName[bundles.length];
+ for (int i=0; i < bundles.length; i++)
+ {
+ OSGiBundle bundle = bundles[i];
+ long id = bundle.getBundleId();
+ String symbolicName = bundle.getSymbolicName();
+ Version version = bundle.getVersion();
+ bundleArr[i] = ManagedBundle.getObjectName(id, symbolicName, version);
+ }
+ }
+ try
+ {
+ ManagedFrameworkMBean mbeanProxy = MBeanProxy.get(ManagedFrameworkMBean.class, ManagedFrameworkMBean.MBEAN_MANAGED_FRAMEWORK, runtime.getMBeanServer());
+ mbeanProxy.refreshPackages(bundleArr);
+ }
+ catch (MBeanProxyException ex)
+ {
+ throw new IllegalStateException("Cannot refresh packages", ex);
+ }
+ }
+}
Modified: projects/jboss-osgi/projects/bundles/husky/trunk/pom.xml
===================================================================
--- projects/jboss-osgi/projects/bundles/husky/trunk/pom.xml 2009-10-29 14:54:29 UTC (rev 95761)
+++ projects/jboss-osgi/projects/bundles/husky/trunk/pom.xml 2009-10-29 14:55:57 UTC (rev 95762)
@@ -42,7 +42,7 @@
<properties>
<version.jboss.osgi.runtime.felix>2.0.0-SNAPSHOT</version.jboss.osgi.runtime.felix>
<version.jboss.osgi.spi>1.0.3-SNAPSHOT</version.jboss.osgi.spi>
- <version.jboss.osgi.testing>1.0.0-SNAPSHOT</version.jboss.osgi.testing>
+ <version.jboss.osgi.deployment>1.0.0-SNAPSHOT</version.jboss.osgi.deployment>
<version.osgi>4.2.0</version.osgi>
</properties>
@@ -61,9 +61,9 @@
<version>${version.jboss.osgi.spi}</version>
</dependency>
<dependency>
- <groupId>org.jboss.osgi</groupId>
- <artifactId>jboss-osgi-testing</artifactId>
- <version>${version.jboss.osgi.testing}</version>
+ <groupId>org.jboss.osgi.runtime</groupId>
+ <artifactId>jboss-osgi-deployment</artifactId>
+ <version>${version.jboss.osgi.deployment}</version>
</dependency>
<dependency>
Modified: projects/jboss-osgi/projects/bundles/husky/trunk/testsuite/pom.xml
===================================================================
--- projects/jboss-osgi/projects/bundles/husky/trunk/testsuite/pom.xml 2009-10-29 14:54:29 UTC (rev 95761)
+++ projects/jboss-osgi/projects/bundles/husky/trunk/testsuite/pom.xml 2009-10-29 14:55:57 UTC (rev 95762)
@@ -50,11 +50,6 @@
<!-- Test Dependencies -->
<dependency>
- <groupId>org.jboss.osgi</groupId>
- <artifactId>jboss-osgi-testing</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<scope>test</scope>
Modified: projects/jboss-osgi/projects/bundles/husky/trunk/testsuite/src/test/resources/jboss-osgi-framework.properties
===================================================================
--- projects/jboss-osgi/projects/bundles/husky/trunk/testsuite/src/test/resources/jboss-osgi-framework.properties 2009-10-29 14:54:29 UTC (rev 95761)
+++ projects/jboss-osgi/projects/bundles/husky/trunk/testsuite/src/test/resources/jboss-osgi-framework.properties 2009-10-29 14:55:57 UTC (rev 95762)
@@ -17,15 +17,12 @@
# Extra System Packages
org.osgi.framework.system.packages.extra=\
- org.jboss.logging, \
org.jboss.osgi.spi;version=1.0, \
org.jboss.osgi.spi.capability;version=1.0, \
- org.jboss.osgi.spi.logging;version=1.0, \
org.jboss.osgi.spi.management;version=1.0, \
org.jboss.osgi.spi.service;version=1.0, \
org.jboss.osgi.spi.util;version=1.0, \
- org.jboss.osgi.testing;version=1.0, \
- org.osgi.framework;version=1.4, \
+ org.osgi.framework;version=1.5, \
org.slf4j;version=1.5
# Bundles that need to be installed with the Framework automatically
16 years, 1 month
JBoss-OSGI SVN: r95761 - in projects/jboss-osgi/trunk: distribution and 10 other directories.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-10-29 10:54:29 -0400 (Thu, 29 Oct 2009)
New Revision: 95761
Modified:
projects/jboss-osgi/trunk/distribution/pom.xml
projects/jboss-osgi/trunk/pom.xml
projects/jboss-osgi/trunk/reactor/blueprint/testsuite/pom.xml
projects/jboss-osgi/trunk/reactor/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/container/BlueprintContainerTestCase.java
projects/jboss-osgi/trunk/reactor/blueprint/testsuite/src/test/resources/container/container-basic.bnd
projects/jboss-osgi/trunk/reactor/framework/pom.xml
projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/microcontainer/MicrocontainerCapability.java
projects/jboss-osgi/trunk/reactor/pom.xml
projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/blueprint/BlueprintTestCase.java
projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/jta/TransactionTestCase.java
projects/jboss-osgi/trunk/testsuite/example/src/test/resources/blueprint/example-blueprint.bnd
projects/jboss-osgi/trunk/testsuite/pom.xml
Log:
Remove dependency on jboss-osgi-testing
Modified: projects/jboss-osgi/trunk/distribution/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/distribution/pom.xml 2009-10-29 13:52:35 UTC (rev 95760)
+++ projects/jboss-osgi/trunk/distribution/pom.xml 2009-10-29 14:54:29 UTC (rev 95761)
@@ -72,22 +72,6 @@
<classifier>javadoc</classifier>
</dependency>
<dependency>
- <groupId>org.jboss.osgi</groupId>
- <artifactId>jboss-osgi-testing</artifactId>
- </dependency>
- <dependency>
- <groupId>org.jboss.osgi</groupId>
- <artifactId>jboss-osgi-testing</artifactId>
- <version>${version.jboss.osgi.testing}</version>
- <classifier>sources</classifier>
- </dependency>
- <dependency>
- <groupId>org.jboss.osgi</groupId>
- <artifactId>jboss-osgi-testing</artifactId>
- <version>${version.jboss.osgi.testing}</version>
- <classifier>javadoc</classifier>
- </dependency>
- <dependency>
<groupId>org.jboss.osgi.testsuite</groupId>
<artifactId>jboss-osgi-testsuite-example</artifactId>
<version>${version}</version>
Modified: projects/jboss-osgi/trunk/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/pom.xml 2009-10-29 13:52:35 UTC (rev 95760)
+++ projects/jboss-osgi/trunk/pom.xml 2009-10-29 14:54:29 UTC (rev 95761)
@@ -67,7 +67,6 @@
<version.jboss.osgi.runtime.felix>2.0.0-SNAPSHOT</version.jboss.osgi.runtime.felix>
<version.jboss.osgi.runtime.jbossas>1.0.2-SNAPSHOT</version.jboss.osgi.runtime.jbossas>
<version.jboss.osgi.spi>1.0.3-SNAPSHOT</version.jboss.osgi.spi>
- <version.jboss.osgi.testing>1.0.0-SNAPSHOT</version.jboss.osgi.testing>
<version.jboss.osgi.webapp>0.7.2-SNAPSHOT</version.jboss.osgi.webapp>
<version.jboss.osgi.webconsole>1.0.2</version.jboss.osgi.webconsole>
<version.jboss.osgi.xml.binding>2.0.1.SP1</version.jboss.osgi.xml.binding>
@@ -89,11 +88,6 @@
<artifactId>jboss-osgi-spi</artifactId>
<version>${version.jboss.osgi.spi}</version>
</dependency>
- <dependency>
- <groupId>org.jboss.osgi</groupId>
- <artifactId>jboss-osgi-testing</artifactId>
- <version>${version.jboss.osgi.testing}</version>
- </dependency>
<!-- jboss.osgi.bundles -->
<dependency>
Modified: projects/jboss-osgi/trunk/reactor/blueprint/testsuite/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/reactor/blueprint/testsuite/pom.xml 2009-10-29 13:52:35 UTC (rev 95760)
+++ projects/jboss-osgi/trunk/reactor/blueprint/testsuite/pom.xml 2009-10-29 14:54:29 UTC (rev 95761)
@@ -43,10 +43,6 @@
<groupId>biz.aQute</groupId>
<artifactId>bnd</artifactId>
</dependency>
- <dependency>
- <groupId>org.jboss.osgi</groupId>
- <artifactId>jboss-osgi-testing</artifactId>
- </dependency>
<dependency>
<groupId>org.jboss.osgi.bundles</groupId>
Modified: projects/jboss-osgi/trunk/reactor/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/container/BlueprintContainerTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/reactor/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/container/BlueprintContainerTestCase.java 2009-10-29 13:52:35 UTC (rev 95760)
+++ projects/jboss-osgi/trunk/reactor/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/container/BlueprintContainerTestCase.java 2009-10-29 14:54:29 UTC (rev 95761)
@@ -40,6 +40,7 @@
import org.jboss.osgi.husky.BridgeFactory;
import org.jboss.osgi.husky.HuskyCapability;
import org.jboss.osgi.husky.annotation.ProvideContext;
+import org.jboss.osgi.jmx.JMXCapability;
import org.jboss.osgi.testing.OSGiBundle;
import org.jboss.osgi.testing.OSGiRuntime;
import org.jboss.osgi.testing.OSGiTestHelper;
@@ -80,6 +81,7 @@
{
runtime = new OSGiTestHelper().getEmbeddedRuntime();
runtime.addCapability(new HuskyCapability());
+ runtime.addCapability(new JMXCapability());
runtime.addCapability(new BlueprintCapability());
huskyBridge = BridgeFactory.getBridge();
Modified: projects/jboss-osgi/trunk/reactor/blueprint/testsuite/src/test/resources/container/container-basic.bnd
===================================================================
--- projects/jboss-osgi/trunk/reactor/blueprint/testsuite/src/test/resources/container/container-basic.bnd 2009-10-29 13:52:35 UTC (rev 95760)
+++ projects/jboss-osgi/trunk/reactor/blueprint/testsuite/src/test/resources/container/container-basic.bnd 2009-10-29 14:54:29 UTC (rev 95761)
@@ -11,6 +11,7 @@
org.jboss.osgi.blueprint, \
org.jboss.osgi.husky, \
org.jboss.osgi.husky.annotation, \
+ org.jboss.osgi.jmx, \
org.jboss.osgi.spi.capability, \
org.jboss.osgi.testing, \
org.junit, \
Modified: projects/jboss-osgi/trunk/reactor/framework/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/reactor/framework/pom.xml 2009-10-29 13:52:35 UTC (rev 95760)
+++ projects/jboss-osgi/trunk/reactor/framework/pom.xml 2009-10-29 14:54:29 UTC (rev 95761)
@@ -135,10 +135,6 @@
<artifactId>jboss-osgi-spi</artifactId>
</dependency>
<dependency>
- <groupId>org.jboss.osgi</groupId>
- <artifactId>jboss-osgi-testing</artifactId>
- </dependency>
- <dependency>
<groupId>org.jboss.osgi.runtime</groupId>
<artifactId>jboss-osgi-deployers</artifactId>
</dependency>
Modified: projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/microcontainer/MicrocontainerCapability.java
===================================================================
--- projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/microcontainer/MicrocontainerCapability.java 2009-10-29 13:52:35 UTC (rev 95760)
+++ projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/microcontainer/MicrocontainerCapability.java 2009-10-29 14:54:29 UTC (rev 95761)
@@ -26,11 +26,9 @@
import org.jboss.osgi.spi.capability.Capability;
import org.jboss.osgi.spi.capability.CompendiumCapability;
import org.jboss.osgi.spi.service.MicrocontainerService;
-import org.jboss.osgi.testing.OSGiRuntime;
/**
- * Adds the Microcontainer capability to the {@link OSGiRuntime}
- * under test.
+ * Adds the Microcontainer capability to the OSGiRuntime under test.
*
* This implementation does nothing because the JBossMC based framework
* does support microcontainer natively.
Modified: projects/jboss-osgi/trunk/reactor/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/reactor/pom.xml 2009-10-29 13:52:35 UTC (rev 95760)
+++ projects/jboss-osgi/trunk/reactor/pom.xml 2009-10-29 14:54:29 UTC (rev 95761)
@@ -44,7 +44,6 @@
<modules>
<module>deployment</module>
- <module>testing</module>
<module>blueprint</module>
<module>jmx</module>
<module>jta</module>
Modified: projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/blueprint/BlueprintTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/blueprint/BlueprintTestCase.java 2009-10-29 13:52:35 UTC (rev 95760)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/blueprint/BlueprintTestCase.java 2009-10-29 14:54:29 UTC (rev 95761)
@@ -33,6 +33,7 @@
import org.jboss.osgi.husky.BridgeFactory;
import org.jboss.osgi.husky.HuskyCapability;
import org.jboss.osgi.husky.annotation.ProvideContext;
+import org.jboss.osgi.jmx.JMXCapability;
import org.jboss.osgi.testing.OSGiBundle;
import org.jboss.osgi.testing.OSGiRuntime;
import org.jboss.osgi.testing.OSGiTestHelper;
@@ -66,6 +67,7 @@
{
runtime = new OSGiTestHelper().getDefaultRuntime();
runtime.addCapability(new HuskyCapability());
+ runtime.addCapability(new JMXCapability());
runtime.addCapability(new BlueprintCapability());
OSGiBundle bundle = runtime.installBundle("example-blueprint.jar");
Modified: projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/jta/TransactionTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/jta/TransactionTestCase.java 2009-10-29 13:52:35 UTC (rev 95760)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/jta/TransactionTestCase.java 2009-10-29 14:54:29 UTC (rev 95761)
@@ -50,6 +50,7 @@
{
runtime = new OSGiTestHelper().getDefaultRuntime();
runtime.addCapability(new HuskyCapability());
+ runtime.addCapability(new HuskyCapability());
runtime.addCapability(new TransactionCapability());
}
Modified: projects/jboss-osgi/trunk/testsuite/example/src/test/resources/blueprint/example-blueprint.bnd
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/resources/blueprint/example-blueprint.bnd 2009-10-29 13:52:35 UTC (rev 95760)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/resources/blueprint/example-blueprint.bnd 2009-10-29 14:54:29 UTC (rev 95761)
@@ -9,7 +9,8 @@
org.jboss.osgi.blueprint, \
org.jboss.osgi.husky, \
org.jboss.osgi.husky.annotation, \
- org.jboss.osgi.spi*, \
+ org.jboss.osgi.jmx, \
+ org.jboss.osgi.spi.capability, \
org.jboss.osgi.testing, \
org.junit, \
org.osgi.framework, \
Modified: projects/jboss-osgi/trunk/testsuite/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/testsuite/pom.xml 2009-10-29 13:52:35 UTC (rev 95760)
+++ projects/jboss-osgi/trunk/testsuite/pom.xml 2009-10-29 14:54:29 UTC (rev 95761)
@@ -56,10 +56,6 @@
<groupId>org.jboss.osgi.runtime</groupId>
<artifactId>jboss-osgi-deployment</artifactId>
</dependency>
- <dependency>
- <groupId>org.jboss.osgi</groupId>
- <artifactId>jboss-osgi-testing</artifactId>
- </dependency>
<!-- Bundle Dependencies -->
<dependency>
16 years, 1 month
JBoss-OSGI SVN: r95759 - in projects/jboss-osgi/trunk: distribution/docbook/en/modules and 3 other directories.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-10-29 09:48:34 -0400 (Thu, 29 Oct 2009)
New Revision: 95759
Modified:
projects/jboss-osgi/trunk/distribution/docbook/en/modules/ch080-provided-examples.xml
projects/jboss-osgi/trunk/pom.xml
projects/jboss-osgi/trunk/reactor/deployment/pom.xml
projects/jboss-osgi/trunk/reactor/testing/pom.xml
projects/jboss-osgi/trunk/testsuite/pom.xml
Log:
Update husky
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-10-29 13:30:22 UTC (rev 95758)
+++ projects/jboss-osgi/trunk/distribution/docbook/en/modules/ch080-provided-examples.xml 2009-10-29 13:48:34 UTC (rev 95759)
@@ -347,9 +347,8 @@
<sect1 xml:id="SecMicrocontainerServiceExample">
<title>Microcontainer Service Example</title>
- <para>The <emphasis role="bold">example-microcontainer.jar</emphasis> bundle contains a Service
- that calls a service from an MC bean and vica versa. The MC bean registeres itself as an MBean
- after it got the MBeanServer injected.</para>
+ <para>The <emphasis role="bold">example-microcontainer.jar</emphasis> bundle calls a service
+ from an MC bean and vica versa. The MC bean gets the MBeanServer injected and registeres itself as an MBean.</para>
<para>The test accesses the registered MBean.</para>
Modified: projects/jboss-osgi/trunk/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/pom.xml 2009-10-29 13:30:22 UTC (rev 95758)
+++ projects/jboss-osgi/trunk/pom.xml 2009-10-29 13:48:34 UTC (rev 95759)
@@ -43,7 +43,6 @@
<!-- Properties -->
<properties>
- <version.aqute.bnd>0.0.356</version.aqute.bnd>
<version.apache.felix.configadmin>1.0.10</version.apache.felix.configadmin>
<version.apache.felix.core>1.4.0</version.apache.felix.core>
<version.apache.felix.eventadmin>1.0.0</version.apache.felix.eventadmin>
@@ -54,10 +53,10 @@
<version.jboss.osgi.blueprint>1.0.0.Alpha3</version.jboss.osgi.blueprint>
<version.jboss.osgi.common>1.0.3-SNAPSHOT</version.jboss.osgi.common>
<version.jboss.osgi.common.core>2.2.13.GA</version.jboss.osgi.common.core>
- <version.jboss.osgi.deployment>0.0.1-SNAPSHOT</version.jboss.osgi.deployment>
+ <version.jboss.osgi.deployment>1.0.0-SNAPSHOT</version.jboss.osgi.deployment>
<version.jboss.osgi.framework>1.0.0.Alpha2</version.jboss.osgi.framework>
<version.jboss.osgi.hotdeploy>1.0.3-SNAPSHOT</version.jboss.osgi.hotdeploy>
- <version.jboss.osgi.husky>1.0.1</version.jboss.osgi.husky>
+ <version.jboss.osgi.husky>1.0.2-SNAPSHOT</version.jboss.osgi.husky>
<version.jboss.osgi.jaxb>2.1.10.SP2</version.jboss.osgi.jaxb>
<version.jboss.osgi.jmx>1.0.2-SNAPSHOT</version.jboss.osgi.jmx>
<version.jboss.osgi.jndi>1.0.1</version.jboss.osgi.jndi>
@@ -68,7 +67,7 @@
<version.jboss.osgi.runtime.felix>2.0.0-SNAPSHOT</version.jboss.osgi.runtime.felix>
<version.jboss.osgi.runtime.jbossas>1.0.2-SNAPSHOT</version.jboss.osgi.runtime.jbossas>
<version.jboss.osgi.spi>1.0.3-SNAPSHOT</version.jboss.osgi.spi>
- <version.jboss.osgi.testing>0.0.1-SNAPSHOT</version.jboss.osgi.testing>
+ <version.jboss.osgi.testing>1.0.0-SNAPSHOT</version.jboss.osgi.testing>
<version.jboss.osgi.webapp>0.7.2-SNAPSHOT</version.jboss.osgi.webapp>
<version.jboss.osgi.webconsole>1.0.2</version.jboss.osgi.webconsole>
<version.jboss.osgi.xml.binding>2.0.1.SP1</version.jboss.osgi.xml.binding>
@@ -83,14 +82,7 @@
<!-- DependencyManagement -->
<dependencyManagement>
<dependencies>
-
- <!-- aQute -->
- <dependency>
- <groupId>biz.aQute</groupId>
- <artifactId>bnd</artifactId>
- <version>${version.aqute.bnd}</version>
- </dependency>
-
+
<!-- jboss.osgi -->
<dependency>
<groupId>org.jboss.osgi</groupId>
Modified: projects/jboss-osgi/trunk/reactor/deployment/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/reactor/deployment/pom.xml 2009-10-29 13:30:22 UTC (rev 95758)
+++ projects/jboss-osgi/trunk/reactor/deployment/pom.xml 2009-10-29 13:48:34 UTC (rev 95759)
@@ -20,7 +20,7 @@
<artifactId>jboss-osgi-deployment</artifactId>
<packaging>jar</packaging>
- <version>0.0.1-SNAPSHOT</version>
+ <version>1.0.0-SNAPSHOT</version>
<!-- Parent -->
<parent>
Modified: projects/jboss-osgi/trunk/reactor/testing/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/reactor/testing/pom.xml 2009-10-29 13:30:22 UTC (rev 95758)
+++ projects/jboss-osgi/trunk/reactor/testing/pom.xml 2009-10-29 13:48:34 UTC (rev 95759)
@@ -20,7 +20,7 @@
<artifactId>jboss-osgi-testing</artifactId>
<packaging>jar</packaging>
- <version>0.0.1-SNAPSHOT</version>
+ <version>1.0.0-SNAPSHOT</version>
<!-- Parent -->
<parent>
Modified: projects/jboss-osgi/trunk/testsuite/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/testsuite/pom.xml 2009-10-29 13:30:22 UTC (rev 95758)
+++ projects/jboss-osgi/trunk/testsuite/pom.xml 2009-10-29 13:48:34 UTC (rev 95759)
@@ -134,6 +134,16 @@
</dependency>
<dependency>
<groupId>org.jboss.osgi.bundles</groupId>
+ <artifactId>jboss-osgi-jmx</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.osgi.bundles</groupId>
+ <artifactId>jboss-osgi-jndi</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.osgi.bundles</groupId>
<artifactId>jboss-osgi-jta</artifactId>
<scope>provided</scope>
</dependency>
16 years, 1 month
JBoss-OSGI SVN: r95758 - in projects/jboss-osgi/projects/bundles/husky/trunk: testsuite and 4 other directories.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-10-29 09:30:22 -0400 (Thu, 29 Oct 2009)
New Revision: 95758
Modified:
projects/jboss-osgi/projects/bundles/husky/trunk/pom.xml
projects/jboss-osgi/projects/bundles/husky/trunk/testsuite/pom.xml
projects/jboss-osgi/projects/bundles/husky/trunk/testsuite/scripts/assembly-bundles.xml
projects/jboss-osgi/projects/bundles/husky/trunk/testsuite/src/test/java/org/jboss/test/osgi/husky/context/ContextTestCase.java
projects/jboss-osgi/projects/bundles/husky/trunk/testsuite/src/test/java/org/jboss/test/osgi/husky/context/MultipleMethodsTestCase.java
projects/jboss-osgi/projects/bundles/husky/trunk/testsuite/src/test/java/org/jboss/test/osgi/husky/context/StaticContextTestCase.java
projects/jboss-osgi/projects/bundles/husky/trunk/testsuite/src/test/resources/context/context-basic.bnd
projects/jboss-osgi/projects/bundles/husky/trunk/testsuite/src/test/resources/jboss-osgi-framework.properties
Log:
Remove dependency on jboss-osgi-jmx
Modified: projects/jboss-osgi/projects/bundles/husky/trunk/pom.xml
===================================================================
--- projects/jboss-osgi/projects/bundles/husky/trunk/pom.xml 2009-10-29 13:29:12 UTC (rev 95757)
+++ projects/jboss-osgi/projects/bundles/husky/trunk/pom.xml 2009-10-29 13:30:22 UTC (rev 95758)
@@ -28,7 +28,7 @@
<parent>
<groupId>org.jboss.osgi</groupId>
<artifactId>jboss-osgi-parent</artifactId>
- <version>1.0.3</version>
+ <version>1.0.4-SNAPSHOT</version>
</parent>
<!-- Subversion -->
@@ -40,11 +40,10 @@
<!-- Properties -->
<properties>
- <version.aqute.bnd>0.0.356</version.aqute.bnd>
- <version.apache.felix.log>1.0.0</version.apache.felix.log>
- <version.jboss.osgi.jmx>1.0.1</version.jboss.osgi.jmx>
- <version.jboss.osgi.runtime.felix>2.0.0</version.jboss.osgi.runtime.felix>
- <version.osgi>r4v42</version.osgi>
+ <version.jboss.osgi.runtime.felix>2.0.0-SNAPSHOT</version.jboss.osgi.runtime.felix>
+ <version.jboss.osgi.spi>1.0.3-SNAPSHOT</version.jboss.osgi.spi>
+ <version.jboss.osgi.testing>1.0.0-SNAPSHOT</version.jboss.osgi.testing>
+ <version.osgi>4.2.0</version.osgi>
</properties>
<!-- Modules -->
@@ -57,25 +56,22 @@
<dependencyManagement>
<dependencies>
<dependency>
- <groupId>biz.aQute</groupId>
- <artifactId>bnd</artifactId>
- <version>${version.aqute.bnd}</version>
+ <groupId>org.jboss.osgi</groupId>
+ <artifactId>jboss-osgi-spi</artifactId>
+ <version>${version.jboss.osgi.spi}</version>
</dependency>
<dependency>
- <groupId>org.apache.felix</groupId>
- <artifactId>org.apache.felix.log</artifactId>
- <version>${version.apache.felix.log}</version>
+ <groupId>org.jboss.osgi</groupId>
+ <artifactId>jboss-osgi-testing</artifactId>
+ <version>${version.jboss.osgi.testing}</version>
</dependency>
+
<dependency>
- <groupId>org.jboss.osgi.bundles</groupId>
- <artifactId>jboss-osgi-jmx</artifactId>
- <version>${version.jboss.osgi.jmx}</version>
- </dependency>
- <dependency>
<groupId>org.jboss.osgi.runtime</groupId>
<artifactId>jboss-osgi-runtime-felix</artifactId>
<version>${version.jboss.osgi.runtime.felix}</version>
</dependency>
+
<dependency>
<groupId>org.osgi</groupId>
<artifactId>org.osgi.core</artifactId>
Modified: projects/jboss-osgi/projects/bundles/husky/trunk/testsuite/pom.xml
===================================================================
--- projects/jboss-osgi/projects/bundles/husky/trunk/testsuite/pom.xml 2009-10-29 13:29:12 UTC (rev 95757)
+++ projects/jboss-osgi/projects/bundles/husky/trunk/testsuite/pom.xml 2009-10-29 13:30:22 UTC (rev 95758)
@@ -41,37 +41,24 @@
<groupId>biz.aQute</groupId>
<artifactId>bnd</artifactId>
</dependency>
+
<dependency>
<groupId>org.jboss.osgi.runtime</groupId>
<artifactId>jboss-osgi-runtime-felix</artifactId>
- </dependency>
- <dependency>
- <groupId>org.osgi</groupId>
- <artifactId>org.osgi.core</artifactId>
- </dependency>
- <dependency>
- <groupId>org.osgi</groupId>
- <artifactId>org.osgi.compendium</artifactId>
- </dependency>
-
- <!-- Bundle Dependencies -->
- <dependency>
- <groupId>org.apache.felix</groupId>
- <artifactId>org.apache.felix.log</artifactId>
<scope>provided</scope>
</dependency>
- <dependency>
- <groupId>org.jboss.osgi.bundles</groupId>
- <artifactId>jboss-osgi-jmx</artifactId>
- <scope>provided</scope>
- </dependency>
<!-- Test Dependencies -->
<dependency>
- <groupId>org.jboss.logging</groupId>
- <artifactId>jboss-logging-log4j</artifactId>
+ <groupId>org.jboss.osgi</groupId>
+ <artifactId>jboss-osgi-testing</artifactId>
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-log4j12</artifactId>
+ <scope>test</scope>
+ </dependency>
</dependencies>
<build>
@@ -120,8 +107,8 @@
<configuration>
<systemProperties>
<property>
- <name>test.archive.directory</name>
- <value>${project.build.directory}/test-libs</value>
+ <name>java.protocol.handler.pkgs</name>
+ <value>org.jboss.net.protocol|org.jboss.virtual.protocol</value>
</property>
<property>
<name>log4j.output.dir</name>
@@ -131,6 +118,10 @@
<name>org.jboss.osgi.husky.Invoker</name>
<value>org.jboss.osgi.husky.internal.OSGiInvoker</value>
</property>
+ <property>
+ <name>test.archive.directory</name>
+ <value>${project.build.directory}/test-libs</value>
+ </property>
</systemProperties>
</configuration>
</plugin>
Modified: projects/jboss-osgi/projects/bundles/husky/trunk/testsuite/scripts/assembly-bundles.xml
===================================================================
--- projects/jboss-osgi/projects/bundles/husky/trunk/testsuite/scripts/assembly-bundles.xml 2009-10-29 13:29:12 UTC (rev 95757)
+++ projects/jboss-osgi/projects/bundles/husky/trunk/testsuite/scripts/assembly-bundles.xml 2009-10-29 13:30:22 UTC (rev 95758)
@@ -15,12 +15,7 @@
<outputDirectory>bundles</outputDirectory>
<outputFileNameMapping>${artifact.artifactId}${dashClassifier?}.${artifact.extension}</outputFileNameMapping>
<includes>
- <include>*:jboss-osgi-common:jar</include>
- <include>*:jboss-osgi-common-core:jar</include>
- <include>*:jboss-osgi-jmx:jar</include>
- <include>*:jboss-osgi-jndi:jar</include>
<include>*:jboss-osgi-husky:jar</include>
- <include>*:org.apache.felix.log:jar</include>
<include>*:org.osgi.compendium:jar</include>
</includes>
<useStrictFiltering>true</useStrictFiltering>
Modified: projects/jboss-osgi/projects/bundles/husky/trunk/testsuite/src/test/java/org/jboss/test/osgi/husky/context/ContextTestCase.java
===================================================================
--- projects/jboss-osgi/projects/bundles/husky/trunk/testsuite/src/test/java/org/jboss/test/osgi/husky/context/ContextTestCase.java 2009-10-29 13:29:12 UTC (rev 95757)
+++ projects/jboss-osgi/projects/bundles/husky/trunk/testsuite/src/test/java/org/jboss/test/osgi/husky/context/ContextTestCase.java 2009-10-29 13:30:22 UTC (rev 95758)
@@ -29,10 +29,9 @@
import org.jboss.osgi.husky.BridgeFactory;
import org.jboss.osgi.husky.HuskyCapability;
import org.jboss.osgi.husky.annotation.ProvideContext;
-import org.jboss.osgi.jmx.JMXCapability;
-import org.jboss.osgi.spi.testing.OSGiBundle;
-import org.jboss.osgi.spi.testing.OSGiRuntime;
-import org.jboss.osgi.spi.testing.OSGiTestHelper;
+import org.jboss.osgi.testing.OSGiBundle;
+import org.jboss.osgi.testing.OSGiRuntime;
+import org.jboss.osgi.testing.OSGiTestHelper;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
@@ -59,7 +58,6 @@
if (context == null)
{
runtime = new OSGiTestHelper().getDefaultRuntime();
- runtime.addCapability(new JMXCapability());
runtime.addCapability(new HuskyCapability());
OSGiBundle bundle = runtime.installBundle("context-basic.jar");
Modified: projects/jboss-osgi/projects/bundles/husky/trunk/testsuite/src/test/java/org/jboss/test/osgi/husky/context/MultipleMethodsTestCase.java
===================================================================
--- projects/jboss-osgi/projects/bundles/husky/trunk/testsuite/src/test/java/org/jboss/test/osgi/husky/context/MultipleMethodsTestCase.java 2009-10-29 13:29:12 UTC (rev 95757)
+++ projects/jboss-osgi/projects/bundles/husky/trunk/testsuite/src/test/java/org/jboss/test/osgi/husky/context/MultipleMethodsTestCase.java 2009-10-29 13:30:22 UTC (rev 95758)
@@ -23,16 +23,15 @@
//$Id$
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertEquals;
import static org.junit.Assume.assumeNotNull;
import org.jboss.osgi.husky.BridgeFactory;
import org.jboss.osgi.husky.HuskyCapability;
import org.jboss.osgi.husky.annotation.ProvideContext;
-import org.jboss.osgi.jmx.JMXCapability;
-import org.jboss.osgi.spi.testing.OSGiBundle;
-import org.jboss.osgi.spi.testing.OSGiRuntime;
-import org.jboss.osgi.spi.testing.OSGiTestHelper;
+import org.jboss.osgi.testing.OSGiBundle;
+import org.jboss.osgi.testing.OSGiRuntime;
+import org.jboss.osgi.testing.OSGiTestHelper;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
@@ -59,7 +58,6 @@
if (context == null)
{
runtime = new OSGiTestHelper().getDefaultRuntime();
- runtime.addCapability(new JMXCapability());
runtime.addCapability(new HuskyCapability());
OSGiBundle bundle = runtime.installBundle("context-basic.jar");
Modified: projects/jboss-osgi/projects/bundles/husky/trunk/testsuite/src/test/java/org/jboss/test/osgi/husky/context/StaticContextTestCase.java
===================================================================
--- projects/jboss-osgi/projects/bundles/husky/trunk/testsuite/src/test/java/org/jboss/test/osgi/husky/context/StaticContextTestCase.java 2009-10-29 13:29:12 UTC (rev 95757)
+++ projects/jboss-osgi/projects/bundles/husky/trunk/testsuite/src/test/java/org/jboss/test/osgi/husky/context/StaticContextTestCase.java 2009-10-29 13:30:22 UTC (rev 95758)
@@ -29,10 +29,9 @@
import org.jboss.osgi.husky.BridgeFactory;
import org.jboss.osgi.husky.HuskyCapability;
import org.jboss.osgi.husky.annotation.ProvideContext;
-import org.jboss.osgi.jmx.JMXCapability;
-import org.jboss.osgi.spi.testing.OSGiBundle;
-import org.jboss.osgi.spi.testing.OSGiRuntime;
-import org.jboss.osgi.spi.testing.OSGiTestHelper;
+import org.jboss.osgi.testing.OSGiBundle;
+import org.jboss.osgi.testing.OSGiRuntime;
+import org.jboss.osgi.testing.OSGiTestHelper;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
@@ -59,7 +58,6 @@
if (context == null)
{
runtime = new OSGiTestHelper().getDefaultRuntime();
- runtime.addCapability(new JMXCapability());
runtime.addCapability(new HuskyCapability());
OSGiBundle bundle = runtime.installBundle("context-basic.jar");
Modified: projects/jboss-osgi/projects/bundles/husky/trunk/testsuite/src/test/resources/context/context-basic.bnd
===================================================================
--- projects/jboss-osgi/projects/bundles/husky/trunk/testsuite/src/test/resources/context/context-basic.bnd 2009-10-29 13:29:12 UTC (rev 95757)
+++ projects/jboss-osgi/projects/bundles/husky/trunk/testsuite/src/test/resources/context/context-basic.bnd 2009-10-29 13:30:22 UTC (rev 95758)
@@ -8,8 +8,7 @@
org.jboss.osgi.husky, \
org.jboss.osgi.husky.annotation, \
org.jboss.osgi.spi.capability, \
- org.jboss.osgi.spi.testing, \
- org.jboss.osgi.jmx, \
+ org.jboss.osgi.testing, \
org.junit, \
org.osgi.framework
Modified: projects/jboss-osgi/projects/bundles/husky/trunk/testsuite/src/test/resources/jboss-osgi-framework.properties
===================================================================
--- projects/jboss-osgi/projects/bundles/husky/trunk/testsuite/src/test/resources/jboss-osgi-framework.properties 2009-10-29 13:29:12 UTC (rev 95757)
+++ projects/jboss-osgi/projects/bundles/husky/trunk/testsuite/src/test/resources/jboss-osgi-framework.properties 2009-10-29 13:30:22 UTC (rev 95758)
@@ -4,9 +4,6 @@
# $Id$
#
-# The OSGiFramework implementation
-org.jboss.osgi.spi.framework.impl=org.jboss.osgi.felix.framework.FelixIntegration
-
# Properties to configure the Framework
org.osgi.framework.storage=${test.archive.directory}/../osgi-store
org.osgi.framework.storage.clean=onFirstInit
@@ -26,15 +23,15 @@
org.jboss.osgi.spi.logging;version=1.0, \
org.jboss.osgi.spi.management;version=1.0, \
org.jboss.osgi.spi.service;version=1.0, \
- org.jboss.osgi.spi.testing;version=1.0, \
org.jboss.osgi.spi.util;version=1.0, \
- org.osgi.framework;version=1.4
+ org.jboss.osgi.testing;version=1.0, \
+ org.osgi.framework;version=1.4, \
+ org.slf4j;version=1.5
# Bundles that need to be installed with the Framework automatically
org.jboss.osgi.spi.framework.autoInstall=\
file://${test.archive.directory}/bundles/org.osgi.compendium.jar
# Bundles that need to be started automatically
-org.jboss.osgi.spi.framework.autoStart=\
- file://${test.archive.directory}/bundles/org.apache.felix.log.jar \
- file://${test.archive.directory}/bundles/jboss-osgi-common.jar
+#org.jboss.osgi.spi.framework.autoStart=\
+# file://${test.archive.directory}/bundles/jboss-osgi-common.jar
16 years, 1 month
JBoss-OSGI SVN: r95756 - in projects/jboss-osgi/projects/bundles/husky/trunk/harness: src/main/java/org/jboss/osgi/husky and 2 other directories.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-10-29 09:27:57 -0400 (Thu, 29 Oct 2009)
New Revision: 95756
Removed:
projects/jboss-osgi/projects/bundles/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/internal/HuskyLogService.java
projects/jboss-osgi/projects/bundles/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/internal/HuskySystemLog.java
Modified:
projects/jboss-osgi/projects/bundles/husky/trunk/harness/pom.xml
projects/jboss-osgi/projects/bundles/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/HuskyCapability.java
projects/jboss-osgi/projects/bundles/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/runtime/osgi/HuskyExtender.java
projects/jboss-osgi/projects/bundles/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/runtime/osgi/JMXConnector.java
projects/jboss-osgi/projects/bundles/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/runtime/osgi/SocketConnector.java
Log:
Remove dependency on jboss-osgi-jmx
Modified: projects/jboss-osgi/projects/bundles/husky/trunk/harness/pom.xml
===================================================================
--- projects/jboss-osgi/projects/bundles/husky/trunk/harness/pom.xml 2009-10-29 13:21:24 UTC (rev 95755)
+++ projects/jboss-osgi/projects/bundles/husky/trunk/harness/pom.xml 2009-10-29 13:27:57 UTC (rev 95756)
@@ -31,13 +31,13 @@
<!-- Dependencies -->
<dependencies>
<dependency>
+ <groupId>org.jboss.osgi</groupId>
+ <artifactId>jboss-osgi-spi</artifactId>
+ </dependency>
+ <dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
</dependency>
- <dependency>
- <groupId>org.jboss.osgi.bundles</groupId>
- <artifactId>jboss-osgi-jmx</artifactId>
- </dependency>
<!-- Provided Dependencies -->
<dependency>
Modified: projects/jboss-osgi/projects/bundles/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/HuskyCapability.java
===================================================================
--- projects/jboss-osgi/projects/bundles/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/HuskyCapability.java 2009-10-29 13:21:24 UTC (rev 95755)
+++ projects/jboss-osgi/projects/bundles/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/HuskyCapability.java 2009-10-29 13:27:57 UTC (rev 95756)
@@ -21,11 +21,11 @@
*/
package org.jboss.osgi.husky;
-import org.jboss.osgi.jmx.JMXCapability;
+import org.jboss.osgi.husky.runtime.Connector;
import org.jboss.osgi.spi.capability.Capability;
-import org.jboss.osgi.spi.testing.OSGiRuntime;
+
//$Id$
@@ -35,8 +35,6 @@
*
* It is ignored if a Husky connector is already registered.
*
- * Dependent capabilities: {@link JMXCapability}.
- *
* Installed bundles: jboss-osgi-husky.jar
*
* @author thomas.diesler(a)jboss.com
@@ -46,9 +44,8 @@
{
public HuskyCapability()
{
- super("org.jboss.osgi.husky.runtime.Connector");
+ super(Connector.class.getName());
- addDependency(new JMXCapability());
addBundle("bundles/jboss-osgi-husky.jar");
}
}
\ No newline at end of file
Deleted: projects/jboss-osgi/projects/bundles/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/internal/HuskyLogService.java
===================================================================
--- projects/jboss-osgi/projects/bundles/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/internal/HuskyLogService.java 2009-10-29 13:21:24 UTC (rev 95755)
+++ projects/jboss-osgi/projects/bundles/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/internal/HuskyLogService.java 2009-10-29 13:27:57 UTC (rev 95756)
@@ -1,85 +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.osgi.husky.internal;
-
-//$Id$
-
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.ServiceReference;
-import org.osgi.service.log.LogService;
-import org.osgi.util.tracker.ServiceTracker;
-
-/**
- * A combined ServiceTracker/LogService that bundles can use to access the registered LogService.
- *
- * If a LogService is registered, the LogServiceTracker delegates to that LogService.
- * If there is no LogService registered, the LogServiceTracker delegates to the {@link HuskySystemLog}
- *
- *
- * @author thomas.diesler(a)jboss.com
- * @since 11-Apr-2009
- */
-public class HuskyLogService extends ServiceTracker implements LogService
-{
- private LogService log;
-
- public HuskyLogService(BundleContext context)
- {
- super(context, LogService.class.getName(), null);
- log = new HuskySystemLog(context);
- open();
- }
-
- @Override
- public Object addingService(ServiceReference reference)
- {
- log = (LogService)super.addingService(reference);
- return log;
- }
-
- @Override
- public void removedService(ServiceReference reference, Object service)
- {
- super.removedService(reference, service);
- log = new HuskySystemLog(context);
- }
-
- public void log(int level, String message)
- {
- log.log(level, message);
- }
-
- public void log(int level, String message, Throwable exception)
- {
- log.log(level, message, exception);
- }
-
- public void log(ServiceReference sr, int level, String message)
- {
- log.log(sr, level, message);
- }
-
- public void log(ServiceReference sr, int level, String message, Throwable exception)
- {
- log.log(sr, level, message, exception);
- }
-}
\ No newline at end of file
Deleted: projects/jboss-osgi/projects/bundles/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/internal/HuskySystemLog.java
===================================================================
--- projects/jboss-osgi/projects/bundles/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/internal/HuskySystemLog.java 2009-10-29 13:21:24 UTC (rev 95755)
+++ projects/jboss-osgi/projects/bundles/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/internal/HuskySystemLog.java 2009-10-29 13:27:57 UTC (rev 95756)
@@ -1,115 +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.osgi.husky.internal;
-
-//$Id$
-
-import java.text.SimpleDateFormat;
-import java.util.Date;
-
-import org.osgi.framework.Bundle;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.ServiceReference;
-import org.osgi.service.log.LogService;
-
-/**
- * A basic LogService that writes to System.out
- *
- * @author thomas.diesler(a)jboss.com
- * @since 11-Apr-2009
- */
-class HuskySystemLog implements LogService
-{
- private BundleContext context;
-
- public HuskySystemLog(BundleContext context)
- {
- this.context = context;
- }
-
- public void log(int level, String message)
- {
- logInternal(null, level, message, null);
- }
-
- public void log(int level, String message, Throwable exception)
- {
- logInternal(null, level, message, exception);
- }
-
- public void log(ServiceReference sr, int level, String message)
- {
- logInternal(sr, level, message, null);
- }
-
- public void log(ServiceReference sr, int level, String message, Throwable exception)
- {
- logInternal(sr, level, message, exception);
- }
-
- private void logInternal(ServiceReference sref, int level, String message, Throwable exception)
- {
- long time = System.currentTimeMillis();
- Bundle bundle = context.getBundle();
-
- String bndStr = bundle.getSymbolicName();
-
- String srefStr = null;
- if (sref != null && sref.getBundle() != null)
- srefStr = sref.getBundle().getSymbolicName();
-
- String t = new SimpleDateFormat("dd-MMM-yyyy HH:mm.ss.SSS").format(new Date(time));
- String l = " " + logLevel(level);
- String s = srefStr != null ? ",sref=" + srefStr : "";
- String b = ",bnd=" + bndStr;
- String m = ",msg=" + message;
- String e = exception != null ? ",ex=" + exception : "";
-
- System.out.println("[" + t + l + b + s + m + e + "]");
-
- if (exception != null)
- exception.printStackTrace(System.out);
- }
-
- private String logLevel(int level)
- {
- String logLevel;
- switch (level)
- {
- case LogService.LOG_DEBUG:
- logLevel = "DEBUG";
- break;
- case LogService.LOG_INFO:
- logLevel = "INFO";
- break;
- case LogService.LOG_WARNING:
- logLevel = "WARN";
- break;
- case LogService.LOG_ERROR:
- logLevel = "ERROR";
- break;
- default:
- logLevel = "Level=" + level;
- }
- return logLevel;
- }
-}
\ No newline at end of file
Modified: projects/jboss-osgi/projects/bundles/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/runtime/osgi/HuskyExtender.java
===================================================================
--- projects/jboss-osgi/projects/bundles/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/runtime/osgi/HuskyExtender.java 2009-10-29 13:21:24 UTC (rev 95755)
+++ projects/jboss-osgi/projects/bundles/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/runtime/osgi/HuskyExtender.java 2009-10-29 13:27:57 UTC (rev 95756)
@@ -27,7 +27,6 @@
import java.util.Arrays;
import java.util.List;
-import org.jboss.osgi.husky.internal.HuskyLogService;
import org.jboss.osgi.husky.runtime.Connector;
import org.jboss.osgi.husky.runtime.PackageListener;
import org.jboss.osgi.husky.runtime.junit.JUnitPackageListener;
@@ -38,7 +37,8 @@
import org.osgi.framework.InvalidSyntaxException;
import org.osgi.framework.ServiceReference;
import org.osgi.framework.SynchronousBundleListener;
-import org.osgi.service.log.LogService;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/**
* The Husky extender is a {@link BundleListener} that checkes the {@link #HEADER_TEST_PACKAGE}
@@ -51,12 +51,13 @@
/** The manifest header that identifies a bundle as Husky test bundle: 'Test-Package' */
public static final String HEADER_TEST_PACKAGE = "Test-Package";
+ // Provide Logging
+ private Logger log = LoggerFactory.getLogger(HuskyExtender.class);
+
private BundleContext context;
- private LogService log;
public HuskyExtender(BundleContext context)
{
- this.log = new HuskyLogService(context);
this.context = context;
}
@@ -92,7 +93,7 @@
if (srefs != null)
{
- log.log(LogService.LOG_INFO, "Register test packages " + packages);
+ log.info("Register test packages " + packages);
for (ServiceReference sref : srefs)
{
Connector connector = (Connector)context.getService(sref);
@@ -116,7 +117,7 @@
if (srefs != null)
{
- log.log(LogService.LOG_INFO, "Unregister test packages " + packages);
+ log.info("Unregister test packages " + packages);
for (ServiceReference sref : srefs)
{
Connector connector = (Connector)context.getService(sref);
Modified: projects/jboss-osgi/projects/bundles/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/runtime/osgi/JMXConnector.java
===================================================================
--- projects/jboss-osgi/projects/bundles/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/runtime/osgi/JMXConnector.java 2009-10-29 13:21:24 UTC (rev 95755)
+++ projects/jboss-osgi/projects/bundles/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/runtime/osgi/JMXConnector.java 2009-10-29 13:27:57 UTC (rev 95756)
@@ -24,18 +24,20 @@
// $Id$
import java.io.InputStream;
+import java.util.ArrayList;
import java.util.Properties;
import javax.management.MBeanServer;
+import javax.management.MBeanServerFactory;
import javax.management.MalformedObjectNameException;
import javax.management.ObjectName;
import org.jboss.osgi.husky.internal.AbstractConnector;
-import org.jboss.osgi.husky.internal.HuskyLogService;
import org.jboss.osgi.husky.runtime.Connector;
import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceReference;
-import org.osgi.service.log.LogService;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/**
* The JMX connector is a {@link Connector} that process Husky
@@ -46,14 +48,13 @@
*/
public class JMXConnector extends AbstractConnector implements JMXConnectorMBean
{
- /*
- * The ObjectName for this service: jboss.osgi.husky:service=jmx-connector
- */
- public static ObjectName OBJECT_NAME;
+ // Provide Logging
+ private Logger log = LoggerFactory.getLogger(HuskyExtender.class);
- private LogService log;
private BundleContext context;
+ /** The ObjectName for this service: jboss.osgi.husky:service=jmx-connector */
+ public static ObjectName OBJECT_NAME;
static
{
try
@@ -68,34 +69,26 @@
public JMXConnector(BundleContext context)
{
- this.log = new HuskyLogService(context);
this.context = context;
}
public void start() throws Exception
{
- ServiceReference sref = context.getServiceReference(MBeanServer.class.getName());
- if (sref == null)
- throw new IllegalStateException("Cannot obtain MBeanServer service");
+ MBeanServer mbeanServer = getMBeanServer();
+ mbeanServer.registerMBean(this, OBJECT_NAME);
Properties props = new Properties();
props.setProperty("transport", "jmx");
context.registerService(Connector.class.getName(), this, props);
- MBeanServer server = (MBeanServer)context.getService(sref);
- server.registerMBean(this, OBJECT_NAME);
- log.log(LogService.LOG_INFO, "JMXConnector registered: " + OBJECT_NAME);
+ log.info("JMXConnector registered: " + OBJECT_NAME);
}
public void stop() throws Exception
{
- ServiceReference sref = context.getServiceReference(MBeanServer.class.getName());
- if (sref != null)
- {
- MBeanServer server = (MBeanServer)context.getService(sref);
- if (server.isRegistered(OBJECT_NAME))
- server.unregisterMBean(OBJECT_NAME);
- }
+ MBeanServer mbeanServer = getMBeanServer();
+ if (mbeanServer.isRegistered(OBJECT_NAME))
+ mbeanServer.unregisterMBean(OBJECT_NAME);
}
@Override
@@ -103,4 +96,37 @@
{
return super.process(reqStream);
}
+
+ @SuppressWarnings("unchecked")
+ private MBeanServer getMBeanServer()
+ {
+ MBeanServer mbeanServer = null;
+
+ // Check if there is an MBeanServer service already
+ ServiceReference sref = context.getServiceReference(MBeanServer.class.getName());
+ if (sref != null)
+ {
+ mbeanServer = (MBeanServer)context.getService(sref);
+ log.debug("Found MBeanServer fom service: " + mbeanServer.getDefaultDomain());
+ }
+ else
+ {
+ ArrayList<MBeanServer> serverArr = MBeanServerFactory.findMBeanServer(null);
+ if (serverArr.size() > 1)
+ log.warn("Multiple MBeanServer instances: " + serverArr);
+
+ if (serverArr.size() > 0)
+ {
+ mbeanServer = serverArr.get(0);
+ log.debug("Found MBeanServer: " + mbeanServer.getDefaultDomain());
+ }
+
+ if (mbeanServer == null)
+ {
+ log.debug("No MBeanServer, create one ...");
+ mbeanServer = MBeanServerFactory.createMBeanServer();
+ }
+ }
+ return mbeanServer;
+ }
}
\ No newline at end of file
Modified: projects/jboss-osgi/projects/bundles/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/runtime/osgi/SocketConnector.java
===================================================================
--- projects/jboss-osgi/projects/bundles/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/runtime/osgi/SocketConnector.java 2009-10-29 13:21:24 UTC (rev 95755)
+++ projects/jboss-osgi/projects/bundles/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/runtime/osgi/SocketConnector.java 2009-10-29 13:27:57 UTC (rev 95756)
@@ -31,12 +31,12 @@
import java.util.Properties;
import org.jboss.osgi.husky.internal.AbstractConnector;
-import org.jboss.osgi.husky.internal.HuskyLogService;
import org.jboss.osgi.husky.internal.Util;
import org.jboss.osgi.husky.runtime.Connector;
import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceRegistration;
-import org.osgi.service.log.LogService;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/**
* The socket connector is a {@link Connector} that process Husky
@@ -51,19 +51,20 @@
*/
public class SocketConnector extends AbstractConnector
{
+ // Provide Logging
+ private Logger log = LoggerFactory.getLogger(HuskyExtender.class);
+
/** The Husky socket connector host poperty: 'org.jboss.osgi.husky.runtime.connector.host' */
public static final String PROP_SOCKET_CONNECTOR_HOST = Connector.class.getName().toLowerCase() + ".host";
/** The Husky socket connector port poperty: 'org.jboss.osgi.husky.runtime.connector.port' */
public static final String PROP_SOCKET_CONNECTOR_PORT = Connector.class.getName().toLowerCase() + ".port";
- private LogService log;
private BundleContext context;
private ServiceRegistration sreg;
private ListenerThread listenerThread;
public SocketConnector(BundleContext context)
{
- this.log = new HuskyLogService(context);
this.context = context;
}
@@ -98,7 +99,7 @@
listenerThread.start();
sreg = context.registerService(Connector.class.getName(), this, props);
- log.log(LogService.LOG_INFO, "SocketConnector registered: " + props);
+ log.info("SocketConnector registered: " + props);
}
public void stop() throws Exception
@@ -132,7 +133,7 @@
{
try
{
- log.log(LogService.LOG_DEBUG, "Stop SocketConnector");
+ log.debug("Stop SocketConnector");
serverSocket.close();
}
catch (IOException ex)
@@ -149,9 +150,9 @@
Socket socket = null;
try
{
- log.log(LogService.LOG_DEBUG, "Waiting for connection ...");
+ log.debug("Waiting for connection ...");
socket = serverSocket.accept();
- log.log(LogService.LOG_DEBUG, "Connection accepted");
+ log.debug("Connection accepted");
}
catch (IOException ex)
{
@@ -169,7 +170,7 @@
}
catch (Exception ex)
{
- log.log(LogService.LOG_WARNING, "Cannot process request", ex);
+ log.warn("Cannot process request", ex);
}
}
}
16 years, 1 month