[jboss-cvs] JBossAS SVN: r58877 - trunk/deployment/src/main/org/jboss/deployment/services
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Wed Dec 6 15:46:44 EST 2006
Author: scott.stark at jboss.org
Date: 2006-12-06 15:46:42 -0500 (Wed, 06 Dec 2006)
New Revision: 58877
Modified:
trunk/deployment/src/main/org/jboss/deployment/services/DeploymentManagerService.java
trunk/deployment/src/main/org/jboss/deployment/services/DeploymentManagerServiceMBean.java
Log:
Correct the module type identification and add an ejb3DeployerType.
Modified: trunk/deployment/src/main/org/jboss/deployment/services/DeploymentManagerService.java
===================================================================
--- trunk/deployment/src/main/org/jboss/deployment/services/DeploymentManagerService.java 2006-12-06 19:14:11 UTC (rev 58876)
+++ trunk/deployment/src/main/org/jboss/deployment/services/DeploymentManagerService.java 2006-12-06 20:46:42 UTC (rev 58877)
@@ -28,7 +28,6 @@
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
-import java.net.URLConnection;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
@@ -40,7 +39,7 @@
import javax.enterprise.deploy.spi.exceptions.TargetException;
import org.jboss.deployers.plugins.structure.AbstractDeploymentContext;
-import org.jboss.deployers.spi.attachments.Attachments;
+import org.jboss.deployers.spi.deployer.DeploymentUnit;
import org.jboss.deployers.spi.deployment.MainDeployer;
import org.jboss.deployers.spi.structure.DeploymentContext;
import org.jboss.deployers.spi.structure.DeploymentState;
@@ -79,6 +78,7 @@
* The type of attachment used to identify a EJB
*/
private Class ejbDeployerType;
+ private Class ejb3DeployerType;
/**
* The type of attachment used to identify a RAR
*/
@@ -132,6 +132,16 @@
{
this.ejbDeployerType = ejbDeployerType;
}
+
+ public Class getEjb3DeployerType()
+ {
+ return ejb3DeployerType;
+ }
+ public void setEjb3DeployerType(Class ejb3DeployerType)
+ {
+ this.ejb3DeployerType = ejb3DeployerType;
+ }
+
public Class getRarDeployerType()
{
return rarDeployerType;
@@ -194,8 +204,7 @@
// Create a status object
URL deployURL = new URL(url);
- URLConnection conn = deployURL.openConnection();
- int contentLength = conn.getContentLength();
+ int contentLength = deployURL.openConnection().getContentLength();
log.debug("Begin deploy, url: " + deployURL + ", contentLength: " + contentLength);
// Create the local path
@@ -215,7 +224,11 @@
throw new IOException("Failed to create local path: " + parentFile);
}
- InputStream is = conn.getInputStream();
+ InputStream is = moduleID.getContentIS();
+ if( is == null )
+ {
+ is = deployURL.openStream();
+ }
BufferedInputStream bis = new BufferedInputStream(is);
byte[] buffer = new byte[4096];
FileOutputStream fos = new FileOutputStream(deployFile);
@@ -316,6 +329,11 @@
return ids;
}
+ /**
+ * Travers the deployment children to build up the jsr88 module children
+ * @param moduleID
+ * @param info
+ */
private void fillChildrenTargetModuleID(SerializableTargetModuleID moduleID,
DeploymentContext info)
{
@@ -354,25 +372,26 @@
private ModuleType getModuleType(DeploymentContext info)
{
ModuleType type = null;
+ DeploymentUnit unit = info.getDeploymentUnit();
- Attachments attachments = info.getTransientAttachments();
- if (attachments.getAttachment(carDeployerType) != null)
+ if (unit.getAttachment(carDeployerType) != null)
{
type = ModuleType.CAR;
}
- else if (attachments.getAttachment(ejbDeployerType) != null)
+ else if (unit.getAttachment(ejbDeployerType) != null
+ || unit.getAttachment(ejb3DeployerType) != null)
{
type = ModuleType.EJB;
}
- else if (attachments.getAttachment(earDeployerType) != null)
+ else if (unit.getAttachment(earDeployerType) != null)
{
type = ModuleType.EAR;
}
- else if (attachments.getAttachment(rarDeployerType) != null)
+ else if (unit.getAttachment(rarDeployerType) != null)
{
type = ModuleType.RAR;
}
- else if (attachments.getAttachment(warDeployerType) != null)
+ else if (unit.getAttachment(warDeployerType) != null)
{
type = ModuleType.WAR;
}
Modified: trunk/deployment/src/main/org/jboss/deployment/services/DeploymentManagerServiceMBean.java
===================================================================
--- trunk/deployment/src/main/org/jboss/deployment/services/DeploymentManagerServiceMBean.java 2006-12-06 19:14:11 UTC (rev 58876)
+++ trunk/deployment/src/main/org/jboss/deployment/services/DeploymentManagerServiceMBean.java 2006-12-06 20:46:42 UTC (rev 58877)
@@ -27,8 +27,6 @@
import javax.enterprise.deploy.spi.exceptions.TargetException;
import org.jboss.deployers.spi.deployment.MainDeployer;
-import org.jboss.deployers.spi.structure.vfs.StructureBuilder;
-import org.jboss.deployers.spi.structure.vfs.StructuredDeployers;
import org.jboss.deployment.spi.SerializableTargetModuleID;
/**
@@ -53,6 +51,8 @@
public void setEarDeployerType(Class earDeployerType);
public Class getEjbDeployerType();
public void setEjbDeployerType(Class ejbDeployerType);
+ public Class getEjb3DeployerType();
+ public void setEjb3DeployerType(Class ejb3DeployerType);
public Class getRarDeployerType();
public void setRarDeployerType(Class rarDeployerType);
public Class getWarDeployerType();
More information about the jboss-cvs-commits
mailing list