Author: richard.opalka(a)jboss.com
Date: 2008-05-16 17:47:47 -0400 (Fri, 16 May 2008)
New Revision: 7073
Modified:
container/jboss50/branches/jbossws-jboss500/src/main/java/org/jboss/wsf/container/jboss50/DefaultWebAppDesciptorModifierImpl.java
container/jboss50/branches/jbossws-jboss500/src/main/java/org/jboss/wsf/container/jboss50/WebAppDeploymentAspect.java
container/jboss50/branches/jbossws-jboss500/src/main/java/org/jboss/wsf/container/jboss50/WebAppDesciptorModifier.java
container/jboss50/branches/jbossws-jboss500/src/main/java/org/jboss/wsf/container/jboss50/WebXMLRewriterImpl.java
container/jboss50/branches/jbossws-jboss500/src/main/java/org/jboss/wsf/container/jboss50/deployment/tomcat/ModifyWebMetaDataDeploymentAspect.java
Log:
refactoring
Modified:
container/jboss50/branches/jbossws-jboss500/src/main/java/org/jboss/wsf/container/jboss50/DefaultWebAppDesciptorModifierImpl.java
===================================================================
---
container/jboss50/branches/jbossws-jboss500/src/main/java/org/jboss/wsf/container/jboss50/DefaultWebAppDesciptorModifierImpl.java 2008-05-16
21:11:59 UTC (rev 7072)
+++
container/jboss50/branches/jbossws-jboss500/src/main/java/org/jboss/wsf/container/jboss50/DefaultWebAppDesciptorModifierImpl.java 2008-05-16
21:47:47 UTC (rev 7073)
@@ -30,6 +30,7 @@
import org.jboss.wsf.container.jboss50.deployment.tomcat.RewriteResults;
import org.jboss.wsf.spi.deployment.Deployment;
import org.jboss.wsf.spi.deployment.Endpoint;
+import org.jboss.wsf.spi.transport.HttpSpec;
/**
* Modifies web.xml for jbossws
@@ -47,11 +48,11 @@
RewriteResults results = new RewriteResults();
Element root = webXml.getRootElement();
- String servletClass = (String)dep.getProperty(PROPERTY_WEBAPP_SERVLET_CLASS);
+ String servletClass =
(String)dep.getProperty(HttpSpec.PROPERTY_WEBAPP_SERVLET_CLASS);
if (servletClass == null)
- throw new IllegalStateException("Cannot obtain context property: " +
PROPERTY_WEBAPP_SERVLET_CLASS);
+ throw new IllegalStateException("Cannot obtain context property: " +
HttpSpec.PROPERTY_WEBAPP_SERVLET_CLASS);
- Map<String, String> contextParams = (Map<String,
String>)dep.getProperty(PROPERTY_WEBAPP_CONTEXT_PARAMETERS);
+ Map<String, String> contextParams = (Map<String,
String>)dep.getProperty(HttpSpec.PROPERTY_WEBAPP_CONTEXT_PARAMETERS);
if (contextParams != null)
{
for (Map.Entry<String, String> entry : contextParams.entrySet())
@@ -69,7 +70,7 @@
}
}
- String listenerClass =
(String)dep.getProperty(PROPERTY_WEBAPP_SERVLET_CONTEXT_LISTENER);
+ String listenerClass =
(String)dep.getProperty(HttpSpec.PROPERTY_WEBAPP_SERVLET_CONTEXT_LISTENER);
if (listenerClass != null)
{
Element listener = root.addElement("listener");
Modified:
container/jboss50/branches/jbossws-jboss500/src/main/java/org/jboss/wsf/container/jboss50/WebAppDeploymentAspect.java
===================================================================
---
container/jboss50/branches/jbossws-jboss500/src/main/java/org/jboss/wsf/container/jboss50/WebAppDeploymentAspect.java 2008-05-16
21:11:59 UTC (rev 7072)
+++
container/jboss50/branches/jbossws-jboss500/src/main/java/org/jboss/wsf/container/jboss50/WebAppDeploymentAspect.java 2008-05-16
21:47:47 UTC (rev 7073)
@@ -36,6 +36,7 @@
import org.jboss.wsf.spi.deployment.Deployment;
import org.jboss.wsf.spi.deployment.DeploymentAspect;
import org.jboss.wsf.spi.deployment.WSFDeploymentException;
+import org.jboss.wsf.spi.transport.HttpSpec;
import org.jboss.wsf.spi.WSFRuntime;
/**
@@ -65,7 +66,7 @@
public void create(Deployment dep, WSFRuntime runtime)
{
- URL warURL = (URL)dep.getProperty(WebAppDesciptorModifier.PROPERTY_WEBAPP_URL);
+ URL warURL = (URL)dep.getProperty(HttpSpec.PROPERTY_WEBAPP_URL);
if (warURL == null)
throw new IllegalStateException("Cannot obtain generated webapp
URL");
@@ -77,7 +78,7 @@
// Mark the deployment as generated web app so the JSE deployer hook can ignore
it
MutableAttachments attach =
(MutableAttachments)deployment.getPredeterminedManagedObjects();
- attach.addAttachment(WebAppDesciptorModifier.PROPERTY_GENERATED_WEBAPP,
Boolean.TRUE);
+ attach.addAttachment(HttpSpec.PROPERTY_GENERATED_WEBAPP, Boolean.TRUE);
mainDeployer.deploy(deployment);
@@ -91,7 +92,7 @@
public void destroy(Deployment dep, WSFRuntime runtime)
{
- URL warURL = (URL)dep.getProperty(WebAppDesciptorModifier.PROPERTY_WEBAPP_URL);
+ URL warURL = (URL)dep.getProperty(HttpSpec.PROPERTY_WEBAPP_URL);
if (warURL == null)
{
log.error("Cannot obtain generated webapp URL");
Modified:
container/jboss50/branches/jbossws-jboss500/src/main/java/org/jboss/wsf/container/jboss50/WebAppDesciptorModifier.java
===================================================================
---
container/jboss50/branches/jbossws-jboss500/src/main/java/org/jboss/wsf/container/jboss50/WebAppDesciptorModifier.java 2008-05-16
21:11:59 UTC (rev 7072)
+++
container/jboss50/branches/jbossws-jboss500/src/main/java/org/jboss/wsf/container/jboss50/WebAppDesciptorModifier.java 2008-05-16
21:47:47 UTC (rev 7073)
@@ -33,11 +33,5 @@
*/
public interface WebAppDesciptorModifier
{
- static final String PROPERTY_GENERATED_WEBAPP =
"org.jboss.ws.generated.webapp";
- static final String PROPERTY_WEBAPP_CONTEXT_PARAMETERS =
"org.jboss.ws.webapp.ContextParameterMap";
- static final String PROPERTY_WEBAPP_SERVLET_CLASS =
"org.jboss.ws.webapp.ServletClass";
- static final String PROPERTY_WEBAPP_SERVLET_CONTEXT_LISTENER =
"org.jboss.ws.webapp.ServletContextListener";
- static final String PROPERTY_WEBAPP_URL = "org.jboss.ws.webapp.url";
-
RewriteResults modifyDescriptor(Deployment dep, Document webXml) throws
ClassNotFoundException;
}
Modified:
container/jboss50/branches/jbossws-jboss500/src/main/java/org/jboss/wsf/container/jboss50/WebXMLRewriterImpl.java
===================================================================
---
container/jboss50/branches/jbossws-jboss500/src/main/java/org/jboss/wsf/container/jboss50/WebXMLRewriterImpl.java 2008-05-16
21:11:59 UTC (rev 7072)
+++
container/jboss50/branches/jbossws-jboss500/src/main/java/org/jboss/wsf/container/jboss50/WebXMLRewriterImpl.java 2008-05-16
21:47:47 UTC (rev 7073)
@@ -22,6 +22,7 @@
package org.jboss.wsf.container.jboss50;
import org.jboss.wsf.spi.deployment.Deployment;
+import org.jboss.wsf.spi.transport.HttpSpec;
import org.jboss.wsf.common.IOUtils;
import org.jboss.wsf.container.jboss50.deployment.tomcat.RewriteResults;
import org.dom4j.io.SAXReader;
@@ -33,7 +34,6 @@
import java.net.URL;
import java.io.File;
import java.io.FileInputStream;
-import java.io.InputStream;
import java.io.FileOutputStream;
/**
@@ -63,7 +63,7 @@
public RewriteResults rewriteWebXml(Deployment dep)
{
- URL warURL = (URL)dep.getProperty(WebAppDesciptorModifier.PROPERTY_WEBAPP_URL);
+ URL warURL = (URL)dep.getProperty(HttpSpec.PROPERTY_WEBAPP_URL);
File warFile = new File(warURL.getFile());
if (warFile.isDirectory() == false)
throw new WebServiceException("Expected a war directory: " + warURL);
Modified:
container/jboss50/branches/jbossws-jboss500/src/main/java/org/jboss/wsf/container/jboss50/deployment/tomcat/ModifyWebMetaDataDeploymentAspect.java
===================================================================
---
container/jboss50/branches/jbossws-jboss500/src/main/java/org/jboss/wsf/container/jboss50/deployment/tomcat/ModifyWebMetaDataDeploymentAspect.java 2008-05-16
21:11:59 UTC (rev 7072)
+++
container/jboss50/branches/jbossws-jboss500/src/main/java/org/jboss/wsf/container/jboss50/deployment/tomcat/ModifyWebMetaDataDeploymentAspect.java 2008-05-16
21:47:47 UTC (rev 7073)
@@ -31,10 +31,10 @@
import org.jboss.metadata.web.jboss.JBossWebMetaData;
import org.jboss.metadata.web.spec.ListenerMetaData;
import org.jboss.metadata.web.spec.ServletMetaData;
-import org.jboss.wsf.container.jboss50.WebAppDesciptorModifier;
import org.jboss.wsf.spi.deployment.Deployment;
import org.jboss.wsf.spi.deployment.DeploymentAspect;
import org.jboss.wsf.spi.deployment.Endpoint;
+import org.jboss.wsf.spi.transport.HttpSpec;
import org.jboss.wsf.spi.WSFRuntime;
/**
@@ -48,17 +48,17 @@
@Override
public void create(Deployment dep, WSFRuntime runtime)
{
- String servletClass =
(String)dep.getProperty(WebAppDesciptorModifier.PROPERTY_WEBAPP_SERVLET_CLASS);
+ String servletClass =
(String)dep.getProperty(HttpSpec.PROPERTY_WEBAPP_SERVLET_CLASS);
if (servletClass == null)
- throw new IllegalStateException("Cannot obtain context property: " +
WebAppDesciptorModifier.PROPERTY_WEBAPP_SERVLET_CLASS);
+ throw new IllegalStateException("Cannot obtain context property: " +
HttpSpec.PROPERTY_WEBAPP_SERVLET_CLASS);
modifyServletClass(dep, servletClass);
- String listenerClass =
(String)dep.getProperty(WebAppDesciptorModifier.PROPERTY_WEBAPP_SERVLET_CONTEXT_LISTENER);
+ String listenerClass =
(String)dep.getProperty(HttpSpec.PROPERTY_WEBAPP_SERVLET_CONTEXT_LISTENER);
if (listenerClass != null)
modifyListener(dep, listenerClass);
- Map<String, String> contextParams = (Map<String,
String>)dep.getProperty(WebAppDesciptorModifier.PROPERTY_WEBAPP_CONTEXT_PARAMETERS);
+ Map<String, String> contextParams = (Map<String,
String>)dep.getProperty(HttpSpec.PROPERTY_WEBAPP_CONTEXT_PARAMETERS);
if (contextParams != null)
modifyContextParams(dep, contextParams);
}