JBoss-OSGI SVN: r95024 - in projects/jboss-osgi/projects: bundles/common/trunk/src/main/java/org/jboss/osgi/common/internal and 7 other directories.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-10-16 06:37:53 -0400 (Fri, 16 Oct 2009)
New Revision: 95024
Removed:
projects/jboss-osgi/projects/bundles/common/trunk/src/main/java/org/jboss/osgi/common/internal/AbstractCommonServicesActivator.java
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/DeploymentRegistryServiceImpl.java
projects/jboss-osgi/projects/bundles/common/trunk/src/main/java/org/jboss/osgi/common/internal/SystemDeployerService.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/CommonServicesActivator.java
projects/jboss-osgi/projects/spi/trunk/pom.xml
projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/framework/BundleContextWrapper.java
projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/framework/BundleWrapper.java
projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/framework/FrameworkIntegration.java
projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/framework/FrameworkWrapper.java
projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/framework/OSGiBootstrap.java
projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/framework/PropertiesBootstrapProvider.java
projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/logging/ExportedPackageHelper.java
projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/management/ManagedFramework.java
projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/testing/OSGiTest.java
projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/testing/internal/OSGiRuntimeImpl.java
projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/testing/internal/RemoteBundle.java
projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/util/ServiceLoader.java
Log:
[JBOSGI-183] Initial implementation of OSGi Deployers
Move deployment stuff from common to deployement project
Modified: projects/jboss-osgi/projects/bundles/common/trunk/pom.xml
===================================================================
--- projects/jboss-osgi/projects/bundles/common/trunk/pom.xml 2009-10-16 10:01:33 UTC (rev 95023)
+++ projects/jboss-osgi/projects/bundles/common/trunk/pom.xml 2009-10-16 10:37:53 UTC (rev 95024)
@@ -97,15 +97,11 @@
</Export-Package>
<Import-Package>
javax.management,
- org.apache.log4j;version="1.2";resolution:=optional,
- org.jboss.osgi.spi.management;version="1.0",
- org.jboss.osgi.spi.logging;version="1.0",
- org.jboss.osgi.spi.service;version="1.0",
- org.jboss.osgi.spi.util;version="1.0",
+ org.apache.log4j;version=1.2;resolution:=optional,
+ org.jboss.osgi.spi.logging;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.service.packageadmin;version=1.2,
- org.osgi.service.startlevel;version=1.1,
org.osgi.util.tracker
</Import-Package>
<Embed-Dependency>
Deleted: projects/jboss-osgi/projects/bundles/common/trunk/src/main/java/org/jboss/osgi/common/internal/AbstractCommonServicesActivator.java
===================================================================
--- projects/jboss-osgi/projects/bundles/common/trunk/src/main/java/org/jboss/osgi/common/internal/AbstractCommonServicesActivator.java 2009-10-16 10:01:33 UTC (rev 95023)
+++ projects/jboss-osgi/projects/bundles/common/trunk/src/main/java/org/jboss/osgi/common/internal/AbstractCommonServicesActivator.java 2009-10-16 10:37:53 UTC (rev 95024)
@@ -1,111 +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.common.internal;
-
-//$Id$
-
-import java.util.Properties;
-
-import javax.management.JMException;
-import javax.management.MBeanServer;
-import javax.management.StandardMBean;
-
-import org.jboss.osgi.spi.service.DeployerService;
-import org.jboss.osgi.spi.service.DeploymentRegistryService;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.Constants;
-import org.osgi.framework.ServiceReference;
-import org.osgi.service.log.LogReaderService;
-import org.osgi.util.tracker.ServiceTracker;
-
-
-/**
- * The common services activator
- *
- * @author thomas.diesler(a)jboss.com
- * @since 23-Jan-2009
- */
-public abstract class AbstractCommonServicesActivator
-{
- protected ServiceTracker trackLogReaderService(BundleContext context)
- {
- ServiceTracker logTracker = new ServiceTracker(context, LogReaderService.class.getName(), null)
- {
- @Override
- public Object addingService(ServiceReference reference)
- {
- LogReaderService logReader = (LogReaderService)super.addingService(reference);
- logReader.addLogListener(new LogListenerBridge());
- return logReader;
- }
- };
- return logTracker;
- }
-
- protected DeployerService registerDeployerServices(BundleContext context)
- {
- // Register the DeploymentRegistryService
- DeploymentRegistryService registry = new DeploymentRegistryServiceImpl(context);
- context.registerService(DeploymentRegistryService.class.getName(), registry, null);
-
- // Register the SystemDeployerService
- Properties props = new Properties();
- props.put("provider", "system");
- SystemDeployerService systemDeployer = new SystemDeployerService(context);
- context.registerService(DeployerService.class.getName(), systemDeployer, props);
-
- // Register the DeployerServiceDelegate
- props = new Properties();
- props.put(Constants.SERVICE_RANKING, Integer.MAX_VALUE);
- DeployerService deployerDelegate = new DeployerServiceDelegate(context);
- context.registerService(DeployerService.class.getName(), deployerDelegate, props);
- return deployerDelegate;
- }
-
- protected void registerDeployerServiceMBean(MBeanServer mbeanServer, DeployerService delegate)
- {
- try
- {
- StandardMBean mbean = new StandardMBean(delegate, DeployerService.class);
- mbeanServer.registerMBean(mbean, DeployerService.MBEAN_DEPLOYER_SERVICE);
- }
- catch (JMException ex)
- {
- throw new IllegalStateException("Cannot register DeployerService MBean", ex);
- }
- }
-
- protected void unregisterDeployerServiceMBean(MBeanServer mbeanServer)
- {
- try
- {
- if (mbeanServer.isRegistered(DeployerService.MBEAN_DEPLOYER_SERVICE))
- mbeanServer.unregisterMBean(DeployerService.MBEAN_DEPLOYER_SERVICE);
- }
- catch (JMException ex)
- {
- logError("Cannot unregister DeployerService MBean", ex);
- }
- }
-
- protected abstract void logError(String message, Exception ex);
-}
\ No newline at end of file
Modified: projects/jboss-osgi/projects/bundles/common/trunk/src/main/java/org/jboss/osgi/common/internal/CommonServicesActivator.java
===================================================================
--- projects/jboss-osgi/projects/bundles/common/trunk/src/main/java/org/jboss/osgi/common/internal/CommonServicesActivator.java 2009-10-16 10:01:33 UTC (rev 95023)
+++ projects/jboss-osgi/projects/bundles/common/trunk/src/main/java/org/jboss/osgi/common/internal/CommonServicesActivator.java 2009-10-16 10:37:53 UTC (rev 95024)
@@ -24,14 +24,11 @@
//$Id$
-import javax.management.MBeanServer;
-
import org.jboss.osgi.common.log.LogServiceTracker;
-import org.jboss.osgi.spi.service.DeployerService;
import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceReference;
-import org.osgi.service.log.LogService;
+import org.osgi.service.log.LogReaderService;
import org.osgi.util.tracker.ServiceTracker;
/**
@@ -40,17 +37,11 @@
* @author thomas.diesler(a)jboss.com
* @since 23-Jan-2009
*/
-public class CommonServicesActivator extends AbstractCommonServicesActivator implements BundleActivator
+public class CommonServicesActivator implements BundleActivator
{
private LogServiceTracker logServiceTracker;
private ServiceTracker logReaderTracker;
- @Override
- protected void logError(String message, Exception ex)
- {
- logServiceTracker.log(LogService.LOG_ERROR, message, ex);
- }
-
public void start(BundleContext context)
{
logServiceTracker = new LogServiceTracker(context);
@@ -58,12 +49,6 @@
// Track LogReaderService and add/remove LogListener
logReaderTracker = trackLogReaderService(context);
logReaderTracker.open();
-
- // Register the system SystemDeployerService and DeployerServiceDelegate
- DeployerService deployer = registerDeployerServices(context);
-
- // Track the MBeanServer and register the DeployerServiceDelegate
- trackMBeanServer(context, deployer);
}
public void stop(BundleContext context)
@@ -73,35 +58,20 @@
if (logReaderTracker != null)
logReaderTracker.close();
-
- ServiceReference sref = context.getServiceReference(MBeanServer.class.getName());
- if (sref != null)
- {
- MBeanServer mbeanServer = (MBeanServer)context.getService(sref);
- unregisterDeployerServiceMBean(mbeanServer);
- }
}
-
- private void trackMBeanServer(BundleContext context, final DeployerService deployer)
+
+ private ServiceTracker trackLogReaderService(BundleContext context)
{
- ServiceTracker jmxTracker = new ServiceTracker(context, MBeanServer.class.getName(), null)
+ ServiceTracker logTracker = new ServiceTracker(context, LogReaderService.class.getName(), null)
{
@Override
public Object addingService(ServiceReference reference)
{
- MBeanServer mbeanServer = (MBeanServer)super.addingService(reference);
- registerDeployerServiceMBean(mbeanServer, deployer);
- return mbeanServer;
+ LogReaderService logReader = (LogReaderService)super.addingService(reference);
+ logReader.addLogListener(new LogListenerBridge());
+ return logReader;
}
-
- @Override
- public void removedService(ServiceReference reference, Object service)
- {
- MBeanServer mbeanServer = (MBeanServer)service;
- unregisterDeployerServiceMBean(mbeanServer);
- super.removedService(reference, service);
- }
};
- jmxTracker.open();
+ return logTracker;
}
}
\ No newline at end of file
Deleted: 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-10-16 10:01:33 UTC (rev 95023)
+++ projects/jboss-osgi/projects/bundles/common/trunk/src/main/java/org/jboss/osgi/common/internal/DeployerServiceDelegate.java 2009-10-16 10:37:53 UTC (rev 95024)
@@ -1,137 +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.common.internal;
-
-//$Id$
-
-import java.net.URL;
-
-import org.jboss.osgi.spi.service.DeployerService;
-import org.jboss.osgi.spi.util.BundleDeployment;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.BundleException;
-import org.osgi.framework.InvalidSyntaxException;
-import org.osgi.framework.ServiceReference;
-
-/**
- * A {@link DeployerService} that delegates to the service that is tracked by the given {@link DeployerServiceTracker}
- *
- * This delegate is registered as an MBean
- *
- * @author thomas.diesler(a)jboss.com
- * @since 27-May-2009
- */
-public class DeployerServiceDelegate implements DeployerService
-{
- private BundleContext context;
-
- public DeployerServiceDelegate(BundleContext context)
- {
- this.context = context;
- }
-
- public void deploy(BundleDeployment[] bundles) throws BundleException
- {
- DeployerService service = getDefaultDeployerService();
- service.deploy(bundles);
- }
-
- public void deploy(URL url) throws BundleException
- {
- DeployerService service = getDefaultDeployerService();
- service.deploy(url);
- }
-
- public void undeploy(BundleDeployment[] bundles) throws BundleException
- {
- for (BundleDeployment info : bundles)
- undeploy(info.getLocation());
- }
-
- public boolean undeploy(URL url) throws BundleException
- {
- boolean undeployed = false;
-
- DeployerService service = getMicrocontainerDeployerService();
- if (service != null)
- undeployed = service.undeploy(url);
-
- if (undeployed == false)
- {
- service = getSystemDeployerService();
- undeployed = service.undeploy(url);
- }
-
- return undeployed;
- }
-
- private DeployerService getDefaultDeployerService()
- {
- // First try the MC provider
- DeployerService service = getMicrocontainerDeployerService();
-
- // Fall back to the system provider
- if (service == null)
- service = getSystemDeployerService();
-
- return service;
- }
-
- private DeployerService getMicrocontainerDeployerService()
- {
- DeployerService service = null;
- try
- {
- String filter = "(provider=microcontainer)";
- String serviceName = DeployerService.class.getName();
- ServiceReference[] srefs = context.getServiceReferences(serviceName, filter);
- if (srefs != null)
- service = (DeployerService)context.getService(srefs[0]);
- }
- catch (InvalidSyntaxException ex)
- {
- throw new IllegalArgumentException(ex);
- }
- return service;
- }
-
- private DeployerService getSystemDeployerService()
- {
- DeployerService service = null;
- try
- {
- String filter = "(provider=system)";
- String serviceName = DeployerService.class.getName();
- ServiceReference[] srefs = context.getServiceReferences(serviceName, filter);
- if (srefs != null)
- service = (DeployerService)context.getService(srefs[0]);
- }
- catch (InvalidSyntaxException ex)
- {
- throw new IllegalArgumentException(ex);
- }
-
- if (service == null)
- throw new IllegalStateException("Cannot obtain system DeployerService");
- return service;
- }
-}
\ No newline at end of file
Deleted: projects/jboss-osgi/projects/bundles/common/trunk/src/main/java/org/jboss/osgi/common/internal/DeploymentRegistryServiceImpl.java
===================================================================
--- projects/jboss-osgi/projects/bundles/common/trunk/src/main/java/org/jboss/osgi/common/internal/DeploymentRegistryServiceImpl.java 2009-10-16 10:01:33 UTC (rev 95023)
+++ projects/jboss-osgi/projects/bundles/common/trunk/src/main/java/org/jboss/osgi/common/internal/DeploymentRegistryServiceImpl.java 2009-10-16 10:37:53 UTC (rev 95024)
@@ -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.common.internal;
-
-//$Id: SystemDeployerService.java 90894 2009-07-07 11:58:40Z thomas.diesler(a)jboss.com $
-
-import java.net.URL;
-import java.util.HashSet;
-import java.util.Set;
-
-import org.jboss.osgi.spi.service.DeployerService;
-import org.jboss.osgi.spi.service.DeploymentRegistryService;
-import org.jboss.osgi.spi.util.BundleDeployment;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.Version;
-
-/**
- * A {@link DeployerService} that installs/uninstalls the bundles directly on the OSGi framework without going through the MC registered deployers.
- *
- * @author thomas.diesler(a)jboss.com
- * @since 27-May-2009
- */
-public class DeploymentRegistryServiceImpl implements DeploymentRegistryService
-{
- private Set<BundleDeployment> deployments = new HashSet<BundleDeployment>();
-
- public DeploymentRegistryServiceImpl(BundleContext context)
- {
- }
-
- public void registerBundleDeployment(BundleDeployment dep)
- {
- deployments.add(dep);
- }
-
- public void unregisterBundleDeployment(BundleDeployment dep)
- {
- deployments.remove(dep);
- }
-
- public BundleDeployment getBundleDeployment(String symbolicName, Version version)
- {
- if (symbolicName == null)
- throw new IllegalArgumentException("Cannot obtain bundle deployment for null symbolic name");
-
- BundleDeployment dep = null;
- for (BundleDeployment auxDep : deployments)
- {
- String auxName = auxDep.getSymbolicName();
- String auxVersion = auxDep.getVersion();
- if (symbolicName.equals(auxName) && version.equals(auxVersion))
- {
- dep = auxDep;
- break;
- }
- }
-
- return dep;
- }
-
- public BundleDeployment getBundleDeployment(URL url)
- {
- if (url == null)
- throw new IllegalArgumentException("Cannot obtain bundle deployment for: null");
-
- BundleDeployment dep = null;
- for (BundleDeployment auxDep : deployments)
- {
- if (url.equals(auxDep.getLocation()))
- {
- dep = auxDep;
- break;
- }
- }
-
- return dep;
- }
-}
\ No newline at end of file
Deleted: 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-10-16 10:01:33 UTC (rev 95023)
+++ projects/jboss-osgi/projects/bundles/common/trunk/src/main/java/org/jboss/osgi/common/internal/SystemDeployerService.java 2009-10-16 10:37:53 UTC (rev 95024)
@@ -1,260 +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.common.internal;
-
-//$Id$
-
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Map.Entry;
-
-import org.jboss.osgi.common.log.LogServiceTracker;
-import org.jboss.osgi.spi.logging.ExportedPackageHelper;
-import org.jboss.osgi.spi.management.ManagedBundleService;
-import org.jboss.osgi.spi.service.DeployerService;
-import org.jboss.osgi.spi.service.DeploymentRegistryService;
-import org.jboss.osgi.spi.util.BundleDeployment;
-import org.jboss.osgi.spi.util.BundleDeploymentFactory;
-import org.osgi.framework.Bundle;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.BundleException;
-import org.osgi.framework.ServiceReference;
-import org.osgi.framework.Version;
-import org.osgi.service.log.LogService;
-import org.osgi.service.packageadmin.PackageAdmin;
-import org.osgi.service.startlevel.StartLevel;
-import org.osgi.util.tracker.ServiceTracker;
-
-/**
- * A {@link DeployerService} that installs/uninstalls the bundles directly on the OSGi framework without going through the MC registered deployers.
- *
- * @author thomas.diesler(a)jboss.com
- * @since 27-May-2009
- */
-public class SystemDeployerService implements DeployerService
-{
- private LogServiceTracker log;
- private BundleContext context;
- private ServiceTracker registryTracker;
- private ServiceTracker startLevelTracker;
-
- public SystemDeployerService(BundleContext context)
- {
- this.log = new LogServiceTracker(context);
- this.context = context;
- }
-
- public void deploy(BundleDeployment[] depArr) throws BundleException
- {
- DeploymentRegistryService registry = getDeploymentRegistry();
-
- List<Bundle> resolvableBundles = new ArrayList<Bundle>();
- Map<BundleDeployment, Bundle> bundleMap = new HashMap<BundleDeployment, Bundle>();
-
- for (BundleDeployment dep : depArr)
- {
- try
- {
- String location = dep.getLocation().toExternalForm();
- Bundle bundle = context.installBundle(location);
- log.log(LogService.LOG_INFO, "Installed: " + bundle);
-
- registerManagedBundle(bundle);
-
- bundleMap.put(dep, bundle);
- if (dep.isAutoStart())
- resolvableBundles.add(bundle);
-
- registry.registerBundleDeployment(dep);
- }
- catch (BundleException ex)
- {
- log.log(LogService.LOG_ERROR, "Cannot install bundle: " + dep, ex);
- }
- }
-
- // Resolve the installed bundles through the PackageAdmin
- ServiceReference packageAdminRef = context.getServiceReference(PackageAdmin.class.getName());
- if (packageAdminRef != null && resolvableBundles.isEmpty() == false)
- {
- PackageAdmin packageAdmin = (PackageAdmin)context.getService(packageAdminRef);
- Bundle[] resolvableBundleArr = new Bundle[resolvableBundles.size()];
- resolvableBundles.toArray(resolvableBundleArr);
- packageAdmin.resolveBundles(resolvableBundleArr);
- }
-
- // Start the installed bundles
- for (Entry<BundleDeployment, Bundle> entry : bundleMap.entrySet())
- {
- BundleDeployment dep = entry.getKey();
- Bundle bundle = entry.getValue();
-
- StartLevel startLevel = getStartLevel();
- if (dep.getStartLevel() > 0)
- {
- startLevel.setBundleStartLevel(bundle, dep.getStartLevel());
- }
-
- if (dep.isAutoStart())
- {
- int state = bundle.getState();
- if (state == Bundle.RESOLVED || packageAdminRef == null)
- {
- try
- {
- log.log(LogService.LOG_DEBUG, "Start: " + bundle);
-
- // Added support for Bundle.START_ACTIVATION_POLICY on start
- // http://issues.apache.org/jira/browse/FELIX-1317
- // bundle.start(Bundle.START_ACTIVATION_POLICY);
-
- bundle.start();
-
- log.log(LogService.LOG_INFO, "Started: " + bundle);
- ExportedPackageHelper packageHelper = new ExportedPackageHelper(context);
- packageHelper.logExportedPackages(bundle);
- }
- catch (BundleException ex)
- {
- log.log(LogService.LOG_ERROR, "Cannot start bundle: " + bundle, ex);
- }
- }
- }
- }
- }
-
- public void undeploy(BundleDeployment[] depArr) throws BundleException
- {
- DeploymentRegistryService registry = getDeploymentRegistry();
-
- for (BundleDeployment dep : depArr)
- {
- Bundle bundle = getBundle(dep);
- if (bundle != null)
- {
- registry.unregisterBundleDeployment(dep);
-
- unregisterManagedBundle(bundle);
- bundle.uninstall();
- log.log(LogService.LOG_INFO, "Uninstalled: " + bundle);
- }
- else
- {
- log.log(LogService.LOG_WARNING, "Cannot obtain bundle for: " + dep);
- }
- }
- }
-
- public void deploy(URL url) throws BundleException
- {
- BundleDeployment dep = BundleDeploymentFactory.createBundleDeployment(url);
- deploy(new BundleDeployment[] { dep });
- }
-
- public boolean undeploy(URL url) throws BundleException
- {
- DeploymentRegistryService registry = getDeploymentRegistry();
- BundleDeployment dep = registry.getBundleDeployment(url);
- if (dep != null)
- {
- undeploy(new BundleDeployment[] { dep });
- return true;
- }
- else
- {
- log.log(LogService.LOG_WARNING, "Cannot find deployment for: " + url);
- return false;
- }
- }
-
- private Bundle getBundle(BundleDeployment dep)
- {
- String symbolicName = dep.getSymbolicName();
- Version version = Version.parseVersion(dep.getVersion());
-
- Bundle bundle = null;
- for (Bundle aux : context.getBundles())
- {
- if (aux.getSymbolicName().equals(symbolicName))
- {
- Version auxVersion = aux.getVersion();
- if (version.equals(auxVersion))
- {
- bundle = aux;
- break;
- }
- }
- }
- return bundle;
- }
-
- private void registerManagedBundle(Bundle bundle)
- {
- ServiceReference sref = context.getServiceReference(ManagedBundleService.class.getName());
- if (sref != null)
- {
- ManagedBundleService service = (ManagedBundleService)context.getService(sref);
- service.register(bundle);
- }
- else
- {
- log.log(LogService.LOG_DEBUG, "No ManagedBundleService. Cannot register managed bundle: " + bundle);
- }
- }
-
- private void unregisterManagedBundle(Bundle bundle)
- {
- ServiceReference sref = context.getServiceReference(ManagedBundleService.class.getName());
- if (sref != null)
- {
- ManagedBundleService service = (ManagedBundleService)context.getService(sref);
- service.unregister(bundle);
- }
- else
- {
- log.log(LogService.LOG_DEBUG, "No ManagedBundleService. Cannot unregister managed bundle: " + bundle);
- }
- }
-
- private DeploymentRegistryService getDeploymentRegistry()
- {
- if (registryTracker == null)
- {
- registryTracker = new ServiceTracker(context, DeploymentRegistryService.class.getName(), null);
- registryTracker.open();
- }
- return (DeploymentRegistryService)registryTracker.getService();
- }
-
- private StartLevel getStartLevel()
- {
- if (startLevelTracker == null)
- {
- startLevelTracker = new ServiceTracker(context, StartLevel.class.getName(), null);
- startLevelTracker.open();
- }
- return (StartLevel)startLevelTracker.getService();
- }
-}
\ No newline at end of file
Modified: projects/jboss-osgi/projects/spi/trunk/pom.xml
===================================================================
--- projects/jboss-osgi/projects/spi/trunk/pom.xml 2009-10-16 10:01:33 UTC (rev 95023)
+++ projects/jboss-osgi/projects/spi/trunk/pom.xml 2009-10-16 10:37:53 UTC (rev 95024)
@@ -39,8 +39,8 @@
<!-- Properties -->
<properties>
<version.args4j>2.0.12</version.args4j>
- <version.jboss.logging>2.0.5.GA</version.jboss.logging>
<version.jboss.vfs>2.1.3.SP1</version.jboss.vfs>
+ <version.slf4j>1.5.8</version.slf4j>
<version.osgi>r4v42</version.osgi>
</properties>
@@ -54,16 +54,16 @@
<version>${version.args4j}</version>
</dependency>
<dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ <version>${version.slf4j}</version>
+ </dependency>
+ <dependency>
<groupId>org.jboss</groupId>
<artifactId>jboss-vfs</artifactId>
<version>${version.jboss.vfs}</version>
</dependency>
<dependency>
- <groupId>org.jboss.logging</groupId>
- <artifactId>jboss-logging-spi</artifactId>
- <version>${version.jboss.logging}</version>
- </dependency>
- <dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${version.junit}</version>
Modified: projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/framework/BundleContextWrapper.java
===================================================================
--- projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/framework/BundleContextWrapper.java 2009-10-16 10:01:33 UTC (rev 95023)
+++ projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/framework/BundleContextWrapper.java 2009-10-16 10:37:53 UTC (rev 95024)
@@ -27,7 +27,6 @@
import java.io.InputStream;
import java.util.Dictionary;
-import org.jboss.logging.Logger;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
import org.osgi.framework.BundleException;
@@ -38,6 +37,8 @@
import org.osgi.framework.ServiceListener;
import org.osgi.framework.ServiceReference;
import org.osgi.framework.ServiceRegistration;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/**
* A generic BundleContext wrapper that delegates all method calls to the underlying
@@ -49,7 +50,7 @@
public class BundleContextWrapper implements BundleContext
{
// Provide logging
- final Logger log = Logger.getLogger(BundleContextWrapper.class);
+ final Logger log = LoggerFactory.getLogger(BundleContextWrapper.class);
protected BundleContext context;
Modified: projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/framework/BundleWrapper.java
===================================================================
--- projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/framework/BundleWrapper.java 2009-10-16 10:01:33 UTC (rev 95023)
+++ projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/framework/BundleWrapper.java 2009-10-16 10:37:53 UTC (rev 95024)
@@ -30,12 +30,13 @@
import java.util.Enumeration;
import java.util.Map;
-import org.jboss.logging.Logger;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
import org.osgi.framework.BundleException;
import org.osgi.framework.ServiceReference;
import org.osgi.framework.Version;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/**
* A generic Bundle wrapper that delegates all method calls to the underlying
@@ -47,7 +48,7 @@
public class BundleWrapper implements Bundle
{
// Provide logging
- final Logger log = Logger.getLogger(BundleWrapper.class);
+ final Logger log = LoggerFactory.getLogger(BundleWrapper.class);
protected Bundle bundle;
Modified: projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/framework/FrameworkIntegration.java
===================================================================
--- projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/framework/FrameworkIntegration.java 2009-10-16 10:01:33 UTC (rev 95023)
+++ projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/framework/FrameworkIntegration.java 2009-10-16 10:37:53 UTC (rev 95024)
@@ -29,13 +29,14 @@
import java.util.List;
import java.util.Map;
-import org.jboss.logging.Logger;
import org.jboss.osgi.spi.FrameworkException;
import org.jboss.osgi.spi.logging.ExportedPackageHelper;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
import org.osgi.framework.BundleException;
import org.osgi.framework.launch.Framework;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/**
* An abstraction of an OSGi Framework.
@@ -49,7 +50,7 @@
public abstract class FrameworkIntegration
{
// Provide logging
- final Logger log = Logger.getLogger(FrameworkIntegration.class);
+ final Logger log = LoggerFactory.getLogger(FrameworkIntegration.class);
private Map<String, Object> properties = new HashMap<String, Object>();
private List<URL> autoInstall = new ArrayList<URL>();
Modified: projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/framework/FrameworkWrapper.java
===================================================================
--- projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/framework/FrameworkWrapper.java 2009-10-16 10:01:33 UTC (rev 95023)
+++ projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/framework/FrameworkWrapper.java 2009-10-16 10:37:53 UTC (rev 95024)
@@ -30,13 +30,14 @@
import java.util.Enumeration;
import java.util.Map;
-import org.jboss.logging.Logger;
import org.osgi.framework.BundleContext;
import org.osgi.framework.BundleException;
import org.osgi.framework.FrameworkEvent;
import org.osgi.framework.ServiceReference;
import org.osgi.framework.Version;
import org.osgi.framework.launch.Framework;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/**
* A generic Framework wrapper that delegates all method calls to the underlying
@@ -48,7 +49,7 @@
public class FrameworkWrapper implements Framework
{
// Provide logging
- final Logger log = Logger.getLogger(FrameworkWrapper.class);
+ final Logger log = LoggerFactory.getLogger(FrameworkWrapper.class);
protected Framework framework;
Modified: projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/framework/OSGiBootstrap.java
===================================================================
--- projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/framework/OSGiBootstrap.java 2009-10-16 10:01:33 UTC (rev 95023)
+++ projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/framework/OSGiBootstrap.java 2009-10-16 10:37:53 UTC (rev 95024)
@@ -37,13 +37,14 @@
import java.util.List;
import java.util.Properties;
-import org.jboss.logging.Logger;
import org.jboss.osgi.spi.util.ServiceLoader;
import org.kohsuke.args4j.CmdLineException;
import org.kohsuke.args4j.CmdLineParser;
import org.kohsuke.args4j.Option;
import org.osgi.framework.BundleException;
import org.osgi.framework.launch.Framework;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/**
* The OSGiBootstrap provides an {@link OSGiFramework} through a {@link OSGiBootstrapProvider}.
@@ -129,7 +130,7 @@
// This property must be set before the logger is obtained
System.setProperty(OSGI_SERVER_HOME, osgiServerHome);
- log = Logger.getLogger(OSGiBootstrap.class);
+ log = LoggerFactory.getLogger(OSGiBootstrap.class);
Properties defaults = new Properties();
defaults.setProperty(OSGI_SERVER_NAME, serverName);
@@ -172,7 +173,7 @@
}
catch (Exception ex)
{
- Logger tmplog = Logger.getLogger(OSGiBootstrap.class);
+ Logger tmplog = LoggerFactory.getLogger(OSGiBootstrap.class);
tmplog.debug("Cannot configure [" + aux.getClass().getName() + "]", ex);
}
}
Modified: projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/framework/PropertiesBootstrapProvider.java
===================================================================
--- projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/framework/PropertiesBootstrapProvider.java 2009-10-16 10:01:33 UTC (rev 95023)
+++ projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/framework/PropertiesBootstrapProvider.java 2009-10-16 10:37:53 UTC (rev 95024)
@@ -38,7 +38,6 @@
import java.util.Properties;
import java.util.Set;
-import org.jboss.logging.Logger;
import org.jboss.osgi.spi.FrameworkException;
import org.jboss.osgi.spi.NotImplementedException;
import org.jboss.osgi.spi.internal.StringPropertyReplacer;
@@ -52,6 +51,8 @@
import org.osgi.framework.Version;
import org.osgi.framework.launch.Framework;
import org.osgi.framework.launch.FrameworkFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/**
* A simple properties based bootstrap provider
@@ -69,7 +70,6 @@
* # Properties to configure the Framework
* org.osgi.framework.storage.clean=onFirstInit
* org.osgi.framework.system.packages=\
- * org.jboss.logging, \
* org.osgi.framework; version=1.4, \
* javax.management
*
@@ -92,7 +92,7 @@
public class PropertiesBootstrapProvider implements OSGiBootstrapProvider
{
// Provide logging
- final Logger log = Logger.getLogger(PropertiesBootstrapProvider.class);
+ final Logger log = LoggerFactory.getLogger(PropertiesBootstrapProvider.class);
/** The default framework property: jboss.osgi.framework.properties */
public static final String OSGI_FRAMEWORK_CONFIG = "jboss.osgi.framework.properties";
Modified: projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/logging/ExportedPackageHelper.java
===================================================================
--- projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/logging/ExportedPackageHelper.java 2009-10-16 10:01:33 UTC (rev 95023)
+++ projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/logging/ExportedPackageHelper.java 2009-10-16 10:37:53 UTC (rev 95024)
@@ -27,12 +27,13 @@
import java.util.Collections;
import java.util.List;
-import org.jboss.logging.Logger;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceReference;
import org.osgi.service.packageadmin.ExportedPackage;
import org.osgi.service.packageadmin.PackageAdmin;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/**
* A helper the logs the exported packages for a bundle.
@@ -43,7 +44,7 @@
public final class ExportedPackageHelper
{
// Provide logging
- final Logger log = Logger.getLogger(ExportedPackageHelper.class);
+ final Logger log = LoggerFactory.getLogger(ExportedPackageHelper.class);
private PackageAdmin packageAdmin;
Modified: projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/management/ManagedFramework.java
===================================================================
--- projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/management/ManagedFramework.java 2009-10-16 10:01:33 UTC (rev 95023)
+++ projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/management/ManagedFramework.java 2009-10-16 10:37:53 UTC (rev 95024)
@@ -36,13 +36,14 @@
import javax.management.ObjectName;
import javax.management.QueryExp;
-import org.jboss.logging.Logger;
import org.jboss.osgi.spi.OSGiConstants;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
import org.osgi.framework.InvalidSyntaxException;
import org.osgi.framework.ServiceReference;
import org.osgi.service.packageadmin.PackageAdmin;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/**
* The managed view of an OSGi Framework
@@ -53,7 +54,7 @@
public class ManagedFramework implements ManagedFrameworkMBean
{
// Provide logging
- final Logger log = Logger.getLogger(ManagedFramework.class);
+ final Logger log = LoggerFactory.getLogger(ManagedFramework.class);
private MBeanServer mbeanServer;
private BundleContext bundleContext;
Modified: projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/testing/OSGiTest.java
===================================================================
--- projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/testing/OSGiTest.java 2009-10-16 10:01:33 UTC (rev 95023)
+++ projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/testing/OSGiTest.java 2009-10-16 10:37:53 UTC (rev 95024)
@@ -27,10 +27,11 @@
import javax.naming.InitialContext;
import javax.naming.NamingException;
-import org.jboss.logging.Logger;
import org.jboss.virtual.VFS;
import org.junit.After;
import org.junit.Before;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/**
* An abstract OSGi Test.
@@ -44,7 +45,7 @@
public abstract class OSGiTest
{
// Provide logging
- final Logger log = Logger.getLogger(OSGiTest.class);
+ final Logger log = LoggerFactory.getLogger(OSGiTest.class);
private OSGiTestHelper helper;
Modified: projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/testing/internal/OSGiRuntimeImpl.java
===================================================================
--- projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/testing/internal/OSGiRuntimeImpl.java 2009-10-16 10:01:33 UTC (rev 95023)
+++ projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/testing/internal/OSGiRuntimeImpl.java 2009-10-16 10:37:53 UTC (rev 95024)
@@ -40,7 +40,6 @@
import javax.naming.InitialContext;
import javax.naming.NamingException;
-import org.jboss.logging.Logger;
import org.jboss.osgi.spi.capability.Capability;
import org.jboss.osgi.spi.testing.OSGiBundle;
import org.jboss.osgi.spi.testing.OSGiRuntime;
@@ -50,6 +49,8 @@
import org.osgi.framework.BundleException;
import org.osgi.framework.Constants;
import org.osgi.framework.Version;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/**
* An abstract implementation of the {@link OSGiRuntime}
@@ -60,7 +61,7 @@
public abstract class OSGiRuntimeImpl implements OSGiRuntime
{
// Provide logging
- final Logger log = Logger.getLogger(OSGiRuntimeImpl.class);
+ final Logger log = LoggerFactory.getLogger(OSGiRuntimeImpl.class);
private OSGiTestHelper helper;
private Map<String, OSGiBundle> bundles = new LinkedHashMap<String, OSGiBundle>();
Modified: projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/testing/internal/RemoteBundle.java
===================================================================
--- projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/testing/internal/RemoteBundle.java 2009-10-16 10:01:33 UTC (rev 95023)
+++ projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/testing/internal/RemoteBundle.java 2009-10-16 10:37:53 UTC (rev 95024)
@@ -21,15 +21,18 @@
*/
package org.jboss.osgi.spi.testing.internal;
+// $Id$
+
import java.util.Dictionary;
-import org.jboss.logging.Logger;
import org.jboss.osgi.spi.management.ManagedBundleMBean;
import org.jboss.osgi.spi.testing.OSGiBundle;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleException;
import org.osgi.framework.Constants;
import org.osgi.framework.Version;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/**
* An implementation of a remote {@link OSGiBundle}
@@ -40,7 +43,7 @@
public class RemoteBundle extends OSGiBundle
{
// Provide logging
- private static final Logger log = Logger.getLogger(RemoteBundle.class);
+ private final Logger log = LoggerFactory.getLogger(RemoteBundle.class);
private OSGiRuntimeImpl runtime;
private ManagedBundleMBean bundle;
Modified: projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/util/ServiceLoader.java
===================================================================
--- projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/util/ServiceLoader.java 2009-10-16 10:01:33 UTC (rev 95023)
+++ projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/util/ServiceLoader.java 2009-10-16 10:37:53 UTC (rev 95024)
@@ -28,7 +28,8 @@
import java.util.ArrayList;
import java.util.List;
-import org.jboss.logging.Logger;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/**
* Loads service implementations from the requesters classpath.
@@ -39,7 +40,7 @@
public abstract class ServiceLoader
{
// Provide logging
- final static Logger log = Logger.getLogger(ServiceLoader.class);
+ static final Logger log = LoggerFactory.getLogger(ServiceLoader.class);
/**
* Loads a list of service implementations defined in META-INF/services/${serviceClass}
16 years, 9 months
JBoss-OSGI SVN: r95022 - in projects/jboss-osgi/projects/runtime/felix/trunk: src/main/java/org/jboss/osgi/felix and 1 other directory.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-10-16 05:45:03 -0400 (Fri, 16 Oct 2009)
New Revision: 95022
Modified:
projects/jboss-osgi/projects/runtime/felix/trunk/pom.xml
projects/jboss-osgi/projects/runtime/felix/trunk/src/main/java/org/jboss/osgi/felix/FelixBundleContextWrapper.java
Log:
Extract deployment related API to jboss-osgi-deployment
Modified: projects/jboss-osgi/projects/runtime/felix/trunk/pom.xml
===================================================================
--- projects/jboss-osgi/projects/runtime/felix/trunk/pom.xml 2009-10-16 09:44:03 UTC (rev 95021)
+++ projects/jboss-osgi/projects/runtime/felix/trunk/pom.xml 2009-10-16 09:45:03 UTC (rev 95022)
@@ -38,12 +38,18 @@
<properties>
<version.felix.framework>2.0.0</version.felix.framework>
+ <version.jboss.osgi.deployment>1.0.0-SNAPSHOT</version.jboss.osgi.deployment>
<version.jboss.osgi.spi>1.0.3-SNAPSHOT</version.jboss.osgi.spi>
</properties>
<!-- Dependencies -->
<dependencies>
<dependency>
+ <groupId>org.jboss.osgi.bundles</groupId>
+ <artifactId>jboss-osgi-deployment</artifactId>
+ <version>${version.jboss.osgi.deployment}</version>
+ </dependency>
+ <dependency>
<groupId>org.jboss.osgi</groupId>
<artifactId>jboss-osgi-spi</artifactId>
<version>${version.jboss.osgi.spi}</version>
Modified: projects/jboss-osgi/projects/runtime/felix/trunk/src/main/java/org/jboss/osgi/felix/FelixBundleContextWrapper.java
===================================================================
--- projects/jboss-osgi/projects/runtime/felix/trunk/src/main/java/org/jboss/osgi/felix/FelixBundleContextWrapper.java 2009-10-16 09:44:03 UTC (rev 95021)
+++ projects/jboss-osgi/projects/runtime/felix/trunk/src/main/java/org/jboss/osgi/felix/FelixBundleContextWrapper.java 2009-10-16 09:45:03 UTC (rev 95022)
@@ -26,10 +26,10 @@
import java.net.URL;
import org.jboss.logging.Logger;
+import org.jboss.osgi.deployment.BundleDeployment;
+import org.jboss.osgi.deployment.BundleDeploymentFactory;
+import org.jboss.osgi.deployment.DeployerService;
import org.jboss.osgi.spi.framework.BundleContextWrapper;
-import org.jboss.osgi.spi.service.DeployerService;
-import org.jboss.osgi.spi.util.BundleDeployment;
-import org.jboss.osgi.spi.util.BundleDeploymentFactory;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
import org.osgi.framework.BundleException;
16 years, 9 months
JBoss-OSGI SVN: r95021 - in projects/jboss-osgi/projects/bundles: hotdeploy/trunk/src/main/java/org/jboss/osgi/hotdeploy/internal and 3 other directories.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-10-16 05:44:03 -0400 (Fri, 16 Oct 2009)
New Revision: 95021
Modified:
projects/jboss-osgi/projects/bundles/hotdeploy/trunk/pom.xml
projects/jboss-osgi/projects/bundles/hotdeploy/trunk/src/main/java/org/jboss/osgi/hotdeploy/internal/DeploymentScannerActivator.java
projects/jboss-osgi/projects/bundles/hotdeploy/trunk/src/main/java/org/jboss/osgi/hotdeploy/internal/DeploymentScannerImpl.java
projects/jboss-osgi/projects/bundles/hotdeploy/trunk/src/main/java/org/jboss/osgi/hotdeploy/internal/ScannerThread.java
projects/jboss-osgi/projects/bundles/microcontainer/trunk/pom.xml
projects/jboss-osgi/projects/bundles/microcontainer/trunk/src/main/java/org/jboss/osgi/microcontainer/integration/AbstractMicrocontainerService.java
projects/jboss-osgi/projects/bundles/microcontainer/trunk/src/main/java/org/jboss/osgi/microcontainer/internal/MicrocontainerServiceImpl.java
Log:
Extract deployment related API to jboss-osgi-deployment
Modified: projects/jboss-osgi/projects/bundles/hotdeploy/trunk/pom.xml
===================================================================
--- projects/jboss-osgi/projects/bundles/hotdeploy/trunk/pom.xml 2009-10-16 09:37:48 UTC (rev 95020)
+++ projects/jboss-osgi/projects/bundles/hotdeploy/trunk/pom.xml 2009-10-16 09:44:03 UTC (rev 95021)
@@ -40,6 +40,7 @@
<!-- Properties -->
<properties>
<version.jboss.osgi.common>1.0.3-SNAPSHOT</version.jboss.osgi.common>
+ <version.jboss.osgi.deployment>1.0.0-SNAPSHOT</version.jboss.osgi.deployment>
<version.jboss.osgi.spi>1.0.3-SNAPSHOT</version.jboss.osgi.spi>
<version.osgi>r4v42</version.osgi>
</properties>
@@ -59,6 +60,12 @@
<version>${version.jboss.osgi.common}</version>
<scope>provided</scope>
</dependency>
+ <dependency>
+ <groupId>org.jboss.osgi.bundles</groupId>
+ <artifactId>jboss-osgi-deployment</artifactId>
+ <version>${version.jboss.osgi.deployment}</version>
+ <scope>provided</scope>
+ </dependency>
<!-- OSGi Dependencies -->
<dependency>
@@ -89,6 +96,7 @@
<Import-Package>
javax.management,
org.jboss.osgi.common.log;version=1.0,
+ org.jboss.osgi.deployment;version=1.0,
org.jboss.osgi.spi.service;version=1.0,
org.jboss.osgi.spi.util;version=1.0,
org.osgi.framework,
Modified: projects/jboss-osgi/projects/bundles/hotdeploy/trunk/src/main/java/org/jboss/osgi/hotdeploy/internal/DeploymentScannerActivator.java
===================================================================
--- projects/jboss-osgi/projects/bundles/hotdeploy/trunk/src/main/java/org/jboss/osgi/hotdeploy/internal/DeploymentScannerActivator.java 2009-10-16 09:37:48 UTC (rev 95020)
+++ projects/jboss-osgi/projects/bundles/hotdeploy/trunk/src/main/java/org/jboss/osgi/hotdeploy/internal/DeploymentScannerActivator.java 2009-10-16 09:44:03 UTC (rev 95021)
@@ -23,7 +23,7 @@
//$Id$
-import org.jboss.osgi.spi.service.DeploymentScannerService;
+import org.jboss.osgi.deployment.DeploymentScannerService;
import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;
Modified: projects/jboss-osgi/projects/bundles/hotdeploy/trunk/src/main/java/org/jboss/osgi/hotdeploy/internal/DeploymentScannerImpl.java
===================================================================
--- projects/jboss-osgi/projects/bundles/hotdeploy/trunk/src/main/java/org/jboss/osgi/hotdeploy/internal/DeploymentScannerImpl.java 2009-10-16 09:37:48 UTC (rev 95020)
+++ projects/jboss-osgi/projects/bundles/hotdeploy/trunk/src/main/java/org/jboss/osgi/hotdeploy/internal/DeploymentScannerImpl.java 2009-10-16 09:44:03 UTC (rev 95021)
@@ -34,10 +34,10 @@
import java.util.List;
import java.util.Map;
-import org.jboss.osgi.spi.service.DeployerService;
-import org.jboss.osgi.spi.service.DeploymentScannerService;
-import org.jboss.osgi.spi.util.BundleDeployment;
-import org.jboss.osgi.spi.util.BundleDeploymentFactory;
+import org.jboss.osgi.deployment.BundleDeployment;
+import org.jboss.osgi.deployment.BundleDeploymentFactory;
+import org.jboss.osgi.deployment.DeployerService;
+import org.jboss.osgi.deployment.DeploymentScannerService;
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/hotdeploy/internal/ScannerThread.java
===================================================================
--- projects/jboss-osgi/projects/bundles/hotdeploy/trunk/src/main/java/org/jboss/osgi/hotdeploy/internal/ScannerThread.java 2009-10-16 09:37:48 UTC (rev 95020)
+++ projects/jboss-osgi/projects/bundles/hotdeploy/trunk/src/main/java/org/jboss/osgi/hotdeploy/internal/ScannerThread.java 2009-10-16 09:44:03 UTC (rev 95021)
@@ -24,7 +24,7 @@
//$Id$
import org.jboss.osgi.common.log.LogServiceTracker;
-import org.jboss.osgi.spi.service.DeploymentScannerService;
+import org.jboss.osgi.deployment.DeploymentScannerService;
import org.osgi.framework.BundleContext;
import org.osgi.service.log.LogService;
Modified: projects/jboss-osgi/projects/bundles/microcontainer/trunk/pom.xml
===================================================================
--- projects/jboss-osgi/projects/bundles/microcontainer/trunk/pom.xml 2009-10-16 09:37:48 UTC (rev 95020)
+++ projects/jboss-osgi/projects/bundles/microcontainer/trunk/pom.xml 2009-10-16 09:44:03 UTC (rev 95021)
@@ -35,6 +35,8 @@
<version.jboss.deployers>2.0.5.SP1</version.jboss.deployers>
<version.jboss.microcontainer>2.0.9.GA</version.jboss.microcontainer>
<version.jboss.osgi.runtime.deployers>1.0.2</version.jboss.osgi.runtime.deployers>
+ <version.jboss.osgi.deployment>1.0.0-SNAPSHOT</version.jboss.osgi.deployment>
+ <version.jboss.osgi.spi>1.0.3-SNAPSHOT</version.jboss.osgi.spi>
<version.jboss.osgi.xml.binding>2.0.1.SP1</version.jboss.osgi.xml.binding>
<version.osgi>r4v42</version.osgi>
</properties>
@@ -42,7 +44,17 @@
<!-- Dependencies -->
<dependencies>
<dependency>
+ <groupId>org.jboss.osgi</groupId>
+ <artifactId>jboss-osgi-spi</artifactId>
+ <version>${version.jboss.osgi.spi}</version>
+ </dependency>
+ <dependency>
<groupId>org.jboss.osgi.bundles</groupId>
+ <artifactId>jboss-osgi-deployment</artifactId>
+ <version>${version.jboss.osgi.deployment}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.osgi.bundles</groupId>
<artifactId>jboss-osgi-xml-binding</artifactId>
<version>${version.jboss.osgi.xml.binding}</version>
</dependency>
@@ -114,11 +126,12 @@
org.jboss.deployers.*,
org.jboss.joinpoint.*,
org.jboss.logging,
- org.jboss.osgi.common.log;version="1.0",
- org.jboss.osgi.jbossxb;version="2.0",
- org.jboss.osgi.spi;version="1.0",
- org.jboss.osgi.spi.management;version="1.0",
- org.jboss.osgi.spi.util;version="1.0",
+ org.jboss.osgi.common.log;version=1.0,
+ org.jboss.osgi.deployment;version=1.0,
+ org.jboss.osgi.jbossxb;version=2.0,
+ org.jboss.osgi.spi;version=1.0,
+ org.jboss.osgi.spi.management;version=1.0,
+ org.jboss.osgi.spi.util;version=1.0,
org.jboss.reflect.*,
org.jboss.util.*,
org.jboss.virtual*,
Modified: projects/jboss-osgi/projects/bundles/microcontainer/trunk/src/main/java/org/jboss/osgi/microcontainer/integration/AbstractMicrocontainerService.java
===================================================================
--- projects/jboss-osgi/projects/bundles/microcontainer/trunk/src/main/java/org/jboss/osgi/microcontainer/integration/AbstractMicrocontainerService.java 2009-10-16 09:37:48 UTC (rev 95020)
+++ projects/jboss-osgi/projects/bundles/microcontainer/trunk/src/main/java/org/jboss/osgi/microcontainer/integration/AbstractMicrocontainerService.java 2009-10-16 09:44:03 UTC (rev 95021)
@@ -48,13 +48,13 @@
import org.jboss.kernel.Kernel;
import org.jboss.kernel.spi.dependency.KernelController;
import org.jboss.kernel.spi.dependency.KernelControllerContext;
+import org.jboss.osgi.deployment.BundleDeployment;
+import org.jboss.osgi.deployment.BundleDeploymentFactory;
+import org.jboss.osgi.deployment.DeployerService;
+import org.jboss.osgi.deployment.DeploymentRegistryService;
import org.jboss.osgi.spi.OSGiConstants;
import org.jboss.osgi.spi.management.MicrocontainerServiceMBean;
-import org.jboss.osgi.spi.service.DeployerService;
-import org.jboss.osgi.spi.service.DeploymentRegistryService;
import org.jboss.osgi.spi.service.MicrocontainerService;
-import org.jboss.osgi.spi.util.BundleDeployment;
-import org.jboss.osgi.spi.util.BundleDeploymentFactory;
import org.jboss.virtual.VFS;
import org.jboss.virtual.VirtualFile;
import org.osgi.framework.BundleContext;
Modified: projects/jboss-osgi/projects/bundles/microcontainer/trunk/src/main/java/org/jboss/osgi/microcontainer/internal/MicrocontainerServiceImpl.java
===================================================================
--- projects/jboss-osgi/projects/bundles/microcontainer/trunk/src/main/java/org/jboss/osgi/microcontainer/internal/MicrocontainerServiceImpl.java 2009-10-16 09:37:48 UTC (rev 95020)
+++ projects/jboss-osgi/projects/bundles/microcontainer/trunk/src/main/java/org/jboss/osgi/microcontainer/internal/MicrocontainerServiceImpl.java 2009-10-16 09:44:03 UTC (rev 95021)
@@ -35,10 +35,10 @@
import org.jboss.kernel.Kernel;
import org.jboss.kernel.spi.dependency.KernelController;
import org.jboss.osgi.common.log.LogServiceTracker;
+import org.jboss.osgi.deployment.DeployerService;
import org.jboss.osgi.jbossxb.XMLBindingService;
import org.jboss.osgi.microcontainer.integration.AbstractMicrocontainerService;
import org.jboss.osgi.spi.management.MicrocontainerServiceMBean;
-import org.jboss.osgi.spi.service.DeployerService;
import org.jboss.osgi.spi.service.MicrocontainerService;
import org.jboss.virtual.VFS;
import org.osgi.framework.BundleContext;
16 years, 9 months
JBoss-OSGI SVN: r95020 - in projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi: testing/internal and 1 other directories.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-10-16 05:37:48 -0400 (Fri, 16 Oct 2009)
New Revision: 95020
Added:
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/service/DeployerService.java
projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/service/DeploymentRegistryService.java
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/util/BundleDeployment.java
projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/util/BundleDeploymentFactory.java
Modified:
projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/testing/internal/RemoteRuntime.java
Log:
Extract deployment related API to jboss-osgi-deployment
Deleted: 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-10-16 09:06:06 UTC (rev 95019)
+++ projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/service/DeployerService.java 2009-10-16 09:37:48 UTC (rev 95020)
@@ -1,75 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.osgi.spi.service;
-
-//$Id$
-
-import java.net.URL;
-
-import javax.management.ObjectName;
-
-import org.jboss.osgi.spi.management.ObjectNameFactory;
-import org.jboss.osgi.spi.util.BundleDeployment;
-import org.osgi.framework.BundleException;
-
-/**
- * A Service that can be used to deploy/undeploy bundles or archives to/from the runtime.
- *
- * @author thomas.diesler(a)jboss.com
- * @since 23-Jan-2009
- */
-public interface DeployerService
-{
- /**
- * The object name under which this is registered: 'jboss.osgi:service=DeployerService'
- */
- ObjectName MBEAN_DEPLOYER_SERVICE = ObjectNameFactory.create("jboss.osgi:service=DeployerService");
-
- /**
- * Deploy an array of bundles
- */
- void deploy(BundleDeployment[] bundleDeps) throws BundleException;
-
- /**
- * Undeploy an array of bundles
- */
- void undeploy(BundleDeployment[] bundleDeps) throws BundleException;
-
- /**
- * Deploy bundle from URL
- */
- void deploy(URL url) throws BundleException;
-
- /**
- * Undeploy bundle from URL.
- *
- * Note, due to the dynamic nature of OSGi services it is
- * possible that a {@link DeployerService} is asked to undeploy
- * a bundle URL which it did not deploy itself.
- *
- * In this case this method should return false, so that
- * another {@link DeployerService} can be tried.
- *
- * @return true if this service could undeploy the bundle
- */
- boolean undeploy(URL url) throws BundleException;
-}
\ No newline at end of file
Deleted: projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/service/DeploymentRegistryService.java
===================================================================
--- projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/service/DeploymentRegistryService.java 2009-10-16 09:06:06 UTC (rev 95019)
+++ projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/service/DeploymentRegistryService.java 2009-10-16 09:37:48 UTC (rev 95020)
@@ -1,60 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.osgi.spi.service;
-
-//$Id: DeployerService.java 90894 2009-07-07 11:58:40Z thomas.diesler(a)jboss.com $
-
-import java.net.URL;
-
-import org.jboss.osgi.spi.util.BundleDeployment;
-import org.osgi.framework.Version;
-
-/**
- * A Service to register/unregister bundle deployments.
- *
- * @author thomas.diesler(a)jboss.com
- * @since 08-Jul-2009
- */
-public interface DeploymentRegistryService
-{
- /**
- * Create a bundle deployment from the given bundle URL
- * @return null, if this service does not maintain the bundle deployment
- */
- BundleDeployment getBundleDeployment(URL url);
-
- /**
- * Get the bundle deployment for the given bundle symbolicName and version
- * @return null, if this service does not maintain the bundle deployment
- */
- BundleDeployment getBundleDeployment(String symbolicName, Version version);
-
- /**
- * Register a bundle deployment
- */
- void registerBundleDeployment(BundleDeployment dep);
-
- /**
- * Unregister a bundle deployment
- */
- void unregisterBundleDeployment(BundleDeployment dep);
-}
\ No newline at end of file
Deleted: 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-10-16 09:06:06 UTC (rev 95019)
+++ projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/service/DeploymentScannerService.java 2009-10-16 09:37:48 UTC (rev 95020)
@@ -1,80 +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;
-
-import org.jboss.osgi.spi.util.BundleDeployment;
-
-/**
- * A service that scans a directory location for new/removed bundles.
- *
- * @author thomas.diesler(a)jboss.com
- * @since 27-May-2009
- */
-public interface DeploymentScannerService
-{
- /**
- * The property that names the scan location: org.jboss.osgi.hotdeploy.scandir
- */
- String PROPERTY_SCAN_LOCATION = "org.jboss.osgi.hotdeploy.scandir";
-
- /**
- * The property to defines the scan interval: org.jboss.osgi.hotdeploy.interval
- */
- String PROPERTY_SCAN_INTERVAL = "org.jboss.osgi.hotdeploy.interval";
-
- /**
- * Get the scan location URL.
- *
- * This is can be specified by setting the {@link #PROPERTY_SCAN_LOCATION} property.
- */
- URL getScanLocation();
-
- /**
- * The number of scans since the service started
- */
- long getScanCount();
-
- /**
- * The number of milliseconds between scans
- * Defaults to 2000ms
- */
- long getScanInterval();
-
- /**
- * The timestamp of the last change
- */
- long getLastChange();
-
- /**
- * Run a directory scan
- */
- void scan();
-
- /**
- * Returns the array of bundles currently known to the deployemtn scanner.
- */
- BundleDeployment[] getBundleDeployments();
-}
\ No newline at end of file
Modified: projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/testing/internal/RemoteRuntime.java
===================================================================
--- projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/testing/internal/RemoteRuntime.java 2009-10-16 09:06:06 UTC (rev 95019)
+++ projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/testing/internal/RemoteRuntime.java 2009-10-16 09:37:48 UTC (rev 95020)
@@ -44,8 +44,7 @@
import org.jboss.osgi.spi.testing.OSGiRuntime;
import org.jboss.osgi.spi.testing.OSGiServiceReference;
import org.jboss.osgi.spi.testing.OSGiTestHelper;
-import org.jboss.osgi.spi.util.BundleDeployment;
-import org.jboss.osgi.spi.util.BundleDeploymentFactory;
+import org.jboss.osgi.spi.util.BundleInfo;
import org.osgi.framework.BundleException;
/**
@@ -69,12 +68,12 @@
try
{
URL bundleURL = getTestHelper().getTestArchiveURL(location);
- BundleDeployment bundleDep = BundleDeploymentFactory.createBundleDeployment(bundleURL);
+ BundleInfo bundleInfo = BundleInfo.createBundleInfo(bundleURL);
deployInternal(location, true);
- String symbolicName = bundleDep.getSymbolicName();
- String version = bundleDep.getVersion().toString();
+ String symbolicName = bundleInfo.getSymbolicName();
+ String version = bundleInfo.getVersion().toString();
ManagedBundleMBean bundleMBean = getRemoteFramework().getBundle(symbolicName, version);
RemoteBundle bundle = new RemoteBundle(this, bundleMBean, location);
return registerBundle(location, bundle);
@@ -125,7 +124,7 @@
try
{
URL archiveURL = getTestHelper().getTestArchiveURL(location);
- BundleDeploymentFactory.createBundleDeployment(archiveURL);
+ BundleInfo.createBundleInfo(archiveURL);
return true;
}
catch (BundleException ex)
Deleted: projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/util/BundleDeployment.java
===================================================================
--- projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/util/BundleDeployment.java 2009-10-16 09:06:06 UTC (rev 95019)
+++ projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/util/BundleDeployment.java 2009-10-16 09:37:48 UTC (rev 95020)
@@ -1,154 +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.util;
-
-import java.io.Serializable;
-import java.net.URL;
-
-//$Id$
-
-/**
- * An abstraction of a bundle deployment
- *
- * @author thomas.diesler(a)jboss.com
- * @since 27-May-2009
- */
-public class BundleDeployment implements Serializable
-{
- private static final long serialVersionUID = 1L;
-
- private URL location;
- private String symbolicName;
- private String version;
- private int startLevel;
- private boolean autoStart;
- private Object metadata;
-
- public BundleDeployment(URL location, String symbolicName, String version)
- {
- if (location == null)
- throw new IllegalArgumentException("Location cannot be null");
- if (symbolicName == null)
- throw new IllegalArgumentException("Symbolic name cannot be null");
-
- if (version == null)
- version = "0.0.0";
-
- this.symbolicName = symbolicName;
- this.location = location;
- this.version = version;
- }
-
- /**
- * 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;
- }
-
- /**
- * Get the start level associated with this deployment
- */
- public int getStartLevel()
- {
- return startLevel;
- }
-
- /**
- * Set the start level associated with this deployment
- */
- public void setStartLevel(int startLevel)
- {
- this.startLevel = startLevel;
- }
-
- /**
- * Get the autostart flag associated with this deployment
- */
- public boolean isAutoStart()
- {
- return autoStart;
- }
-
- /**
- * Set the autostart flag associated with this deployment
- */
- public void setAutoStart(boolean autoStart)
- {
- this.autoStart = autoStart;
- }
-
- /**
- * Get extra meta data associated with this deployment
- */
- public Object getMetadata()
- {
- return metadata;
- }
-
- /**
- * Set extra meta data associated with this deployment
- */
- public void setMetadata(Object metadata)
- {
- this.metadata = metadata;
- }
-
- @Override
- public boolean equals(Object obj)
- {
- if (!(obj instanceof BundleDeployment))
- return false;
-
- BundleDeployment other = (BundleDeployment)obj;
- return symbolicName.equals(other.symbolicName) && version.equals(other.version);
- }
-
- @Override
- public int hashCode()
- {
- return toString().hashCode();
- }
-
- @Override
- public String toString()
- {
- return "[" + symbolicName + "-" + version + ",url=" + location + "]";
- }
-}
\ No newline at end of file
Deleted: projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/util/BundleDeploymentFactory.java
===================================================================
--- projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/util/BundleDeploymentFactory.java 2009-10-16 09:06:06 UTC (rev 95019)
+++ projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/util/BundleDeploymentFactory.java 2009-10-16 09:37:48 UTC (rev 95020)
@@ -1,102 +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.util;
-
-//$Id: BundleDeployment.java 90925 2009-07-08 10:12:31Z thomas.diesler(a)jboss.com $
-
-import java.io.File;
-import java.io.IOException;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.util.jar.Attributes;
-import java.util.jar.JarFile;
-import java.util.jar.Manifest;
-
-import org.osgi.framework.BundleException;
-import org.osgi.framework.Constants;
-
-/**
- * A factory for bundle deployments.
- *
- * @author thomas.diesler(a)jboss.com
- * @since 08-Jul-2009
- */
-public abstract class BundleDeploymentFactory
-{
- public static BundleDeployment createBundleDeployment(String location) throws BundleException
- {
- // Try location as URL
- URL url = null;
- try
- {
- url = new URL(location);
- }
- catch (MalformedURLException ex)
- {
- // ignore
- }
-
- // Try location as File
- if (url == null)
- {
- try
- {
- File file = new File(location);
- if (file.exists())
- url = file.toURI().toURL();
- }
- catch (MalformedURLException e)
- {
- // ignore
- }
- }
-
- if (url == null)
- throw new IllegalArgumentException("Invalid bundle location: " + location);
-
- return createBundleDeployment(url);
- }
-
- public static BundleDeployment createBundleDeployment(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 BundleDeployment(url, symbolicName, version);
- }
-}
\ No newline at end of file
Added: projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/util/BundleInfo.java
===================================================================
--- projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/util/BundleInfo.java (rev 0)
+++ projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/util/BundleInfo.java 2009-10-16 09:37:48 UTC (rev 95020)
@@ -0,0 +1,160 @@
+/*
+ * 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.io.File;
+import java.io.IOException;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.jar.Attributes;
+import java.util.jar.JarFile;
+import java.util.jar.Manifest;
+
+import org.osgi.framework.BundleException;
+import org.osgi.framework.Constants;
+
+/**
+ * An abstraction of a bundle
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 16-Oct-2009
+ */
+public class BundleInfo
+{
+ private URL location;
+ private Manifest manifest;
+ private String symbolicName;
+ private String version;
+
+ public static BundleInfo createBundleInfo(String location) throws BundleException
+ {
+ // Try location as URL
+ URL url = null;
+ try
+ {
+ url = new URL(location);
+ }
+ catch (MalformedURLException ex)
+ {
+ // ignore
+ }
+
+ // Try location as File
+ if (url == null)
+ {
+ try
+ {
+ File file = new File(location);
+ if (file.exists())
+ url = file.toURI().toURL();
+ }
+ catch (MalformedURLException e)
+ {
+ // ignore
+ }
+ }
+
+ if (url == null)
+ throw new IllegalArgumentException("Invalid bundle location: " + location);
+
+ return createBundleInfo(url);
+ }
+
+ public static BundleInfo createBundleInfo(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);
+
+ }
+
+ return new BundleInfo(url, manifest);
+ }
+
+ private BundleInfo(URL location, Manifest manifest) throws BundleException
+ {
+ if (location == null)
+ throw new IllegalArgumentException("Location cannot be null");
+ if (manifest == null)
+ throw new IllegalArgumentException("Manifest cannot be null");
+
+ this.manifest = manifest;
+ this.location = location;
+
+ symbolicName = getManifestHeader(Constants.BUNDLE_SYMBOLICNAME);
+ if (symbolicName == null)
+ throw new BundleException("Cannot obtain Bundle-SymbolicName for: " + location);
+
+ version = getManifestHeader(Constants.BUNDLE_VERSION);
+ if (version == null)
+ version = "0.0.0";
+ }
+
+ /**
+ * Get the manifest header for the given key.
+ */
+ public String getManifestHeader(String key)
+ {
+ Attributes attribs = manifest.getMainAttributes();
+ String value = attribs.getValue(key);
+ return value;
+ }
+
+ /**
+ * 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 String toString()
+ {
+ return "[" + symbolicName + "-" + version + ",url=" + location + "]";
+ }
+}
\ No newline at end of file
Property changes on: projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/util/BundleInfo.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
16 years, 9 months
JBoss-OSGI SVN: r95019 - in projects/jboss-osgi: trunk/reactor/deployment/src/main/java/org/jboss/osgi and 2 other directories.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-10-16 05:06:06 -0400 (Fri, 16 Oct 2009)
New Revision: 95019
Added:
projects/jboss-osgi/trunk/reactor/deployment/src/main/java/org/jboss/osgi/deployment/
projects/jboss-osgi/trunk/reactor/deployment/src/main/java/org/jboss/osgi/deployment/Deployer.java
projects/jboss-osgi/trunk/reactor/deployment/src/main/java/org/jboss/osgi/deployment/DeployersCapability.java
projects/jboss-osgi/trunk/reactor/deployment/src/main/java/org/jboss/osgi/deployment/DeployersService.java
projects/jboss-osgi/trunk/reactor/deployment/src/main/java/org/jboss/osgi/deployment/Deployment.java
projects/jboss-osgi/trunk/reactor/deployment/src/main/java/org/jboss/osgi/deployment/internal/
projects/jboss-osgi/trunk/reactor/deployment/src/main/java/org/jboss/osgi/deployment/internal/DeployersActivator.java
Modified:
projects/jboss-osgi/projects/runtime/felix/trunk/src/main/java/org/jboss/osgi/felix/FelixBundleContextWrapper.java
Log:
[JBOSGI-183] Initial implementation of OSGi Deployers
Fix partial SVN commit
Modified: projects/jboss-osgi/projects/runtime/felix/trunk/src/main/java/org/jboss/osgi/felix/FelixBundleContextWrapper.java
===================================================================
--- projects/jboss-osgi/projects/runtime/felix/trunk/src/main/java/org/jboss/osgi/felix/FelixBundleContextWrapper.java 2009-10-16 08:58:54 UTC (rev 95018)
+++ projects/jboss-osgi/projects/runtime/felix/trunk/src/main/java/org/jboss/osgi/felix/FelixBundleContextWrapper.java 2009-10-16 09:06:06 UTC (rev 95019)
@@ -26,8 +26,8 @@
import java.net.URL;
import org.jboss.logging.Logger;
-import org.jboss.osgi.deployment.DeployerService;
import org.jboss.osgi.spi.framework.BundleContextWrapper;
+import org.jboss.osgi.spi.service.DeployerService;
import org.jboss.osgi.spi.util.BundleDeployment;
import org.jboss.osgi.spi.util.BundleDeploymentFactory;
import org.osgi.framework.Bundle;
Added: projects/jboss-osgi/trunk/reactor/deployment/src/main/java/org/jboss/osgi/deployment/Deployer.java
===================================================================
--- projects/jboss-osgi/trunk/reactor/deployment/src/main/java/org/jboss/osgi/deployment/Deployer.java (rev 0)
+++ projects/jboss-osgi/trunk/reactor/deployment/src/main/java/org/jboss/osgi/deployment/Deployer.java 2009-10-16 09:06:06 UTC (rev 95019)
@@ -0,0 +1,47 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.osgi.deployment;
+
+//$Id$
+
+
+/**
+ * An OSGi deployer
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 15-Oct-2009
+ */
+public interface Deployer
+{
+ enum Phase {
+ BEFORE_INSTALLED,
+ AFTER_INSTALLED,
+ BEFORE_RESOLVED,
+ AFTER_RESOLVED,
+ BEFORE_ACTIVE,
+ AFTER_ACTIVE
+ }
+
+ void deploy(Deployment dep);
+
+ void undeploy(Deployment dep);
+}
\ No newline at end of file
Property changes on: projects/jboss-osgi/trunk/reactor/deployment/src/main/java/org/jboss/osgi/deployment/Deployer.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: projects/jboss-osgi/trunk/reactor/deployment/src/main/java/org/jboss/osgi/deployment/DeployersCapability.java
===================================================================
--- projects/jboss-osgi/trunk/reactor/deployment/src/main/java/org/jboss/osgi/deployment/DeployersCapability.java (rev 0)
+++ projects/jboss-osgi/trunk/reactor/deployment/src/main/java/org/jboss/osgi/deployment/DeployersCapability.java 2009-10-16 09:06:06 UTC (rev 95019)
@@ -0,0 +1,48 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.osgi.deployment;
+
+//$Id$
+
+import org.jboss.osgi.spi.capability.Capability;
+import org.jboss.osgi.spi.testing.OSGiRuntime;
+
+/**
+ * Adds the Deployers capability to the {@link OSGiRuntime}
+ * under test.
+ *
+ * It is ignored if the {@link DeployersService} is already registered.
+ *
+ * Installed bundles: jboss-osgi-microcontainer.jar
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 05-May-2009
+ */
+public class DeployersCapability extends Capability
+{
+ public DeployersCapability()
+ {
+ super(DeployersService.class.getName());
+
+ addBundle("bundles/jboss-osgi-deployers.jar");
+ }
+}
\ No newline at end of file
Property changes on: projects/jboss-osgi/trunk/reactor/deployment/src/main/java/org/jboss/osgi/deployment/DeployersCapability.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: projects/jboss-osgi/trunk/reactor/deployment/src/main/java/org/jboss/osgi/deployment/DeployersService.java
===================================================================
--- projects/jboss-osgi/trunk/reactor/deployment/src/main/java/org/jboss/osgi/deployment/DeployersService.java (rev 0)
+++ projects/jboss-osgi/trunk/reactor/deployment/src/main/java/org/jboss/osgi/deployment/DeployersService.java 2009-10-16 09:06:06 UTC (rev 95019)
@@ -0,0 +1,40 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.osgi.deployment;
+
+//$Id$
+
+
+/**
+ * The deployers service
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 15-Oct-2009
+ */
+public interface DeployersService
+{
+ Deployment createDeployment(String location);
+
+ void addDeployer(Deployer deployer);
+
+ void removeDeployer(Deployer deployer);
+}
\ No newline at end of file
Property changes on: projects/jboss-osgi/trunk/reactor/deployment/src/main/java/org/jboss/osgi/deployment/DeployersService.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: projects/jboss-osgi/trunk/reactor/deployment/src/main/java/org/jboss/osgi/deployment/Deployment.java
===================================================================
--- projects/jboss-osgi/trunk/reactor/deployment/src/main/java/org/jboss/osgi/deployment/Deployment.java (rev 0)
+++ projects/jboss-osgi/trunk/reactor/deployment/src/main/java/org/jboss/osgi/deployment/Deployment.java 2009-10-16 09:06:06 UTC (rev 95019)
@@ -0,0 +1,39 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.osgi.deployment;
+
+//$Id$
+
+import org.jboss.virtual.VirtualFile;
+
+/**
+ * An OSGi deployment
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 15-Oct-2009
+ */
+public interface Deployment
+{
+ String getLocation();
+
+ VirtualFile getRoot();
+}
\ No newline at end of file
Property changes on: projects/jboss-osgi/trunk/reactor/deployment/src/main/java/org/jboss/osgi/deployment/Deployment.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: projects/jboss-osgi/trunk/reactor/deployment/src/main/java/org/jboss/osgi/deployment/internal/DeployersActivator.java
===================================================================
--- projects/jboss-osgi/trunk/reactor/deployment/src/main/java/org/jboss/osgi/deployment/internal/DeployersActivator.java (rev 0)
+++ projects/jboss-osgi/trunk/reactor/deployment/src/main/java/org/jboss/osgi/deployment/internal/DeployersActivator.java 2009-10-16 09:06:06 UTC (rev 95019)
@@ -0,0 +1,69 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.osgi.deployment.internal;
+
+//$Id$
+
+import org.jboss.osgi.deployment.Deployer;
+import org.jboss.osgi.deployment.DeployersService;
+import org.jboss.osgi.deployment.Deployment;
+import org.jboss.osgi.spi.NotImplementedException;
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+
+
+/**
+ * The deployers activator
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 15-Oct-2009
+ */
+public class DeployersActivator implements BundleActivator
+{
+ public void start(BundleContext context) throws Exception
+ {
+ DeployersService service = new DeployersService()
+ {
+ public void removeDeployer(Deployer deployer)
+ {
+ throw new NotImplementedException();
+ }
+
+ public Deployment createDeployment(String location)
+ {
+ throw new NotImplementedException();
+ }
+
+ public void addDeployer(Deployer deployer)
+ {
+ throw new NotImplementedException();
+ }
+ };
+ context.registerService(DeployersService.class.getName(), service, null);
+ }
+
+ public void stop(BundleContext context) throws Exception
+ {
+ // TODO Auto-generated method stub
+
+ }
+}
\ No newline at end of file
Property changes on: projects/jboss-osgi/trunk/reactor/deployment/src/main/java/org/jboss/osgi/deployment/internal/DeployersActivator.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
16 years, 9 months
JBoss-OSGI SVN: r95018 - projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/service/microcontainer.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-10-16 04:58:54 -0400 (Fri, 16 Oct 2009)
New Revision: 95018
Modified:
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/service/microcontainer/MicrocontainerServiceTestCase.java
Log:
Revert invalid svn commit
Modified: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/service/microcontainer/MicrocontainerServiceTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/service/microcontainer/MicrocontainerServiceTestCase.java 2009-10-16 08:57:19 UTC (rev 95017)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/service/microcontainer/MicrocontainerServiceTestCase.java 2009-10-16 08:58:54 UTC (rev 95018)
@@ -23,9 +23,9 @@
//$Id$
-import static org.jboss.osgi.deployment.DeployerService.MBEAN_DEPLOYER_SERVICE;
import static org.jboss.osgi.spi.management.ManagedFrameworkMBean.MBEAN_MANAGED_FRAMEWORK;
import static org.jboss.osgi.spi.management.MicrocontainerServiceMBean.MBEAN_MICROCONTAINER_SERVICE;
+import static org.jboss.osgi.spi.service.DeployerService.MBEAN_DEPLOYER_SERVICE;
import static org.jboss.test.osgi.service.microcontainer.bundleB.SomeBeanMBean.MBEAN_NAME;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
@@ -36,7 +36,6 @@
import javax.management.ObjectName;
-import org.jboss.osgi.deployment.DeployerService;
import org.jboss.osgi.jbossxb.XMLBindingCapability;
import org.jboss.osgi.jmx.JMXCapability;
import org.jboss.osgi.jndi.JNDICapability;
@@ -44,6 +43,7 @@
import org.jboss.osgi.spi.management.MBeanProxy;
import org.jboss.osgi.spi.management.ManagedFrameworkMBean;
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.testing.OSGiRuntime;
import org.jboss.osgi.spi.testing.OSGiTest;
16 years, 9 months
JBoss-OSGI SVN: r95017 - in projects/jboss-osgi: projects/runtime/felix/trunk/src/main/java/org/jboss/osgi/felix and 13 other directories.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-10-16 04:57:19 -0400 (Fri, 16 Oct 2009)
New Revision: 95017
Added:
projects/jboss-osgi/trunk/reactor/deployment/
projects/jboss-osgi/trunk/reactor/deployment/.classpath
projects/jboss-osgi/trunk/reactor/deployment/.project
projects/jboss-osgi/trunk/reactor/deployment/.settings/
projects/jboss-osgi/trunk/reactor/deployment/.settings/org.eclipse.jdt.core.prefs
projects/jboss-osgi/trunk/reactor/deployment/.settings/org.maven.ide.eclipse.prefs
projects/jboss-osgi/trunk/reactor/deployment/pom.xml
projects/jboss-osgi/trunk/reactor/deployment/src/
projects/jboss-osgi/trunk/reactor/deployment/src/main/
projects/jboss-osgi/trunk/reactor/deployment/src/main/java/
projects/jboss-osgi/trunk/reactor/deployment/src/main/java/org/
projects/jboss-osgi/trunk/reactor/deployment/src/main/java/org/jboss/
projects/jboss-osgi/trunk/reactor/deployment/src/main/java/org/jboss/osgi/
Modified:
projects/jboss-osgi/projects/bundles/hotdeploy/trunk/pom.xml
projects/jboss-osgi/projects/runtime/felix/trunk/src/main/java/org/jboss/osgi/felix/FelixBundleContextWrapper.java
projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/testing/internal/EmbeddedRuntime.java
projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/util/BundleDeploymentFactory.java
projects/jboss-osgi/trunk/distribution/docbook/en/modules/ch080-provided-examples.xml
projects/jboss-osgi/trunk/pom.xml
projects/jboss-osgi/trunk/reactor/pom.xml
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/service/microcontainer/MicrocontainerServiceTestCase.java
Log:
[JBOSGI-183] Initial implementation of OSGi Deployers
Add reactor project jboss-osgi-deployment
Modified: projects/jboss-osgi/projects/bundles/hotdeploy/trunk/pom.xml
===================================================================
--- projects/jboss-osgi/projects/bundles/hotdeploy/trunk/pom.xml 2009-10-16 08:47:46 UTC (rev 95016)
+++ projects/jboss-osgi/projects/bundles/hotdeploy/trunk/pom.xml 2009-10-16 08:57:19 UTC (rev 95017)
@@ -39,7 +39,7 @@
<!-- Properties -->
<properties>
- <version.jboss.osgi.common>1.0.2</version.jboss.osgi.common>
+ <version.jboss.osgi.common>1.0.3-SNAPSHOT</version.jboss.osgi.common>
<version.jboss.osgi.spi>1.0.3-SNAPSHOT</version.jboss.osgi.spi>
<version.osgi>r4v42</version.osgi>
</properties>
Modified: projects/jboss-osgi/projects/runtime/felix/trunk/src/main/java/org/jboss/osgi/felix/FelixBundleContextWrapper.java
===================================================================
--- projects/jboss-osgi/projects/runtime/felix/trunk/src/main/java/org/jboss/osgi/felix/FelixBundleContextWrapper.java 2009-10-16 08:47:46 UTC (rev 95016)
+++ projects/jboss-osgi/projects/runtime/felix/trunk/src/main/java/org/jboss/osgi/felix/FelixBundleContextWrapper.java 2009-10-16 08:57:19 UTC (rev 95017)
@@ -23,11 +23,18 @@
//$Id$
+import java.net.URL;
+
import org.jboss.logging.Logger;
+import org.jboss.osgi.deployment.DeployerService;
import org.jboss.osgi.spi.framework.BundleContextWrapper;
+import org.jboss.osgi.spi.util.BundleDeployment;
+import org.jboss.osgi.spi.util.BundleDeploymentFactory;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
import org.osgi.framework.BundleException;
+import org.osgi.framework.ServiceReference;
+import org.osgi.framework.Version;
/**
* The FelixBundleContextWrapper wrapps the BundleContext provided by the Felix implemenation.
@@ -50,7 +57,46 @@
@Override
public Bundle installBundle(String location) throws BundleException
{
- Bundle bundle = super.installBundle(location);
+ BundleDeployment dep = BundleDeploymentFactory.createBundleDeployment(location);
+ URL bundleURL = dep.getLocation();
+ String symbolicName = dep.getSymbolicName();
+ Version version = Version.parseVersion(dep.getVersion());
+
+ Bundle bundle;
+
+ ServiceReference sref = context.getServiceReference(DeployerService.class.getName());
+ if (sref != null)
+ {
+ DeployerService service = (DeployerService)context.getService(sref);
+ service.deploy(bundleURL);
+ bundle = getBundle(symbolicName, version, true);
+ }
+ else
+ {
+ bundle = context.installBundle(bundleURL.toExternalForm());
+ }
+
return bundle;
}
+
+ private Bundle getBundle(String symbolicName, Version version, boolean mustExist)
+ {
+ Bundle bundle = null;
+ for (Bundle aux : getBundles())
+ {
+ if (aux.getSymbolicName().equals(symbolicName))
+ {
+ if (version == null || version.equals(aux.getVersion()))
+ {
+ bundle = aux;
+ break;
+ }
+ }
+ }
+
+ if (bundle == null && mustExist == true)
+ throw new IllegalStateException("Cannot obtain bundle: " + symbolicName + "-" + version);
+
+ return bundle;
+ }
}
\ No newline at end of file
Modified: projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/testing/internal/EmbeddedRuntime.java
===================================================================
--- projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/testing/internal/EmbeddedRuntime.java 2009-10-16 08:47:46 UTC (rev 95016)
+++ projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/testing/internal/EmbeddedRuntime.java 2009-10-16 08:57:19 UTC (rev 95017)
@@ -23,7 +23,6 @@
// $Id$
-import java.net.URL;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
@@ -35,20 +34,16 @@
import org.jboss.osgi.spi.capability.Capability;
import org.jboss.osgi.spi.framework.OSGiBootstrapProvider;
-import org.jboss.osgi.spi.service.DeployerService;
import org.jboss.osgi.spi.testing.OSGiBundle;
import org.jboss.osgi.spi.testing.OSGiPackageAdmin;
import org.jboss.osgi.spi.testing.OSGiRuntime;
import org.jboss.osgi.spi.testing.OSGiServiceReference;
import org.jboss.osgi.spi.testing.OSGiTestHelper;
-import org.jboss.osgi.spi.util.BundleDeployment;
-import org.jboss.osgi.spi.util.BundleDeploymentFactory;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
import org.osgi.framework.BundleException;
import org.osgi.framework.InvalidSyntaxException;
import org.osgi.framework.ServiceReference;
-import org.osgi.framework.Version;
import org.osgi.framework.launch.Framework;
import org.osgi.service.packageadmin.PackageAdmin;
@@ -67,27 +62,12 @@
public OSGiBundle installBundle(String location) throws BundleException
{
- URL bundleURL = getTestHelper().getTestArchiveURL(location);
+ location = getTestHelper().getTestArchivePath(location);
- BundleDeployment bundleDep = BundleDeploymentFactory.createBundleDeployment(bundleURL);
- String symbolicName = bundleDep.getSymbolicName();
- Version version = Version.parseVersion(bundleDep.getVersion());
-
- OSGiBundle bundle;
-
BundleContext context = getBundleContext();
- ServiceReference sref = context.getServiceReference(DeployerService.class.getName());
- if (sref != null)
- {
- DeployerService service = (DeployerService)context.getService(sref);
- service.deploy(bundleURL);
- bundle = getBundle(symbolicName, version, true);
- }
- else
- {
- Bundle auxBundle = context.installBundle(bundleURL.toExternalForm());
- bundle = new EmbeddedBundle(this, auxBundle);
- }
+ Bundle auxBundle = context.installBundle(location);
+ OSGiBundle bundle = new EmbeddedBundle(this, auxBundle);
+
return registerBundle(location, bundle);
}
Modified: projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/util/BundleDeploymentFactory.java
===================================================================
--- projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/util/BundleDeploymentFactory.java 2009-10-16 08:47:46 UTC (rev 95016)
+++ projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/util/BundleDeploymentFactory.java 2009-10-16 08:57:19 UTC (rev 95017)
@@ -23,7 +23,9 @@
//$Id: BundleDeployment.java 90925 2009-07-08 10:12:31Z thomas.diesler(a)jboss.com $
+import java.io.File;
import java.io.IOException;
+import java.net.MalformedURLException;
import java.net.URL;
import java.util.jar.Attributes;
import java.util.jar.JarFile;
@@ -38,8 +40,42 @@
* @author thomas.diesler(a)jboss.com
* @since 08-Jul-2009
*/
-public abstract class BundleDeploymentFactory
+public abstract class BundleDeploymentFactory
{
+ public static BundleDeployment createBundleDeployment(String location) throws BundleException
+ {
+ // Try location as URL
+ URL url = null;
+ try
+ {
+ url = new URL(location);
+ }
+ catch (MalformedURLException ex)
+ {
+ // ignore
+ }
+
+ // Try location as File
+ if (url == null)
+ {
+ try
+ {
+ File file = new File(location);
+ if (file.exists())
+ url = file.toURI().toURL();
+ }
+ catch (MalformedURLException e)
+ {
+ // ignore
+ }
+ }
+
+ if (url == null)
+ throw new IllegalArgumentException("Invalid bundle location: " + location);
+
+ return createBundleDeployment(url);
+ }
+
public static BundleDeployment createBundleDeployment(URL url) throws BundleException
{
Manifest manifest;
Modified: projects/jboss-osgi/trunk/distribution/docbook/en/modules/ch080-provided-examples.xml
===================================================================
--- projects/jboss-osgi/trunk/distribution/docbook/en/modules/ch080-provided-examples.xml 2009-10-16 08:47:46 UTC (rev 95016)
+++ projects/jboss-osgi/trunk/distribution/docbook/en/modules/ch080-provided-examples.xml 2009-10-16 08:57:19 UTC (rev 95017)
@@ -288,7 +288,7 @@
<sect1 xml:id="SecWebAppExample">
<title>WebApp Example</title>
- <para>The <emphasis role="bold">example-webapp.war</emphasis> archive is an OSGi Bundle as well as an Web Application Archive (WAR)
+ <para>The <emphasis role="bold">example-webapp.war</emphasis> archive is an OSGi Bundle and a Web Application Archive (WAR)
at the same time. Similar to <link linkend="SecHTTPServiceExample">HTTP Service Example</link> it registers a servlet and resources with
the WebApp container. This is done through a standard web.xml descriptor.
</para>
@@ -326,7 +326,7 @@
Import-Package: org.osgi.service.http,org.ops4j.pax.web.service,javax.servlet,javax.servlet.http
]]></programlisting>
- <para>The test verifies that we can access the servlet and some resourtces.</para>
+ <para>The test verifies that we can access the servlet and some resources.</para>
<programlisting role="JAVA">
@Test
Modified: projects/jboss-osgi/trunk/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/pom.xml 2009-10-16 08:47:46 UTC (rev 95016)
+++ projects/jboss-osgi/trunk/pom.xml 2009-10-16 08:57:19 UTC (rev 95017)
@@ -60,7 +60,7 @@
<version.jboss.osgi.jaxb>2.1.10.SP2</version.jboss.osgi.jaxb>
<version.jboss.osgi.jmx>1.0.1</version.jboss.osgi.jmx>
<version.jboss.osgi.jndi>1.0.1</version.jboss.osgi.jndi>
- <version.jboss.osgi.microcontainer>1.0.2</version.jboss.osgi.microcontainer>
+ <version.jboss.osgi.microcontainer>1.0.3-SNAPSHOT</version.jboss.osgi.microcontainer>
<version.jboss.osgi.runtime.deployers>1.0.2</version.jboss.osgi.runtime.deployers>
<version.jboss.osgi.runtime.equinox>3.5</version.jboss.osgi.runtime.equinox>
<version.jboss.osgi.runtime.felix>2.0.0-SNAPSHOT</version.jboss.osgi.runtime.felix>
Property changes on: projects/jboss-osgi/trunk/reactor/deployment
___________________________________________________________________
Name: svn:ignore
+ target
Added: projects/jboss-osgi/trunk/reactor/deployment/.classpath
===================================================================
--- projects/jboss-osgi/trunk/reactor/deployment/.classpath (rev 0)
+++ projects/jboss-osgi/trunk/reactor/deployment/.classpath 2009-10-16 08:57:19 UTC (rev 95017)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" output="target/classes" path="src/main/java"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+ <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
+ <classpathentry kind="output" path="target/classes"/>
+</classpath>
Added: projects/jboss-osgi/trunk/reactor/deployment/.project
===================================================================
--- projects/jboss-osgi/trunk/reactor/deployment/.project (rev 0)
+++ projects/jboss-osgi/trunk/reactor/deployment/.project 2009-10-16 08:57:19 UTC (rev 95017)
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>jboss-osgi-runtime-deployer</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.maven.ide.eclipse.maven2Builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.maven.ide.eclipse.maven2Nature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
Added: projects/jboss-osgi/trunk/reactor/deployment/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- projects/jboss-osgi/trunk/reactor/deployment/.settings/org.eclipse.jdt.core.prefs (rev 0)
+++ projects/jboss-osgi/trunk/reactor/deployment/.settings/org.eclipse.jdt.core.prefs 2009-10-16 08:57:19 UTC (rev 95017)
@@ -0,0 +1,5 @@
+#Fri Oct 16 10:23:39 CEST 2009
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.source=1.5
Added: projects/jboss-osgi/trunk/reactor/deployment/.settings/org.maven.ide.eclipse.prefs
===================================================================
--- projects/jboss-osgi/trunk/reactor/deployment/.settings/org.maven.ide.eclipse.prefs (rev 0)
+++ projects/jboss-osgi/trunk/reactor/deployment/.settings/org.maven.ide.eclipse.prefs 2009-10-16 08:57:19 UTC (rev 95017)
@@ -0,0 +1,9 @@
+#Fri Oct 16 10:23:37 CEST 2009
+activeProfiles=
+eclipse.preferences.version=1
+fullBuildGoals=process-test-resources
+includeModules=false
+resolveWorkspaceProjects=true
+resourceFilterGoals=process-resources resources\:testResources
+skipCompilerPlugin=true
+version=1
Added: projects/jboss-osgi/trunk/reactor/deployment/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/reactor/deployment/pom.xml (rev 0)
+++ projects/jboss-osgi/trunk/reactor/deployment/pom.xml 2009-10-16 08:57:19 UTC (rev 95017)
@@ -0,0 +1,83 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+ <!-- ====================================================================== -->
+ <!-- -->
+ <!-- JBoss, the OpenSource J2EE webOS -->
+ <!-- -->
+ <!-- Distributable under LGPL license. -->
+ <!-- See terms of license at http://www.gnu.org. -->
+ <!-- -->
+ <!-- ====================================================================== -->
+
+ <!-- $Id$ -->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <name>JBossOSGi Deployment</name>
+
+ <groupId>org.jboss.osgi.bundles</groupId>
+ <artifactId>jboss-osgi-deployment</artifactId>
+ <packaging>bundle</packaging>
+
+ <version>1.0.0-SNAPSHOT</version>
+
+ <!-- Parent -->
+ <parent>
+ <groupId>org.jboss.osgi</groupId>
+ <artifactId>jboss-osgi</artifactId>
+ <version>1.0.0.Beta5</version>
+ </parent>
+
+ <properties>
+ <version.jboss.deployers>2.0.8.GA</version.jboss.deployers>
+ </properties>
+
+ <!-- Dependencies -->
+ <dependencies>
+ <dependency>
+ <groupId>org.jboss.osgi</groupId>
+ <artifactId>jboss-osgi-spi</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.deployers</groupId>
+ <artifactId>jboss-deployers-vfs</artifactId>
+ <version>${version.jboss.deployers}</version>
+ </dependency>
+
+ <!-- OSGi Dependencies -->
+ <dependency>
+ <groupId>org.osgi</groupId>
+ <artifactId>org.osgi.core</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.osgi</groupId>
+ <artifactId>org.osgi.compendium</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>maven-bundle-plugin</artifactId>
+ <extensions>true</extensions>
+ <configuration>
+ <instructions>
+ <Bundle-SymbolicName>${artifactId}</Bundle-SymbolicName>
+ <Bundle-Activator>org.jboss.osgi.deployment.internal.DeployersActivator</Bundle-Activator>
+ <Export-Package>
+ org.jboss.osgi.deployment;version=1.0,
+ </Export-Package>
+ <Private-Package>
+ org.jboss.osgi.deployment.internal
+ </Private-Package>
+ </instructions>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
Property changes on: projects/jboss-osgi/trunk/reactor/deployment/pom.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: projects/jboss-osgi/trunk/reactor/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/reactor/pom.xml 2009-10-16 08:47:46 UTC (rev 95016)
+++ projects/jboss-osgi/trunk/reactor/pom.xml 2009-10-16 08:57:19 UTC (rev 95017)
@@ -14,8 +14,9 @@
<!--
The reactor is used to pull in external subprojects and build them as part of this maven reactor build.
- It is a one-stop entry point to build, test and deploy dependent SNAPSHOTs. To pull in a particular subproject,
- set one or more svn:external definitions. For example
+ It is a one-stop entry point to build, test and deploy dependent SNAPSHOTs.
+
+ To pull in a particular subproject, set one or more svn:external definitions. For example
spi https://svn.jboss.org/repos/jbossas/projects/jboss-osgi/projects/spi/trunk
runtime/deployers https://svn.jboss.org/repos/jbossas/projects/jboss-osgi/projects/runtime/...
@@ -42,6 +43,7 @@
</parent>
<modules>
+ <module>deployment</module>
<module>framework</module>
<module>blueprint</module>
</modules>
Modified: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/service/microcontainer/MicrocontainerServiceTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/service/microcontainer/MicrocontainerServiceTestCase.java 2009-10-16 08:47:46 UTC (rev 95016)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/service/microcontainer/MicrocontainerServiceTestCase.java 2009-10-16 08:57:19 UTC (rev 95017)
@@ -23,9 +23,9 @@
//$Id$
+import static org.jboss.osgi.deployment.DeployerService.MBEAN_DEPLOYER_SERVICE;
import static org.jboss.osgi.spi.management.ManagedFrameworkMBean.MBEAN_MANAGED_FRAMEWORK;
import static org.jboss.osgi.spi.management.MicrocontainerServiceMBean.MBEAN_MICROCONTAINER_SERVICE;
-import static org.jboss.osgi.spi.service.DeployerService.MBEAN_DEPLOYER_SERVICE;
import static org.jboss.test.osgi.service.microcontainer.bundleB.SomeBeanMBean.MBEAN_NAME;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
@@ -36,6 +36,7 @@
import javax.management.ObjectName;
+import org.jboss.osgi.deployment.DeployerService;
import org.jboss.osgi.jbossxb.XMLBindingCapability;
import org.jboss.osgi.jmx.JMXCapability;
import org.jboss.osgi.jndi.JNDICapability;
@@ -43,7 +44,6 @@
import org.jboss.osgi.spi.management.MBeanProxy;
import org.jboss.osgi.spi.management.ManagedFrameworkMBean;
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.testing.OSGiRuntime;
import org.jboss.osgi.spi.testing.OSGiTest;
16 years, 9 months
JBoss-OSGI SVN: r95010 - in projects/jboss-osgi: projects/runtime/felix/trunk/src/main/java/org/jboss/osgi/felix and 6 other directories.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-10-16 03:51:11 -0400 (Fri, 16 Oct 2009)
New Revision: 95010
Added:
projects/jboss-osgi/projects/runtime/felix/trunk/src/main/java/org/jboss/osgi/felix/FelixBundleContextWrapper.java
projects/jboss-osgi/projects/runtime/felix/trunk/src/main/java/org/jboss/osgi/felix/FelixFrameworkWrapper.java
projects/jboss-osgi/projects/runtime/felix/trunk/src/test/java/org/jboss/test/osgi/felix/OSGiBootstrapTestCase.java
projects/jboss-osgi/projects/runtime/felix/trunk/src/test/resources/META-INF/
projects/jboss-osgi/projects/runtime/felix/trunk/src/test/resources/META-INF/services/
projects/jboss-osgi/projects/runtime/felix/trunk/src/test/resources/META-INF/services/org.jboss.osgi.spi.framework.OSGiBootstrapProvider
projects/jboss-osgi/projects/runtime/felix/trunk/src/test/resources/jboss-osgi-framework.properties
projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/framework/BundleContextWrapper.java
projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/framework/BundleWrapper.java
projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/framework/FrameworkWrapper.java
Modified:
projects/jboss-osgi/projects/runtime/felix/trunk/pom.xml
projects/jboss-osgi/projects/runtime/felix/trunk/src/main/java/org/jboss/osgi/felix/FelixBootstrapProvider.java
projects/jboss-osgi/projects/runtime/felix/trunk/src/main/java/org/jboss/osgi/felix/FelixIntegration.java
projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/framework/FrameworkIntegration.java
projects/jboss-osgi/trunk/pom.xml
Log:
[JBOSGI-183] Initial implementation of OSGi Deployers
Add hooks into Felix integration - WIP
Modified: projects/jboss-osgi/projects/runtime/felix/trunk/pom.xml
===================================================================
--- projects/jboss-osgi/projects/runtime/felix/trunk/pom.xml 2009-10-16 07:42:55 UTC (rev 95009)
+++ projects/jboss-osgi/projects/runtime/felix/trunk/pom.xml 2009-10-16 07:51:11 UTC (rev 95010)
@@ -20,18 +20,25 @@
<artifactId>jboss-osgi-runtime-felix</artifactId>
<packaging>jar</packaging>
- <version>2.0.1-SNAPSHOT</version>
+ <version>2.0.0-SNAPSHOT</version>
<!-- Parent -->
<parent>
<groupId>org.jboss.osgi</groupId>
<artifactId>jboss-osgi-parent</artifactId>
- <version>1.0.2</version>
+ <version>1.0.3</version>
</parent>
+ <!-- Subversion -->
+ <scm>
+ <connection>scm:svn:http://anonsvn.jboss.org/repos/jbossas/projects/jboss-osgi/projec...</connection>
+ <developerConnection>scm:svn:https://svn.jboss.org/repos/jbossas/projects/jboss-osgi/projects/...</developerConnection>
+ <url>http://fisheye.jboss.com/qsearch/JBossOSGi</url>
+ </scm>
+
<properties>
<version.felix.framework>2.0.0</version.felix.framework>
- <version.jboss.osgi.spi>1.0.1</version.jboss.osgi.spi>
+ <version.jboss.osgi.spi>1.0.3-SNAPSHOT</version.jboss.osgi.spi>
</properties>
<!-- Dependencies -->
@@ -46,13 +53,28 @@
<artifactId>org.apache.felix.framework</artifactId>
<version>${version.felix.framework}</version>
</dependency>
+ <dependency>
+ <groupId>org.jboss.logging</groupId>
+ <artifactId>jboss-logging-log4j</artifactId>
+ <scope>test</scope>
+ </dependency>
</dependencies>
- <!-- Subversion -->
- <scm>
- <connection>scm:svn:http://anonsvn.jboss.org/repos/jbossas/projects/jboss-osgi/projec...</connection>
- <developerConnection>scm:svn:https://svn.jboss.org/repos/jbossas/projects/jboss-osgi/projects/...</developerConnection>
- <url>http://fisheye.jboss.com/qsearch/JBossOSGi/projects/runtime/felix/trunk</url>
- </scm>
+ <!-- Build -->
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <systemProperties>
+ <property>
+ <name>log4j.output.dir</name>
+ <value>${project.build.directory}</value>
+ </property>
+ </systemProperties>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
</project>
Modified: projects/jboss-osgi/projects/runtime/felix/trunk/src/main/java/org/jboss/osgi/felix/FelixBootstrapProvider.java
===================================================================
--- projects/jboss-osgi/projects/runtime/felix/trunk/src/main/java/org/jboss/osgi/felix/FelixBootstrapProvider.java 2009-10-16 07:42:55 UTC (rev 95009)
+++ projects/jboss-osgi/projects/runtime/felix/trunk/src/main/java/org/jboss/osgi/felix/FelixBootstrapProvider.java 2009-10-16 07:51:11 UTC (rev 95010)
@@ -24,6 +24,7 @@
//$Id$
import org.jboss.osgi.spi.framework.PropertiesBootstrapProvider;
+import org.osgi.framework.launch.Framework;
/**
* A bootstrap provider for Felix.
@@ -33,4 +34,16 @@
*/
public class FelixBootstrapProvider extends PropertiesBootstrapProvider
{
+ private Framework frameworkWrapper;
+
+ @Override
+ public Framework getFramework()
+ {
+ if (frameworkWrapper == null)
+ {
+ Framework framework = super.getFramework();
+ frameworkWrapper = new FelixFrameworkWrapper(framework);
+ }
+ return frameworkWrapper;
+ }
}
\ No newline at end of file
Added: projects/jboss-osgi/projects/runtime/felix/trunk/src/main/java/org/jboss/osgi/felix/FelixBundleContextWrapper.java
===================================================================
--- projects/jboss-osgi/projects/runtime/felix/trunk/src/main/java/org/jboss/osgi/felix/FelixBundleContextWrapper.java (rev 0)
+++ projects/jboss-osgi/projects/runtime/felix/trunk/src/main/java/org/jboss/osgi/felix/FelixBundleContextWrapper.java 2009-10-16 07:51:11 UTC (rev 95010)
@@ -0,0 +1,56 @@
+/*
+ * 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.felix;
+
+//$Id$
+
+import org.jboss.logging.Logger;
+import org.jboss.osgi.spi.framework.BundleContextWrapper;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.BundleException;
+
+/**
+ * The FelixBundleContextWrapper wrapps the BundleContext provided by the Felix implemenation.
+ *
+ * It provides additional functionality on bundle install.
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 15-Oct-2009
+ */
+public class FelixBundleContextWrapper extends BundleContextWrapper
+{
+ // Provide logging
+ final Logger log = Logger.getLogger(FelixBundleContextWrapper.class);
+
+ public FelixBundleContextWrapper(BundleContext context)
+ {
+ super(context);
+ }
+
+ @Override
+ public Bundle installBundle(String location) throws BundleException
+ {
+ Bundle bundle = super.installBundle(location);
+ return bundle;
+ }
+}
\ No newline at end of file
Property changes on: projects/jboss-osgi/projects/runtime/felix/trunk/src/main/java/org/jboss/osgi/felix/FelixBundleContextWrapper.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: projects/jboss-osgi/projects/runtime/felix/trunk/src/main/java/org/jboss/osgi/felix/FelixFrameworkWrapper.java
===================================================================
--- projects/jboss-osgi/projects/runtime/felix/trunk/src/main/java/org/jboss/osgi/felix/FelixFrameworkWrapper.java (rev 0)
+++ projects/jboss-osgi/projects/runtime/felix/trunk/src/main/java/org/jboss/osgi/felix/FelixFrameworkWrapper.java 2009-10-16 07:51:11 UTC (rev 95010)
@@ -0,0 +1,53 @@
+/*
+ * 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.felix;
+
+//$Id$
+
+import org.jboss.logging.Logger;
+import org.jboss.osgi.spi.framework.FrameworkWrapper;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.launch.Framework;
+
+/**
+ * The FelixFrameworkWrapper wrapps the Framework provided by the Felix implemenation.
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 15-Oct-2009
+ */
+class FelixFrameworkWrapper extends FrameworkWrapper
+{
+ // Provide logging
+ final Logger log = Logger.getLogger(FelixFrameworkWrapper.class);
+
+ FelixFrameworkWrapper(Framework framework)
+ {
+ super(framework);
+ }
+
+ @Override
+ public BundleContext getBundleContext()
+ {
+ BundleContext context = framework.getBundleContext();
+ return new FelixBundleContextWrapper(context);
+ }
+}
\ No newline at end of file
Property changes on: projects/jboss-osgi/projects/runtime/felix/trunk/src/main/java/org/jboss/osgi/felix/FelixFrameworkWrapper.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: projects/jboss-osgi/projects/runtime/felix/trunk/src/main/java/org/jboss/osgi/felix/FelixIntegration.java
===================================================================
--- projects/jboss-osgi/projects/runtime/felix/trunk/src/main/java/org/jboss/osgi/felix/FelixIntegration.java 2009-10-16 07:42:55 UTC (rev 95009)
+++ projects/jboss-osgi/projects/runtime/felix/trunk/src/main/java/org/jboss/osgi/felix/FelixIntegration.java 2009-10-16 07:51:11 UTC (rev 95010)
@@ -23,10 +23,13 @@
//$Id$
+import java.util.Map;
+
import org.jboss.logging.Logger;
import org.jboss.osgi.spi.framework.FrameworkIntegration;
import org.jboss.osgi.spi.util.ServiceLoader;
import org.osgi.framework.BundleException;
+import org.osgi.framework.launch.Framework;
import org.osgi.framework.launch.FrameworkFactory;
/**
@@ -40,7 +43,10 @@
// Provide logging
final Logger log = Logger.getLogger(FelixIntegration.class);
- public void create()
+ private Framework framework;
+
+ @Override
+ protected void createFramework(Map<String, Object> properties)
{
// Log INFO about this implementation
log.info(getClass().getPackage().getImplementationTitle());
@@ -58,6 +64,13 @@
framework = factory.newFramework(properties);
}
+ @Override
+ protected Framework getFramework()
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
public void stop()
{
if (framework != null)
Added: projects/jboss-osgi/projects/runtime/felix/trunk/src/test/java/org/jboss/test/osgi/felix/OSGiBootstrapTestCase.java
===================================================================
--- projects/jboss-osgi/projects/runtime/felix/trunk/src/test/java/org/jboss/test/osgi/felix/OSGiBootstrapTestCase.java (rev 0)
+++ projects/jboss-osgi/projects/runtime/felix/trunk/src/test/java/org/jboss/test/osgi/felix/OSGiBootstrapTestCase.java 2009-10-16 07:51:11 UTC (rev 95010)
@@ -0,0 +1,64 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.osgi.felix;
+
+//$Id$
+
+import static org.junit.Assert.assertEquals;
+
+import org.jboss.osgi.felix.FelixBundleContextWrapper;
+import org.jboss.osgi.spi.framework.OSGiBootstrap;
+import org.jboss.osgi.spi.framework.OSGiBootstrapProvider;
+import org.junit.Test;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.launch.Framework;
+
+/**
+ * Test OSGi System bundle access
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 27-Jul-2009
+ */
+public class OSGiBootstrapTestCase
+{
+ @Test
+ public void testFrameworkLaunch() throws Exception
+ {
+ OSGiBootstrapProvider bootProvider = OSGiBootstrap.getBootstrapProvider();
+ Framework framework = bootProvider.getFramework();
+
+ assertEquals("BundleId == 0", 0, framework.getBundleId());
+ assertEquals("SymbolicName", "org.apache.felix.framework", framework.getSymbolicName());
+
+ framework.start();
+ try
+ {
+ BundleContext context = framework.getBundleContext();
+ assertEquals(FelixBundleContextWrapper.class.getName(), context.getClass().getName());
+ }
+ finally
+ {
+ framework.stop();
+ framework.waitForStop(1000);
+ }
+ }
+}
\ No newline at end of file
Property changes on: projects/jboss-osgi/projects/runtime/felix/trunk/src/test/java/org/jboss/test/osgi/felix/OSGiBootstrapTestCase.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: projects/jboss-osgi/projects/runtime/felix/trunk/src/test/resources/META-INF/services/org.jboss.osgi.spi.framework.OSGiBootstrapProvider
===================================================================
--- projects/jboss-osgi/projects/runtime/felix/trunk/src/test/resources/META-INF/services/org.jboss.osgi.spi.framework.OSGiBootstrapProvider (rev 0)
+++ projects/jboss-osgi/projects/runtime/felix/trunk/src/test/resources/META-INF/services/org.jboss.osgi.spi.framework.OSGiBootstrapProvider 2009-10-16 07:51:11 UTC (rev 95010)
@@ -0,0 +1 @@
+org.jboss.osgi.felix.FelixBootstrapProvider # The Felix bootstrap provider
\ No newline at end of file
Added: projects/jboss-osgi/projects/runtime/felix/trunk/src/test/resources/jboss-osgi-framework.properties
===================================================================
--- projects/jboss-osgi/projects/runtime/felix/trunk/src/test/resources/jboss-osgi-framework.properties (rev 0)
+++ projects/jboss-osgi/projects/runtime/felix/trunk/src/test/resources/jboss-osgi-framework.properties 2009-10-16 07:51:11 UTC (rev 95010)
@@ -0,0 +1,24 @@
+#
+# Properties read by the org.jboss.osgi.spi.framework.PropertiesBootstrapProvider
+#
+# $Id$
+#
+
+# The OSGiFramework implementation
+org.jboss.osgi.spi.framework.impl=org.jboss.osgi.felix.framework.FelixIntegration
+
+# Properties to configure the Framework
+# org.osgi.framework.storage.clean=onFirstInit
+
+# Framework bootdelegation
+# org.osgi.framework.bootdelegation=org.osgi.service.log
+
+# Extra System Packages
+# org.osgi.framework.system.packages.extra=\
+
+# Bundles that need to be installed with the Framework automatically
+# org.jboss.osgi.spi.framework.autoInstall=\
+
+# Bundles that need to be started automatically
+# org.jboss.osgi.spi.framework.autoStart=\
+
\ No newline at end of file
Property changes on: projects/jboss-osgi/projects/runtime/felix/trunk/src/test/resources/jboss-osgi-framework.properties
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/framework/BundleContextWrapper.java
===================================================================
--- projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/framework/BundleContextWrapper.java (rev 0)
+++ projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/framework/BundleContextWrapper.java 2009-10-16 07:51:11 UTC (rev 95010)
@@ -0,0 +1,174 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.osgi.spi.framework;
+
+//$Id$
+
+import java.io.File;
+import java.io.InputStream;
+import java.util.Dictionary;
+
+import org.jboss.logging.Logger;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.BundleException;
+import org.osgi.framework.BundleListener;
+import org.osgi.framework.Filter;
+import org.osgi.framework.FrameworkListener;
+import org.osgi.framework.InvalidSyntaxException;
+import org.osgi.framework.ServiceListener;
+import org.osgi.framework.ServiceReference;
+import org.osgi.framework.ServiceRegistration;
+
+/**
+ * A generic BundleContext wrapper that delegates all method calls to the underlying
+ * BundleContext implementation.
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 16-Oct-2009
+ */
+public class BundleContextWrapper implements BundleContext
+{
+ // Provide logging
+ final Logger log = Logger.getLogger(BundleContextWrapper.class);
+
+ protected BundleContext context;
+
+ public BundleContextWrapper(BundleContext context)
+ {
+ if (context == null)
+ throw new IllegalArgumentException("Null framework");
+ this.context = context;
+ }
+
+ public void addBundleListener(BundleListener listener)
+ {
+ context.addBundleListener(listener);
+ }
+
+ public void addFrameworkListener(FrameworkListener listener)
+ {
+ context.addFrameworkListener(listener);
+ }
+
+ public void addServiceListener(ServiceListener listener, String filter) throws InvalidSyntaxException
+ {
+ context.addServiceListener(listener, filter);
+ }
+
+ public void addServiceListener(ServiceListener listener)
+ {
+ context.addServiceListener(listener);
+ }
+
+ public Filter createFilter(String filter) throws InvalidSyntaxException
+ {
+ return context.createFilter(filter);
+ }
+
+ public ServiceReference[] getAllServiceReferences(String clazz, String filter) throws InvalidSyntaxException
+ {
+ return context.getAllServiceReferences(clazz, filter);
+ }
+
+ public Bundle getBundle()
+ {
+ return context.getBundle();
+ }
+
+ public Bundle getBundle(long id)
+ {
+ return context.getBundle(id);
+ }
+
+ public Bundle[] getBundles()
+ {
+ return context.getBundles();
+ }
+
+ public File getDataFile(String filename)
+ {
+ return context.getDataFile(filename);
+ }
+
+ public String getProperty(String key)
+ {
+ return context.getProperty(key);
+ }
+
+ public Object getService(ServiceReference reference)
+ {
+ return context.getService(reference);
+ }
+
+ public ServiceReference getServiceReference(String clazz)
+ {
+ return context.getServiceReference(clazz);
+ }
+
+ public ServiceReference[] getServiceReferences(String clazz, String filter) throws InvalidSyntaxException
+ {
+ return context.getServiceReferences(clazz, filter);
+ }
+
+ public Bundle installBundle(String location, InputStream input) throws BundleException
+ {
+ return context.installBundle(location, input);
+ }
+
+ public Bundle installBundle(String location) throws BundleException
+ {
+ return context.installBundle(location);
+ }
+
+ @SuppressWarnings("unchecked")
+ public ServiceRegistration registerService(String clazz, Object service, Dictionary properties)
+ {
+ return context.registerService(clazz, service, properties);
+ }
+
+ @SuppressWarnings("unchecked")
+ public ServiceRegistration registerService(String[] clazzes, Object service, Dictionary properties)
+ {
+ return context.registerService(clazzes, service, properties);
+ }
+
+ public void removeBundleListener(BundleListener listener)
+ {
+ context.removeBundleListener(listener);
+ }
+
+ public void removeFrameworkListener(FrameworkListener listener)
+ {
+ context.removeFrameworkListener(listener);
+ }
+
+ public void removeServiceListener(ServiceListener listener)
+ {
+ context.removeServiceListener(listener);
+ }
+
+ public boolean ungetService(ServiceReference reference)
+ {
+ return context.ungetService(reference);
+ }
+}
\ No newline at end of file
Property changes on: projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/framework/BundleContextWrapper.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/framework/BundleWrapper.java
===================================================================
--- projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/framework/BundleWrapper.java (rev 0)
+++ projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/framework/BundleWrapper.java 2009-10-16 07:51:11 UTC (rev 95010)
@@ -0,0 +1,197 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.osgi.spi.framework;
+
+//$Id$
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URL;
+import java.util.Dictionary;
+import java.util.Enumeration;
+import java.util.Map;
+
+import org.jboss.logging.Logger;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.BundleException;
+import org.osgi.framework.ServiceReference;
+import org.osgi.framework.Version;
+
+/**
+ * A generic Bundle wrapper that delegates all method calls to the underlying
+ * Bundle implementation.
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 16-Oct-2009
+ */
+public class BundleWrapper implements Bundle
+{
+ // Provide logging
+ final Logger log = Logger.getLogger(BundleWrapper.class);
+
+ protected Bundle bundle;
+
+ public BundleWrapper(Bundle bundle)
+ {
+ if (bundle == null)
+ throw new IllegalArgumentException("Null bundle");
+ this.bundle = bundle;
+ }
+
+ @SuppressWarnings("unchecked")
+ public Enumeration findEntries(String path, String filePattern, boolean recurse)
+ {
+ return bundle.findEntries(path, filePattern, recurse);
+ }
+
+ public BundleContext getBundleContext()
+ {
+ return bundle.getBundleContext();
+ }
+
+ public long getBundleId()
+ {
+ return bundle.getBundleId();
+ }
+
+ public URL getEntry(String path)
+ {
+ return bundle.getEntry(path);
+ }
+
+ @SuppressWarnings("unchecked")
+ public Enumeration getEntryPaths(String path)
+ {
+ return bundle.getEntryPaths(path);
+ }
+
+ @SuppressWarnings("unchecked")
+ public Dictionary getHeaders()
+ {
+ return bundle.getHeaders();
+ }
+
+ @SuppressWarnings("unchecked")
+ public Dictionary getHeaders(String locale)
+ {
+ return bundle.getHeaders(locale);
+ }
+
+ public long getLastModified()
+ {
+ return bundle.getLastModified();
+ }
+
+ public String getLocation()
+ {
+ return bundle.getLocation();
+ }
+
+ public ServiceReference[] getRegisteredServices()
+ {
+ return bundle.getRegisteredServices();
+ }
+
+ public URL getResource(String name)
+ {
+ return bundle.getResource(name);
+ }
+
+ @SuppressWarnings("unchecked")
+ public Enumeration getResources(String name) throws IOException
+ {
+ return bundle.getResources(name);
+ }
+
+ public ServiceReference[] getServicesInUse()
+ {
+ return bundle.getServicesInUse();
+ }
+
+ @SuppressWarnings("unchecked")
+ public Map getSignerCertificates(int signersType)
+ {
+ return bundle.getSignerCertificates(signersType);
+ }
+
+ public int getState()
+ {
+ return bundle.getState();
+ }
+
+ public String getSymbolicName()
+ {
+ return bundle.getSymbolicName();
+ }
+
+ public Version getVersion()
+ {
+ return bundle.getVersion();
+ }
+
+ public boolean hasPermission(Object permission)
+ {
+ return bundle.hasPermission(permission);
+ }
+
+ @SuppressWarnings("unchecked")
+ public Class loadClass(String name) throws ClassNotFoundException
+ {
+ return bundle.loadClass(name);
+ }
+
+ public void start() throws BundleException
+ {
+ bundle.start();
+ }
+
+ public void start(int options) throws BundleException
+ {
+ bundle.start(options);
+ }
+
+ public void stop() throws BundleException
+ {
+ bundle.stop();
+ }
+
+ public void stop(int options) throws BundleException
+ {
+ bundle.stop(options);
+ }
+
+ public void uninstall() throws BundleException
+ {
+ bundle.uninstall();
+ }
+
+ public void update() throws BundleException
+ {
+ bundle.update();
+ }
+
+ public void update(InputStream input) throws BundleException
+ {
+ bundle.update(input);
+ }
+}
\ No newline at end of file
Property changes on: projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/framework/BundleWrapper.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/framework/FrameworkIntegration.java
===================================================================
--- projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/framework/FrameworkIntegration.java 2009-10-16 07:42:55 UTC (rev 95009)
+++ projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/framework/FrameworkIntegration.java 2009-10-16 07:51:11 UTC (rev 95010)
@@ -32,30 +32,29 @@
import org.jboss.logging.Logger;
import org.jboss.osgi.spi.FrameworkException;
import org.jboss.osgi.spi.logging.ExportedPackageHelper;
-import org.jboss.osgi.spi.util.ServiceLoader;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
import org.osgi.framework.BundleException;
import org.osgi.framework.launch.Framework;
-import org.osgi.framework.launch.FrameworkFactory;
/**
- * An abstraction of an OSGi Framework
+ * An abstraction of an OSGi Framework.
*
+ * In addition to the standard {@link Framework} this implementation also
+ * supports properties and initial bundle provisioning.
+ *
* @author thomas.diesler(a)jboss.com
* @since 23-Jan-2009
*/
-public class FrameworkIntegration
+public abstract class FrameworkIntegration
{
// Provide logging
final Logger log = Logger.getLogger(FrameworkIntegration.class);
- protected Map<String, Object> properties = new HashMap<String, Object>();
- protected List<URL> autoInstall = new ArrayList<URL>();
- protected List<URL> autoStart = new ArrayList<URL>();
+ private Map<String, Object> properties = new HashMap<String, Object>();
+ private List<URL> autoInstall = new ArrayList<URL>();
+ private List<URL> autoStart = new ArrayList<URL>();
- protected Framework framework;
-
public Map<String, Object> getProperties()
{
return properties;
@@ -86,22 +85,27 @@
this.autoStart = autoStart;
}
+ /** Overwrite to create the framework */
+ protected abstract void createFramework(Map<String, Object> properties);
+
+ /** Overwrite to provide the framework */
+ protected abstract Framework getFramework();
+
public Bundle getBundle()
{
assertFrameworkStart();
- return framework;
+ return getFramework();
}
public BundleContext getBundleContext()
{
- return getBundle().getBundleContext();
+ assertFrameworkStart();
+ return getFramework().getBundleContext();
}
public void create()
{
- // Load the framework instance
- FrameworkFactory factory = ServiceLoader.loadService(FrameworkFactory.class);
- framework = factory.newFramework(properties);
+ createFramework(properties);
}
public void start()
@@ -112,7 +116,7 @@
// Start the System Bundle
try
{
- framework.start();
+ getFramework().start();
}
catch (BundleException ex)
{
@@ -120,7 +124,7 @@
}
// Get system bundle context
- BundleContext context = framework.getBundleContext();
+ BundleContext context = getFramework().getBundleContext();
if (context == null)
throw new FrameworkException("Cannot obtain system context");
@@ -176,6 +180,7 @@
public void stop()
{
+ Framework framework = getFramework();
if (framework != null)
{
try
@@ -198,14 +203,14 @@
private void assertFrameworkCreate()
{
- if (framework == null)
+ if (getFramework() == null)
create();
}
private void assertFrameworkStart()
{
assertFrameworkCreate();
- if ((framework.getState() & Bundle.ACTIVE) == 0)
+ if ((getFramework().getState() & Bundle.ACTIVE) == 0)
start();
}
}
\ No newline at end of file
Added: projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/framework/FrameworkWrapper.java
===================================================================
--- projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/framework/FrameworkWrapper.java (rev 0)
+++ projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/framework/FrameworkWrapper.java 2009-10-16 07:51:11 UTC (rev 95010)
@@ -0,0 +1,208 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.osgi.spi.framework;
+
+//$Id$
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URL;
+import java.util.Dictionary;
+import java.util.Enumeration;
+import java.util.Map;
+
+import org.jboss.logging.Logger;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.BundleException;
+import org.osgi.framework.FrameworkEvent;
+import org.osgi.framework.ServiceReference;
+import org.osgi.framework.Version;
+import org.osgi.framework.launch.Framework;
+
+/**
+ * A generic Framework wrapper that delegates all method calls to the underlying
+ * Framework implementation.
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 16-Oct-2009
+ */
+public class FrameworkWrapper implements Framework
+{
+ // Provide logging
+ final Logger log = Logger.getLogger(FrameworkWrapper.class);
+
+ protected Framework framework;
+
+ public FrameworkWrapper(Framework framework)
+ {
+ if (framework == null)
+ throw new IllegalArgumentException("Null framework");
+ this.framework = framework;
+ }
+
+ @SuppressWarnings("unchecked")
+ public Enumeration findEntries(String arg0, String arg1, boolean arg2)
+ {
+ return framework.findEntries(arg0, arg1, arg2);
+ }
+
+ public BundleContext getBundleContext()
+ {
+ return framework.getBundleContext();
+ }
+
+ public long getBundleId()
+ {
+ return framework.getBundleId();
+ }
+
+ public URL getEntry(String arg0)
+ {
+ return framework.getEntry(arg0);
+ }
+
+ @SuppressWarnings("unchecked")
+ public Enumeration getEntryPaths(String arg0)
+ {
+ return framework.getEntryPaths(arg0);
+ }
+
+ @SuppressWarnings("unchecked")
+ public Dictionary getHeaders()
+ {
+ return framework.getHeaders();
+ }
+
+ @SuppressWarnings("unchecked")
+ public Dictionary getHeaders(String arg0)
+ {
+ return framework.getHeaders(arg0);
+ }
+
+ public long getLastModified()
+ {
+ return framework.getLastModified();
+ }
+
+ public String getLocation()
+ {
+ return framework.getLocation();
+ }
+
+ public ServiceReference[] getRegisteredServices()
+ {
+ return framework.getRegisteredServices();
+ }
+
+ public URL getResource(String arg0)
+ {
+ return framework.getResource(arg0);
+ }
+
+ @SuppressWarnings("unchecked")
+ public Enumeration getResources(String arg0) throws IOException
+ {
+ return framework.getResources(arg0);
+ }
+
+ public ServiceReference[] getServicesInUse()
+ {
+ return framework.getServicesInUse();
+ }
+
+ @SuppressWarnings("unchecked")
+ public Map getSignerCertificates(int arg0)
+ {
+ return framework.getSignerCertificates(arg0);
+ }
+
+ public int getState()
+ {
+ return framework.getState();
+ }
+
+ public String getSymbolicName()
+ {
+ return framework.getSymbolicName();
+ }
+
+ public Version getVersion()
+ {
+ return framework.getVersion();
+ }
+
+ public boolean hasPermission(Object arg0)
+ {
+ return framework.hasPermission(arg0);
+ }
+
+ public void init() throws BundleException
+ {
+ framework.init();
+ }
+
+ @SuppressWarnings("unchecked")
+ public Class loadClass(String arg0) throws ClassNotFoundException
+ {
+ return framework.loadClass(arg0);
+ }
+
+ public void start() throws BundleException
+ {
+ framework.start();
+ }
+
+ public void start(int arg0) throws BundleException
+ {
+ framework.start(arg0);
+ }
+
+ public void stop() throws BundleException
+ {
+ framework.stop();
+ }
+
+ public void stop(int arg0) throws BundleException
+ {
+ framework.stop(arg0);
+ }
+
+ public void uninstall() throws BundleException
+ {
+ framework.uninstall();
+ }
+
+ public void update() throws BundleException
+ {
+ framework.update();
+ }
+
+ public void update(InputStream arg0) throws BundleException
+ {
+ framework.update(arg0);
+ }
+
+ public FrameworkEvent waitForStop(long arg0) throws InterruptedException
+ {
+ return framework.waitForStop(arg0);
+ }
+}
\ No newline at end of file
Property changes on: projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/framework/FrameworkWrapper.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: projects/jboss-osgi/trunk/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/pom.xml 2009-10-16 07:42:55 UTC (rev 95009)
+++ projects/jboss-osgi/trunk/pom.xml 2009-10-16 07:51:11 UTC (rev 95010)
@@ -63,7 +63,7 @@
<version.jboss.osgi.microcontainer>1.0.2</version.jboss.osgi.microcontainer>
<version.jboss.osgi.runtime.deployers>1.0.2</version.jboss.osgi.runtime.deployers>
<version.jboss.osgi.runtime.equinox>3.5</version.jboss.osgi.runtime.equinox>
- <version.jboss.osgi.runtime.felix>2.0.0</version.jboss.osgi.runtime.felix>
+ <version.jboss.osgi.runtime.felix>2.0.0-SNAPSHOT</version.jboss.osgi.runtime.felix>
<version.jboss.osgi.runtime.jbossas>1.0.1</version.jboss.osgi.runtime.jbossas>
<version.jboss.osgi.spi>1.0.3-SNAPSHOT</version.jboss.osgi.spi>
<version.jboss.osgi.webconsole>1.0.2</version.jboss.osgi.webconsole>
16 years, 9 months
JBoss-OSGI SVN: r95005 - in projects/jboss-osgi/trunk: reactor and 2 other directories.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-10-16 02:38:39 -0400 (Fri, 16 Oct 2009)
New Revision: 95005
Removed:
projects/jboss-osgi/trunk/reactor/runtime/
Modified:
projects/jboss-osgi/trunk/
projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/launch/OSGiFrameworkFactory.java
projects/jboss-osgi/trunk/reactor/framework/src/test/java/org/jboss/test/osgi/OSGiTestDelegate.java
Log:
[JBOSGI-184] Allow for overlay of jboss-osgi-bootstrap.xml
Prepare - WIP
Property changes on: projects/jboss-osgi/trunk
___________________________________________________________________
Name: svn:ignore
- autoinstall.xml
target
Modified: projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/launch/OSGiFrameworkFactory.java
===================================================================
--- projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/launch/OSGiFrameworkFactory.java 2009-10-16 06:29:24 UTC (rev 95004)
+++ projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/launch/OSGiFrameworkFactory.java 2009-10-16 06:38:39 UTC (rev 95005)
@@ -70,7 +70,7 @@
BasicXMLDeployer deployer = new BasicXMLDeployer(kernel, ControllerMode.AUTOMATIC);
URL url = null;
- String[] bootstraps = new String[] { "bootstrap/bootstrap.xml", "jboss-osgi-bootstrap.xml", "META-INF/jboss-osgi-bootstrap.xml" };
+ String[] bootstraps = new String[] { "jboss-osgi-bootstrap.xml", "META-INF/jboss-osgi-bootstrap.xml", "META-INF/jboss-osgi-default-bootstrap.xml" };
ClassLoader contextLoader = Thread.currentThread().getContextClassLoader();
for (String xml : bootstraps)
{
Modified: projects/jboss-osgi/trunk/reactor/framework/src/test/java/org/jboss/test/osgi/OSGiTestDelegate.java
===================================================================
--- projects/jboss-osgi/trunk/reactor/framework/src/test/java/org/jboss/test/osgi/OSGiTestDelegate.java 2009-10-16 06:29:24 UTC (rev 95004)
+++ projects/jboss-osgi/trunk/reactor/framework/src/test/java/org/jboss/test/osgi/OSGiTestDelegate.java 2009-10-16 06:38:39 UTC (rev 95005)
@@ -81,10 +81,11 @@
*/
protected void deploy() throws Exception
{
- String common = "/META-INF/jboss-osgi-bootstrap.xml";
- URL url = getClass().getResource(common);
+ URL url = getClass().getResource("/META-INF/jboss-osgi-bootstrap.xml");
if (url == null)
- throw new IllegalStateException(common + " not found");
+ url = getClass().getResource("/META-INF/jboss-osgi-default-bootstrap.xml");
+ if (url == null)
+ throw new IllegalStateException("Cannot find: jboss-osgi-bootstrap.xml");
deploy(url);
try
{
16 years, 9 months
JBoss-OSGI SVN: r95002 - in projects/jboss-osgi: projects/bundles/common/trunk/src/main/java/org and 1 other directories.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-10-16 00:18:41 -0400 (Fri, 16 Oct 2009)
New Revision: 95002
Removed:
projects/jboss-osgi/projects/bundles/common/trunk/src/main/java/org/apache/
Modified:
projects/jboss-osgi/projects/bundles/common/trunk/pom.xml
projects/jboss-osgi/trunk/pom.xml
Log:
Update jboss-osgi-common
Modified: projects/jboss-osgi/projects/bundles/common/trunk/pom.xml
===================================================================
--- projects/jboss-osgi/projects/bundles/common/trunk/pom.xml 2009-10-16 04:09:45 UTC (rev 95001)
+++ projects/jboss-osgi/projects/bundles/common/trunk/pom.xml 2009-10-16 04:18:41 UTC (rev 95002)
@@ -39,7 +39,7 @@
<!-- Properties -->
<properties>
- <version.jboss.osgi.spi>1.0.2</version.jboss.osgi.spi>
+ <version.jboss.osgi.spi>1.0.3-SNAPSHOT</version.jboss.osgi.spi>
<version.slf4j>1.5.8</version.slf4j>
<version.osgi>r4v42</version.osgi>
</properties>
Modified: projects/jboss-osgi/trunk/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/pom.xml 2009-10-16 04:09:45 UTC (rev 95001)
+++ projects/jboss-osgi/trunk/pom.xml 2009-10-16 04:18:41 UTC (rev 95002)
@@ -52,7 +52,7 @@
<version.izpack>4.3.1</version.izpack>
<version.jboss.osgi.apache.xerces>2.9.1.SP2</version.jboss.osgi.apache.xerces>
<version.jboss.osgi.blueprint>1.0.0.Alpha3</version.jboss.osgi.blueprint>
- <version.jboss.osgi.common>1.0.2</version.jboss.osgi.common>
+ <version.jboss.osgi.common>1.0.3-SNAPSHOT</version.jboss.osgi.common>
<version.jboss.osgi.common.core>2.2.13.GA</version.jboss.osgi.common.core>
<version.jboss.osgi.framework>1.0.0.Alpha2</version.jboss.osgi.framework>
<version.jboss.osgi.hotdeploy>1.0.3-SNAPSHOT</version.jboss.osgi.hotdeploy>
16 years, 9 months