Author: richard.opalka(a)jboss.com
Date: 2008-05-16 13:58:17 -0400 (Fri, 16 May 2008)
New Revision: 7065
Modified:
container/jboss50/branches/jbossws-jboss500/src/main/java/org/jboss/wsf/container/jboss50/deployer/AbstractDeployerHook.java
container/jboss50/branches/jbossws-jboss500/src/main/java/org/jboss/wsf/container/jboss50/deployer/AbstractDeployerHookEJB.java
container/jboss50/branches/jbossws-jboss500/src/main/java/org/jboss/wsf/container/jboss50/deployer/AbstractDeployerHookJSE.java
container/jboss50/branches/jbossws-jboss500/src/main/java/org/jboss/wsf/container/jboss50/deployer/ArchiveDeployerHook.java
container/jboss50/branches/jbossws-jboss500/src/main/java/org/jboss/wsf/container/jboss50/deployer/JAXRPCDeployerHookPostJSE.java
container/jboss50/branches/jbossws-jboss500/src/main/java/org/jboss/wsf/container/jboss50/deployer/JAXRPCDeployerHookPreJSE.java
container/jboss50/branches/jbossws-jboss500/src/main/java/org/jboss/wsf/container/jboss50/deployer/JAXWSDeployerHookPostJSE.java
Log:
sync with jboss501 integration
Modified:
container/jboss50/branches/jbossws-jboss500/src/main/java/org/jboss/wsf/container/jboss50/deployer/AbstractDeployerHook.java
===================================================================
---
container/jboss50/branches/jbossws-jboss500/src/main/java/org/jboss/wsf/container/jboss50/deployer/AbstractDeployerHook.java 2008-05-16
17:57:21 UTC (rev 7064)
+++
container/jboss50/branches/jbossws-jboss500/src/main/java/org/jboss/wsf/container/jboss50/deployer/AbstractDeployerHook.java 2008-05-16
17:58:17 UTC (rev 7065)
@@ -50,16 +50,6 @@
private DeploymentModelFactory deploymentModelFactory;
- public String getRuntimeName()
- {
- return runtimeName;
- }
-
- public void setRuntimeName(String runtimeName)
- {
- this.runtimeName = runtimeName;
- }
-
public WSFRuntime getWsfRuntime()
{
if(null == wsfRuntime)
@@ -76,6 +66,11 @@
this.wsfRuntime = wsfRuntime;
}
+ public void setRuntimeName(String runtimeName)
+ {
+ this.runtimeName = runtimeName;
+ }
+
public DeploymentModelFactory getDeploymentModelFactory()
{
if(null == deploymentModelFactory)
Modified:
container/jboss50/branches/jbossws-jboss500/src/main/java/org/jboss/wsf/container/jboss50/deployer/AbstractDeployerHookEJB.java
===================================================================
---
container/jboss50/branches/jbossws-jboss500/src/main/java/org/jboss/wsf/container/jboss50/deployer/AbstractDeployerHookEJB.java 2008-05-16
17:57:21 UTC (rev 7064)
+++
container/jboss50/branches/jbossws-jboss500/src/main/java/org/jboss/wsf/container/jboss50/deployer/AbstractDeployerHookEJB.java 2008-05-16
17:58:17 UTC (rev 7065)
@@ -24,6 +24,7 @@
import org.jboss.deployers.structure.spi.DeploymentUnit;
import org.jboss.deployers.spi.DeploymentException;
import org.jboss.wsf.spi.deployment.Deployment;
+import static org.jboss.wsf.spi.deployment.Deployment.DeploymentState;
//$Id$
@@ -42,13 +43,11 @@
super.deploy(unit); // Calls create
Deployment dep = unit.getAttachment(Deployment.class);
- if(null==dep || Deployment.DeploymentState.CREATED != dep.getState())
+ if(null==dep || DeploymentState.CREATED != dep.getState())
throw new DeploymentException("Create step failed");
// execute the 'start' step
getWsfRuntime().start(dep);
-
}
-
}
}
Modified:
container/jboss50/branches/jbossws-jboss500/src/main/java/org/jboss/wsf/container/jboss50/deployer/AbstractDeployerHookJSE.java
===================================================================
---
container/jboss50/branches/jbossws-jboss500/src/main/java/org/jboss/wsf/container/jboss50/deployer/AbstractDeployerHookJSE.java 2008-05-16
17:57:21 UTC (rev 7064)
+++
container/jboss50/branches/jbossws-jboss500/src/main/java/org/jboss/wsf/container/jboss50/deployer/AbstractDeployerHookJSE.java 2008-05-16
17:58:17 UTC (rev 7065)
@@ -29,8 +29,8 @@
import org.jboss.metadata.javaee.spec.ParamValueMetaData;
import org.jboss.metadata.web.jboss.JBossWebMetaData;
import org.jboss.metadata.web.spec.ServletMetaData;
-import org.jboss.wsf.container.jboss50.WebAppDesciptorModifier;
import org.jboss.wsf.spi.deployment.Endpoint;
+import org.jboss.wsf.spi.transport.HttpSpec;
/**
* An abstract deployer for JSE Endpoints
@@ -43,7 +43,7 @@
public boolean isWebServiceDeployment(DeploymentUnit unit)
{
JBossWebMetaData webMetaData = unit.getAttachment(JBossWebMetaData.class);
- boolean isGenerated =
Boolean.TRUE.equals(unit.getAttachment(WebAppDesciptorModifier.PROPERTY_GENERATED_WEBAPP));
+ boolean isGenerated =
Boolean.TRUE.equals(unit.getAttachment(HttpSpec.PROPERTY_GENERATED_WEBAPP));
return webMetaData != null && isGenerated == false;
}
Modified:
container/jboss50/branches/jbossws-jboss500/src/main/java/org/jboss/wsf/container/jboss50/deployer/ArchiveDeployerHook.java
===================================================================
---
container/jboss50/branches/jbossws-jboss500/src/main/java/org/jboss/wsf/container/jboss50/deployer/ArchiveDeployerHook.java 2008-05-16
17:57:21 UTC (rev 7064)
+++
container/jboss50/branches/jbossws-jboss500/src/main/java/org/jboss/wsf/container/jboss50/deployer/ArchiveDeployerHook.java 2008-05-16
17:58:17 UTC (rev 7065)
@@ -23,6 +23,8 @@
//$Id$
+import java.net.URL;
+
import org.jboss.deployers.spi.DeploymentException;
import org.jboss.deployers.structure.spi.DeploymentUnit;
import org.jboss.deployers.vfs.spi.structure.VFSDeploymentUnit;
@@ -39,51 +41,39 @@
import org.jboss.xb.binding.UnmarshallerFactory;
import org.w3c.dom.Element;
-import java.net.URL;
-
/**
* An abstract web service deployer.
- *
- * deploy(unit)
+ * <pre>
+ * deploy(unit)
* if(isWebServiceDeployment)
* dep = createDeployment(unit)
- * deploy(dep)
+ * create(dep)
+ * start(dep)
*
* undeploy(unit)
* dep = getDeployment(unit)
- * undeploy(dep)
+ * stop(dep)
+ * destroy(dep)
+ * </pre>
*
* @author Thomas.Diesler(a)jboss.org
+ * @author Heiko.Braun(a)jboss.com
+ *
* @since 25-Apr-2007
*/
public abstract class ArchiveDeployerHook extends AbstractDeployerHook
{
- /** Depending on the type of deployment, this method should return true
- * if the deployment contains web service endpoints.
+ /**
+ * Executes the 'create' step only. <br/>
+ * Subclasses need to take care that the 'start' step is executed as well.
*/
- public abstract boolean isWebServiceDeployment(DeploymentUnit unit);
-
- /** Create the Deployment for a given DeploymentUnit
- */
- public abstract Deployment createDeployment(DeploymentUnit unit);
-
- /** Get the Deployment for a given DeploymentUnit
- */
- public Deployment getDeployment(DeploymentUnit unit)
- {
- Deployment dep = unit.getAttachment(Deployment.class);
- return (dep != null && dep.getType() == getDeploymentType() ? dep : null);
- }
-
public void deploy(DeploymentUnit unit) throws DeploymentException
{
- if (ignoreDeployment(unit))
- return;
-
- if (isWebServiceDeployment(unit))
+ if (!ignoreDeployment(unit) && isWebServiceDeployment(unit))
{
log.debug("deploy: " + unit.getName());
+
Deployment dep = getDeployment(unit);
if (dep == null)
{
@@ -91,11 +81,22 @@
dep.addAttachment(DeploymentUnit.class, unit);
}
- getWsfRuntime().create(dep);
- unit.addAttachment(Deployment.class, dep);
+ if(Deployment.DeploymentState.UNDEFINED == dep.getState())
+ {
+ getWsfRuntime().create(dep);
+ unit.addAttachment(Deployment.class, dep);
+ }
+ else
+ {
+ throw new IllegalArgumentException("Cannot process Deployment in state
" + dep.getState() + ": " + dep);
+ }
}
}
+ /**
+ * Executes the stop() and destroy() lifecycles
+ * @param unit
+ */
public void undeploy(DeploymentUnit unit)
{
if (ignoreDeployment(unit))
@@ -110,6 +111,23 @@
}
}
+ /** Depending on the type of deployment, this method should return true
+ * if the deployment contains web service endpoints.
+ */
+ public abstract boolean isWebServiceDeployment(DeploymentUnit unit);
+
+ /** Create the Deployment for a given DeploymentUnit
+ */
+ public abstract Deployment createDeployment(DeploymentUnit unit);
+
+ /** Get the Deployment for a given DeploymentUnit
+ */
+ public Deployment getDeployment(DeploymentUnit unit)
+ {
+ Deployment dep = unit.getAttachment(Deployment.class);
+ return (dep != null && dep.getType() == getDeploymentType() ? dep : null);
+ }
+
/** Unmrashall the webservices.xml if there is one
*/
protected WebservicesMetaData getWebservicesMetaData(DeploymentUnit unit)
Modified:
container/jboss50/branches/jbossws-jboss500/src/main/java/org/jboss/wsf/container/jboss50/deployer/JAXRPCDeployerHookPostJSE.java
===================================================================
---
container/jboss50/branches/jbossws-jboss500/src/main/java/org/jboss/wsf/container/jboss50/deployer/JAXRPCDeployerHookPostJSE.java 2008-05-16
17:57:21 UTC (rev 7064)
+++
container/jboss50/branches/jbossws-jboss500/src/main/java/org/jboss/wsf/container/jboss50/deployer/JAXRPCDeployerHookPostJSE.java 2008-05-16
17:58:17 UTC (rev 7065)
@@ -23,9 +23,11 @@
// $Id$
+import org.jboss.deployers.spi.DeploymentException;
import org.jboss.deployers.structure.spi.DeploymentUnit;
import org.jboss.wsf.spi.deployment.Deployment;
import org.jboss.wsf.spi.metadata.webservices.WebservicesMetaData;
+import static org.jboss.wsf.spi.deployment.Deployment.DeploymentState;
/**
* A deployer JAXRPC JSE Endpoints
@@ -35,18 +37,39 @@
*/
public class JAXRPCDeployerHookPostJSE extends DeployerHookPostJSE
{
- /** Get the deployment type this deployer can handle
+
+ /**
+ * Expects the 'create' step to be executed in
+ * {@link org.jboss.wsf.container.jboss50.deployer.JAXRPCDeployerHookPreJSE}
+ * and executes the 'start' step.
+ *
*/
+ public void deploy(DeploymentUnit unit) throws DeploymentException
+ {
+ if (!ignoreDeployment(unit) && isWebServiceDeployment(unit))
+ {
+ Deployment dep = getDeployment(unit);
+ if(null==dep || DeploymentState.CREATED != dep.getState())
+ throw new DeploymentException("Create step is missing");
+
+ // execute the 'start' step
+ getWsfRuntime().start(dep);
+ }
+ }
+
+ /**
+ * Get the deployment type this deployer can handle
+ */
public Deployment.DeploymentType getDeploymentType()
{
return Deployment.DeploymentType.JAXRPC_JSE;
}
-
@Override
public boolean isWebServiceDeployment(DeploymentUnit unit)
{
WebservicesMetaData wsMetaData = getWebservicesMetaData(unit);
return (wsMetaData!=null && super.isWebServiceDeployment(unit));
}
+
}
Modified:
container/jboss50/branches/jbossws-jboss500/src/main/java/org/jboss/wsf/container/jboss50/deployer/JAXRPCDeployerHookPreJSE.java
===================================================================
---
container/jboss50/branches/jbossws-jboss500/src/main/java/org/jboss/wsf/container/jboss50/deployer/JAXRPCDeployerHookPreJSE.java 2008-05-16
17:57:21 UTC (rev 7064)
+++
container/jboss50/branches/jbossws-jboss500/src/main/java/org/jboss/wsf/container/jboss50/deployer/JAXRPCDeployerHookPreJSE.java 2008-05-16
17:58:17 UTC (rev 7065)
@@ -46,6 +46,7 @@
*/
public class JAXRPCDeployerHookPreJSE extends AbstractDeployerHookJSE
{
+
public void undeploy(DeploymentUnit unit)
{
// the JAXRPCDeployerHookPostJSE deals with undeployments
Modified:
container/jboss50/branches/jbossws-jboss500/src/main/java/org/jboss/wsf/container/jboss50/deployer/JAXWSDeployerHookPostJSE.java
===================================================================
---
container/jboss50/branches/jbossws-jboss500/src/main/java/org/jboss/wsf/container/jboss50/deployer/JAXWSDeployerHookPostJSE.java 2008-05-16
17:57:21 UTC (rev 7064)
+++
container/jboss50/branches/jbossws-jboss500/src/main/java/org/jboss/wsf/container/jboss50/deployer/JAXWSDeployerHookPostJSE.java 2008-05-16
17:58:17 UTC (rev 7065)
@@ -27,6 +27,7 @@
import org.jboss.deployers.spi.DeploymentException;
import org.jboss.wsf.spi.deployment.Deployment;
import org.jboss.wsf.spi.metadata.webservices.WebservicesMetaData;
+import static org.jboss.wsf.spi.deployment.Deployment.DeploymentState;
/**
* @author Heiko.Braun(a)jboss.com
@@ -34,6 +35,7 @@
*/
public class JAXWSDeployerHookPostJSE extends DeployerHookPostJSE
{
+
/**
* Expects the 'create' step to be executed in
* {@link org.jboss.wsf.container.jboss50.deployer.JAXWSDeployerHookPreJSE} and
@@ -45,7 +47,7 @@
if (!ignoreDeployment(unit) && isWebServiceDeployment(unit))
{
Deployment dep = getDeployment(unit);
- if (null == dep || Deployment.DeploymentState.CREATED != dep.getState())
+ if (null == dep || DeploymentState.CREATED != dep.getState())
throw new DeploymentException("Create step failed");
// execute the 'start' step
Show replies by date