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.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)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
16 years
JBoss-OSGI SVN: r97214 - projects/jboss-osgi/projects/bundles/husky/trunk/src/main/java/org/jboss/osgi/testing/internal.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-12-01 05:29:20 -0500 (Tue, 01 Dec 2009)
New Revision: 97214
Modified:
projects/jboss-osgi/projects/bundles/husky/trunk/src/main/java/org/jboss/osgi/testing/internal/RemoteBundle.java
Log:
Fix issue with remote access of already uninstalled bundle
Modified: projects/jboss-osgi/projects/bundles/husky/trunk/src/main/java/org/jboss/osgi/testing/internal/RemoteBundle.java
===================================================================
--- projects/jboss-osgi/projects/bundles/husky/trunk/src/main/java/org/jboss/osgi/testing/internal/RemoteBundle.java 2009-12-01 10:28:17 UTC (rev 97213)
+++ projects/jboss-osgi/projects/bundles/husky/trunk/src/main/java/org/jboss/osgi/testing/internal/RemoteBundle.java 2009-12-01 10:29:20 UTC (rev 97214)
@@ -49,6 +49,9 @@
private ManagedBundleMBean bundle;
private BundleInfo bundleInfo;
private String location;
+
+ private long bundleId;
+ private String symbolicName;
private Version version;
public RemoteBundle(OSGiRuntimeImpl runtime, ManagedBundleMBean bundle, BundleInfo bundleInfo)
@@ -63,8 +66,12 @@
super(runtime);
this.bundle = bundle;
+ // Initialize cached properties to avoid remote access
+ bundleId = bundle.getBundleId();
+ symbolicName = bundle.getSymbolicName();
+
String versionStr = getHeaders().get(Constants.BUNDLE_VERSION);
- this.version = Version.parseVersion(versionStr);
+ version = Version.parseVersion(versionStr);
}
@Override
@@ -76,13 +83,13 @@
@Override
public long getBundleId()
{
- return bundle.getBundleId();
+ return bundleId;
}
@Override
public String getSymbolicName()
{
- return bundle.getSymbolicName();
+ return symbolicName;
}
@Override
16 years
JBoss-OSGI SVN: r97213 - projects/jboss-osgi/projects/runtime/deployment/trunk/src/test/java/org/jboss/test/osgi/deployment/interceptor.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-12-01 05:28:17 -0500 (Tue, 01 Dec 2009)
New Revision: 97213
Modified:
projects/jboss-osgi/projects/runtime/deployment/trunk/src/test/java/org/jboss/test/osgi/deployment/interceptor/MockBundleContext.java
Log:
Fix annotation warnings
Modified: projects/jboss-osgi/projects/runtime/deployment/trunk/src/test/java/org/jboss/test/osgi/deployment/interceptor/MockBundleContext.java
===================================================================
--- projects/jboss-osgi/projects/runtime/deployment/trunk/src/test/java/org/jboss/test/osgi/deployment/interceptor/MockBundleContext.java 2009-12-01 10:26:54 UTC (rev 97212)
+++ projects/jboss-osgi/projects/runtime/deployment/trunk/src/test/java/org/jboss/test/osgi/deployment/interceptor/MockBundleContext.java 2009-12-01 10:28:17 UTC (rev 97213)
@@ -122,13 +122,13 @@
return null;
}
- @SuppressWarnings("unchecked")
+ @SuppressWarnings("rawtypes")
public ServiceRegistration registerService(String[] clazzes, Object service, Dictionary properties)
{
return null;
}
- @SuppressWarnings("unchecked")
+ @SuppressWarnings("rawtypes")
public ServiceRegistration registerService(String clazz, Object service, Dictionary properties)
{
return null;
16 years
JBoss-OSGI SVN: r97212 - projects/jboss-osgi/projects/runtime/deployment/trunk/src/main/java/org/jboss/osgi/deployment/deployer.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-12-01 05:26:54 -0500 (Tue, 01 Dec 2009)
New Revision: 97212
Added:
projects/jboss-osgi/projects/runtime/deployment/trunk/src/main/java/org/jboss/osgi/deployment/deployer/DeploymentFactory.java
Modified:
projects/jboss-osgi/projects/runtime/deployment/trunk/src/main/java/org/jboss/osgi/deployment/deployer/AbstractDeployerService.java
Log:
Add a DeploymentFactory
Modified: projects/jboss-osgi/projects/runtime/deployment/trunk/src/main/java/org/jboss/osgi/deployment/deployer/AbstractDeployerService.java
===================================================================
--- projects/jboss-osgi/projects/runtime/deployment/trunk/src/main/java/org/jboss/osgi/deployment/deployer/AbstractDeployerService.java 2009-12-01 10:25:24 UTC (rev 97211)
+++ projects/jboss-osgi/projects/runtime/deployment/trunk/src/main/java/org/jboss/osgi/deployment/deployer/AbstractDeployerService.java 2009-12-01 10:26:54 UTC (rev 97212)
@@ -25,7 +25,6 @@
import java.net.URL;
-import org.jboss.osgi.deployment.internal.DeploymentImpl;
import org.jboss.osgi.spi.util.BundleInfo;
import org.jboss.virtual.VirtualFile;
@@ -39,18 +38,16 @@
{
public Deployment createDeployment(URL url)
{
- BundleInfo info = BundleInfo.createBundleInfo(url);
- return new DeploymentImpl(info);
+ return DeploymentFactory.createDeployment(url);
}
public Deployment createDeployment(VirtualFile file)
{
- BundleInfo info = BundleInfo.createBundleInfo(file);
- return new DeploymentImpl(info);
+ return DeploymentFactory.createDeployment(file);
}
public Deployment createDeployment(BundleInfo info)
{
- return new DeploymentImpl(info);
+ return DeploymentFactory.createDeployment(info);
}
}
\ No newline at end of file
Added: projects/jboss-osgi/projects/runtime/deployment/trunk/src/main/java/org/jboss/osgi/deployment/deployer/DeploymentFactory.java
===================================================================
--- projects/jboss-osgi/projects/runtime/deployment/trunk/src/main/java/org/jboss/osgi/deployment/deployer/DeploymentFactory.java (rev 0)
+++ projects/jboss-osgi/projects/runtime/deployment/trunk/src/main/java/org/jboss/osgi/deployment/deployer/DeploymentFactory.java 2009-12-01 10:26:54 UTC (rev 97212)
@@ -0,0 +1,61 @@
+/*
+ * 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.deployer;
+
+//$Id$
+
+import java.net.URL;
+
+import org.jboss.osgi.deployment.internal.DeploymentImpl;
+import org.jboss.osgi.spi.util.BundleInfo;
+import org.jboss.virtual.VirtualFile;
+
+/**
+ * A deployment factory.
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 16-Oct-2009
+ */
+public class DeploymentFactory
+{
+ // Hide default ctor
+ private DeploymentFactory()
+ {
+ }
+
+ public static Deployment createDeployment(URL url)
+ {
+ BundleInfo info = BundleInfo.createBundleInfo(url);
+ return new DeploymentImpl(info);
+ }
+
+ public static Deployment createDeployment(VirtualFile file)
+ {
+ BundleInfo info = BundleInfo.createBundleInfo(file);
+ return new DeploymentImpl(info);
+ }
+
+ public static Deployment createDeployment(BundleInfo info)
+ {
+ return new DeploymentImpl(info);
+ }
+}
\ No newline at end of file
Property changes on: projects/jboss-osgi/projects/runtime/deployment/trunk/src/main/java/org/jboss/osgi/deployment/deployer/DeploymentFactory.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
16 years
JBoss-OSGI SVN: r97211 - projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/util.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-12-01 05:25:24 -0500 (Tue, 01 Dec 2009)
New Revision: 97211
Modified:
projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/util/BundleInfo.java
Log:
Fix manifest access for existing vfs file
Modified: projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/util/BundleInfo.java
===================================================================
--- projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/util/BundleInfo.java 2009-12-01 09:39:09 UTC (rev 97210)
+++ projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/util/BundleInfo.java 2009-12-01 10:25:24 UTC (rev 97211)
@@ -134,9 +134,8 @@
public VirtualFile getRoot()
{
if (rootFile == null)
- {
rootFile = toVirtualFile(rootURL);
- }
+
return rootFile;
}
@@ -170,7 +169,7 @@
{
try
{
- manifest = VFSUtils.getManifest(toVirtualFile(rootURL));
+ manifest = VFSUtils.getManifest(getRoot());
}
catch (Exception ex)
{
16 years
JBoss-OSGI SVN: r97210 - in projects/jboss-osgi: trunk and 1 other directory.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-12-01 04:39:09 -0500 (Tue, 01 Dec 2009)
New Revision: 97210
Modified:
projects/jboss-osgi/projects/bundles/jta/trunk/pom.xml
projects/jboss-osgi/trunk/pom.xml
Log:
Use JTA snapshot
Modified: projects/jboss-osgi/projects/bundles/jta/trunk/pom.xml
===================================================================
--- projects/jboss-osgi/projects/bundles/jta/trunk/pom.xml 2009-12-01 09:25:09 UTC (rev 97209)
+++ projects/jboss-osgi/projects/bundles/jta/trunk/pom.xml 2009-12-01 09:39:09 UTC (rev 97210)
@@ -21,7 +21,7 @@
<artifactId>jboss-osgi-jta</artifactId>
<packaging>bundle</packaging>
- <version>1.0.1-SNAPSHOT</version>
+ <version>1.0.0-SNAPSHOT</version>
<!-- Parent -->
<parent>
@@ -41,7 +41,7 @@
<properties>
<version.jboss.jta.api>1.0.1.GA</version.jboss.jta.api>
<version.jboss.jbossts>4.6.1.GA</version.jboss.jbossts>
- <version.jboss.osgi.spi>1.0.3</version.jboss.osgi.spi>
+ <version.jboss.osgi.spi>1.0.3-SNAPSHOT</version.jboss.osgi.spi>
<version.osgi>4.2.0</version.osgi>
</properties>
Modified: projects/jboss-osgi/trunk/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/pom.xml 2009-12-01 09:25:09 UTC (rev 97209)
+++ projects/jboss-osgi/trunk/pom.xml 2009-12-01 09:39:09 UTC (rev 97210)
@@ -60,7 +60,7 @@
<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.jndi>1.0.2-SNAPSHOT</version.jboss.osgi.jndi>
- <version.jboss.osgi.jta>1.0.0</version.jboss.osgi.jta>
+ <version.jboss.osgi.jta>1.0.0-SNAPSHOT</version.jboss.osgi.jta>
<version.jboss.osgi.microcontainer>2.0.9-SNAPSHOT</version.jboss.osgi.microcontainer>
<version.jboss.osgi.reflect>2.0.2-SNAPSHOT</version.jboss.osgi.reflect>
<version.jboss.osgi.runtime.deployers>1.0.3-SNAPSHOT</version.jboss.osgi.runtime.deployers>
16 years
JBoss-OSGI SVN: r97209 - projects/jboss-osgi/trunk.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-12-01 04:25:09 -0500 (Tue, 01 Dec 2009)
New Revision: 97209
Modified:
projects/jboss-osgi/trunk/pom.xml
Log:
Update to pax-web-0.7.2
Modified: projects/jboss-osgi/trunk/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/pom.xml 2009-12-01 09:24:05 UTC (rev 97208)
+++ projects/jboss-osgi/trunk/pom.xml 2009-12-01 09:25:09 UTC (rev 97209)
@@ -71,7 +71,7 @@
<version.jboss.osgi.webapp>0.7.2-SNAPSHOT</version.jboss.osgi.webapp>
<version.jboss.osgi.webconsole>1.0.2</version.jboss.osgi.webconsole>
<version.jboss.osgi.xml.binding>2.0.2-SNAPSHOT</version.jboss.osgi.xml.binding>
- <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>
<surefire.memory.args>-Xmx512m</surefire.memory.args>
16 years
JBoss-OSGI SVN: r97208 - projects/jboss-osgi/projects/bundles/webapp/trunk.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-12-01 04:24:05 -0500 (Tue, 01 Dec 2009)
New Revision: 97208
Modified:
projects/jboss-osgi/projects/bundles/webapp/trunk/pom.xml
Log:
Update to 0.7.2
Modified: projects/jboss-osgi/projects/bundles/webapp/trunk/pom.xml
===================================================================
--- projects/jboss-osgi/projects/bundles/webapp/trunk/pom.xml 2009-12-01 08:46:33 UTC (rev 97207)
+++ projects/jboss-osgi/projects/bundles/webapp/trunk/pom.xml 2009-12-01 09:24:05 UTC (rev 97208)
@@ -27,7 +27,7 @@
<parent>
<groupId>org.jboss.osgi</groupId>
<artifactId>jboss-osgi-parent</artifactId>
- <version>1.0.4-SNAPSHOT</version>
+ <version>1.0.4</version>
</parent>
<!-- Subversion -->
@@ -40,7 +40,7 @@
<!-- Properties -->
<properties>
<version.jboss.osgi.deployment>1.0.0-SNAPSHOT</version.jboss.osgi.deployment>
- <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>
16 years
JBoss-OSGI SVN: r97207 - in projects/jboss-osgi: projects/bundles/husky/trunk/src/main/java/org/jboss/osgi/testing/internal and 5 other directories.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-12-01 03:46:33 -0500 (Tue, 01 Dec 2009)
New Revision: 97207
Modified:
projects/jboss-osgi/projects/bundles/husky/trunk/pom.xml
projects/jboss-osgi/projects/bundles/husky/trunk/src/main/java/org/jboss/osgi/testing/internal/EmbeddedRuntime.java
projects/jboss-osgi/projects/bundles/husky/trunk/src/main/java/org/jboss/osgi/testing/internal/OSGiRuntimeImpl.java
projects/jboss-osgi/projects/bundles/husky/trunk/src/main/java/org/jboss/osgi/testing/internal/RemoteBundle.java
projects/jboss-osgi/projects/bundles/husky/trunk/src/main/java/org/jboss/osgi/testing/internal/RemoteRuntime.java
projects/jboss-osgi/projects/runtime/deployment/trunk/pom.xml
projects/jboss-osgi/projects/runtime/deployment/trunk/src/main/java/org/jboss/osgi/deployment/internal/DeploymentImpl.java
projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/capability/Capability.java
projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/util/BundleInfo.java
projects/jboss-osgi/trunk/pom.xml
Log:
Husky remote undeployment issue - WIP
Modified: projects/jboss-osgi/projects/bundles/husky/trunk/pom.xml
===================================================================
--- projects/jboss-osgi/projects/bundles/husky/trunk/pom.xml 2009-12-01 08:33:50 UTC (rev 97206)
+++ projects/jboss-osgi/projects/bundles/husky/trunk/pom.xml 2009-12-01 08:46:33 UTC (rev 97207)
@@ -42,7 +42,7 @@
<properties>
<version.jboss.osgi.runtime.felix>2.0.0</version.jboss.osgi.runtime.felix>
<version.jboss.osgi.spi>1.0.3-SNAPSHOT</version.jboss.osgi.spi>
- <version.jboss.osgi.deployment>1.0.0</version.jboss.osgi.deployment>
+ <version.jboss.osgi.deployment>1.0.0-SNAPSHOT</version.jboss.osgi.deployment>
<version.osgi>4.2.0</version.osgi>
</properties>
Modified: projects/jboss-osgi/projects/bundles/husky/trunk/src/main/java/org/jboss/osgi/testing/internal/EmbeddedRuntime.java
===================================================================
--- projects/jboss-osgi/projects/bundles/husky/trunk/src/main/java/org/jboss/osgi/testing/internal/EmbeddedRuntime.java 2009-12-01 08:33:50 UTC (rev 97206)
+++ projects/jboss-osgi/projects/bundles/husky/trunk/src/main/java/org/jboss/osgi/testing/internal/EmbeddedRuntime.java 2009-12-01 08:46:33 UTC (rev 97207)
@@ -66,10 +66,10 @@
public OSGiBundle installBundle(String location) throws BundleException
{
- URL url = getTestHelper().getTestArchiveURL(location);
- BundleInfo info = BundleInfo.createBundleInfo(url);
+ BundleInfo info = BundleInfo.createBundleInfo(location);
String symbolicName = info.getSymbolicName();
Version version = info.getVersion();
+ URL rootURL = info.getRootURL();
OSGiBundle bundle;
@@ -78,15 +78,15 @@
if (sref != null)
{
DeployerService service = (DeployerService)context.getService(sref);
- service.deploy(url);
+ service.deploy(rootURL);
bundle = getBundle(symbolicName, version, true);
}
else
{
- Bundle auxBundle = context.installBundle(url.toExternalForm());
+ Bundle auxBundle = context.installBundle(rootURL.toExternalForm());
bundle = new EmbeddedBundle(this, auxBundle);
}
- return registerBundle(location, bundle);
+ return registerBundle(bundle.getLocation(), bundle);
}
public OSGiBundle[] getBundles()
Modified: projects/jboss-osgi/projects/bundles/husky/trunk/src/main/java/org/jboss/osgi/testing/internal/OSGiRuntimeImpl.java
===================================================================
--- projects/jboss-osgi/projects/bundles/husky/trunk/src/main/java/org/jboss/osgi/testing/internal/OSGiRuntimeImpl.java 2009-12-01 08:33:50 UTC (rev 97206)
+++ projects/jboss-osgi/projects/bundles/husky/trunk/src/main/java/org/jboss/osgi/testing/internal/OSGiRuntimeImpl.java 2009-12-01 08:46:33 UTC (rev 97207)
@@ -45,13 +45,13 @@
import org.jboss.osgi.deployment.deployer.DeployerService;
import org.jboss.osgi.deployment.deployer.Deployment;
import org.jboss.osgi.spi.capability.Capability;
+import org.jboss.osgi.spi.util.BundleInfo;
import org.jboss.osgi.testing.OSGiBundle;
import org.jboss.osgi.testing.OSGiRuntime;
import org.jboss.osgi.testing.OSGiServiceReference;
import org.jboss.osgi.testing.OSGiTestHelper;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleException;
-import org.osgi.framework.Constants;
import org.osgi.framework.Version;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -98,9 +98,10 @@
{
log.debug("Add capability: " + capability);
- for (String location : capability.getBundles())
+ for (BundleInfo info : capability.getBundles())
{
- String symName = getManifestEntry(location, Constants.BUNDLE_SYMBOLICNAME);
+ String location = info.getLocation();
+ String symName = info.getSymbolicName();
if (bundles.get(location) == null && getBundle(symName, null) == null)
{
OSGiBundle bundle = installBundle(location);
@@ -125,11 +126,11 @@
{
log.debug("Remove capability : " + capability);
- List<String> bundleLocations = new ArrayList<String>(capability.getBundles());
- Collections.reverse(bundleLocations);
+ List<BundleInfo> bundleInfos = new ArrayList<BundleInfo>(capability.getBundles());
+ Collections.reverse(bundleInfos);
- for (String location : bundleLocations)
- failsafeUninstall(bundles.remove(location));
+ for (BundleInfo info : bundleInfos)
+ failsafeUninstall(bundles.remove(info.getLocation()));
}
List<Capability> dependencies = new ArrayList<Capability>(capability.getDependencies());
Modified: projects/jboss-osgi/projects/bundles/husky/trunk/src/main/java/org/jboss/osgi/testing/internal/RemoteBundle.java
===================================================================
--- projects/jboss-osgi/projects/bundles/husky/trunk/src/main/java/org/jboss/osgi/testing/internal/RemoteBundle.java 2009-12-01 08:33:50 UTC (rev 97206)
+++ projects/jboss-osgi/projects/bundles/husky/trunk/src/main/java/org/jboss/osgi/testing/internal/RemoteBundle.java 2009-12-01 08:46:33 UTC (rev 97207)
@@ -23,10 +23,10 @@
// $Id$
-import java.net.URL;
import java.util.Dictionary;
import org.jboss.osgi.spi.management.ManagedBundleMBean;
+import org.jboss.osgi.spi.util.BundleInfo;
import org.jboss.osgi.testing.OSGiBundle;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleException;
@@ -47,21 +47,22 @@
private final Logger log = LoggerFactory.getLogger(RemoteBundle.class);
private ManagedBundleMBean bundle;
+ private BundleInfo bundleInfo;
private String location;
-
- private long bundleId;
- private String symbolicName;
private Version version;
- public RemoteBundle(OSGiRuntimeImpl runtime, ManagedBundleMBean bundle, String location)
+ public RemoteBundle(OSGiRuntimeImpl runtime, ManagedBundleMBean bundle, BundleInfo bundleInfo)
{
+ this(runtime, bundle);
+ this.bundleInfo = bundleInfo;
+ this.location = bundleInfo.getLocation();
+ }
+
+ public RemoteBundle(OSGiRuntimeImpl runtime, ManagedBundleMBean bundle)
+ {
super(runtime);
this.bundle = bundle;
- this.location = location;
- this.bundleId = bundle.getBundleId();
- this.symbolicName = bundle.getSymbolicName();
-
String versionStr = getHeaders().get(Constants.BUNDLE_VERSION);
this.version = Version.parseVersion(versionStr);
}
@@ -75,13 +76,13 @@
@Override
public long getBundleId()
{
- return bundleId;
+ return bundle.getBundleId();
}
@Override
public String getSymbolicName()
{
- return symbolicName;
+ return bundle.getSymbolicName();
}
@Override
@@ -130,7 +131,7 @@
assertNotUninstalled();
try
{
- getRuntime().undeploy(new URL(getLocation()));
+ getRuntime().undeploy(bundleInfo.getRootURL());
getRuntime().unregisterBundle(this);
setUninstalled(true);
}
Modified: projects/jboss-osgi/projects/bundles/husky/trunk/src/main/java/org/jboss/osgi/testing/internal/RemoteRuntime.java
===================================================================
--- projects/jboss-osgi/projects/bundles/husky/trunk/src/main/java/org/jboss/osgi/testing/internal/RemoteRuntime.java 2009-12-01 08:33:50 UTC (rev 97206)
+++ projects/jboss-osgi/projects/bundles/husky/trunk/src/main/java/org/jboss/osgi/testing/internal/RemoteRuntime.java 2009-12-01 08:46:33 UTC (rev 97207)
@@ -69,8 +69,7 @@
try
{
// Get the bundle info from the location
- URL bundleURL = getTestHelper().getTestArchiveURL(location);
- BundleInfo info = BundleInfo.createBundleInfo(bundleURL);
+ BundleInfo info = BundleInfo.createBundleInfo(location);
// Create the deployment from the info
DeployerServiceClient deployer = new DeployerServiceClient(DeployerService.MBEAN_DEPLOYER_SERVICE);
@@ -95,8 +94,8 @@
if (bundleMBean == null)
throw new IllegalStateException("Cannot find installed bundle: " + symbolicName + "-" + version);
- RemoteBundle bundle = new RemoteBundle(this, bundleMBean, location);
- return registerBundle(location, bundle);
+ RemoteBundle bundle = new RemoteBundle(this, bundleMBean, info);
+ return registerBundle(bundle.getLocation(), bundle);
}
catch (RuntimeException rte)
{
@@ -135,7 +134,7 @@
Set<ManagedBundleMBean> remoteBundles = getRemoteFramework().getBundles();
Set<OSGiBundle> bundles = new HashSet<OSGiBundle>();
for (ManagedBundleMBean remoteBundle : remoteBundles)
- bundles.add(new RemoteBundle(this, remoteBundle, null));
+ bundles.add(new RemoteBundle(this, remoteBundle));
OSGiBundle[] bundleArr = new OSGiBundle[bundles.size()];
bundles.toArray(bundleArr);
@@ -150,7 +149,7 @@
public OSGiBundle getBundle(long bundleId)
{
ManagedBundleMBean bundle = getRemoteFramework().getBundle(bundleId);
- return bundle != null ? new RemoteBundle(this, bundle, null) : null;
+ return bundle != null ? new RemoteBundle(this, bundle) : null;
}
public OSGiServiceReference getServiceReference(String clazz)
Modified: projects/jboss-osgi/projects/runtime/deployment/trunk/pom.xml
===================================================================
--- projects/jboss-osgi/projects/runtime/deployment/trunk/pom.xml 2009-12-01 08:33:50 UTC (rev 97206)
+++ projects/jboss-osgi/projects/runtime/deployment/trunk/pom.xml 2009-12-01 08:46:33 UTC (rev 97207)
@@ -20,7 +20,7 @@
<artifactId>jboss-osgi-deployment</artifactId>
<packaging>jar</packaging>
- <version>1.0.1-SNAPSHOT</version>
+ <version>1.0.0-SNAPSHOT</version>
<!-- Parent -->
<parent>
@@ -38,8 +38,8 @@
<!-- Properties -->
<properties>
- <version.jboss.deployers>2.0.8.GA</version.jboss.deployers>
- <version.jboss.osgi.spi>1.0.3</version.jboss.osgi.spi>
+ <version.jboss.deployers>2.0.9.GA</version.jboss.deployers>
+ <version.jboss.osgi.spi>1.0.3-SNAPSHOT</version.jboss.osgi.spi>
<version.osgi>4.2.0</version.osgi>
</properties>
Modified: projects/jboss-osgi/projects/runtime/deployment/trunk/src/main/java/org/jboss/osgi/deployment/internal/DeploymentImpl.java
===================================================================
--- projects/jboss-osgi/projects/runtime/deployment/trunk/src/main/java/org/jboss/osgi/deployment/internal/DeploymentImpl.java 2009-12-01 08:33:50 UTC (rev 97206)
+++ projects/jboss-osgi/projects/runtime/deployment/trunk/src/main/java/org/jboss/osgi/deployment/internal/DeploymentImpl.java 2009-12-01 08:46:33 UTC (rev 97207)
@@ -22,7 +22,6 @@
package org.jboss.osgi.deployment.internal;
import java.io.Serializable;
-import java.net.MalformedURLException;
import java.net.URL;
import org.jboss.osgi.deployment.deployer.Deployment;
@@ -43,7 +42,6 @@
private static final long serialVersionUID = 6216977125749367927L;
private BundleInfo info;
- private URL location;
private int startLevel;
private boolean autoStart;
@@ -53,15 +51,6 @@
throw new IllegalArgumentException("Bundle info cannot be null");
this.info = info;
-
- try
- {
- this.location = new URL(info.getLocation());
- }
- catch (MalformedURLException e)
- {
- throw new IllegalArgumentException("Malformed URL location: " + info.getLocation());
- }
}
/**
@@ -77,7 +66,7 @@
*/
public URL getLocation()
{
- return location;
+ return info.getRootURL();
}
/**
@@ -157,6 +146,7 @@
{
String symbolicName = getSymbolicName();
String version = getVersion();
- return "[" + symbolicName + "-" + version + ",url=" + location + "]";
+ URL url = getLocation();
+ return "[" + symbolicName + "-" + version + ",url=" + url + "]";
}
}
\ No newline at end of file
Modified: projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/capability/Capability.java
===================================================================
--- projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/capability/Capability.java 2009-12-01 08:33:50 UTC (rev 97206)
+++ projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/capability/Capability.java 2009-12-01 08:46:33 UTC (rev 97207)
@@ -29,6 +29,8 @@
import java.util.List;
import java.util.Map;
+import org.jboss.osgi.spi.util.BundleInfo;
+
/**
* An abstract OSGi capability that can be installed in an {@link OSGiRuntime}.
*
@@ -46,7 +48,7 @@
private Map<String, String> systemProperties;
private List<Capability> dependencies;
- private List<String> bundles;
+ private List<BundleInfo> bundles;
/**
* Construct a capability that is identified by the given service name.
@@ -128,21 +130,22 @@
getDependenciesInternal().add(dependency);
}
- public List<String> getBundles()
+ public List<BundleInfo> getBundles()
{
return Collections.unmodifiableList(getBundlesInternal());
}
- protected void addBundle(String bundle)
+ protected void addBundle(String location)
{
- getBundlesInternal().add(bundle);
+ BundleInfo info = BundleInfo.createBundleInfo(location);
+ getBundlesInternal().add(info);
}
private Map<String, String> getPropertiesInternal()
{
if (systemProperties == null)
systemProperties = new HashMap<String, String>();
-
+
return systemProperties;
}
@@ -154,10 +157,10 @@
return dependencies;
}
- private List<String> getBundlesInternal()
+ private List<BundleInfo> getBundlesInternal()
{
if (bundles == null)
- bundles = new ArrayList<String>();
+ bundles = new ArrayList<BundleInfo>();
return bundles;
}
Modified: projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/util/BundleInfo.java
===================================================================
--- projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/util/BundleInfo.java 2009-12-01 08:33:50 UTC (rev 97206)
+++ projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/util/BundleInfo.java 2009-12-01 08:46:33 UTC (rev 97207)
@@ -63,33 +63,8 @@
if (location == null)
throw new IllegalArgumentException("Location cannot be null");
- // Try location as URL
- URL url = null;
- try
- {
- url = new URL(location);
- }
- catch (MalformedURLException ex)
- {
- // ignore
- }
-
- // Try location as File
+ URL url = getRealLocation(location);
if (url == null)
- {
- try
- {
- File file = new File(location);
- if (file.exists())
- url = file.toURI().toURL();
- }
- catch (MalformedURLException e)
- {
- // ignore
- }
- }
-
- if (url == null)
throw new IllegalArgumentException("Cannot obtain root url from: " + location);
return new BundleInfo(toVirtualFile(url), location);
@@ -166,6 +141,14 @@
}
/**
+ * Get the bundle root url
+ */
+ public URL getRootURL()
+ {
+ return toURL(getRoot());
+ }
+
+ /**
* Get the bundle symbolic name
*/
public String getSymbolicName()
@@ -197,6 +180,45 @@
return manifest;
}
+ private static URL getRealLocation(String location)
+ {
+ // Try location as URL
+ URL url = null;
+ try
+ {
+ url = new URL(location);
+ }
+ catch (MalformedURLException ex)
+ {
+ // ignore
+ }
+
+ // Try location as File
+ if (url == null)
+ {
+ try
+ {
+ File file = new File(location);
+ if (file.exists())
+ url = file.toURI().toURL();
+ }
+ catch (MalformedURLException e)
+ {
+ // ignore
+ }
+ }
+
+ // Try to prefix the location with the test archive directory
+ if (url == null)
+ {
+ String prefix = System.getProperty("test.archive.directory", "target/test-libs");
+ if (new File(prefix).exists())
+ return getRealLocation(prefix + File.separator + location);
+ }
+
+ return url;
+ }
+
private static VirtualFile toVirtualFile(URL url)
{
try
Modified: projects/jboss-osgi/trunk/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/pom.xml 2009-12-01 08:33:50 UTC (rev 97206)
+++ projects/jboss-osgi/trunk/pom.xml 2009-12-01 08:46:33 UTC (rev 97207)
@@ -53,7 +53,7 @@
<version.jboss.osgi.blueprint>1.0.0.Alpha3</version.jboss.osgi.blueprint>
<version.jboss.osgi.common>1.0.4-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.deployment>1.0.0-SNAPSHOT</version.jboss.osgi.deployment>
<version.jboss.osgi.framework>1.0.0.Alpha2-SNAPSHOT</version.jboss.osgi.framework>
<version.jboss.osgi.hotdeploy>1.0.3</version.jboss.osgi.hotdeploy>
<version.jboss.osgi.husky>1.0.2-SNAPSHOT</version.jboss.osgi.husky>
16 years