[jboss-osgi-commits] JBoss-OSGI SVN: r97215 - in projects/jboss-osgi/projects/runtime/framework/branches/1.0.0.Alpha2: src/main/java/org/jboss/osgi/framework/bundle and 2 other directories.
jboss-osgi-commits at lists.jboss.org
jboss-osgi-commits at lists.jboss.org
Tue Dec 1 05:36:11 EST 2009
Author: thomas.diesler at jboss.com
Date: 2009-12-01 05:36:10 -0500 (Tue, 01 Dec 2009)
New Revision: 97215
Modified:
projects/jboss-osgi/projects/runtime/framework/branches/1.0.0.Alpha2/pom.xml
projects/jboss-osgi/projects/runtime/framework/branches/1.0.0.Alpha2/src/main/java/org/jboss/osgi/framework/bundle/OSGiBundleManager.java
projects/jboss-osgi/projects/runtime/framework/branches/1.0.0.Alpha2/src/main/java/org/jboss/osgi/framework/deployers/OSGiDeployersWrapper.java
projects/jboss-osgi/projects/runtime/framework/branches/1.0.0.Alpha2/src/main/java/org/jboss/osgi/framework/service/internal/MicrocontainerServiceImpl.java
Log:
Update dependencies. Use attached Deployment instead of individual properties.
Modified: projects/jboss-osgi/projects/runtime/framework/branches/1.0.0.Alpha2/pom.xml
===================================================================
--- projects/jboss-osgi/projects/runtime/framework/branches/1.0.0.Alpha2/pom.xml 2009-12-01 10:29:20 UTC (rev 97214)
+++ projects/jboss-osgi/projects/runtime/framework/branches/1.0.0.Alpha2/pom.xml 2009-12-01 10:36:10 UTC (rev 97215)
@@ -44,18 +44,18 @@
<version.jboss.classloading>2.0.8.GA</version.jboss.classloading>
<version.jboss.deployers>2.0.9.GA</version.jboss.deployers>
<version.jboss.kernel>2.0.9.GA</version.jboss.kernel>
- <version.jboss.osgi.apache.xerces>2.9.1.SP2</version.jboss.osgi.apache.xerces>
- <version.jboss.osgi.common>1.0.3</version.jboss.osgi.common>
+ <version.jboss.osgi.apache.xerces>2.9.1-SNAPSHOT</version.jboss.osgi.apache.xerces>
+ <version.jboss.osgi.common>1.0.3-SNAPSHOT</version.jboss.osgi.common>
<version.jboss.osgi.common.core>2.2.13.GA</version.jboss.osgi.common.core>
- <version.jboss.osgi.deployment>1.0.0</version.jboss.osgi.deployment>
- <version.jboss.osgi.husky>1.0.2</version.jboss.osgi.husky>
- <version.jboss.osgi.jaxb>2.1.10.SP2</version.jboss.osgi.jaxb>
- <version.jboss.osgi.jmx>1.0.2</version.jboss.osgi.jmx>
- <version.jboss.osgi.runtime.deployers>1.0.3</version.jboss.osgi.runtime.deployers>
- <version.jboss.osgi.spi>1.0.3</version.jboss.osgi.spi>
- <version.jboss.osgi.xml.binding>2.0.1.SP1</version.jboss.osgi.xml.binding>
+ <version.jboss.osgi.deployment>1.0.0-SNAPSHOT</version.jboss.osgi.deployment>
+ <version.jboss.osgi.husky>1.0.2-SNAPSHOT</version.jboss.osgi.husky>
+ <version.jboss.osgi.jaxb>2.1.10-SNAPSHOT</version.jboss.osgi.jaxb>
+ <version.jboss.osgi.jmx>1.0.2-SNAPSHOT</version.jboss.osgi.jmx>
+ <version.jboss.osgi.runtime.deployers>1.0.3-SNAPSHOT</version.jboss.osgi.runtime.deployers>
+ <version.jboss.osgi.spi>1.0.3-SNAPSHOT</version.jboss.osgi.spi>
+ <version.jboss.osgi.xml.binding>2.0.2-SNAPSHOT</version.jboss.osgi.xml.binding>
<version.jboss.test>1.1.4.GA</version.jboss.test>
- <version.ops4j.pax.web>0.7.2-SNAPSHOT</version.ops4j.pax.web>
+ <version.ops4j.pax.web>0.7.2</version.ops4j.pax.web>
<version.osgi>4.2.0</version.osgi>
</properties>
Modified: projects/jboss-osgi/projects/runtime/framework/branches/1.0.0.Alpha2/src/main/java/org/jboss/osgi/framework/bundle/OSGiBundleManager.java
===================================================================
--- projects/jboss-osgi/projects/runtime/framework/branches/1.0.0.Alpha2/src/main/java/org/jboss/osgi/framework/bundle/OSGiBundleManager.java 2009-12-01 10:29:20 UTC (rev 97214)
+++ projects/jboss-osgi/projects/runtime/framework/branches/1.0.0.Alpha2/src/main/java/org/jboss/osgi/framework/bundle/OSGiBundleManager.java 2009-12-01 10:36:10 UTC (rev 97215)
@@ -21,8 +21,6 @@
*/
package org.jboss.osgi.framework.bundle;
-import static org.jboss.osgi.spi.OSGiConstants.PROPERTY_AUTO_START;
-
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
@@ -66,6 +64,7 @@
import org.jboss.kernel.Kernel;
import org.jboss.logging.Logger;
import org.jboss.osgi.deployment.deployer.Deployment;
+import org.jboss.osgi.deployment.deployer.DeploymentFactory;
import org.jboss.osgi.framework.metadata.OSGiMetaData;
import org.jboss.osgi.framework.metadata.PackageAttribute;
import org.jboss.osgi.framework.metadata.internal.AbstractOSGiMetaData;
@@ -77,6 +76,7 @@
import org.jboss.osgi.framework.plugins.ResolverPlugin;
import org.jboss.osgi.framework.plugins.ServicePlugin;
import org.jboss.osgi.framework.util.NoFilter;
+import org.jboss.osgi.spi.util.BundleInfo;
import org.jboss.util.collection.ConcurrentSet;
import org.jboss.virtual.VFS;
import org.jboss.virtual.VFSUtils;
@@ -493,6 +493,21 @@
return install(root, root.toString(), false);
}
+ /*
+ * Installs a bundle from the given virtual file.
+ */
+ private AbstractBundleState install(VirtualFile root, String location, boolean autoStart) throws BundleException
+ {
+ if (location == null)
+ throw new IllegalArgumentException("Null location");
+
+ BundleInfo info = BundleInfo.createBundleInfo(root, location);
+ Deployment dep = DeploymentFactory.createDeployment(info);
+ dep.setAutoStart(autoStart);
+
+ return installBundle(dep);
+ }
+
/**
* Install a bundle from a deployment.
*
@@ -503,25 +518,12 @@
*/
public AbstractBundleState installBundle(Deployment dep) throws BundleException
{
- String location = dep.getLocation().toExternalForm();
- return install(dep.getRoot(), location, dep.isAutoStart());
- }
-
- /*
- * Installs a bundle from the given virtual file.
- */
- private AbstractBundleState install(VirtualFile root, String location, boolean autoStart) throws BundleException
- {
- if (location == null)
- throw new IllegalArgumentException("Null location");
-
// Create the deployment and deploy it
try
{
- VFSDeployment deployment = VFSDeploymentFactory.getInstance().createVFSDeployment(root);
+ VFSDeployment deployment = VFSDeploymentFactory.getInstance().createVFSDeployment(dep.getRoot());
MutableAttachments att = (MutableAttachments)deployment.getPredeterminedManagedObjects();
- att.addAttachment(PROPERTY_BUNDLE_LOCATION, location);
- att.addAttachment(PROPERTY_AUTO_START, autoStart);
+ att.addAttachment(Deployment.class, dep);
deployerClient.deploy(deployment);
try
@@ -548,7 +550,7 @@
if (cause instanceof BundleException)
throw (BundleException)cause;
}
- throw new BundleException("Error installing bundle from location=" + root, (cause != null ? cause : ex));
+ throw new BundleException("Error installing bundle from: " + dep, (cause != null ? cause : ex));
}
}
Modified: projects/jboss-osgi/projects/runtime/framework/branches/1.0.0.Alpha2/src/main/java/org/jboss/osgi/framework/deployers/OSGiDeployersWrapper.java
===================================================================
--- projects/jboss-osgi/projects/runtime/framework/branches/1.0.0.Alpha2/src/main/java/org/jboss/osgi/framework/deployers/OSGiDeployersWrapper.java 2009-12-01 10:29:20 UTC (rev 97214)
+++ projects/jboss-osgi/projects/runtime/framework/branches/1.0.0.Alpha2/src/main/java/org/jboss/osgi/framework/deployers/OSGiDeployersWrapper.java 2009-12-01 10:36:10 UTC (rev 97215)
@@ -21,14 +21,11 @@
*/
package org.jboss.osgi.framework.deployers;
-import static org.jboss.osgi.spi.OSGiConstants.PROPERTY_AUTO_START;
-
import java.util.Collection;
import java.util.List;
import java.util.Map;
import java.util.concurrent.CopyOnWriteArrayList;
-import org.jboss.deployers.client.spi.Deployment;
import org.jboss.deployers.client.spi.main.MainDeployer;
import org.jboss.deployers.plugins.main.MainDeployerImpl;
import org.jboss.deployers.spi.DeploymentException;
@@ -39,6 +36,7 @@
import org.jboss.deployers.structure.spi.DeploymentUnit;
import org.jboss.logging.Logger;
import org.jboss.managed.api.ManagedObject;
+import org.jboss.osgi.deployment.deployer.Deployment;
import org.jboss.osgi.framework.bundle.OSGiBundleManager;
import org.jboss.osgi.framework.bundle.OSGiBundleState;
import org.osgi.framework.Bundle;
@@ -131,11 +129,8 @@
if (bundle == null)
continue;
- Boolean autoStart = (Boolean)unit.getAttachment(PROPERTY_AUTO_START);
- if (autoStart == null)
- autoStart = Boolean.TRUE;
-
- if (autoStart == true && bundle.getState() == Bundle.INSTALLED)
+ Deployment dep = unit.getAttachment(Deployment.class);
+ if (dep.isAutoStart() == true && bundle.getState() == Bundle.INSTALLED)
{
unresolvedBundles.add(0, bundle);
}
@@ -185,7 +180,7 @@
deployers.checkComplete(contexts);
}
- public void checkComplete(Collection<DeploymentContext> errors, Collection<Deployment> missingDeployer) throws DeploymentException
+ public void checkComplete(Collection<DeploymentContext> errors, Collection<org.jboss.deployers.client.spi.Deployment> missingDeployer) throws DeploymentException
{
deployers.checkComplete(errors, missingDeployer);
}
Modified: projects/jboss-osgi/projects/runtime/framework/branches/1.0.0.Alpha2/src/main/java/org/jboss/osgi/framework/service/internal/MicrocontainerServiceImpl.java
===================================================================
--- projects/jboss-osgi/projects/runtime/framework/branches/1.0.0.Alpha2/src/main/java/org/jboss/osgi/framework/service/internal/MicrocontainerServiceImpl.java 2009-12-01 10:29:20 UTC (rev 97214)
+++ projects/jboss-osgi/projects/runtime/framework/branches/1.0.0.Alpha2/src/main/java/org/jboss/osgi/framework/service/internal/MicrocontainerServiceImpl.java 2009-12-01 10:36:10 UTC (rev 97215)
@@ -76,7 +76,7 @@
public void startService()
{
- installKernelBean(BEAN_SYSTEM_BUNDLE_CONTEXT, getSystemContext());
+ installKernelBean(BEAN_BUNDLE_CONTEXT, getSystemContext());
registration = getSystemContext().registerService(MicrocontainerService.class.getName(), this, null);
// Track the MBeanServer and register this service as an MBean
More information about the jboss-osgi-commits
mailing list