JBoss-OSGI SVN: r90879 - in projects/jboss-osgi/trunk/blueprint/impl: src/main/java/org/jboss/osgi/blueprint/container and 1 other directory.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-07-07 03:16:23 -0400 (Tue, 07 Jul 2009)
New Revision: 90879
Modified:
projects/jboss-osgi/trunk/blueprint/impl/pom.xml
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/container/BlueprintContainerImpl.java
Log:
Use BundleClassloader from util
Modified: projects/jboss-osgi/trunk/blueprint/impl/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/pom.xml 2009-07-07 07:14:08 UTC (rev 90878)
+++ projects/jboss-osgi/trunk/blueprint/impl/pom.xml 2009-07-07 07:16:23 UTC (rev 90879)
@@ -72,6 +72,7 @@
org.jboss.osgi.common.log;version=1.0,
org.jboss.osgi.spi;version=1.0,
org.jboss.osgi.spi.service;version=1.0,
+ org.jboss.osgi.spi.util;version=1.0,
org.jboss.reflect.spi,
org.jboss.util.xml,
org.jboss.xb.*,
Modified: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/container/BlueprintContainerImpl.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/container/BlueprintContainerImpl.java 2009-07-07 07:14:08 UTC (rev 90878)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/container/BlueprintContainerImpl.java 2009-07-07 07:16:23 UTC (rev 90879)
@@ -37,7 +37,7 @@
import org.jboss.osgi.blueprint.BlueprintContext;
import org.jboss.osgi.blueprint.parser.BlueprintParser;
import org.jboss.osgi.blueprint.reflect.BlueprintMetadata;
-import org.jboss.osgi.spi.BundleClassLoader;
+import org.jboss.osgi.spi.util.BundleClassLoader;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
import org.osgi.framework.Constants;
16 years, 11 months
JBoss-OSGI SVN: r90878 - in projects/jboss-osgi/projects: bundles/common/trunk/src/main/java/org/jboss/osgi/common/internal and 4 other directories.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-07-07 03:14:08 -0400 (Tue, 07 Jul 2009)
New Revision: 90878
Modified:
projects/jboss-osgi/projects/bundles/common/trunk/pom.xml
projects/jboss-osgi/projects/bundles/common/trunk/src/main/java/org/jboss/osgi/common/internal/DeployerServiceDelegate.java
projects/jboss-osgi/projects/bundles/common/trunk/src/main/java/org/jboss/osgi/common/internal/SystemDeployerService.java
projects/jboss-osgi/projects/bundles/hotdeploy/trunk/src/main/java/org/jboss/osgi/service/hotdeploy/internal/DeploymentScannerImpl.java
projects/jboss-osgi/projects/bundles/microcontainer/trunk/pom.xml
projects/jboss-osgi/projects/integration/deployers/trunk/src/main/java/org/jboss/osgi/deployer/BundleClassLoaderDeployer.java
projects/jboss-osgi/projects/integration/jbossas/trunk/src/main/java/org/jboss/osgi/integration/jbossas/AbstractMicrocontainerService.java
Log:
Use SPI util
Modified: projects/jboss-osgi/projects/bundles/common/trunk/pom.xml
===================================================================
--- projects/jboss-osgi/projects/bundles/common/trunk/pom.xml 2009-07-07 07:09:57 UTC (rev 90877)
+++ projects/jboss-osgi/projects/bundles/common/trunk/pom.xml 2009-07-07 07:14:08 UTC (rev 90878)
@@ -73,6 +73,7 @@
org.jboss.logging,
org.jboss.osgi.spi.management;version="1.0",
org.jboss.osgi.spi.service;version="1.0",
+ org.jboss.osgi.spi.util;version="1.0",
org.osgi.framework;version=1.4,
org.osgi.service.log;version=1.3,
org.osgi.util.tracker
Modified: projects/jboss-osgi/projects/bundles/common/trunk/src/main/java/org/jboss/osgi/common/internal/DeployerServiceDelegate.java
===================================================================
--- projects/jboss-osgi/projects/bundles/common/trunk/src/main/java/org/jboss/osgi/common/internal/DeployerServiceDelegate.java 2009-07-07 07:09:57 UTC (rev 90877)
+++ projects/jboss-osgi/projects/bundles/common/trunk/src/main/java/org/jboss/osgi/common/internal/DeployerServiceDelegate.java 2009-07-07 07:14:08 UTC (rev 90878)
@@ -25,8 +25,8 @@
import java.net.URL;
-import org.jboss.osgi.spi.BundleInfo;
import org.jboss.osgi.spi.service.DeployerService;
+import org.jboss.osgi.spi.util.BundleInfo;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
import org.osgi.framework.BundleException;
Modified: projects/jboss-osgi/projects/bundles/common/trunk/src/main/java/org/jboss/osgi/common/internal/SystemDeployerService.java
===================================================================
--- projects/jboss-osgi/projects/bundles/common/trunk/src/main/java/org/jboss/osgi/common/internal/SystemDeployerService.java 2009-07-07 07:09:57 UTC (rev 90877)
+++ projects/jboss-osgi/projects/bundles/common/trunk/src/main/java/org/jboss/osgi/common/internal/SystemDeployerService.java 2009-07-07 07:14:08 UTC (rev 90878)
@@ -34,9 +34,9 @@
import java.util.jar.Manifest;
import org.jboss.osgi.common.log.LogServiceTracker;
-import org.jboss.osgi.spi.BundleInfo;
import org.jboss.osgi.spi.management.ManagedBundleService;
import org.jboss.osgi.spi.service.DeployerService;
+import org.jboss.osgi.spi.util.BundleInfo;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
import org.osgi.framework.BundleException;
Modified: projects/jboss-osgi/projects/bundles/hotdeploy/trunk/src/main/java/org/jboss/osgi/service/hotdeploy/internal/DeploymentScannerImpl.java
===================================================================
--- projects/jboss-osgi/projects/bundles/hotdeploy/trunk/src/main/java/org/jboss/osgi/service/hotdeploy/internal/DeploymentScannerImpl.java 2009-07-07 07:09:57 UTC (rev 90877)
+++ projects/jboss-osgi/projects/bundles/hotdeploy/trunk/src/main/java/org/jboss/osgi/service/hotdeploy/internal/DeploymentScannerImpl.java 2009-07-07 07:14:08 UTC (rev 90878)
@@ -35,9 +35,9 @@
import java.util.Set;
import org.jboss.osgi.common.log.LogServiceTracker;
-import org.jboss.osgi.spi.BundleInfo;
import org.jboss.osgi.spi.service.DeployerService;
import org.jboss.osgi.spi.service.DeploymentScannerService;
+import org.jboss.osgi.spi.util.BundleInfo;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
import org.osgi.framework.BundleException;
Modified: projects/jboss-osgi/projects/bundles/microcontainer/trunk/pom.xml
===================================================================
--- projects/jboss-osgi/projects/bundles/microcontainer/trunk/pom.xml 2009-07-07 07:09:57 UTC (rev 90877)
+++ projects/jboss-osgi/projects/bundles/microcontainer/trunk/pom.xml 2009-07-07 07:14:08 UTC (rev 90878)
@@ -22,8 +22,8 @@
<version.jboss.deployers>2.0.5.SP1</version.jboss.deployers>
<version.jboss.microcontainer>2.0.5.GA</version.jboss.microcontainer>
<version.jboss.osgi.apache.xerces>2.9.1</version.jboss.osgi.apache.xerces>
- <version.jboss.osgi.common>1.0.0.Beta2</version.jboss.osgi.common>
- <version.jboss.osgi.deployers>1.0.0.Beta2</version.jboss.osgi.deployers>
+ <version.jboss.osgi.common>1.0.0-SNAPSHOT</version.jboss.osgi.common>
+ <version.jboss.osgi.deployers>1.0.0-SNAPSHOT</version.jboss.osgi.deployers>
<version.jboss.osgi.jbossas>1.0.0-SNAPSHOT</version.jboss.osgi.jbossas>
<version.jboss.osgi.jmx>1.0.0.Beta2</version.jboss.osgi.jmx>
<version.jboss.osgi.spi>1.0.0-SNAPSHOT</version.jboss.osgi.spi>
Modified: projects/jboss-osgi/projects/integration/deployers/trunk/src/main/java/org/jboss/osgi/deployer/BundleClassLoaderDeployer.java
===================================================================
--- projects/jboss-osgi/projects/integration/deployers/trunk/src/main/java/org/jboss/osgi/deployer/BundleClassLoaderDeployer.java 2009-07-07 07:09:57 UTC (rev 90877)
+++ projects/jboss-osgi/projects/integration/deployers/trunk/src/main/java/org/jboss/osgi/deployer/BundleClassLoaderDeployer.java 2009-07-07 07:14:08 UTC (rev 90878)
@@ -31,8 +31,8 @@
import org.jboss.deployers.structure.spi.DeploymentUnitFilter;
import org.jboss.osgi.deployer.helpers.BundleDeploymentUnitFilter;
import org.jboss.osgi.deployer.helpers.PackageAdminDependencyItem;
-import org.jboss.osgi.spi.BundleClassLoader;
import org.jboss.osgi.spi.Constants;
+import org.jboss.osgi.spi.util.BundleClassLoader;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
Modified: projects/jboss-osgi/projects/integration/jbossas/trunk/src/main/java/org/jboss/osgi/integration/jbossas/AbstractMicrocontainerService.java
===================================================================
--- projects/jboss-osgi/projects/integration/jbossas/trunk/src/main/java/org/jboss/osgi/integration/jbossas/AbstractMicrocontainerService.java 2009-07-07 07:09:57 UTC (rev 90877)
+++ projects/jboss-osgi/projects/integration/jbossas/trunk/src/main/java/org/jboss/osgi/integration/jbossas/AbstractMicrocontainerService.java 2009-07-07 07:14:08 UTC (rev 90878)
@@ -53,10 +53,10 @@
import org.jboss.kernel.Kernel;
import org.jboss.kernel.spi.dependency.KernelController;
import org.jboss.kernel.spi.dependency.KernelControllerContext;
-import org.jboss.osgi.spi.BundleInfo;
import org.jboss.osgi.spi.management.MicrocontainerServiceMBean;
import org.jboss.osgi.spi.service.DeployerService;
import org.jboss.osgi.spi.service.MicrocontainerService;
+import org.jboss.osgi.spi.util.BundleInfo;
import org.jboss.virtual.VFS;
import org.jboss.virtual.VirtualFile;
import org.osgi.framework.Bundle;
16 years, 11 months
JBoss-OSGI SVN: r90877 - in projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi: service and 1 other directories.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-07-07 03:09:57 -0400 (Tue, 07 Jul 2009)
New Revision: 90877
Added:
projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/util/
projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/util/BundleClassLoader.java
projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/util/BundleInfo.java
Removed:
projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/BundleClassLoader.java
projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/BundleInfo.java
Modified:
projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/service/DeployerService.java
projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/service/DeploymentScannerService.java
Log:
Move util classes to package util
Deleted: projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/BundleClassLoader.java
===================================================================
--- projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/BundleClassLoader.java 2009-07-07 06:58:20 UTC (rev 90876)
+++ projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/BundleClassLoader.java 2009-07-07 07:09:57 UTC (rev 90877)
@@ -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.spi;
-
-// $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 createClassLoader(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 obj)
- {
- if (this == obj)
- return true;
-
- if (obj instanceof BundleClassLoader == false)
- return false;
-
- final BundleClassLoader bundleClassLoader = (BundleClassLoader)obj;
- return bundle.equals(bundleClassLoader.bundle);
- }
-
- public int hashCode()
- {
- return bundle.hashCode();
- }
-
- public String toString()
- {
- Dictionary<?, ?> headers = bundle.getHeaders();
- String bundleId = bundle.getSymbolicName() + ":" + headers.get(Constants.BUNDLE_VERSION);
- return "BundleClassLoader for [" + bundleId + "]";
- }
-}
Deleted: projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/BundleInfo.java
===================================================================
--- projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/BundleInfo.java 2009-07-07 06:58:20 UTC (rev 90876)
+++ projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/BundleInfo.java 2009-07-07 07:09:57 UTC (rev 90877)
@@ -1,97 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.osgi.spi;
-
-//$Id$
-
-import java.net.URL;
-
-/**
- * An abstraction of a bundle
- *
- * @author thomas.diesler(a)jboss.com
- * @since 27-May-2009
- */
-public class BundleInfo
-{
- private URL location;
- private String symbolicName;
- private String version;
-
- public BundleInfo(URL location, String symbolicName, String version)
- {
- this.symbolicName = symbolicName;
- this.location = location;
- this.version = (version != null ? version : "0.0.0");
-
- if (symbolicName == null)
- throw new IllegalArgumentException("Symbolic name cannot be null");
- if (location == null)
- throw new IllegalArgumentException("Location cannot be null");
- }
-
- /**
- * Get the bundle location
- */
- public URL getLocation()
- {
- return location;
- }
-
- /**
- * Get the bundle symbolic name
- */
- public String getSymbolicName()
- {
- return symbolicName;
- }
-
- /**
- * Get the bundle version
- */
- public String getVersion()
- {
- return version;
- }
-
- @Override
- public boolean equals(Object obj)
- {
- if (!(obj instanceof BundleInfo))
- return false;
-
- BundleInfo other = (BundleInfo)obj;
- return symbolicName.equals(other.symbolicName) && version.equals(other.version);
- }
-
- @Override
- public int hashCode()
- {
- return toString().hashCode();
- }
-
- @Override
- public String toString()
- {
- return "[" + symbolicName + ":" + version + "]";
- }
-}
\ No newline at end of file
Modified: projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/service/DeployerService.java
===================================================================
--- projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/service/DeployerService.java 2009-07-07 06:58:20 UTC (rev 90876)
+++ projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/service/DeployerService.java 2009-07-07 07:09:57 UTC (rev 90877)
@@ -25,8 +25,8 @@
import javax.management.ObjectName;
-import org.jboss.osgi.spi.BundleInfo;
import org.jboss.osgi.spi.management.ObjectNameFactory;
+import org.jboss.osgi.spi.util.BundleInfo;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleException;
Modified: projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/service/DeploymentScannerService.java
===================================================================
--- projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/service/DeploymentScannerService.java 2009-07-07 06:58:20 UTC (rev 90876)
+++ projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/service/DeploymentScannerService.java 2009-07-07 07:09:57 UTC (rev 90877)
@@ -25,7 +25,7 @@
import java.net.URL;
-import org.jboss.osgi.spi.BundleInfo;
+import org.jboss.osgi.spi.util.BundleInfo;
/**
* A service that scans a directory location for new/removed bundles.
Copied: projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/util/BundleClassLoader.java (from rev 90875, projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/BundleClassLoader.java)
===================================================================
--- projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/util/BundleClassLoader.java (rev 0)
+++ projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/util/BundleClassLoader.java 2009-07-07 07:09:57 UTC (rev 90877)
@@ -0,0 +1,115 @@
+/*
+ * 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.spi.util;
+
+// $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 createClassLoader(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 obj)
+ {
+ if (this == obj)
+ return true;
+
+ if (obj instanceof BundleClassLoader == false)
+ return false;
+
+ final BundleClassLoader bundleClassLoader = (BundleClassLoader)obj;
+ return bundle.equals(bundleClassLoader.bundle);
+ }
+
+ public int hashCode()
+ {
+ return bundle.hashCode();
+ }
+
+ public String toString()
+ {
+ Dictionary<?, ?> headers = bundle.getHeaders();
+ String bundleId = bundle.getSymbolicName() + ":" + headers.get(Constants.BUNDLE_VERSION);
+ return "BundleClassLoader for [" + bundleId + "]";
+ }
+}
Copied: projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/util/BundleInfo.java (from rev 90875, projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/BundleInfo.java)
===================================================================
--- projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/util/BundleInfo.java (rev 0)
+++ projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/util/BundleInfo.java 2009-07-07 07:09:57 UTC (rev 90877)
@@ -0,0 +1,97 @@
+/*
+ * 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.util;
+
+//$Id$
+
+import java.net.URL;
+
+/**
+ * An abstraction of a bundle
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 27-May-2009
+ */
+public class BundleInfo
+{
+ private URL location;
+ private String symbolicName;
+ private String version;
+
+ public BundleInfo(URL location, String symbolicName, String version)
+ {
+ this.symbolicName = symbolicName;
+ this.location = location;
+ this.version = (version != null ? version : "0.0.0");
+
+ if (symbolicName == null)
+ throw new IllegalArgumentException("Symbolic name cannot be null");
+ if (location == null)
+ throw new IllegalArgumentException("Location cannot be null");
+ }
+
+ /**
+ * Get the bundle location
+ */
+ public URL getLocation()
+ {
+ return location;
+ }
+
+ /**
+ * Get the bundle symbolic name
+ */
+ public String getSymbolicName()
+ {
+ return symbolicName;
+ }
+
+ /**
+ * Get the bundle version
+ */
+ public String getVersion()
+ {
+ return version;
+ }
+
+ @Override
+ public boolean equals(Object obj)
+ {
+ if (!(obj instanceof BundleInfo))
+ return false;
+
+ BundleInfo other = (BundleInfo)obj;
+ return symbolicName.equals(other.symbolicName) && version.equals(other.version);
+ }
+
+ @Override
+ public int hashCode()
+ {
+ return toString().hashCode();
+ }
+
+ @Override
+ public String toString()
+ {
+ return "[" + symbolicName + ":" + version + "]";
+ }
+}
\ No newline at end of file
16 years, 11 months
JBoss-OSGI SVN: r90876 - projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-07-07 02:58:20 -0400 (Tue, 07 Jul 2009)
New Revision: 90876
Added:
projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/FrameworkException.java
Log:
Restore FrameworkException
Added: projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/FrameworkException.java
===================================================================
--- projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/FrameworkException.java (rev 0)
+++ projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/FrameworkException.java 2009-07-07 06:58:20 UTC (rev 90876)
@@ -0,0 +1,49 @@
+/*
+ * 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;
+
+// $Id$
+
+/**
+ * An OSGi Framework Exception that should be thrown on unrecoverable errors.
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 18-Jan-2009
+ */
+@SuppressWarnings("serial")
+public class FrameworkException extends RuntimeException
+{
+ public FrameworkException(String message)
+ {
+ super(message);
+ }
+
+ public FrameworkException(String message, Throwable cause)
+ {
+ super(message, cause);
+ }
+
+ public FrameworkException(Throwable cause)
+ {
+ super(cause);
+ }
+}
Property changes on: projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/FrameworkException.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
16 years, 11 months
JBoss-OSGI SVN: r90847 - in projects/jboss-osgi/projects: bundles/hotdeploy/trunk/src/main/java/org/jboss/osgi/service/hotdeploy/internal and 4 other directories.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-07-06 10:05:20 -0400 (Mon, 06 Jul 2009)
New Revision: 90847
Added:
projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/BundleInfo.java
Removed:
projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/FrameworkException.java
projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/service/BundleInfo.java
Modified:
projects/jboss-osgi/projects/bundles/common/trunk/src/main/java/org/jboss/osgi/common/internal/DeployerServiceDelegate.java
projects/jboss-osgi/projects/bundles/common/trunk/src/main/java/org/jboss/osgi/common/internal/SystemDeployerService.java
projects/jboss-osgi/projects/bundles/hotdeploy/trunk/src/main/java/org/jboss/osgi/service/hotdeploy/internal/DeploymentScannerImpl.java
projects/jboss-osgi/projects/bundles/webconsole/trunk/src/main/java/org/jboss/osgi/service/webconsole/internal/plugins/InstallActionExt.java
projects/jboss-osgi/projects/integration/jbossas/trunk/src/main/java/org/jboss/osgi/integration/jbossas/AbstractMicrocontainerService.java
projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/service/DeployerService.java
projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/service/DeploymentScannerService.java
Log:
Unify BundleInfo
Modified: projects/jboss-osgi/projects/bundles/common/trunk/src/main/java/org/jboss/osgi/common/internal/DeployerServiceDelegate.java
===================================================================
--- projects/jboss-osgi/projects/bundles/common/trunk/src/main/java/org/jboss/osgi/common/internal/DeployerServiceDelegate.java 2009-07-06 13:40:20 UTC (rev 90846)
+++ projects/jboss-osgi/projects/bundles/common/trunk/src/main/java/org/jboss/osgi/common/internal/DeployerServiceDelegate.java 2009-07-06 14:05:20 UTC (rev 90847)
@@ -25,7 +25,7 @@
import java.net.URL;
-import org.jboss.osgi.spi.service.BundleInfo;
+import org.jboss.osgi.spi.BundleInfo;
import org.jboss.osgi.spi.service.DeployerService;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
@@ -50,7 +50,7 @@
this.context = context;
}
- public Bundle getBundle(BundleInfo info) throws BundleException
+ public Bundle getBundle(BundleInfo info)
{
DeployerService service = getDefaultDeployerService();
return service.getBundle(info);
Modified: projects/jboss-osgi/projects/bundles/common/trunk/src/main/java/org/jboss/osgi/common/internal/SystemDeployerService.java
===================================================================
--- projects/jboss-osgi/projects/bundles/common/trunk/src/main/java/org/jboss/osgi/common/internal/SystemDeployerService.java 2009-07-06 13:40:20 UTC (rev 90846)
+++ projects/jboss-osgi/projects/bundles/common/trunk/src/main/java/org/jboss/osgi/common/internal/SystemDeployerService.java 2009-07-06 14:05:20 UTC (rev 90847)
@@ -34,8 +34,8 @@
import java.util.jar.Manifest;
import org.jboss.osgi.common.log.LogServiceTracker;
+import org.jboss.osgi.spi.BundleInfo;
import org.jboss.osgi.spi.management.ManagedBundleService;
-import org.jboss.osgi.spi.service.BundleInfo;
import org.jboss.osgi.spi.service.DeployerService;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
@@ -84,10 +84,10 @@
throw new BundleException("Cannot obtain Bundle-SymbolicName for: " + url);
String version = attribs.getValue(Constants.BUNDLE_VERSION);
- return new BundleInfoImpl(url, symbolicName, version);
+ return new BundleInfo(url, symbolicName, version);
}
- public Bundle getBundle(BundleInfo info) throws BundleException
+ public Bundle getBundle(BundleInfo info)
{
String symbolicName = info.getSymbolicName();
String version = info.getVersion();
@@ -206,35 +206,4 @@
log.log(LogService.LOG_DEBUG, "No ManagedBundleService. Cannot unregister managed bundle: " + bundle);
}
}
-
- static class BundleInfoImpl implements BundleInfo
- {
- private URL location;
- private String symbolicName;
- private String version;
-
- public BundleInfoImpl(URL location, String symbolicName, String version)
- {
- super();
- this.location = location;
- this.symbolicName = symbolicName;
- this.version = version;
- }
-
- public URL getLocation()
- {
- return location;
- }
-
- public String getSymbolicName()
- {
- return symbolicName;
- }
-
- public String getVersion()
- {
- return version;
- }
-
- }
}
\ No newline at end of file
Modified: projects/jboss-osgi/projects/bundles/hotdeploy/trunk/src/main/java/org/jboss/osgi/service/hotdeploy/internal/DeploymentScannerImpl.java
===================================================================
--- projects/jboss-osgi/projects/bundles/hotdeploy/trunk/src/main/java/org/jboss/osgi/service/hotdeploy/internal/DeploymentScannerImpl.java 2009-07-06 13:40:20 UTC (rev 90846)
+++ projects/jboss-osgi/projects/bundles/hotdeploy/trunk/src/main/java/org/jboss/osgi/service/hotdeploy/internal/DeploymentScannerImpl.java 2009-07-06 14:05:20 UTC (rev 90847)
@@ -35,9 +35,10 @@
import java.util.Set;
import org.jboss.osgi.common.log.LogServiceTracker;
-import org.jboss.osgi.spi.service.BundleInfo;
+import org.jboss.osgi.spi.BundleInfo;
import org.jboss.osgi.spi.service.DeployerService;
import org.jboss.osgi.spi.service.DeploymentScannerService;
+import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
import org.osgi.framework.BundleException;
import org.osgi.framework.ServiceReference;
@@ -172,7 +173,11 @@
for (BundleInfo info : lastScan)
{
if (currScan.contains(info) == false)
- diff.add(info);
+ {
+ Bundle bundle = deployer.getBundle(info);
+ if ((bundle.getState() & Bundle.INSTALLED) != 0)
+ diff.add(info);
+ }
}
if (traceBundles)
@@ -199,8 +204,10 @@
// Detect NEW bundles that are not in the last scan
for (BundleInfo info : currScan)
{
- if (lastScan.contains(info) == false)
+ if (lastScan.contains(info) == false && deployer.getBundle(info) == null)
+ {
diff.add(info);
+ }
}
if (traceBundles)
Modified: projects/jboss-osgi/projects/bundles/webconsole/trunk/src/main/java/org/jboss/osgi/service/webconsole/internal/plugins/InstallActionExt.java
===================================================================
--- projects/jboss-osgi/projects/bundles/webconsole/trunk/src/main/java/org/jboss/osgi/service/webconsole/internal/plugins/InstallActionExt.java 2009-07-06 13:40:20 UTC (rev 90846)
+++ projects/jboss-osgi/projects/bundles/webconsole/trunk/src/main/java/org/jboss/osgi/service/webconsole/internal/plugins/InstallActionExt.java 2009-07-06 14:05:20 UTC (rev 90847)
@@ -29,7 +29,7 @@
import java.net.URL;
import org.apache.felix.webconsole.internal.core.InstallAction;
-import org.jboss.osgi.spi.service.BundleInfo;
+import org.jboss.osgi.spi.BundleInfo;
import org.jboss.osgi.spi.service.DeployerService;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
Modified: projects/jboss-osgi/projects/integration/jbossas/trunk/src/main/java/org/jboss/osgi/integration/jbossas/AbstractMicrocontainerService.java
===================================================================
--- projects/jboss-osgi/projects/integration/jbossas/trunk/src/main/java/org/jboss/osgi/integration/jbossas/AbstractMicrocontainerService.java 2009-07-06 13:40:20 UTC (rev 90846)
+++ projects/jboss-osgi/projects/integration/jbossas/trunk/src/main/java/org/jboss/osgi/integration/jbossas/AbstractMicrocontainerService.java 2009-07-06 14:05:20 UTC (rev 90847)
@@ -53,8 +53,8 @@
import org.jboss.kernel.Kernel;
import org.jboss.kernel.spi.dependency.KernelController;
import org.jboss.kernel.spi.dependency.KernelControllerContext;
+import org.jboss.osgi.spi.BundleInfo;
import org.jboss.osgi.spi.management.MicrocontainerServiceMBean;
-import org.jboss.osgi.spi.service.BundleInfo;
import org.jboss.osgi.spi.service.DeployerService;
import org.jboss.osgi.spi.service.MicrocontainerService;
import org.jboss.virtual.VFS;
@@ -133,10 +133,10 @@
throw new BundleException("Cannot obtain Bundle-SymbolicName for: " + url);
String version = attribs.getValue(Constants.BUNDLE_VERSION);
- return new BundleInfoImpl(url, symbolicName, version);
+ return new BundleInfo(url, symbolicName, version);
}
- public Bundle getBundle(BundleInfo info) throws BundleException
+ public Bundle getBundle(BundleInfo info)
{
BundleContext context = getRegisteredBean(BundleContext.class, BEAN_SYSTEM_BUNDLE_CONTEXT);
String symbolicName = info.getSymbolicName();
@@ -320,35 +320,4 @@
super(name, actions, null, target);
}
}
-
- static class BundleInfoImpl implements BundleInfo
- {
- private URL location;
- private String symbolicName;
- private String version;
-
- public BundleInfoImpl(URL location, String symbolicName, String version)
- {
- super();
- this.location = location;
- this.symbolicName = symbolicName;
- this.version = version;
- }
-
- public URL getLocation()
- {
- return location;
- }
-
- public String getSymbolicName()
- {
- return symbolicName;
- }
-
- public String getVersion()
- {
- return version;
- }
-
- }
}
\ No newline at end of file
Copied: projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/BundleInfo.java (from rev 90833, projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/service/BundleInfo.java)
===================================================================
--- projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/BundleInfo.java (rev 0)
+++ projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/BundleInfo.java 2009-07-06 14:05:20 UTC (rev 90847)
@@ -0,0 +1,97 @@
+/*
+ * 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;
+
+//$Id$
+
+import java.net.URL;
+
+/**
+ * An abstraction of a bundle
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 27-May-2009
+ */
+public class BundleInfo
+{
+ private URL location;
+ private String symbolicName;
+ private String version;
+
+ public BundleInfo(URL location, String symbolicName, String version)
+ {
+ this.symbolicName = symbolicName;
+ this.location = location;
+ this.version = (version != null ? version : "0.0.0");
+
+ if (symbolicName == null)
+ throw new IllegalArgumentException("Symbolic name cannot be null");
+ if (location == null)
+ throw new IllegalArgumentException("Location cannot be null");
+ }
+
+ /**
+ * Get the bundle location
+ */
+ public URL getLocation()
+ {
+ return location;
+ }
+
+ /**
+ * Get the bundle symbolic name
+ */
+ public String getSymbolicName()
+ {
+ return symbolicName;
+ }
+
+ /**
+ * Get the bundle version
+ */
+ public String getVersion()
+ {
+ return version;
+ }
+
+ @Override
+ public boolean equals(Object obj)
+ {
+ if (!(obj instanceof BundleInfo))
+ return false;
+
+ BundleInfo other = (BundleInfo)obj;
+ return symbolicName.equals(other.symbolicName) && version.equals(other.version);
+ }
+
+ @Override
+ public int hashCode()
+ {
+ return toString().hashCode();
+ }
+
+ @Override
+ public String toString()
+ {
+ return "[" + symbolicName + ":" + version + "]";
+ }
+}
\ No newline at end of file
Deleted: projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/FrameworkException.java
===================================================================
--- projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/FrameworkException.java 2009-07-06 13:40:20 UTC (rev 90846)
+++ projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/FrameworkException.java 2009-07-06 14:05:20 UTC (rev 90847)
@@ -1,49 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.osgi.spi;
-
-// $Id$
-
-/**
- * An OSGi Framework Exception that should be thrown on unrecoverable errors.
- *
- * @author thomas.diesler(a)jboss.com
- * @since 18-Jan-2009
- */
-@SuppressWarnings("serial")
-public class FrameworkException extends RuntimeException
-{
- public FrameworkException(String message)
- {
- super(message);
- }
-
- public FrameworkException(String message, Throwable cause)
- {
- super(message, cause);
- }
-
- public FrameworkException(Throwable cause)
- {
- super(cause);
- }
-}
Deleted: projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/service/BundleInfo.java
===================================================================
--- projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/service/BundleInfo.java 2009-07-06 13:40:20 UTC (rev 90846)
+++ projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/service/BundleInfo.java 2009-07-06 14:05:20 UTC (rev 90847)
@@ -1,51 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.osgi.spi.service;
-
-//$Id$
-
-import java.net.URL;
-
-
-/**
- * An abstraction of a bundle in the scan folder
- *
- * @author thomas.diesler(a)jboss.com
- * @since 27-May-2009
- */
-public interface BundleInfo
-{
- /**
- * Get the bundle location
- */
- URL getLocation();
-
- /**
- * Get the bundle symbolic name
- */
- String getSymbolicName();
-
- /**
- * Get the bundle version
- */
- String getVersion();
-}
\ No newline at end of file
Modified: projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/service/DeployerService.java
===================================================================
--- projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/service/DeployerService.java 2009-07-06 13:40:20 UTC (rev 90846)
+++ projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/service/DeployerService.java 2009-07-06 14:05:20 UTC (rev 90847)
@@ -25,6 +25,7 @@
import javax.management.ObjectName;
+import org.jboss.osgi.spi.BundleInfo;
import org.jboss.osgi.spi.management.ObjectNameFactory;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleException;
@@ -53,7 +54,7 @@
* Get the installed bundle for the given bundle info
* @return null, if there is no bundle that matches the given bundle info
*/
- Bundle getBundle(BundleInfo info) throws BundleException;
+ Bundle getBundle(BundleInfo info);
/**
* Deploy an array of bundles
Modified: projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/service/DeploymentScannerService.java
===================================================================
--- projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/service/DeploymentScannerService.java 2009-07-06 13:40:20 UTC (rev 90846)
+++ projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/service/DeploymentScannerService.java 2009-07-06 14:05:20 UTC (rev 90847)
@@ -25,6 +25,8 @@
import java.net.URL;
+import org.jboss.osgi.spi.BundleInfo;
+
/**
* A service that scans a directory location for new/removed bundles.
*
16 years, 11 months
JBoss-OSGI SVN: r90843 - in projects/jboss-osgi/trunk/hudson/hudson-home: jobs/jbossosgi-jdk16 and 1 other directory.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-07-06 09:17:47 -0400 (Mon, 06 Jul 2009)
New Revision: 90843
Modified:
projects/jboss-osgi/trunk/hudson/hudson-home/config.xml
projects/jboss-osgi/trunk/hudson/hudson-home/jobs/jbossosgi-jdk16/config.xml
Log:
Extract SPI to projects
Modified: projects/jboss-osgi/trunk/hudson/hudson-home/config.xml
===================================================================
--- projects/jboss-osgi/trunk/hudson/hudson-home/config.xml 2009-07-06 13:10:56 UTC (rev 90842)
+++ projects/jboss-osgi/trunk/hudson/hudson-home/config.xml 2009-07-06 13:17:47 UTC (rev 90843)
@@ -8,9 +8,6 @@
<table>
<tr align="left"><th>Bind Addr</th><td>@jboss.bind.address@</td></tr>
-<tr align="left"><th>JavaDoc</th><td>
-<a href='job/jbossosgi-jdk16/ws/jboss-osgi/spi/target/apidocs/index.html'>SPI</a> <a href='job/jbossosgi-jdk16/ws/jboss-osgi/husky/harness/target/apidocs/index.html'>Husky</a>
-</td></tr>
<tr align="left"><th>Userguide</th><td>
<a href='job/jbossosgi-jdk16/ws/jboss-osgi/distribution/target/auto-install-dest/docs/userguide/pdf/JBossOSGi - Userguide.pdf'>PDF</a>
<a href='job/jbossosgi-jdk16/ws/jboss-osgi/distribution/target/auto-install-dest/docs/userguide/html/index.html'>HTML</a>
Modified: projects/jboss-osgi/trunk/hudson/hudson-home/jobs/jbossosgi-jdk16/config.xml
===================================================================
--- projects/jboss-osgi/trunk/hudson/hudson-home/jobs/jbossosgi-jdk16/config.xml 2009-07-06 13:10:56 UTC (rev 90842)
+++ projects/jboss-osgi/trunk/hudson/hudson-home/jobs/jbossosgi-jdk16/config.xml 2009-07-06 13:17:47 UTC (rev 90843)
@@ -59,10 +59,6 @@
</hudson.tasks.Shell>
</builders>
<publishers class="vector">
- <hudson.tasks.JavadocArchiver>
- <javadocDir>jboss-osgi/spi/target/apidocs</javadocDir>
- <keepAll>false</keepAll>
- </hudson.tasks.JavadocArchiver>
<hudson.tasks.junit.JUnitResultArchiver>
<testResults>jboss-osgi/**/target/surefire-reports/TEST-*.xml</testResults>
</hudson.tasks.junit.JUnitResultArchiver>
16 years, 11 months
JBoss-OSGI SVN: r90842 - projects/jboss-osgi/trunk.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-07-06 09:10:56 -0400 (Mon, 06 Jul 2009)
New Revision: 90842
Modified:
projects/jboss-osgi/trunk/pom.xml
Log:
version.jboss.osgi.deployers=1.0.0-SNAPSHOT
Modified: projects/jboss-osgi/trunk/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/pom.xml 2009-07-06 12:58:03 UTC (rev 90841)
+++ projects/jboss-osgi/trunk/pom.xml 2009-07-06 13:10:56 UTC (rev 90842)
@@ -42,7 +42,7 @@
<version.jboss.osgi.apache.xerces>2.9.1</version.jboss.osgi.apache.xerces>
<version.jboss.osgi.common>1.0.0-SNAPSHOT</version.jboss.osgi.common>
<version.jboss.osgi.common.core>2.2.11</version.jboss.osgi.common.core>
- <version.jboss.osgi.deployers>1.0.0.Beta2</version.jboss.osgi.deployers>
+ <version.jboss.osgi.deployers>1.0.0-SNAPSHOT</version.jboss.osgi.deployers>
<version.jboss.osgi.hotdeploy>1.0.0-SNAPSHOT</version.jboss.osgi.hotdeploy>
<version.jboss.osgi.husky>1.0.0-SNAPSHOT</version.jboss.osgi.husky>
<version.jboss.osgi.integration.jbossas>1.0.0-SNAPSHOT</version.jboss.osgi.integration.jbossas>
16 years, 11 months
JBoss-OSGI SVN: r90841 - in projects/jboss-osgi/projects: bundles/common/trunk/src/main/java/org/jboss/osgi/common/internal and 9 other directories.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-07-06 08:58:03 -0400 (Mon, 06 Jul 2009)
New Revision: 90841
Added:
projects/jboss-osgi/projects/bundles/webconsole/trunk/src/main/java/org/apache/felix/webconsole/internal/core/
projects/jboss-osgi/projects/bundles/webconsole/trunk/src/main/java/org/apache/felix/webconsole/internal/core/InstallAction.java
projects/jboss-osgi/projects/bundles/webconsole/trunk/src/main/java/org/jboss/osgi/service/webconsole/internal/plugins/InstallActionExt.java
Removed:
projects/jboss-osgi/projects/bundles/hotdeploy/trunk/src/main/java/org/jboss/osgi/service/hotdeploy/internal/BundleInfoImpl.java
Modified:
projects/jboss-osgi/projects/bundles/common/trunk/pom.xml
projects/jboss-osgi/projects/bundles/common/trunk/src/main/java/org/jboss/osgi/common/internal/DeployerServiceDelegate.java
projects/jboss-osgi/projects/bundles/common/trunk/src/main/java/org/jboss/osgi/common/internal/SystemDeployerService.java
projects/jboss-osgi/projects/bundles/hotdeploy/trunk/pom.xml
projects/jboss-osgi/projects/bundles/hotdeploy/trunk/src/main/java/org/jboss/osgi/service/hotdeploy/internal/DeploymentScannerImpl.java
projects/jboss-osgi/projects/bundles/webconsole/trunk/pom.xml
projects/jboss-osgi/projects/bundles/webconsole/trunk/src/main/java/org/jboss/osgi/service/webconsole/internal/WebConsole.java
projects/jboss-osgi/projects/integration/jbossas/trunk/src/main/java/org/jboss/osgi/integration/jbossas/AbstractMicrocontainerService.java
projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/service/DeploymentScannerService.java
Log:
[JBOSGI-66] Support bundle deployment through web console
Modified: projects/jboss-osgi/projects/bundles/common/trunk/pom.xml
===================================================================
--- projects/jboss-osgi/projects/bundles/common/trunk/pom.xml 2009-07-06 12:56:35 UTC (rev 90840)
+++ projects/jboss-osgi/projects/bundles/common/trunk/pom.xml 2009-07-06 12:58:03 UTC (rev 90841)
@@ -18,7 +18,7 @@
<properties>
<version.jboss.logging>2.0.5.GA</version.jboss.logging>
- <version.jboss.osgi.spi>1.0.0.Beta2</version.jboss.osgi.spi>
+ <version.jboss.osgi.spi>1.0.0-SNAPSHOT</version.jboss.osgi.spi>
<version.osgi>r4v41</version.osgi>
</properties>
Modified: projects/jboss-osgi/projects/bundles/common/trunk/src/main/java/org/jboss/osgi/common/internal/DeployerServiceDelegate.java
===================================================================
--- projects/jboss-osgi/projects/bundles/common/trunk/src/main/java/org/jboss/osgi/common/internal/DeployerServiceDelegate.java 2009-07-06 12:56:35 UTC (rev 90840)
+++ projects/jboss-osgi/projects/bundles/common/trunk/src/main/java/org/jboss/osgi/common/internal/DeployerServiceDelegate.java 2009-07-06 12:58:03 UTC (rev 90841)
@@ -27,6 +27,7 @@
import org.jboss.osgi.spi.service.BundleInfo;
import org.jboss.osgi.spi.service.DeployerService;
+import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
import org.osgi.framework.BundleException;
import org.osgi.framework.InvalidSyntaxException;
@@ -49,6 +50,18 @@
this.context = context;
}
+ public Bundle getBundle(BundleInfo info) throws BundleException
+ {
+ DeployerService service = getDefaultDeployerService();
+ return service.getBundle(info);
+ }
+
+ public BundleInfo getBundleInfo(URL url) throws BundleException
+ {
+ DeployerService service = getDefaultDeployerService();
+ return service.getBundleInfo(url);
+ }
+
public void deploy(BundleInfo[] bundles) throws BundleException
{
DeployerService service = getDefaultDeployerService();
Modified: projects/jboss-osgi/projects/bundles/common/trunk/src/main/java/org/jboss/osgi/common/internal/SystemDeployerService.java
===================================================================
--- projects/jboss-osgi/projects/bundles/common/trunk/src/main/java/org/jboss/osgi/common/internal/SystemDeployerService.java 2009-07-06 12:56:35 UTC (rev 90840)
+++ projects/jboss-osgi/projects/bundles/common/trunk/src/main/java/org/jboss/osgi/common/internal/SystemDeployerService.java 2009-07-06 12:58:03 UTC (rev 90841)
@@ -23,11 +23,15 @@
//$Id$
+import java.io.IOException;
import java.net.URL;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
+import java.util.jar.Attributes;
+import java.util.jar.JarFile;
+import java.util.jar.Manifest;
import org.jboss.osgi.common.log.LogServiceTracker;
import org.jboss.osgi.spi.management.ManagedBundleService;
@@ -36,6 +40,7 @@
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
import org.osgi.framework.BundleException;
+import org.osgi.framework.Constants;
import org.osgi.framework.ServiceReference;
import org.osgi.service.log.LogService;
@@ -58,6 +63,51 @@
this.context = context;
}
+ public BundleInfo getBundleInfo(URL url) throws BundleException
+ {
+ Manifest manifest;
+ try
+ {
+ JarFile jarFile = new JarFile(url.getPath());
+ manifest = jarFile.getManifest();
+ jarFile.close();
+ }
+ catch (IOException ex)
+ {
+ throw new BundleException("Cannot get manifest from: " + url);
+
+ }
+
+ Attributes attribs = manifest.getMainAttributes();
+ String symbolicName = attribs.getValue(Constants.BUNDLE_SYMBOLICNAME);
+ if (symbolicName == null)
+ throw new BundleException("Cannot obtain Bundle-SymbolicName for: " + url);
+
+ String version = attribs.getValue(Constants.BUNDLE_VERSION);
+ return new BundleInfoImpl(url, symbolicName, version);
+ }
+
+ public Bundle getBundle(BundleInfo info) throws BundleException
+ {
+ String symbolicName = info.getSymbolicName();
+ String version = info.getVersion();
+
+ Bundle bundle = null;
+ for (Bundle aux : context.getBundles())
+ {
+ if (aux.getSymbolicName().equals(symbolicName))
+ {
+ String auxVersion = (String)aux.getHeaders().get(Constants.BUNDLE_VERSION);
+ if (version == null || version.equals(auxVersion))
+ {
+ bundle = aux;
+ break;
+ }
+ }
+ }
+ return bundle;
+ }
+
public void deploy(BundleInfo[] bundleInfos) throws BundleException
{
// Install the NEW bundles
@@ -156,4 +206,35 @@
log.log(LogService.LOG_DEBUG, "No ManagedBundleService. Cannot unregister managed bundle: " + bundle);
}
}
+
+ static class BundleInfoImpl implements BundleInfo
+ {
+ private URL location;
+ private String symbolicName;
+ private String version;
+
+ public BundleInfoImpl(URL location, String symbolicName, String version)
+ {
+ super();
+ this.location = location;
+ this.symbolicName = symbolicName;
+ this.version = version;
+ }
+
+ public URL getLocation()
+ {
+ return location;
+ }
+
+ public String getSymbolicName()
+ {
+ return symbolicName;
+ }
+
+ public String getVersion()
+ {
+ return version;
+ }
+
+ }
}
\ No newline at end of file
Modified: projects/jboss-osgi/projects/bundles/hotdeploy/trunk/pom.xml
===================================================================
--- projects/jboss-osgi/projects/bundles/hotdeploy/trunk/pom.xml 2009-07-06 12:56:35 UTC (rev 90840)
+++ projects/jboss-osgi/projects/bundles/hotdeploy/trunk/pom.xml 2009-07-06 12:58:03 UTC (rev 90841)
@@ -18,8 +18,8 @@
</parent>
<properties>
- <version.jboss.osgi.common>1.0.0.Beta2</version.jboss.osgi.common>
- <version.jboss.osgi.spi>1.0.0.Beta2</version.jboss.osgi.spi>
+ <version.jboss.osgi.common>1.0.0-SNAPSHOT</version.jboss.osgi.common>
+ <version.jboss.osgi.spi>1.0.0-SNAPSHOT</version.jboss.osgi.spi>
<version.osgi>r4v41</version.osgi>
</properties>
Deleted: projects/jboss-osgi/projects/bundles/hotdeploy/trunk/src/main/java/org/jboss/osgi/service/hotdeploy/internal/BundleInfoImpl.java
===================================================================
--- projects/jboss-osgi/projects/bundles/hotdeploy/trunk/src/main/java/org/jboss/osgi/service/hotdeploy/internal/BundleInfoImpl.java 2009-07-06 12:56:35 UTC (rev 90840)
+++ projects/jboss-osgi/projects/bundles/hotdeploy/trunk/src/main/java/org/jboss/osgi/service/hotdeploy/internal/BundleInfoImpl.java 2009-07-06 12:58:03 UTC (rev 90841)
@@ -1,123 +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.service.hotdeploy.internal;
-
-//$Id$
-
-import java.net.URL;
-import java.util.Dictionary;
-
-import org.jboss.osgi.spi.service.BundleInfo;
-import org.osgi.framework.Bundle;
-import org.osgi.framework.Constants;
-
-/**
- * An abstraction of a bundle in the scan folder
- *
- * @author thomas.diesler(a)jboss.com
- * @since 27-May-2009
- */
-public class BundleInfoImpl implements BundleInfo
-{
- private URL location;
- private String symbolicName;
- private String version;
- private State state;
-
- public BundleInfoImpl(URL bundleURL, String symbolicName, String version)
- {
- this.symbolicName = symbolicName;
- this.location = bundleURL;
- this.state = State.NEW;
-
- this.version = (version != null ? version : "0.0.0");
- }
-
- @SuppressWarnings("unchecked")
- public void initFromBundle(Bundle bundle)
- {
- Dictionary headers = bundle.getHeaders();
- String bundleVersion = (String)headers.get(Constants.BUNDLE_VERSION);
- if (bundleVersion != null)
- this.version = bundleVersion;
-
- int bundleState = bundle.getState();
- switch (bundleState)
- {
- case Bundle.INSTALLED:
- case Bundle.RESOLVED:
- case Bundle.STARTING:
- case Bundle.STOPPING:
- state = State.INSTALLED;
- break;
-
- case Bundle.ACTIVE:
- state = State.ACTIVE;
- break;
-
- case Bundle.UNINSTALLED:
- state = State.UNINSTALLED;
- break;
- }
- }
-
- public URL getLocation()
- {
- return location;
- }
-
- public State getState()
- {
- return state;
- }
-
- public String getSymbolicName()
- {
- return symbolicName;
- }
-
- public String getVersion()
- {
- return version;
- }
-
- @Override
- public boolean equals(Object obj)
- {
- if ((obj instanceof BundleInfoImpl) == false)
- return false;
-
- BundleInfoImpl other = (BundleInfoImpl)obj;
- return symbolicName.equals(other.symbolicName) && version.equals(other.version);
- }
-
- @Override
- public int hashCode()
- {
- return toString().hashCode();
- }
-
- public String toString()
- {
- return "[" + state + "," + symbolicName + "," + version + "]";
- }
-}
\ No newline at end of file
Modified: projects/jboss-osgi/projects/bundles/hotdeploy/trunk/src/main/java/org/jboss/osgi/service/hotdeploy/internal/DeploymentScannerImpl.java
===================================================================
--- projects/jboss-osgi/projects/bundles/hotdeploy/trunk/src/main/java/org/jboss/osgi/service/hotdeploy/internal/DeploymentScannerImpl.java 2009-07-06 12:56:35 UTC (rev 90840)
+++ projects/jboss-osgi/projects/bundles/hotdeploy/trunk/src/main/java/org/jboss/osgi/service/hotdeploy/internal/DeploymentScannerImpl.java 2009-07-06 12:58:03 UTC (rev 90841)
@@ -26,7 +26,6 @@
import static org.jboss.osgi.spi.Constants.OSGI_HOME;
import java.io.File;
-import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.ArrayList;
@@ -34,18 +33,13 @@
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Set;
-import java.util.jar.Attributes;
-import java.util.jar.JarFile;
-import java.util.jar.Manifest;
import org.jboss.osgi.common.log.LogServiceTracker;
import org.jboss.osgi.spi.service.BundleInfo;
import org.jboss.osgi.spi.service.DeployerService;
import org.jboss.osgi.spi.service.DeploymentScannerService;
-import org.jboss.osgi.spi.service.BundleInfo.State;
-import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
-import org.osgi.framework.Constants;
+import org.osgi.framework.BundleException;
import org.osgi.framework.ServiceReference;
import org.osgi.service.log.LogService;
@@ -139,11 +133,11 @@
public void scan()
{
// Use a copy so listeners can remove themselves from within the callback
- List<ScanListener> listenerArr = new ArrayList<ScanListener>(listeners);
- for (ScanListener listener : listenerArr)
+ List<ScanListener> scanListeners = new ArrayList<ScanListener>(listeners);
+ for (ScanListener listener : scanListeners)
listener.beforeScan(this);
- List<BundleInfo> currScan = Arrays.asList(getBundles());
+ List<BundleInfo> currScan = Arrays.asList(getBundleInfos());
if (traceBundles)
logBundleInfos("Current Scan", currScan);
@@ -157,7 +151,7 @@
lastScan = currScan;
scanCount++;
- for (ScanListener listener : listenerArr)
+ for (ScanListener listener : scanListeners)
listener.afterScan(this);
}
@@ -177,7 +171,7 @@
// Detect OLD bundles that are not in the current scan
for (BundleInfo info : lastScan)
{
- if ((info.getState() == State.INSTALLED || info.getState() == State.ACTIVE) && currScan.contains(info) == false)
+ if (currScan.contains(info) == false)
diff.add(info);
}
@@ -205,7 +199,7 @@
// Detect NEW bundles that are not in the last scan
for (BundleInfo info : currScan)
{
- if (info.getState() == BundleInfo.State.NEW && lastScan.contains(info) == false)
+ if (lastScan.contains(info) == false)
diff.add(info);
}
@@ -226,7 +220,7 @@
return diff.size();
}
- public BundleInfo[] getBundles()
+ public BundleInfo[] getBundleInfos()
{
List<BundleInfo> bundles = new ArrayList<BundleInfo>();
@@ -238,17 +232,19 @@
{
for (File file : listFiles)
{
- BundleInfoImpl info = getBundleInfo(file);
-
- Bundle bundle = getInstalledBundle(info);
- if (bundle != null)
- info.initFromBundle(bundle);
-
- bundles.add(info);
+ try
+ {
+ BundleInfo info = deployer.getBundleInfo(toURL(file));
+ bundles.add(info);
+ }
+ catch (BundleException ex)
+ {
+ log.log(LogService.LOG_WARNING, "Cannot obtain bundle info for: " + file);
+ }
}
}
- BundleInfo[] arr = new BundleInfoImpl[bundles.size()];
+ BundleInfo[] arr = new BundleInfo[bundles.size()];
return bundles.toArray(arr);
}
@@ -287,51 +283,6 @@
scanLocation = scanFile;
}
- private BundleInfoImpl getBundleInfo(File file)
- {
- Manifest manifest;
- try
- {
- JarFile jarFile = new JarFile(file);
- manifest = jarFile.getManifest();
- jarFile.close();
- }
- catch (IOException ex)
- {
- throw new IllegalStateException("Cannot obtain manifest from: " + file, ex);
- }
-
- Attributes attribs = manifest.getMainAttributes();
-
- String symbolicName = attribs.getValue(Constants.BUNDLE_SYMBOLICNAME);
- if (symbolicName == null)
- throw new IllegalStateException("Cannot obtain '" + Constants.BUNDLE_SYMBOLICNAME + "' from: " + file);
-
- String version = attribs.getValue(Constants.BUNDLE_VERSION);
-
- return new BundleInfoImpl(toURL(file), symbolicName, version);
- }
-
- private Bundle getInstalledBundle(BundleInfo info)
- {
- Bundle bundle = null;
- for (Bundle aux : context.getBundles())
- {
- String name = aux.getSymbolicName();
-
- String version = (String)aux.getHeaders().get(Constants.BUNDLE_VERSION);
- if (version == null)
- version = "0.0.0";
-
- if (name.equals(info.getSymbolicName()) && version.equals(info.getVersion()))
- {
- bundle = aux;
- break;
- }
- }
- return bundle;
- }
-
private URL toURL(File file)
{
try
Modified: projects/jboss-osgi/projects/bundles/webconsole/trunk/pom.xml
===================================================================
--- projects/jboss-osgi/projects/bundles/webconsole/trunk/pom.xml 2009-07-06 12:56:35 UTC (rev 90840)
+++ projects/jboss-osgi/projects/bundles/webconsole/trunk/pom.xml 2009-07-06 12:58:03 UTC (rev 90841)
@@ -18,6 +18,7 @@
<!-- Properties -->
<properties>
+ <version.jboss.osgi.spi>1.0.0-SNAPSHOT</version.jboss.osgi.spi>
<version.commons.fileupload>1.1.1</version.commons.fileupload>
<version.commons.io>1.4</version.commons.io>
<version.felix.bundlerepository>1.0.3</version.felix.bundlerepository>
@@ -31,6 +32,12 @@
<!-- Dependencies -->
<dependencies>
<dependency>
+ <groupId>org.jboss.osgi</groupId>
+ <artifactId>jboss-osgi-spi</artifactId>
+ <version>${version.jboss.osgi.spi}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>${version.javax.servlet}</version>
Added: projects/jboss-osgi/projects/bundles/webconsole/trunk/src/main/java/org/apache/felix/webconsole/internal/core/InstallAction.java
===================================================================
--- projects/jboss-osgi/projects/bundles/webconsole/trunk/src/main/java/org/apache/felix/webconsole/internal/core/InstallAction.java (rev 0)
+++ projects/jboss-osgi/projects/bundles/webconsole/trunk/src/main/java/org/apache/felix/webconsole/internal/core/InstallAction.java 2009-07-06 12:58:03 UTC (rev 90841)
@@ -0,0 +1,390 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.felix.webconsole.internal.core;
+
+
+import java.io.*;
+import java.util.Map;
+import java.util.jar.JarFile;
+import java.util.jar.Manifest;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.commons.fileupload.FileItem;
+import org.apache.felix.webconsole.AbstractWebConsolePlugin;
+import org.apache.felix.webconsole.Action;
+import org.apache.felix.webconsole.internal.BaseManagementPlugin;
+import org.osgi.framework.*;
+import org.osgi.service.log.LogService;
+import org.osgi.service.packageadmin.PackageAdmin;
+import org.osgi.service.startlevel.StartLevel;
+
+
+/**
+ * The <code>InstallAction</code> TODO
+ */
+public class InstallAction extends BaseManagementPlugin implements Action
+{
+
+ public static final String NAME = "install";
+
+ public static final String LABEL = "Install or Update";
+
+ public static final String FIELD_STARTLEVEL = "bundlestartlevel";
+
+ public static final String FIELD_START = "bundlestart";
+
+ public static final String FIELD_BUNDLEFILE = "bundlefile";
+
+ // set to ask for PackageAdmin.refreshPackages() after install/update
+ public static final String FIELD_REFRESH_PACKAGES = "refreshPackages";
+
+
+ public String getName()
+ {
+ return NAME;
+ }
+
+
+ public String getLabel()
+ {
+ return LABEL;
+ }
+
+
+ public boolean performAction( HttpServletRequest request, HttpServletResponse response )
+ throws IOException
+ {
+
+ // get the uploaded data
+ Map params = ( Map ) request.getAttribute( AbstractWebConsolePlugin.ATTR_FILEUPLOAD );
+ if ( params == null )
+ {
+ return true;
+ }
+
+ FileItem startItem = getFileItem( params, FIELD_START, true );
+ FileItem startLevelItem = getFileItem( params, FIELD_STARTLEVEL, true );
+ FileItem bundleItem = getFileItem( params, FIELD_BUNDLEFILE, false );
+ FileItem refreshPackagesItem = getFileItem( params, FIELD_REFRESH_PACKAGES, true );
+
+ // don't care any more if not bundle item
+ if ( bundleItem == null || bundleItem.getSize() <= 0 )
+ {
+ return true;
+ }
+
+ // default values
+ // it exists
+ int startLevel = -1;
+ String bundleLocation = "inputstream:";
+
+ // convert the start level value
+ if ( startLevelItem != null )
+ {
+ try
+ {
+ startLevel = Integer.parseInt( startLevelItem.getString() );
+ }
+ catch ( NumberFormatException nfe )
+ {
+ getLog().log( LogService.LOG_INFO,
+ "Cannot parse start level parameter " + startLevelItem + " to a number, not setting start level" );
+ }
+ }
+
+ // write the bundle data to a temporary file to ease processing
+ File tmpFile = null;
+ try
+ {
+ // copy the data to a file for better processing
+ tmpFile = File.createTempFile( "install", ".tmp" );
+ bundleItem.write( tmpFile );
+ }
+ catch ( Exception e )
+ {
+ getLog().log( LogService.LOG_ERROR, "Problem accessing uploaded bundle file", e );
+
+ // remove the tmporary file
+ if ( tmpFile != null )
+ {
+ tmpFile.delete();
+ tmpFile = null;
+ }
+ }
+
+ // install or update the bundle now
+ if ( tmpFile != null )
+ {
+ // start, refreshPackages just needs to exist, don't care for value
+ boolean start = startItem != null;
+ boolean refreshPackages = refreshPackagesItem != null;
+
+ bundleLocation = "inputstream:" + bundleItem.getName();
+ installBundle( bundleLocation, tmpFile, startLevel, start, refreshPackages );
+ }
+
+ return true;
+ }
+
+
+ private FileItem getFileItem( Map params, String name, boolean isFormField )
+ {
+ FileItem[] items = ( FileItem[] ) params.get( name );
+ if ( items != null )
+ {
+ for ( int i = 0; i < items.length; i++ )
+ {
+ if ( items[i].isFormField() == isFormField )
+ {
+ return items[i];
+ }
+ }
+ }
+
+ // nothing found, fail
+ return null;
+ }
+
+
+ protected void installBundle( String location, File bundleFile, int startLevel, boolean start, boolean refreshPackages )
+ throws IOException
+ {
+ if ( bundleFile != null )
+ {
+
+ // try to get the bundle name, fail if none
+ String symbolicName = getSymbolicName( bundleFile );
+ if ( symbolicName == null )
+ {
+ bundleFile.delete();
+ throw new IOException(Constants.BUNDLE_SYMBOLICNAME + " header missing, cannot install bundle");
+ }
+
+ // check for existing bundle first
+ Bundle updateBundle = null;
+ if ( Constants.SYSTEM_BUNDLE_SYMBOLICNAME.equals( symbolicName ) )
+ {
+ updateBundle = getBundleContext().getBundle( 0 );
+ }
+ else
+ {
+ Bundle[] bundles = getBundleContext().getBundles();
+ for ( int i = 0; i < bundles.length; i++ )
+ {
+ if ( ( bundles[i].getLocation() != null && bundles[i].getLocation().equals( location ) )
+ || ( bundles[i].getSymbolicName() != null && bundles[i].getSymbolicName().equals( symbolicName ) ) )
+ {
+ updateBundle = bundles[i];
+ break;
+ }
+ }
+ }
+
+ if ( updateBundle != null )
+ {
+
+ updateBackground( updateBundle, bundleFile, refreshPackages );
+
+ }
+ else
+ {
+
+ installBackground( bundleFile, location, startLevel, start, refreshPackages );
+
+ }
+ }
+ }
+
+
+ private String getSymbolicName( File bundleFile )
+ {
+ JarFile jar = null;
+ try
+ {
+ jar = new JarFile( bundleFile );
+ Manifest m = jar.getManifest();
+ if ( m != null )
+ {
+ return m.getMainAttributes().getValue( Constants.BUNDLE_SYMBOLICNAME );
+ }
+ }
+ catch ( IOException ioe )
+ {
+ getLog().log( LogService.LOG_WARNING, "Cannot extract symbolic name of bundle file " + bundleFile, ioe );
+ }
+ finally
+ {
+ if ( jar != null )
+ {
+ try
+ {
+ jar.close();
+ }
+ catch ( IOException ioe )
+ {
+ // ignore
+ }
+ }
+ }
+
+ // fall back to "not found"
+ return null;
+ }
+
+
+ protected void installBackground( final File bundleFile, final String location, final int startlevel,
+ final boolean doStart, final boolean refreshPackages )
+ {
+
+ Thread t = new InstallHelper( this, "Background Install " + bundleFile, bundleFile, refreshPackages )
+ {
+
+ protected Bundle doRun( InputStream bundleStream ) throws BundleException
+ {
+ Bundle bundle = getBundleContext().installBundle( location, bundleStream );
+
+ if ( startlevel > 0 )
+ {
+ StartLevel sl = getStartLevel();
+ if ( sl != null )
+ {
+ sl.setBundleStartLevel( bundle, startlevel );
+ }
+ }
+
+ if ( doStart )
+ {
+ bundle.start();
+ }
+
+ return bundle;
+ }
+ };
+
+ t.start();
+ }
+
+
+ protected void updateBackground( final Bundle bundle, final File bundleFile, final boolean refreshPackages )
+ {
+ Thread t = new InstallHelper( this, "Background Update" + bundle.getSymbolicName() + " ("
+ + bundle.getBundleId() + ")", bundleFile, refreshPackages )
+ {
+
+ protected Bundle doRun( InputStream bundleStream ) throws BundleException
+ {
+ bundle.update( bundleStream );
+ return bundle;
+ }
+ };
+
+ t.start();
+ }
+
+ public static abstract class InstallHelper extends Thread
+ {
+
+ private final InstallAction installAction;
+
+ private final File bundleFile;
+
+ private final boolean refreshPackages;
+
+
+ public InstallHelper( InstallAction installAction, String name, File bundleFile, boolean refreshPackages )
+ {
+ super( name );
+ setDaemon( true );
+
+ this.installAction = installAction;
+ this.bundleFile = bundleFile;
+ this.refreshPackages = refreshPackages;
+ }
+
+
+ protected abstract Bundle doRun( InputStream bundleStream ) throws BundleException;
+
+
+ public void run()
+ {
+ // wait some time for the request to settle
+ sleepSilently( 500L );
+
+ // now deploy the resolved bundles
+ InputStream bundleStream = null;
+ try
+ {
+ // we need the package admin before we call the bundle
+ // installation or update, since we might be updating
+ // our selves in which case the bundle context will be
+ // invalid by the time we want to call the update
+ PackageAdmin pa = ( refreshPackages ) ? installAction.getPackageAdmin() : null;
+
+ bundleStream = new FileInputStream( bundleFile );
+ Bundle bundle = doRun( bundleStream );
+
+ if ( pa != null )
+ {
+ // wait for asynchronous bundle start tasks to finish
+ sleepSilently( 2000L );
+
+ pa.refreshPackages( new Bundle[]
+ { bundle } );
+ }
+ }
+ catch ( IOException ioe )
+ {
+ installAction.getLog().log( LogService.LOG_ERROR, "Cannot install or update bundle from " + bundleFile,
+ ioe );
+ }
+ catch ( BundleException be )
+ {
+ installAction.getLog().log( LogService.LOG_ERROR, "Cannot install or update bundle from " + bundleFile,
+ be );
+ }
+ finally
+ {
+ if ( bundleStream != null )
+ {
+ try
+ {
+ bundleStream.close();
+ }
+ catch ( IOException ignore )
+ {
+ }
+ }
+ bundleFile.delete();
+ }
+ }
+
+
+ protected void sleepSilently( long msecs )
+ {
+ try
+ {
+ sleep( msecs );
+ }
+ catch ( InterruptedException ie )
+ {
+ // don't care
+ }
+ }
+ }
+}
Modified: projects/jboss-osgi/projects/bundles/webconsole/trunk/src/main/java/org/jboss/osgi/service/webconsole/internal/WebConsole.java
===================================================================
--- projects/jboss-osgi/projects/bundles/webconsole/trunk/src/main/java/org/jboss/osgi/service/webconsole/internal/WebConsole.java 2009-07-06 12:56:35 UTC (rev 90840)
+++ projects/jboss-osgi/projects/bundles/webconsole/trunk/src/main/java/org/jboss/osgi/service/webconsole/internal/WebConsole.java 2009-07-06 12:58:03 UTC (rev 90841)
@@ -24,8 +24,6 @@
//$Id$
import org.apache.felix.webconsole.internal.compendium.ComponentConfigurationPrinter;
-import org.apache.felix.webconsole.internal.compendium.ComponentsServlet;
-import org.apache.felix.webconsole.internal.core.InstallAction;
import org.apache.felix.webconsole.internal.core.SetStartLevelAction;
import org.apache.felix.webconsole.internal.misc.ConfigurationRender;
import org.apache.felix.webconsole.internal.obr.BundleRepositoryRender;
@@ -37,6 +35,7 @@
import org.jboss.osgi.service.webconsole.internal.plugins.BundlesPlugin;
import org.jboss.osgi.service.webconsole.internal.plugins.ConfigManagerPlugin;
import org.jboss.osgi.service.webconsole.internal.plugins.EventAdminPlugin;
+import org.jboss.osgi.service.webconsole.internal.plugins.InstallActionExt;
import org.jboss.osgi.service.webconsole.internal.plugins.LicensePlugin;
import org.jboss.osgi.service.webconsole.internal.plugins.LogServicePlugin;
import org.osgi.framework.BundleContext;
@@ -97,7 +96,7 @@
ConfigManagerPlugin.class.getName(),
LogServicePlugin.class.getName(),
BundlesPlugin.class.getName(),
- InstallAction.class.getName(),
+ InstallActionExt.class.getName(),
SetStartLevelAction.class.getName(),
// DepPackServlet.class.getName(),
EventAdminPlugin.class.getName(),
Added: projects/jboss-osgi/projects/bundles/webconsole/trunk/src/main/java/org/jboss/osgi/service/webconsole/internal/plugins/InstallActionExt.java
===================================================================
--- projects/jboss-osgi/projects/bundles/webconsole/trunk/src/main/java/org/jboss/osgi/service/webconsole/internal/plugins/InstallActionExt.java (rev 0)
+++ projects/jboss-osgi/projects/bundles/webconsole/trunk/src/main/java/org/jboss/osgi/service/webconsole/internal/plugins/InstallActionExt.java 2009-07-06 12:58:03 UTC (rev 90841)
@@ -0,0 +1,107 @@
+/*
+ * 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.service.webconsole.internal.plugins;
+
+//$Id: EventAdminPlugin.java 86577 2009-04-01 07:53:06Z thomas.diesler(a)jboss.com $
+
+import java.io.File;
+import java.io.InputStream;
+import java.net.MalformedURLException;
+import java.net.URL;
+
+import org.apache.felix.webconsole.internal.core.InstallAction;
+import org.jboss.osgi.spi.service.BundleInfo;
+import org.jboss.osgi.spi.service.DeployerService;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.BundleException;
+import org.osgi.framework.ServiceReference;
+import org.osgi.service.log.LogService;
+import org.osgi.service.startlevel.StartLevel;
+
+/**
+ * A Console plugin
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 06-Jul-2009
+ */
+public class InstallActionExt extends InstallAction
+{
+ @Override
+ protected void installBackground(final File bundleFile, final String location, final int startlevel, final boolean doStart, boolean refreshPackages)
+ {
+ final BundleContext context = getBundleContext();
+ final ServiceReference sref = context.getServiceReference(DeployerService.class.getName());
+ if (sref == null)
+ {
+ getLog().log(LogService.LOG_WARNING, "Cannot obtain server: " + DeployerService.class.getName());
+ super.installBackground(bundleFile, location, startlevel, doStart, refreshPackages);
+ return;
+ }
+
+ Thread t = new InstallHelper(this, "Background Install " + bundleFile, bundleFile, refreshPackages)
+ {
+ protected Bundle doRun(InputStream bundleStream) throws BundleException
+ {
+ DeployerService service = (DeployerService)context.getService(sref);
+ URL bundleURL = getBundleURL(bundleFile);
+
+ service.deploy(bundleURL);
+ BundleInfo info = service.getBundleInfo(bundleURL);
+ Bundle bundle = service.getBundle(info);
+
+ if (startlevel > 0)
+ {
+ StartLevel sl = getStartLevel();
+ if (sl != null)
+ {
+ sl.setBundleStartLevel(bundle, startlevel);
+ }
+ }
+
+ if (doStart)
+ {
+ bundle.start();
+ }
+
+ return bundle;
+ }
+
+ };
+
+ t.start();
+ }
+
+ private URL getBundleURL(final File bundleFile) throws BundleException
+ {
+ URL bundleURL;
+ try
+ {
+ bundleURL = bundleFile.toURL();
+ }
+ catch (MalformedURLException ex)
+ {
+ throw new BundleException(ex.getMessage());
+ }
+ return bundleURL;
+ }
+}
\ No newline at end of file
Modified: projects/jboss-osgi/projects/integration/jbossas/trunk/src/main/java/org/jboss/osgi/integration/jbossas/AbstractMicrocontainerService.java
===================================================================
--- projects/jboss-osgi/projects/integration/jbossas/trunk/src/main/java/org/jboss/osgi/integration/jbossas/AbstractMicrocontainerService.java 2009-07-06 12:56:35 UTC (rev 90840)
+++ projects/jboss-osgi/projects/integration/jbossas/trunk/src/main/java/org/jboss/osgi/integration/jbossas/AbstractMicrocontainerService.java 2009-07-06 12:58:03 UTC (rev 90841)
@@ -25,12 +25,16 @@
import static org.jboss.osgi.spi.management.MicrocontainerServiceMBean.MBEAN_MICROCONTAINER_SERVICE;
+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 java.util.jar.Attributes;
+import java.util.jar.JarFile;
+import java.util.jar.Manifest;
import javax.management.MBeanServer;
import javax.management.StandardMBean;
@@ -55,7 +59,10 @@
import org.jboss.osgi.spi.service.MicrocontainerService;
import org.jboss.virtual.VFS;
import org.jboss.virtual.VirtualFile;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
import org.osgi.framework.BundleException;
+import org.osgi.framework.Constants;
/**
* An OSGi Service the gives access to the Kernel.
@@ -105,6 +112,52 @@
return (T)getRegisteredBean(beanName);
}
+ public BundleInfo getBundleInfo(URL url) throws BundleException
+ {
+ Manifest manifest;
+ try
+ {
+ JarFile jarFile = new JarFile(url.getPath());
+ manifest = jarFile.getManifest();
+ jarFile.close();
+ }
+ catch (IOException ex)
+ {
+ throw new BundleException("Cannot get manifest from: " + url);
+
+ }
+
+ Attributes attribs = manifest.getMainAttributes();
+ String symbolicName = attribs.getValue(Constants.BUNDLE_SYMBOLICNAME);
+ if (symbolicName == null)
+ throw new BundleException("Cannot obtain Bundle-SymbolicName for: " + url);
+
+ String version = attribs.getValue(Constants.BUNDLE_VERSION);
+ return new BundleInfoImpl(url, symbolicName, version);
+ }
+
+ public Bundle getBundle(BundleInfo info) throws BundleException
+ {
+ BundleContext context = getRegisteredBean(BundleContext.class, BEAN_SYSTEM_BUNDLE_CONTEXT);
+ String symbolicName = info.getSymbolicName();
+ String version = info.getVersion();
+
+ Bundle bundle = null;
+ for (Bundle aux : context.getBundles())
+ {
+ if (aux.getSymbolicName().equals(symbolicName))
+ {
+ String auxVersion = (String)aux.getHeaders().get(Constants.BUNDLE_VERSION);
+ if (version == null || version.equals(auxVersion))
+ {
+ bundle = aux;
+ break;
+ }
+ }
+ }
+ return bundle;
+ }
+
public void deploy(URL url) throws BundleException
{
deployInternal(new URL[] { url });
@@ -267,4 +320,35 @@
super(name, actions, null, target);
}
}
+
+ static class BundleInfoImpl implements BundleInfo
+ {
+ private URL location;
+ private String symbolicName;
+ private String version;
+
+ public BundleInfoImpl(URL location, String symbolicName, String version)
+ {
+ super();
+ this.location = location;
+ this.symbolicName = symbolicName;
+ this.version = version;
+ }
+
+ public URL getLocation()
+ {
+ return location;
+ }
+
+ public String getSymbolicName()
+ {
+ return symbolicName;
+ }
+
+ public String getVersion()
+ {
+ return version;
+ }
+
+ }
}
\ No newline at end of file
Modified: projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/service/DeploymentScannerService.java
===================================================================
--- projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/service/DeploymentScannerService.java 2009-07-06 12:56:35 UTC (rev 90840)
+++ projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/service/DeploymentScannerService.java 2009-07-06 12:58:03 UTC (rev 90841)
@@ -74,7 +74,7 @@
/**
* Returns the array of bundles currently known to the deployemtn scanner.
*/
- BundleInfo[] getBundles();
+ BundleInfo[] getBundleInfos();
/**
* Add a scan listener to this service
16 years, 11 months
JBoss-OSGI SVN: r90840 - in projects/jboss-osgi/trunk: testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi108 and 1 other directory.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-07-06 08:56:35 -0400 (Mon, 06 Jul 2009)
New Revision: 90840
Modified:
projects/jboss-osgi/trunk/pom.xml
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi108/OSGI108TestCase.java
Log:
[JBOSGI-66] Support bundle deployment through web console
Modified: projects/jboss-osgi/trunk/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/pom.xml 2009-07-06 12:47:39 UTC (rev 90839)
+++ projects/jboss-osgi/trunk/pom.xml 2009-07-06 12:56:35 UTC (rev 90840)
@@ -18,7 +18,6 @@
<!-- Modules -->
<modules>
- <module>spi</module>
<module>husky</module>
<module>blueprint</module>
<module>testsuite</module>
@@ -34,15 +33,14 @@
<version.apache.felix.metatype>1.0.2</version.apache.felix.metatype>
<version.izpack>4.3.1</version.izpack>
<version.javax.servlet>2.4</version.javax.servlet>
- <version.jboss.deployers>2.0.5.GA</version.jboss.deployers>
<version.jboss.jdocbook.plugin>2.1.2</version.jboss.jdocbook.plugin>
<version.jboss.jdocbook.style>1.1.0</version.jboss.jdocbook.style>
<version.jboss.jbossas>5.0.1.GA</version.jboss.jbossas>
<version.jboss.logging>2.0.5.GA</version.jboss.logging>
- <version.jboss.microcontainer>2.0.4.GA</version.jboss.microcontainer>
+ <version.jboss.microcontainer>2.0.5.GA</version.jboss.microcontainer>
<version.jboss.naming>5.0.1.GA</version.jboss.naming>
<version.jboss.osgi.apache.xerces>2.9.1</version.jboss.osgi.apache.xerces>
- <version.jboss.osgi.common>1.0.0.Beta2</version.jboss.osgi.common>
+ <version.jboss.osgi.common>1.0.0-SNAPSHOT</version.jboss.osgi.common>
<version.jboss.osgi.common.core>2.2.11</version.jboss.osgi.common.core>
<version.jboss.osgi.deployers>1.0.0.Beta2</version.jboss.osgi.deployers>
<version.jboss.osgi.hotdeploy>1.0.0-SNAPSHOT</version.jboss.osgi.hotdeploy>
@@ -112,16 +110,6 @@
<version>${version.izpack}</version>
</dependency>
<dependency>
- <groupId>org.jboss.deployers</groupId>
- <artifactId>jboss-deployers-client-spi</artifactId>
- <version>${version.jboss.deployers}</version>
- </dependency>
- <dependency>
- <groupId>org.jboss.deployers</groupId>
- <artifactId>jboss-deployers-vfs</artifactId>
- <version>${version.jboss.deployers}</version>
- </dependency>
- <dependency>
<groupId>org.jboss.jbossas</groupId>
<artifactId>jboss-as-client</artifactId>
<version>${version.jboss.jbossas}</version>
@@ -143,11 +131,6 @@
<version>${version.jboss.microcontainer}</version>
</dependency>
<dependency>
- <groupId>org.jboss.microcontainer</groupId>
- <artifactId>jboss-kernel</artifactId>
- <version>${version.jboss.microcontainer}</version>
- </dependency>
- <dependency>
<groupId>org.jboss.naming</groupId>
<artifactId>jnpserver</artifactId>
<version>${version.jboss.naming}</version>
Modified: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi108/OSGI108TestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi108/OSGI108TestCase.java 2009-07-06 12:47:39 UTC (rev 90839)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi108/OSGI108TestCase.java 2009-07-06 12:56:35 UTC (rev 90840)
@@ -166,12 +166,10 @@
private List<String> report(List<String> messages)
{
- System.out.println(">>>>>>>>>>>>");
- for (String aux : messages)
- {
- System.out.println(aux);
- }
- System.out.println("<<<<<<<<<<<");
+ // System.out.println(">>>>>>>>>>>>");
+ // for (String aux : messages)
+ // System.out.println(aux);
+ // System.out.println("<<<<<<<<<<<");
return messages;
}
16 years, 11 months
JBoss-OSGI SVN: r90834 - projects/jboss-osgi/projects/spi/trunk.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-07-06 08:16:00 -0400 (Mon, 06 Jul 2009)
New Revision: 90834
Modified:
projects/jboss-osgi/projects/spi/trunk/pom.xml
Log:
Extract SPI to projects
Modified: projects/jboss-osgi/projects/spi/trunk/pom.xml
===================================================================
--- projects/jboss-osgi/projects/spi/trunk/pom.xml 2009-07-06 11:58:51 UTC (rev 90833)
+++ projects/jboss-osgi/projects/spi/trunk/pom.xml 2009-07-06 12:16:00 UTC (rev 90834)
@@ -13,10 +13,20 @@
<!-- Parent -->
<parent>
<groupId>org.jboss.osgi</groupId>
- <artifactId>jboss-osgi</artifactId>
- <version>1.0.0.Beta3</version>
+ <artifactId>jboss-osgi-parent</artifactId>
+ <version>1.0.1-SNAPSHOT</version>
</parent>
+ <!-- Properties -->
+ <properties>
+ <version.args4j>2.0.12</version.args4j>
+ <version.jboss.deployers>2.0.5.SP1</version.jboss.deployers>
+ <version.jboss.logging>2.0.5.GA</version.jboss.logging>
+ <version.jboss.microcontainer>2.0.5.GA</version.jboss.microcontainer>
+ <version.junit>4.6</version.junit>
+ <version.osgi>r4v41</version.osgi>
+ </properties>
+
<!-- Dependencies -->
<dependencies>
@@ -24,39 +34,47 @@
<dependency>
<groupId>args4j</groupId>
<artifactId>args4j</artifactId>
+ <version>${version.args4j}</version>
</dependency>
<dependency>
<groupId>org.jboss.logging</groupId>
<artifactId>jboss-logging-spi</artifactId>
+ <version>${version.jboss.logging}</version>
</dependency>
<dependency>
<groupId>org.jboss.deployers</groupId>
<artifactId>jboss-deployers-vfs</artifactId>
+ <version>${version.jboss.deployers}</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
+ <version>${version.junit}</version>
</dependency>
<!-- Provided Dependencies -->
<dependency>
<groupId>org.osgi</groupId>
<artifactId>org.osgi.core</artifactId>
+ <version>${version.osgi}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.osgi</groupId>
<artifactId>org.osgi.compendium</artifactId>
+ <version>${version.osgi}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.jboss.deployers</groupId>
<artifactId>jboss-deployers-client-spi</artifactId>
+ <version>${version.jboss.deployers}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.jboss.microcontainer</groupId>
<artifactId>jboss-kernel</artifactId>
+ <version>${version.jboss.microcontainer}</version>
<scope>provided</scope>
</dependency>
</dependencies>
@@ -83,4 +101,27 @@
</plugins>
</build>
+ <!-- Repositories -->
+ <repositories>
+ <repository>
+ <id>repository.jboss.org</id>
+ <name>JBoss Repository</name>
+ <url>http://repository.jboss.org/maven2/</url>
+ <snapshots>
+ <enabled>false</enabled>
+ </snapshots>
+ </repository>
+ <repository>
+ <id>snapshots.jboss.org</id>
+ <name>JBoss Snapshots Repository</name>
+ <url>http://snapshots.jboss.org/maven2/</url>
+ <releases>
+ <enabled>false</enabled>
+ </releases>
+ <snapshots>
+ <enabled>true</enabled>
+ </snapshots>
+ </repository>
+ </repositories>
+
</project>
16 years, 11 months