[jboss-cvs] JBossAS SVN: r60909 - in projects/osgi/trunk: deployment/src/main/org/jboss/osgi/deployers and 1 other directory.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Mon Feb 26 10:34:34 EST 2007
Author: alesj
Date: 2007-02-26 10:34:34 -0500 (Mon, 26 Feb 2007)
New Revision: 60909
Modified:
projects/osgi/trunk/core/src/main/org/jboss/osgi/core/platform/plugin/FelixPlatform.java
projects/osgi/trunk/core/src/main/org/jboss/osgi/core/platform/plugin/FelixWrapper.java
projects/osgi/trunk/deployment/src/main/org/jboss/osgi/deployers/BundleActivatorDeployer.java
projects/osgi/trunk/deployment/src/main/org/jboss/osgi/deployers/BundleClassLoaderDeployer.java
projects/osgi/trunk/deployment/src/main/org/jboss/osgi/deployers/BundleManifestDeployer.java
Log:
Bug fixes.
Modified: projects/osgi/trunk/core/src/main/org/jboss/osgi/core/platform/plugin/FelixPlatform.java
===================================================================
--- projects/osgi/trunk/core/src/main/org/jboss/osgi/core/platform/plugin/FelixPlatform.java 2007-02-26 15:26:55 UTC (rev 60908)
+++ projects/osgi/trunk/core/src/main/org/jboss/osgi/core/platform/plugin/FelixPlatform.java 2007-02-26 15:34:34 UTC (rev 60909)
@@ -22,7 +22,7 @@
package org.jboss.osgi.core.platform.plugin;
import java.io.InputStream;
-import java.util.Properties;
+import java.util.Map;
import org.jboss.osgi.core.platform.spi.BundleAdapter;
import org.jboss.osgi.core.platform.spi.OSGiPlatform;
@@ -36,13 +36,18 @@
public class FelixPlatform implements OSGiPlatform
{
private FelixWrapper felix;
+ private Map properties;
- protected Properties getConfigProperties()
+ protected Map getConfigProperties()
{
- // todo
- return new Properties();
+ return properties;
}
+ public void setConfigProperties(Map properties)
+ {
+ this.properties = properties;
+ }
+
private void check()
{
if (felix == null || felix.getStatus() == FelixWrapper.STOPPING_STATUS)
Modified: projects/osgi/trunk/core/src/main/org/jboss/osgi/core/platform/plugin/FelixWrapper.java
===================================================================
--- projects/osgi/trunk/core/src/main/org/jboss/osgi/core/platform/plugin/FelixWrapper.java 2007-02-26 15:26:55 UTC (rev 60908)
+++ projects/osgi/trunk/core/src/main/org/jboss/osgi/core/platform/plugin/FelixWrapper.java 2007-02-26 15:34:34 UTC (rev 60909)
@@ -40,26 +40,22 @@
{
private static Logger log = Logger.getLogger(FelixWrapper.class);
- private Felix felix;
private Map<Long, Bundle> installedBundles;
public FelixWrapper()
{
- felix = new Felix();
installedBundles = new HashMap<Long, Bundle>();
}
public void start(Map properties)
{
- felix.start(new MutablePropertyResolverImpl(properties), null);
+ start(new MutablePropertyResolverImpl(properties), null);
}
public void stop()
{
installedBundles.clear();
installedBundles = null;
- felix.shutdown();
- felix = null;
}
public Bundle installBundle(String location, InputStream is) throws BundleException
Modified: projects/osgi/trunk/deployment/src/main/org/jboss/osgi/deployers/BundleActivatorDeployer.java
===================================================================
--- projects/osgi/trunk/deployment/src/main/org/jboss/osgi/deployers/BundleActivatorDeployer.java 2007-02-26 15:26:55 UTC (rev 60908)
+++ projects/osgi/trunk/deployment/src/main/org/jboss/osgi/deployers/BundleActivatorDeployer.java 2007-02-26 15:34:34 UTC (rev 60909)
@@ -66,7 +66,7 @@
/**
* Deploy / install activator as new BeanMD
*
- * @param unit
+ * @param unit deployment unit
* @throws DeploymentException
*/
public void deploy(DeploymentUnit unit) throws DeploymentException
@@ -85,9 +85,9 @@
/**
* Let Controller take care of BundleActivator lifecycle.
*
- * @param bamd
- * @param bundleAdapter
- * @throws DeploymentException
+ * @param bamd activator meta data
+ * @param bundleAdapter bundle adapter
+ * @throws DeploymentException deployment exception
*/
private void registerBundleActivator(BundleActivatorMetaData bamd, BundleAdapter bundleAdapter) throws DeploymentException
{
@@ -108,4 +108,6 @@
}
}
+ // todo uninstall
+
}
Modified: projects/osgi/trunk/deployment/src/main/org/jboss/osgi/deployers/BundleClassLoaderDeployer.java
===================================================================
--- projects/osgi/trunk/deployment/src/main/org/jboss/osgi/deployers/BundleClassLoaderDeployer.java 2007-02-26 15:26:55 UTC (rev 60908)
+++ projects/osgi/trunk/deployment/src/main/org/jboss/osgi/deployers/BundleClassLoaderDeployer.java 2007-02-26 15:34:34 UTC (rev 60909)
@@ -23,6 +23,7 @@
import org.jboss.deployers.plugins.deployers.helpers.AbstractTopLevelClassLoaderDeployer;
import org.jboss.deployers.spi.structure.DeploymentContext;
+import org.jboss.deployers.spi.deployer.DeploymentUnit;
import org.jboss.osgi.core.platform.spi.BundleAdapter;
import org.jboss.osgi.core.support.BundleDelegatingClassLoader;
@@ -37,7 +38,8 @@
public ClassLoader createTopLevelClassLoader(DeploymentContext context) throws Exception
{
ClassLoader loader = context.getClassLoader();
- BundleAdapter bundleAdapter = context.getTransientAttachments().getAttachment(BundleAdapter.class);
+ DeploymentUnit unit = context.getDeploymentUnit();
+ BundleAdapter bundleAdapter = unit.getTransientManagedObjects().getAttachment(BundleAdapter.class);
if (bundleAdapter != null)
{
ClassLoader parentClassLoader = getParentClassLoader(context);
Modified: projects/osgi/trunk/deployment/src/main/org/jboss/osgi/deployers/BundleManifestDeployer.java
===================================================================
--- projects/osgi/trunk/deployment/src/main/org/jboss/osgi/deployers/BundleManifestDeployer.java 2007-02-26 15:26:55 UTC (rev 60908)
+++ projects/osgi/trunk/deployment/src/main/org/jboss/osgi/deployers/BundleManifestDeployer.java 2007-02-26 15:34:34 UTC (rev 60909)
@@ -21,6 +21,7 @@
*/
package org.jboss.osgi.deployers;
+import java.io.InputStream;
import java.util.jar.Attributes;
import java.util.jar.Manifest;
@@ -31,7 +32,6 @@
import org.jboss.osgi.metadata.plugins.AbstractBundleActivatorMetaData;
import org.jboss.osgi.metadata.spi.BundleActivatorMetaData;
import org.jboss.virtual.VirtualFile;
-import org.jboss.virtual.VFSUtils;
/**
* Parses OSGi Bundle Manifest if BundleAdapter attachment exists.
@@ -56,7 +56,17 @@
VirtualFile manifestVF = unit.getMetaDataFile("MANIFEST.MF");
if (manifestVF != null)
{
- Manifest manifest = VFSUtils.readManifest(manifestVF);
+ // todo - update once we have new vfs snapshot
+ InputStream is = manifestVF.openStream();
+ Manifest manifest;
+ try
+ {
+ manifest = new Manifest(is);
+ }
+ finally
+ {
+ is.close();
+ }
Attributes attributes = manifest.getMainAttributes();
String bundleActivator = attributes.getValue("Bundle-Activator");
if (bundleActivator != null)
More information about the jboss-cvs-commits
mailing list