[jboss-cvs] JBossAS SVN: r84809 - in projects/jboss-osgi/trunk: runtime/spi/src/main/java/org/jboss/osgi/spi/internal and 10 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Thu Feb 26 10:34:27 EST 2009
Author: thomas.diesler at jboss.com
Date: 2009-02-26 10:34:27 -0500 (Thu, 26 Feb 2009)
New Revision: 84809
Added:
projects/jboss-osgi/trunk/runtime/spi/src/main/java/org/jboss/osgi/spi/junit/EmbeddedArchiveDeployer.java
projects/jboss-osgi/trunk/runtime/spi/src/main/java/org/jboss/osgi/spi/junit/RemoteArchiveDeployer.java
projects/jboss-osgi/trunk/testsuite/src/test/java/org/jboss/test/osgi/bootstrap/
projects/jboss-osgi/trunk/testsuite/src/test/java/org/jboss/test/osgi/bootstrap/BootstrapTest.java
projects/jboss-osgi/trunk/testsuite/src/test/resources/jbosgi36/META-INF/jbosgi36-jboss-beans.xml
projects/jboss-osgi/trunk/testsuite/src/test/resources/jboss-osgi-beans.xml
projects/jboss-osgi/trunk/testsuite/src/test/resources/jboss-osgi-bootstrap-beans.xml
Removed:
projects/jboss-osgi/trunk/runtime/spi/src/main/java/org/jboss/osgi/spi/junit/JBossArchiveDeployer.java
projects/jboss-osgi/trunk/testsuite/src/test/java/org/jboss/osgi/
projects/jboss-osgi/trunk/testsuite/src/test/resources/jbosgi36/META-INF/jbosgi36-service.xml
Modified:
projects/jboss-osgi/trunk/runtime/spi/pom.xml
projects/jboss-osgi/trunk/runtime/spi/src/main/java/org/jboss/osgi/spi/internal/MicrocontainerConfigurationProvider.java
projects/jboss-osgi/trunk/runtime/spi/src/main/java/org/jboss/osgi/spi/junit/IntegrationTestCase.java
projects/jboss-osgi/trunk/runtime/spi/src/main/java/org/jboss/osgi/spi/junit/IntegrationTestHelper.java
projects/jboss-osgi/trunk/runtime/spi/src/main/java/org/jboss/osgi/spi/junit/IntegrationTestSetup.java
projects/jboss-osgi/trunk/testsuite/
projects/jboss-osgi/trunk/testsuite/pom.xml
projects/jboss-osgi/trunk/testsuite/scripts/antrun-test-jars.xml
projects/jboss-osgi/trunk/testsuite/src/test/java/org/jboss/test/osgi/jbosgi36/junit/JBOSGI36Test.java
projects/jboss-osgi/trunk/testsuite/src/test/java/org/jboss/test/osgi/jbosgi36/mbean/Foo.java
Log:
Support embedded bootstrap
Modified: projects/jboss-osgi/trunk/runtime/spi/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/runtime/spi/pom.xml 2009-02-26 15:03:04 UTC (rev 84808)
+++ projects/jboss-osgi/trunk/runtime/spi/pom.xml 2009-02-26 15:34:27 UTC (rev 84809)
@@ -23,6 +23,14 @@
<artifactId>org.osgi.core</artifactId>
</dependency>
<dependency>
+ <groupId>org.jboss.deployers</groupId>
+ <artifactId>jboss-deployers-client-spi</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.deployers</groupId>
+ <artifactId>jboss-deployers-vfs</artifactId>
+ </dependency>
+ <dependency>
<groupId>org.jboss.microcontainer</groupId>
<artifactId>jboss-kernel</artifactId>
</dependency>
Modified: projects/jboss-osgi/trunk/runtime/spi/src/main/java/org/jboss/osgi/spi/internal/MicrocontainerConfigurationProvider.java
===================================================================
--- projects/jboss-osgi/trunk/runtime/spi/src/main/java/org/jboss/osgi/spi/internal/MicrocontainerConfigurationProvider.java 2009-02-26 15:03:04 UTC (rev 84808)
+++ projects/jboss-osgi/trunk/runtime/spi/src/main/java/org/jboss/osgi/spi/internal/MicrocontainerConfigurationProvider.java 2009-02-26 15:34:27 UTC (rev 84809)
@@ -31,10 +31,10 @@
import org.jboss.kernel.Kernel;
import org.jboss.kernel.plugins.bootstrap.basic.KernelConstants;
import org.jboss.osgi.spi.NotImplementedException;
+import org.jboss.osgi.spi.framework.AbstractAttributeProvider;
+import org.jboss.osgi.spi.framework.AttributeProvider;
import org.jboss.osgi.spi.framework.OSGiConfigurationProvider;
import org.jboss.osgi.spi.framework.OSGiFramework;
-import org.jboss.osgi.spi.framework.AttributeProvider;
-import org.jboss.osgi.spi.framework.AbstractAttributeProvider;
/**
* The ConfigurationProvider provides a Framework through a given configuration method
@@ -44,75 +44,88 @@
*/
public class MicrocontainerConfigurationProvider extends AbstractAttributeProvider implements OSGiConfigurationProvider, AttributeProvider
{
- /* The Framework bean name - jboss.osgi:service=Framework */
- public static final String DEFAULT_BEAN_NAME = "jboss.osgi:service=Framework";
- /* The default bean config: jboss-osgi-beans.xml */
- public static final String DEFAULT_BEANS_CONFIG = "osgi-jboss-beans.xml";
+ /* The Framework bean name - jboss.osgi:service=Framework */
+ public static final String DEFAULT_FRAMEWORK_NAME = "jboss.osgi:service=Framework";
+ /* The default framework beans: jboss-osgi-bootstrap-beans.xml */
+ public static final String DEFAULT_BOOTSTRAP_BEANS = "jboss-osgi-bootstrap-beans.xml";
+ /* The default framework beans: jboss-osgi-beans.xml */
+ public static final String DEFAULT_FRAMEWORK_BEANS = "jboss-osgi-beans.xml";
- private Kernel kernel;
+ private EmbeddedBeansDeployer deployer = new EmbeddedBeansDeployer();
+ private Kernel kernel;
- public OSGiFramework getFramework()
- {
- return getFramework(this);
- }
+ public OSGiFramework getFramework()
+ {
+ return getFramework(this);
+ }
- public OSGiFramework getFramework(AttributeProvider attributeProvider)
- {
- return getFramework(attributeProvider, DEFAULT_BEAN_NAME);
- }
+ public OSGiFramework getFramework(AttributeProvider attributeProvider)
+ {
+ return getFramework(attributeProvider, DEFAULT_FRAMEWORK_NAME);
+ }
- @SuppressWarnings("deprecation")
- public OSGiFramework getFramework(AttributeProvider attributeProvider, String beanName)
- {
- kernel = attributeProvider.getAttribute(KernelConstants.KERNEL_NAME, Kernel.class);
+ public OSGiFramework getFramework(AttributeProvider attributeProvider, String beanName)
+ {
+ kernel = attributeProvider.getAttribute(KernelConstants.KERNEL_NAME, Kernel.class);
- if (kernel == null)
- configure(DEFAULT_BEANS_CONFIG);
+ if (kernel == null)
+ configure(DEFAULT_FRAMEWORK_BEANS);
- Controller controller = kernel.getController();
- ControllerContext context = controller.getInstalledContext(beanName);
- return (OSGiFramework)context.getTarget();
- }
+ Controller controller = kernel.getController();
+ ControllerContext context = controller.getInstalledContext(beanName);
+ return (OSGiFramework)context.getTarget();
+ }
- public void configure(InputStream streamConfig)
- {
- throw new NotImplementedException("Cannot bootstrap JBossMC from InputStream");
- }
+ public void configure(InputStream streamConfig)
+ {
+ throw new NotImplementedException("Cannot bootstrap JBossMC from InputStream");
+ }
- public void configure(String resourceConfig)
- {
- URL urlConfig = Thread.currentThread().getContextClassLoader().getResource(resourceConfig);
- if (urlConfig == null)
- throw new IllegalStateException("Cannot find resource: " + resourceConfig);
+ public void configure(String resourceConfig)
+ {
+ URL urlConfig = Thread.currentThread().getContextClassLoader().getResource(resourceConfig);
+ if (urlConfig == null)
+ throw new IllegalStateException("Cannot find resource: " + resourceConfig);
- deploy(urlConfig);
- }
+ deploy(urlConfig);
+ }
- public void configure(URL urlConfig)
- {
- deploy(urlConfig);
- }
+ public void configure(URL urlConfig)
+ {
+ deploy(urlConfig);
+ }
- private void deploy(URL urlConfig)
- {
- EmbeddedBeansDeployer deployer = new EmbeddedBeansDeployer();
- deployer.deploy(urlConfig);
- kernel = deployer.getKernel();
-
- if (kernel == null)
- throw new IllegalStateException("Cannot obtain kernel, after beans deployment");
- }
+ private void deploy(URL urlConfig)
+ {
+ if (kernel == null)
+ bootstrapKernel();
+ deployer.deploy(urlConfig);
+
+ if (kernel == null)
+ throw new IllegalStateException("Cannot obtain kernel, after beans deployment");
+ }
+
+ private void bootstrapKernel()
+ {
+ // Deploy the bootstrap beans if DEFAULT_BOOTSTRAP_BEANS is on the classpath
+ URL urlBootstrap = Thread.currentThread().getContextClassLoader().getResource(DEFAULT_BOOTSTRAP_BEANS);
+ if (urlBootstrap != null)
+ deployer.deploy(urlBootstrap);
+
+ kernel = deployer.getKernel();
+ }
+
public Object getAttribute(String name)
{
if (kernel == null)
- return null;
+ bootstrapKernel();
if (KernelConstants.KERNEL_NAME.equals(name))
return kernel;
Controller controller = kernel.getController();
- ControllerContext context = controller.getInstalledContext(name);
+ ControllerContext context = controller.getInstalledContext(name);
return context.getTarget();
}
}
\ No newline at end of file
Added: projects/jboss-osgi/trunk/runtime/spi/src/main/java/org/jboss/osgi/spi/junit/EmbeddedArchiveDeployer.java
===================================================================
--- projects/jboss-osgi/trunk/runtime/spi/src/main/java/org/jboss/osgi/spi/junit/EmbeddedArchiveDeployer.java (rev 0)
+++ projects/jboss-osgi/trunk/runtime/spi/src/main/java/org/jboss/osgi/spi/junit/EmbeddedArchiveDeployer.java 2009-02-26 15:34:27 UTC (rev 84809)
@@ -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.junit;
+
+import java.net.URL;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.jboss.deployers.client.spi.DeployerClient;
+import org.jboss.deployers.vfs.spi.client.VFSDeployment;
+import org.jboss.deployers.vfs.spi.client.VFSDeploymentFactory;
+import org.jboss.virtual.VFS;
+
+/**
+ * An archive deployer that deals with test deployment/undeployment, etc.
+ *
+ * @author Thomas.Diesler at jboss.org
+ * @since 26-Feb-2009
+ */
+public class EmbeddedArchiveDeployer implements ArchiveDeployer
+{
+ private DeployerClient deployer;
+ private Map<String, VFSDeployment> deployments = new HashMap<String, VFSDeployment>();
+
+ public EmbeddedArchiveDeployer(DeployerClient deployer)
+ {
+ if (deployer == null)
+ throw new IllegalArgumentException("Cannot construct archive deployer with: " + deployer);
+
+ this.deployer = deployer;
+ }
+
+ public void deploy(URL url) throws Exception
+ {
+ VFSDeploymentFactory factory = VFSDeploymentFactory.getInstance();
+ VFSDeployment deployment = factory.createVFSDeployment(VFS.getRoot(url));
+ deployer.deploy(deployment);
+ deployments.put(url.toExternalForm(), deployment);
+ }
+
+ public void undeploy(URL url) throws Exception
+ {
+ VFSDeployment deployment = deployments.remove(url.toExternalForm());
+ if (deployment != null)
+ deployer.undeploy(deployment);
+ }
+}
Property changes on: projects/jboss-osgi/trunk/runtime/spi/src/main/java/org/jboss/osgi/spi/junit/EmbeddedArchiveDeployer.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: projects/jboss-osgi/trunk/runtime/spi/src/main/java/org/jboss/osgi/spi/junit/IntegrationTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/runtime/spi/src/main/java/org/jboss/osgi/spi/junit/IntegrationTestCase.java 2009-02-26 15:03:04 UTC (rev 84808)
+++ projects/jboss-osgi/trunk/runtime/spi/src/main/java/org/jboss/osgi/spi/junit/IntegrationTestCase.java 2009-02-26 15:34:27 UTC (rev 84809)
@@ -28,8 +28,9 @@
import javax.management.MBeanServerConnection;
import org.jboss.logging.Logger;
+import org.jboss.osgi.spi.framework.OSGiConfiguration;
+import org.jboss.osgi.spi.framework.OSGiConfigurationProvider;
-
/**
* An integration test case
*
@@ -38,43 +39,73 @@
*/
public class IntegrationTestCase extends OSGiTestCase
{
- // Provide logging
- final Logger log = Logger.getLogger(IntegrationTestCase.class);
+ // Provide logging
+ final Logger log = Logger.getLogger(IntegrationTestCase.class);
- IntegrationTestHelper delegate = new IntegrationTestHelper();
-
- public boolean isTargetJBoss50()
- {
- return delegate.isTargetJBoss50();
- }
-
- public void deploy(String archive) throws Exception
- {
- delegate.deploy(archive);
- }
+ private IntegrationTestHelper delegate;
+ private OSGiConfigurationProvider configProvider;
- public void deploy(URL archive) throws Exception
- {
- delegate.deploy(archive);
- }
+ private IntegrationTestHelper getDelegate()
+ {
+ if (delegate == null)
+ {
+ delegate = new IntegrationTestHelper(getConfigurationProvider());
+ }
+ return delegate;
+ }
- public void undeploy(String archive) throws Exception
- {
- delegate.undeploy(archive);
- }
+ // Overwrite to provide an OSGiConfigurationProvider
+ public OSGiConfigurationProvider getConfigurationProvider()
+ {
+ if (configProvider == null)
+ {
+ configProvider = OSGiConfiguration.getConfigurationProvider();
+ }
+ return configProvider;
+ }
- public void undeploy(URL archive) throws Exception
- {
- delegate.undeploy(archive);
- }
+ public void setConfigurationProvider(OSGiConfigurationProvider configProvider)
+ {
+ this.configProvider = configProvider;
+ }
- public MBeanServerConnection getServer()
- {
- return delegate.getServer();
- }
+ public boolean isRemoteIntegration()
+ {
+ return getDelegate().isRemoteIntegration();
+ }
- public String getServerHost()
- {
- return delegate.getServerHost();
- }
+ public boolean isTargetJBoss50()
+ {
+ return getDelegate().isTargetJBoss50();
+ }
+
+ public void deploy(String archive) throws Exception
+ {
+ getDelegate().deploy(archive);
+ }
+
+ public void deploy(URL archive) throws Exception
+ {
+ getDelegate().deploy(archive);
+ }
+
+ public void undeploy(String archive) throws Exception
+ {
+ getDelegate().undeploy(archive);
+ }
+
+ public void undeploy(URL archive) throws Exception
+ {
+ getDelegate().undeploy(archive);
+ }
+
+ public MBeanServerConnection getServer()
+ {
+ return getDelegate().getServer();
+ }
+
+ public String getServerHost()
+ {
+ return getDelegate().getServerHost();
+ }
}
Modified: projects/jboss-osgi/trunk/runtime/spi/src/main/java/org/jboss/osgi/spi/junit/IntegrationTestHelper.java
===================================================================
--- projects/jboss-osgi/trunk/runtime/spi/src/main/java/org/jboss/osgi/spi/junit/IntegrationTestHelper.java 2009-02-26 15:03:04 UTC (rev 84808)
+++ projects/jboss-osgi/trunk/runtime/spi/src/main/java/org/jboss/osgi/spi/junit/IntegrationTestHelper.java 2009-02-26 15:34:27 UTC (rev 84809)
@@ -29,6 +29,11 @@
import javax.naming.InitialContext;
import javax.naming.NamingException;
+import org.jboss.deployers.client.spi.DeployerClient;
+import org.jboss.deployers.client.spi.main.MainDeployer;
+import org.jboss.osgi.spi.framework.AttributeProvider;
+import org.jboss.osgi.spi.framework.OSGiConfigurationProvider;
+
/**
* An integration test helper that deals with test deployment/undeployment, etc.
*
@@ -37,87 +42,107 @@
*/
public class IntegrationTestHelper extends OSGiTestHelper
{
- private static MBeanServerConnection server;
- private String integrationTarget;
+ private static MBeanServerConnection server;
+ private OSGiConfigurationProvider configProvider;
+ private String integrationTarget;
- public void deploy(String archive) throws Exception
- {
- URL url = getTestArchiveFile(archive).toURI().toURL();
- deploy(url);
- }
+ public IntegrationTestHelper(OSGiConfigurationProvider configProvider)
+ {
+ this.configProvider = configProvider;
+ }
- public void deploy(URL archive) throws Exception
- {
- getDeployer().deploy(archive);
- }
+ public void deploy(String archive) throws Exception
+ {
+ URL url = getTestArchiveFile(archive).toURI().toURL();
+ deploy(url);
+ }
- public void undeploy(String archive) throws Exception
- {
- URL url = getTestArchiveFile(archive).toURI().toURL();
- undeploy(url);
- }
+ public void deploy(URL archive) throws Exception
+ {
+ getDeployer().deploy(archive);
+ }
- public void undeploy(URL archive) throws Exception
- {
- getDeployer().undeploy(archive);
- }
+ public void undeploy(String archive) throws Exception
+ {
+ URL url = getTestArchiveFile(archive).toURI().toURL();
+ undeploy(url);
+ }
- public boolean isTargetJBoss50()
- {
- String target = getIntegrationTarget();
- return target.startsWith("jboss50");
- }
+ public void undeploy(URL archive) throws Exception
+ {
+ getDeployer().undeploy(archive);
+ }
- private String getIntegrationTarget()
- {
- if (integrationTarget == null)
- {
- String jbossVersion;
- try
+ public boolean isTargetJBoss50()
+ {
+ String target = getIntegrationTarget();
+ return target.startsWith("jboss50");
+ }
+
+ private String getIntegrationTarget()
+ {
+ if (integrationTarget == null)
{
- ObjectName oname = new ObjectName("jboss.system:type=ServerConfig");
- jbossVersion = (String)getServer().getAttribute(oname, "SpecificationVersion");
+ String jbossVersion;
+ try
+ {
+ ObjectName oname = new ObjectName("jboss.system:type=ServerConfig");
+ jbossVersion = (String)getServer().getAttribute(oname, "SpecificationVersion");
+ }
+ catch (Exception ex)
+ {
+ throw new IllegalStateException("Cannot obtain jboss version", ex);
+ }
+
+ if (jbossVersion.startsWith("5.0"))
+ integrationTarget = "jboss50";
+ else
+ throw new IllegalStateException("Unsupported jboss version: " + jbossVersion);
}
- catch (Exception ex)
+ return integrationTarget;
+ }
+
+ @SuppressWarnings("unchecked")
+ public MBeanServerConnection getServer()
+ {
+ if (server == null)
{
- throw new IllegalStateException("Cannot obtain jboss version", ex);
+ Hashtable jndiEnv = null;
+ try
+ {
+ InitialContext iniCtx = new InitialContext();
+ jndiEnv = iniCtx.getEnvironment();
+ server = (MBeanServerConnection)iniCtx.lookup("jmx/invoker/RMIAdaptor");
+ }
+ catch (NamingException ex)
+ {
+ throw new RuntimeException("Cannot obtain MBeanServerConnection using jndi props: " + jndiEnv, ex);
+ }
}
+ return server;
+ }
- if (jbossVersion.startsWith("5.0"))
- integrationTarget = "jboss50";
- else
- throw new IllegalStateException("Unsupported jboss version: " + jbossVersion);
- }
- return integrationTarget;
- }
-
- @SuppressWarnings("unchecked")
- public MBeanServerConnection getServer()
- {
- if (server == null)
- {
- Hashtable jndiEnv = null;
- try
+ private ArchiveDeployer getDeployer()
+ {
+ if (isRemoteIntegration())
{
- InitialContext iniCtx = new InitialContext();
- jndiEnv = iniCtx.getEnvironment();
- server = (MBeanServerConnection)iniCtx.lookup("jmx/invoker/RMIAdaptor");
+ return new RemoteArchiveDeployer(getServer());
}
- catch (NamingException ex)
+ else
{
- throw new RuntimeException("Cannot obtain MBeanServerConnection using jndi props: " + jndiEnv, ex);
+ AttributeProvider attProvider = (AttributeProvider)configProvider;
+ DeployerClient deployer = (MainDeployer)attProvider.getAttribute("MainDeployer");
+ return new EmbeddedArchiveDeployer(deployer);
}
- }
- return server;
- }
+ }
- private ArchiveDeployer getDeployer()
- {
- return new JBossArchiveDeployer(getServer());
- }
-
- public String getServerHost()
- {
- return System.getProperty("jboss.bind.address", "localhost");
- }
+ public boolean isRemoteIntegration()
+ {
+ return System.getProperty("jboss.bind.address") != null;
+ }
+
+ public String getServerHost()
+ {
+ return System.getProperty("jboss.bind.address", "localhost");
+ }
}
Modified: projects/jboss-osgi/trunk/runtime/spi/src/main/java/org/jboss/osgi/spi/junit/IntegrationTestSetup.java
===================================================================
--- projects/jboss-osgi/trunk/runtime/spi/src/main/java/org/jboss/osgi/spi/junit/IntegrationTestSetup.java 2009-02-26 15:03:04 UTC (rev 84808)
+++ projects/jboss-osgi/trunk/runtime/spi/src/main/java/org/jboss/osgi/spi/junit/IntegrationTestSetup.java 2009-02-26 15:34:27 UTC (rev 84809)
@@ -31,6 +31,9 @@
import javax.management.MBeanServerConnection;
+import org.jboss.osgi.spi.framework.OSGiConfiguration;
+import org.jboss.osgi.spi.framework.OSGiConfigurationProvider;
+
/**
* A test setup that deploys/undeploys archives
*
@@ -39,110 +42,140 @@
*/
public class IntegrationTestSetup extends OSGiTestSetup
{
- private IntegrationTestHelper delegate = new IntegrationTestHelper();
- private String[] archives = new String[0];
- private ClassLoader originalClassLoader;
+ private IntegrationTestHelper delegate;
+ private String[] archives = new String[0];
+ private ClassLoader originalClassLoader;
+ private OSGiConfigurationProvider configProvider;
- public IntegrationTestSetup(Class<?> testClass, String archiveList)
- {
- super(testClass);
- getArchiveArray(archiveList);
- }
+ public IntegrationTestSetup(Class<?> testClass, String archiveList)
+ {
+ super(testClass);
+ getArchiveArray(archiveList);
+ }
- public File getArchiveFile(String archive)
- {
- return delegate.getTestArchiveFile(archive);
- }
+ private IntegrationTestHelper getDelegate()
+ {
+ if (delegate == null)
+ {
+ delegate = new IntegrationTestHelper(getConfigurationProvider());
+ }
+ return delegate;
+ }
- public URL getArchiveURL(String archive) throws MalformedURLException
- {
- return delegate.getTestArchiveFile(archive).toURI().toURL();
- }
+ // Overwrite to provide an OSGiConfigurationProvider
+ public OSGiConfigurationProvider getConfigurationProvider()
+ {
+ if (configProvider == null)
+ {
+ configProvider = OSGiConfiguration.getConfigurationProvider();
+ }
+ return configProvider;
+ }
- public boolean isTargetJBoss50()
- {
- return delegate.isTargetJBoss50();
- }
-
- public MBeanServerConnection getServer()
- {
- return delegate.getServer();
- }
-
- public String getServerHost()
- {
- return delegate.getServerHost();
- }
-
- private void getArchiveArray(String archiveList)
- {
- if (archiveList != null)
- {
- StringTokenizer st = new StringTokenizer(archiveList, ", ");
- archives = new String[st.countTokens()];
+ public void setConfigurationProvider(OSGiConfigurationProvider configProvider)
+ {
+ this.configProvider = configProvider;
+ }
- for (int i = 0; i < archives.length; i++)
- archives[i] = st.nextToken();
- }
- }
+ public File getArchiveFile(String archive)
+ {
+ return getDelegate().getTestArchiveFile(archive);
+ }
- @Override
- protected void setUp() throws Exception
- {
- super.setUp();
-
- List<URL> clientJars = new ArrayList<URL>();
- for (int i = 0; i < archives.length; i++)
- {
- String archive = archives[i];
- try
+ public URL getArchiveURL(String archive) throws MalformedURLException
+ {
+ return getDelegate().getTestArchiveFile(archive).toURI().toURL();
+ }
+
+ public boolean isRemoteIntegration()
+ {
+ return getDelegate().isRemoteIntegration();
+ }
+
+ public boolean isTargetJBoss50()
+ {
+ return getDelegate().isTargetJBoss50();
+ }
+
+ public MBeanServerConnection getServer()
+ {
+ return getDelegate().getServer();
+ }
+
+ public String getServerHost()
+ {
+ return getDelegate().getServerHost();
+ }
+
+ private void getArchiveArray(String archiveList)
+ {
+ if (archiveList != null)
{
- delegate.deploy(archive);
+ StringTokenizer st = new StringTokenizer(archiveList, ", ");
+ archives = new String[st.countTokens()];
+
+ for (int i = 0; i < archives.length; i++)
+ archives[i] = st.nextToken();
}
- catch (Exception ex)
+ }
+
+ @Override
+ protected void setUp() throws Exception
+ {
+ super.setUp();
+
+ List<URL> clientJars = new ArrayList<URL>();
+ for (int i = 0; i < archives.length; i++)
{
- ex.printStackTrace();
- delegate.undeploy(archive);
- }
+ String archive = archives[i];
+ try
+ {
+ getDelegate().deploy(archive);
+ }
+ catch (Exception ex)
+ {
+ ex.printStackTrace();
+ getDelegate().undeploy(archive);
+ }
- if (archive.endsWith("-client.jar"))
- {
- URL archiveURL = getArchiveURL(archive);
- clientJars.add(archiveURL);
+ if (archive.endsWith("-client.jar"))
+ {
+ URL archiveURL = getArchiveURL(archive);
+ clientJars.add(archiveURL);
+ }
}
- }
- ClassLoader parent = Thread.currentThread().getContextClassLoader();
- originalClassLoader = parent;
+ ClassLoader parent = Thread.currentThread().getContextClassLoader();
+ originalClassLoader = parent;
- // add client jars to the class loader
- if (!clientJars.isEmpty())
- {
- URL[] urls = new URL[clientJars.size()];
- for (int i = 0; i < clientJars.size(); i++)
+ // add client jars to the class loader
+ if (!clientJars.isEmpty())
{
- urls[i] = clientJars.get(i);
+ URL[] urls = new URL[clientJars.size()];
+ for (int i = 0; i < clientJars.size(); i++)
+ {
+ urls[i] = clientJars.get(i);
+ }
+ URLClassLoader cl = new URLClassLoader(urls, parent);
+ Thread.currentThread().setContextClassLoader(cl);
}
- URLClassLoader cl = new URLClassLoader(urls, parent);
- Thread.currentThread().setContextClassLoader(cl);
- }
- }
+ }
- @Override
- protected void tearDown() throws Exception
- {
- try
- {
- for (int i = 0; i < archives.length; i++)
+ @Override
+ protected void tearDown() throws Exception
+ {
+ try
{
- String archive = archives[archives.length - i - 1];
- delegate.undeploy(archive);
+ for (int i = 0; i < archives.length; i++)
+ {
+ String archive = archives[archives.length - i - 1];
+ getDelegate().undeploy(archive);
+ }
}
- }
- finally
- {
- Thread.currentThread().setContextClassLoader(originalClassLoader);
- }
- super.tearDown();
- }
+ finally
+ {
+ Thread.currentThread().setContextClassLoader(originalClassLoader);
+ }
+ super.tearDown();
+ }
}
Deleted: projects/jboss-osgi/trunk/runtime/spi/src/main/java/org/jboss/osgi/spi/junit/JBossArchiveDeployer.java
===================================================================
--- projects/jboss-osgi/trunk/runtime/spi/src/main/java/org/jboss/osgi/spi/junit/JBossArchiveDeployer.java 2009-02-26 15:03:04 UTC (rev 84808)
+++ projects/jboss-osgi/trunk/runtime/spi/src/main/java/org/jboss/osgi/spi/junit/JBossArchiveDeployer.java 2009-02-26 15:34:27 UTC (rev 84809)
@@ -1,60 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.osgi.spi.junit;
-
-import java.net.URL;
-
-import javax.management.MBeanServerConnection;
-import javax.management.ObjectName;
-
-/**
- * An archive deployer that deals with test deployment/undeployment, etc.
- *
- * @author Thomas.Diesler at jboss.org
- * @since 14-Oct-2004
- */
-public class JBossArchiveDeployer implements ArchiveDeployer
-{
- private static final String MAIN_DEPLOYER = "jboss.system:service=MainDeployer";
-
- private MBeanServerConnection server;
-
- public JBossArchiveDeployer(MBeanServerConnection server)
- {
- this.server = server;
- }
-
- public void deploy(URL url) throws Exception
- {
- invokeMainDeployer("deploy", url);
- }
-
- public void undeploy(URL url) throws Exception
- {
- invokeMainDeployer("undeploy", url);
- }
-
- private void invokeMainDeployer(String methodName, URL url) throws Exception
- {
- server.invoke(new ObjectName(MAIN_DEPLOYER), methodName, new Object[] { url }, new String[] { "java.net.URL" });
- }
-}
Copied: projects/jboss-osgi/trunk/runtime/spi/src/main/java/org/jboss/osgi/spi/junit/RemoteArchiveDeployer.java (from rev 84802, projects/jboss-osgi/trunk/runtime/spi/src/main/java/org/jboss/osgi/spi/junit/JBossArchiveDeployer.java)
===================================================================
--- projects/jboss-osgi/trunk/runtime/spi/src/main/java/org/jboss/osgi/spi/junit/RemoteArchiveDeployer.java (rev 0)
+++ projects/jboss-osgi/trunk/runtime/spi/src/main/java/org/jboss/osgi/spi/junit/RemoteArchiveDeployer.java 2009-02-26 15:34:27 UTC (rev 84809)
@@ -0,0 +1,63 @@
+/*
+ * 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.junit;
+
+import java.net.URL;
+
+import javax.management.MBeanServerConnection;
+import javax.management.ObjectName;
+
+/**
+ * An archive deployer that deals with test deployment/undeployment, etc.
+ *
+ * @author Thomas.Diesler at jboss.org
+ * @since 14-Oct-2004
+ */
+public class RemoteArchiveDeployer implements ArchiveDeployer
+{
+ private static final String MAIN_DEPLOYER = "jboss.system:service=MainDeployer";
+
+ private MBeanServerConnection server;
+
+ public RemoteArchiveDeployer(MBeanServerConnection server)
+ {
+ if (server == null)
+ throw new IllegalArgumentException("Cannot construct archive deployer with: " + server);
+
+ this.server = server;
+ }
+
+ public void deploy(URL url) throws Exception
+ {
+ invokeMainDeployer("deploy", url);
+ }
+
+ public void undeploy(URL url) throws Exception
+ {
+ invokeMainDeployer("undeploy", url);
+ }
+
+ private void invokeMainDeployer(String methodName, URL url) throws Exception
+ {
+ server.invoke(new ObjectName(MAIN_DEPLOYER), methodName, new Object[] { url }, new String[] { "java.net.URL" });
+ }
+}
Property changes on: projects/jboss-osgi/trunk/runtime/spi/src/main/java/org/jboss/osgi/spi/junit/RemoteArchiveDeployer.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:mergeinfo
+
Name: svn:eol-style
+ LF
Property changes on: projects/jboss-osgi/trunk/testsuite
___________________________________________________________________
Name: svn:ignore
- target
+ target
felix-cache
Modified: projects/jboss-osgi/trunk/testsuite/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/testsuite/pom.xml 2009-02-26 15:03:04 UTC (rev 84808)
+++ projects/jboss-osgi/trunk/testsuite/pom.xml 2009-02-26 15:34:27 UTC (rev 84809)
@@ -102,7 +102,6 @@
<!--
Name: no-jboss-bind-address
Descr: Skip tests if no jboss.bind.address is given
- -->
<profile>
<id>no-jboss-bind-address</id>
<activation>
@@ -121,6 +120,8 @@
</plugins>
</build>
</profile>
+ -->
+
</profiles>
</project>
Modified: projects/jboss-osgi/trunk/testsuite/scripts/antrun-test-jars.xml
===================================================================
--- projects/jboss-osgi/trunk/testsuite/scripts/antrun-test-jars.xml 2009-02-26 15:03:04 UTC (rev 84808)
+++ projects/jboss-osgi/trunk/testsuite/scripts/antrun-test-jars.xml 2009-02-26 15:34:27 UTC (rev 84809)
@@ -44,13 +44,13 @@
<!-- jbosgi36 -->
<bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/jbosgi36-bundle.jar" files="${tests.resources.dir}/jbosgi36/jbosgi36.bnd" />
- <jar jarfile="${tests.output.dir}/test-libs/jbosgi36-service.jar">
+ <jar jarfile="${tests.output.dir}/test-libs/jbosgi36-mbean.jar">
<fileset dir="${tests.classes.dir}">
<include name="org/jboss/test/osgi/jbosgi36/mbean/Foo.class" />
<include name="org/jboss/test/osgi/jbosgi36/mbean/FooMBean.class" />
</fileset>
<fileset dir="${tests.resources.dir}/jbosgi36">
- <include name="META-INF/jbosgi36-service.xml" />
+ <include name="META-INF/jbosgi36-jboss-beans.xml" />
</fileset>
</jar>
Added: projects/jboss-osgi/trunk/testsuite/src/test/java/org/jboss/test/osgi/bootstrap/BootstrapTest.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/src/test/java/org/jboss/test/osgi/bootstrap/BootstrapTest.java (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/src/test/java/org/jboss/test/osgi/bootstrap/BootstrapTest.java 2009-02-26 15:34:27 UTC (rev 84809)
@@ -0,0 +1,52 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.osgi.bootstrap;
+
+//$Id$
+
+import org.jboss.deployers.client.spi.main.MainDeployer;
+import org.jboss.osgi.spi.framework.AttributeProvider;
+import org.jboss.osgi.spi.framework.OSGiConfiguration;
+import org.jboss.osgi.spi.framework.OSGiConfigurationProvider;
+import org.jboss.osgi.spi.framework.OSGiFramework;
+import org.jboss.osgi.spi.junit.IntegrationTestCase;
+
+/**
+ * Test the embedded bootstrap of the framework
+ *
+ * @author thomas.diesler at jboss.com
+ * @since 25-Feb-2009
+ */
+public class BootstrapTest extends IntegrationTestCase
+{
+ static OSGiConfigurationProvider configProvider = OSGiConfiguration.getConfigurationProvider();
+
+ public void testFrameworkBootstrap() throws Exception
+ {
+ OSGiFramework framework = configProvider.getFramework();
+ assertNotNull("Framework not null", framework);
+
+ AttributeProvider attProvider = (AttributeProvider)configProvider;
+ MainDeployer mainDeployer = (MainDeployer)attProvider.getAttribute("MainDeployer");
+ assertNotNull("MainDeployer not null", mainDeployer);
+ }
+}
\ No newline at end of file
Property changes on: projects/jboss-osgi/trunk/testsuite/src/test/java/org/jboss/test/osgi/bootstrap/BootstrapTest.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: projects/jboss-osgi/trunk/testsuite/src/test/java/org/jboss/test/osgi/jbosgi36/junit/JBOSGI36Test.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/src/test/java/org/jboss/test/osgi/jbosgi36/junit/JBOSGI36Test.java 2009-02-26 15:03:04 UTC (rev 84808)
+++ projects/jboss-osgi/trunk/testsuite/src/test/java/org/jboss/test/osgi/jbosgi36/junit/JBOSGI36Test.java 2009-02-26 15:34:27 UTC (rev 84809)
@@ -25,6 +25,9 @@
import junit.framework.Test;
+import org.jboss.osgi.spi.framework.AttributeProvider;
+import org.jboss.osgi.spi.framework.OSGiConfiguration;
+import org.jboss.osgi.spi.framework.OSGiConfigurationProvider;
import org.jboss.osgi.spi.jmx.MBeanProxy;
import org.jboss.osgi.spi.jmx.MBeanProxyException;
import org.jboss.osgi.spi.junit.IntegrationTestCase;
@@ -41,9 +44,17 @@
*/
public class JBOSGI36Test extends IntegrationTestCase
{
+ private static OSGiConfigurationProvider configProvider;
+
public static Test suite()
{
- return new IntegrationTestSetup(JBOSGI36Test.class, "jbosgi36-bundle.jar, jbosgi36-service.jar");
+ IntegrationTestSetup setup = new IntegrationTestSetup(JBOSGI36Test.class, "jbosgi36-bundle.jar, jbosgi36-mbean.jar");
+ if (setup.isRemoteIntegration() == false)
+ {
+ configProvider = OSGiConfiguration.getConfigurationProvider();
+ setup.setConfigurationProvider(configProvider);
+ }
+ return setup;
}
public void testAccessMBean() throws Exception
@@ -79,7 +90,16 @@
private FooMBean getFooMBean() throws MBeanProxyException
{
- FooMBean foo = (FooMBean)MBeanProxy.get(FooMBean.class, FooMBean.OBJECT_NAME, getServer());
+ FooMBean foo;
+ if (configProvider != null)
+ {
+ AttributeProvider attProvider = (AttributeProvider)configProvider;
+ foo = attProvider.getAttribute(FooMBean.OBJECT_NAME.getCanonicalName(), FooMBean.class);
+ }
+ else
+ {
+ foo = (FooMBean)MBeanProxy.get(FooMBean.class, FooMBean.OBJECT_NAME, getServer());
+ }
return foo;
}
}
\ No newline at end of file
Modified: projects/jboss-osgi/trunk/testsuite/src/test/java/org/jboss/test/osgi/jbosgi36/mbean/Foo.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/src/test/java/org/jboss/test/osgi/jbosgi36/mbean/Foo.java 2009-02-26 15:03:04 UTC (rev 84808)
+++ projects/jboss-osgi/trunk/testsuite/src/test/java/org/jboss/test/osgi/jbosgi36/mbean/Foo.java 2009-02-26 15:34:27 UTC (rev 84809)
@@ -23,6 +23,9 @@
//$Id$
+import org.jboss.aop.microcontainer.aspects.jmx.JMX;
+
+ at JMX (exposedInterface = FooMBean.class, name = "jboss.osgi:test=jbosgi36", registerDirectly = true)
public class Foo implements FooMBean
{
public String echo(String msg)
Copied: projects/jboss-osgi/trunk/testsuite/src/test/resources/jbosgi36/META-INF/jbosgi36-jboss-beans.xml (from rev 84807, projects/jboss-osgi/trunk/testsuite/src/test/resources/jbosgi36/META-INF/jbosgi36-service.xml)
===================================================================
--- projects/jboss-osgi/trunk/testsuite/src/test/resources/jbosgi36/META-INF/jbosgi36-jboss-beans.xml (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/src/test/resources/jbosgi36/META-INF/jbosgi36-jboss-beans.xml 2009-02-26 15:34:27 UTC (rev 84809)
@@ -0,0 +1,6 @@
+<deployment xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:jboss:bean-deployer:2.0 bean-deployer_2_0.xsd" xmlns="urn:jboss:bean-deployer:2.0">
+
+ <bean name="Foo" class="org.jboss.test.osgi.jbosgi36.mbean.Foo"/>
+
+</deployment>
+
Deleted: projects/jboss-osgi/trunk/testsuite/src/test/resources/jbosgi36/META-INF/jbosgi36-service.xml
===================================================================
--- projects/jboss-osgi/trunk/testsuite/src/test/resources/jbosgi36/META-INF/jbosgi36-service.xml 2009-02-26 15:03:04 UTC (rev 84808)
+++ projects/jboss-osgi/trunk/testsuite/src/test/resources/jbosgi36/META-INF/jbosgi36-service.xml 2009-02-26 15:34:27 UTC (rev 84809)
@@ -1,4 +0,0 @@
-<server>
- <mbean code="org.jboss.test.osgi.jbosgi36.mbean.Foo" name="jboss.osgi:test=jbosgi36">
- </mbean>
-</server>
\ No newline at end of file
Added: projects/jboss-osgi/trunk/testsuite/src/test/resources/jboss-osgi-beans.xml
===================================================================
--- projects/jboss-osgi/trunk/testsuite/src/test/resources/jboss-osgi-beans.xml (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/src/test/resources/jboss-osgi-beans.xml 2009-02-26 15:34:27 UTC (rev 84809)
@@ -0,0 +1,15 @@
+<!--
+ $Id$
+-->
+<deployment xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:jboss:bean-deployer:2.0 bean-deployer_2_0.xsd" xmlns="urn:jboss:bean-deployer:2.0">
+
+ <!-- The OSGiFramework -->
+ <bean name="jboss.osgi:service=Framework" class="org.jboss.osgi.felix.framework.FelixIntegration">
+ <property name="felixProperties">
+ <map keyClass="java.lang.String" valueClass="java.lang.String">
+ <entry><key>org.osgi.framework.storage.clean</key><value>onFirstInit</value></entry>
+ </map>
+ </property>
+ </bean>
+
+</deployment>
Property changes on: projects/jboss-osgi/trunk/testsuite/src/test/resources/jboss-osgi-beans.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: projects/jboss-osgi/trunk/testsuite/src/test/resources/jboss-osgi-bootstrap-beans.xml
===================================================================
--- projects/jboss-osgi/trunk/testsuite/src/test/resources/jboss-osgi-bootstrap-beans.xml (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/src/test/resources/jboss-osgi-bootstrap-beans.xml 2009-02-26 15:34:27 UTC (rev 84809)
@@ -0,0 +1,111 @@
+<!--
+ The bootstrap of the server. This should only have the minimum
+ needed to bootstrap the mc kernel and profile service.
+
+ $Id$
+-->
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+
+ <!-- The MainDeployer -->
+ <bean name="MainDeployer" class="org.jboss.deployers.plugins.main.MainDeployerImpl">
+ <property name="structuralDeployers"><inject bean="StructuralDeployers"/></property>
+ <property name="deployers"><inject bean="Deployers"/></property>
+ <property name="mgtDeploymentCreator"><inject bean="ManagedDeploymentCreator"/></property>
+ </bean>
+
+ <!-- The ManagedDeploymentCreator implementation -->
+ <bean name="ManagedDeploymentCreator" class="org.jboss.deployers.plugins.managed.DefaultManagedDeploymentCreator" />
+
+ <!-- ModificationType structure processor -->
+ <bean name="ModificationTypeStructureProcessor" class="org.jboss.deployers.vfs.plugins.structure.modify.ModificationTypeStructureProcessor">
+ <incallback method="addMatcher"/>
+ <uncallback method="removeMatcher"/>
+ </bean>
+
+ <!-- The holder for deployers that determine structure -->
+ <bean name="StructuralDeployers" class="org.jboss.deployers.vfs.plugins.structure.VFSStructuralDeployersImpl">
+ <property name="structureBuilder">
+ <!-- The consolidator of the structure information -->
+ <bean name="StructureBuilder" class="org.jboss.deployers.vfs.plugins.structure.VFSStructureBuilder">
+ <property name="structureProcessor"><inject bean="ModificationTypeStructureProcessor"/></property>
+ </bean>
+ </property>
+ <!-- Accept any implementor of structure deployer -->
+ <incallback method="addDeployer"/>
+ <uncallback method="removeDeployer"/>
+ </bean>
+
+ <!-- The holder for deployers that do real deployment -->
+ <bean name="Deployers" class="org.jboss.deployers.plugins.deployers.DeployersImpl">
+ <constructor><parameter><inject bean="jboss.kernel:service=KernelController"/></parameter></constructor>
+ <!-- Accept any implementor of deployer -->
+ <incallback method="addDeployer"/>
+ <uncallback method="removeDeployer"/>
+ </bean>
+
+ <!-- A declared structure descriptor deployer -->
+ <bean name="DeclaredStructure" class="org.jboss.deployers.vfs.plugins.structure.explicit.DeclaredStructure"/>
+
+ <!-- JAR Structure -->
+ <bean name="JARStructure" class="org.jboss.deployers.vfs.plugins.structure.jar.JARStructure">
+ <property name="candidateStructureVisitorFactory">
+ <!-- Any file that is not an ordinary directory is a candidate -->
+ <bean name="JARStructureCandidates" class="org.jboss.deployers.vfs.spi.structure.helpers.DefaultCandidateStructureVisitorFactory">
+ <!-- A filter to exclude some obvious non-subdeployments -->
+ <property name="filter">
+ <bean name="JARFilter" class="org.jboss.virtual.plugins.vfs.helpers.SuffixesExcludeFilter">
+ <constructor><parameter>
+ <list elementClass="java.lang.String">
+ <!-- Exclude class files as subdeployments -->
+ <value>.class</value>
+ </list>
+ </parameter></constructor>
+ </bean>
+ </property>
+ </bean>
+ </property>
+ </bean>
+
+ <!-- File Structure -->
+ <bean name="FileStructure" class="org.jboss.deployers.vfs.plugins.structure.file.FileStructure">
+ <!-- Unless specified the default list of suffixes is -service.xml, -beans.xml, -ds.xml, -aop.xml -->
+ <constructor>
+ <parameter>
+ <set elementClass="java.lang.String">
+ <value>-service.xml</value>
+ <value>-beans.xml</value>
+ </set>
+ </parameter>
+ </constructor>
+ </bean>
+
+ <!-- POJO Deployment -->
+ <bean name="BeanDeployer" class="org.jboss.deployers.vfs.deployer.kernel.BeanDeployer"/>
+ <bean name="KernelDeploymentDeployer" class="org.jboss.deployers.vfs.deployer.kernel.KernelDeploymentDeployer"/>
+ <bean name="BeanMetaDataDeployer" class="org.jboss.deployers.vfs.deployer.kernel.BeanMetaDataDeployer">
+ <constructor><parameter class="org.jboss.kernel.Kernel"><inject bean="jboss.kernel:service=Kernel"/></parameter></constructor>
+ </bean>
+
+ <!-- VFS ClassLoader -->
+ <bean name="ClassLoaderSystem" class="org.jboss.classloader.spi.ClassLoaderSystem">
+ <constructor factoryClass="org.jboss.classloader.spi.ClassLoaderSystem" factoryMethod="getInstance"/>
+ </bean>
+ <bean name="ClassLoading" class="org.jboss.classloading.spi.dependency.ClassLoading">
+ <incallback method="addModule" state="Configured"/>
+ <uncallback method="removeModule" state="Configured"/>
+ </bean>
+ <bean name="ClassLoadingDefaultDeployer" class="org.jboss.deployers.plugins.classloading.ClassLoadingDefaultDeployer">
+ <property name="defaultMetaData">
+ <classloading xmlns="urn:jboss:classloading:1.0" export-all="NON_EMPTY" import-all="true"/>
+ </property>
+ </bean>
+ <bean name="ClassLoaderClassPathDeployer" class="org.jboss.deployers.vfs.plugins.classloader.VFSClassLoaderClassPathDeployer"/>
+ <bean name="ClassLoaderDescribeDeployer" class="org.jboss.deployers.vfs.plugins.classloader.VFSClassLoaderDescribeDeployer">
+ <property name="classLoading"><inject bean="ClassLoading"/></property>
+ </bean>
+ <bean name="ClassLoaderDeployer" class="org.jboss.deployers.plugins.classloading.AbstractLevelClassLoaderSystemDeployer">
+ <property name="classLoading"><inject bean="ClassLoading"/></property>
+ <property name="system"><inject bean="ClassLoaderSystem"/></property>
+ </bean>
+
+</deployment>
Property changes on: projects/jboss-osgi/trunk/testsuite/src/test/resources/jboss-osgi-bootstrap-beans.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
More information about the jboss-cvs-commits
mailing list