Author: alessio.soldano(a)jboss.com
Date: 2010-06-29 12:33:18 -0400 (Tue, 29 Jun 2010)
New Revision: 12544
Modified:
container/jboss50/branches/jbossws-jboss510/src/main/java/org/jboss/webservices/integration/tomcat/WebMetaDataModifier.java
Log:
- [JBWS-3073] add check for servlet class provider parameter when modifying the jbossweb
metadata
- [JBAS-7902] remove context params propagation (not used anymore)
Modified:
container/jboss50/branches/jbossws-jboss510/src/main/java/org/jboss/webservices/integration/tomcat/WebMetaDataModifier.java
===================================================================
---
container/jboss50/branches/jbossws-jboss510/src/main/java/org/jboss/webservices/integration/tomcat/WebMetaDataModifier.java 2010-06-29
16:18:41 UTC (rev 12543)
+++
container/jboss50/branches/jbossws-jboss510/src/main/java/org/jboss/webservices/integration/tomcat/WebMetaDataModifier.java 2010-06-29
16:33:18 UTC (rev 12544)
@@ -22,7 +22,6 @@
package org.jboss.webservices.integration.tomcat;
import java.util.List;
-import java.util.Map;
import org.jboss.logging.Logger;
import org.jboss.metadata.javaee.spec.ParamValueMetaData;
@@ -34,6 +33,7 @@
import org.jboss.wsf.common.integration.WSHelper;
import org.jboss.wsf.spi.deployment.Deployment;
import org.jboss.wsf.spi.deployment.Endpoint;
+import org.jboss.wsf.spi.deployment.ServletClassProvider;
/**
* The modifier of jboss web meta data.
@@ -66,40 +66,11 @@
{
final JBossWebMetaData jbossWebMD = WSHelper.getRequiredAttachment(dep,
JBossWebMetaData.class);
- this.propagateContextProps(dep, jbossWebMD);
this.configureEndpoints(dep, jbossWebMD);
this.modifyContextRoot(dep, jbossWebMD);
}
/**
- * Propagates stack specific context parameters if specified.
- *
- * @param dep webservice deployment
- * @param jbossWebMD web meta data
- */
- @SuppressWarnings("unchecked")
- private void propagateContextProps(final Deployment dep, final JBossWebMetaData
jbossWebMD)
- {
- final Map<String, String> stackContextParams = (Map<String, String>)
dep
- .getProperty(WSConstants.STACK_CONTEXT_PARAMS);
-
- if (stackContextParams != null)
- {
- this.log.debug("Creating context parameters");
- final List<ParamValueMetaData> contextParams =
WebMetaDataHelper.getContextParams(jbossWebMD);
-
- for (Map.Entry<String, String> entry : stackContextParams.entrySet())
- {
- final String paramName = entry.getKey();
- final String paramValue = entry.getValue();
-
- this.log.debug("Setting context parameter name: " + paramName +
" value: " + paramValue);
- WebMetaDataHelper.newParamValue(paramName, paramValue, contextParams);
- }
- }
- }
-
- /**
* Configures transport servlet class for every found webservice endpoint.
*
* @param dep webservice deployment
@@ -109,7 +80,7 @@
{
final String transportClassName = this.getTransportClassName(dep);
final ClassLoader loader = dep.getInitialClassLoader();
- this.log.debug("Modifying servlets");
+ this.log.trace("Modifying servlets");
for (final ServletMetaData servletMD : jbossWebMD.getServlets())
{
@@ -151,11 +122,29 @@
*/
private String getTransportClassName(final Deployment dep)
{
- final String transportClassName = (String)
dep.getProperty(WSConstants.STACK_TRANSPORT_CLASS);
+ String transportClassName = null;
+ String transportClassProviderName = (String)
dep.getProperty(WSConstants.STACK_TRANSPORT_CLASS_PROVIDER);
+ if (transportClassProviderName != null)
+ {
+ try
+ {
+ ServletClassProvider scp =
(ServletClassProvider)(Class.forName(transportClassProviderName).newInstance());
+ transportClassName = scp.getServletClassName();
+ }
+ catch (Exception e)
+ {
+ log.warn("Cannot get transport class name from " +
WSConstants.STACK_TRANSPORT_CLASS_PROVIDER, e);
+ }
+ }
+
+ if (transportClassName == null)
+ {
+ transportClassName = (String)
dep.getProperty(WSConstants.STACK_TRANSPORT_CLASS);
+ }
if (transportClassName == null)
{
- throw new IllegalStateException("Cannot obtain deployment property: "
+ WSConstants.STACK_TRANSPORT_CLASS);
+ throw new IllegalStateException("Cannot obtain deployment property : "
+ WSConstants.STACK_TRANSPORT_CLASS);
}
return transportClassName;
Show replies by date