[jboss-cvs] JBossAS SVN: r95093 - in projects/jboss-osgi: projects/bundles/microcontainer/trunk/src/main/java/org/jboss/osgi/microcontainer/integration and 7 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Mon Oct 19 03:29:27 EDT 2009
Author: thomas.diesler at jboss.com
Date: 2009-10-19 03:29:26 -0400 (Mon, 19 Oct 2009)
New Revision: 95093
Added:
projects/jboss-osgi/trunk/reactor/deployment/src/main/java/org/jboss/osgi/deployment/DeployerService.java
projects/jboss-osgi/trunk/reactor/deployment/src/main/java/org/jboss/osgi/deployment/DeployerServiceBase.java
projects/jboss-osgi/trunk/reactor/deployment/src/main/java/org/jboss/osgi/deployment/internal/DeploymentServicesActivator.java
Removed:
projects/jboss-osgi/trunk/reactor/deployment/src/main/java/org/jboss/osgi/deployment/DeploymentService.java
projects/jboss-osgi/trunk/reactor/deployment/src/main/java/org/jboss/osgi/deployment/DeploymentServiceBase.java
projects/jboss-osgi/trunk/reactor/deployment/src/main/java/org/jboss/osgi/deployment/internal/DeployerServiceDelegate.java
projects/jboss-osgi/trunk/reactor/deployment/src/main/java/org/jboss/osgi/deployment/internal/DeployersActivator.java
Modified:
projects/jboss-osgi/projects/bundles/hotdeploy/trunk/src/main/java/org/jboss/osgi/hotdeploy/internal/DeploymentScannerImpl.java
projects/jboss-osgi/projects/bundles/microcontainer/trunk/src/main/java/org/jboss/osgi/microcontainer/integration/AbstractMicrocontainerService.java
projects/jboss-osgi/projects/bundles/microcontainer/trunk/src/main/java/org/jboss/osgi/microcontainer/internal/MicrocontainerServiceImpl.java
projects/jboss-osgi/projects/runtime/felix/trunk/src/main/java/org/jboss/osgi/felix/FelixBundleContextWrapper.java
projects/jboss-osgi/projects/runtime/jbossas/trunk/src/main/java/org/jboss/osgi/microcontainer/integration/MicrocontainerServiceBean.java
projects/jboss-osgi/trunk/reactor/deployment/pom.xml
projects/jboss-osgi/trunk/reactor/deployment/src/main/java/org/jboss/osgi/deployment/Deployment.java
projects/jboss-osgi/trunk/reactor/deployment/src/main/java/org/jboss/osgi/deployment/DeploymentServiceCapability.java
projects/jboss-osgi/trunk/reactor/deployment/src/main/java/org/jboss/osgi/deployment/internal/DeploymentRegistryServiceImpl.java
projects/jboss-osgi/trunk/reactor/deployment/src/main/java/org/jboss/osgi/deployment/internal/SystemDeployerService.java
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/service/microcontainer/MicrocontainerServiceTestCase.java
Log:
[JBOSGI-183] Initial implementation of OSGi Deployers
Remove DeployerServiceDelegate
Modified: projects/jboss-osgi/projects/bundles/hotdeploy/trunk/src/main/java/org/jboss/osgi/hotdeploy/internal/DeploymentScannerImpl.java
===================================================================
--- projects/jboss-osgi/projects/bundles/hotdeploy/trunk/src/main/java/org/jboss/osgi/hotdeploy/internal/DeploymentScannerImpl.java 2009-10-19 07:22:47 UTC (rev 95092)
+++ projects/jboss-osgi/projects/bundles/hotdeploy/trunk/src/main/java/org/jboss/osgi/hotdeploy/internal/DeploymentScannerImpl.java 2009-10-19 07:29:26 UTC (rev 95093)
@@ -36,7 +36,7 @@
import org.jboss.osgi.deployment.Deployment;
import org.jboss.osgi.deployment.DeploymentScannerService;
-import org.jboss.osgi.deployment.DeploymentService;
+import org.jboss.osgi.deployment.DeployerService;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
import org.osgi.framework.BundleException;
@@ -62,7 +62,7 @@
private long beforeStart;
private long lastChange;
- private DeploymentService deployer;
+ private DeployerService deployer;
private ScannerThread scannerThread;
private List<Deployment> lastScan = new ArrayList<Deployment>();
private Map<String, Deployment> deploymentCache = new HashMap<String, Deployment>();
@@ -72,8 +72,8 @@
this.context = context;
// Get the DeployerService
- ServiceReference sref = context.getServiceReference(DeploymentService.class.getName());
- deployer = (DeploymentService)context.getService(sref);
+ ServiceReference sref = context.getServiceReference(DeployerService.class.getName());
+ deployer = (DeployerService)context.getService(sref);
initScanner(context);
}
Modified: projects/jboss-osgi/projects/bundles/microcontainer/trunk/src/main/java/org/jboss/osgi/microcontainer/integration/AbstractMicrocontainerService.java
===================================================================
--- projects/jboss-osgi/projects/bundles/microcontainer/trunk/src/main/java/org/jboss/osgi/microcontainer/integration/AbstractMicrocontainerService.java 2009-10-19 07:22:47 UTC (rev 95092)
+++ projects/jboss-osgi/projects/bundles/microcontainer/trunk/src/main/java/org/jboss/osgi/microcontainer/integration/AbstractMicrocontainerService.java 2009-10-19 07:29:26 UTC (rev 95093)
@@ -48,7 +48,7 @@
import org.jboss.kernel.spi.dependency.KernelController;
import org.jboss.kernel.spi.dependency.KernelControllerContext;
import org.jboss.osgi.deployment.Deployment;
-import org.jboss.osgi.deployment.DeploymentServiceBase;
+import org.jboss.osgi.deployment.DeployerServiceBase;
import org.jboss.osgi.deployment.DeploymentRegistryService;
import org.jboss.osgi.spi.OSGiConstants;
import org.jboss.osgi.spi.management.MicrocontainerServiceMBean;
@@ -65,7 +65,7 @@
* @author thomas.diesler at jboss.com
* @since 23-Jan-2009
*/
-public abstract class AbstractMicrocontainerService extends DeploymentServiceBase implements MicrocontainerService
+public abstract class AbstractMicrocontainerService extends DeployerServiceBase implements MicrocontainerService
{
private VFSDeploymentFactory deploymentFactory = VFSDeploymentFactory.getInstance();
private ServiceTracker registryTracker;
Modified: projects/jboss-osgi/projects/bundles/microcontainer/trunk/src/main/java/org/jboss/osgi/microcontainer/internal/MicrocontainerServiceImpl.java
===================================================================
--- projects/jboss-osgi/projects/bundles/microcontainer/trunk/src/main/java/org/jboss/osgi/microcontainer/internal/MicrocontainerServiceImpl.java 2009-10-19 07:22:47 UTC (rev 95092)
+++ projects/jboss-osgi/projects/bundles/microcontainer/trunk/src/main/java/org/jboss/osgi/microcontainer/internal/MicrocontainerServiceImpl.java 2009-10-19 07:29:26 UTC (rev 95093)
@@ -35,13 +35,14 @@
import org.jboss.kernel.Kernel;
import org.jboss.kernel.spi.dependency.KernelController;
import org.jboss.osgi.common.log.LogServiceTracker;
-import org.jboss.osgi.deployment.DeploymentService;
+import org.jboss.osgi.deployment.DeployerService;
import org.jboss.osgi.jbossxb.XMLBindingService;
import org.jboss.osgi.microcontainer.integration.AbstractMicrocontainerService;
import org.jboss.osgi.spi.management.MicrocontainerServiceMBean;
import org.jboss.osgi.spi.service.MicrocontainerService;
import org.jboss.virtual.VFS;
import org.osgi.framework.BundleContext;
+import org.osgi.framework.Constants;
import org.osgi.framework.Filter;
import org.osgi.framework.InvalidSyntaxException;
import org.osgi.framework.ServiceReference;
@@ -49,7 +50,7 @@
import org.osgi.util.tracker.ServiceTracker;
/**
- * An implementation of the {@link DeploymentService} and {@link MicrocontainerService}
+ * An implementation of the {@link DeployerService} and {@link MicrocontainerService}
* which is installed as a bundle
*
* @author thomas.diesler at jboss.com
@@ -147,8 +148,9 @@
// Register the DeployerService
Properties props = new Properties();
props.setProperty("provider", "microcontainer");
+ props.put(Constants.SERVICE_RANKING, Integer.MAX_VALUE);
log.log(LogService.LOG_DEBUG, "Register DeployerService");
- context.registerService(DeploymentService.class.getName(), mcServiceImpl, props);
+ context.registerService(DeployerService.class.getName(), mcServiceImpl, props);
// Register the MicrocontainerServiceMBean
registerMicrocontainerServiceMBean(mbeanServer);
Modified: projects/jboss-osgi/projects/runtime/felix/trunk/src/main/java/org/jboss/osgi/felix/FelixBundleContextWrapper.java
===================================================================
--- projects/jboss-osgi/projects/runtime/felix/trunk/src/main/java/org/jboss/osgi/felix/FelixBundleContextWrapper.java 2009-10-19 07:22:47 UTC (rev 95092)
+++ projects/jboss-osgi/projects/runtime/felix/trunk/src/main/java/org/jboss/osgi/felix/FelixBundleContextWrapper.java 2009-10-19 07:29:26 UTC (rev 95093)
@@ -26,7 +26,7 @@
import java.net.URL;
import org.jboss.logging.Logger;
-import org.jboss.osgi.deployment.DeploymentService;
+import org.jboss.osgi.deployment.DeployerService;
import org.jboss.osgi.spi.framework.BundleContextWrapper;
import org.jboss.osgi.spi.util.BundleInfo;
import org.osgi.framework.Bundle;
@@ -63,10 +63,10 @@
Bundle bundle;
- ServiceReference sref = context.getServiceReference(DeploymentService.class.getName());
+ ServiceReference sref = context.getServiceReference(DeployerService.class.getName());
if (sref != null)
{
- DeploymentService service = (DeploymentService)context.getService(sref);
+ DeployerService service = (DeployerService)context.getService(sref);
service.deploy(bundleURL);
bundle = getBundle(symbolicName, version, true);
}
Modified: projects/jboss-osgi/projects/runtime/jbossas/trunk/src/main/java/org/jboss/osgi/microcontainer/integration/MicrocontainerServiceBean.java
===================================================================
--- projects/jboss-osgi/projects/runtime/jbossas/trunk/src/main/java/org/jboss/osgi/microcontainer/integration/MicrocontainerServiceBean.java 2009-10-19 07:22:47 UTC (rev 95092)
+++ projects/jboss-osgi/projects/runtime/jbossas/trunk/src/main/java/org/jboss/osgi/microcontainer/integration/MicrocontainerServiceBean.java 2009-10-19 07:29:26 UTC (rev 95093)
@@ -31,13 +31,14 @@
import org.jboss.kernel.Kernel;
import org.jboss.kernel.spi.dependency.KernelController;
import org.jboss.logging.Logger;
-import org.jboss.osgi.deployment.DeploymentService;
+import org.jboss.osgi.deployment.DeployerService;
import org.jboss.osgi.spi.management.MicrocontainerServiceMBean;
import org.jboss.osgi.spi.service.MicrocontainerService;
import org.osgi.framework.BundleContext;
+import org.osgi.framework.Constants;
/**
- * An implementation of the {@link DeploymentService} and {@link MicrocontainerService}
+ * An implementation of the {@link DeployerService} and {@link MicrocontainerService}
* which is installed as MC bean in jbossas.
*
* @author thomas.diesler at jboss.com
@@ -102,7 +103,8 @@
// Register the DeployerService
Properties props = new Properties();
props.setProperty("provider", "microcontainer");
- bundleContext.registerService(DeploymentService.class.getName(), this, props);
+ props.put(Constants.SERVICE_RANKING, Integer.MAX_VALUE);
+ bundleContext.registerService(DeployerService.class.getName(), this, props);
log.debug("DeployerService registered");
// Register the MicrocontainerServiceMBean
Modified: projects/jboss-osgi/trunk/reactor/deployment/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/reactor/deployment/pom.xml 2009-10-19 07:22:47 UTC (rev 95092)
+++ projects/jboss-osgi/trunk/reactor/deployment/pom.xml 2009-10-19 07:29:26 UTC (rev 95093)
@@ -67,7 +67,7 @@
<configuration>
<instructions>
<Bundle-SymbolicName>${artifactId}</Bundle-SymbolicName>
- <Bundle-Activator>org.jboss.osgi.deployment.internal.DeployersActivator</Bundle-Activator>
+ <Bundle-Activator>org.jboss.osgi.deployment.internal.DeploymentServicesActivator</Bundle-Activator>
<Export-Package>
org.jboss.osgi.deployment;version=1.0,
</Export-Package>
Copied: projects/jboss-osgi/trunk/reactor/deployment/src/main/java/org/jboss/osgi/deployment/DeployerService.java (from rev 95091, projects/jboss-osgi/trunk/reactor/deployment/src/main/java/org/jboss/osgi/deployment/DeploymentService.java)
===================================================================
--- projects/jboss-osgi/trunk/reactor/deployment/src/main/java/org/jboss/osgi/deployment/DeployerService.java (rev 0)
+++ projects/jboss-osgi/trunk/reactor/deployment/src/main/java/org/jboss/osgi/deployment/DeployerService.java 2009-10-19 07:29:26 UTC (rev 95093)
@@ -0,0 +1,79 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.osgi.deployment;
+
+//$Id$
+
+import java.net.URL;
+
+import javax.management.ObjectName;
+
+import org.jboss.osgi.spi.management.ObjectNameFactory;
+import org.osgi.framework.BundleException;
+
+/**
+ * A Service that can be used to deploy/undeploy bundles or archives to/from the runtime.
+ *
+ * @author thomas.diesler at 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");
+
+ /**
+ * Create a deployment from the given location.
+ */
+ Deployment createDeployment(String location) throws BundleException;
+
+ /**
+ * Deploy an array of bundles
+ */
+ void deploy(Deployment[] bundleDeps) throws BundleException;
+
+ /**
+ * Undeploy an array of bundles
+ */
+ void undeploy(Deployment[] bundleDeps) 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
+ * another {@link DeployerService} can be tried.
+ *
+ * @return true if this service could undeploy the bundle
+ */
+ boolean undeploy(URL url) throws BundleException;
+}
\ No newline at end of file
Copied: projects/jboss-osgi/trunk/reactor/deployment/src/main/java/org/jboss/osgi/deployment/DeployerServiceBase.java (from rev 95091, projects/jboss-osgi/trunk/reactor/deployment/src/main/java/org/jboss/osgi/deployment/DeploymentServiceBase.java)
===================================================================
--- projects/jboss-osgi/trunk/reactor/deployment/src/main/java/org/jboss/osgi/deployment/DeployerServiceBase.java (rev 0)
+++ projects/jboss-osgi/trunk/reactor/deployment/src/main/java/org/jboss/osgi/deployment/DeployerServiceBase.java 2009-10-19 07:29:26 UTC (rev 95093)
@@ -0,0 +1,103 @@
+/*
+ * 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.deployment;
+
+import java.io.File;
+import java.io.IOException;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.jar.Attributes;
+import java.util.jar.JarFile;
+import java.util.jar.Manifest;
+
+import org.jboss.osgi.deployment.internal.DeploymentImpl;
+import org.osgi.framework.BundleException;
+import org.osgi.framework.Constants;
+
+//$Id$
+
+/**
+ * An abstract base implementation of the DeployerService.
+ *
+ * @author thomas.diesler at jboss.com
+ * @since 16-Oct-2009
+ */
+public abstract class DeployerServiceBase implements DeployerService
+{
+ public Deployment createDeployment(String location) throws BundleException
+ {
+ // Try location as URL
+ URL url = null;
+ try
+ {
+ url = new URL(location);
+ }
+ catch (MalformedURLException ex)
+ {
+ // ignore
+ }
+
+ // Try location as File
+ if (url == null)
+ {
+ try
+ {
+ File file = new File(location);
+ if (file.exists())
+ url = file.toURI().toURL();
+ }
+ catch (MalformedURLException e)
+ {
+ // ignore
+ }
+ }
+
+ if (url == null)
+ throw new IllegalArgumentException("Invalid bundle location: " + location);
+
+ return createDeploymentInternal(url);
+ }
+
+ private Deployment createDeploymentInternal(URL url) throws BundleException
+ {
+ Manifest manifest;
+ try
+ {
+ JarFile jarFile = new JarFile(url.getPath());
+ manifest = jarFile.getManifest();
+ jarFile.close();
+ }
+ catch (IOException ex)
+ {
+ throw new BundleException("Cannot get manifest from: " + url);
+
+ }
+
+ Attributes attribs = manifest.getMainAttributes();
+ String symbolicName = attribs.getValue(Constants.BUNDLE_SYMBOLICNAME);
+ if (symbolicName == null)
+ throw new BundleException("Cannot obtain Bundle-SymbolicName for: " + url);
+
+ String version = attribs.getValue(Constants.BUNDLE_VERSION);
+ return new DeploymentImpl(url, symbolicName, version);
+ }
+}
\ No newline at end of file
Modified: projects/jboss-osgi/trunk/reactor/deployment/src/main/java/org/jboss/osgi/deployment/Deployment.java
===================================================================
--- projects/jboss-osgi/trunk/reactor/deployment/src/main/java/org/jboss/osgi/deployment/Deployment.java 2009-10-19 07:22:47 UTC (rev 95092)
+++ projects/jboss-osgi/trunk/reactor/deployment/src/main/java/org/jboss/osgi/deployment/Deployment.java 2009-10-19 07:29:26 UTC (rev 95093)
@@ -14,7 +14,7 @@
* 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
+ * 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.
Deleted: projects/jboss-osgi/trunk/reactor/deployment/src/main/java/org/jboss/osgi/deployment/DeploymentService.java
===================================================================
--- projects/jboss-osgi/trunk/reactor/deployment/src/main/java/org/jboss/osgi/deployment/DeploymentService.java 2009-10-19 07:22:47 UTC (rev 95092)
+++ projects/jboss-osgi/trunk/reactor/deployment/src/main/java/org/jboss/osgi/deployment/DeploymentService.java 2009-10-19 07:29:26 UTC (rev 95093)
@@ -1,79 +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.deployment;
-
-//$Id$
-
-import java.net.URL;
-
-import javax.management.ObjectName;
-
-import org.jboss.osgi.spi.management.ObjectNameFactory;
-import org.osgi.framework.BundleException;
-
-/**
- * A Service that can be used to deploy/undeploy bundles or archives to/from the runtime.
- *
- * @author thomas.diesler at jboss.com
- * @since 23-Jan-2009
- */
-public interface DeploymentService
-{
- /**
- * The object name under which this is registered: 'jboss.osgi:service=DeployerService'
- */
- ObjectName MBEAN_DEPLOYER_SERVICE = ObjectNameFactory.create("jboss.osgi:service=DeployerService");
-
- /**
- * Create a deployment from the given location.
- */
- Deployment createDeployment(String location) throws BundleException;
-
- /**
- * Deploy an array of bundles
- */
- void deploy(Deployment[] bundleDeps) throws BundleException;
-
- /**
- * Undeploy an array of bundles
- */
- void undeploy(Deployment[] bundleDeps) 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 DeploymentService} is asked to undeploy
- * a bundle URL which it did not deploy itself.
- *
- * In this case this method should return false, so that
- * another {@link DeploymentService} can be tried.
- *
- * @return true if this service could undeploy the bundle
- */
- boolean undeploy(URL url) throws BundleException;
-}
\ No newline at end of file
Deleted: projects/jboss-osgi/trunk/reactor/deployment/src/main/java/org/jboss/osgi/deployment/DeploymentServiceBase.java
===================================================================
--- projects/jboss-osgi/trunk/reactor/deployment/src/main/java/org/jboss/osgi/deployment/DeploymentServiceBase.java 2009-10-19 07:22:47 UTC (rev 95092)
+++ projects/jboss-osgi/trunk/reactor/deployment/src/main/java/org/jboss/osgi/deployment/DeploymentServiceBase.java 2009-10-19 07:29:26 UTC (rev 95093)
@@ -1,103 +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.deployment;
-
-import java.io.File;
-import java.io.IOException;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.util.jar.Attributes;
-import java.util.jar.JarFile;
-import java.util.jar.Manifest;
-
-import org.jboss.osgi.deployment.internal.DeploymentImpl;
-import org.osgi.framework.BundleException;
-import org.osgi.framework.Constants;
-
-//$Id$
-
-/**
- * An abstract base implementation of the DeployerService.
- *
- * @author thomas.diesler at jboss.com
- * @since 16-Oct-2009
- */
-public abstract class DeploymentServiceBase implements DeploymentService
-{
- public Deployment createDeployment(String location) throws BundleException
- {
- // Try location as URL
- URL url = null;
- try
- {
- url = new URL(location);
- }
- catch (MalformedURLException ex)
- {
- // ignore
- }
-
- // Try location as File
- if (url == null)
- {
- try
- {
- File file = new File(location);
- if (file.exists())
- url = file.toURI().toURL();
- }
- catch (MalformedURLException e)
- {
- // ignore
- }
- }
-
- if (url == null)
- throw new IllegalArgumentException("Invalid bundle location: " + location);
-
- return createDeploymentInternal(url);
- }
-
- private Deployment createDeploymentInternal(URL url) throws BundleException
- {
- Manifest manifest;
- try
- {
- JarFile jarFile = new JarFile(url.getPath());
- manifest = jarFile.getManifest();
- jarFile.close();
- }
- catch (IOException ex)
- {
- throw new BundleException("Cannot get manifest from: " + url);
-
- }
-
- Attributes attribs = manifest.getMainAttributes();
- String symbolicName = attribs.getValue(Constants.BUNDLE_SYMBOLICNAME);
- if (symbolicName == null)
- throw new BundleException("Cannot obtain Bundle-SymbolicName for: " + url);
-
- String version = attribs.getValue(Constants.BUNDLE_VERSION);
- return new DeploymentImpl(url, symbolicName, version);
- }
-}
\ No newline at end of file
Modified: projects/jboss-osgi/trunk/reactor/deployment/src/main/java/org/jboss/osgi/deployment/DeploymentServiceCapability.java
===================================================================
--- projects/jboss-osgi/trunk/reactor/deployment/src/main/java/org/jboss/osgi/deployment/DeploymentServiceCapability.java 2009-10-19 07:22:47 UTC (rev 95092)
+++ projects/jboss-osgi/trunk/reactor/deployment/src/main/java/org/jboss/osgi/deployment/DeploymentServiceCapability.java 2009-10-19 07:29:26 UTC (rev 95093)
@@ -30,7 +30,7 @@
* Adds the DeploymentService capability to the {@link OSGiRuntime}
* under test.
*
- * It is ignored if the {@link DeploymentService} is already registered.
+ * It is ignored if the {@link DeployerService} is already registered.
*
* Installed bundles: jboss-osgi-deployment.jar
*
@@ -41,7 +41,7 @@
{
public DeploymentServiceCapability()
{
- super(DeploymentService.class.getName());
+ super(DeployerService.class.getName());
addBundle("bundles/jboss-osgi-deployment.jar");
}
Deleted: projects/jboss-osgi/trunk/reactor/deployment/src/main/java/org/jboss/osgi/deployment/internal/DeployerServiceDelegate.java
===================================================================
--- projects/jboss-osgi/trunk/reactor/deployment/src/main/java/org/jboss/osgi/deployment/internal/DeployerServiceDelegate.java 2009-10-19 07:22:47 UTC (rev 95092)
+++ projects/jboss-osgi/trunk/reactor/deployment/src/main/java/org/jboss/osgi/deployment/internal/DeployerServiceDelegate.java 2009-10-19 07:29:26 UTC (rev 95093)
@@ -1,143 +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.deployment.internal;
-
-//$Id$
-
-import java.net.URL;
-
-import org.jboss.osgi.deployment.Deployment;
-import org.jboss.osgi.deployment.DeploymentService;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.BundleException;
-import org.osgi.framework.InvalidSyntaxException;
-import org.osgi.framework.ServiceReference;
-
-/**
- * A {@link DeploymentService} that delegates to the service that is tracked by the given {@link DeployerServiceTracker}
- *
- * This delegate is registered as an MBean
- *
- * @author thomas.diesler at jboss.com
- * @since 27-May-2009
- */
-public class DeployerServiceDelegate implements DeploymentService
-{
- private BundleContext context;
-
- public DeployerServiceDelegate(BundleContext context)
- {
- this.context = context;
- }
-
- public Deployment createDeployment(String location) throws BundleException
- {
- DeploymentService service = getDefaultDeployerService();
- return service.createDeployment(location);
- }
-
- public void deploy(Deployment[] bundles) throws BundleException
- {
- DeploymentService service = getDefaultDeployerService();
- service.deploy(bundles);
- }
-
- public void deploy(URL url) throws BundleException
- {
- DeploymentService service = getDefaultDeployerService();
- service.deploy(url);
- }
-
- public void undeploy(Deployment[] bundles) throws BundleException
- {
- for (Deployment info : bundles)
- undeploy(info.getLocation());
- }
-
- public boolean undeploy(URL url) throws BundleException
- {
- boolean undeployed = false;
-
- DeploymentService service = getMicrocontainerDeployerService();
- if (service != null)
- undeployed = service.undeploy(url);
-
- if (undeployed == false)
- {
- service = getSystemDeployerService();
- undeployed = service.undeploy(url);
- }
-
- return undeployed;
- }
-
- private DeploymentService getDefaultDeployerService()
- {
- // First try the MC provider
- DeploymentService service = getMicrocontainerDeployerService();
-
- // Fall back to the system provider
- if (service == null)
- service = getSystemDeployerService();
-
- return service;
- }
-
- private DeploymentService getMicrocontainerDeployerService()
- {
- DeploymentService service = null;
- try
- {
- String filter = "(provider=microcontainer)";
- String serviceName = DeploymentService.class.getName();
- ServiceReference[] srefs = context.getServiceReferences(serviceName, filter);
- if (srefs != null)
- service = (DeploymentService)context.getService(srefs[0]);
- }
- catch (InvalidSyntaxException ex)
- {
- throw new IllegalArgumentException(ex);
- }
- return service;
- }
-
- private DeploymentService getSystemDeployerService()
- {
- DeploymentService service = null;
- try
- {
- String filter = "(provider=system)";
- String serviceName = DeploymentService.class.getName();
- ServiceReference[] srefs = context.getServiceReferences(serviceName, filter);
- if (srefs != null)
- service = (DeploymentService)context.getService(srefs[0]);
- }
- catch (InvalidSyntaxException ex)
- {
- throw new IllegalArgumentException(ex);
- }
-
- if (service == null)
- throw new IllegalStateException("Cannot obtain system DeployerService");
- return service;
- }
-}
\ No newline at end of file
Deleted: projects/jboss-osgi/trunk/reactor/deployment/src/main/java/org/jboss/osgi/deployment/internal/DeployersActivator.java
===================================================================
--- projects/jboss-osgi/trunk/reactor/deployment/src/main/java/org/jboss/osgi/deployment/internal/DeployersActivator.java 2009-10-19 07:22:47 UTC (rev 95092)
+++ projects/jboss-osgi/trunk/reactor/deployment/src/main/java/org/jboss/osgi/deployment/internal/DeployersActivator.java 2009-10-19 07:29:26 UTC (rev 95093)
@@ -1,158 +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.deployment.internal;
-
-//$Id$
-
-import java.util.Properties;
-
-import javax.management.JMException;
-import javax.management.MBeanServer;
-import javax.management.StandardMBean;
-
-import org.jboss.osgi.deployment.DeploymentService;
-import org.jboss.osgi.deployment.DeploymentInterceptor;
-import org.jboss.osgi.deployment.DeploymentInterceptorService;
-import org.jboss.osgi.deployment.DeploymentRegistryService;
-import org.jboss.osgi.spi.NotImplementedException;
-import org.osgi.framework.BundleActivator;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.Constants;
-import org.osgi.framework.ServiceReference;
-import org.osgi.util.tracker.ServiceTracker;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-
-/**
- * The deployers activator
- *
- * @author thomas.diesler at jboss.com
- * @since 15-Oct-2009
- */
-public class DeployersActivator implements BundleActivator
-{
- // Provide logging
- private Logger log = LoggerFactory.getLogger(DeployersActivator.class);
-
- public void start(BundleContext context) throws Exception
- {
- // Register the system SystemDeployerService and DeployerServiceDelegate
- DeploymentService deployer = registerDeployerServices(context);
-
- // Track the MBeanServer and register the DeployerServiceDelegate
- trackMBeanServer(context, deployer);
-
- DeploymentInterceptorService service = new DeploymentInterceptorService()
- {
- public void removeInterceptor(DeploymentInterceptor deployer)
- {
- throw new NotImplementedException();
- }
-
- public void addInterceptor(DeploymentInterceptor deployer)
- {
- throw new NotImplementedException();
- }
- };
- context.registerService(DeploymentInterceptorService.class.getName(), service, null);
- }
-
- public void stop(BundleContext context) throws Exception
- {
- ServiceReference sref = context.getServiceReference(MBeanServer.class.getName());
- if (sref != null)
- {
- MBeanServer mbeanServer = (MBeanServer)context.getService(sref);
- unregisterDeployerServiceMBean(mbeanServer);
- }
- }
-
- protected DeploymentService registerDeployerServices(BundleContext context)
- {
- // Register the DeploymentRegistryService
- DeploymentRegistryService registry = new DeploymentRegistryServiceImpl(context);
- context.registerService(DeploymentRegistryService.class.getName(), registry, null);
-
- // Register the SystemDeployerService
- Properties props = new Properties();
- props.put("provider", "system");
- SystemDeployerService systemDeployer = new SystemDeployerService(context);
- context.registerService(DeploymentService.class.getName(), systemDeployer, props);
-
- // Register the DeployerServiceDelegate
- props = new Properties();
- props.put(Constants.SERVICE_RANKING, Integer.MAX_VALUE);
- DeploymentService deployerDelegate = new DeployerServiceDelegate(context);
- context.registerService(DeploymentService.class.getName(), deployerDelegate, props);
- return deployerDelegate;
- }
-
- private void trackMBeanServer(BundleContext context, final DeploymentService deployer)
- {
- ServiceTracker jmxTracker = new ServiceTracker(context, MBeanServer.class.getName(), null)
- {
- @Override
- public Object addingService(ServiceReference reference)
- {
- MBeanServer mbeanServer = (MBeanServer)super.addingService(reference);
- registerDeployerServiceMBean(mbeanServer, deployer);
- return mbeanServer;
- }
-
- @Override
- public void removedService(ServiceReference reference, Object service)
- {
- MBeanServer mbeanServer = (MBeanServer)service;
- unregisterDeployerServiceMBean(mbeanServer);
- super.removedService(reference, service);
- }
- };
- jmxTracker.open();
- }
-
- private void registerDeployerServiceMBean(MBeanServer mbeanServer, DeploymentService delegate)
- {
- try
- {
- StandardMBean mbean = new StandardMBean(delegate, DeploymentService.class);
- mbeanServer.registerMBean(mbean, DeploymentService.MBEAN_DEPLOYER_SERVICE);
- }
- catch (JMException ex)
- {
- throw new IllegalStateException("Cannot register DeployerService MBean", ex);
- }
- }
-
- private void unregisterDeployerServiceMBean(MBeanServer mbeanServer)
- {
- try
- {
- if (mbeanServer.isRegistered(DeploymentService.MBEAN_DEPLOYER_SERVICE))
- mbeanServer.unregisterMBean(DeploymentService.MBEAN_DEPLOYER_SERVICE);
- }
- catch (JMException ex)
- {
- log.error("Cannot unregister DeployerService MBean", ex);
- }
- }
-}
\ No newline at end of file
Modified: projects/jboss-osgi/trunk/reactor/deployment/src/main/java/org/jboss/osgi/deployment/internal/DeploymentRegistryServiceImpl.java
===================================================================
--- projects/jboss-osgi/trunk/reactor/deployment/src/main/java/org/jboss/osgi/deployment/internal/DeploymentRegistryServiceImpl.java 2009-10-19 07:22:47 UTC (rev 95092)
+++ projects/jboss-osgi/trunk/reactor/deployment/src/main/java/org/jboss/osgi/deployment/internal/DeploymentRegistryServiceImpl.java 2009-10-19 07:29:26 UTC (rev 95093)
@@ -28,13 +28,13 @@
import java.util.Set;
import org.jboss.osgi.deployment.Deployment;
-import org.jboss.osgi.deployment.DeploymentService;
+import org.jboss.osgi.deployment.DeployerService;
import org.jboss.osgi.deployment.DeploymentRegistryService;
import org.osgi.framework.BundleContext;
import org.osgi.framework.Version;
/**
- * A {@link DeploymentService} that installs/uninstalls the bundles directly on the OSGi framework without going through the MC registered deployers.
+ * A {@link DeployerService} that installs/uninstalls the bundles directly on the OSGi framework without going through the MC registered deployers.
*
* @author thomas.diesler at jboss.com
* @since 27-May-2009
Copied: projects/jboss-osgi/trunk/reactor/deployment/src/main/java/org/jboss/osgi/deployment/internal/DeploymentServicesActivator.java (from rev 95091, projects/jboss-osgi/trunk/reactor/deployment/src/main/java/org/jboss/osgi/deployment/internal/DeployersActivator.java)
===================================================================
--- projects/jboss-osgi/trunk/reactor/deployment/src/main/java/org/jboss/osgi/deployment/internal/DeploymentServicesActivator.java (rev 0)
+++ projects/jboss-osgi/trunk/reactor/deployment/src/main/java/org/jboss/osgi/deployment/internal/DeploymentServicesActivator.java 2009-10-19 07:29:26 UTC (rev 95093)
@@ -0,0 +1,179 @@
+/*
+ * 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.deployment.internal;
+
+//$Id$
+
+import java.util.Properties;
+
+import javax.management.JMException;
+import javax.management.MBeanServer;
+import javax.management.StandardMBean;
+
+import org.jboss.osgi.deployment.DeployerService;
+import org.jboss.osgi.deployment.DeploymentInterceptor;
+import org.jboss.osgi.deployment.DeploymentInterceptorService;
+import org.jboss.osgi.deployment.DeploymentRegistryService;
+import org.jboss.osgi.spi.NotImplementedException;
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceReference;
+import org.osgi.util.tracker.ServiceTracker;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * The deployers activator
+ *
+ * @author thomas.diesler at jboss.com
+ * @since 15-Oct-2009
+ */
+public class DeploymentServicesActivator implements BundleActivator
+{
+ // Provide logging
+ private Logger log = LoggerFactory.getLogger(DeploymentServicesActivator.class);
+
+ public void start(BundleContext context) throws Exception
+ {
+ // Register the deployer related services
+ registerDeployerService(context);
+
+ DeploymentInterceptorService service = new DeploymentInterceptorService()
+ {
+ public void removeInterceptor(DeploymentInterceptor deployer)
+ {
+ throw new NotImplementedException();
+ }
+
+ public void addInterceptor(DeploymentInterceptor deployer)
+ {
+ throw new NotImplementedException();
+ }
+ };
+ context.registerService(DeploymentInterceptorService.class.getName(), service, null);
+ }
+
+ public void stop(BundleContext context) throws Exception
+ {
+ }
+
+ protected void registerDeployerService(BundleContext context)
+ {
+ // Register the DeploymentRegistryService
+ DeploymentRegistryService registry = new DeploymentRegistryServiceImpl(context);
+ context.registerService(DeploymentRegistryService.class.getName(), registry, null);
+
+ // Register the SystemDeployerService
+ Properties props = new Properties();
+ props.put("provider", "system");
+ SystemDeployerService deployerService = new SystemDeployerService(context);
+ context.registerService(DeployerService.class.getName(), deployerService, props);
+
+ // Track the MBeanServer and register the DeployerService
+ ServiceTracker jmxTracker = new ServiceTracker(context, MBeanServer.class.getName(), null)
+ {
+ @Override
+ public Object addingService(ServiceReference reference)
+ {
+ MBeanServer mbeanServer = (MBeanServer)super.addingService(reference);
+ registerDeployerServiceMBean(context, mbeanServer);
+ return mbeanServer;
+ }
+
+ @Override
+ public void removedService(ServiceReference reference, Object service)
+ {
+ MBeanServer mbeanServer = (MBeanServer)service;
+ unregisterDeployerServiceMBean(mbeanServer);
+ super.removedService(reference, service);
+ }
+ };
+ jmxTracker.open();
+
+ // Track the DeployerService and register it as an MBean
+ ServiceTracker serviceTracker = new ServiceTracker(context, DeployerService.class.getName(), null)
+ {
+ @Override
+ public Object addingService(ServiceReference reference)
+ {
+ DeployerService service = (DeployerService)super.addingService(reference);
+ ServiceReference sref = context.getServiceReference(MBeanServer.class.getName());
+ if (sref != null)
+ {
+ MBeanServer mbeanServer = (MBeanServer)context.getService(sref);
+ registerDeployerServiceMBean(context, mbeanServer);
+ }
+ return service;
+ }
+
+ @Override
+ public void removedService(ServiceReference reference, Object service)
+ {
+ ServiceReference sref = context.getServiceReference(MBeanServer.class.getName());
+ if (sref != null)
+ {
+ MBeanServer mbeanServer = (MBeanServer)context.getService(sref);
+ unregisterDeployerServiceMBean(mbeanServer);
+ }
+ super.removedService(reference, service);
+ }
+ };
+ serviceTracker.open();
+ }
+
+ private void registerDeployerServiceMBean(BundleContext context, MBeanServer mbeanServer)
+ {
+ try
+ {
+ // Get the DeployerService with the highest ranking
+ ServiceReference sref = context.getServiceReference(DeployerService.class.getName());
+ if (sref == null)
+ throw new IllegalStateException("Cannot obtain deployer service");
+
+ // Unregister the DeployerService with a potentialy lower ranking
+ if (mbeanServer.isRegistered(DeployerService.MBEAN_DEPLOYER_SERVICE))
+ mbeanServer.unregisterMBean(DeployerService.MBEAN_DEPLOYER_SERVICE);
+
+ // Register the DeployerService with the highest ranking
+ DeployerService service = (DeployerService)context.getService(sref);
+ StandardMBean mbean = new StandardMBean(service, DeployerService.class);
+ mbeanServer.registerMBean(mbean, DeployerService.MBEAN_DEPLOYER_SERVICE);
+ }
+ catch (JMException ex)
+ {
+ throw new IllegalStateException("Cannot register DeployerService MBean", ex);
+ }
+ }
+
+ private void unregisterDeployerServiceMBean(MBeanServer mbeanServer)
+ {
+ try
+ {
+ if (mbeanServer.isRegistered(DeployerService.MBEAN_DEPLOYER_SERVICE))
+ mbeanServer.unregisterMBean(DeployerService.MBEAN_DEPLOYER_SERVICE);
+ }
+ catch (JMException ex)
+ {
+ log.error("Cannot unregister DeployerService MBean", ex);
+ }
+ }
+}
\ No newline at end of file
Modified: projects/jboss-osgi/trunk/reactor/deployment/src/main/java/org/jboss/osgi/deployment/internal/SystemDeployerService.java
===================================================================
--- projects/jboss-osgi/trunk/reactor/deployment/src/main/java/org/jboss/osgi/deployment/internal/SystemDeployerService.java 2009-10-19 07:22:47 UTC (rev 95092)
+++ projects/jboss-osgi/trunk/reactor/deployment/src/main/java/org/jboss/osgi/deployment/internal/SystemDeployerService.java 2009-10-19 07:29:26 UTC (rev 95093)
@@ -31,8 +31,8 @@
import java.util.Map.Entry;
import org.jboss.osgi.deployment.Deployment;
-import org.jboss.osgi.deployment.DeploymentService;
-import org.jboss.osgi.deployment.DeploymentServiceBase;
+import org.jboss.osgi.deployment.DeployerService;
+import org.jboss.osgi.deployment.DeployerServiceBase;
import org.jboss.osgi.deployment.DeploymentRegistryService;
import org.jboss.osgi.spi.logging.ExportedPackageHelper;
import org.jboss.osgi.spi.management.ManagedBundleService;
@@ -48,12 +48,12 @@
import org.slf4j.LoggerFactory;
/**
- * A {@link DeploymentService} that installs/uninstalls the bundles directly on the OSGi framework without going through the MC registered deployers.
+ * A {@link DeployerService} that installs/uninstalls the bundles directly on the OSGi framework without going through the MC registered deployers.
*
* @author thomas.diesler at jboss.com
* @since 27-May-2009
*/
-public class SystemDeployerService extends DeploymentServiceBase
+public class SystemDeployerService extends DeployerServiceBase
{
// Provide logging
private Logger log = LoggerFactory.getLogger(SystemDeployerService.class);
Modified: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/service/microcontainer/MicrocontainerServiceTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/service/microcontainer/MicrocontainerServiceTestCase.java 2009-10-19 07:22:47 UTC (rev 95092)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/service/microcontainer/MicrocontainerServiceTestCase.java 2009-10-19 07:29:26 UTC (rev 95093)
@@ -23,7 +23,7 @@
//$Id$
-import static org.jboss.osgi.deployment.DeploymentService.MBEAN_DEPLOYER_SERVICE;
+import static org.jboss.osgi.deployment.DeployerService.MBEAN_DEPLOYER_SERVICE;
import static org.jboss.osgi.spi.management.ManagedFrameworkMBean.MBEAN_MANAGED_FRAMEWORK;
import static org.jboss.osgi.spi.management.MicrocontainerServiceMBean.MBEAN_MICROCONTAINER_SERVICE;
import static org.jboss.test.osgi.service.microcontainer.bundleB.SomeBeanMBean.MBEAN_NAME;
@@ -36,7 +36,7 @@
import javax.management.ObjectName;
-import org.jboss.osgi.deployment.DeploymentService;
+import org.jboss.osgi.deployment.DeployerService;
import org.jboss.osgi.jbossxb.XMLBindingCapability;
import org.jboss.osgi.jmx.JMXCapability;
import org.jboss.osgi.jndi.JNDICapability;
@@ -92,12 +92,12 @@
}
/**
- * Test whether a bundle can be deployed through the {@link DeploymentService}
+ * Test whether a bundle can be deployed through the {@link DeployerService}
*/
@Test
public void testBundleDeployment() throws Exception
{
- DeploymentService deployer = MBeanProxy.get(DeploymentService.class, MBEAN_DEPLOYER_SERVICE, runtime.getMBeanServer());
+ DeployerService deployer = MBeanProxy.get(DeployerService.class, MBEAN_DEPLOYER_SERVICE, runtime.getMBeanServer());
deployer.deploy(getTestArchiveURL("service/mcservice-bundleA.jar"));
ManagedFrameworkMBean frameworkMBean = MBeanProxy.get(ManagedFrameworkMBean.class, MBEAN_MANAGED_FRAMEWORK, runtime.getMBeanServer());
@@ -108,13 +108,13 @@
}
/**
- * Test whether a bundle that contains beans can be deployed through the {@link DeploymentService}
+ * Test whether a bundle that contains beans can be deployed through the {@link DeployerService}
*/
@Test
public void testBeansDeployment() throws Exception
{
MicrocontainerServiceMBean mcService = MBeanProxy.get(MicrocontainerServiceMBean.class, MBEAN_MICROCONTAINER_SERVICE, runtime.getMBeanServer());
- DeploymentService deployer = MBeanProxy.get(DeploymentService.class, MBEAN_DEPLOYER_SERVICE, runtime.getMBeanServer());
+ DeployerService deployer = MBeanProxy.get(DeployerService.class, MBEAN_DEPLOYER_SERVICE, runtime.getMBeanServer());
deployer.deploy(getTestArchiveURL("service/mcservice-bundleB.jar"));
More information about the jboss-cvs-commits
mailing list