JBoss-OSGI SVN: r89555 - in projects/jboss-osgi/trunk: runtime/felix/src/main/resources and 1 other directory.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-05-30 11:19:38 -0400 (Sat, 30 May 2009)
New Revision: 89555
Modified:
projects/jboss-osgi/trunk/pom.xml
projects/jboss-osgi/trunk/runtime/felix/src/main/resources/osgi-deployers-jboss-beans.xml
Log:
Add missing surefire sysprop jboss.bind.address
Modified: projects/jboss-osgi/trunk/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/pom.xml 2009-05-30 14:49:58 UTC (rev 89554)
+++ projects/jboss-osgi/trunk/pom.xml 2009-05-30 15:19:38 UTC (rev 89555)
@@ -688,13 +688,7 @@
<name>jboss.osgi.framework.properties</name>
<value>${jboss.osgi.framework.properties}</value>
</property>
- <!--
<property>
- <name>org.apache.xerces.xni.parser.XMLParserConfiguration</name>
- <value>org.apache.xerces.parsers.XIncludeAwareParserConfiguration</value>
- </property>
- -->
- <property>
<name>org.jboss.osgi.husky.Invoker</name>
<value>org.jboss.osgi.husky.internal.OSGiInvoker</value>
</property>
@@ -739,6 +733,10 @@
<value>org.jboss.net.protocol|org.jboss.virtual.protocol</value>
</property>
<property>
+ <name>jboss.bind.address</name>
+ <value>${jboss.bind.address}</value>
+ </property>
+ <property>
<name>jndi.server.port</name>
<value>1099</value>
</property>
Modified: projects/jboss-osgi/trunk/runtime/felix/src/main/resources/osgi-deployers-jboss-beans.xml
===================================================================
--- projects/jboss-osgi/trunk/runtime/felix/src/main/resources/osgi-deployers-jboss-beans.xml 2009-05-30 14:49:58 UTC (rev 89554)
+++ projects/jboss-osgi/trunk/runtime/felix/src/main/resources/osgi-deployers-jboss-beans.xml 2009-05-30 15:19:38 UTC (rev 89555)
@@ -62,7 +62,7 @@
Setup remote logging
-->
<entry><key>org.jboss.osgi.service.remote.log.sender</key><value>true</value></entry>
- <entry><key>org.jboss.osgi.service.remote.log.host</key><value>localhost</value></entry>
+ <entry><key>org.jboss.osgi.service.remote.log.host</key><value>${jboss.bind.address}</value></entry>
<entry><key>org.jboss.osgi.service.remote.log.port</key><value>5400</value></entry>
<!--
Husky socket connector properties
16 years, 6 months
JBoss-OSGI SVN: r89554 - projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/http.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-05-30 10:49:58 -0400 (Sat, 30 May 2009)
New Revision: 89554
Modified:
projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/http/HttpServiceTestCase.java
Log:
Wait 10sec before accessing the http service. Jetty takes long to become available.
Modified: projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/http/HttpServiceTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/http/HttpServiceTestCase.java 2009-05-30 14:20:04 UTC (rev 89553)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/http/HttpServiceTestCase.java 2009-05-30 14:49:58 UTC (rev 89554)
@@ -57,7 +57,7 @@
runtime.addCapability(new ConfigAdminCapability());
runtime.addCapability(new HttpCapability());
- Thread.sleep(2000);
+ Thread.sleep(10000);
testBundle = runtime.installBundle("example-http.jar");
testBundle.start();
16 years, 6 months
JBoss-OSGI SVN: r89553 - in projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi: service and 1 other directory.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-05-30 10:20:04 -0400 (Sat, 30 May 2009)
New Revision: 89553
Removed:
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/service/jmx/
Modified:
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/bootstrap/CapabilityTestCase.java
Log:
Cleanup ignored tests - WIP
Modified: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/bootstrap/CapabilityTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/bootstrap/CapabilityTestCase.java 2009-05-30 14:10:05 UTC (rev 89552)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/bootstrap/CapabilityTestCase.java 2009-05-30 14:20:04 UTC (rev 89553)
@@ -34,7 +34,6 @@
import javax.xml.parsers.SAXParserFactory;
import org.jboss.osgi.common.service.JAXBService;
-import org.jboss.osgi.common.service.MicrocontainerService;
import org.jboss.osgi.common.service.XMLBindingService;
import org.jboss.osgi.spi.testing.OSGiBundle;
import org.jboss.osgi.spi.testing.OSGiRuntime;
@@ -43,10 +42,8 @@
import org.jboss.osgi.spi.testing.capability.JAXBCapability;
import org.jboss.osgi.spi.testing.capability.JMXCapability;
import org.jboss.osgi.spi.testing.capability.JNDICapability;
-import org.jboss.osgi.spi.testing.capability.MicrocontainerCapability;
import org.jboss.osgi.spi.testing.capability.XMLBindingCapability;
import org.jboss.osgi.spi.testing.capability.XMLParserCapability;
-import org.junit.Ignore;
import org.junit.Test;
import org.osgi.framework.BundleException;
@@ -166,25 +163,4 @@
runtime.shutdown();
}
}
-
- @Test
- @Ignore ("Fails with AS520 in hudson")
- public void testMicrocontainerCapability() throws Exception
- {
- OSGiRuntime runtime = getEmbeddedRuntime();
- try
- {
- OSGiBundle bundle = runtime.getBundle("jboss-osgi-microcontainer", null);
- assertNull("Test bundle null", bundle);
-
- runtime.addCapability(new MicrocontainerCapability());
-
- OSGiServiceReference saxRef = runtime.getServiceReference(MicrocontainerService.class.getName());
- assertNotNull("MicrocontainerService registered", saxRef);
- }
- finally
- {
- runtime.shutdown();
- }
- }
}
\ No newline at end of file
16 years, 6 months
JBoss-OSGI SVN: r89552 - in projects/jboss-osgi/trunk: runtime/felix/src/main/resources and 4 other directories.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-05-30 10:10:05 -0400 (Sat, 30 May 2009)
New Revision: 89552
Removed:
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/deployer/
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/service/jndi/
Modified:
projects/jboss-osgi/trunk/runtime/equinox/src/main/resources/osgi-deployers-jboss-beans.xml
projects/jboss-osgi/trunk/runtime/felix/src/main/resources/osgi-deployers-jboss-beans.xml
projects/jboss-osgi/trunk/runtime/knopflerfish/src/main/resources/osgi-deployers-jboss-beans.xml
projects/jboss-osgi/trunk/testsuite/pom.xml
Log:
Allign equinox, knopflerfish AS integration - WIP
Modified: projects/jboss-osgi/trunk/runtime/equinox/src/main/resources/osgi-deployers-jboss-beans.xml
===================================================================
--- projects/jboss-osgi/trunk/runtime/equinox/src/main/resources/osgi-deployers-jboss-beans.xml 2009-05-30 13:56:38 UTC (rev 89551)
+++ projects/jboss-osgi/trunk/runtime/equinox/src/main/resources/osgi-deployers-jboss-beans.xml 2009-05-30 14:10:05 UTC (rev 89552)
@@ -26,18 +26,31 @@
<entry>
<key>org.osgi.framework.system.packages</key>
<value>
+ <!-- system -->
javax.management,
javax.xml.parsers,
- org.jboss.logging,
+ org.xml.sax
+
+ <!-- jboss -->
+ org.jboss.osgi.common.service;version=1.0,
+ org.jboss.osgi.jbossas.integration,
org.jboss.osgi.spi;version=1.0,
org.jboss.osgi.spi.logging;version=1.0,
org.jboss.osgi.spi.management;version=1.0,
org.jboss.osgi.spi.testing;version=1.0,
org.jboss.osgi.spi.testing.capability;version=1.0,
- org.osgi.framework; version=1.4,
- org.osgi.service.packageadmin; version=1.2,
- org.osgi.service.startlevel; version=1.1,
- org.xml.sax
+ org.jboss.xb.binding;version=2.0,
+ org.jboss.xb.binding.sunday.unmarshalling;version=2.0,
+
+ <!-- compendium -->
+ org.osgi.service.event;version=1.1,
+ org.osgi.service.http;version=1.2,
+ org.osgi.service.log;version=1.3,
+
+ <!-- core -->
+ org.osgi.framework;version=1.4,
+ org.osgi.service.packageadmin;version=1.2,
+ org.osgi.service.startlevel;version=1.1,
</value>
</entry>
<!--
@@ -74,20 +87,26 @@
********************************
-->
- <!-- A Service that gives access to the Microcontainer -->
- <bean name="jboss.osgi:service=Microcontainer" class="org.jboss.osgi.microcontainer.internal.MicrocontainerServiceBean">
+ <!-- Common Services -->
+ <bean name="jboss.osgi:service=Common" class="org.jboss.osgi.jbossas.integration.CommonServicesBean">
<property name="systemContext"><inject bean="jboss.osgi:service=Framework" property="bundleContext"/></property>
<property name="mbeanServer"><inject bean="JMXKernel" property="mbeanServer"/></property>
+ </bean>
+
+ <!-- Microcontainer Service -->
+ <bean name="jboss.osgi:service=Microcontainer" class="org.jboss.osgi.jbossas.integration.MicrocontainerServiceBean">
+ <property name="systemContext"><inject bean="jboss.osgi:service=Framework" property="bundleContext"/></property>
+ <property name="mbeanServer"><inject bean="JMXKernel" property="mbeanServer"/></property>
<property name="kernel"><inject bean="jboss.kernel:service=Kernel" /></property>
</bean>
- <!-- A Service that gives access to JNDI -->
- <bean name="jboss.osgi:service=Naming" class="org.jboss.osgi.jndi.internal.NamingServiceBean">
+ <!-- Naming Service -->
+ <bean name="jboss.osgi:service=Naming" class="org.jboss.osgi.jbossas.integration.NamingServiceBean">
<property name="systemContext"><inject bean="jboss.osgi:service=Framework" property="bundleContext"/></property>
</bean>
- <!-- A Service that gives access to the MBeanServer -->
- <bean name="jboss.osgi:service=Management" class="org.jboss.osgi.jmx.internal.ManagementServiceBean">
+ <!-- Management Service -->
+ <bean name="jboss.osgi:service=Management" class="org.jboss.osgi.jbossas.integration.ManagementServiceBean">
<property name="systemContext"><inject bean="jboss.osgi:service=Framework" property="bundleContext"/></property>
<property name="mbeanServer"><inject bean="JMXKernel" property="mbeanServer"/></property>
</bean>
Modified: projects/jboss-osgi/trunk/runtime/felix/src/main/resources/osgi-deployers-jboss-beans.xml
===================================================================
--- projects/jboss-osgi/trunk/runtime/felix/src/main/resources/osgi-deployers-jboss-beans.xml 2009-05-30 13:56:38 UTC (rev 89551)
+++ projects/jboss-osgi/trunk/runtime/felix/src/main/resources/osgi-deployers-jboss-beans.xml 2009-05-30 14:10:05 UTC (rev 89552)
@@ -25,8 +25,11 @@
<entry>
<key>org.osgi.framework.system.packages.extra</key>
<value>
+ <!-- system -->
org.apache.xerces.dom,
org.jboss.logging,
+
+ <!-- jboss -->
org.jboss.osgi.common.service;version=1.0,
org.jboss.osgi.jbossas.integration,
org.jboss.osgi.spi;version=1.0,
@@ -36,6 +39,8 @@
org.jboss.osgi.spi.testing.capability;version=1.0,
org.jboss.xb.binding;version=2.0,
org.jboss.xb.binding.sunday.unmarshalling;version=2.0,
+
+ <!-- compendium -->
org.osgi.service.event;version=1.1,
org.osgi.service.http;version=1.2,
org.osgi.service.log;version=1.3,
Modified: projects/jboss-osgi/trunk/runtime/knopflerfish/src/main/resources/osgi-deployers-jboss-beans.xml
===================================================================
--- projects/jboss-osgi/trunk/runtime/knopflerfish/src/main/resources/osgi-deployers-jboss-beans.xml 2009-05-30 13:56:38 UTC (rev 89551)
+++ projects/jboss-osgi/trunk/runtime/knopflerfish/src/main/resources/osgi-deployers-jboss-beans.xml 2009-05-30 14:10:05 UTC (rev 89552)
@@ -25,18 +25,31 @@
<entry>
<key>org.osgi.framework.system.packages</key>
<value>
+ <!-- system -->
javax.management,
javax.xml.parsers,
- org.jboss.logging,
+ org.xml.sax
+
+ <!-- jboss -->
+ org.jboss.osgi.common.service;version=1.0,
+ org.jboss.osgi.jbossas.integration,
org.jboss.osgi.spi;version=1.0,
org.jboss.osgi.spi.logging;version=1.0,
org.jboss.osgi.spi.management;version=1.0,
org.jboss.osgi.spi.testing;version=1.0,
org.jboss.osgi.spi.testing.capability;version=1.0,
- org.osgi.framework; version=1.4,
- org.osgi.service.packageadmin; version=1.2,
- org.osgi.service.startlevel; version=1.1,
- org.xml.sax
+ org.jboss.xb.binding;version=2.0,
+ org.jboss.xb.binding.sunday.unmarshalling;version=2.0,
+
+ <!-- compendium -->
+ org.osgi.service.event;version=1.1,
+ org.osgi.service.http;version=1.2,
+ org.osgi.service.log;version=1.3,
+
+ <!-- core -->
+ org.osgi.framework;version=1.4,
+ org.osgi.service.packageadmin;version=1.2,
+ org.osgi.service.startlevel;version=1.1,
</value>
</entry>
<!--
@@ -73,20 +86,26 @@
********************************
-->
- <!-- A Service that gives access to the Microcontainer -->
- <bean name="jboss.osgi:service=Microcontainer" class="org.jboss.osgi.microcontainer.internal.MicrocontainerServiceBean">
+ <!-- Common Services -->
+ <bean name="jboss.osgi:service=Common" class="org.jboss.osgi.jbossas.integration.CommonServicesBean">
<property name="systemContext"><inject bean="jboss.osgi:service=Framework" property="bundleContext"/></property>
<property name="mbeanServer"><inject bean="JMXKernel" property="mbeanServer"/></property>
+ </bean>
+
+ <!-- Microcontainer Service -->
+ <bean name="jboss.osgi:service=Microcontainer" class="org.jboss.osgi.jbossas.integration.MicrocontainerServiceBean">
+ <property name="systemContext"><inject bean="jboss.osgi:service=Framework" property="bundleContext"/></property>
+ <property name="mbeanServer"><inject bean="JMXKernel" property="mbeanServer"/></property>
<property name="kernel"><inject bean="jboss.kernel:service=Kernel" /></property>
</bean>
- <!-- A Service that gives access to JNDI -->
- <bean name="jboss.osgi:service=Naming" class="org.jboss.osgi.jndi.internal.NamingServiceBean">
+ <!-- Naming Service -->
+ <bean name="jboss.osgi:service=Naming" class="org.jboss.osgi.jbossas.integration.NamingServiceBean">
<property name="systemContext"><inject bean="jboss.osgi:service=Framework" property="bundleContext"/></property>
</bean>
- <!-- A Service that gives access to the MBeanServer -->
- <bean name="jboss.osgi:service=Management" class="org.jboss.osgi.jmx.internal.ManagementServiceBean">
+ <!-- Management Service -->
+ <bean name="jboss.osgi:service=Management" class="org.jboss.osgi.jbossas.integration.ManagementServiceBean">
<property name="systemContext"><inject bean="jboss.osgi:service=Framework" property="bundleContext"/></property>
<property name="mbeanServer"><inject bean="JMXKernel" property="mbeanServer"/></property>
</bean>
Modified: projects/jboss-osgi/trunk/testsuite/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/testsuite/pom.xml 2009-05-30 13:56:38 UTC (rev 89551)
+++ projects/jboss-osgi/trunk/testsuite/pom.xml 2009-05-30 14:10:05 UTC (rev 89552)
@@ -276,8 +276,6 @@
<excludes>
<!-- Exclude tests that require jboss access -->
<exclude>org/jboss/test/osgi/jbossas/**</exclude>
- <!-- Temporarily disable remote log against runtime (fails in hudson) -->
- <exclude>org/jboss/test/osgi/example/log/LogServiceTestCase.java</exclude>
</excludes>
</configuration>
</plugin>
16 years, 6 months
JBoss-OSGI SVN: r89551 - projects/jboss-osgi/trunk/testsuite/example/src/test/resources.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-05-30 09:56:38 -0400 (Sat, 30 May 2009)
New Revision: 89551
Modified:
projects/jboss-osgi/trunk/testsuite/example/src/test/resources/jboss-osgi-felix.properties
Log:
Add org.jboss.osgi.common.log;version=1.0 to system
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-05-30 13:49:39 UTC (rev 89550)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/resources/jboss-osgi-felix.properties 2009-05-30 13:56:38 UTC (rev 89551)
@@ -18,6 +18,7 @@
org.osgi.framework.system.packages.extra=\
org.jboss.logging, \
org.jboss.net.protocol, \
+ org.jboss.osgi.common.log;version=1.0, \
org.jboss.osgi.spi;version=1.0, \
org.jboss.osgi.spi.logging;version=1.0, \
org.jboss.osgi.spi.management;version=1.0, \
16 years, 6 months
JBoss-OSGI SVN: r89550 - in projects/jboss-osgi/trunk: runtime/felix/src/main/resources and 1 other directories.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-05-30 09:49:39 -0400 (Sat, 30 May 2009)
New Revision: 89550
Modified:
projects/jboss-osgi/trunk/distribution/src/main/resources/installer/install-definition.xml
projects/jboss-osgi/trunk/runtime/felix/src/main/resources/osgi-deployers-jboss-beans.xml
projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/log/LogServiceTestCase.java
Log:
More on AS integration - WIP
Modified: projects/jboss-osgi/trunk/distribution/src/main/resources/installer/install-definition.xml
===================================================================
--- projects/jboss-osgi/trunk/distribution/src/main/resources/installer/install-definition.xml 2009-05-30 13:22:11 UTC (rev 89549)
+++ projects/jboss-osgi/trunk/distribution/src/main/resources/installer/install-definition.xml 2009-05-30 13:49:39 UTC (rev 89550)
@@ -293,12 +293,12 @@
<fileset condition="isFelix" dir="@{deploy.artifacts.dir}/lib" targetdir="${jbossInstallPath}/server/${jbossTargetServer}/deployers/osgi.deployer" override="true">
<include name="jboss-osgi-runtime-felix.jar" />
<include name="org.apache.felix.framework.jar" />
+ <include name="org.osgi.compendium.jar" />
</fileset>
<fileset condition="isFelix" dir="@{deploy.artifacts.dir}/resources/jboss-osgi-runtime-felix" targetdir="${jbossInstallPath}/server/${jbossTargetServer}/deployers/osgi.deployer/META-INF" override="true">
<include name="osgi-deployers-jboss-beans.xml" />
</fileset>
<fileset condition="isFelix" dir="@{deploy.artifacts.dir}/lib" targetdir="${jbossInstallPath}/server/${jbossTargetServer}/deploy/osgi" override="true">
- <include name="org.osgi.compendium.jar" />
</fileset>
<!-- Equinox Integration -->
@@ -307,12 +307,12 @@
<include name="jboss-osgi-runtime-equinox.jar" />
<include name="org.apache.equinox.framework.jar" />
<include name="org.eclipse.osgi.jar"/>
+ <include name="org.eclipse.osgi.services.jar" />
</fileset>
<fileset condition="isEquinox" dir="@{deploy.artifacts.dir}/resources/jboss-osgi-runtime-equinox" targetdir="${jbossInstallPath}/server/${jbossTargetServer}/deployers/osgi.deployer/META-INF" override="true">
<include name="osgi-deployers-jboss-beans.xml" />
</fileset>
<fileset condition="isEquinox" dir="@{deploy.artifacts.dir}/lib" targetdir="${jbossInstallPath}/server/${jbossTargetServer}/deploy/osgi" override="true">
- <include name="org.eclipse.osgi.services.jar" />
</fileset>
<!-- Knopflerfish Integration -->
@@ -320,12 +320,12 @@
<fileset condition="isKnopflerfish" dir="@{deploy.artifacts.dir}/lib" targetdir="${jbossInstallPath}/server/${jbossTargetServer}/deployers/osgi.deployer" override="true">
<include name="jboss-osgi-runtime-knopflerfish.jar" />
<include name="org.knopflerfish.framework.jar" />
+ <include name="org.osgi.compendium.jar" />
</fileset>
<fileset condition="isKnopflerfish" dir="@{deploy.artifacts.dir}/resources/jboss-osgi-runtime-knopflerfish" targetdir="${jbossInstallPath}/server/${jbossTargetServer}/deployers/osgi.deployer/META-INF" override="true">
<include name="osgi-deployers-jboss-beans.xml" />
</fileset>
<fileset condition="isKnopflerfish" dir="@{deploy.artifacts.dir}/lib" targetdir="${jbossInstallPath}/server/${jbossTargetServer}/deploy/osgi" override="true">
- <include name="org.osgi.compendium.jar" />
</fileset>
</pack>
Modified: projects/jboss-osgi/trunk/runtime/felix/src/main/resources/osgi-deployers-jboss-beans.xml
===================================================================
--- projects/jboss-osgi/trunk/runtime/felix/src/main/resources/osgi-deployers-jboss-beans.xml 2009-05-30 13:22:11 UTC (rev 89549)
+++ projects/jboss-osgi/trunk/runtime/felix/src/main/resources/osgi-deployers-jboss-beans.xml 2009-05-30 13:49:39 UTC (rev 89550)
@@ -27,7 +27,7 @@
<value>
org.apache.xerces.dom,
org.jboss.logging,
- org.jboss.osgi.common.service,
+ org.jboss.osgi.common.service;version=1.0,
org.jboss.osgi.jbossas.integration,
org.jboss.osgi.spi;version=1.0,
org.jboss.osgi.spi.logging;version=1.0,
@@ -36,6 +36,9 @@
org.jboss.osgi.spi.testing.capability;version=1.0,
org.jboss.xb.binding;version=2.0,
org.jboss.xb.binding.sunday.unmarshalling;version=2.0,
+ org.osgi.service.event;version=1.1,
+ org.osgi.service.http;version=1.2,
+ org.osgi.service.log;version=1.3,
<!-- needed by jboss-remoting -->
org.apache.log4j,
@@ -63,12 +66,16 @@
<entry><key>org.jboss.osgi.husky.runtime.connector.port</key><value>5401</value></entry>
</map>
</property>
- <property name="autoStart">
+ <property name="autoInstall">
<list elementClass="java.net.URL">
<value>${jboss.server.home.url}/deploy/osgi/org.osgi.compendium.jar</value>
- <value>${jboss.server.home.url}/deploy/osgi/jboss-osgi-common.jar</value>
</list>
</property>
+ <property name="autoStart">
+ <list elementClass="java.net.URL">
+ <value>${jboss.server.home.url}/deploy/osgi/org.apache.felix.log.jar</value>
+ </list>
+ </property>
</bean>
<!-- The Framework Management -->
Modified: projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/log/LogServiceTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/log/LogServiceTestCase.java 2009-05-30 13:22:11 UTC (rev 89549)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/log/LogServiceTestCase.java 2009-05-30 13:49:39 UTC (rev 89550)
@@ -59,7 +59,6 @@
runtime.startLogEntryTracking(logEntryCache);
}
-
@AfterClass
public static void tearDownClass() throws Exception
{
16 years, 6 months
JBoss-OSGI SVN: r89549 - in projects/jboss-osgi/trunk: bundles/jmx/src/main/java/org/jboss/osgi/jmx/internal and 4 other directories.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-05-30 09:22:11 -0400 (Sat, 30 May 2009)
New Revision: 89549
Added:
projects/jboss-osgi/trunk/bundles/common/src/main/java/org/jboss/osgi/common/internal/AbstractCommonServicesActivator.java
projects/jboss-osgi/trunk/bundles/common/src/main/java/org/jboss/osgi/common/internal/SystemDeployerService.java
projects/jboss-osgi/trunk/integration/jbossas/src/main/java/org/jboss/osgi/jbossas/integration/CommonServicesBean.java
Removed:
projects/jboss-osgi/trunk/bundles/common/src/main/java/org/jboss/osgi/common/internal/SimpleDeployerService.java
projects/jboss-osgi/trunk/integration/jbossas/src/main/java/org/jboss/osgi/jmx/
projects/jboss-osgi/trunk/integration/jbossas/src/main/java/org/jboss/osgi/jndi/
projects/jboss-osgi/trunk/integration/jbossas/src/main/java/org/jboss/osgi/microcontainer/
Modified:
projects/jboss-osgi/trunk/bundles/common/src/main/java/org/jboss/osgi/common/internal/CommonServicesActivator.java
projects/jboss-osgi/trunk/bundles/jmx/src/main/java/org/jboss/osgi/jmx/internal/JMXConnectorService.java
projects/jboss-osgi/trunk/distribution/src/main/resources/installer/install-definition.xml
projects/jboss-osgi/trunk/runtime/felix/src/main/resources/osgi-deployers-jboss-beans.xml
Log:
Implement CommonServiceBean for jbossas
Added: projects/jboss-osgi/trunk/bundles/common/src/main/java/org/jboss/osgi/common/internal/AbstractCommonServicesActivator.java
===================================================================
--- projects/jboss-osgi/trunk/bundles/common/src/main/java/org/jboss/osgi/common/internal/AbstractCommonServicesActivator.java (rev 0)
+++ projects/jboss-osgi/trunk/bundles/common/src/main/java/org/jboss/osgi/common/internal/AbstractCommonServicesActivator.java 2009-05-30 13:22:11 UTC (rev 89549)
@@ -0,0 +1,104 @@
+/*
+ * 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.common.internal;
+
+//$Id$
+
+import java.util.Properties;
+
+import javax.management.JMException;
+import javax.management.MBeanServer;
+import javax.management.StandardMBean;
+
+import org.jboss.osgi.common.service.DeployerService;
+import org.jboss.osgi.common.service.DeployerServiceDelegate;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceReference;
+import org.osgi.service.log.LogReaderService;
+import org.osgi.util.tracker.ServiceTracker;
+
+
+/**
+ * The common services activator
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 23-Jan-2009
+ */
+public abstract class AbstractCommonServicesActivator
+{
+ protected void trackLogReaderService(BundleContext context)
+ {
+ ServiceTracker logTracker = new ServiceTracker(context, LogReaderService.class.getName(), null)
+ {
+ @Override
+ public Object addingService(ServiceReference reference)
+ {
+ LogReaderService logReader = (LogReaderService)super.addingService(reference);
+ logReader.addLogListener(new LoggingLogListener());
+ return logReader;
+ }
+ };
+ logTracker.open();
+ }
+
+ protected DeployerServiceDelegate registerDeployerServices(BundleContext context)
+ {
+ // Register the SystemDeployerService
+ Properties props = new Properties();
+ props.setProperty("provider", "system");
+ SystemDeployerService service = new SystemDeployerService(context);
+ context.registerService(DeployerService.class.getName(), service, props);
+
+ // Register the DeployerServiceDelegate
+ DeployerServiceDelegate delegate = new DeployerServiceDelegate(context);
+ context.registerService(DeployerServiceDelegate.class.getName(), delegate, null);
+ return delegate;
+ }
+
+ protected void registerDeployerServiceMBean(MBeanServer mbeanServer, DeployerServiceDelegate delegate)
+ {
+ try
+ {
+ StandardMBean mbean = new StandardMBean(delegate, DeployerService.class);
+ mbeanServer.registerMBean(mbean, DeployerService.MBEAN_DEPLOYER_SERVICE);
+ }
+ catch (JMException ex)
+ {
+ throw new IllegalStateException("Cannot register DeployerService MBean", ex);
+ }
+ }
+
+ protected void unregisterDeployerServiceMBean(MBeanServer mbeanServer)
+ {
+ try
+ {
+ if (mbeanServer.isRegistered(DeployerService.MBEAN_DEPLOYER_SERVICE))
+ mbeanServer.unregisterMBean(DeployerService.MBEAN_DEPLOYER_SERVICE);
+ }
+ catch (JMException ex)
+ {
+ logError("Cannot unregister DeployerService MBean", ex);
+ }
+ }
+
+ protected abstract void logError(String message, Exception ex);
+}
\ No newline at end of file
Property changes on: projects/jboss-osgi/trunk/bundles/common/src/main/java/org/jboss/osgi/common/internal/AbstractCommonServicesActivator.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: projects/jboss-osgi/trunk/bundles/common/src/main/java/org/jboss/osgi/common/internal/CommonServicesActivator.java
===================================================================
--- projects/jboss-osgi/trunk/bundles/common/src/main/java/org/jboss/osgi/common/internal/CommonServicesActivator.java 2009-05-30 12:14:08 UTC (rev 89548)
+++ projects/jboss-osgi/trunk/bundles/common/src/main/java/org/jboss/osgi/common/internal/CommonServicesActivator.java 2009-05-30 13:22:11 UTC (rev 89549)
@@ -23,19 +23,14 @@
//$Id$
-import java.util.Properties;
-import javax.management.JMException;
import javax.management.MBeanServer;
-import javax.management.StandardMBean;
import org.jboss.osgi.common.log.LogServiceTracker;
-import org.jboss.osgi.common.service.DeployerService;
import org.jboss.osgi.common.service.DeployerServiceDelegate;
import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceReference;
-import org.osgi.service.log.LogReaderService;
import org.osgi.service.log.LogService;
import org.osgi.util.tracker.ServiceTracker;
@@ -45,10 +40,16 @@
* @author thomas.diesler(a)jboss.com
* @since 23-Jan-2009
*/
-public class CommonServicesActivator implements BundleActivator
+public class CommonServicesActivator extends AbstractCommonServicesActivator implements BundleActivator
{
private LogService log;
+ @Override
+ protected void logError(String message, Exception ex)
+ {
+ log.log(LogService.LOG_ERROR, message, ex);
+ }
+
public void start(BundleContext context)
{
log = new LogServiceTracker(context);
@@ -56,16 +57,9 @@
// Track LogReaderService and add/remove LogListener
trackLogReaderService(context);
- // Register the system DeployerService
- Properties props = new Properties();
- props.setProperty("provider", "system");
- SimpleDeployerService service = new SimpleDeployerService(context);
- context.registerService(DeployerService.class.getName(), service, props);
+ // Register the system SystemDeployerService and DeployerServiceDelegate
+ DeployerServiceDelegate delegate = registerDeployerServices(context);
- // Register the DeployerServiceDelegate
- DeployerServiceDelegate delegate = new DeployerServiceDelegate(context);
- context.registerService(DeployerServiceDelegate.class.getName(), delegate, null);
-
// Track the MBeanServer and register the DeployerServiceDelegate
trackMBeanServer(context, delegate);
}
@@ -78,15 +72,7 @@
public Object addingService(ServiceReference reference)
{
MBeanServer mbeanServer = (MBeanServer)super.addingService(reference);
- try
- {
- StandardMBean mbean = new StandardMBean(delegate, DeployerService.class);
- mbeanServer.registerMBean(mbean, DeployerService.MBEAN_DEPLOYER_SERVICE);
- }
- catch (JMException ex)
- {
- log.log(LogService.LOG_ERROR, "Cannot register DeployerService MBean", ex);
- }
+ registerDeployerServiceMBean(mbeanServer, delegate);
return mbeanServer;
}
@@ -94,39 +80,20 @@
public void removedService(ServiceReference reference, Object service)
{
MBeanServer mbeanServer = (MBeanServer)service;
- try
- {
- if (mbeanServer.isRegistered(DeployerService.MBEAN_DEPLOYER_SERVICE))
- mbeanServer.unregisterMBean(DeployerService.MBEAN_DEPLOYER_SERVICE);
- }
- catch (JMException ex)
- {
- log.log(LogService.LOG_ERROR, "Cannot unregister DeployerService MBean", ex);
- }
-
+ unregisterDeployerServiceMBean(mbeanServer);
super.removedService(reference, service);
}
};
jmxTracker.open();
}
- private void trackLogReaderService(BundleContext context)
+ public void stop(BundleContext context)
{
- ServiceTracker logTracker = new ServiceTracker(context, LogReaderService.class.getName(), null)
+ ServiceReference sref = context.getServiceReference(MBeanServer.class.getName());
+ if (sref != null)
{
- @Override
- public Object addingService(ServiceReference reference)
- {
- LogReaderService logReader = (LogReaderService)super.addingService(reference);
- logReader.addLogListener(new LoggingLogListener());
- return logReader;
- }
- };
- logTracker.open();
+ MBeanServer mbeanServer = (MBeanServer)context.getService(sref);
+ unregisterDeployerServiceMBean(mbeanServer);
+ }
}
-
- public void stop(BundleContext context)
- {
- // NOTE: The service is automatically unregistered.
- }
}
\ No newline at end of file
Deleted: projects/jboss-osgi/trunk/bundles/common/src/main/java/org/jboss/osgi/common/internal/SimpleDeployerService.java
===================================================================
--- projects/jboss-osgi/trunk/bundles/common/src/main/java/org/jboss/osgi/common/internal/SimpleDeployerService.java 2009-05-30 12:14:08 UTC (rev 89548)
+++ projects/jboss-osgi/trunk/bundles/common/src/main/java/org/jboss/osgi/common/internal/SimpleDeployerService.java 2009-05-30 13:22:11 UTC (rev 89549)
@@ -1,159 +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.common.internal;
-
-//$Id$
-
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.jboss.osgi.common.log.LogServiceTracker;
-import org.jboss.osgi.common.service.BundleInfo;
-import org.jboss.osgi.common.service.DeployerService;
-import org.jboss.osgi.common.service.ManagedBundleService;
-import org.osgi.framework.Bundle;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.BundleException;
-import org.osgi.framework.ServiceReference;
-import org.osgi.service.log.LogService;
-
-/**
- * A {@link DeployerService} that installs/uninstalls the bundles directly on the OSGi framework without going through the MC registered deployers.
- *
- * @author thomas.diesler(a)jboss.com
- * @since 27-May-2009
- */
-public class SimpleDeployerService implements DeployerService
-{
- private LogServiceTracker log;
- private BundleContext context;
-
- private Map<String, Bundle> deployments = new HashMap<String, Bundle>();
-
- public SimpleDeployerService(BundleContext context)
- {
- this.log = new LogServiceTracker(context);
- this.context = context;
- }
-
- public void deploy(BundleInfo[] bundleInfos) throws BundleException
- {
- // Install the NEW bundles
- List<Bundle> bundles = new ArrayList<Bundle>();
- for (BundleInfo info : bundleInfos)
- {
- try
- {
- String location = info.getLocation().toExternalForm();
- Bundle bundle = context.installBundle(location);
- log.log(LogService.LOG_INFO, "Installed: " + bundle);
-
- deployments.put(location, bundle);
- registerManagedBundle(bundle);
- bundles.add(bundle);
- }
- catch (BundleException ex)
- {
- log.log(LogService.LOG_ERROR, "Cannot install bundle: " + info, ex);
- }
- }
-
- // Start the installed bundles
- for (Bundle bundle : bundles)
- {
- try
- {
- log.log(LogService.LOG_DEBUG, "Start: " + bundle);
- bundle.start();
- }
- catch (BundleException ex)
- {
- log.log(LogService.LOG_ERROR, "Cannot start bundle: " + bundle, ex);
- }
- }
- }
-
- public void undeploy(BundleInfo[] bundleInfos) throws BundleException
- {
- for (BundleInfo info : bundleInfos)
- undeploy(info.getLocation());
- }
-
- // Note, in contrary to deploy(BundleInfo[]) this
- // method does not start the bundle. The client
- // is expected to do that
- public void deploy(URL url) throws BundleException
- {
- Bundle bundle = context.installBundle(url.toExternalForm());
- log.log(LogService.LOG_INFO, "Installed: " + bundle);
- deployments.put(url.toExternalForm(), bundle);
- registerManagedBundle(bundle);
- }
-
- public boolean undeploy(URL url) throws BundleException
- {
- Bundle bundle = deployments.remove(url.toExternalForm());
- if (bundle != null)
- {
- unregisterManagedBundle(bundle);
- bundle.uninstall();
- log.log(LogService.LOG_INFO, "Uninstalled: " + bundle);
- return true;
- }
- else
- {
- log.log(LogService.LOG_WARNING, "Cannot find bundle for: " + url);
- return false;
- }
- }
-
- private void registerManagedBundle(Bundle bundle)
- {
- ServiceReference sref = context.getServiceReference(ManagedBundleService.class.getName());
- if (sref != null)
- {
- ManagedBundleService service = (ManagedBundleService)context.getService(sref);
- service.register(bundle);
- }
- else
- {
- log.log(LogService.LOG_DEBUG, "No ManagedBundleService. Cannot register managed bundle: " + bundle);
- }
- }
-
- private void unregisterManagedBundle(Bundle bundle)
- {
- ServiceReference sref = context.getServiceReference(ManagedBundleService.class.getName());
- if (sref != null)
- {
- ManagedBundleService service = (ManagedBundleService)context.getService(sref);
- service.unregister(bundle);
- }
- else
- {
- log.log(LogService.LOG_DEBUG, "No ManagedBundleService. Cannot unregister managed bundle: " + bundle);
- }
- }
-}
\ No newline at end of file
Copied: projects/jboss-osgi/trunk/bundles/common/src/main/java/org/jboss/osgi/common/internal/SystemDeployerService.java (from rev 89545, projects/jboss-osgi/trunk/bundles/common/src/main/java/org/jboss/osgi/common/internal/SimpleDeployerService.java)
===================================================================
--- projects/jboss-osgi/trunk/bundles/common/src/main/java/org/jboss/osgi/common/internal/SystemDeployerService.java (rev 0)
+++ projects/jboss-osgi/trunk/bundles/common/src/main/java/org/jboss/osgi/common/internal/SystemDeployerService.java 2009-05-30 13:22:11 UTC (rev 89549)
@@ -0,0 +1,159 @@
+/*
+ * 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.common.internal;
+
+//$Id$
+
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.jboss.osgi.common.log.LogServiceTracker;
+import org.jboss.osgi.common.service.BundleInfo;
+import org.jboss.osgi.common.service.DeployerService;
+import org.jboss.osgi.common.service.ManagedBundleService;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.BundleException;
+import org.osgi.framework.ServiceReference;
+import org.osgi.service.log.LogService;
+
+/**
+ * A {@link DeployerService} that installs/uninstalls the bundles directly on the OSGi framework without going through the MC registered deployers.
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 27-May-2009
+ */
+public class SystemDeployerService implements DeployerService
+{
+ private LogServiceTracker log;
+ private BundleContext context;
+
+ private Map<String, Bundle> deployments = new HashMap<String, Bundle>();
+
+ public SystemDeployerService(BundleContext context)
+ {
+ this.log = new LogServiceTracker(context);
+ this.context = context;
+ }
+
+ public void deploy(BundleInfo[] bundleInfos) throws BundleException
+ {
+ // Install the NEW bundles
+ List<Bundle> bundles = new ArrayList<Bundle>();
+ for (BundleInfo info : bundleInfos)
+ {
+ try
+ {
+ String location = info.getLocation().toExternalForm();
+ Bundle bundle = context.installBundle(location);
+ log.log(LogService.LOG_INFO, "Installed: " + bundle);
+
+ deployments.put(location, bundle);
+ registerManagedBundle(bundle);
+ bundles.add(bundle);
+ }
+ catch (BundleException ex)
+ {
+ log.log(LogService.LOG_ERROR, "Cannot install bundle: " + info, ex);
+ }
+ }
+
+ // Start the installed bundles
+ for (Bundle bundle : bundles)
+ {
+ try
+ {
+ log.log(LogService.LOG_DEBUG, "Start: " + bundle);
+ bundle.start();
+ }
+ catch (BundleException ex)
+ {
+ log.log(LogService.LOG_ERROR, "Cannot start bundle: " + bundle, ex);
+ }
+ }
+ }
+
+ public void undeploy(BundleInfo[] bundleInfos) throws BundleException
+ {
+ for (BundleInfo info : bundleInfos)
+ undeploy(info.getLocation());
+ }
+
+ // Note, in contrary to deploy(BundleInfo[]) this
+ // method does not start the bundle. The client
+ // is expected to do that
+ public void deploy(URL url) throws BundleException
+ {
+ Bundle bundle = context.installBundle(url.toExternalForm());
+ log.log(LogService.LOG_INFO, "Installed: " + bundle);
+ deployments.put(url.toExternalForm(), bundle);
+ registerManagedBundle(bundle);
+ }
+
+ public boolean undeploy(URL url) throws BundleException
+ {
+ Bundle bundle = deployments.remove(url.toExternalForm());
+ if (bundle != null)
+ {
+ unregisterManagedBundle(bundle);
+ bundle.uninstall();
+ log.log(LogService.LOG_INFO, "Uninstalled: " + bundle);
+ return true;
+ }
+ else
+ {
+ log.log(LogService.LOG_WARNING, "Cannot find bundle for: " + url);
+ return false;
+ }
+ }
+
+ private void registerManagedBundle(Bundle bundle)
+ {
+ ServiceReference sref = context.getServiceReference(ManagedBundleService.class.getName());
+ if (sref != null)
+ {
+ ManagedBundleService service = (ManagedBundleService)context.getService(sref);
+ service.register(bundle);
+ }
+ else
+ {
+ log.log(LogService.LOG_DEBUG, "No ManagedBundleService. Cannot register managed bundle: " + bundle);
+ }
+ }
+
+ private void unregisterManagedBundle(Bundle bundle)
+ {
+ ServiceReference sref = context.getServiceReference(ManagedBundleService.class.getName());
+ if (sref != null)
+ {
+ ManagedBundleService service = (ManagedBundleService)context.getService(sref);
+ service.unregister(bundle);
+ }
+ else
+ {
+ log.log(LogService.LOG_DEBUG, "No ManagedBundleService. Cannot unregister managed bundle: " + bundle);
+ }
+ }
+}
\ No newline at end of file
Modified: projects/jboss-osgi/trunk/bundles/jmx/src/main/java/org/jboss/osgi/jmx/internal/JMXConnectorService.java
===================================================================
--- projects/jboss-osgi/trunk/bundles/jmx/src/main/java/org/jboss/osgi/jmx/internal/JMXConnectorService.java 2009-05-30 12:14:08 UTC (rev 89548)
+++ projects/jboss-osgi/trunk/bundles/jmx/src/main/java/org/jboss/osgi/jmx/internal/JMXConnectorService.java 2009-05-30 13:22:11 UTC (rev 89549)
@@ -88,7 +88,7 @@
}
catch (Exception ex)
{
- log.log(LogService.LOG_ERROR, "Cannot create JMXConnectorServer", ex);
+ throw new IllegalStateException("Cannot create JMXConnectorServer", ex);
}
}
@@ -99,9 +99,6 @@
public void start()
{
- if (jmxConnectorServer == null)
- throw new IllegalStateException("JMXConnectorServer not available");
-
ClassLoader ctxLoader = Thread.currentThread().getContextClassLoader();
try
{
Modified: projects/jboss-osgi/trunk/distribution/src/main/resources/installer/install-definition.xml
===================================================================
--- projects/jboss-osgi/trunk/distribution/src/main/resources/installer/install-definition.xml 2009-05-30 12:14:08 UTC (rev 89548)
+++ projects/jboss-osgi/trunk/distribution/src/main/resources/installer/install-definition.xml 2009-05-30 13:22:11 UTC (rev 89549)
@@ -285,7 +285,6 @@
<include name="org.apache.felix.http.jetty.jar" />
<include name="org.apache.felix.log.jar" />
<include name="org.apache.felix.metatype.jar" />
- <include name="jboss-osgi-common.jar" />
<include name="jboss-osgi-webconsole.jar" />
</fileset>
Added: projects/jboss-osgi/trunk/integration/jbossas/src/main/java/org/jboss/osgi/jbossas/integration/CommonServicesBean.java
===================================================================
--- projects/jboss-osgi/trunk/integration/jbossas/src/main/java/org/jboss/osgi/jbossas/integration/CommonServicesBean.java (rev 0)
+++ projects/jboss-osgi/trunk/integration/jbossas/src/main/java/org/jboss/osgi/jbossas/integration/CommonServicesBean.java 2009-05-30 13:22:11 UTC (rev 89549)
@@ -0,0 +1,79 @@
+/*
+ * 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.jbossas.integration;
+
+//$Id$
+
+import javax.management.MBeanServer;
+
+import org.jboss.logging.Logger;
+import org.jboss.osgi.common.internal.AbstractCommonServicesActivator;
+import org.jboss.osgi.common.service.DeployerServiceDelegate;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The common services activator
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 05-May-2009
+ */
+public class CommonServicesBean extends AbstractCommonServicesActivator
+{
+ private static Logger log = Logger.getLogger(CommonServicesBean.class);
+
+ private BundleContext context;
+ public MBeanServer mbeanServer;
+
+ public void setSystemContext(BundleContext context)
+ {
+ this.context = context;
+ }
+
+ public void setMbeanServer(MBeanServer mbeanServer)
+ {
+ this.mbeanServer = mbeanServer;
+ }
+
+ @Override
+ protected void logError(String message, Exception ex)
+ {
+ log.error(message, ex);
+ }
+
+ public void start()
+ {
+ // Track LogReaderService and add/remove LogListener
+ trackLogReaderService(context);
+
+ // Register the SystemDeployerService and DeployerServiceDelegate
+ DeployerServiceDelegate delegate = registerDeployerServices(context);
+
+ // Register the DeployerServiceDelegate as MBean
+ registerDeployerServiceMBean(mbeanServer, delegate);
+ }
+
+ public void stop()
+ {
+ // Unregister the DeployerServiceDelegate as MBean
+ unregisterDeployerServiceMBean(mbeanServer);
+ }
+}
\ No newline at end of file
Property changes on: projects/jboss-osgi/trunk/integration/jbossas/src/main/java/org/jboss/osgi/jbossas/integration/CommonServicesBean.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: projects/jboss-osgi/trunk/runtime/felix/src/main/resources/osgi-deployers-jboss-beans.xml
===================================================================
--- projects/jboss-osgi/trunk/runtime/felix/src/main/resources/osgi-deployers-jboss-beans.xml 2009-05-30 12:14:08 UTC (rev 89548)
+++ projects/jboss-osgi/trunk/runtime/felix/src/main/resources/osgi-deployers-jboss-beans.xml 2009-05-30 13:22:11 UTC (rev 89549)
@@ -27,9 +27,8 @@
<value>
org.apache.xerces.dom,
org.jboss.logging,
- org.jboss.osgi.jndi,
- org.jboss.osgi.jmx,
- org.jboss.osgi.microcontainer,
+ org.jboss.osgi.common.service,
+ org.jboss.osgi.jbossas.integration,
org.jboss.osgi.spi;version=1.0,
org.jboss.osgi.spi.logging;version=1.0,
org.jboss.osgi.spi.management;version=1.0,
@@ -86,19 +85,25 @@
********************************
-->
- <!-- A Service that gives access to the Microcontainer -->
+ <!-- Common Services -->
+ <bean name="jboss.osgi:service=Common" class="org.jboss.osgi.jbossas.integration.CommonServicesBean">
+ <property name="systemContext"><inject bean="jboss.osgi:service=Framework" property="bundleContext"/></property>
+ <property name="mbeanServer"><inject bean="JMXKernel" property="mbeanServer"/></property>
+ </bean>
+
+ <!-- Microcontainer Service -->
<bean name="jboss.osgi:service=Microcontainer" class="org.jboss.osgi.jbossas.integration.MicrocontainerServiceBean">
<property name="systemContext"><inject bean="jboss.osgi:service=Framework" property="bundleContext"/></property>
<property name="mbeanServer"><inject bean="JMXKernel" property="mbeanServer"/></property>
<property name="kernel"><inject bean="jboss.kernel:service=Kernel" /></property>
</bean>
- <!-- A Service that gives access to JNDI -->
+ <!-- Naming Service -->
<bean name="jboss.osgi:service=Naming" class="org.jboss.osgi.jbossas.integration.NamingServiceBean">
<property name="systemContext"><inject bean="jboss.osgi:service=Framework" property="bundleContext"/></property>
</bean>
- <!-- A Service that gives access to the MBeanServer -->
+ <!-- Management Service -->
<bean name="jboss.osgi:service=Management" class="org.jboss.osgi.jbossas.integration.ManagementServiceBean">
<property name="systemContext"><inject bean="jboss.osgi:service=Framework" property="bundleContext"/></property>
<property name="mbeanServer"><inject bean="JMXKernel" property="mbeanServer"/></property>
16 years, 6 months
JBoss-OSGI SVN: r89548 - projects/jboss-osgi/trunk/integration/jbossas/src/main/java/org/jboss/osgi/jbossas/integration.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-05-30 08:14:08 -0400 (Sat, 30 May 2009)
New Revision: 89548
Modified:
projects/jboss-osgi/trunk/integration/jbossas/src/main/java/org/jboss/osgi/jbossas/integration/MicrocontainerServiceBean.java
Log:
Fix typo org.jboss.logging.Logger
Modified: projects/jboss-osgi/trunk/integration/jbossas/src/main/java/org/jboss/osgi/jbossas/integration/MicrocontainerServiceBean.java
===================================================================
--- projects/jboss-osgi/trunk/integration/jbossas/src/main/java/org/jboss/osgi/jbossas/integration/MicrocontainerServiceBean.java 2009-05-30 12:08:13 UTC (rev 89547)
+++ projects/jboss-osgi/trunk/integration/jbossas/src/main/java/org/jboss/osgi/jbossas/integration/MicrocontainerServiceBean.java 2009-05-30 12:14:08 UTC (rev 89548)
@@ -27,9 +27,9 @@
import javax.management.MBeanServer;
-import org.apache.log4j.Logger;
import org.jboss.kernel.Kernel;
import org.jboss.kernel.spi.dependency.KernelController;
+import org.jboss.logging.Logger;
import org.jboss.osgi.common.service.DeployerService;
import org.jboss.osgi.common.service.MicrocontainerService;
import org.jboss.osgi.microcontainer.internal.AbstractMicrocontainerService;
16 years, 6 months
JBoss-OSGI SVN: r89547 - in projects/jboss-osgi/trunk: distribution/src/main/resources/installer and 2 other directories.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-05-30 08:08:13 -0400 (Sat, 30 May 2009)
New Revision: 89547
Modified:
projects/jboss-osgi/trunk/bundles/microcontainer/src/main/java/org/jboss/osgi/microcontainer/internal/AbstractMicrocontainerService.java
projects/jboss-osgi/trunk/bundles/microcontainer/src/main/java/org/jboss/osgi/microcontainer/internal/MicrocontainerServiceImpl.java
projects/jboss-osgi/trunk/distribution/src/main/resources/installer/install-definition.xml
projects/jboss-osgi/trunk/integration/jbossas/src/main/java/org/jboss/osgi/jbossas/integration/MicrocontainerServiceBean.java
projects/jboss-osgi/trunk/runtime/felix/src/main/resources/osgi-deployers-jboss-beans.xml
Log:
Prevent cannot find symbol symbol: constructor StandardMBean
Modified: projects/jboss-osgi/trunk/bundles/microcontainer/src/main/java/org/jboss/osgi/microcontainer/internal/AbstractMicrocontainerService.java
===================================================================
--- projects/jboss-osgi/trunk/bundles/microcontainer/src/main/java/org/jboss/osgi/microcontainer/internal/AbstractMicrocontainerService.java 2009-05-30 11:53:38 UTC (rev 89546)
+++ projects/jboss-osgi/trunk/bundles/microcontainer/src/main/java/org/jboss/osgi/microcontainer/internal/AbstractMicrocontainerService.java 2009-05-30 12:08:13 UTC (rev 89547)
@@ -62,7 +62,7 @@
* @author thomas.diesler(a)jboss.com
* @since 23-Jan-2009
*/
-public abstract class AbstractMicrocontainerService implements DeployerService, MicrocontainerService
+public abstract class AbstractMicrocontainerService implements DeployerService, MicrocontainerService, MicrocontainerServiceMBean
{
private VFSDeploymentFactory deploymentFactory = VFSDeploymentFactory.getInstance();
private Map<URL, String> contextMap = Collections.synchronizedMap(new HashMap<URL, String>());
@@ -221,8 +221,8 @@
try
{
logDebug("Register MicrocontainerServiceMBean");
- StandardMBean mbean = new StandardMBean(this, MicrocontainerServiceMBean.class);
- mbeanServer.registerMBean(mbean, MicrocontainerServiceMBean.MBEAN_MICROCONTAINER_SERVICE);
+ StandardMBean mbean = new StandardMBean((MicrocontainerServiceMBean)this, MicrocontainerServiceMBean.class);
+ mbeanServer.registerMBean(mbean, MBEAN_MICROCONTAINER_SERVICE);
}
catch (Exception ex)
{
Modified: projects/jboss-osgi/trunk/bundles/microcontainer/src/main/java/org/jboss/osgi/microcontainer/internal/MicrocontainerServiceImpl.java
===================================================================
--- projects/jboss-osgi/trunk/bundles/microcontainer/src/main/java/org/jboss/osgi/microcontainer/internal/MicrocontainerServiceImpl.java 2009-05-30 11:53:38 UTC (rev 89546)
+++ projects/jboss-osgi/trunk/bundles/microcontainer/src/main/java/org/jboss/osgi/microcontainer/internal/MicrocontainerServiceImpl.java 2009-05-30 12:08:13 UTC (rev 89547)
@@ -33,7 +33,6 @@
import org.jboss.osgi.common.log.LogServiceTracker;
import org.jboss.osgi.common.service.DeployerService;
import org.jboss.osgi.common.service.MicrocontainerService;
-import org.jboss.osgi.microcontainer.MicrocontainerServiceMBean;
import org.jboss.virtual.VFS;
import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceReference;
@@ -47,7 +46,7 @@
* @author thomas.diesler(a)jboss.com
* @since 23-Jan-2009
*/
-public class MicrocontainerServiceImpl extends AbstractMicrocontainerService implements MicrocontainerServiceMBean
+public class MicrocontainerServiceImpl extends AbstractMicrocontainerService
{
private BundleContext context;
private EmbeddedBeansDeployer deployer;
Modified: projects/jboss-osgi/trunk/distribution/src/main/resources/installer/install-definition.xml
===================================================================
--- projects/jboss-osgi/trunk/distribution/src/main/resources/installer/install-definition.xml 2009-05-30 11:53:38 UTC (rev 89546)
+++ projects/jboss-osgi/trunk/distribution/src/main/resources/installer/install-definition.xml 2009-05-30 12:08:13 UTC (rev 89547)
@@ -272,8 +272,10 @@
<!-- deployers/osgi.deployer -->
<fileset dir="@{deploy.artifacts.dir}/lib" targetdir="${jbossInstallPath}/server/${jbossTargetServer}/deployers/osgi.deployer" override="true">
+ <include name="jboss-osgi-common.jar" />
<include name="jboss-osgi-deployers.jar" />
<include name="jboss-osgi-integration-jbossas.jar" />
+ <include name="jboss-osgi-microcontainer.jar" />
<include name="jboss-osgi-spi.jar" />
</fileset>
Modified: projects/jboss-osgi/trunk/integration/jbossas/src/main/java/org/jboss/osgi/jbossas/integration/MicrocontainerServiceBean.java
===================================================================
--- projects/jboss-osgi/trunk/integration/jbossas/src/main/java/org/jboss/osgi/jbossas/integration/MicrocontainerServiceBean.java 2009-05-30 11:53:38 UTC (rev 89546)
+++ projects/jboss-osgi/trunk/integration/jbossas/src/main/java/org/jboss/osgi/jbossas/integration/MicrocontainerServiceBean.java 2009-05-30 12:08:13 UTC (rev 89547)
@@ -32,7 +32,6 @@
import org.jboss.kernel.spi.dependency.KernelController;
import org.jboss.osgi.common.service.DeployerService;
import org.jboss.osgi.common.service.MicrocontainerService;
-import org.jboss.osgi.microcontainer.MicrocontainerServiceMBean;
import org.jboss.osgi.microcontainer.internal.AbstractMicrocontainerService;
import org.osgi.framework.BundleContext;
@@ -43,7 +42,7 @@
* @author thomas.diesler(a)jboss.com
* @since 05-May-2009
*/
-public class MicrocontainerServiceBean extends AbstractMicrocontainerService implements MicrocontainerServiceMBean
+public class MicrocontainerServiceBean extends AbstractMicrocontainerService
{
private static Logger log = Logger.getLogger(MicrocontainerServiceBean.class);
Modified: projects/jboss-osgi/trunk/runtime/felix/src/main/resources/osgi-deployers-jboss-beans.xml
===================================================================
--- projects/jboss-osgi/trunk/runtime/felix/src/main/resources/osgi-deployers-jboss-beans.xml 2009-05-30 11:53:38 UTC (rev 89546)
+++ projects/jboss-osgi/trunk/runtime/felix/src/main/resources/osgi-deployers-jboss-beans.xml 2009-05-30 12:08:13 UTC (rev 89547)
@@ -87,19 +87,19 @@
-->
<!-- A Service that gives access to the Microcontainer -->
- <bean name="jboss.osgi:service=Microcontainer" class="org.jboss.osgi.microcontainer.internal.MicrocontainerServiceBean">
+ <bean name="jboss.osgi:service=Microcontainer" class="org.jboss.osgi.jbossas.integration.MicrocontainerServiceBean">
<property name="systemContext"><inject bean="jboss.osgi:service=Framework" property="bundleContext"/></property>
<property name="mbeanServer"><inject bean="JMXKernel" property="mbeanServer"/></property>
<property name="kernel"><inject bean="jboss.kernel:service=Kernel" /></property>
</bean>
<!-- A Service that gives access to JNDI -->
- <bean name="jboss.osgi:service=Naming" class="org.jboss.osgi.jndi.internal.NamingServiceBean">
+ <bean name="jboss.osgi:service=Naming" class="org.jboss.osgi.jbossas.integration.NamingServiceBean">
<property name="systemContext"><inject bean="jboss.osgi:service=Framework" property="bundleContext"/></property>
</bean>
<!-- A Service that gives access to the MBeanServer -->
- <bean name="jboss.osgi:service=Management" class="org.jboss.osgi.jmx.internal.ManagementServiceBean">
+ <bean name="jboss.osgi:service=Management" class="org.jboss.osgi.jbossas.integration.ManagementServiceBean">
<property name="systemContext"><inject bean="jboss.osgi:service=Framework" property="bundleContext"/></property>
<property name="mbeanServer"><inject bean="JMXKernel" property="mbeanServer"/></property>
</bean>
16 years, 6 months
JBoss-OSGI SVN: r89546 - in projects/jboss-osgi/trunk: bundles/microcontainer/src/main/java/org/jboss/osgi/microcontainer/internal and 8 other directories.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-05-30 07:53:38 -0400 (Sat, 30 May 2009)
New Revision: 89546
Added:
projects/jboss-osgi/trunk/bundles/microcontainer/src/main/java/org/jboss/osgi/microcontainer/internal/AbstractMicrocontainerService.java
projects/jboss-osgi/trunk/integration/jbossas/src/main/java/org/jboss/osgi/jbossas/
projects/jboss-osgi/trunk/integration/jbossas/src/main/java/org/jboss/osgi/jbossas/integration/
projects/jboss-osgi/trunk/integration/jbossas/src/main/java/org/jboss/osgi/jbossas/integration/ManagementServiceBean.java
projects/jboss-osgi/trunk/integration/jbossas/src/main/java/org/jboss/osgi/jbossas/integration/MicrocontainerServiceBean.java
projects/jboss-osgi/trunk/integration/jbossas/src/main/java/org/jboss/osgi/jbossas/integration/NamingServiceBean.java
Removed:
projects/jboss-osgi/trunk/integration/jbossas/src/main/java/org/jboss/osgi/jmx/internal/
projects/jboss-osgi/trunk/integration/jbossas/src/main/java/org/jboss/osgi/jndi/internal/
projects/jboss-osgi/trunk/integration/jbossas/src/main/java/org/jboss/osgi/microcontainer/MicrocontainerService.java
projects/jboss-osgi/trunk/integration/jbossas/src/main/java/org/jboss/osgi/microcontainer/MicrocontainerServiceMBean.java
projects/jboss-osgi/trunk/integration/jbossas/src/main/java/org/jboss/osgi/microcontainer/internal/
Modified:
projects/jboss-osgi/trunk/bundles/common/src/main/java/org/jboss/osgi/common/service/DeployerServiceDelegate.java
projects/jboss-osgi/trunk/bundles/microcontainer/src/main/java/org/jboss/osgi/microcontainer/internal/MicrocontainerServiceImpl.java
projects/jboss-osgi/trunk/distribution/runtime/bin/run.sh
projects/jboss-osgi/trunk/integration/jbossas/pom.xml
Log:
Reuse mc bundle code in jbossas integration - WIP
Modified: projects/jboss-osgi/trunk/bundles/common/src/main/java/org/jboss/osgi/common/service/DeployerServiceDelegate.java
===================================================================
--- projects/jboss-osgi/trunk/bundles/common/src/main/java/org/jboss/osgi/common/service/DeployerServiceDelegate.java 2009-05-30 10:24:42 UTC (rev 89545)
+++ projects/jboss-osgi/trunk/bundles/common/src/main/java/org/jboss/osgi/common/service/DeployerServiceDelegate.java 2009-05-30 11:53:38 UTC (rev 89546)
@@ -121,6 +121,9 @@
{
String serviceName = DeployerService.class.getName();
ServiceReference sref = context.getServiceReference(serviceName);
+ if (sref == null)
+ throw new IllegalStateException("Cannot obtain system DeployerService");
+
return (DeployerService)context.getService(sref);
}
Added: projects/jboss-osgi/trunk/bundles/microcontainer/src/main/java/org/jboss/osgi/microcontainer/internal/AbstractMicrocontainerService.java
===================================================================
--- projects/jboss-osgi/trunk/bundles/microcontainer/src/main/java/org/jboss/osgi/microcontainer/internal/AbstractMicrocontainerService.java (rev 0)
+++ projects/jboss-osgi/trunk/bundles/microcontainer/src/main/java/org/jboss/osgi/microcontainer/internal/AbstractMicrocontainerService.java 2009-05-30 11:53:38 UTC (rev 89546)
@@ -0,0 +1,286 @@
+/*
+ * 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.microcontainer.internal;
+
+//$Id$
+
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import javax.management.MBeanServer;
+import javax.management.StandardMBean;
+
+import org.jboss.dependency.plugins.AbstractController;
+import org.jboss.dependency.plugins.AbstractControllerContext;
+import org.jboss.dependency.plugins.AbstractControllerContextActions;
+import org.jboss.dependency.plugins.action.ControllerContextAction;
+import org.jboss.dependency.spi.ControllerContext;
+import org.jboss.dependency.spi.ControllerContextActions;
+import org.jboss.dependency.spi.ControllerState;
+import org.jboss.deployers.client.spi.Deployment;
+import org.jboss.deployers.client.spi.main.MainDeployer;
+import org.jboss.deployers.vfs.spi.client.VFSDeployment;
+import org.jboss.deployers.vfs.spi.client.VFSDeploymentFactory;
+import org.jboss.kernel.Kernel;
+import org.jboss.kernel.spi.dependency.KernelController;
+import org.jboss.kernel.spi.dependency.KernelControllerContext;
+import org.jboss.osgi.common.service.BundleInfo;
+import org.jboss.osgi.common.service.DeployerService;
+import org.jboss.osgi.common.service.MicrocontainerService;
+import org.jboss.osgi.microcontainer.MicrocontainerServiceMBean;
+import org.jboss.osgi.spi.NotImplementedException;
+import org.jboss.virtual.VFS;
+import org.jboss.virtual.VirtualFile;
+import org.osgi.framework.BundleException;
+
+/**
+ * An OSGi Service the gives access to the Kernel.
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 23-Jan-2009
+ */
+public abstract class AbstractMicrocontainerService implements DeployerService, MicrocontainerService
+{
+ private VFSDeploymentFactory deploymentFactory = VFSDeploymentFactory.getInstance();
+ private Map<URL, String> contextMap = Collections.synchronizedMap(new HashMap<URL, String>());
+
+ public abstract Kernel getKernel();
+
+ public abstract void logDebug(String message);
+
+ public abstract void logWarning(String message, Exception ex);
+
+ public void logWarning(String message)
+ {
+ logWarning(message, null);
+ }
+
+ public List<String> getRegisteredBeans()
+ {
+ List<String> names = new ArrayList<String>();
+
+ AbstractController controller = (AbstractController)getKernel().getController();
+ for (ControllerContext ctx : controller.getAllContexts())
+ {
+ if (ctx instanceof KernelControllerContext || ctx instanceof PreInstalledControllerContext)
+ names.add(ctx.getName().toString());
+ }
+
+ return names;
+ }
+
+ public Object getRegisteredBean(String beanName)
+ {
+ ControllerContext context = getKernel().getController().getInstalledContext(beanName);
+ return context != null ? context.getTarget() : null;
+ }
+
+ public void deploy(URL url) throws BundleException
+ {
+ BundleInfo info = new LocationOnlyBundleInfo(url);
+ deploy(new BundleInfo[] { info });
+ }
+
+ public boolean undeploy(URL url) throws BundleException
+ {
+ String deploymentName = contextMap.remove(url);
+ if (deploymentName == null)
+ {
+ logWarning("Package not deployed: " + url);
+ return false;
+ }
+
+ try
+ {
+ MainDeployer mainDeployer = (MainDeployer)getRegisteredBean("MainDeployer");
+ mainDeployer.removeDeployment(deploymentName);
+ mainDeployer.process();
+ return true;
+ }
+ catch (RuntimeException rte)
+ {
+ throw rte;
+ }
+ catch (Exception ex)
+ {
+ logWarning("Cannot undeploy bundle", ex);
+ return false;
+ }
+ }
+
+ public void deploy(BundleInfo[] bundles) throws BundleException
+ {
+ ClassLoader ctxLoader = Thread.currentThread().getContextClassLoader();
+ try
+ {
+ Thread.currentThread().setContextClassLoader(getClass().getClassLoader());
+
+ List<Deployment> deployments = new ArrayList<Deployment>();
+ MainDeployer mainDeployer = (MainDeployer)getRegisteredBean("MainDeployer");
+ for (BundleInfo bundle : bundles)
+ {
+ VirtualFile file = VFS.createNewRoot(bundle.getLocation());
+ VFSDeployment deployment = deploymentFactory.createVFSDeployment(file);
+ mainDeployer.addDeployment(deployment);
+ deployments.add(deployment);
+ contextMap.put(bundle.getLocation(), deployment.getName());
+ }
+
+ // Process the deployments
+ mainDeployer.process();
+
+ // Check for completeness
+ Deployment[] depArr = deployments.toArray(new Deployment[deployments.size()]);
+ mainDeployer.checkComplete(depArr);
+ }
+ catch (RuntimeException rte)
+ {
+ throw rte;
+ }
+ catch (Exception ex)
+ {
+ throw new BundleException("Cannot deploy bundles", ex);
+ }
+ finally
+ {
+ Thread.currentThread().setContextClassLoader(ctxLoader);
+ }
+ }
+
+ public void undeploy(BundleInfo[] bundles) throws BundleException
+ {
+ try
+ {
+ MainDeployer mainDeployer = (MainDeployer)getRegisteredBean("MainDeployer");
+ for (BundleInfo bundle : bundles)
+ {
+ String deploymentName = contextMap.remove(bundle.getLocation());
+ if (deploymentName != null)
+ {
+ mainDeployer.removeDeployment(deploymentName);
+ }
+ else
+ {
+ logWarning("Package not deployed: " + bundle.getLocation());
+ }
+ }
+ mainDeployer.process();
+ }
+ catch (RuntimeException rte)
+ {
+ throw rte;
+ }
+ catch (Exception ex)
+ {
+ logWarning("Cannot undeploy bundles", ex);
+ }
+ }
+
+ protected void installBean(KernelController controller, String beanName, Object beanImpl)
+ {
+ try
+ {
+ ControllerContextActions actions = new AbstractControllerContextActions(new HashMap<ControllerState, ControllerContextAction>());
+ controller.install(new PreInstalledControllerContext(beanName, actions, beanImpl));
+ }
+ catch (RuntimeException rte)
+ {
+ throw rte;
+ }
+ catch (Throwable ex)
+ {
+ throw new IllegalStateException("Cannot register bean: " + beanName, ex);
+ }
+ }
+
+ protected void registerMicrocontainerServiceMBean(MBeanServer mbeanServer)
+ {
+ try
+ {
+ logDebug("Register MicrocontainerServiceMBean");
+ StandardMBean mbean = new StandardMBean(this, MicrocontainerServiceMBean.class);
+ mbeanServer.registerMBean(mbean, MicrocontainerServiceMBean.MBEAN_MICROCONTAINER_SERVICE);
+ }
+ catch (Exception ex)
+ {
+ throw new IllegalStateException("Cannot register MicrocontainerServiceMBean", ex);
+ }
+ }
+
+ protected void unregisterMicrocontainerServiceMBean(MBeanServer mbeanServer)
+ {
+ if (mbeanServer.isRegistered(MicrocontainerServiceMBean.MBEAN_MICROCONTAINER_SERVICE))
+ {
+ try
+ {
+ logDebug("Unregister MicrocontainerServiceMBean");
+ mbeanServer.unregisterMBean(MicrocontainerServiceMBean.MBEAN_MICROCONTAINER_SERVICE);
+ }
+ catch (Exception ex)
+ {
+ logWarning("Cannot unregister MicrocontainerServiceMBean", ex);
+ }
+ }
+ }
+
+ static class PreInstalledControllerContext extends AbstractControllerContext
+ {
+ public PreInstalledControllerContext(Object name, ControllerContextActions actions, Object target)
+ {
+ super(name, actions, null, target);
+ }
+ }
+
+ static class LocationOnlyBundleInfo implements BundleInfo
+ {
+ private URL location;
+
+ public LocationOnlyBundleInfo(URL location)
+ {
+ this.location = location;
+ }
+
+ public URL getLocation()
+ {
+ return location;
+ }
+
+ public State getState()
+ {
+ throw new NotImplementedException();
+ }
+
+ public String getSymbolicName()
+ {
+ throw new NotImplementedException();
+ }
+
+ public String getVersion()
+ {
+ throw new NotImplementedException();
+ }
+ }
+}
\ No newline at end of file
Property changes on: projects/jboss-osgi/trunk/bundles/microcontainer/src/main/java/org/jboss/osgi/microcontainer/internal/AbstractMicrocontainerService.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: projects/jboss-osgi/trunk/bundles/microcontainer/src/main/java/org/jboss/osgi/microcontainer/internal/MicrocontainerServiceImpl.java
===================================================================
--- projects/jboss-osgi/trunk/bundles/microcontainer/src/main/java/org/jboss/osgi/microcontainer/internal/MicrocontainerServiceImpl.java 2009-05-30 10:24:42 UTC (rev 89545)
+++ projects/jboss-osgi/trunk/bundles/microcontainer/src/main/java/org/jboss/osgi/microcontainer/internal/MicrocontainerServiceImpl.java 2009-05-30 11:53:38 UTC (rev 89546)
@@ -24,58 +24,35 @@
//$Id$
import java.net.URL;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
import java.util.Properties;
import javax.management.MBeanServer;
-import javax.management.StandardMBean;
-import org.jboss.dependency.plugins.AbstractController;
-import org.jboss.dependency.plugins.AbstractControllerContext;
-import org.jboss.dependency.plugins.AbstractControllerContextActions;
-import org.jboss.dependency.plugins.action.ControllerContextAction;
-import org.jboss.dependency.spi.ControllerContext;
-import org.jboss.dependency.spi.ControllerContextActions;
-import org.jboss.dependency.spi.ControllerState;
-import org.jboss.deployers.client.spi.Deployment;
-import org.jboss.deployers.client.spi.main.MainDeployer;
-import org.jboss.deployers.vfs.spi.client.VFSDeployment;
-import org.jboss.deployers.vfs.spi.client.VFSDeploymentFactory;
import org.jboss.kernel.Kernel;
import org.jboss.kernel.spi.dependency.KernelController;
-import org.jboss.kernel.spi.dependency.KernelControllerContext;
import org.jboss.osgi.common.log.LogServiceTracker;
-import org.jboss.osgi.common.service.BundleInfo;
import org.jboss.osgi.common.service.DeployerService;
import org.jboss.osgi.common.service.MicrocontainerService;
import org.jboss.osgi.microcontainer.MicrocontainerServiceMBean;
-import org.jboss.osgi.spi.NotImplementedException;
import org.jboss.virtual.VFS;
-import org.jboss.virtual.VirtualFile;
import org.osgi.framework.BundleContext;
-import org.osgi.framework.BundleException;
import org.osgi.framework.ServiceReference;
import org.osgi.service.log.LogService;
import org.osgi.util.tracker.ServiceTracker;
/**
- * An OSGi Service the gives access to the Kernel.
+ * An implementation of the {@link DeployerService} and {@link MicrocontainerService}
+ * which is installed as a bundle
*
* @author thomas.diesler(a)jboss.com
* @since 23-Jan-2009
*/
-public class MicrocontainerServiceImpl implements DeployerService, MicrocontainerService, MicrocontainerServiceMBean
+public class MicrocontainerServiceImpl extends AbstractMicrocontainerService implements MicrocontainerServiceMBean
{
private BundleContext context;
private EmbeddedBeansDeployer deployer;
private LogService log;
- private VFSDeploymentFactory deploymentFactory = VFSDeploymentFactory.getInstance();
- private Map<URL, String> contextMap = Collections.synchronizedMap(new HashMap<URL, String>());
public MicrocontainerServiceImpl(BundleContext context)
{
@@ -92,127 +69,18 @@
return deployer.getKernel();
}
- public List<String> getRegisteredBeans()
+ @Override
+ public void logDebug(String message)
{
- List<String> names = new ArrayList<String>();
-
- AbstractController controller = (AbstractController)getKernel().getController();
- for (ControllerContext ctx : controller.getAllContexts())
- {
- if (ctx instanceof KernelControllerContext || ctx instanceof PreInstalledControllerContext)
- names.add(ctx.getName().toString());
- }
-
- return names;
+ log.log(LogService.LOG_DEBUG, message);
}
- public Object getRegisteredBean(String beanName)
+ @Override
+ public void logWarning(String message, Exception ex)
{
- ControllerContext context = getKernel().getController().getInstalledContext(beanName);
- return context != null ? context.getTarget() : null;
+ log.log(LogService.LOG_WARNING, message, ex);
}
- public void deploy(BundleInfo[] bundles) throws BundleException
- {
- ClassLoader ctxLoader = Thread.currentThread().getContextClassLoader();
- try
- {
- Thread.currentThread().setContextClassLoader(getClass().getClassLoader());
-
- List<Deployment> deployments = new ArrayList<Deployment>();
- MainDeployer mainDeployer = (MainDeployer)getRegisteredBean("MainDeployer");
- for (BundleInfo bundle : bundles)
- {
- VirtualFile file = VFS.createNewRoot(bundle.getLocation());
- VFSDeployment deployment = deploymentFactory.createVFSDeployment(file);
- mainDeployer.addDeployment(deployment);
- deployments.add(deployment);
- contextMap.put(bundle.getLocation(), deployment.getName());
- }
-
- // Process the deployments
- mainDeployer.process();
-
- // Check for completeness
- Deployment[] depArr = deployments.toArray(new Deployment[deployments.size()]);
- mainDeployer.checkComplete(depArr);
- }
- catch (RuntimeException rte)
- {
- throw rte;
- }
- catch (Exception ex)
- {
- throw new BundleException("Cannot deploy bundles", ex);
- }
- finally
- {
- Thread.currentThread().setContextClassLoader(ctxLoader);
- }
- }
-
- public void undeploy(BundleInfo[] bundles) throws BundleException
- {
- try
- {
- MainDeployer mainDeployer = (MainDeployer)getRegisteredBean("MainDeployer");
- for (BundleInfo bundle : bundles)
- {
- String deploymentName = contextMap.remove(bundle.getLocation());
- if (deploymentName != null)
- {
- mainDeployer.removeDeployment(deploymentName);
- }
- else
- {
- log.log(LogService.LOG_WARNING, "Package not deployed: " + bundle.getLocation());
- }
- }
- mainDeployer.process();
- }
- catch (RuntimeException rte)
- {
- throw rte;
- }
- catch (Exception ex)
- {
- log.log(LogService.LOG_WARNING, "Cannot undeploy bundles", ex);
- }
- }
-
- public void deploy(URL url) throws BundleException
- {
- BundleInfo info = new LocationOnlyBundleInfo(url);
- deploy(new BundleInfo[] { info });
- }
-
- public boolean undeploy(URL url) throws BundleException
- {
- String deploymentName = contextMap.remove(url);
- if (deploymentName == null)
- {
- log.log(LogService.LOG_WARNING, "Package not deployed: " + url);
- return false;
- }
-
- try
- {
- MainDeployer mainDeployer = (MainDeployer)getRegisteredBean("MainDeployer");
- mainDeployer.removeDeployment(deploymentName);
- mainDeployer.process();
- return true;
- }
- catch (RuntimeException rte)
- {
- throw rte;
- }
- catch (Exception ex)
- {
- log.log(LogService.LOG_WARNING, "Cannot undeploy bundle", ex);
- return false;
- }
- }
-
void start()
{
final MicrocontainerService mcServiceImpl = this;
@@ -260,97 +128,11 @@
void stop()
{
- unregisterMicrocontainerServiceMBean();
- }
-
- private void installBean(KernelController controller, String beanName, Object beanImpl)
- {
- try
- {
- ControllerContextActions actions = new AbstractControllerContextActions(new HashMap<ControllerState, ControllerContextAction>());
- controller.install(new PreInstalledControllerContext(beanName, actions, beanImpl));
- }
- catch (RuntimeException rte)
- {
- throw rte;
- }
- catch (Throwable ex)
- {
- throw new IllegalStateException("Cannot register bean: " + beanName, ex);
- }
- }
-
- private void registerMicrocontainerServiceMBean(MBeanServer mbeanServer)
- {
- // Register the MicrocontainerServiceMBean
- try
- {
- log.log(LogService.LOG_DEBUG, "Register MicrocontainerServiceMBean");
- StandardMBean mbean = new StandardMBean(this, MicrocontainerServiceMBean.class);
- mbeanServer.registerMBean(mbean, MBEAN_MICROCONTAINER_SERVICE);
- }
- catch (Exception ex)
- {
- throw new IllegalStateException("Cannot register MicrocontainerServiceMBean", ex);
- }
- }
-
- private void unregisterMicrocontainerServiceMBean()
- {
ServiceReference sref = context.getServiceReference(MBeanServer.class.getName());
if (sref != null)
{
MBeanServer mbeanServer = (MBeanServer)context.getService(sref);
- if (mbeanServer.isRegistered(MBEAN_MICROCONTAINER_SERVICE))
- {
- try
- {
- log.log(LogService.LOG_DEBUG, "Unregister MicrocontainerServiceMBean");
- mbeanServer.unregisterMBean(MBEAN_MICROCONTAINER_SERVICE);
- }
- catch (Exception ex)
- {
- log.log(LogService.LOG_ERROR, "Cannot unregister MicrocontainerServiceMBean", ex);
- }
- }
+ unregisterMicrocontainerServiceMBean(mbeanServer);
}
}
-
- static class PreInstalledControllerContext extends AbstractControllerContext
- {
- public PreInstalledControllerContext(Object name, ControllerContextActions actions, Object target)
- {
- super(name, actions, null, target);
- }
- }
-
- static class LocationOnlyBundleInfo implements BundleInfo
- {
- private URL location;
-
- public LocationOnlyBundleInfo(URL location)
- {
- this.location = location;
- }
-
- public URL getLocation()
- {
- return location;
- }
-
- public State getState()
- {
- throw new NotImplementedException();
- }
-
- public String getSymbolicName()
- {
- throw new NotImplementedException();
- }
-
- public String getVersion()
- {
- throw new NotImplementedException();
- }
- }
}
\ No newline at end of file
Modified: projects/jboss-osgi/trunk/distribution/runtime/bin/run.sh
===================================================================
--- projects/jboss-osgi/trunk/distribution/runtime/bin/run.sh 2009-05-30 10:24:42 UTC (rev 89545)
+++ projects/jboss-osgi/trunk/distribution/runtime/bin/run.sh 2009-05-30 11:53:38 UTC (rev 89546)
@@ -134,8 +134,6 @@
echo ""
echo " JAVA_OPTS: $JAVA_OPTS"
echo ""
-echo " CLASSPATH: $OSGI_CLASSPATH"
-echo ""
echo "========================================================================="
echo ""
Modified: projects/jboss-osgi/trunk/integration/jbossas/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/integration/jbossas/pom.xml 2009-05-30 10:24:42 UTC (rev 89545)
+++ projects/jboss-osgi/trunk/integration/jbossas/pom.xml 2009-05-30 11:53:38 UTC (rev 89546)
@@ -22,6 +22,14 @@
<groupId>org.jboss.osgi</groupId>
<artifactId>jboss-osgi-spi</artifactId>
</dependency>
+ <dependency>
+ <groupId>org.jboss.osgi.bundles</groupId>
+ <artifactId>jboss-osgi-common</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.osgi.bundles</groupId>
+ <artifactId>jboss-osgi-microcontainer</artifactId>
+ </dependency>
<!-- OSGi Dependencies -->
<dependency>
Copied: projects/jboss-osgi/trunk/integration/jbossas/src/main/java/org/jboss/osgi/jbossas/integration/ManagementServiceBean.java (from rev 89533, projects/jboss-osgi/trunk/integration/jbossas/src/main/java/org/jboss/osgi/jmx/internal/ManagementServiceBean.java)
===================================================================
--- projects/jboss-osgi/trunk/integration/jbossas/src/main/java/org/jboss/osgi/jbossas/integration/ManagementServiceBean.java (rev 0)
+++ projects/jboss-osgi/trunk/integration/jbossas/src/main/java/org/jboss/osgi/jbossas/integration/ManagementServiceBean.java 2009-05-30 11:53:38 UTC (rev 89546)
@@ -0,0 +1,55 @@
+/*
+ * 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.jbossas.integration;
+
+//$Id$
+
+import javax.management.MBeanServer;
+
+import org.osgi.framework.BundleContext;
+
+/**
+ * A service that gives access to the MBeanServer
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 24-Apr-2009
+ */
+public class ManagementServiceBean
+{
+ private MBeanServer mbeanServer;
+ private BundleContext context;
+
+ public void setSystemContext(BundleContext context)
+ {
+ this.context = context;
+ }
+
+ public void setMbeanServer(MBeanServer mbeanServer)
+ {
+ this.mbeanServer = mbeanServer;
+ }
+
+ public void start()
+ {
+ context.registerService(MBeanServer.class.getName(), mbeanServer, null);
+ }
+}
\ No newline at end of file
Copied: projects/jboss-osgi/trunk/integration/jbossas/src/main/java/org/jboss/osgi/jbossas/integration/MicrocontainerServiceBean.java (from rev 89533, projects/jboss-osgi/trunk/integration/jbossas/src/main/java/org/jboss/osgi/microcontainer/internal/MicrocontainerServiceBean.java)
===================================================================
--- projects/jboss-osgi/trunk/integration/jbossas/src/main/java/org/jboss/osgi/jbossas/integration/MicrocontainerServiceBean.java (rev 0)
+++ projects/jboss-osgi/trunk/integration/jbossas/src/main/java/org/jboss/osgi/jbossas/integration/MicrocontainerServiceBean.java 2009-05-30 11:53:38 UTC (rev 89546)
@@ -0,0 +1,115 @@
+/*
+ * 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.jbossas.integration;
+
+//$Id$
+
+import java.util.Properties;
+
+import javax.management.MBeanServer;
+
+import org.apache.log4j.Logger;
+import org.jboss.kernel.Kernel;
+import org.jboss.kernel.spi.dependency.KernelController;
+import org.jboss.osgi.common.service.DeployerService;
+import org.jboss.osgi.common.service.MicrocontainerService;
+import org.jboss.osgi.microcontainer.MicrocontainerServiceMBean;
+import org.jboss.osgi.microcontainer.internal.AbstractMicrocontainerService;
+import org.osgi.framework.BundleContext;
+
+/**
+ * An implementation of the {@link DeployerService} and {@link MicrocontainerService}
+ * which is installed as MC bean in jbossas.
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 05-May-2009
+ */
+public class MicrocontainerServiceBean extends AbstractMicrocontainerService implements MicrocontainerServiceMBean
+{
+ private static Logger log = Logger.getLogger(MicrocontainerServiceBean.class);
+
+ private BundleContext context;
+ private MBeanServer mbeanServer;
+ private Kernel kernel;
+
+ public void setSystemContext(BundleContext context)
+ {
+ this.context = context;
+ }
+
+ public void setMbeanServer(MBeanServer mbeanServer)
+ {
+ this.mbeanServer = mbeanServer;
+ }
+
+ public void setKernel(Kernel kernel)
+ {
+ this.kernel = kernel;
+ }
+
+ public Kernel getKernel()
+ {
+ return kernel;
+ }
+
+ @Override
+ public void logDebug(String message)
+ {
+ log.debug(message);
+ }
+
+ @Override
+ public void logWarning(String message, Exception ex)
+ {
+ log.warn(message, ex);
+ }
+
+ public void start()
+ {
+ Kernel kernel = getKernel();
+ KernelController controller = kernel.getController();
+
+ // Preregister some beans
+ installBean(controller, BEAN_SYSTEM_BUNDLE_CONTEXT, context);
+ installBean(controller, BEAN_KERNEL, kernel);
+ installBean(controller, BEAN_KERNEL_CONTROLLER, controller);
+ installBean(controller, BEAN_MBEAN_SERVER, mbeanServer);
+
+ // Register the MicrocontainerService
+ log.debug("Register MicrocontainerService");
+ context.registerService(MicrocontainerService.class.getName(), this, null);
+
+ // Register the DeployerService
+ Properties props = new Properties();
+ props.setProperty("provider", "microcontainer");
+ log.debug("Register DeployerService");
+ context.registerService(DeployerService.class.getName(), this, props);
+
+ // Register the MicrocontainerServiceMBean
+ registerMicrocontainerServiceMBean(mbeanServer);
+ }
+
+ void stop()
+ {
+ unregisterMicrocontainerServiceMBean(mbeanServer);
+ }
+}
\ No newline at end of file
Copied: projects/jboss-osgi/trunk/integration/jbossas/src/main/java/org/jboss/osgi/jbossas/integration/NamingServiceBean.java (from rev 89533, projects/jboss-osgi/trunk/integration/jbossas/src/main/java/org/jboss/osgi/jndi/internal/NamingServiceBean.java)
===================================================================
--- projects/jboss-osgi/trunk/integration/jbossas/src/main/java/org/jboss/osgi/jbossas/integration/NamingServiceBean.java (rev 0)
+++ projects/jboss-osgi/trunk/integration/jbossas/src/main/java/org/jboss/osgi/jbossas/integration/NamingServiceBean.java 2009-05-30 11:53:38 UTC (rev 89546)
@@ -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.jbossas.integration;
+
+//$Id$
+
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+
+import org.osgi.framework.BundleContext;
+
+/**
+ * A service that gives access to JNDI
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 05-May-2009
+ */
+public class NamingServiceBean
+{
+ private BundleContext context;
+
+ public void setSystemContext(BundleContext context)
+ {
+ this.context = context;
+ }
+
+ public void start()
+ {
+ try
+ {
+ InitialContext initialContext = new InitialContext();
+ context.registerService(InitialContext.class.getName(), initialContext, null);
+ }
+ catch (NamingException ex)
+ {
+ throw new IllegalStateException("Cannot register InitialContext", ex);
+ }
+ }
+}
\ No newline at end of file
Deleted: projects/jboss-osgi/trunk/integration/jbossas/src/main/java/org/jboss/osgi/microcontainer/MicrocontainerService.java
===================================================================
--- projects/jboss-osgi/trunk/integration/jbossas/src/main/java/org/jboss/osgi/microcontainer/MicrocontainerService.java 2009-05-30 10:24:42 UTC (rev 89545)
+++ projects/jboss-osgi/trunk/integration/jbossas/src/main/java/org/jboss/osgi/microcontainer/MicrocontainerService.java 2009-05-30 11:53:38 UTC (rev 89546)
@@ -1,84 +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.microcontainer;
-
-//$Id$
-
-import java.net.URL;
-import java.util.List;
-
-import org.jboss.kernel.Kernel;
-
-/**
- * A service the gives access to the Microcontainer.
- *
- * @author thomas.diesler(a)jboss.com
- * @since 23-Jan-2009
- */
-public interface MicrocontainerService
-{
- /*
- * The name under which the system bundle context is registered: 'jboss.osgi:service=BundleContext'
- */
- String BEAN_SYSTEM_BUNDLE_CONTEXT = "jboss.osgi:service=BundleContext";
-
- /*
- * The name under which the MBeanServer is registered: 'jboss.osgi:service=MBeanServer'
- */
- String BEAN_MBEAN_SERVER = "jboss.osgi:service=MBeanServer";
-
- /*
- * The name under which the KernelController is registered: 'jboss.kernel:service=KernelController'
- */
- String BEAN_KERNEL_CONTROLLER = "jboss.kernel:service=KernelController";
-
- /*
- * The name under which the Kernel is registered: 'jboss.kernel:service=Kernel'
- */
- String BEAN_KERNEL = "jboss.kernel:service=Kernel";
-
- /*
- * * Get the Microcontainer Kernel
- */
- Kernel getKernel();
-
- /*
- * * Get the list of registered beans.
- */
- List<String> getRegisteredBeans();
-
- /*
- * * Get a registered bean from the Kernel.
- * @return null if there is no bean registered under this name
- */
- Object getRegisteredBean(String beanName);
-
- /*
- * * Deploy MC beans from URL
- */
- void deploy(URL url) throws Exception;
-
- /*
- * * Undeploy MC beans from URL
- */
- void undeploy(URL url) throws Exception;
-}
\ No newline at end of file
Deleted: projects/jboss-osgi/trunk/integration/jbossas/src/main/java/org/jboss/osgi/microcontainer/MicrocontainerServiceMBean.java
===================================================================
--- projects/jboss-osgi/trunk/integration/jbossas/src/main/java/org/jboss/osgi/microcontainer/MicrocontainerServiceMBean.java 2009-05-30 10:24:42 UTC (rev 89545)
+++ projects/jboss-osgi/trunk/integration/jbossas/src/main/java/org/jboss/osgi/microcontainer/MicrocontainerServiceMBean.java 2009-05-30 11:53:38 UTC (rev 89546)
@@ -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.microcontainer;
-
-//$Id$
-
-import java.net.URL;
-import java.util.List;
-
-import javax.management.ObjectName;
-
-import org.jboss.osgi.spi.management.ObjectNameFactory;
-
-/**
- * An OSGi Service the gives access to the Kernel and MBeanServer.
- *
- * @author thomas.diesler(a)jboss.com
- * @since 23-Jan-2009
- */
-public interface MicrocontainerServiceMBean
-{
- /**
- * The object name under which the MicrocontainerService is registered: 'jboss.osgi:service=MicrocontainerService'
- */
- ObjectName MBEAN_MICROCONTAINER_SERVICE = ObjectNameFactory.create("jboss.osgi:service=MicrocontainerService");
-
- /**
- * Get the list of registered beans.
- */
- List<String> getRegisteredBeans();
-
- /**
- * Deploy MC beans from URL
- */
- void deploy(URL url) throws Exception;
-
- /**
- * Undeploy MC beans from URL
- */
- void undeploy(URL url) throws Exception;
-}
\ No newline at end of file
16 years, 6 months