JBoss-OSGI SVN: r88025 - in projects/jboss-osgi/trunk: bundle/deployment and 3 other directories.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-04-29 16:47:30 -0400 (Wed, 29 Apr 2009)
New Revision: 88025
Modified:
projects/jboss-osgi/trunk/bundle/deployment/pom.xml
projects/jboss-osgi/trunk/bundle/deployment/src/main/java/org/jboss/osgi/deployment/internal/DeployersActivator.java
projects/jboss-osgi/trunk/bundle/microcontainer/pom.xml
projects/jboss-osgi/trunk/bundle/microcontainer/src/main/java/org/jboss/osgi/microcontainer/internal/MicrocontainerServiceImpl.java
projects/jboss-osgi/trunk/pom.xml
Log:
Use DynamicImport-Packages
Modified: projects/jboss-osgi/trunk/bundle/deployment/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/bundle/deployment/pom.xml 2009-04-29 20:35:04 UTC (rev 88024)
+++ projects/jboss-osgi/trunk/bundle/deployment/pom.xml 2009-04-29 20:47:30 UTC (rev 88025)
@@ -81,13 +81,11 @@
<!-- import -->
org.jboss.dependency*,
org.jboss.deployers*,
- org.jboss.deployers.plugins.attachments,
org.jboss.logging,
org.jboss.osgi.common.log,
org.jboss.osgi.microcontainer,
org.jboss.osgi.spi.management,
org.jboss.virtual*,
- org.jboss.virtual.plugins.registry,
<!-- osgi -->
org.osgi.framework,
Modified: projects/jboss-osgi/trunk/bundle/deployment/src/main/java/org/jboss/osgi/deployment/internal/DeployersActivator.java
===================================================================
--- projects/jboss-osgi/trunk/bundle/deployment/src/main/java/org/jboss/osgi/deployment/internal/DeployersActivator.java 2009-04-29 20:35:04 UTC (rev 88024)
+++ projects/jboss-osgi/trunk/bundle/deployment/src/main/java/org/jboss/osgi/deployment/internal/DeployersActivator.java 2009-04-29 20:47:30 UTC (rev 88025)
@@ -49,10 +49,8 @@
if (service == null)
throw new IllegalStateException("MicrocontainerService not available");
- ClassLoader ctxLoader = Thread.currentThread().getContextClassLoader();
try
{
- Thread.currentThread().setContextClassLoader(getClass().getClassLoader());
deployersURL = new File("../deployment/src/main/resources/META-INF/jboss-osgi-deployers.xml").toURL();
service.deploy(deployersURL);
}
@@ -60,10 +58,6 @@
{
throw new IllegalStateException("Cannot deploy: " + deployersURL, ex);
}
- finally
- {
- Thread.currentThread().setContextClassLoader(ctxLoader);
- }
}
public void stop(BundleContext context)
Modified: projects/jboss-osgi/trunk/bundle/microcontainer/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/bundle/microcontainer/pom.xml 2009-04-29 20:35:04 UTC (rev 88024)
+++ projects/jboss-osgi/trunk/bundle/microcontainer/pom.xml 2009-04-29 20:47:30 UTC (rev 88025)
@@ -119,6 +119,7 @@
!org.jboss.test.*,
!junit*,
</Import-Package>
+ <DynamicImport-Package>*</DynamicImport-Package>
<Embed-Transitive>true</Embed-Transitive>
<Embed-Dependency>
jboss-classloader;inline=false,
Modified: projects/jboss-osgi/trunk/bundle/microcontainer/src/main/java/org/jboss/osgi/microcontainer/internal/MicrocontainerServiceImpl.java
===================================================================
--- projects/jboss-osgi/trunk/bundle/microcontainer/src/main/java/org/jboss/osgi/microcontainer/internal/MicrocontainerServiceImpl.java 2009-04-29 20:35:04 UTC (rev 88024)
+++ projects/jboss-osgi/trunk/bundle/microcontainer/src/main/java/org/jboss/osgi/microcontainer/internal/MicrocontainerServiceImpl.java 2009-04-29 20:47:30 UTC (rev 88025)
@@ -71,7 +71,7 @@
private MBeanServerTracker mbeanServerTracker;
private ServiceRegistration registration;
private LogService log;
-
+
private VFSDeploymentFactory deploymentFactory = VFSDeploymentFactory.getInstance();
private Map<URL, String> contextMap = Collections.synchronizedMap(new HashMap<URL, String>());
@@ -107,8 +107,11 @@
public void deploy(URL url) throws DeploymentException
{
+ ClassLoader ctxLoader = Thread.currentThread().getContextClassLoader();
try
{
+ Thread.currentThread().setContextClassLoader(getClass().getClassLoader());
+
MainDeployer mainDeployer = (MainDeployer)getRegisteredBean(BEAN_MAIN_DEPLOYER);
VirtualFile file = VFS.createNewRoot(url);
VFSDeployment deployment = deploymentFactory.createVFSDeployment(file);
@@ -122,6 +125,10 @@
{
DeploymentException.rethrowAsDeploymentException("Cannot deploy: " + url, ex);
}
+ finally
+ {
+ Thread.currentThread().setContextClassLoader(ctxLoader);
+ }
}
public void undeploy(URL url)
Modified: projects/jboss-osgi/trunk/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/pom.xml 2009-04-29 20:35:04 UTC (rev 88024)
+++ projects/jboss-osgi/trunk/pom.xml 2009-04-29 20:47:30 UTC (rev 88025)
@@ -325,6 +325,10 @@
<failIfNoTests>false</failIfNoTests>
<systemProperties>
<property>
+ <name>org.apache.xerces.xni.parser.XMLParserConfiguration</name>
+ <value>org.apache.xerces.parsers.XIncludeAwareParserConfiguration</value>
+ </property>
+ <property>
<name>test.archive.directory</name>
<value>${project.build.directory}/test-libs</value>
</property>
17 years
JBoss-OSGI SVN: r88014 - in projects/jboss-osgi/trunk/bundle: deployment and 2 other directories.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-04-29 12:32:35 -0400 (Wed, 29 Apr 2009)
New Revision: 88014
Modified:
projects/jboss-osgi/trunk/bundle/deployment/pom.xml
projects/jboss-osgi/trunk/bundle/deployment/src/main/java/org/jboss/osgi/deployment/internal/DeployersActivator.java
projects/jboss-osgi/trunk/bundle/microcontainer/pom.xml
projects/jboss-osgi/trunk/bundle/pom.xml
Log:
DeploymentException: No structural deployers
Modified: projects/jboss-osgi/trunk/bundle/deployment/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/bundle/deployment/pom.xml 2009-04-29 16:31:09 UTC (rev 88013)
+++ projects/jboss-osgi/trunk/bundle/deployment/pom.xml 2009-04-29 16:32:35 UTC (rev 88014)
@@ -79,13 +79,15 @@
javax.management,
<!-- import -->
- org.jboss.dependency.*,
- org.jboss.deployers.*,
+ org.jboss.dependency*,
+ org.jboss.deployers*,
+ org.jboss.deployers.plugins.attachments,
org.jboss.logging,
org.jboss.osgi.common.log,
org.jboss.osgi.microcontainer,
org.jboss.osgi.spi.management,
- org.jboss.virtual,
+ org.jboss.virtual*,
+ org.jboss.virtual.plugins.registry,
<!-- osgi -->
org.osgi.framework,
Modified: projects/jboss-osgi/trunk/bundle/deployment/src/main/java/org/jboss/osgi/deployment/internal/DeployersActivator.java
===================================================================
--- projects/jboss-osgi/trunk/bundle/deployment/src/main/java/org/jboss/osgi/deployment/internal/DeployersActivator.java 2009-04-29 16:31:09 UTC (rev 88013)
+++ projects/jboss-osgi/trunk/bundle/deployment/src/main/java/org/jboss/osgi/deployment/internal/DeployersActivator.java 2009-04-29 16:32:35 UTC (rev 88014)
@@ -49,15 +49,21 @@
if (service == null)
throw new IllegalStateException("MicrocontainerService not available");
+ ClassLoader ctxLoader = Thread.currentThread().getContextClassLoader();
try
{
- deployersURL = new File("src/main/resources/META-INF/jboss-osgi-deployers.xml").toURL();
+ Thread.currentThread().setContextClassLoader(getClass().getClassLoader());
+ deployersURL = new File("../deployment/src/main/resources/META-INF/jboss-osgi-deployers.xml").toURL();
service.deploy(deployersURL);
}
catch (Exception ex)
{
throw new IllegalStateException("Cannot deploy: " + deployersURL, ex);
}
+ finally
+ {
+ Thread.currentThread().setContextClassLoader(ctxLoader);
+ }
}
public void stop(BundleContext context)
Modified: projects/jboss-osgi/trunk/bundle/microcontainer/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/bundle/microcontainer/pom.xml 2009-04-29 16:31:09 UTC (rev 88013)
+++ projects/jboss-osgi/trunk/bundle/microcontainer/pom.xml 2009-04-29 16:32:35 UTC (rev 88014)
@@ -142,9 +142,9 @@
jboss-vfs;inline=false,
</Embed-Dependency>
<_exportcontents>
- org.jboss.virtual,
- org.jboss.dependency.*,
- org.jboss.deployers.*,
+ org.jboss.virtual*,
+ org.jboss.dependency*,
+ org.jboss.deployers*,
</_exportcontents>
</instructions>
</configuration>
Modified: projects/jboss-osgi/trunk/bundle/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/bundle/pom.xml 2009-04-29 16:31:09 UTC (rev 88013)
+++ projects/jboss-osgi/trunk/bundle/pom.xml 2009-04-29 16:32:35 UTC (rev 88014)
@@ -11,7 +11,7 @@
<version>1.0.0.Beta2</version>
</parent>
- <!-- Modules -->
+ <!-- Modules -->
<modules>
<module>blueprint</module>
<module>common</module>
@@ -23,7 +23,7 @@
<module>webconsole</module>
</modules>
- <!--
+ <!--
<modules>
<module>blueprint</module>
<module>deployment</module>
17 years
JBoss-OSGI SVN: r88006 - projects/jboss-osgi/trunk/build/hudson/hudson-home/jobs/jbossosgi-embedded.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-04-29 11:19:53 -0400 (Wed, 29 Apr 2009)
New Revision: 88006
Modified:
projects/jboss-osgi/trunk/build/hudson/hudson-home/jobs/jbossosgi-embedded/config.xml
Log:
Add -U switch
Modified: projects/jboss-osgi/trunk/build/hudson/hudson-home/jobs/jbossosgi-embedded/config.xml
===================================================================
--- projects/jboss-osgi/trunk/build/hudson/hudson-home/jobs/jbossosgi-embedded/config.xml 2009-04-29 15:18:08 UTC (rev 88005)
+++ projects/jboss-osgi/trunk/build/hudson/hudson-home/jobs/jbossosgi-embedded/config.xml 2009-04-29 15:19:53 UTC (rev 88006)
@@ -31,6 +31,7 @@
<hudson.tasks.Maven>
<targets>clean install</targets>
<mavenName>apache-maven</mavenName>
+ <properties>-U</properties>
</hudson.tasks.Maven>
<hudson.tasks.Shell>
<command>
17 years
JBoss-OSGI SVN: r88005 - in projects/jboss-osgi/trunk/bundle: deployment and 1 other directories.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-04-29 11:18:08 -0400 (Wed, 29 Apr 2009)
New Revision: 88005
Modified:
projects/jboss-osgi/trunk/bundle/deployment/.classpath
projects/jboss-osgi/trunk/bundle/deployment/src/main/java/org/jboss/osgi/deployment/internal/DeployersActivator.java
projects/jboss-osgi/trunk/bundle/pom.xml
Log:
WIP
Modified: projects/jboss-osgi/trunk/bundle/deployment/.classpath
===================================================================
--- projects/jboss-osgi/trunk/bundle/deployment/.classpath 2009-04-29 15:13:38 UTC (rev 88004)
+++ projects/jboss-osgi/trunk/bundle/deployment/.classpath 2009-04-29 15:18:08 UTC (rev 88005)
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="target/classes" path="src/main/java"/>
+ <classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
<classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
<classpathentry kind="output" path="target/classes"/>
Modified: projects/jboss-osgi/trunk/bundle/deployment/src/main/java/org/jboss/osgi/deployment/internal/DeployersActivator.java
===================================================================
--- projects/jboss-osgi/trunk/bundle/deployment/src/main/java/org/jboss/osgi/deployment/internal/DeployersActivator.java 2009-04-29 15:13:38 UTC (rev 88004)
+++ projects/jboss-osgi/trunk/bundle/deployment/src/main/java/org/jboss/osgi/deployment/internal/DeployersActivator.java 2009-04-29 15:18:08 UTC (rev 88005)
@@ -23,9 +23,9 @@
//$Id$
+import java.io.File;
import java.net.URL;
-import org.jboss.deployers.spi.DeploymentException;
import org.jboss.osgi.microcontainer.MicrocontainerService;
import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;
@@ -43,7 +43,7 @@
public void start(BundleContext context)
{
- deployersURL = context.getBundle().getResource("META-INF/jboss-osgi-deployers.xml");
+ //deployersURL = context.getBundle().getResource("META-INF/jboss-osgi-deployers.xml");
MicrocontainerService service = getMicrocontainerService(context);
if (service == null)
@@ -51,9 +51,10 @@
try
{
+ deployersURL = new File("src/main/resources/META-INF/jboss-osgi-deployers.xml").toURL();
service.deploy(deployersURL);
}
- catch (DeploymentException ex)
+ catch (Exception ex)
{
throw new IllegalStateException("Cannot deploy: " + deployersURL, ex);
}
Modified: projects/jboss-osgi/trunk/bundle/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/bundle/pom.xml 2009-04-29 15:13:38 UTC (rev 88004)
+++ projects/jboss-osgi/trunk/bundle/pom.xml 2009-04-29 15:18:08 UTC (rev 88005)
@@ -11,7 +11,7 @@
<version>1.0.0.Beta2</version>
</parent>
- <!-- Modules -->
+ <!-- Modules -->
<modules>
<module>blueprint</module>
<module>common</module>
@@ -22,5 +22,13 @@
<module>remotelog</module>
<module>webconsole</module>
</modules>
-
+
+ <!--
+ <modules>
+ <module>blueprint</module>
+ <module>deployment</module>
+ <module>microcontainer</module>
+ </modules>
+ -->
+
</project>
17 years
JBoss-OSGI SVN: r87996 - in projects/jboss-osgi/trunk/bundle: common and 14 other directories.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-04-29 09:43:29 -0400 (Wed, 29 Apr 2009)
New Revision: 87996
Added:
projects/jboss-osgi/trunk/bundle/deployment/src/main/java/org/jboss/osgi/deployment/internal/DeployersActivator.java
projects/jboss-osgi/trunk/bundle/deployment/src/main/resources/
projects/jboss-osgi/trunk/bundle/deployment/src/main/resources/META-INF/
projects/jboss-osgi/trunk/bundle/deployment/src/main/resources/META-INF/jboss-osgi-deployers.xml
Removed:
projects/jboss-osgi/trunk/bundle/deployment/src/main/java/org/jboss/osgi/deployer/
projects/jboss-osgi/trunk/bundle/deployment/src/main/java/org/jboss/osgi/deployment/BundleClassLoaderDeployer.java
projects/jboss-osgi/trunk/bundle/deployment/src/main/java/org/jboss/osgi/deployment/BundleManagementDeployer.java
projects/jboss-osgi/trunk/bundle/deployment/src/main/java/org/jboss/osgi/deployment/BundleMetaData.java
projects/jboss-osgi/trunk/bundle/deployment/src/main/java/org/jboss/osgi/deployment/BundleMetaDataDeployer.java
projects/jboss-osgi/trunk/bundle/deployment/src/main/java/org/jboss/osgi/deployment/BundleRealDeployer.java
projects/jboss-osgi/trunk/bundle/deployment/src/main/java/org/jboss/osgi/deployment/BundleStartStopDeployer.java
projects/jboss-osgi/trunk/bundle/deployment/src/main/java/org/jboss/osgi/deployment/BundleStructureDeployer.java
projects/jboss-osgi/trunk/bundle/deployment/src/main/java/org/jboss/osgi/deployment/DeploymentService.java
projects/jboss-osgi/trunk/bundle/deployment/src/main/java/org/jboss/osgi/deployment/internal/BundleClassLoader.java
projects/jboss-osgi/trunk/bundle/deployment/src/main/java/org/jboss/osgi/deployment/internal/BundleDeploymentUnitFilter.java
projects/jboss-osgi/trunk/bundle/deployment/src/main/java/org/jboss/osgi/deployment/internal/DeploymentProvidedDeploymentUnitFilter.java
projects/jboss-osgi/trunk/bundle/deployment/src/main/java/org/jboss/osgi/deployment/internal/DeploymentServiceImpl.java
projects/jboss-osgi/trunk/bundle/deployment/src/main/java/org/jboss/osgi/deployment/internal/PackageAdminDependencyItem.java
projects/jboss-osgi/trunk/bundle/deployment/src/main/java/org/jboss/osgi/deployment/internal/ServiceActivator.java
Modified:
projects/jboss-osgi/trunk/bundle/blueprint/src/test/java/org/jboss/test/osgi/blueprint/deployment/DeploymentServiceTestCase.java
projects/jboss-osgi/trunk/bundle/common/pom.xml
projects/jboss-osgi/trunk/bundle/deployment/pom.xml
projects/jboss-osgi/trunk/bundle/jmx/pom.xml
projects/jboss-osgi/trunk/bundle/logging/pom.xml
projects/jboss-osgi/trunk/bundle/microcontainer/pom.xml
projects/jboss-osgi/trunk/bundle/microcontainer/src/main/java/org/jboss/osgi/microcontainer/MicrocontainerService.java
projects/jboss-osgi/trunk/bundle/microcontainer/src/main/java/org/jboss/osgi/microcontainer/MicrocontainerServiceMBean.java
projects/jboss-osgi/trunk/bundle/microcontainer/src/main/java/org/jboss/osgi/microcontainer/internal/MicrocontainerServiceImpl.java
projects/jboss-osgi/trunk/bundle/remotelog/pom.xml
projects/jboss-osgi/trunk/bundle/webconsole/pom.xml
Log:
More work on MC deployment
Modified: projects/jboss-osgi/trunk/bundle/blueprint/src/test/java/org/jboss/test/osgi/blueprint/deployment/DeploymentServiceTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/bundle/blueprint/src/test/java/org/jboss/test/osgi/blueprint/deployment/DeploymentServiceTestCase.java 2009-04-29 11:55:49 UTC (rev 87995)
+++ projects/jboss-osgi/trunk/bundle/blueprint/src/test/java/org/jboss/test/osgi/blueprint/deployment/DeploymentServiceTestCase.java 2009-04-29 13:43:29 UTC (rev 87996)
@@ -23,7 +23,13 @@
//$Id$
+import static org.jboss.osgi.microcontainer.MicrocontainerServiceMBean.MBEAN_MICROCONTAINER_SERVICE;
+
+import java.util.List;
+
+import org.jboss.osgi.microcontainer.MicrocontainerServiceMBean;
import org.jboss.osgi.spi.framework.OSGiFramework;
+import org.jboss.osgi.spi.management.MBeanProxy;
import org.jboss.test.osgi.blueprint.BlueprintTest;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
@@ -43,9 +49,12 @@
{
BundleContext sysContext = framework.getSystemBundleContext();
- Bundle bundle = installBundle(sysContext, "bundles/jboss-osgi-deployment.jar", true);
- assertEquals("Test bundle ACTIVE", Bundle.ACTIVE, bundle.getState());
-
+// Bundle bundle = installBundle(sysContext, "bundles/jboss-osgi-deployment.jar", true);
+// assertEquals("Test bundle ACTIVE", Bundle.ACTIVE, bundle.getState());
+//
+// MicrocontainerServiceMBean mcService = MBeanProxy.get(MicrocontainerServiceMBean.class, MBEAN_MICROCONTAINER_SERVICE, getMBeanServer());
+// List<String> registeredBeans = mcService.getRegisteredBeans();
+// System.out.println(registeredBeans);
}
finally
{
Modified: projects/jboss-osgi/trunk/bundle/common/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/bundle/common/pom.xml 2009-04-29 11:55:49 UTC (rev 87995)
+++ projects/jboss-osgi/trunk/bundle/common/pom.xml 2009-04-29 13:43:29 UTC (rev 87996)
@@ -44,7 +44,7 @@
<extensions>true</extensions>
<configuration>
<instructions>
- <Bundle-SymbolicName>org.jboss.osgi.common</Bundle-SymbolicName>
+ <Bundle-SymbolicName>${artifactId}</Bundle-SymbolicName>
<Export-Package>
org.jboss.osgi.common,
org.jboss.osgi.common.log
Modified: projects/jboss-osgi/trunk/bundle/deployment/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/bundle/deployment/pom.xml 2009-04-29 11:55:49 UTC (rev 87995)
+++ projects/jboss-osgi/trunk/bundle/deployment/pom.xml 2009-04-29 13:43:29 UTC (rev 87996)
@@ -26,6 +26,11 @@
<version>${version}</version>
</dependency>
<dependency>
+ <groupId>org.jboss.osgi</groupId>
+ <artifactId>jboss-osgi-runtime-deployer</artifactId>
+ <version>${version}</version>
+ </dependency>
+ <dependency>
<groupId>org.jboss.osgi.bundles</groupId>
<artifactId>jboss-osgi-microcontainer</artifactId>
<version>${version}</version>
@@ -64,31 +69,37 @@
<extensions>true</extensions>
<configuration>
<instructions>
- <Bundle-SymbolicName>jboss-osgi-deployment</Bundle-SymbolicName>
- <Bundle-Activator>org.jboss.osgi.deployment.internal.ServiceActivator</Bundle-Activator>
- <Export-Package>
- org.jboss.osgi.deployment;version=${version}
- </Export-Package>
+ <Bundle-SymbolicName>${artifactId}</Bundle-SymbolicName>
+ <Bundle-Activator>org.jboss.osgi.deployment.internal.DeployersActivator</Bundle-Activator>
<Private-Package>
org.jboss.osgi.deployment.internal
</Private-Package>
<Import-Package>
- <!-- system -->
- javax.management,
-
- <!-- import -->
- org.jboss.dependency.*,
- org.jboss.deployers.*,
- org.jboss.logging,
- org.jboss.osgi.common.log,
- org.jboss.osgi.spi.management,
- org.jboss.virtual,
-
- <!-- osgi -->
- org.osgi.framework,
- org.osgi.service.log,
- org.osgi.service.packageadmin
+ <!-- system -->
+ javax.management,
+
+ <!-- import -->
+ org.jboss.dependency.*,
+ org.jboss.deployers.*,
+ org.jboss.logging,
+ org.jboss.osgi.common.log,
+ org.jboss.osgi.microcontainer,
+ org.jboss.osgi.spi.management,
+ org.jboss.virtual,
+
+ <!-- osgi -->
+ org.osgi.framework,
+ org.osgi.service.packageadmin,
+ org.osgi.service.log,
+ org.osgi.util.tracker,
</Import-Package>
+ <Embed-Transitive>true</Embed-Transitive>
+ <Embed-Dependency>
+ jboss-osgi-runtime-deployer;inline=false,
+ </Embed-Dependency>
+ <_exportcontents>
+ org.jboss.osgi.deployer
+ </_exportcontents>
</instructions>
</configuration>
</plugin>
Deleted: projects/jboss-osgi/trunk/bundle/deployment/src/main/java/org/jboss/osgi/deployment/BundleClassLoaderDeployer.java
===================================================================
--- projects/jboss-osgi/trunk/bundle/deployment/src/main/java/org/jboss/osgi/deployment/BundleClassLoaderDeployer.java 2009-04-29 11:55:49 UTC (rev 87995)
+++ projects/jboss-osgi/trunk/bundle/deployment/src/main/java/org/jboss/osgi/deployment/BundleClassLoaderDeployer.java 2009-04-29 13:43:29 UTC (rev 87996)
@@ -1,110 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file 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 org.jboss.deployers.spi.DeploymentException;
-import org.jboss.deployers.spi.deployer.DeploymentStages;
-import org.jboss.deployers.spi.deployer.helpers.AbstractSimpleRealDeployer;
-import org.jboss.deployers.structure.spi.ClassLoaderFactory;
-import org.jboss.deployers.structure.spi.DeploymentUnit;
-import org.jboss.deployers.structure.spi.DeploymentUnitFilter;
-import org.jboss.osgi.deployment.internal.BundleClassLoader;
-import org.jboss.osgi.deployment.internal.BundleDeploymentUnitFilter;
-import org.jboss.osgi.deployment.internal.PackageAdminDependencyItem;
-import org.jboss.osgi.spi.Constants;
-import org.osgi.framework.Bundle;
-import org.osgi.framework.BundleContext;
-
-/**
- * A deployer that attaches a {@link ClassLoaderFactory} that creates a
- * {@link BundleClassLoader} for the deployed Bundle.
- *
- * @author Ales.Justin(a)jboss.org
- * @author Thomas.Diesler(a)jboss.org
- * @since 03-Feb-2009
- */
-public class BundleClassLoaderDeployer extends AbstractSimpleRealDeployer<Bundle>
-{
- private DeploymentUnitFilter filter = new BundleDeploymentUnitFilter();
- private BundleContext systemContext;
-
- public BundleClassLoaderDeployer()
- {
- super(Bundle.class);
- addOutput(ClassLoaderFactory.class);
- setStage(DeploymentStages.POST_PARSE);
- }
-
- public void setSystemContext(BundleContext systemContext)
- {
- this.systemContext = systemContext;
- }
-
- public void deploy(DeploymentUnit unit, Bundle bundle) throws DeploymentException
- {
- // create bundle delegate classloader
- ClassLoaderFactory factory = createClassLoaderFactory(bundle);
- unit.addAttachment(ClassLoaderFactory.class, factory);
-
- // create dependency items
- String propStart = systemContext.getProperty(Constants.PROPERTY_DEFERRED_START);
- if (Boolean.parseBoolean(propStart != null ? propStart : "true") == false)
- unit.addIDependOn(new PackageAdminDependencyItem(systemContext, bundle));
-
- // skip annotations scanning, if filter is set
- if (filter != null)
- unit.addAttachment(DeploymentUnitFilter.class, filter);
- }
-
- /**
- * Create classloader factory.
- *
- * @param bundle the bundle
- * @return new classloader factory
- */
- protected ClassLoaderFactory createClassLoaderFactory(final Bundle bundle)
- {
- return new ClassLoaderFactory()
- {
- public ClassLoader createClassLoader(DeploymentUnit unit) throws Exception
- {
- return BundleClassLoader.createBundleClassLoader(bundle);
- }
-
- public void removeClassLoader(DeploymentUnit unit) throws Exception
- {
- }
- };
- }
-
- /**
- * Set deployment filter.
- *
- * @param filter the deployment filter
- */
- public void setFilter(DeploymentUnitFilter filter)
- {
- this.filter = filter;
- }
-}
\ No newline at end of file
Deleted: projects/jboss-osgi/trunk/bundle/deployment/src/main/java/org/jboss/osgi/deployment/BundleManagementDeployer.java
===================================================================
--- projects/jboss-osgi/trunk/bundle/deployment/src/main/java/org/jboss/osgi/deployment/BundleManagementDeployer.java 2009-04-29 11:55:49 UTC (rev 87995)
+++ projects/jboss-osgi/trunk/bundle/deployment/src/main/java/org/jboss/osgi/deployment/BundleManagementDeployer.java 2009-04-29 13:43:29 UTC (rev 87996)
@@ -1,90 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file 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 javax.management.MBeanServer;
-import javax.management.ObjectName;
-
-import org.jboss.deployers.spi.DeploymentException;
-import org.jboss.deployers.spi.deployer.helpers.AbstractSimpleRealDeployer;
-import org.jboss.deployers.structure.spi.DeploymentUnit;
-import org.jboss.osgi.spi.management.ManagedBundle;
-import org.osgi.framework.Bundle;
-
-/**
- * Register the Bundle as MBean with JMX.
- *
- * @author Thomas.Diesler(a)jboss.com
- * @since 04-Mar-2009
- */
-public class BundleManagementDeployer extends AbstractSimpleRealDeployer<Bundle>
-{
- private MBeanServer mbeanServer;
-
- public BundleManagementDeployer()
- {
- super(Bundle.class);
- }
-
- public void setMbeanServer(MBeanServer mbeanServer)
- {
- this.mbeanServer = mbeanServer;
- }
-
- public void deploy(DeploymentUnit unit, Bundle bundle) throws DeploymentException
- {
- if (mbeanServer != null)
- {
- ManagedBundle mb = new ManagedBundle(bundle);
- ObjectName oname = mb.getObjectName();
- try
- {
- mbeanServer.registerMBean(mb, oname);
- unit.addAttachment(ManagedBundle.class, mb);
- }
- catch (Exception ex)
- {
- DeploymentException.rethrowAsDeploymentException(ex.getMessage(), ex);
- }
- }
- }
-
- @Override
- public void undeploy(DeploymentUnit unit, Bundle bundle)
- {
- if (mbeanServer != null)
- {
- try
- {
- ManagedBundle mb = unit.getAttachment(ManagedBundle.class);
- if (mb != null && mbeanServer.isRegistered(mb.getObjectName()))
- mbeanServer.unregisterMBean(mb.getObjectName());
- }
- catch (Exception ex)
- {
- log.warn("Cannot unregister: " + bundle, ex);
- }
- }
- }
-}
\ No newline at end of file
Deleted: projects/jboss-osgi/trunk/bundle/deployment/src/main/java/org/jboss/osgi/deployment/BundleMetaData.java
===================================================================
--- projects/jboss-osgi/trunk/bundle/deployment/src/main/java/org/jboss/osgi/deployment/BundleMetaData.java 2009-04-29 11:55:49 UTC (rev 87995)
+++ projects/jboss-osgi/trunk/bundle/deployment/src/main/java/org/jboss/osgi/deployment/BundleMetaData.java 2009-04-29 13:43:29 UTC (rev 87996)
@@ -1,71 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file 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 org.jboss.deployers.vfs.spi.deployer.helpers.AbstractManifestMetaData;
-
-
-/**
- * The Bundle metadata.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 03-Feb-2009
- */
-public class BundleMetaData extends AbstractManifestMetaData
-{
- private String symbolicName;
- private URL bundleLocation;
-
- // exteralizable usage
- public BundleMetaData()
- {
- }
-
- public BundleMetaData(String symbolicName)
- {
- this.symbolicName = symbolicName;
- }
-
- public String getSymbolicName()
- {
- return symbolicName;
- }
-
- public URL getBundleLocation()
- {
- return bundleLocation;
- }
-
- public void setBundleLocation(URL bundleLocation)
- {
- this.bundleLocation = bundleLocation;
- }
-
- public String toString()
- {
- return "Bundle[name=" + symbolicName + "]";
- }
-}
Deleted: projects/jboss-osgi/trunk/bundle/deployment/src/main/java/org/jboss/osgi/deployment/BundleMetaDataDeployer.java
===================================================================
--- projects/jboss-osgi/trunk/bundle/deployment/src/main/java/org/jboss/osgi/deployment/BundleMetaDataDeployer.java 2009-04-29 11:55:49 UTC (rev 87995)
+++ projects/jboss-osgi/trunk/bundle/deployment/src/main/java/org/jboss/osgi/deployment/BundleMetaDataDeployer.java 2009-04-29 13:43:29 UTC (rev 87996)
@@ -1,71 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file 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.util.jar.Attributes;
-import java.util.jar.Manifest;
-
-import org.jboss.deployers.vfs.spi.deployer.ManifestDeployer;
-import org.jboss.deployers.vfs.spi.structure.VFSDeploymentUnit;
-import org.jboss.virtual.VirtualFile;
-import org.osgi.framework.Constants;
-
-/**
- * Create {@link BundleMetaData} from Manifest Headers.
- *
- * If the manifest does not contain a header (named "Bundle-SymbolicName") this deployer does nothing.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 03-Feb-2009
- */
-public class BundleMetaDataDeployer extends ManifestDeployer<BundleMetaData>
-{
- public BundleMetaDataDeployer()
- {
- super(BundleMetaData.class);
- }
-
- @Override
- protected BundleMetaData parse(VFSDeploymentUnit unit, VirtualFile file, BundleMetaData root) throws Exception
- {
- BundleMetaData metaData = super.parse(unit, file, root);
- if (metaData != null)
- {
- metaData.setBundleLocation(unit.getRoot().toURL());
- log.debug("Bundle-SymbolicName: " + metaData.getSymbolicName() + " in " + file);
- }
- return metaData;
- }
-
- @Override
- protected BundleMetaData createMetaData(Manifest manifest) throws Exception
- {
- Attributes attribs = manifest.getMainAttributes();
- String symbolicName = attribs.getValue(Constants.BUNDLE_SYMBOLICNAME);
- if (symbolicName != null)
- return new BundleMetaData(symbolicName);
-
- return null;
- }
-}
Deleted: projects/jboss-osgi/trunk/bundle/deployment/src/main/java/org/jboss/osgi/deployment/BundleRealDeployer.java
===================================================================
--- projects/jboss-osgi/trunk/bundle/deployment/src/main/java/org/jboss/osgi/deployment/BundleRealDeployer.java 2009-04-29 11:55:49 UTC (rev 87995)
+++ projects/jboss-osgi/trunk/bundle/deployment/src/main/java/org/jboss/osgi/deployment/BundleRealDeployer.java 2009-04-29 13:43:29 UTC (rev 87996)
@@ -1,125 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file 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 java.util.List;
-
-import org.jboss.deployers.spi.DeploymentException;
-import org.jboss.deployers.spi.deployer.DeploymentStages;
-import org.jboss.deployers.spi.deployer.helpers.AbstractSimpleRealDeployer;
-import org.jboss.deployers.structure.spi.DeploymentUnit;
-import org.osgi.framework.Bundle;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.BundleException;
-
-/**
- * Installs the Bundle into the Framework's SystemContext.
- *
- * This deployer does not start the bundle. It leaves it in state INSTALLED.
- * On undeploy the Bundle gets uninstalled from the Framework's SystemContext.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @author Ales.Justin(a)jboss.org
- * @since 03-Feb-2009
- */
-public class BundleRealDeployer extends AbstractSimpleRealDeployer<BundleMetaData>
-{
- private BundleContext systemContext;
- private List<URL> skipBundles;
-
- public BundleRealDeployer()
- {
- super(BundleMetaData.class);
- addOutput(Bundle.class);
- setStage(DeploymentStages.POST_PARSE);
- }
-
- public void setSystemContext(BundleContext bundleContext)
- {
- this.systemContext = bundleContext;
- }
-
- public void setSkipBundles(List<URL> skipBundles)
- {
- this.skipBundles = skipBundles;
- }
-
- public void deploy(DeploymentUnit unit, BundleMetaData metadata) throws DeploymentException
- {
- URL bundleURL = metadata.getBundleLocation();
- if (bundleURL == null)
- throw new IllegalStateException("Cannot obtain bundle location for: " + metadata);
-
- String bundlePath = bundleURL.getPath();
- if (bundlePath.endsWith("/"))
- bundlePath = bundlePath.substring(0, bundlePath.length() - 1);
-
- try
- {
- if (skipBundles != null)
- {
- boolean skipBundle = false;
- for (URL skip : skipBundles)
- {
- String skipPath = skip.getPath();
- if (skipPath.equals(bundlePath))
- {
- skipBundle = true;
- break;
- }
- }
- if (skipBundle == false)
- {
- Bundle bundle = systemContext.installBundle(bundleURL.toString());
- unit.addAttachment(Bundle.class, bundle);
-
- log.info("Installed: " + bundle);
- }
- }
- }
- catch (BundleException ex)
- {
- throw DeploymentException.rethrowAsDeploymentException("Cannot install bundle: " + metadata, ex);
- }
- }
-
- @Override
- public void undeploy(DeploymentUnit unit, BundleMetaData osGiMetaData)
- {
- Bundle bundle = unit.getAttachment(Bundle.class);
- if (bundle != null)
- {
- try
- {
- bundle.uninstall();
- log.info("Uninstalled: " + bundle);
- }
- catch (BundleException ex)
- {
- log.warn(ex);
- }
- }
- }
-}
Deleted: projects/jboss-osgi/trunk/bundle/deployment/src/main/java/org/jboss/osgi/deployment/BundleStartStopDeployer.java
===================================================================
--- projects/jboss-osgi/trunk/bundle/deployment/src/main/java/org/jboss/osgi/deployment/BundleStartStopDeployer.java 2009-04-29 11:55:49 UTC (rev 87995)
+++ projects/jboss-osgi/trunk/bundle/deployment/src/main/java/org/jboss/osgi/deployment/BundleStartStopDeployer.java 2009-04-29 13:43:29 UTC (rev 87996)
@@ -1,152 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file 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.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.jboss.deployers.spi.DeploymentException;
-import org.jboss.deployers.spi.deployer.helpers.AbstractSimpleRealDeployer;
-import org.jboss.deployers.structure.spi.DeploymentUnit;
-import org.jboss.osgi.spi.Constants;
-import org.osgi.framework.Bundle;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.BundleException;
-import org.osgi.framework.ServiceReference;
-import org.osgi.service.packageadmin.PackageAdmin;
-
-/**
- * This is the Bundle start/stop Deployer
- *
- * @author Ales.Justin(a)jboss.org
- * @author Thomas.Diesler(a)jboss.com
- * @since 27-Feb-2009
- */
-public class BundleStartStopDeployer extends AbstractSimpleRealDeployer<Bundle>
-{
- private BundleContext systemContext;
- private PackageAdmin packageAdmin;
-
- // The list of unresolved bundles
- private List<Bundle> unresolvedBundles = new ArrayList<Bundle>();
-
- public BundleStartStopDeployer()
- {
- super(Bundle.class);
- }
-
- public void setSystemContext(BundleContext systemContext)
- {
- this.systemContext = systemContext;
- }
-
- public void deploy(DeploymentUnit unit, Bundle bundle) throws DeploymentException
- {
- String propStart = systemContext.getProperty(Constants.PROPERTY_DEFERRED_START);
- if (Boolean.parseBoolean(propStart != null ? propStart : "true") == true)
- {
- deferredStart(unit, bundle);
- }
- else
- {
- simpleStart(unit, bundle);
- }
- }
-
- @Override
- public void undeploy(DeploymentUnit unit, Bundle bundle)
- {
- try
- {
- bundle.stop();
-
- unresolvedBundles.remove(bundle);
-
- log.info("Stoped: " + bundle);
- }
- catch (BundleException e)
- {
- log.warn("Cannot stop bundle: " + e);
- }
- }
-
- private void simpleStart(DeploymentUnit unit, Bundle bundle) throws DeploymentException
- {
- try
- {
- bundle.start();
- log.info("Started: " + bundle);
- }
- catch (BundleException e)
- {
- log.warn("Cannot start bundle", e);
- }
- }
-
- private void deferredStart(DeploymentUnit unit, Bundle bundle) throws DeploymentException
- {
- // Get the required dependency on the PackageAdmin service
- if (packageAdmin == null)
- {
- ServiceReference sref = systemContext.getServiceReference(PackageAdmin.class.getName());
- packageAdmin = (PackageAdmin)systemContext.getService(sref);
- if (packageAdmin == null)
- throw new IllegalStateException("Cannot obtain PackageAdmin service");
- }
-
- // Always add the bundle as unresolved
- unresolvedBundles.add(bundle);
-
- Bundle[] bundleArr = new Bundle[unresolvedBundles.size()];
- unresolvedBundles.toArray(bundleArr);
-
- // Try to resolve the bundles
- packageAdmin.resolveBundles(bundleArr);
-
- // Find resolved bundles and start them
- Iterator<Bundle> it = unresolvedBundles.iterator();
- while (it.hasNext())
- {
- Bundle auxBundle = it.next();
- if ((Bundle.RESOLVED & auxBundle.getState()) == Bundle.RESOLVED)
- {
- it.remove();
- try
- {
- auxBundle.start();
- log.info("Started: " + bundle);
- }
- catch (BundleException e)
- {
- log.warn("Cannot start bundle", e);
- }
- }
- }
-
- // Report unresolved bundles
- if (unresolvedBundles.size() > 0)
- log.info("Unresolved: " + unresolvedBundles);
- }
-}
\ No newline at end of file
Deleted: projects/jboss-osgi/trunk/bundle/deployment/src/main/java/org/jboss/osgi/deployment/BundleStructureDeployer.java
===================================================================
--- projects/jboss-osgi/trunk/bundle/deployment/src/main/java/org/jboss/osgi/deployment/BundleStructureDeployer.java 2009-04-29 11:55:49 UTC (rev 87995)
+++ projects/jboss-osgi/trunk/bundle/deployment/src/main/java/org/jboss/osgi/deployment/BundleStructureDeployer.java 2009-04-29 13:43:29 UTC (rev 87996)
@@ -1,94 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file 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.util.jar.Attributes;
-import java.util.jar.Manifest;
-
-import org.jboss.deployers.spi.DeploymentException;
-import org.jboss.deployers.spi.structure.ContextInfo;
-import org.jboss.deployers.vfs.plugins.structure.AbstractVFSStructureDeployer;
-import org.jboss.deployers.vfs.spi.structure.StructureContext;
-import org.jboss.virtual.VFSUtils;
-import org.jboss.virtual.VirtualFile;
-import org.osgi.framework.Constants;
-
-/**
- * Determine the structure of a Bundle deployment.
- *
- * @author Thomas.Diesler(a)jboss.com
- * @since 16-Apr-2009
- */
-public class BundleStructureDeployer extends AbstractVFSStructureDeployer
-{
- /**
- * Sets the default relative order 9000.
- */
- public BundleStructureDeployer()
- {
- setRelativeOrder(9000);
- }
-
- /**
- * Determine the structure of a bundle deployment
- *
- * @param context the structure context
- * @return true when it recognised the context
- * @throws DeploymentException for an error
- */
- public boolean determineStructure(StructureContext structureContext) throws DeploymentException
- {
- ContextInfo context = null;
- VirtualFile file = structureContext.getFile();
- VirtualFile root = structureContext.getRoot();
-
- try
- {
- // This file is not for me, because I'm only interested
- // in root deployments that contain a MANIFEST.MF
- Manifest manifest = VFSUtils.getManifest(file);
- if (file != root || manifest == null)
- return false;
-
- // This file is also not for me, because I need to see Bundle-SymbolicName
- Attributes attribs = manifest.getMainAttributes();
- String symbolicName = attribs.getValue(Constants.BUNDLE_SYMBOLICNAME);
- if (symbolicName == null)
- return false;
-
- // Create a context for this jar file with META-INF as the location for metadata
- context = createContext(structureContext, "META-INF");
-
- return true;
- }
- catch (Exception e)
- {
- // Remove the invalid context
- if (context != null)
- structureContext.removeChild(context);
-
- throw DeploymentException.rethrowAsDeploymentException("Error determining structure: " + file.getName(), e);
- }
- }
-}
\ No newline at end of file
Deleted: projects/jboss-osgi/trunk/bundle/deployment/src/main/java/org/jboss/osgi/deployment/DeploymentService.java
===================================================================
--- projects/jboss-osgi/trunk/bundle/deployment/src/main/java/org/jboss/osgi/deployment/DeploymentService.java 2009-04-29 11:55:49 UTC (rev 87995)
+++ projects/jboss-osgi/trunk/bundle/deployment/src/main/java/org/jboss/osgi/deployment/DeploymentService.java 2009-04-29 13:43:29 UTC (rev 87996)
@@ -1,34 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file 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$
-
-/**
- * The JBossOSGi deployment service
- *
- * @author Thomas.Diesler(a)jboss.com
- * @since 28-Apr-2009
- */
-public interface DeploymentService
-{
-}
\ No newline at end of file
Deleted: projects/jboss-osgi/trunk/bundle/deployment/src/main/java/org/jboss/osgi/deployment/internal/BundleClassLoader.java
===================================================================
--- projects/jboss-osgi/trunk/bundle/deployment/src/main/java/org/jboss/osgi/deployment/internal/BundleClassLoader.java 2009-04-29 11:55:49 UTC (rev 87995)
+++ projects/jboss-osgi/trunk/bundle/deployment/src/main/java/org/jboss/osgi/deployment/internal/BundleClassLoader.java 2009-04-29 13:43:29 UTC (rev 87996)
@@ -1,115 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file 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.io.IOException;
-import java.net.URL;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-import java.util.Dictionary;
-import java.util.Enumeration;
-
-import org.osgi.framework.Bundle;
-import org.osgi.framework.Constants;
-
-/**
- * A BundleClassLoader delegates all classloading concerns to the underlying Bundle.
- *
- * @author Ales.Justin(a)jboss.org
- * @author thomas.Diesler(a)jboss.org
- * @since 03-Feb-2009
- */
-public class BundleClassLoader extends ClassLoader
-{
- private final Bundle bundle;
-
- public static BundleClassLoader createBundleClassLoader(final Bundle bundle)
- {
- if (bundle == null)
- throw new IllegalArgumentException("Null bundle");
-
- return AccessController.doPrivileged(new PrivilegedAction<BundleClassLoader>()
- {
- public BundleClassLoader run()
- {
- return new BundleClassLoader(bundle);
- }
- });
- }
-
- private BundleClassLoader(Bundle bundle)
- {
- this.bundle = bundle;
- }
-
- protected Class<?> findClass(String name) throws ClassNotFoundException
- {
- return bundle.loadClass(name);
- }
-
- protected URL findResource(String name)
- {
- return bundle.getResource(name);
- }
-
- @SuppressWarnings("unchecked")
- protected Enumeration<URL> findResources(String name) throws IOException
- {
- return bundle.getResources(name);
- }
-
- public URL getResource(String name)
- {
- return findResource(name);
- }
-
- public Class<?> loadClass(String name) throws ClassNotFoundException
- {
- return findClass(name);
- }
-
- public boolean equals(Object o)
- {
- if (this == o)
- return true;
-
- if (o instanceof BundleClassLoader == false)
- return false;
-
- final BundleClassLoader bundleClassLoader = (BundleClassLoader)o;
- return bundle.equals(bundleClassLoader.bundle);
- }
-
- public int hashCode()
- {
- return bundle.hashCode();
- }
-
- public String toString()
- {
- Dictionary<?, ?> dictionary = bundle.getHeaders();
- String bname = dictionary.get(Constants.BUNDLE_NAME) + "(" + dictionary.get(Constants.BUNDLE_SYMBOLICNAME) + ")";
- return "BundleClassLoader for [" + bname + "]";
- }
-}
Deleted: projects/jboss-osgi/trunk/bundle/deployment/src/main/java/org/jboss/osgi/deployment/internal/BundleDeploymentUnitFilter.java
===================================================================
--- projects/jboss-osgi/trunk/bundle/deployment/src/main/java/org/jboss/osgi/deployment/internal/BundleDeploymentUnitFilter.java 2009-04-29 11:55:49 UTC (rev 87995)
+++ projects/jboss-osgi/trunk/bundle/deployment/src/main/java/org/jboss/osgi/deployment/internal/BundleDeploymentUnitFilter.java 2009-04-29 13:43:29 UTC (rev 87996)
@@ -1,43 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file 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 org.jboss.deployers.structure.spi.DeploymentUnit;
-import org.jboss.deployers.structure.spi.DeploymentUnitFilter;
-import org.osgi.framework.Bundle;
-
-/**
- * A DeploymentUnitFilter that rejects OSGi bundle deployments.
- *
- * @author Thomas.Diesler(a)jboss.com
- * @since 27-Feb-2009
- */
-public class BundleDeploymentUnitFilter implements DeploymentUnitFilter
-{
- public boolean accepts(DeploymentUnit unit)
- {
- Bundle bundle = unit.getTopLevel().getAttachment(Bundle.class);
- return bundle == null;
- }
-}
\ No newline at end of file
Copied: projects/jboss-osgi/trunk/bundle/deployment/src/main/java/org/jboss/osgi/deployment/internal/DeployersActivator.java (from rev 87977, projects/jboss-osgi/trunk/bundle/deployment/src/main/java/org/jboss/osgi/deployment/internal/ServiceActivator.java)
===================================================================
--- projects/jboss-osgi/trunk/bundle/deployment/src/main/java/org/jboss/osgi/deployment/internal/DeployersActivator.java (rev 0)
+++ projects/jboss-osgi/trunk/bundle/deployment/src/main/java/org/jboss/osgi/deployment/internal/DeployersActivator.java 2009-04-29 13:43:29 UTC (rev 87996)
@@ -0,0 +1,75 @@
+/*
+ * 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.deployers.spi.DeploymentException;
+import org.jboss.osgi.microcontainer.MicrocontainerService;
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceReference;
+
+/**
+ * A BundleActivator that installs the OSGi deployers with the MC
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 24-Apr-2009
+ */
+public class DeployersActivator implements BundleActivator
+{
+ private URL deployersURL;
+
+ public void start(BundleContext context)
+ {
+ deployersURL = context.getBundle().getResource("META-INF/jboss-osgi-deployers.xml");
+
+ MicrocontainerService service = getMicrocontainerService(context);
+ if (service == null)
+ throw new IllegalStateException("MicrocontainerService not available");
+
+ try
+ {
+ service.deploy(deployersURL);
+ }
+ catch (DeploymentException ex)
+ {
+ throw new IllegalStateException("Cannot deploy: " + deployersURL, ex);
+ }
+ }
+
+ public void stop(BundleContext context)
+ {
+ MicrocontainerService service = getMicrocontainerService(context);
+ if (service != null)
+ service.undeploy(deployersURL);
+ }
+
+ private MicrocontainerService getMicrocontainerService(BundleContext context)
+ {
+ ServiceReference sref = context.getServiceReference(MicrocontainerService.class.getName());
+ MicrocontainerService service = (MicrocontainerService)context.getService(sref);
+ return service;
+ }
+}
\ No newline at end of file
Deleted: projects/jboss-osgi/trunk/bundle/deployment/src/main/java/org/jboss/osgi/deployment/internal/DeploymentProvidedDeploymentUnitFilter.java
===================================================================
--- projects/jboss-osgi/trunk/bundle/deployment/src/main/java/org/jboss/osgi/deployment/internal/DeploymentProvidedDeploymentUnitFilter.java 2009-04-29 11:55:49 UTC (rev 87995)
+++ projects/jboss-osgi/trunk/bundle/deployment/src/main/java/org/jboss/osgi/deployment/internal/DeploymentProvidedDeploymentUnitFilter.java 2009-04-29 13:43:29 UTC (rev 87996)
@@ -1,50 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file 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 org.jboss.deployers.structure.spi.DeploymentUnit;
-import org.jboss.deployers.structure.spi.DeploymentUnitFilter;
-import org.jboss.deployers.vfs.spi.structure.helpers.VFS2BaseBridgeDeploymentUnitFilter;
-
-/**
- * A DeploymentUnitFilter that delegates its work the DeploymentUnitFilter that
- * is attached to the DeploymentUnit.
- *
- * A Deployer can attach a DeploymentUnitFilter to a DeploymentUnit which controlls whether
- * the DeploymentUnit is to be processed by following Deployers
- *
- * [TODO] Remove this class when this functionallity is natively supported by all target containers
- *
- * @author Thomas.Diesler(a)jboss.com
- * @since 27-Feb-2009
- */
-public class DeploymentProvidedDeploymentUnitFilter extends VFS2BaseBridgeDeploymentUnitFilter
-{
- @Override
- protected boolean doAccepts(DeploymentUnit unit)
- {
- DeploymentUnitFilter filter = unit.getTopLevel().getAttachment(DeploymentUnitFilter.class);
- return filter == null || filter.accepts(unit);
- }
-}
\ No newline at end of file
Deleted: projects/jboss-osgi/trunk/bundle/deployment/src/main/java/org/jboss/osgi/deployment/internal/DeploymentServiceImpl.java
===================================================================
--- projects/jboss-osgi/trunk/bundle/deployment/src/main/java/org/jboss/osgi/deployment/internal/DeploymentServiceImpl.java 2009-04-29 11:55:49 UTC (rev 87995)
+++ projects/jboss-osgi/trunk/bundle/deployment/src/main/java/org/jboss/osgi/deployment/internal/DeploymentServiceImpl.java 2009-04-29 13:43:29 UTC (rev 87996)
@@ -1,40 +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 org.jboss.osgi.deployment.DeploymentService;
-import org.osgi.framework.BundleContext;
-
-/**
- * The DeploymentService implementation
- *
- * @author thomas.diesler(a)jboss.com
- * @since 28-Apr-2009
- */
-public class DeploymentServiceImpl implements DeploymentService
-{
- public DeploymentServiceImpl(BundleContext context)
- {
- }
-}
\ No newline at end of file
Deleted: projects/jboss-osgi/trunk/bundle/deployment/src/main/java/org/jboss/osgi/deployment/internal/PackageAdminDependencyItem.java
===================================================================
--- projects/jboss-osgi/trunk/bundle/deployment/src/main/java/org/jboss/osgi/deployment/internal/PackageAdminDependencyItem.java 2009-04-29 11:55:49 UTC (rev 87995)
+++ projects/jboss-osgi/trunk/bundle/deployment/src/main/java/org/jboss/osgi/deployment/internal/PackageAdminDependencyItem.java 2009-04-29 13:43:29 UTC (rev 87996)
@@ -1,74 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file 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;
-
-import org.jboss.dependency.plugins.AbstractDependencyItem;
-import org.jboss.dependency.spi.ControllerState;
-import org.jboss.dependency.spi.Controller;
-import org.jboss.deployers.spi.deployer.DeploymentStages;
-import org.osgi.framework.Bundle;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.ServiceReference;
-import org.osgi.service.packageadmin.PackageAdmin;
-
-/**
- * This dependency item uses the OSGi PackageAdmin to trigger a bundle resolve attempt.
- *
- * @author <a href="mailto:ales.justin@jboss.org">Ales Justin</a>
- * @author Thomas.Diesler(a)jboss.com
- * @since 04-Mar-2009
- */
-public class PackageAdminDependencyItem extends AbstractDependencyItem
-{
- private static final ControllerState CTRL_STATE = new ControllerState(DeploymentStages.CLASSLOADER.getName());
- private final PackageAdmin packageAdmin;
- private final Bundle bundle;
-
- public PackageAdminDependencyItem(BundleContext systemContext, Bundle bundle)
- {
- super(bundle.getSymbolicName(), null, CTRL_STATE, null);
- if (bundle == null)
- throw new IllegalArgumentException("Null bundle");
-
- this.bundle = bundle;
-
- ServiceReference sref = systemContext.getServiceReference(PackageAdmin.class.getName());
- packageAdmin = (PackageAdmin)systemContext.getService(sref);
- if (packageAdmin == null)
- throw new IllegalStateException("Cannot obtain PackageAdmin service");
- }
-
- @Override
- public boolean resolve(Controller controller)
- {
- if (packageAdmin.resolveBundles(new Bundle[] { bundle }))
- setResolved(true);
-
- return isResolved();
- }
-
- @Override
- protected void toHumanReadableString(StringBuilder builder)
- {
- builder.append("Bundle: ").append(bundle);
- }
-}
\ No newline at end of file
Deleted: projects/jboss-osgi/trunk/bundle/deployment/src/main/java/org/jboss/osgi/deployment/internal/ServiceActivator.java
===================================================================
--- projects/jboss-osgi/trunk/bundle/deployment/src/main/java/org/jboss/osgi/deployment/internal/ServiceActivator.java 2009-04-29 11:55:49 UTC (rev 87995)
+++ projects/jboss-osgi/trunk/bundle/deployment/src/main/java/org/jboss/osgi/deployment/internal/ServiceActivator.java 2009-04-29 13:43:29 UTC (rev 87996)
@@ -1,62 +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 org.jboss.osgi.common.log.LogServiceTracker;
-import org.jboss.osgi.deployment.DeploymentService;
-import org.osgi.framework.BundleActivator;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.ServiceRegistration;
-import org.osgi.service.log.LogService;
-
-/**
- * A BundleActivator that registers the {@link DeploymentService}
- *
- * @author thomas.diesler(a)jboss.com
- * @since 24-Apr-2009
- */
-public class ServiceActivator implements BundleActivator
-{
- private ServiceRegistration registration;
- private LogService log;
-
- public void start(BundleContext context)
- {
- log = new LogServiceTracker(context);
-
- log.log(LogService.LOG_DEBUG, "Register DeploymentService");
- DeploymentServiceImpl service = new DeploymentServiceImpl(context);
- registration = context.registerService(DeploymentService.class.getName(), service, null);
- }
-
- public void stop(BundleContext context)
- {
- if (registration != null)
- {
- log.log(LogService.LOG_DEBUG, "Unregister DeploymentService");
- registration.unregister();
- registration = null;
- }
- }
-}
\ No newline at end of file
Added: projects/jboss-osgi/trunk/bundle/deployment/src/main/resources/META-INF/jboss-osgi-deployers.xml
===================================================================
--- projects/jboss-osgi/trunk/bundle/deployment/src/main/resources/META-INF/jboss-osgi-deployers.xml (rev 0)
+++ projects/jboss-osgi/trunk/bundle/deployment/src/main/resources/META-INF/jboss-osgi-deployers.xml 2009-04-29 13:43:29 UTC (rev 87996)
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+
+ <!-- The Framework Management -->
+ <bean name="jboss.osgi:service=ManagedFramework" class="org.jboss.osgi.spi.management.ManagedFramework">
+ <property name="mbeanServer"><inject bean="jboss.osgi:service=MBeanServer"/></property>
+ </bean>
+
+ <!-- The OSGi MetaData Deployer -->
+ <bean name="jboss.osgi:service=BundleMetaDataDeployer" class="org.jboss.osgi.deployer.BundleMetaDataDeployer" />
+
+ <!-- The OSGi Bundle Structure Deployer -->
+ <bean name="jboss.osgi:service=BundleStructureDeployer" class="org.jboss.osgi.deployer.BundleStructureDeployer" />
+
+ <!-- The OSGi Bundle Deployer -->
+ <bean name="jboss.osgi:service=BundleRealDeployer" class="org.jboss.osgi.deployer.BundleRealDeployer">
+ <property name="systemContext"><inject bean="jboss.osgi:service=BundleContext" /></property>
+ </bean>
+
+ <!-- The Bundle ClassLoader Deployer -->
+ <bean name="jboss.osgi:service=BundleClassLoaderDeployer" class="org.jboss.osgi.deployer.BundleClassLoaderDeployer">
+ <property name="systemContext"><inject bean="jboss.osgi:service=BundleContext" /></property>
+ </bean>
+
+ <!-- The Bundle Start/Stop Deployer -->
+ <bean name="jboss.osgi:service=BundleStartStopDeployer" class="org.jboss.osgi.deployer.BundleStartStopDeployer">
+ <property name="systemContext"><inject bean="jboss.osgi:service=BundleContext" /></property>
+ </bean>
+
+ <!-- The Bundle Management Deployer -->
+ <bean name="jboss.osgi:service=BundleManagementDeployer" class="org.jboss.osgi.deployer.BundleManagementDeployer">
+ <property name="mbeanServer"><inject bean="jboss.osgi:service=MBeanServer"/></property>
+ </bean>
+
+</deployment>
\ No newline at end of file
Property changes on: projects/jboss-osgi/trunk/bundle/deployment/src/main/resources/META-INF/jboss-osgi-deployers.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: projects/jboss-osgi/trunk/bundle/jmx/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/bundle/jmx/pom.xml 2009-04-29 11:55:49 UTC (rev 87995)
+++ projects/jboss-osgi/trunk/bundle/jmx/pom.xml 2009-04-29 13:43:29 UTC (rev 87996)
@@ -59,7 +59,7 @@
<extensions>true</extensions>
<configuration>
<instructions>
- <Bundle-SymbolicName>jboss-osgi-jmx</Bundle-SymbolicName>
+ <Bundle-SymbolicName>${artifactId}</Bundle-SymbolicName>
<Bundle-Activator>org.jboss.osgi.jmx.ServiceActivator</Bundle-Activator>
<Import-Package>
org.jboss.osgi.common.log,
Modified: projects/jboss-osgi/trunk/bundle/logging/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/bundle/logging/pom.xml 2009-04-29 11:55:49 UTC (rev 87995)
+++ projects/jboss-osgi/trunk/bundle/logging/pom.xml 2009-04-29 13:43:29 UTC (rev 87996)
@@ -46,7 +46,7 @@
<extensions>true</extensions>
<configuration>
<instructions>
- <Bundle-SymbolicName>org.jboss.osgi.service.logging</Bundle-SymbolicName>
+ <Bundle-SymbolicName>${artifactId}</Bundle-SymbolicName>
<Bundle-Activator>org.jboss.osgi.service.logging.LoggingActivator</Bundle-Activator>
<Private-Package>org.jboss.osgi.service.logging</Private-Package>
<Import-Package>
Modified: projects/jboss-osgi/trunk/bundle/microcontainer/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/bundle/microcontainer/pom.xml 2009-04-29 11:55:49 UTC (rev 87995)
+++ projects/jboss-osgi/trunk/bundle/microcontainer/pom.xml 2009-04-29 13:43:29 UTC (rev 87996)
@@ -77,7 +77,7 @@
<extensions>true</extensions>
<configuration>
<instructions>
- <Bundle-SymbolicName>jboss-osgi-microcontainer</Bundle-SymbolicName>
+ <Bundle-SymbolicName>${artifactId}</Bundle-SymbolicName>
<Bundle-Activator>org.jboss.osgi.microcontainer.internal.ServiceActivator</Bundle-Activator>
<Export-Package>
org.jboss.osgi.microcontainer;version=${version.jboss.microcontainer}
Modified: projects/jboss-osgi/trunk/bundle/microcontainer/src/main/java/org/jboss/osgi/microcontainer/MicrocontainerService.java
===================================================================
--- projects/jboss-osgi/trunk/bundle/microcontainer/src/main/java/org/jboss/osgi/microcontainer/MicrocontainerService.java 2009-04-29 11:55:49 UTC (rev 87995)
+++ projects/jboss-osgi/trunk/bundle/microcontainer/src/main/java/org/jboss/osgi/microcontainer/MicrocontainerService.java 2009-04-29 13:43:29 UTC (rev 87996)
@@ -26,6 +26,7 @@
import java.net.URL;
import java.util.List;
+import org.jboss.deployers.spi.DeploymentException;
import org.jboss.kernel.Kernel;
/**
@@ -37,9 +38,9 @@
public interface MicrocontainerService
{
/**
- * The name under which the system bundle context is registered: 'jboss.osgi:service=SystemBundleContext'
+ * The name under which the system bundle context is registered: 'jboss.osgi:service=BundleContext'
*/
- String BEAN_SYSTEM_BUNDLE_CONTEXT = "jboss.osgi:service=SystemBundleContext";
+ String BEAN_SYSTEM_BUNDLE_CONTEXT = "jboss.osgi:service=BundleContext";
/**
* The name under which the MBeanServer is registered: 'jboss.osgi:service=MBeanServer'
@@ -75,7 +76,7 @@
/**
* Deploy MC beans from URL
*/
- void deploy(URL url);
+ void deploy(URL url) throws DeploymentException;
/**
* Undeploy MC beans from URL
Modified: projects/jboss-osgi/trunk/bundle/microcontainer/src/main/java/org/jboss/osgi/microcontainer/MicrocontainerServiceMBean.java
===================================================================
--- projects/jboss-osgi/trunk/bundle/microcontainer/src/main/java/org/jboss/osgi/microcontainer/MicrocontainerServiceMBean.java 2009-04-29 11:55:49 UTC (rev 87995)
+++ projects/jboss-osgi/trunk/bundle/microcontainer/src/main/java/org/jboss/osgi/microcontainer/MicrocontainerServiceMBean.java 2009-04-29 13:43:29 UTC (rev 87996)
@@ -28,6 +28,7 @@
import javax.management.ObjectName;
+import org.jboss.deployers.spi.DeploymentException;
import org.jboss.osgi.jmx.ObjectNameFactory;
/**
@@ -51,7 +52,7 @@
/**
* Deploy MC beans from URL
*/
- void deploy(URL url);
+ void deploy(URL url) throws DeploymentException;
/**
* Undeploy MC beans from URL
Modified: projects/jboss-osgi/trunk/bundle/microcontainer/src/main/java/org/jboss/osgi/microcontainer/internal/MicrocontainerServiceImpl.java
===================================================================
--- projects/jboss-osgi/trunk/bundle/microcontainer/src/main/java/org/jboss/osgi/microcontainer/internal/MicrocontainerServiceImpl.java 2009-04-29 11:55:49 UTC (rev 87995)
+++ projects/jboss-osgi/trunk/bundle/microcontainer/src/main/java/org/jboss/osgi/microcontainer/internal/MicrocontainerServiceImpl.java 2009-04-29 13:43:29 UTC (rev 87996)
@@ -23,14 +23,16 @@
//$Id$
+import java.io.IOException;
import java.net.URL;
import java.util.ArrayList;
+import java.util.Collections;
import java.util.HashMap;
import java.util.List;
+import java.util.Map;
import javax.management.MBeanServer;
import javax.management.StandardMBean;
-import javax.xml.parsers.SAXParserFactory;
import org.jboss.dependency.plugins.AbstractController;
import org.jboss.dependency.plugins.AbstractControllerContext;
@@ -40,12 +42,16 @@
import org.jboss.dependency.spi.ControllerContextActions;
import org.jboss.dependency.spi.ControllerState;
import org.jboss.deployers.client.spi.main.MainDeployer;
+import org.jboss.deployers.spi.DeploymentException;
+import org.jboss.deployers.vfs.spi.client.VFSDeployment;
+import org.jboss.deployers.vfs.spi.client.VFSDeploymentFactory;
import org.jboss.kernel.Kernel;
import org.jboss.kernel.spi.dependency.KernelController;
import org.jboss.osgi.common.log.LogServiceTracker;
import org.jboss.osgi.microcontainer.MicrocontainerService;
import org.jboss.osgi.microcontainer.MicrocontainerServiceMBean;
-import org.jboss.osgi.spi.NotImplementedException;
+import org.jboss.virtual.VFS;
+import org.jboss.virtual.VirtualFile;
import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceReference;
import org.osgi.framework.ServiceRegistration;
@@ -60,13 +66,14 @@
*/
public class MicrocontainerServiceImpl implements MicrocontainerService, MicrocontainerServiceMBean
{
- private static final SAXParserFactory saxFactory = SAXParserFactory.newInstance();
-
private BundleContext context;
private EmbeddedBeansDeployer deployer;
private MBeanServerTracker mbeanServerTracker;
private ServiceRegistration registration;
private LogService log;
+
+ private VFSDeploymentFactory deploymentFactory = VFSDeploymentFactory.getInstance();
+ private Map<URL, String> contextMap = Collections.synchronizedMap(new HashMap<URL, String>());
public MicrocontainerServiceImpl(BundleContext context)
{
@@ -98,14 +105,45 @@
return context != null ? context.getTarget() : null;
}
- public void deploy(URL url)
+ public void deploy(URL url) throws DeploymentException
{
- MainDeployer mainDeployer = (MainDeployer)getRegisteredBean(BEAN_MAIN_DEPLOYER);
+ try
+ {
+ MainDeployer mainDeployer = (MainDeployer)getRegisteredBean(BEAN_MAIN_DEPLOYER);
+ VirtualFile file = VFS.createNewRoot(url);
+ VFSDeployment deployment = deploymentFactory.createVFSDeployment(file);
+ mainDeployer.addDeployment(deployment);
+ String deploymentName = deployment.getName();
+ mainDeployer.process();
+ contextMap.put(url, deploymentName);
+ mainDeployer.checkComplete(deployment);
+ }
+ catch (IOException ex)
+ {
+ DeploymentException.rethrowAsDeploymentException("Cannot deploy: " + url, ex);
+ }
}
public void undeploy(URL url)
{
- throw new NotImplementedException();
+ String deploymentName = contextMap.remove(url);
+ if (deploymentName != null)
+ {
+ try
+ {
+ MainDeployer mainDeployer = (MainDeployer)getRegisteredBean(BEAN_MAIN_DEPLOYER);
+ mainDeployer.removeDeployment(deploymentName);
+ mainDeployer.process();
+ }
+ catch (DeploymentException ex)
+ {
+ log.log(LogService.LOG_ERROR, "Cannot undeploy: " + url, ex);
+ }
+ }
+ else
+ {
+ log.log(LogService.LOG_WARNING, "Package not deployed: " + url);
+ }
}
void start()
Modified: projects/jboss-osgi/trunk/bundle/remotelog/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/bundle/remotelog/pom.xml 2009-04-29 11:55:49 UTC (rev 87995)
+++ projects/jboss-osgi/trunk/bundle/remotelog/pom.xml 2009-04-29 13:43:29 UTC (rev 87996)
@@ -77,7 +77,7 @@
<extensions>true</extensions>
<configuration>
<instructions>
- <Bundle-SymbolicName>org.jboss.osgi.service.remotelog</Bundle-SymbolicName>
+ <Bundle-SymbolicName>${artifactId}</Bundle-SymbolicName>
<Bundle-Activator>org.jboss.osgi.service.remotelog.RemoteLogActivator</Bundle-Activator>
<Export-Package>org.jboss.osgi.service.remotelog;version=${version}</Export-Package>
<Import-Package>
Modified: projects/jboss-osgi/trunk/bundle/webconsole/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/bundle/webconsole/pom.xml 2009-04-29 11:55:49 UTC (rev 87995)
+++ projects/jboss-osgi/trunk/bundle/webconsole/pom.xml 2009-04-29 13:43:29 UTC (rev 87996)
@@ -106,7 +106,7 @@
<extensions>true</extensions>
<configuration>
<instructions>
- <Bundle-SymbolicName>org.jboss.osgi.service.webconsole</Bundle-SymbolicName>
+ <Bundle-SymbolicName>${artifactId}</Bundle-SymbolicName>
<Bundle-Activator>org.jboss.osgi.service.webconsole.internal.WebConsoleActivator</Bundle-Activator>
<Export-Package>
org.apache.felix.webconsole;version=${version.felix.webconsole},
17 years
JBoss-OSGI SVN: r87995 - in projects/jboss-osgi/trunk: bundle/blueprint/src/test/resources and 9 other directories.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-04-29 07:55:49 -0400 (Wed, 29 Apr 2009)
New Revision: 87995
Added:
projects/jboss-osgi/trunk/bundle/microcontainer/src/main/resources/
projects/jboss-osgi/trunk/bundle/microcontainer/src/main/resources/META-INF/
projects/jboss-osgi/trunk/bundle/microcontainer/src/main/resources/META-INF/base-deployers-beans.xml
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/framework/ExportedPackageHelper.java
Modified:
projects/jboss-osgi/trunk/bundle/blueprint/src/test/java/org/jboss/test/osgi/blueprint/mcservice/MicrocontainerServiceTestCase.java
projects/jboss-osgi/trunk/bundle/blueprint/src/test/resources/basic-felix-framework.properties
projects/jboss-osgi/trunk/bundle/blueprint/src/test/resources/jboss-osgi-framework.properties
projects/jboss-osgi/trunk/bundle/microcontainer/pom.xml
projects/jboss-osgi/trunk/bundle/microcontainer/src/main/java/org/jboss/osgi/microcontainer/MicrocontainerService.java
projects/jboss-osgi/trunk/bundle/microcontainer/src/main/java/org/jboss/osgi/microcontainer/internal/MicrocontainerServiceImpl.java
projects/jboss-osgi/trunk/bundle/microcontainer/src/main/java/org/jboss/osgi/microcontainer/internal/ServiceActivator.java
projects/jboss-osgi/trunk/runtime/felix/src/main/java/org/jboss/osgi/felix/framework/FelixIntegration.java
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/junit/OSGiTestHelper.java
Log:
XMLParser handling - ok
Modified: projects/jboss-osgi/trunk/bundle/blueprint/src/test/java/org/jboss/test/osgi/blueprint/mcservice/MicrocontainerServiceTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/bundle/blueprint/src/test/java/org/jboss/test/osgi/blueprint/mcservice/MicrocontainerServiceTestCase.java 2009-04-29 11:54:59 UTC (rev 87994)
+++ projects/jboss-osgi/trunk/bundle/blueprint/src/test/java/org/jboss/test/osgi/blueprint/mcservice/MicrocontainerServiceTestCase.java 2009-04-29 11:55:49 UTC (rev 87995)
@@ -26,6 +26,7 @@
import static org.jboss.osgi.microcontainer.MicrocontainerServiceMBean.MBEAN_MICROCONTAINER_SERVICE;
import static org.jboss.osgi.microcontainer.MicrocontainerService.BEAN_SYSTEM_BUNDLE_CONTEXT;
import static org.jboss.osgi.microcontainer.MicrocontainerService.BEAN_MBEAN_SERVER;
+import static org.jboss.osgi.microcontainer.MicrocontainerService.BEAN_MAIN_DEPLOYER;
import static org.jboss.osgi.microcontainer.MicrocontainerService.BEAN_KERNEL;
import java.util.List;
@@ -58,6 +59,7 @@
MicrocontainerServiceMBean mcService = MBeanProxy.get(MicrocontainerServiceMBean.class, MBEAN_MICROCONTAINER_SERVICE, getMBeanServer());
List<String> registeredBeans = mcService.getRegisteredBeans();
assertTrue("MicrocontainerService registered with MC", registeredBeans.contains(BEAN_SYSTEM_BUNDLE_CONTEXT));
+ assertTrue("MainDeployer registered with MC", registeredBeans.contains(BEAN_MAIN_DEPLOYER));
assertTrue("MBeanServer registered with MC", registeredBeans.contains(BEAN_MBEAN_SERVER));
assertTrue("Kernel registered with MC", registeredBeans.contains(BEAN_KERNEL));
}
Modified: projects/jboss-osgi/trunk/bundle/blueprint/src/test/resources/basic-felix-framework.properties
===================================================================
--- projects/jboss-osgi/trunk/bundle/blueprint/src/test/resources/basic-felix-framework.properties 2009-04-29 11:54:59 UTC (rev 87994)
+++ projects/jboss-osgi/trunk/bundle/blueprint/src/test/resources/basic-felix-framework.properties 2009-04-29 11:55:49 UTC (rev 87995)
@@ -10,21 +10,8 @@
# Properties to configure the Framework
# All props start with 'framework.prop'
framework.prop.org.osgi.framework.storage.clean=onFirstInit
-framework.prop.org.osgi.framework.system.packages=\
- javax.activation, \
- javax.management, \
- javax.naming, \
- javax.naming.spi, \
- javax.net, \
- javax.net.ssl, \
- javax.xml.bind.annotation, \
- javax.xml.bind.annotation.adapters, \
- javax.xml.namespace, \
- javax.xml.parsers, \
- javax.xml.transform, \
- javax.xml.transform.sax, \
- org.jboss.logging, \
- org.osgi.framework; version=1.4
+framework.prop.org.osgi.framework.system.packages.extra=\
+ org.jboss.logging
# Bundles that need to be installed with the Framework automatically
framework.autoInstall=\
Modified: projects/jboss-osgi/trunk/bundle/blueprint/src/test/resources/jboss-osgi-framework.properties
===================================================================
--- projects/jboss-osgi/trunk/bundle/blueprint/src/test/resources/jboss-osgi-framework.properties 2009-04-29 11:54:59 UTC (rev 87994)
+++ projects/jboss-osgi/trunk/bundle/blueprint/src/test/resources/jboss-osgi-framework.properties 2009-04-29 11:55:49 UTC (rev 87995)
@@ -10,21 +10,10 @@
# Properties to configure the Framework
# All props start with 'framework.prop'
framework.prop.org.osgi.framework.storage.clean=onFirstInit
-framework.prop.org.osgi.framework.system.packages=\
- javax.activation, \
- javax.management, \
- javax.naming, \
- javax.naming.spi, \
- javax.net, \
- javax.net.ssl, \
- javax.xml.bind, \
- javax.xml.bind.annotation, \
- javax.xml.bind.annotation.adapters, \
- javax.xml.namespace, \
- org.jboss.logging, \
- org.jboss.osgi.spi.management, \
- org.osgi.framework; version=1.4, \
- org.osgi.service.packageadmin; version=1.2
+framework.prop.org.osgi.framework.system.packages.extra=\
+ org.jboss.logging, \
+ org.jboss.osgi.spi, \
+ org.jboss.osgi.spi.management
# Bundles that need to be installed with the Framework automatically
framework.autoInstall=\
Modified: projects/jboss-osgi/trunk/bundle/microcontainer/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/bundle/microcontainer/pom.xml 2009-04-29 11:54:59 UTC (rev 87994)
+++ projects/jboss-osgi/trunk/bundle/microcontainer/pom.xml 2009-04-29 11:55:49 UTC (rev 87995)
@@ -108,6 +108,7 @@
org.jboss.logging,
org.jboss.osgi.common.log,
org.jboss.osgi.jmx,
+ org.jboss.osgi.spi,
org.jboss.reflect.*,
org.jboss.util.*,
org.jboss.xb.*,
Modified: projects/jboss-osgi/trunk/bundle/microcontainer/src/main/java/org/jboss/osgi/microcontainer/MicrocontainerService.java
===================================================================
--- projects/jboss-osgi/trunk/bundle/microcontainer/src/main/java/org/jboss/osgi/microcontainer/MicrocontainerService.java 2009-04-29 11:54:59 UTC (rev 87994)
+++ projects/jboss-osgi/trunk/bundle/microcontainer/src/main/java/org/jboss/osgi/microcontainer/MicrocontainerService.java 2009-04-29 11:55:49 UTC (rev 87995)
@@ -49,6 +49,11 @@
/**
* The name under which the Kernel is registered: 'jboss.osgi:service=Kernel'
*/
+ String BEAN_MAIN_DEPLOYER = "jboss.osgi:service=MainDeployer";
+
+ /**
+ * The name under which the Kernel is registered: 'jboss.osgi:service=Kernel'
+ */
String BEAN_KERNEL = "jboss.osgi:service=Kernel";
/**
Modified: projects/jboss-osgi/trunk/bundle/microcontainer/src/main/java/org/jboss/osgi/microcontainer/internal/MicrocontainerServiceImpl.java
===================================================================
--- projects/jboss-osgi/trunk/bundle/microcontainer/src/main/java/org/jboss/osgi/microcontainer/internal/MicrocontainerServiceImpl.java 2009-04-29 11:54:59 UTC (rev 87994)
+++ projects/jboss-osgi/trunk/bundle/microcontainer/src/main/java/org/jboss/osgi/microcontainer/internal/MicrocontainerServiceImpl.java 2009-04-29 11:55:49 UTC (rev 87995)
@@ -28,6 +28,10 @@
import java.util.HashMap;
import java.util.List;
+import javax.management.MBeanServer;
+import javax.management.StandardMBean;
+import javax.xml.parsers.SAXParserFactory;
+
import org.jboss.dependency.plugins.AbstractController;
import org.jboss.dependency.plugins.AbstractControllerContext;
import org.jboss.dependency.plugins.AbstractControllerContextActions;
@@ -35,11 +39,18 @@
import org.jboss.dependency.spi.ControllerContext;
import org.jboss.dependency.spi.ControllerContextActions;
import org.jboss.dependency.spi.ControllerState;
+import org.jboss.deployers.client.spi.main.MainDeployer;
import org.jboss.kernel.Kernel;
import org.jboss.kernel.spi.dependency.KernelController;
+import org.jboss.osgi.common.log.LogServiceTracker;
import org.jboss.osgi.microcontainer.MicrocontainerService;
import org.jboss.osgi.microcontainer.MicrocontainerServiceMBean;
+import org.jboss.osgi.spi.NotImplementedException;
import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceReference;
+import org.osgi.framework.ServiceRegistration;
+import org.osgi.service.log.LogService;
+import org.osgi.util.tracker.ServiceTracker;
/**
* An OSGi Service the gives access to the Kernel.
@@ -49,29 +60,20 @@
*/
public class MicrocontainerServiceImpl implements MicrocontainerService, MicrocontainerServiceMBean
{
+ private static final SAXParserFactory saxFactory = SAXParserFactory.newInstance();
+
+ private BundleContext context;
private EmbeddedBeansDeployer deployer;
+ private MBeanServerTracker mbeanServerTracker;
+ private ServiceRegistration registration;
+ private LogService log;
public MicrocontainerServiceImpl(BundleContext context)
{
+ this.context = context;
+ this.log = new LogServiceTracker(context);
+
deployer = new EmbeddedBeansDeployer(context);
-
- // Preregister some beans
- try
- {
- Kernel kernel = getKernel();
- KernelController controller = kernel.getController();
- ControllerContextActions actions = new AbstractControllerContextActions(new HashMap<ControllerState, ControllerContextAction>());
- controller.install(new AbstractControllerContext(BEAN_SYSTEM_BUNDLE_CONTEXT, actions, null, context));
- controller.install(new AbstractControllerContext(BEAN_KERNEL, actions, null, kernel));
- }
- catch (RuntimeException rte)
- {
- throw rte;
- }
- catch (Throwable ex)
- {
- throw new IllegalStateException("Cannot register MC bean", ex);
- }
}
public Kernel getKernel()
@@ -82,11 +84,11 @@
public List<String> getRegisteredBeans()
{
List<String> names = new ArrayList<String>();
-
+
AbstractController controller = (AbstractController)getKernel().getController();
for (ControllerContext ctx : controller.getAllContexts())
names.add(ctx.getName().toString());
-
+
return names;
}
@@ -98,29 +100,135 @@
public void deploy(URL url)
{
- ClassLoader ctxLoader = Thread.currentThread().getContextClassLoader();
+ MainDeployer mainDeployer = (MainDeployer)getRegisteredBean(BEAN_MAIN_DEPLOYER);
+ }
+
+ public void undeploy(URL url)
+ {
+ throw new NotImplementedException();
+ }
+
+ void start()
+ {
+ // Preregister some beans
try
{
- Thread.currentThread().setContextClassLoader(getClass().getClassLoader());
- deployer.deploy(url);
+ Kernel kernel = getKernel();
+ KernelController controller = kernel.getController();
+ ControllerContextActions actions = new AbstractControllerContextActions(new HashMap<ControllerState, ControllerContextAction>());
+ controller.install(new AbstractControllerContext(BEAN_SYSTEM_BUNDLE_CONTEXT, actions, null, context));
+ controller.install(new AbstractControllerContext(BEAN_KERNEL, actions, null, kernel));
+
+ URL deployersURL = context.getBundle().getResource("META-INF/base-deployers-beans.xml");
+ deployer.deploy(deployersURL);
}
- finally
+ catch (RuntimeException rte)
{
- Thread.currentThread().setContextClassLoader(ctxLoader);
+ throw rte;
}
+ catch (Throwable ex)
+ {
+ throw new IllegalStateException("Cannot register MC bean", ex);
+ }
+
+ log.log(LogService.LOG_DEBUG, "Register MicrocontainerService");
+ registration = context.registerService(MicrocontainerService.class.getName(), this, null);
+
+ // Track the MBeanServer to register the MicrocontainerServiceMBean
+ mbeanServerTracker = new MBeanServerTracker(context, this);
+ mbeanServerTracker.open();
}
- public void undeploy(URL url)
+ void stop()
{
- ClassLoader ctxLoader = Thread.currentThread().getContextClassLoader();
- try
+ if (registration != null)
{
- Thread.currentThread().setContextClassLoader(getClass().getClassLoader());
- deployer.undeploy(url);
+ log.log(LogService.LOG_DEBUG, "Unregister MicrocontainerService");
+ registration.unregister();
+ registration = null;
}
- finally
+ }
+
+ private void unregisterMBean(MBeanServer server)
+ {
+ if (server.isRegistered(MBEAN_MICROCONTAINER_SERVICE))
{
- Thread.currentThread().setContextClassLoader(ctxLoader);
+ try
+ {
+ log.log(LogService.LOG_DEBUG, "Unregister MicrocontainerServiceMBean");
+ server.unregisterMBean(MBEAN_MICROCONTAINER_SERVICE);
+ }
+ catch (Exception ex)
+ {
+ log.log(LogService.LOG_ERROR, "Cannot register MicrocontainerServiceMBean", ex);
+ }
}
}
+
+ class MBeanServerTracker extends ServiceTracker
+ {
+ private MicrocontainerServiceImpl mcService;
+
+ public MBeanServerTracker(BundleContext context, MicrocontainerServiceImpl mcService)
+ {
+ super(context, MBeanServer.class.getName(), null);
+ this.mcService = mcService;
+ }
+
+ public Object addingService(ServiceReference reference)
+ {
+ MBeanServer server = (MBeanServer)super.addingService(reference);
+
+ // Register the MicrocontainerServiceMBean
+ try
+ {
+ log.log(LogService.LOG_DEBUG, "Register MicrocontainerServiceMBean");
+ StandardMBean mbean = new StandardMBean(mcService, MicrocontainerServiceMBean.class);
+ server.registerMBean(mbean, MBEAN_MICROCONTAINER_SERVICE);
+ }
+ catch (Exception ex)
+ {
+ throw new IllegalStateException("Cannot register MicrocontainerServiceMBean", ex);
+ }
+
+ // Install the MBeanServer with the Kernel
+ try
+ {
+ ControllerContextActions actions = new AbstractControllerContextActions(new HashMap<ControllerState, ControllerContextAction>());
+ mcService.getKernel().getController().install(new AbstractControllerContext(BEAN_MBEAN_SERVER, actions, null, server));
+ }
+ catch (RuntimeException rte)
+ {
+ throw rte;
+ }
+ catch (Throwable ex)
+ {
+ throw new IllegalStateException("Cannot register MC bean", ex);
+ }
+
+ return server;
+ }
+
+ @Override
+ public void removedService(ServiceReference reference, Object service)
+ {
+ // Unregister MBean
+ unregisterMBean((MBeanServer)service);
+
+ // Uninstall the MBeanServer from the Kernel
+ try
+ {
+ mcService.getKernel().getController().uninstall(BEAN_MBEAN_SERVER);
+ }
+ catch (RuntimeException rte)
+ {
+ throw rte;
+ }
+ catch (Throwable ex)
+ {
+ throw new IllegalStateException("Cannot register MC bean", ex);
+ }
+ super.removedService(reference, service);
+ }
+ }
}
\ No newline at end of file
Modified: projects/jboss-osgi/trunk/bundle/microcontainer/src/main/java/org/jboss/osgi/microcontainer/internal/ServiceActivator.java
===================================================================
--- projects/jboss-osgi/trunk/bundle/microcontainer/src/main/java/org/jboss/osgi/microcontainer/internal/ServiceActivator.java 2009-04-29 11:54:59 UTC (rev 87994)
+++ projects/jboss-osgi/trunk/bundle/microcontainer/src/main/java/org/jboss/osgi/microcontainer/internal/ServiceActivator.java 2009-04-29 11:55:49 UTC (rev 87995)
@@ -23,28 +23,9 @@
//$Id$
-import static org.jboss.osgi.microcontainer.MicrocontainerService.BEAN_MBEAN_SERVER;
-import static org.jboss.osgi.microcontainer.MicrocontainerServiceMBean.MBEAN_MICROCONTAINER_SERVICE;
-
-import java.util.HashMap;
-
-import javax.management.MBeanServer;
-import javax.management.StandardMBean;
-
-import org.jboss.dependency.plugins.AbstractControllerContext;
-import org.jboss.dependency.plugins.AbstractControllerContextActions;
-import org.jboss.dependency.plugins.action.ControllerContextAction;
-import org.jboss.dependency.spi.ControllerContextActions;
-import org.jboss.dependency.spi.ControllerState;
-import org.jboss.osgi.common.log.LogServiceTracker;
import org.jboss.osgi.microcontainer.MicrocontainerService;
-import org.jboss.osgi.microcontainer.MicrocontainerServiceMBean;
import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;
-import org.osgi.framework.ServiceReference;
-import org.osgi.framework.ServiceRegistration;
-import org.osgi.service.log.LogService;
-import org.osgi.util.tracker.ServiceTracker;
/**
* A BundleActivator that registers the {@link MicrocontainerService}
@@ -54,47 +35,16 @@
*/
public class ServiceActivator implements BundleActivator
{
- private ServiceRegistration registration;
- private MBeanServerTracker mbeanServerTracker;
- private LogService log;
+ private MicrocontainerServiceImpl mcService;
public void start(BundleContext context)
{
- log = new LogServiceTracker(context);
-
- // Register the MicrocontainerService as OSGi service
- MicrocontainerServiceImpl mcService = registerOSGiService(context);
-
- // Track the MBeanServer to register the MicrocontainerServiceMBean
- mbeanServerTracker = new MBeanServerTracker(context, mcService);
- mbeanServerTracker.open();
- }
-
- public void stop(BundleContext context)
- {
- if (registration != null)
- {
- MBeanServer server = (MBeanServer)mbeanServerTracker.getService();
- if (server != null)
- unregisterMBean(server);
-
- log.log(LogService.LOG_DEBUG, "Unregister MicrocontainerService");
- registration.unregister();
- registration = null;
- }
- }
-
- private MicrocontainerServiceImpl registerOSGiService(BundleContext context)
- {
ClassLoader ctxLoader = Thread.currentThread().getContextClassLoader();
try
{
Thread.currentThread().setContextClassLoader(getClass().getClassLoader());
- MicrocontainerServiceImpl service = new MicrocontainerServiceImpl(context);
-
- log.log(LogService.LOG_DEBUG, "Register MicrocontainerService");
- registration = context.registerService(MicrocontainerService.class.getName(), service, null);
- return service;
+ mcService = new MicrocontainerServiceImpl(context);
+ mcService.start();
}
finally
{
@@ -102,86 +52,9 @@
}
}
- private void unregisterMBean(MBeanServer server)
+ public void stop(BundleContext context)
{
- if (server.isRegistered(MBEAN_MICROCONTAINER_SERVICE))
- {
- try
- {
- log.log(LogService.LOG_DEBUG, "Unregister MicrocontainerServiceMBean");
- server.unregisterMBean(MBEAN_MICROCONTAINER_SERVICE);
- }
- catch (Exception ex)
- {
- log.log(LogService.LOG_ERROR, "Cannot register MicrocontainerServiceMBean", ex);
- }
- }
+ if (mcService != null)
+ mcService.stop();
}
-
- class MBeanServerTracker extends ServiceTracker
- {
- private MicrocontainerServiceImpl mcService;
-
- public MBeanServerTracker(BundleContext context, MicrocontainerServiceImpl mcService)
- {
- super(context, MBeanServer.class.getName(), null);
- this.mcService = mcService;
- }
-
- public Object addingService(ServiceReference reference)
- {
- MBeanServer server = (MBeanServer)super.addingService(reference);
-
- // Register the MicrocontainerServiceMBean
- try
- {
- log.log(LogService.LOG_DEBUG, "Register MicrocontainerServiceMBean");
- StandardMBean mbean = new StandardMBean(mcService, MicrocontainerServiceMBean.class);
- server.registerMBean(mbean, MBEAN_MICROCONTAINER_SERVICE);
- }
- catch (Exception ex)
- {
- throw new IllegalStateException("Cannot register MicrocontainerServiceMBean", ex);
- }
-
- // Install the MBeanServer with the Kernel
- try
- {
- ControllerContextActions actions = new AbstractControllerContextActions(new HashMap<ControllerState, ControllerContextAction>());
- mcService.getKernel().getController().install(new AbstractControllerContext(BEAN_MBEAN_SERVER, actions, null, server));
- }
- catch (RuntimeException rte)
- {
- throw rte;
- }
- catch (Throwable ex)
- {
- throw new IllegalStateException("Cannot register MC bean", ex);
- }
-
- return server;
- }
-
- @Override
- public void removedService(ServiceReference reference, Object service)
- {
- // Unregister MBean
- unregisterMBean((MBeanServer)service);
-
- // Uninstall the MBeanServer from the Kernel
- try
- {
- mcService.getKernel().getController().uninstall(BEAN_MBEAN_SERVER);
- }
- catch (RuntimeException rte)
- {
- throw rte;
- }
- catch (Throwable ex)
- {
- throw new IllegalStateException("Cannot register MC bean", ex);
- }
- super.removedService(reference, service);
- }
- }
}
\ No newline at end of file
Added: projects/jboss-osgi/trunk/bundle/microcontainer/src/main/resources/META-INF/base-deployers-beans.xml
===================================================================
--- projects/jboss-osgi/trunk/bundle/microcontainer/src/main/resources/META-INF/base-deployers-beans.xml (rev 0)
+++ projects/jboss-osgi/trunk/bundle/microcontainer/src/main/resources/META-INF/base-deployers-beans.xml 2009-04-29 11:55:49 UTC (rev 87995)
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ The base deployers
+-->
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+
+ <!-- The MainDeployer -->
+ <bean name="jboss.osgi:service=MainDeployer" class="org.jboss.deployers.plugins.main.MainDeployerImpl">
+ </bean>
+
+</deployment>
\ No newline at end of file
Property changes on: projects/jboss-osgi/trunk/bundle/microcontainer/src/main/resources/META-INF/base-deployers-beans.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: projects/jboss-osgi/trunk/runtime/felix/src/main/java/org/jboss/osgi/felix/framework/FelixIntegration.java
===================================================================
--- projects/jboss-osgi/trunk/runtime/felix/src/main/java/org/jboss/osgi/felix/framework/FelixIntegration.java 2009-04-29 11:54:59 UTC (rev 87994)
+++ projects/jboss-osgi/trunk/runtime/felix/src/main/java/org/jboss/osgi/felix/framework/FelixIntegration.java 2009-04-29 11:55:49 UTC (rev 87995)
@@ -32,6 +32,7 @@
import org.apache.felix.framework.Felix;
import org.jboss.logging.Logger;
import org.jboss.osgi.spi.FrameworkException;
+import org.jboss.osgi.spi.framework.ExportedPackageHelper;
import org.jboss.osgi.spi.framework.OSGiFramework;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
@@ -146,7 +147,8 @@
try
{
Bundle bundle = context.installBundle(bundleURL.toString());
- log.info("Installed bundle: " + bundle.getSymbolicName());
+ long bundleId = bundle.getBundleId();
+ log.info("Installed bundle [" + bundleId + "]: " + bundle.getSymbolicName());
autoBundles.put(bundleURL, bundle);
}
catch (BundleException ex)
@@ -156,13 +158,18 @@
}
// Start autoStart bundles
+ ExportedPackageHelper packageHelper = new ExportedPackageHelper(context);
for (URL bundleURL : autoStart)
{
try
{
Bundle bundle = autoBundles.get(bundleURL);
- bundle.start();
- log.info("Started bundle: " + bundle.getSymbolicName());
+ if (bundle != null)
+ {
+ bundle.start();
+ packageHelper.logExportedPackages(bundle);
+ log.info("Started bundle: " + bundle.getSymbolicName());
+ }
}
catch (BundleException ex)
{
Added: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/framework/ExportedPackageHelper.java
===================================================================
--- projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/framework/ExportedPackageHelper.java (rev 0)
+++ projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/framework/ExportedPackageHelper.java 2009-04-29 11:55:49 UTC (rev 87995)
@@ -0,0 +1,81 @@
+/*
+ * 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.framework;
+
+//$Id$
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import org.jboss.logging.Logger;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceReference;
+import org.osgi.service.packageadmin.ExportedPackage;
+import org.osgi.service.packageadmin.PackageAdmin;
+
+/**
+ * A helper the logs the exported packages for a bundle.
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 24-Apr-2009
+ */
+public final class ExportedPackageHelper
+{
+ // Provide logging
+ final Logger log = Logger.getLogger(ExportedPackageHelper.class);
+
+ private PackageAdmin packageAdmin;
+
+ public ExportedPackageHelper(BundleContext context)
+ {
+ ServiceReference sref = context.getServiceReference(PackageAdmin.class.getName());
+ packageAdmin = (PackageAdmin)context.getService(sref);
+ }
+
+ public boolean resolveBundle(Bundle bundle)
+ {
+ return packageAdmin.resolveBundles(new Bundle[] { bundle });
+ }
+
+ public boolean resolveBundles(Bundle[] bundles)
+ {
+ return packageAdmin.resolveBundles(bundles);
+ }
+
+ /*
+ * * Log the list of exported packages
+ */
+ public void logExportedPackages(Bundle bundle)
+ {
+ log.debug("Exported-Packages: " + bundle.getSymbolicName());
+
+ List<String> packages = new ArrayList<String>();
+ for (ExportedPackage exp : packageAdmin.getExportedPackages(bundle))
+ packages.add(" " + exp.getName() + ";version=" + exp.getVersion());
+
+ Collections.sort(packages);
+ for (String exp : packages)
+ log.debug(exp);
+ }
+}
\ No newline at end of file
Property changes on: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/framework/ExportedPackageHelper.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/junit/OSGiTestHelper.java
===================================================================
--- projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/junit/OSGiTestHelper.java 2009-04-29 11:54:59 UTC (rev 87994)
+++ projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/junit/OSGiTestHelper.java 2009-04-29 11:55:49 UTC (rev 87995)
@@ -25,6 +25,7 @@
import java.net.MalformedURLException;
import java.net.URL;
+import org.jboss.osgi.spi.framework.ExportedPackageHelper;
import org.jboss.osgi.spi.framework.OSGiBootstrap;
import org.jboss.osgi.spi.framework.OSGiBootstrapProvider;
import org.jboss.osgi.spi.framework.OSGiFramework;
@@ -173,8 +174,15 @@
{
Bundle bundle = sysContext.installBundle(getTestArchiveURL(bundlePath).toExternalForm());
+ ExportedPackageHelper packageHelper = new ExportedPackageHelper(sysContext);
+ packageHelper.resolveBundle(bundle);
+
if (start == true)
+ {
bundle.start();
+ }
+
+ packageHelper.logExportedPackages(bundle);
return bundle;
}
17 years
JBoss-OSGI SVN: r87994 - projects/jboss-osgi/bundles.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-04-29 07:54:59 -0400 (Wed, 29 Apr 2009)
New Revision: 87994
Modified:
projects/jboss-osgi/bundles/
Log:
svn:ignore target
Property changes on: projects/jboss-osgi/bundles
___________________________________________________________________
Name: svn:ignore
- .settings
+ .settings
target
17 years
JBoss-OSGI SVN: r87993 - in projects/jboss-osgi/bundles: apache-xerces and 10 other directories.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-04-29 07:47:21 -0400 (Wed, 29 Apr 2009)
New Revision: 87993
Added:
projects/jboss-osgi/bundles/apache-xerces/.classpath
projects/jboss-osgi/bundles/apache-xerces/.project
projects/jboss-osgi/bundles/apache-xerces/.settings/
projects/jboss-osgi/bundles/apache-xerces/.settings/org.eclipse.jdt.core.prefs
projects/jboss-osgi/bundles/apache-xerces/.settings/org.maven.ide.eclipse.prefs
projects/jboss-osgi/bundles/apache-xerces/src/
projects/jboss-osgi/bundles/apache-xerces/src/main/
projects/jboss-osgi/bundles/apache-xerces/src/main/java/
projects/jboss-osgi/bundles/apache-xerces/src/main/java/org/
projects/jboss-osgi/bundles/apache-xerces/src/main/java/org/jboss/
projects/jboss-osgi/bundles/apache-xerces/src/main/java/org/jboss/osgi/
projects/jboss-osgi/bundles/apache-xerces/src/main/java/org/jboss/osgi/apache/
projects/jboss-osgi/bundles/apache-xerces/src/main/java/org/jboss/osgi/apache/xerces/
projects/jboss-osgi/bundles/apache-xerces/src/main/java/org/jboss/osgi/apache/xerces/internal/
projects/jboss-osgi/bundles/apache-xerces/src/main/java/org/jboss/osgi/apache/xerces/internal/XercesParserActivator.java
Modified:
projects/jboss-osgi/bundles/apache-xerces/pom.xml
projects/jboss-osgi/bundles/pom.xml
Log:
Add BundleActivator to xerces bundle
Added: projects/jboss-osgi/bundles/apache-xerces/.classpath
===================================================================
--- projects/jboss-osgi/bundles/apache-xerces/.classpath (rev 0)
+++ projects/jboss-osgi/bundles/apache-xerces/.classpath 2009-04-29 11:47:21 UTC (rev 87993)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" output="target/classes" path="src/main/java"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
+ <classpathentry kind="output" path="target/classes"/>
+</classpath>
Added: projects/jboss-osgi/bundles/apache-xerces/.project
===================================================================
--- projects/jboss-osgi/bundles/apache-xerces/.project (rev 0)
+++ projects/jboss-osgi/bundles/apache-xerces/.project 2009-04-29 11:47:21 UTC (rev 87993)
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>apache-xerces-bundle</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.maven.ide.eclipse.maven2Builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.maven.ide.eclipse.maven2Nature</nature>
+ </natures>
+</projectDescription>
Added: projects/jboss-osgi/bundles/apache-xerces/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- projects/jboss-osgi/bundles/apache-xerces/.settings/org.eclipse.jdt.core.prefs (rev 0)
+++ projects/jboss-osgi/bundles/apache-xerces/.settings/org.eclipse.jdt.core.prefs 2009-04-29 11:47:21 UTC (rev 87993)
@@ -0,0 +1,5 @@
+#Wed Apr 29 11:59:13 CEST 2009
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.2
+org.eclipse.jdt.core.compiler.compliance=1.4
+org.eclipse.jdt.core.compiler.source=1.3
Added: projects/jboss-osgi/bundles/apache-xerces/.settings/org.maven.ide.eclipse.prefs
===================================================================
--- projects/jboss-osgi/bundles/apache-xerces/.settings/org.maven.ide.eclipse.prefs (rev 0)
+++ projects/jboss-osgi/bundles/apache-xerces/.settings/org.maven.ide.eclipse.prefs 2009-04-29 11:47:21 UTC (rev 87993)
@@ -0,0 +1,9 @@
+#Wed Apr 29 11:59:01 CEST 2009
+activeProfiles=
+eclipse.preferences.version=1
+fullBuildGoals=process-test-resources
+includeModules=false
+resolveWorkspaceProjects=true
+resourceFilterGoals=process-resources resources\:testResources
+skipCompilerPlugin=true
+version=1
Modified: projects/jboss-osgi/bundles/apache-xerces/pom.xml
===================================================================
--- projects/jboss-osgi/bundles/apache-xerces/pom.xml 2009-04-29 11:37:24 UTC (rev 87992)
+++ projects/jboss-osgi/bundles/apache-xerces/pom.xml 2009-04-29 11:47:21 UTC (rev 87993)
@@ -42,6 +42,17 @@
<artifactId>xml-resolver</artifactId>
<version>${version.xml.resolver}</version>
</dependency>
+
+ <dependency>
+ <groupId>org.osgi</groupId>
+ <artifactId>org.osgi.core</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.osgi</groupId>
+ <artifactId>org.osgi.compendium</artifactId>
+ <scope>provided</scope>
+ </dependency>
</dependencies>
<build>
@@ -49,26 +60,37 @@
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
- <executions>
- <execution>
- <phase>package</phase>
- <goals>
- <goal>wrap</goal>
- </goals>
- </execution>
- </executions>
<configuration>
<instructions>
+ <Bundle-SymbolicName>${artifactId}</Bundle-SymbolicName>
+ <Bundle-Activator>org.jboss.osgi.apache.xerces.internal.XercesParserActivator</Bundle-Activator>
+ <Private-Package>
+ org.jboss.osgi.apache.xerces.internal
+ </Private-Package>
<Import-Package>
- !sun.io
+ javax.xml.datatype,
+ javax.xml.namespace,
+ javax.xml.parsers,
+ javax.xml.transform*,
+ javax.xml.validation,
+ org.w3c.dom*,
+ org.xml.sax*,
+
+ <!-- osgi -->
+ org.osgi.framework,
+ org.osgi.util.xml,
+
+ <!-- ignore -->
+ !sun.io,
</Import-Package>
<Embed-Dependency>
dtdparser121;inline=false,
xercesImpl;inline=false,
- xml-apis;inline=false,
xml-resolver;inline=false,
</Embed-Dependency>
- <_exportcontents>*</_exportcontents>
+ <_exportcontents>
+ *
+ </_exportcontents>
</instructions>
</configuration>
</plugin>
Added: projects/jboss-osgi/bundles/apache-xerces/src/main/java/org/jboss/osgi/apache/xerces/internal/XercesParserActivator.java
===================================================================
--- projects/jboss-osgi/bundles/apache-xerces/src/main/java/org/jboss/osgi/apache/xerces/internal/XercesParserActivator.java (rev 0)
+++ projects/jboss-osgi/bundles/apache-xerces/src/main/java/org/jboss/osgi/apache/xerces/internal/XercesParserActivator.java 2009-04-29 11:47:21 UTC (rev 87993)
@@ -0,0 +1,60 @@
+/*
+ * 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.apache.xerces.internal;
+
+//$Id$
+
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+import org.osgi.util.xml.XMLParserActivator;
+
+/**
+ * Activat the XML parser using {@link XMLParserActivator}
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 29-Apr-2009
+ */
+public class XercesParserActivator implements BundleActivator
+{
+ private XMLParserActivator parserActivator;
+
+ public void start(BundleContext context)
+ {
+ try
+ {
+ parserActivator = new XMLParserActivator();
+ parserActivator.start(context);
+ }
+ catch (Exception ex)
+ {
+ throw new IllegalStateException("Cannot activate XML parser", ex);
+ }
+ }
+
+ public void stop(BundleContext context) throws Exception
+ {
+ if (parserActivator != null)
+ {
+ parserActivator.stop(context);
+ }
+ }
+}
\ No newline at end of file
Property changes on: projects/jboss-osgi/bundles/apache-xerces/src/main/java/org/jboss/osgi/apache/xerces/internal/XercesParserActivator.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: projects/jboss-osgi/bundles/pom.xml
===================================================================
--- projects/jboss-osgi/bundles/pom.xml 2009-04-29 11:37:24 UTC (rev 87992)
+++ projects/jboss-osgi/bundles/pom.xml 2009-04-29 11:47:21 UTC (rev 87993)
@@ -11,8 +11,25 @@
<properties>
<version.aqute.bnd>0.0.323</version.aqute.bnd>
+ <version.osgi>r4v41</version.osgi>
</properties>
+ <!-- DependencyManagement -->
+ <dependencyManagement>
+ <dependencies>
+ <dependency>
+ <groupId>org.osgi</groupId>
+ <artifactId>org.osgi.core</artifactId>
+ <version>${version.osgi}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.osgi</groupId>
+ <artifactId>org.osgi.compendium</artifactId>
+ <version>${version.osgi}</version>
+ </dependency>
+ </dependencies>
+ </dependencyManagement>
+
<!-- Modules -->
<modules>
<module>apache-xerces</module>
17 years
JBoss-OSGI SVN: r87983 - in projects/jboss-osgi/trunk/bundle: blueprint and 5 other directories.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-04-29 03:17:59 -0400 (Wed, 29 Apr 2009)
New Revision: 87983
Modified:
projects/jboss-osgi/trunk/bundle/blueprint/pom.xml
projects/jboss-osgi/trunk/bundle/blueprint/scripts/assembly-bundles.xml
projects/jboss-osgi/trunk/bundle/blueprint/src/test/java/org/jboss/test/osgi/blueprint/deployment/DeploymentServiceTestCase.java
projects/jboss-osgi/trunk/bundle/blueprint/src/test/resources/jboss-osgi-framework.properties
projects/jboss-osgi/trunk/bundle/deployment/pom.xml
projects/jboss-osgi/trunk/bundle/microcontainer/pom.xml
projects/jboss-osgi/trunk/bundle/pom.xml
Log:
DeploymentService start - ok
Modified: projects/jboss-osgi/trunk/bundle/blueprint/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/bundle/blueprint/pom.xml 2009-04-29 06:20:29 UTC (rev 87982)
+++ projects/jboss-osgi/trunk/bundle/blueprint/pom.xml 2009-04-29 07:17:59 UTC (rev 87983)
@@ -39,19 +39,23 @@
<!-- Bundle Dependencies -->
<dependency>
<groupId>org.jboss.osgi.bundles</groupId>
- <artifactId>jboss-osgi-common</artifactId>
- <version>${version}</version>
+ <artifactId>apache-xerces-bundle</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.jboss.osgi.bundles</groupId>
- <artifactId>jboss-osgi-logging</artifactId>
+ <artifactId>jboss-common-core-bundle</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.osgi.bundles</groupId>
+ <artifactId>jboss-osgi-common</artifactId>
<version>${version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.jboss.osgi.bundles</groupId>
- <artifactId>jboss-osgi-microcontainer</artifactId>
+ <artifactId>jboss-osgi-deployment</artifactId>
<version>${version}</version>
<scope>provided</scope>
</dependency>
@@ -63,12 +67,14 @@
</dependency>
<dependency>
<groupId>org.jboss.osgi.bundles</groupId>
- <artifactId>apache-xerces-bundle</artifactId>
+ <artifactId>jboss-osgi-logging</artifactId>
+ <version>${version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.jboss.osgi.bundles</groupId>
- <artifactId>jboss-common-core-bundle</artifactId>
+ <artifactId>jboss-osgi-microcontainer</artifactId>
+ <version>${version}</version>
<scope>provided</scope>
</dependency>
<dependency>
Modified: projects/jboss-osgi/trunk/bundle/blueprint/scripts/assembly-bundles.xml
===================================================================
--- projects/jboss-osgi/trunk/bundle/blueprint/scripts/assembly-bundles.xml 2009-04-29 06:20:29 UTC (rev 87982)
+++ projects/jboss-osgi/trunk/bundle/blueprint/scripts/assembly-bundles.xml 2009-04-29 07:17:59 UTC (rev 87983)
@@ -19,6 +19,7 @@
<include>*:org.apache.felix.log:jar</include>
<include>*:org.osgi.compendium:jar</include>
<include>*:jboss-osgi-common:jar</include>
+ <include>*:jboss-osgi-deployment:jar</include>
<include>*:jboss-osgi-logging:jar</include>
<include>*:jboss-osgi-microcontainer:jar</include>
<include>*:jboss-osgi-jmx:jar</include>
Modified: projects/jboss-osgi/trunk/bundle/blueprint/src/test/java/org/jboss/test/osgi/blueprint/deployment/DeploymentServiceTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/bundle/blueprint/src/test/java/org/jboss/test/osgi/blueprint/deployment/DeploymentServiceTestCase.java 2009-04-29 06:20:29 UTC (rev 87982)
+++ projects/jboss-osgi/trunk/bundle/blueprint/src/test/java/org/jboss/test/osgi/blueprint/deployment/DeploymentServiceTestCase.java 2009-04-29 07:17:59 UTC (rev 87983)
@@ -43,8 +43,8 @@
{
BundleContext sysContext = framework.getSystemBundleContext();
- //Bundle bundle = installBundle(sysContext, "bundles/jboss-osgi-deployment.jar", true);
- //assertEquals("Test bundle ACTIVE", Bundle.ACTIVE, bundle.getState());
+ Bundle bundle = installBundle(sysContext, "bundles/jboss-osgi-deployment.jar", true);
+ assertEquals("Test bundle ACTIVE", Bundle.ACTIVE, bundle.getState());
}
finally
Modified: projects/jboss-osgi/trunk/bundle/blueprint/src/test/resources/jboss-osgi-framework.properties
===================================================================
--- projects/jboss-osgi/trunk/bundle/blueprint/src/test/resources/jboss-osgi-framework.properties 2009-04-29 06:20:29 UTC (rev 87982)
+++ projects/jboss-osgi/trunk/bundle/blueprint/src/test/resources/jboss-osgi-framework.properties 2009-04-29 07:17:59 UTC (rev 87983)
@@ -17,14 +17,14 @@
javax.naming.spi, \
javax.net, \
javax.net.ssl, \
+ javax.xml.bind, \
javax.xml.bind.annotation, \
javax.xml.bind.annotation.adapters, \
javax.xml.namespace, \
- javax.xml.parsers, \
- javax.xml.transform, \
- javax.xml.transform.sax, \
org.jboss.logging, \
- org.osgi.framework; version=1.4
+ org.jboss.osgi.spi.management, \
+ org.osgi.framework; version=1.4, \
+ org.osgi.service.packageadmin; version=1.2
# Bundles that need to be installed with the Framework automatically
framework.autoInstall=\
Modified: projects/jboss-osgi/trunk/bundle/deployment/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/bundle/deployment/pom.xml 2009-04-29 06:20:29 UTC (rev 87982)
+++ projects/jboss-osgi/trunk/bundle/deployment/pom.xml 2009-04-29 07:17:59 UTC (rev 87983)
@@ -25,14 +25,13 @@
<artifactId>jboss-osgi-spi</artifactId>
<version>${version}</version>
</dependency>
-
- <!-- Provided DEpendencies -->
<dependency>
- <groupId>org.jboss.osgi</groupId>
+ <groupId>org.jboss.osgi.bundles</groupId>
<artifactId>jboss-osgi-microcontainer</artifactId>
<version>${version}</version>
- <scope>provided</scope>
</dependency>
+
+ <!-- Provided Dependencies -->
<dependency>
<groupId>org.osgi</groupId>
<artifactId>org.osgi.core</artifactId>
@@ -74,21 +73,22 @@
org.jboss.osgi.deployment.internal
</Private-Package>
<Import-Package>
+ <!-- system -->
javax.management,
- org.jboss.dependency.plugins,
- org.jboss.dependency.spi,
+
+ <!-- import -->
+ org.jboss.dependency.*,
org.jboss.deployers.*,
org.jboss.logging,
org.jboss.osgi.common.log,
org.jboss.osgi.spi.management,
- org.jboss.virtual,
+ org.jboss.virtual,
+
+ <!-- osgi -->
org.osgi.framework,
org.osgi.service.log,
org.osgi.service.packageadmin
</Import-Package>
- <Embed-Transitive>true</Embed-Transitive>
- <Embed-Dependency>
- </Embed-Dependency>
</instructions>
</configuration>
</plugin>
Modified: projects/jboss-osgi/trunk/bundle/microcontainer/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/bundle/microcontainer/pom.xml 2009-04-29 06:20:29 UTC (rev 87982)
+++ projects/jboss-osgi/trunk/bundle/microcontainer/pom.xml 2009-04-29 07:17:59 UTC (rev 87983)
@@ -89,10 +89,9 @@
<!-- system -->
javax.management,
javax.naming*,
- javax.xml.bind.*,
- javax.xml.namespace,
- javax.xml.parsers,
- org.w3c.dom,
+ javax.xml.*,
+ org.w3c.dom,
+ org.xml.sax,
<!-- osgi -->
org.osgi.framework,
@@ -104,6 +103,7 @@
org.jboss.beans.*,
org.jboss.classadapter.spi,
org.jboss.config.*,
+ org.jboss.deployers.*,
org.jboss.joinpoint.*,
org.jboss.logging,
org.jboss.osgi.common.log,
@@ -115,18 +115,36 @@
<!-- optional -->
<!-- exclude -->
- !org.apache.commons.httpclient,
- !org.apache.webdav.lib,
- !org.jboss.test.*
+ !org.jboss.test.*,
+ !junit*,
</Import-Package>
<Embed-Transitive>true</Embed-Transitive>
<Embed-Dependency>
+ jboss-classloader;inline=false,
+ jboss-classloading;inline=false,
+ jboss-classloading-spi;inline=false,
+ jboss-classloading-vfs;inline=false,
jboss-dependency;inline=false,
+ jboss-deployers-client-spi;inline=false,
+ jboss-deployers-client;inline=false,
+ jboss-deployers-core-spi;inline=false,
+ jboss-deployers-core;inline=false,
+ jboss-deployers-impl;inline=false,
+ jboss-deployers-spi;inline=false,
+ jboss-deployers-structure-spi;inline=false,
+ jboss-deployers-vfs-spi;inline=false,
+ jboss-deployers-vfs;inline=false,
jboss-managed;inline=false,
jboss-metatype;inline=false,
jboss-mdr;inline=false,
jboss-kernel;inline=false,
+ jboss-vfs;inline=false,
</Embed-Dependency>
+ <_exportcontents>
+ org.jboss.virtual,
+ org.jboss.dependency.*,
+ org.jboss.deployers.*,
+ </_exportcontents>
</instructions>
</configuration>
</plugin>
Modified: projects/jboss-osgi/trunk/bundle/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/bundle/pom.xml 2009-04-29 06:20:29 UTC (rev 87982)
+++ projects/jboss-osgi/trunk/bundle/pom.xml 2009-04-29 07:17:59 UTC (rev 87983)
@@ -15,12 +15,12 @@
<modules>
<module>blueprint</module>
<module>common</module>
- <!-- module>deployment</module -->
+ <module>deployment</module>
<module>jmx</module>
<module>logging</module>
<module>microcontainer</module>
<module>remotelog</module>
<module>webconsole</module>
</modules>
-
+
</project>
17 years
JBoss-OSGI SVN: r87981 - in projects/jboss-osgi/trunk/bundle: blueprint/src/test/resources and 1 other directories.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-04-29 02:17:08 -0400 (Wed, 29 Apr 2009)
New Revision: 87981
Added:
projects/jboss-osgi/trunk/bundle/blueprint/src/test/java/org/jboss/test/osgi/blueprint/mcservice/MicrocontainerServiceTestCase.java
Removed:
projects/jboss-osgi/trunk/bundle/blueprint/src/test/java/org/jboss/test/osgi/blueprint/mcservice/MCServiceTestCase.java
Modified:
projects/jboss-osgi/trunk/bundle/blueprint/src/test/resources/jboss-osgi-framework.properties
projects/jboss-osgi/trunk/bundle/microcontainer/pom.xml
Log:
wiring to 3rd party bundles ok
Deleted: projects/jboss-osgi/trunk/bundle/blueprint/src/test/java/org/jboss/test/osgi/blueprint/mcservice/MCServiceTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/bundle/blueprint/src/test/java/org/jboss/test/osgi/blueprint/mcservice/MCServiceTestCase.java 2009-04-29 06:03:38 UTC (rev 87980)
+++ projects/jboss-osgi/trunk/bundle/blueprint/src/test/java/org/jboss/test/osgi/blueprint/mcservice/MCServiceTestCase.java 2009-04-29 06:17:08 UTC (rev 87981)
@@ -1,75 +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.test.osgi.blueprint.mcservice;
-
-//$Id$
-
-import static org.jboss.osgi.microcontainer.MicrocontainerServiceMBean.MBEAN_MICROCONTAINER_SERVICE;
-import static org.jboss.osgi.microcontainer.MicrocontainerService.BEAN_SYSTEM_BUNDLE_CONTEXT;
-import static org.jboss.osgi.microcontainer.MicrocontainerService.BEAN_MBEAN_SERVER;
-import static org.jboss.osgi.microcontainer.MicrocontainerService.BEAN_KERNEL;
-
-import java.util.List;
-
-import org.jboss.osgi.microcontainer.MicrocontainerServiceMBean;
-import org.jboss.osgi.spi.framework.OSGiFramework;
-import org.jboss.osgi.spi.management.MBeanProxy;
-import org.jboss.test.osgi.blueprint.BlueprintTest;
-import org.osgi.framework.Bundle;
-import org.osgi.framework.BundleContext;
-
-/**
- * A test that checks whether the MicrocontainerService can be accessed
- *
- * @author thomas.diesler(a)jboss.com
- * @since 12-Feb-2009
- */
-public class MCServiceTestCase extends BlueprintTest
-{
- public void testMCServiceAccess() throws Exception
- {
- OSGiFramework framework = getBootstrapProvider().getFramework();
- try
- {
- BundleContext sysContext = framework.getSystemBundleContext();
-
- Bundle bundle = installBundle(sysContext, "mcservice-bundle.jar", true);
- assertEquals("Test bundle ACTIVE", Bundle.ACTIVE, bundle.getState());
-
- MicrocontainerServiceMBean mcService = MBeanProxy.get(MicrocontainerServiceMBean.class, MBEAN_MICROCONTAINER_SERVICE, getMBeanServer());
- List<String> registeredBeans = mcService.getRegisteredBeans();
- assertTrue("MicrocontainerService registered with MC", registeredBeans.contains(BEAN_SYSTEM_BUNDLE_CONTEXT));
- assertTrue("MBeanServer registered with MC", registeredBeans.contains(BEAN_MBEAN_SERVER));
- assertTrue("Kernel registered with MC", registeredBeans.contains(BEAN_KERNEL));
- }
- finally
- {
- framework.stop();
- }
- }
-
- public void testBeansDeployment() throws Exception
- {
- //MicrocontainerServiceMBean mcService = MBeanProxy.get(MicrocontainerServiceMBean.class, MBEAN_MICROCONTAINER_SERVICE, getMBeanServer());
- //mcService.deploy(getTestArchiveURL("mcservice-beans.jar"));
- }
-}
\ No newline at end of file
Copied: projects/jboss-osgi/trunk/bundle/blueprint/src/test/java/org/jboss/test/osgi/blueprint/mcservice/MicrocontainerServiceTestCase.java (from rev 87977, projects/jboss-osgi/trunk/bundle/blueprint/src/test/java/org/jboss/test/osgi/blueprint/mcservice/MCServiceTestCase.java)
===================================================================
--- projects/jboss-osgi/trunk/bundle/blueprint/src/test/java/org/jboss/test/osgi/blueprint/mcservice/MicrocontainerServiceTestCase.java (rev 0)
+++ projects/jboss-osgi/trunk/bundle/blueprint/src/test/java/org/jboss/test/osgi/blueprint/mcservice/MicrocontainerServiceTestCase.java 2009-04-29 06:17:08 UTC (rev 87981)
@@ -0,0 +1,75 @@
+/*
+ * 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.blueprint.mcservice;
+
+//$Id$
+
+import static org.jboss.osgi.microcontainer.MicrocontainerServiceMBean.MBEAN_MICROCONTAINER_SERVICE;
+import static org.jboss.osgi.microcontainer.MicrocontainerService.BEAN_SYSTEM_BUNDLE_CONTEXT;
+import static org.jboss.osgi.microcontainer.MicrocontainerService.BEAN_MBEAN_SERVER;
+import static org.jboss.osgi.microcontainer.MicrocontainerService.BEAN_KERNEL;
+
+import java.util.List;
+
+import org.jboss.osgi.microcontainer.MicrocontainerServiceMBean;
+import org.jboss.osgi.spi.framework.OSGiFramework;
+import org.jboss.osgi.spi.management.MBeanProxy;
+import org.jboss.test.osgi.blueprint.BlueprintTest;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
+
+/**
+ * A test that checks whether the MicrocontainerService can be accessed
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 12-Feb-2009
+ */
+public class MicrocontainerServiceTestCase extends BlueprintTest
+{
+ public void testServiceAccess() throws Exception
+ {
+ OSGiFramework framework = getBootstrapProvider().getFramework();
+ try
+ {
+ BundleContext sysContext = framework.getSystemBundleContext();
+
+ Bundle bundle = installBundle(sysContext, "mcservice-bundle.jar", true);
+ assertEquals("Test bundle ACTIVE", Bundle.ACTIVE, bundle.getState());
+
+ MicrocontainerServiceMBean mcService = MBeanProxy.get(MicrocontainerServiceMBean.class, MBEAN_MICROCONTAINER_SERVICE, getMBeanServer());
+ List<String> registeredBeans = mcService.getRegisteredBeans();
+ assertTrue("MicrocontainerService registered with MC", registeredBeans.contains(BEAN_SYSTEM_BUNDLE_CONTEXT));
+ assertTrue("MBeanServer registered with MC", registeredBeans.contains(BEAN_MBEAN_SERVER));
+ assertTrue("Kernel registered with MC", registeredBeans.contains(BEAN_KERNEL));
+ }
+ finally
+ {
+ framework.stop();
+ }
+ }
+
+ public void testBeansDeployment() throws Exception
+ {
+ //MicrocontainerServiceMBean mcService = MBeanProxy.get(MicrocontainerServiceMBean.class, MBEAN_MICROCONTAINER_SERVICE, getMBeanServer());
+ //mcService.deploy(getTestArchiveURL("mcservice-beans.jar"));
+ }
+}
\ No newline at end of file
Modified: projects/jboss-osgi/trunk/bundle/blueprint/src/test/resources/jboss-osgi-framework.properties
===================================================================
--- projects/jboss-osgi/trunk/bundle/blueprint/src/test/resources/jboss-osgi-framework.properties 2009-04-29 06:03:38 UTC (rev 87980)
+++ projects/jboss-osgi/trunk/bundle/blueprint/src/test/resources/jboss-osgi-framework.properties 2009-04-29 06:17:08 UTC (rev 87981)
@@ -11,15 +11,20 @@
# All props start with 'framework.prop'
framework.prop.org.osgi.framework.storage.clean=onFirstInit
framework.prop.org.osgi.framework.system.packages=\
+ javax.activation, \
javax.management, \
javax.naming, \
javax.naming.spi, \
- javax.xml.namespace, \
- javax.xml.parsers, \
- org.jboss.logging, \
- org.osgi.framework; version=1.4, \
- org.w3c.dom*, \
- org.xml.sax*
+ javax.net, \
+ javax.net.ssl, \
+ javax.xml.bind.annotation, \
+ javax.xml.bind.annotation.adapters, \
+ javax.xml.namespace, \
+ javax.xml.parsers, \
+ javax.xml.transform, \
+ javax.xml.transform.sax, \
+ org.jboss.logging, \
+ org.osgi.framework; version=1.4
# Bundles that need to be installed with the Framework automatically
framework.autoInstall=\
Modified: projects/jboss-osgi/trunk/bundle/microcontainer/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/bundle/microcontainer/pom.xml 2009-04-29 06:03:38 UTC (rev 87980)
+++ projects/jboss-osgi/trunk/bundle/microcontainer/pom.xml 2009-04-29 06:17:08 UTC (rev 87981)
@@ -99,30 +99,33 @@
org.osgi.service.log,
org.osgi.util.tracker,
- <!-- import -->
+ <!-- import -->
+ javassist*,
+ org.jboss.beans.*,
+ org.jboss.classadapter.spi,
+ org.jboss.config.*,
+ org.jboss.joinpoint.*,
+ org.jboss.logging,
org.jboss.osgi.common.log,
org.jboss.osgi.jmx,
+ org.jboss.reflect.*,
org.jboss.util.*,
org.jboss.xb.*,
<!-- optional -->
- org.apache.commons.httpclient;resolution=optional,
- org.apache.webdav.lib;resolution=optional,
<!-- exclude -->
- !com.sun.jdi*,
+ !org.apache.commons.httpclient,
+ !org.apache.webdav.lib,
!org.jboss.test.*
</Import-Package>
<Embed-Transitive>true</Embed-Transitive>
<Embed-Dependency>
- javassist;scope=test;inline=false,
jboss-dependency;inline=false,
- jboss-logging-spi;inline=false,
jboss-managed;inline=false,
jboss-metatype;inline=false,
jboss-mdr;inline=false,
jboss-kernel;inline=false,
- jboss-reflect;inline=false,
</Embed-Dependency>
</instructions>
</configuration>
17 years