[jboss-cvs] JBossAS SVN: r92889 - projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/plugins/facade/bundle.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Thu Aug 27 15:25:29 EDT 2009
Author: alesj
Date: 2009-08-27 15:25:29 -0400 (Thu, 27 Aug 2009)
New Revision: 92889
Modified:
projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/plugins/facade/bundle/OSGiBundleManager.java
Log:
Use duplicated code + few javadocs.
Modified: projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/plugins/facade/bundle/OSGiBundleManager.java
===================================================================
--- projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/plugins/facade/bundle/OSGiBundleManager.java 2009-08-27 19:15:26 UTC (rev 92888)
+++ projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/plugins/facade/bundle/OSGiBundleManager.java 2009-08-27 19:25:29 UTC (rev 92889)
@@ -21,6 +21,7 @@
*/
package org.jboss.osgi.plugins.facade.bundle;
+import java.io.IOException;
import java.net.URL;
import java.security.AccessController;
import java.security.PrivilegedAction;
@@ -36,8 +37,8 @@
import java.util.concurrent.Executor;
import java.util.concurrent.Executors;
import java.util.jar.Attributes;
-import java.util.jar.Manifest;
import java.util.jar.Attributes.Name;
+import java.util.jar.Manifest;
import org.jboss.deployers.client.spi.DeployerClient;
import org.jboss.deployers.spi.DeploymentException;
@@ -231,6 +232,9 @@
/**
* Set a property.
* This is used at the frame work init state.
+ *
+ * @param key the prperty key
+ * @param value the property value
*/
public void setProperty(String key, String value)
{
@@ -330,23 +334,9 @@
try
{
VirtualFile root = VFS.getRoot(url);
- VFSDeployment deployment = VFSDeploymentFactory.getInstance().createVFSDeployment(root);
- deployerClient.deploy(deployment);
- try
- {
- DeploymentUnit unit = deployerStructure.getDeploymentUnit(deployment.getName());
- AbstractBundleState bundleState = unit.getAttachment(OSGiBundleState.class);
- if (bundleState == null)
- throw new IllegalStateException("Unable to determine bundle state for " + deployment.getName());
- return bundleState;
- }
- catch (Exception e)
- {
- deployerClient.undeploy(deployment);
- throw e;
- }
+ return install(root);
}
- catch (Exception e)
+ catch (IOException e)
{
throw new BundleException("Error installing bundle from location=" + url, e);
}
@@ -525,6 +515,7 @@
{
if (bundleState == null)
throw new IllegalArgumentException("Null bundle state");
+
bundleState.uninstallInternal();
bundleState.setBundleManager(null);
long id = bundleState.getBundleId();
@@ -954,6 +945,8 @@
/**
* Fire a framework error
*
+ * @param bundleState the bundle state
+ * @param context the msg context
* @param t the throwable
*/
void fireError(Bundle bundle, String context, Throwable t)
@@ -969,7 +962,9 @@
/**
* Fire a framework error
- *
+ *
+ * @param bundleState the bundle state
+ * @param context the msg context
* @param t the throwable
*/
void fireWarning(Bundle bundle, String context, Throwable t)
More information about the jboss-cvs-commits
mailing list