Author: thomas.diesler(a)jboss.com
Date: 2009-06-01 04:00:17 -0400 (Mon, 01 Jun 2009)
New Revision: 89589
Added:
projects/jboss-osgi/trunk/integration/jbossas/src/main/java/org/jboss/osgi/integration/
projects/jboss-osgi/trunk/integration/jbossas/src/main/java/org/jboss/osgi/integration/jbossas/
projects/jboss-osgi/trunk/integration/jbossas/src/main/java/org/jboss/osgi/integration/jbossas/AbstractMicrocontainerService.java
projects/jboss-osgi/trunk/integration/jbossas/src/main/java/org/jboss/osgi/integration/jbossas/MicrocontainerServiceBean.java
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/service/
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/service/BundleInfo.java
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/service/DeployerService.java
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/service/MicrocontainerService.java
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/service/MicrocontainerServiceMBean.java
Removed:
projects/jboss-osgi/trunk/bundles/common/src/main/java/org/jboss/osgi/common/service/BundleInfo.java
projects/jboss-osgi/trunk/bundles/common/src/main/java/org/jboss/osgi/common/service/DeployerService.java
projects/jboss-osgi/trunk/bundles/common/src/main/java/org/jboss/osgi/common/service/MicrocontainerService.java
projects/jboss-osgi/trunk/bundles/microcontainer/src/main/java/org/jboss/osgi/microcontainer/MicrocontainerServiceMBean.java
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/integration/jbossas/
projects/jboss-osgi/trunk/integration/jbossas/src/main/java/org/jboss/osgi/integration/jbossas/AbstractMicrocontainerService.java
projects/jboss-osgi/trunk/integration/jbossas/src/main/java/org/jboss/osgi/integration/jbossas/MicrocontainerServiceBean.java
projects/jboss-osgi/trunk/integration/jbossas/src/main/java/org/jboss/osgi/jbossas/integration/
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/service/BundleInfo.java
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/service/DeployerService.java
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/service/MicrocontainerService.java
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/service/MicrocontainerServiceMBean.java
Modified:
projects/jboss-osgi/trunk/blueprint/testsuite/src/test/resources/jboss-osgi-felix.properties
projects/jboss-osgi/trunk/bundles/common/pom.xml
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/bundles/common/src/main/java/org/jboss/osgi/common/service/DeployerServiceDelegate.java
projects/jboss-osgi/trunk/bundles/hotdeploy/pom.xml
projects/jboss-osgi/trunk/bundles/hotdeploy/src/main/java/org/jboss/osgi/service/hotdeploy/DeploymentScannerService.java
projects/jboss-osgi/trunk/bundles/hotdeploy/src/main/java/org/jboss/osgi/service/hotdeploy/internal/BundleInfoImpl.java
projects/jboss-osgi/trunk/bundles/hotdeploy/src/main/java/org/jboss/osgi/service/hotdeploy/internal/DeploymentScannerImpl.java
projects/jboss-osgi/trunk/bundles/microcontainer/pom.xml
projects/jboss-osgi/trunk/bundles/microcontainer/src/main/java/org/jboss/osgi/microcontainer/internal/MicrocontainerServiceActivator.java
projects/jboss-osgi/trunk/bundles/microcontainer/src/main/java/org/jboss/osgi/microcontainer/internal/MicrocontainerServiceImpl.java
projects/jboss-osgi/trunk/distribution/runtime/conf/jboss-osgi-felix.properties
projects/jboss-osgi/trunk/distribution/src/main/resources/installer/install-definition.xml
projects/jboss-osgi/trunk/husky/testsuite/src/test/resources/jboss-osgi-felix.properties
projects/jboss-osgi/trunk/integration/jbossas/pom.xml
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/example/src/test/java/org/jboss/test/osgi/example/microcontainer/MicrocontainerTestCase.java
projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/microcontainer/bundleA/SomeService.java
projects/jboss-osgi/trunk/testsuite/example/src/test/resources/jboss-osgi-felix.properties
projects/jboss-osgi/trunk/testsuite/example/src/test/resources/mcservice/example-mcservice-bundleA.bnd
projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jboss-osgi-felix.properties
projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/resources/jboss-osgi-felix.properties
Log:
Sort out MC dependencies
Modified:
projects/jboss-osgi/trunk/blueprint/testsuite/src/test/resources/jboss-osgi-felix.properties
===================================================================
---
projects/jboss-osgi/trunk/blueprint/testsuite/src/test/resources/jboss-osgi-felix.properties 2009-06-01
07:50:26 UTC (rev 89588)
+++
projects/jboss-osgi/trunk/blueprint/testsuite/src/test/resources/jboss-osgi-felix.properties 2009-06-01
08:00:17 UTC (rev 89589)
@@ -19,6 +19,7 @@
org.jboss.logging, \
org.jboss.osgi.spi;version=1.0, \
org.jboss.osgi.spi.management;version=1.0, \
+ org.jboss.osgi.spi.service;version=1.0, \
org.jboss.osgi.spi.testing;version=1.0, \
org.jboss.osgi.spi.testing.capability;version=1.0, \
org.jboss.virtual, \
Modified: projects/jboss-osgi/trunk/bundles/common/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/bundles/common/pom.xml 2009-06-01 07:50:26 UTC (rev 89588)
+++ projects/jboss-osgi/trunk/bundles/common/pom.xml 2009-06-01 08:00:17 UTC (rev 89589)
@@ -62,6 +62,7 @@
javax.management,
org.jboss.logging,
org.jboss.osgi.spi.management;version="1.0",
+ org.jboss.osgi.spi.service;version="1.0",
org.osgi.framework;version=1.4,
org.osgi.service.log;version=1.3,
org.osgi.util.tracker
Modified:
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 2009-06-01
07:50:26 UTC (rev 89588)
+++
projects/jboss-osgi/trunk/bundles/common/src/main/java/org/jboss/osgi/common/internal/AbstractCommonServicesActivator.java 2009-06-01
08:00:17 UTC (rev 89589)
@@ -29,8 +29,8 @@
import javax.management.MBeanServer;
import javax.management.StandardMBean;
-import org.jboss.osgi.common.service.DeployerService;
import org.jboss.osgi.common.service.DeployerServiceDelegate;
+import org.jboss.osgi.spi.service.DeployerService;
import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceReference;
import org.osgi.service.log.LogReaderService;
Modified:
projects/jboss-osgi/trunk/bundles/common/src/main/java/org/jboss/osgi/common/internal/SystemDeployerService.java
===================================================================
---
projects/jboss-osgi/trunk/bundles/common/src/main/java/org/jboss/osgi/common/internal/SystemDeployerService.java 2009-06-01
07:50:26 UTC (rev 89588)
+++
projects/jboss-osgi/trunk/bundles/common/src/main/java/org/jboss/osgi/common/internal/SystemDeployerService.java 2009-06-01
08:00:17 UTC (rev 89589)
@@ -30,9 +30,9 @@
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.jboss.osgi.spi.service.BundleInfo;
+import org.jboss.osgi.spi.service.DeployerService;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
import org.osgi.framework.BundleException;
Deleted:
projects/jboss-osgi/trunk/bundles/common/src/main/java/org/jboss/osgi/common/service/BundleInfo.java
===================================================================
---
projects/jboss-osgi/trunk/bundles/common/src/main/java/org/jboss/osgi/common/service/BundleInfo.java 2009-06-01
07:50:26 UTC (rev 89588)
+++
projects/jboss-osgi/trunk/bundles/common/src/main/java/org/jboss/osgi/common/service/BundleInfo.java 2009-06-01
08:00:17 UTC (rev 89589)
@@ -1,64 +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.service;
-
-//$Id$
-
-import java.net.URL;
-
-
-/**
- * An abstraction of a bundle in the scan folder
- *
- * @author thomas.diesler(a)jboss.com
- * @since 27-May-2009
- */
-public interface BundleInfo
-{
- /**
- * The state of the bundle
- */
- enum State
- {
- NEW, INSTALLED, ACTIVE, UNINSTALLED
- }
-
- /**
- * Get the bundle location
- */
- URL getLocation();
-
- /**
- * Get the bundle state
- */
- BundleInfo.State getState();
-
- /**
- * Get the bundle symbolic name
- */
- String getSymbolicName();
-
- /**
- * Get the bundle version
- */
- String getVersion();
-}
\ No newline at end of file
Deleted:
projects/jboss-osgi/trunk/bundles/common/src/main/java/org/jboss/osgi/common/service/DeployerService.java
===================================================================
---
projects/jboss-osgi/trunk/bundles/common/src/main/java/org/jboss/osgi/common/service/DeployerService.java 2009-06-01
07:50:26 UTC (rev 89588)
+++
projects/jboss-osgi/trunk/bundles/common/src/main/java/org/jboss/osgi/common/service/DeployerService.java 2009-06-01
08:00:17 UTC (rev 89589)
@@ -1,74 +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.service;
-
-import java.net.URL;
-
-import javax.management.ObjectName;
-
-import org.jboss.osgi.spi.management.ObjectNameFactory;
-import org.osgi.framework.BundleException;
-
-//$Id$
-
-/**
- * A Service that can be used to deploy/undeploy bundles or archives to/from the
runtime.
- *
- * @author thomas.diesler(a)jboss.com
- * @since 23-Jan-2009
- */
-public interface DeployerService
-{
- /**
- * The object name under which this is registered:
'jboss.osgi:service=DeployerService'
- */
- ObjectName MBEAN_DEPLOYER_SERVICE =
ObjectNameFactory.create("jboss.osgi:service=DeployerService");
-
- /**
- * Deploy an array of bundles
- */
- void deploy(BundleInfo[] bundles) throws BundleException;
-
- /**
- * Undeploy an array of bundles
- */
- void undeploy(BundleInfo[] bundles) throws BundleException;
-
- /**
- * Deploy bundle from URL
- */
- void deploy(URL url) throws BundleException;
-
- /**
- * Undeploy bundle from URL.
- *
- * Note, due to the dynamic nature of OSGi services it is
- * possible that a {@link DeployerService} is asked to undeploy
- * a bundle URL which it did not deploy itself.
- *
- * In this case this method should return false, so that the
- * {@link DeployerServiceDelegate} can use another {@link DeployerService}
- *
- * @return true if thhis service could undeploy the bundle
- */
- boolean undeploy(URL url) throws BundleException;
-}
\ No newline at end of file
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-06-01
07:50:26 UTC (rev 89588)
+++
projects/jboss-osgi/trunk/bundles/common/src/main/java/org/jboss/osgi/common/service/DeployerServiceDelegate.java 2009-06-01
08:00:17 UTC (rev 89589)
@@ -26,6 +26,8 @@
import java.net.URL;
import org.jboss.osgi.common.log.LogServiceTracker;
+import org.jboss.osgi.spi.service.BundleInfo;
+import org.jboss.osgi.spi.service.DeployerService;
import org.osgi.framework.BundleContext;
import org.osgi.framework.BundleException;
import org.osgi.framework.InvalidSyntaxException;
Deleted:
projects/jboss-osgi/trunk/bundles/common/src/main/java/org/jboss/osgi/common/service/MicrocontainerService.java
===================================================================
---
projects/jboss-osgi/trunk/bundles/common/src/main/java/org/jboss/osgi/common/service/MicrocontainerService.java 2009-06-01
07:50:26 UTC (rev 89588)
+++
projects/jboss-osgi/trunk/bundles/common/src/main/java/org/jboss/osgi/common/service/MicrocontainerService.java 2009-06-01
08:00:17 UTC (rev 89589)
@@ -1,66 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.osgi.common.service;
-
-//$Id$
-
-import java.util.List;
-
-/**
- * An OSGi Service the gives access to the Kernel and MBeanServer.
- *
- * @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 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);
-}
\ No newline at end of file
Modified: projects/jboss-osgi/trunk/bundles/hotdeploy/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/bundles/hotdeploy/pom.xml 2009-06-01 07:50:26 UTC (rev
89588)
+++ projects/jboss-osgi/trunk/bundles/hotdeploy/pom.xml 2009-06-01 08:00:17 UTC (rev
89589)
@@ -19,6 +19,10 @@
<!-- Dependencies -->
<dependencies>
+ <dependency>
+ <groupId>org.jboss.osgi</groupId>
+ <artifactId>jboss-osgi-spi</artifactId>
+ </dependency>
<!-- Bundle dependencies -->
<dependency>
@@ -55,6 +59,7 @@
javax.management,
org.jboss.osgi.common.log;version="1.0",
org.jboss.osgi.common.service;version="1.0",
+ org.jboss.osgi.spi.service;version="1.0",
org.osgi.framework,
org.osgi.service.log,
org.osgi.util.tracker
Modified:
projects/jboss-osgi/trunk/bundles/hotdeploy/src/main/java/org/jboss/osgi/service/hotdeploy/DeploymentScannerService.java
===================================================================
---
projects/jboss-osgi/trunk/bundles/hotdeploy/src/main/java/org/jboss/osgi/service/hotdeploy/DeploymentScannerService.java 2009-06-01
07:50:26 UTC (rev 89588)
+++
projects/jboss-osgi/trunk/bundles/hotdeploy/src/main/java/org/jboss/osgi/service/hotdeploy/DeploymentScannerService.java 2009-06-01
08:00:17 UTC (rev 89589)
@@ -25,7 +25,7 @@
import java.net.URL;
-import org.jboss.osgi.common.service.BundleInfo;
+import org.jboss.osgi.spi.service.BundleInfo;
/**
Modified:
projects/jboss-osgi/trunk/bundles/hotdeploy/src/main/java/org/jboss/osgi/service/hotdeploy/internal/BundleInfoImpl.java
===================================================================
---
projects/jboss-osgi/trunk/bundles/hotdeploy/src/main/java/org/jboss/osgi/service/hotdeploy/internal/BundleInfoImpl.java 2009-06-01
07:50:26 UTC (rev 89588)
+++
projects/jboss-osgi/trunk/bundles/hotdeploy/src/main/java/org/jboss/osgi/service/hotdeploy/internal/BundleInfoImpl.java 2009-06-01
08:00:17 UTC (rev 89589)
@@ -26,7 +26,7 @@
import java.net.URL;
import java.util.Dictionary;
-import org.jboss.osgi.common.service.BundleInfo;
+import org.jboss.osgi.spi.service.BundleInfo;
import org.osgi.framework.Bundle;
import org.osgi.framework.Constants;
Modified:
projects/jboss-osgi/trunk/bundles/hotdeploy/src/main/java/org/jboss/osgi/service/hotdeploy/internal/DeploymentScannerImpl.java
===================================================================
---
projects/jboss-osgi/trunk/bundles/hotdeploy/src/main/java/org/jboss/osgi/service/hotdeploy/internal/DeploymentScannerImpl.java 2009-06-01
07:50:26 UTC (rev 89588)
+++
projects/jboss-osgi/trunk/bundles/hotdeploy/src/main/java/org/jboss/osgi/service/hotdeploy/internal/DeploymentScannerImpl.java 2009-06-01
08:00:17 UTC (rev 89589)
@@ -35,10 +35,10 @@
import java.util.jar.Manifest;
import org.jboss.osgi.common.log.LogServiceTracker;
-import org.jboss.osgi.common.service.BundleInfo;
import org.jboss.osgi.common.service.DeployerServiceDelegate;
-import org.jboss.osgi.common.service.BundleInfo.State;
import org.jboss.osgi.service.hotdeploy.DeploymentScannerService;
+import org.jboss.osgi.spi.service.BundleInfo;
+import org.jboss.osgi.spi.service.BundleInfo.State;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
import org.osgi.framework.Constants;
Modified: projects/jboss-osgi/trunk/bundles/microcontainer/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/bundles/microcontainer/pom.xml 2009-06-01 07:50:26 UTC (rev
89588)
+++ projects/jboss-osgi/trunk/bundles/microcontainer/pom.xml 2009-06-01 08:00:17 UTC (rev
89589)
@@ -29,11 +29,15 @@
</dependency>
<dependency>
<groupId>org.jboss.osgi</groupId>
+ <artifactId>jboss-osgi-deployers</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.osgi</groupId>
<artifactId>jboss-osgi-spi</artifactId>
</dependency>
<dependency>
<groupId>org.jboss.osgi</groupId>
- <artifactId>jboss-osgi-deployers</artifactId>
+ <artifactId>jboss-osgi-integration-jbossas</artifactId>
</dependency>
<!-- Bundle Dependencies -->
@@ -140,6 +144,7 @@
jboss-metatype;inline=false,
jboss-mdr;inline=false,
jboss-osgi-deployers;inline=false,
+ jboss-osgi-integration-jbossas;inline=false,
jboss-kernel;inline=false,
</Embed-Dependency>
<_exportcontents>
Deleted:
projects/jboss-osgi/trunk/bundles/microcontainer/src/main/java/org/jboss/osgi/microcontainer/MicrocontainerServiceMBean.java
===================================================================
---
projects/jboss-osgi/trunk/bundles/microcontainer/src/main/java/org/jboss/osgi/microcontainer/MicrocontainerServiceMBean.java 2009-06-01
07:50:26 UTC (rev 89588)
+++
projects/jboss-osgi/trunk/bundles/microcontainer/src/main/java/org/jboss/osgi/microcontainer/MicrocontainerServiceMBean.java 2009-06-01
08:00:17 UTC (rev 89589)
@@ -1,49 +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.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();
-}
\ No newline at end of file
Deleted:
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-06-01
07:50:26 UTC (rev 89588)
+++
projects/jboss-osgi/trunk/bundles/microcontainer/src/main/java/org/jboss/osgi/microcontainer/internal/AbstractMicrocontainerService.java 2009-06-01
08:00:17 UTC (rev 89589)
@@ -1,286 +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.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, MicrocontainerServiceMBean
-{
- 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((MicrocontainerServiceMBean)this,
MicrocontainerServiceMBean.class);
- mbeanServer.registerMBean(mbean, 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
Modified:
projects/jboss-osgi/trunk/bundles/microcontainer/src/main/java/org/jboss/osgi/microcontainer/internal/MicrocontainerServiceActivator.java
===================================================================
---
projects/jboss-osgi/trunk/bundles/microcontainer/src/main/java/org/jboss/osgi/microcontainer/internal/MicrocontainerServiceActivator.java 2009-06-01
07:50:26 UTC (rev 89588)
+++
projects/jboss-osgi/trunk/bundles/microcontainer/src/main/java/org/jboss/osgi/microcontainer/internal/MicrocontainerServiceActivator.java 2009-06-01
08:00:17 UTC (rev 89589)
@@ -23,7 +23,7 @@
//$Id$
-import org.jboss.osgi.common.service.MicrocontainerService;
+import org.jboss.osgi.spi.service.MicrocontainerService;
import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;
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-06-01
07:50:26 UTC (rev 89588)
+++
projects/jboss-osgi/trunk/bundles/microcontainer/src/main/java/org/jboss/osgi/microcontainer/internal/MicrocontainerServiceImpl.java 2009-06-01
08:00:17 UTC (rev 89589)
@@ -31,8 +31,10 @@
import org.jboss.kernel.Kernel;
import org.jboss.kernel.spi.dependency.KernelController;
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.integration.jbossas.AbstractMicrocontainerService;
+import org.jboss.osgi.spi.service.DeployerService;
+import org.jboss.osgi.spi.service.MicrocontainerService;
+import org.jboss.osgi.spi.service.MicrocontainerServiceMBean;
import org.jboss.virtual.VFS;
import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceReference;
@@ -46,7 +48,7 @@
* @author thomas.diesler(a)jboss.com
* @since 23-Jan-2009
*/
-public class MicrocontainerServiceImpl extends AbstractMicrocontainerService
+public class MicrocontainerServiceImpl extends AbstractMicrocontainerService implements
MicrocontainerServiceMBean
{
private BundleContext context;
private EmbeddedBeansDeployer deployer;
Modified: projects/jboss-osgi/trunk/distribution/runtime/conf/jboss-osgi-felix.properties
===================================================================
---
projects/jboss-osgi/trunk/distribution/runtime/conf/jboss-osgi-felix.properties 2009-06-01
07:50:26 UTC (rev 89588)
+++
projects/jboss-osgi/trunk/distribution/runtime/conf/jboss-osgi-felix.properties 2009-06-01
08:00:17 UTC (rev 89589)
@@ -45,26 +45,15 @@
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.service;version=1.0, \
org.jboss.osgi.spi.testing;version=1.0, \
org.jboss.osgi.spi.testing.capability;version=1.0, \
org.jboss.virtual, \
org.jboss.virtual.plugins.registry, \
org.jboss.virtual.plugins.context.jar, \
org.jboss.virtual.plugins.vfs.helpers, \
- org.jboss.virtual.protocol, \
- org.apache.log4j, \
- org.jboss.util, \
- org.jboss.util.id, \
- org.jboss.util.threadpool, \
- org.jboss.util.propertyeditor
+ org.jboss.virtual.protocol
-# These are needed by jboss-remoting
-# org.apache.log4j, \
-# org.jboss.util, \
-# org.jboss.util.id, \
-# org.jboss.util.threadpool, \
-# org.jboss.util.propertyeditor
-
# Bundles that need to be installed with the Framework automatically
org.jboss.osgi.spi.framework.autoInstall=\
file://${osgi.home}/server/minimal/bundles/org.osgi.compendium.jar
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-06-01
07:50:26 UTC (rev 89588)
+++
projects/jboss-osgi/trunk/distribution/src/main/resources/installer/install-definition.xml 2009-06-01
08:00:17 UTC (rev 89589)
@@ -272,7 +272,6 @@
<!-- deployers/osgi.deployer -->
<fileset dir="(a){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" />
@@ -281,6 +280,8 @@
<!-- deploy/osgi -->
<fileset dir="(a){deploy.artifacts.dir}/lib"
targetdir="${jbossInstallPath}/server/${jbossTargetServer}/deploy/osgi"
override="true">
+ <include name="jboss-osgi-common.jar" />
+ <include name="jboss-osgi-webconsole.jar" />
<include name="org.apache.felix.configadmin.jar" />
<include name="org.apache.felix.http.jetty.jar" />
<include name="org.apache.felix.log.jar" />
@@ -292,13 +293,12 @@
<fileset condition="isFelix"
dir="(a){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="(a){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="(a){deploy.artifacts.dir}/lib"
targetdir="${jbossInstallPath}/server/${jbossTargetServer}/deploy/osgi"
override="true">
- <include name="jboss-osgi-webconsole.jar" />
+ <include name="org.osgi.compendium.jar" />
</fileset>
<!-- Equinox Integration -->
@@ -307,28 +307,26 @@
<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="(a){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>
- <!-- does not work with compendium in system classpath
<fileset condition="isEquinox"
dir="(a){deploy.artifacts.dir}/lib"
targetdir="${jbossInstallPath}/server/${jbossTargetServer}/deploy/osgi"
override="true">
+ <include name="org.eclipse.osgi.services.jar" />
<include name="jboss-osgi-webconsole.jar" />
- </fileset
- -->
+ </fileset>
<!-- Knopflerfish Integration -->
<fileset condition="isKnopflerfish"
dir="(a){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="(a){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="(a){deploy.artifacts.dir}/lib"
targetdir="${jbossInstallPath}/server/${jbossTargetServer}/deploy/osgi"
override="true">
+ <include name="org.osgi.compendium.jar" />
<include name="jboss-osgi-webconsole.jar" />
</fileset>
Modified:
projects/jboss-osgi/trunk/husky/testsuite/src/test/resources/jboss-osgi-felix.properties
===================================================================
---
projects/jboss-osgi/trunk/husky/testsuite/src/test/resources/jboss-osgi-felix.properties 2009-06-01
07:50:26 UTC (rev 89588)
+++
projects/jboss-osgi/trunk/husky/testsuite/src/test/resources/jboss-osgi-felix.properties 2009-06-01
08:00:17 UTC (rev 89589)
@@ -23,6 +23,7 @@
org.jboss.logging, \
org.jboss.osgi.spi;version=1.0, \
org.jboss.osgi.spi.management;version=1.0, \
+ org.jboss.osgi.spi.service;version=1.0, \
org.jboss.osgi.spi.testing;version=1.0, \
org.jboss.osgi.spi.testing.capability;version=1.0, \
org.osgi.framework;version=1.4
Modified: projects/jboss-osgi/trunk/integration/jbossas/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/integration/jbossas/pom.xml 2009-06-01 07:50:26 UTC (rev
89588)
+++ projects/jboss-osgi/trunk/integration/jbossas/pom.xml 2009-06-01 08:00:17 UTC (rev
89589)
@@ -22,14 +22,6 @@
<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/integration
(from rev 89588,
projects/jboss-osgi/branches/tdiesler/integration/jbossas/src/main/java/org/jboss/osgi/integration)
Copied:
projects/jboss-osgi/trunk/integration/jbossas/src/main/java/org/jboss/osgi/integration/jbossas
(from rev 89588,
projects/jboss-osgi/branches/tdiesler/integration/jbossas/src/main/java/org/jboss/osgi/integration/jbossas)
Deleted:
projects/jboss-osgi/trunk/integration/jbossas/src/main/java/org/jboss/osgi/integration/jbossas/AbstractMicrocontainerService.java
===================================================================
---
projects/jboss-osgi/branches/tdiesler/integration/jbossas/src/main/java/org/jboss/osgi/integration/jbossas/AbstractMicrocontainerService.java 2009-06-01
07:50:26 UTC (rev 89588)
+++
projects/jboss-osgi/trunk/integration/jbossas/src/main/java/org/jboss/osgi/integration/jbossas/AbstractMicrocontainerService.java 2009-06-01
08:00:17 UTC (rev 89589)
@@ -1,264 +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.integration.jbossas;
-
-//$Id$
-
-import static
org.jboss.osgi.spi.service.MicrocontainerServiceMBean.MBEAN_MICROCONTAINER_SERVICE;
-
-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.spi.service.BundleInfo;
-import org.jboss.osgi.spi.service.DeployerService;
-import org.jboss.osgi.spi.service.MicrocontainerService;
-import org.jboss.osgi.spi.service.MicrocontainerServiceMBean;
-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
- {
- deployInternal(new URL[] { url });
- }
-
- 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
- {
- URL[] urls = new URL[bundles.length];
- for (int i = 0; i < bundles.length; i++)
- urls[i] = bundles[i].getLocation();
-
- deployInternal(urls);
- }
-
- private void deployInternal(URL[] urls) 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 (URL location : urls)
- {
- VirtualFile file = VFS.createNewRoot(location);
- VFSDeployment deployment = deploymentFactory.createVFSDeployment(file);
- mainDeployer.addDeployment(deployment);
- deployments.add(deployment);
- contextMap.put(location, 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
- {
- StandardMBean mbean = new StandardMBean((MicrocontainerServiceMBean)this,
MicrocontainerServiceMBean.class);
- mbeanServer.registerMBean(mbean, MBEAN_MICROCONTAINER_SERVICE);
- }
- catch (Exception ex)
- {
- throw new IllegalStateException("Cannot register
MicrocontainerServiceMBean", ex);
- }
- }
-
- protected void unregisterMicrocontainerServiceMBean(MBeanServer mbeanServer)
- {
- if (mbeanServer.isRegistered(MBEAN_MICROCONTAINER_SERVICE))
- {
- try
- {
- logDebug("Unregister MicrocontainerServiceMBean");
- mbeanServer.unregisterMBean(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);
- }
- }
-}
\ No newline at end of file
Copied:
projects/jboss-osgi/trunk/integration/jbossas/src/main/java/org/jboss/osgi/integration/jbossas/AbstractMicrocontainerService.java
(from rev 89588,
projects/jboss-osgi/branches/tdiesler/integration/jbossas/src/main/java/org/jboss/osgi/integration/jbossas/AbstractMicrocontainerService.java)
===================================================================
---
projects/jboss-osgi/trunk/integration/jbossas/src/main/java/org/jboss/osgi/integration/jbossas/AbstractMicrocontainerService.java
(rev 0)
+++
projects/jboss-osgi/trunk/integration/jbossas/src/main/java/org/jboss/osgi/integration/jbossas/AbstractMicrocontainerService.java 2009-06-01
08:00:17 UTC (rev 89589)
@@ -0,0 +1,264 @@
+/*
+ * 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.integration.jbossas;
+
+//$Id$
+
+import static
org.jboss.osgi.spi.service.MicrocontainerServiceMBean.MBEAN_MICROCONTAINER_SERVICE;
+
+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.spi.service.BundleInfo;
+import org.jboss.osgi.spi.service.DeployerService;
+import org.jboss.osgi.spi.service.MicrocontainerService;
+import org.jboss.osgi.spi.service.MicrocontainerServiceMBean;
+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
+ {
+ deployInternal(new URL[] { url });
+ }
+
+ 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
+ {
+ URL[] urls = new URL[bundles.length];
+ for (int i = 0; i < bundles.length; i++)
+ urls[i] = bundles[i].getLocation();
+
+ deployInternal(urls);
+ }
+
+ private void deployInternal(URL[] urls) 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 (URL location : urls)
+ {
+ VirtualFile file = VFS.createNewRoot(location);
+ VFSDeployment deployment = deploymentFactory.createVFSDeployment(file);
+ mainDeployer.addDeployment(deployment);
+ deployments.add(deployment);
+ contextMap.put(location, 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
+ {
+ StandardMBean mbean = new StandardMBean((MicrocontainerServiceMBean)this,
MicrocontainerServiceMBean.class);
+ mbeanServer.registerMBean(mbean, MBEAN_MICROCONTAINER_SERVICE);
+ }
+ catch (Exception ex)
+ {
+ throw new IllegalStateException("Cannot register
MicrocontainerServiceMBean", ex);
+ }
+ }
+
+ protected void unregisterMicrocontainerServiceMBean(MBeanServer mbeanServer)
+ {
+ if (mbeanServer.isRegistered(MBEAN_MICROCONTAINER_SERVICE))
+ {
+ try
+ {
+ logDebug("Unregister MicrocontainerServiceMBean");
+ mbeanServer.unregisterMBean(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);
+ }
+ }
+}
\ No newline at end of file
Deleted:
projects/jboss-osgi/trunk/integration/jbossas/src/main/java/org/jboss/osgi/integration/jbossas/MicrocontainerServiceBean.java
===================================================================
---
projects/jboss-osgi/branches/tdiesler/integration/jbossas/src/main/java/org/jboss/osgi/integration/jbossas/MicrocontainerServiceBean.java 2009-06-01
07:50:26 UTC (rev 89588)
+++
projects/jboss-osgi/trunk/integration/jbossas/src/main/java/org/jboss/osgi/integration/jbossas/MicrocontainerServiceBean.java 2009-06-01
08:00:17 UTC (rev 89589)
@@ -1,139 +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.integration.jbossas;
-
-//$Id$
-
-import java.util.Properties;
-
-import javax.management.MBeanServer;
-import javax.naming.InitialContext;
-import javax.naming.NamingException;
-
-import org.jboss.kernel.Kernel;
-import org.jboss.kernel.spi.dependency.KernelController;
-import org.jboss.logging.Logger;
-import org.jboss.osgi.spi.service.DeployerService;
-import org.jboss.osgi.spi.service.MicrocontainerService;
-import org.jboss.osgi.spi.service.MicrocontainerServiceMBean;
-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();
-
- // Register the MBeanServer
- context.registerService(MBeanServer.class.getName(), mbeanServer, null);
- log.debug("MBeanServer registered");
-
- // Register the InitialContext service
- registerInitialContext();
- log.debug("InitialContext registered");
-
- // 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);
- log.debug("MicrocontainerService registered");
-
- // Register the DeployerService
- Properties props = new Properties();
- props.setProperty("provider", "microcontainer");
- context.registerService(DeployerService.class.getName(), this, props);
- log.debug("DeployerService registered");
-
- // Register the MicrocontainerServiceMBean
- registerMicrocontainerServiceMBean(mbeanServer);
- log.debug("MicrocontainerServiceMBean registered");
- }
-
- void stop()
- {
- unregisterMicrocontainerServiceMBean(mbeanServer);
- }
-
- public void registerInitialContext()
- {
- 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
Copied:
projects/jboss-osgi/trunk/integration/jbossas/src/main/java/org/jboss/osgi/integration/jbossas/MicrocontainerServiceBean.java
(from rev 89588,
projects/jboss-osgi/branches/tdiesler/integration/jbossas/src/main/java/org/jboss/osgi/integration/jbossas/MicrocontainerServiceBean.java)
===================================================================
---
projects/jboss-osgi/trunk/integration/jbossas/src/main/java/org/jboss/osgi/integration/jbossas/MicrocontainerServiceBean.java
(rev 0)
+++
projects/jboss-osgi/trunk/integration/jbossas/src/main/java/org/jboss/osgi/integration/jbossas/MicrocontainerServiceBean.java 2009-06-01
08:00:17 UTC (rev 89589)
@@ -0,0 +1,139 @@
+/*
+ * 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.integration.jbossas;
+
+//$Id$
+
+import java.util.Properties;
+
+import javax.management.MBeanServer;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+
+import org.jboss.kernel.Kernel;
+import org.jboss.kernel.spi.dependency.KernelController;
+import org.jboss.logging.Logger;
+import org.jboss.osgi.spi.service.DeployerService;
+import org.jboss.osgi.spi.service.MicrocontainerService;
+import org.jboss.osgi.spi.service.MicrocontainerServiceMBean;
+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();
+
+ // Register the MBeanServer
+ context.registerService(MBeanServer.class.getName(), mbeanServer, null);
+ log.debug("MBeanServer registered");
+
+ // Register the InitialContext service
+ registerInitialContext();
+ log.debug("InitialContext registered");
+
+ // 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);
+ log.debug("MicrocontainerService registered");
+
+ // Register the DeployerService
+ Properties props = new Properties();
+ props.setProperty("provider", "microcontainer");
+ context.registerService(DeployerService.class.getName(), this, props);
+ log.debug("DeployerService registered");
+
+ // Register the MicrocontainerServiceMBean
+ registerMicrocontainerServiceMBean(mbeanServer);
+ log.debug("MicrocontainerServiceMBean registered");
+ }
+
+ void stop()
+ {
+ unregisterMicrocontainerServiceMBean(mbeanServer);
+ }
+
+ public void registerInitialContext()
+ {
+ 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
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-06-01
07:50:26 UTC (rev 89588)
+++
projects/jboss-osgi/trunk/runtime/equinox/src/main/resources/osgi-deployers-jboss-beans.xml 2009-06-01
08:00:17 UTC (rev 89589)
@@ -36,9 +36,15 @@
<entry><key>org.jboss.osgi.deferred.start</key><value>true</value></entry>
</map>
</property>
+ <property name="autoInstall">
+ <list elementClass="java.net.URL">
+
<value>${jboss.server.home.url}/deploy/osgi/org.osgi.compendium.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>
+
<value>${jboss.server.home.url}/deploy/osgi/jboss-osgi-common.jar</value>
</list>
</property>
</bean>
@@ -57,30 +63,13 @@
********************************
-->
- <!-- 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">
+ <bean name="jboss.osgi:service=Microcontainer"
class="org.jboss.osgi.integration.jbossas.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>
- <!-- 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>
-
- <!-- 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-06-01
07:50:26 UTC (rev 89588)
+++
projects/jboss-osgi/trunk/runtime/felix/src/main/resources/osgi-deployers-jboss-beans.xml 2009-06-01
08:00:17 UTC (rev 89589)
@@ -66,9 +66,15 @@
<entry><key>org.jboss.osgi.husky.runtime.connector.port</key><value>5401</value></entry>
</map>
</property>
+ <property name="autoInstall">
+ <list elementClass="java.net.URL">
+
<value>${jboss.server.home.url}/deploy/osgi/org.osgi.compendium.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>
+
<value>${jboss.server.home.url}/deploy/osgi/jboss-osgi-common.jar</value>
</list>
</property>
</bean>
@@ -87,30 +93,13 @@
********************************
-->
- <!-- 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">
+ <bean name="jboss.osgi:service=Microcontainer"
class="org.jboss.osgi.integration.jbossas.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>
- <!-- 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>
-
- <!-- 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/knopflerfish/src/main/resources/osgi-deployers-jboss-beans.xml
===================================================================
---
projects/jboss-osgi/trunk/runtime/knopflerfish/src/main/resources/osgi-deployers-jboss-beans.xml 2009-06-01
07:50:26 UTC (rev 89588)
+++
projects/jboss-osgi/trunk/runtime/knopflerfish/src/main/resources/osgi-deployers-jboss-beans.xml 2009-06-01
08:00:17 UTC (rev 89589)
@@ -61,9 +61,15 @@
<entry><key>org.jboss.osgi.deferred.start</key><value>true</value></entry>
</map>
</property>
+ <property name="autoInstall">
+ <list elementClass="java.net.URL">
+
<value>${jboss.server.home.url}/deploy/osgi/org.osgi.compendium.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>
+
<value>${jboss.server.home.url}/deploy/osgi/jboss-osgi-common.jar</value>
</list>
</property>
</bean>
@@ -82,30 +88,13 @@
********************************
-->
- <!-- 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">
+ <bean name="jboss.osgi:service=Microcontainer"
class="org.jboss.osgi.integration.jbossas.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>
- <!-- 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>
-
- <!-- 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>
-
<!--
********************************
* *
Copied: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/service (from rev
89588,
projects/jboss-osgi/branches/tdiesler/spi/src/main/java/org/jboss/osgi/spi/service)
Deleted:
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/service/BundleInfo.java
===================================================================
---
projects/jboss-osgi/branches/tdiesler/spi/src/main/java/org/jboss/osgi/spi/service/BundleInfo.java 2009-06-01
07:50:26 UTC (rev 89588)
+++
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/service/BundleInfo.java 2009-06-01
08:00:17 UTC (rev 89589)
@@ -1,64 +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.spi.service;
-
-//$Id$
-
-import java.net.URL;
-
-
-/**
- * An abstraction of a bundle in the scan folder
- *
- * @author thomas.diesler(a)jboss.com
- * @since 27-May-2009
- */
-public interface BundleInfo
-{
- /**
- * The state of the bundle
- */
- enum State
- {
- NEW, INSTALLED, ACTIVE, UNINSTALLED
- }
-
- /**
- * Get the bundle location
- */
- URL getLocation();
-
- /**
- * Get the bundle state
- */
- State getState();
-
- /**
- * Get the bundle symbolic name
- */
- String getSymbolicName();
-
- /**
- * Get the bundle version
- */
- String getVersion();
-}
\ No newline at end of file
Copied:
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/service/BundleInfo.java
(from rev 89588,
projects/jboss-osgi/branches/tdiesler/spi/src/main/java/org/jboss/osgi/spi/service/BundleInfo.java)
===================================================================
---
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/service/BundleInfo.java
(rev 0)
+++
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/service/BundleInfo.java 2009-06-01
08:00:17 UTC (rev 89589)
@@ -0,0 +1,64 @@
+/*
+ * 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.spi.service;
+
+//$Id$
+
+import java.net.URL;
+
+
+/**
+ * An abstraction of a bundle in the scan folder
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 27-May-2009
+ */
+public interface BundleInfo
+{
+ /**
+ * The state of the bundle
+ */
+ enum State
+ {
+ NEW, INSTALLED, ACTIVE, UNINSTALLED
+ }
+
+ /**
+ * Get the bundle location
+ */
+ URL getLocation();
+
+ /**
+ * Get the bundle state
+ */
+ State getState();
+
+ /**
+ * Get the bundle symbolic name
+ */
+ String getSymbolicName();
+
+ /**
+ * Get the bundle version
+ */
+ String getVersion();
+}
\ No newline at end of file
Deleted:
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/service/DeployerService.java
===================================================================
---
projects/jboss-osgi/branches/tdiesler/spi/src/main/java/org/jboss/osgi/spi/service/DeployerService.java 2009-06-01
07:50:26 UTC (rev 89588)
+++
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/service/DeployerService.java 2009-06-01
08:00:17 UTC (rev 89589)
@@ -1,74 +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.spi.service;
-
-import java.net.URL;
-
-import javax.management.ObjectName;
-
-import org.jboss.osgi.spi.management.ObjectNameFactory;
-import org.osgi.framework.BundleException;
-
-//$Id$
-
-/**
- * A Service that can be used to deploy/undeploy bundles or archives to/from the
runtime.
- *
- * @author thomas.diesler(a)jboss.com
- * @since 23-Jan-2009
- */
-public interface DeployerService
-{
- /**
- * The object name under which this is registered:
'jboss.osgi:service=DeployerService'
- */
- ObjectName MBEAN_DEPLOYER_SERVICE =
ObjectNameFactory.create("jboss.osgi:service=DeployerService");
-
- /**
- * Deploy an array of bundles
- */
- void deploy(BundleInfo[] bundles) throws BundleException;
-
- /**
- * Undeploy an array of bundles
- */
- void undeploy(BundleInfo[] bundles) throws BundleException;
-
- /**
- * Deploy bundle from URL
- */
- void deploy(URL url) throws BundleException;
-
- /**
- * Undeploy bundle from URL.
- *
- * Note, due to the dynamic nature of OSGi services it is
- * possible that a {@link DeployerService} is asked to undeploy
- * a bundle URL which it did not deploy itself.
- *
- * In this case this method should return false, so that the
- * {@link DeployerServiceDelegate} can use another {@link DeployerService}
- *
- * @return true if thhis service could undeploy the bundle
- */
- boolean undeploy(URL url) throws BundleException;
-}
\ No newline at end of file
Copied:
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/service/DeployerService.java
(from rev 89588,
projects/jboss-osgi/branches/tdiesler/spi/src/main/java/org/jboss/osgi/spi/service/DeployerService.java)
===================================================================
---
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/service/DeployerService.java
(rev 0)
+++
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/service/DeployerService.java 2009-06-01
08:00:17 UTC (rev 89589)
@@ -0,0 +1,74 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.osgi.spi.service;
+
+import java.net.URL;
+
+import javax.management.ObjectName;
+
+import org.jboss.osgi.spi.management.ObjectNameFactory;
+import org.osgi.framework.BundleException;
+
+//$Id$
+
+/**
+ * A Service that can be used to deploy/undeploy bundles or archives to/from the
runtime.
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 23-Jan-2009
+ */
+public interface DeployerService
+{
+ /**
+ * The object name under which this is registered:
'jboss.osgi:service=DeployerService'
+ */
+ ObjectName MBEAN_DEPLOYER_SERVICE =
ObjectNameFactory.create("jboss.osgi:service=DeployerService");
+
+ /**
+ * Deploy an array of bundles
+ */
+ void deploy(BundleInfo[] bundles) throws BundleException;
+
+ /**
+ * Undeploy an array of bundles
+ */
+ void undeploy(BundleInfo[] bundles) throws BundleException;
+
+ /**
+ * Deploy bundle from URL
+ */
+ void deploy(URL url) throws BundleException;
+
+ /**
+ * Undeploy bundle from URL.
+ *
+ * Note, due to the dynamic nature of OSGi services it is
+ * possible that a {@link DeployerService} is asked to undeploy
+ * a bundle URL which it did not deploy itself.
+ *
+ * In this case this method should return false, so that the
+ * {@link DeployerServiceDelegate} can use another {@link DeployerService}
+ *
+ * @return true if thhis service could undeploy the bundle
+ */
+ boolean undeploy(URL url) throws BundleException;
+}
\ No newline at end of file
Deleted:
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/service/MicrocontainerService.java
===================================================================
---
projects/jboss-osgi/branches/tdiesler/spi/src/main/java/org/jboss/osgi/spi/service/MicrocontainerService.java 2009-06-01
07:50:26 UTC (rev 89588)
+++
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/service/MicrocontainerService.java 2009-06-01
08:00:17 UTC (rev 89589)
@@ -1,66 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.osgi.spi.service;
-
-//$Id$
-
-import java.util.List;
-
-/**
- * An OSGi Service the gives access to the Kernel and MBeanServer.
- *
- * @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 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);
-}
\ No newline at end of file
Copied:
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/service/MicrocontainerService.java
(from rev 89588,
projects/jboss-osgi/branches/tdiesler/spi/src/main/java/org/jboss/osgi/spi/service/MicrocontainerService.java)
===================================================================
---
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/service/MicrocontainerService.java
(rev 0)
+++
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/service/MicrocontainerService.java 2009-06-01
08:00:17 UTC (rev 89589)
@@ -0,0 +1,66 @@
+/*
+ * 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.spi.service;
+
+//$Id$
+
+import java.util.List;
+
+/**
+ * An OSGi Service the gives access to the Kernel and MBeanServer.
+ *
+ * @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 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);
+}
\ No newline at end of file
Deleted:
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/service/MicrocontainerServiceMBean.java
===================================================================
---
projects/jboss-osgi/branches/tdiesler/spi/src/main/java/org/jboss/osgi/spi/service/MicrocontainerServiceMBean.java 2009-06-01
07:50:26 UTC (rev 89588)
+++
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/service/MicrocontainerServiceMBean.java 2009-06-01
08:00:17 UTC (rev 89589)
@@ -1,49 +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.spi.service;
-
-//$Id$
-
-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();
-}
\ No newline at end of file
Copied:
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/service/MicrocontainerServiceMBean.java
(from rev 89588,
projects/jboss-osgi/branches/tdiesler/spi/src/main/java/org/jboss/osgi/spi/service/MicrocontainerServiceMBean.java)
===================================================================
---
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/service/MicrocontainerServiceMBean.java
(rev 0)
+++
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/service/MicrocontainerServiceMBean.java 2009-06-01
08:00:17 UTC (rev 89589)
@@ -0,0 +1,49 @@
+/*
+ * 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.spi.service;
+
+//$Id$
+
+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();
+}
\ No newline at end of file
Modified:
projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/microcontainer/MicrocontainerTestCase.java
===================================================================
---
projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/microcontainer/MicrocontainerTestCase.java 2009-06-01
07:50:26 UTC (rev 89588)
+++
projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/microcontainer/MicrocontainerTestCase.java 2009-06-01
08:00:17 UTC (rev 89589)
@@ -23,12 +23,12 @@
//$Id$
-import static org.jboss.osgi.common.service.DeployerService.MBEAN_DEPLOYER_SERVICE;
-import static org.jboss.osgi.common.service.MicrocontainerService.BEAN_KERNEL;
-import static org.jboss.osgi.common.service.MicrocontainerService.BEAN_MBEAN_SERVER;
-import static
org.jboss.osgi.common.service.MicrocontainerService.BEAN_SYSTEM_BUNDLE_CONTEXT;
-import static
org.jboss.osgi.microcontainer.MicrocontainerServiceMBean.MBEAN_MICROCONTAINER_SERVICE;
import static
org.jboss.osgi.spi.management.ManagedFrameworkMBean.MBEAN_MANAGED_FRAMEWORK;
+import static org.jboss.osgi.spi.service.DeployerService.MBEAN_DEPLOYER_SERVICE;
+import static org.jboss.osgi.spi.service.MicrocontainerService.BEAN_KERNEL;
+import static org.jboss.osgi.spi.service.MicrocontainerService.BEAN_MBEAN_SERVER;
+import static
org.jboss.osgi.spi.service.MicrocontainerService.BEAN_SYSTEM_BUNDLE_CONTEXT;
+import static
org.jboss.osgi.spi.service.MicrocontainerServiceMBean.MBEAN_MICROCONTAINER_SERVICE;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
@@ -37,10 +37,10 @@
import javax.management.ObjectName;
-import org.jboss.osgi.common.service.DeployerService;
-import org.jboss.osgi.microcontainer.MicrocontainerServiceMBean;
import org.jboss.osgi.spi.management.MBeanProxy;
import org.jboss.osgi.spi.management.ManagedFrameworkMBean;
+import org.jboss.osgi.spi.service.DeployerService;
+import org.jboss.osgi.spi.service.MicrocontainerServiceMBean;
import org.jboss.osgi.spi.testing.OSGiRuntime;
import org.jboss.osgi.spi.testing.OSGiTest;
import org.jboss.osgi.spi.testing.OSGiTestHelper;
Modified:
projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/microcontainer/bundleA/SomeService.java
===================================================================
---
projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/microcontainer/bundleA/SomeService.java 2009-06-01
07:50:26 UTC (rev 89588)
+++
projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/microcontainer/bundleA/SomeService.java 2009-06-01
08:00:17 UTC (rev 89589)
@@ -23,9 +23,9 @@
//$Id$
-import static
org.jboss.osgi.common.service.MicrocontainerService.BEAN_SYSTEM_BUNDLE_CONTEXT;
+import static
org.jboss.osgi.spi.service.MicrocontainerService.BEAN_SYSTEM_BUNDLE_CONTEXT;
-import org.jboss.osgi.common.service.MicrocontainerService;
+import org.jboss.osgi.spi.service.MicrocontainerService;
import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceReference;
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-06-01
07:50:26 UTC (rev 89588)
+++
projects/jboss-osgi/trunk/testsuite/example/src/test/resources/jboss-osgi-felix.properties 2009-06-01
08:00:17 UTC (rev 89589)
@@ -22,6 +22,7 @@
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.service;version=1.0, \
org.jboss.virtual, \
org.jboss.virtual.plugins.registry, \
org.jboss.virtual.plugins.context.jar, \
Modified:
projects/jboss-osgi/trunk/testsuite/example/src/test/resources/mcservice/example-mcservice-bundleA.bnd
===================================================================
---
projects/jboss-osgi/trunk/testsuite/example/src/test/resources/mcservice/example-mcservice-bundleA.bnd 2009-06-01
07:50:26 UTC (rev 89588)
+++
projects/jboss-osgi/trunk/testsuite/example/src/test/resources/mcservice/example-mcservice-bundleA.bnd 2009-06-01
08:00:17 UTC (rev 89589)
@@ -6,4 +6,4 @@
Export-Package: org.jboss.test.osgi.example.microcontainer.bundleA
-Import-Package: org.jboss.osgi.common.service, org.osgi.framework
+Import-Package: org.jboss.osgi.spi.service, org.osgi.framework
Modified:
projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jboss-osgi-felix.properties
===================================================================
---
projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jboss-osgi-felix.properties 2009-06-01
07:50:26 UTC (rev 89588)
+++
projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jboss-osgi-felix.properties 2009-06-01
08:00:17 UTC (rev 89589)
@@ -21,6 +21,7 @@
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.service;version=1.0, \
org.jboss.virtual, \
org.jboss.virtual.plugins.registry, \
org.jboss.virtual.plugins.context.jar, \
@@ -33,13 +34,6 @@
org.jboss.util.threadpool, \
org.jboss.util.propertyeditor
-# These are needed by jboss-remoting
-# org.apache.log4j, \
-# org.jboss.util, \
-# org.jboss.util.id, \
-# org.jboss.util.threadpool, \
-# org.jboss.util.propertyeditor
-
# Bundles that need to be installed with the Framework automatically
# org.jboss.osgi.spi.framework.autoInstall=
Modified:
projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/resources/jboss-osgi-felix.properties
===================================================================
---
projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/resources/jboss-osgi-felix.properties 2009-06-01
07:50:26 UTC (rev 89588)
+++
projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/resources/jboss-osgi-felix.properties 2009-06-01
08:00:17 UTC (rev 89589)
@@ -18,9 +18,10 @@
org.osgi.framework.system.packages.extra=\
org.jboss.logging, \
org.jboss.net.protocol, \
- org.jboss.osgi.spi, \
- org.jboss.osgi.spi.logging, \
- org.jboss.osgi.spi.management, \
+ 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.service;version=1.0, \
org.jboss.virtual, \
org.jboss.virtual.plugins.registry, \
org.jboss.virtual.plugins.context.jar, \
@@ -33,13 +34,6 @@
org.jboss.util.threadpool, \
org.jboss.util.propertyeditor
-# These are needed by jboss-remoting
-# org.apache.log4j, \
-# org.jboss.util, \
-# org.jboss.util.id, \
-# org.jboss.util.threadpool, \
-# org.jboss.util.propertyeditor
-
# Bundles that need to be installed with the Framework automatically
org.jboss.osgi.spi.framework.autoInstall=\
file://${test.archive.directory}/bundles/org.osgi.compendium.jar