Author: thomas.diesler(a)jboss.com
Date: 2006-12-23 19:55:22 -0500 (Sat, 23 Dec 2006)
New Revision: 1772
Modified:
branches/tdiesler/trunk/integration-jboss42/src/main/java/org/jboss/ws/integration/jboss42/DeployerInterceptorJSE.java
branches/tdiesler/trunk/integration-jboss42/src/main/java/org/jboss/ws/integration/jboss42/WebMetaDataAdaptor.java
Log:
Fix jse deployement for jboss42
Modified:
branches/tdiesler/trunk/integration-jboss42/src/main/java/org/jboss/ws/integration/jboss42/DeployerInterceptorJSE.java
===================================================================
---
branches/tdiesler/trunk/integration-jboss42/src/main/java/org/jboss/ws/integration/jboss42/DeployerInterceptorJSE.java 2006-12-24
00:55:18 UTC (rev 1771)
+++
branches/tdiesler/trunk/integration-jboss42/src/main/java/org/jboss/ws/integration/jboss42/DeployerInterceptorJSE.java 2006-12-24
00:55:22 UTC (rev 1772)
@@ -27,6 +27,9 @@
import java.util.Iterator;
import java.util.Map;
+import javax.jws.WebService;
+import javax.xml.ws.WebServiceProvider;
+
import org.jboss.deployment.DeploymentInfo;
import org.jboss.metadata.WebMetaData;
import org.jboss.ws.WSException;
@@ -49,6 +52,51 @@
*/
public class DeployerInterceptorJSE extends DeployerInterceptor implements
DeployerInterceptorJSEMBean
{
+ /** Return true if the deployment is a web service endpoint
+ */
+ protected boolean isWebserviceDeployment(DeploymentInfo di)
+ {
+ WebMetaData webMetaData = (WebMetaData)di.metaData;
+ boolean isWebserviceDeployment = webMetaData.isWebServiceDeployment();
+
+ // Check if we have a webservices.xml descriptor
+ if (isWebserviceDeployment == false)
+ {
+ if (getWebservicesDescriptor(di) != null)
+ {
+ di.context.put("UnifiedDeploymentInfo.Type",
UnifiedDeploymentInfo.DeploymentType.JAXRPC_JSE);
+ isWebserviceDeployment = true;
+ }
+ }
+
+ // Check if the web.xml contains annotated endpoint impl
+ if (isWebserviceDeployment == false)
+ {
+ Map servletClassMap = webMetaData.getServletClassMap();
+ Iterator<String> it = servletClassMap.values().iterator();
+ while (it.hasNext() && isWebserviceDeployment == false)
+ {
+ String servletClassName = it.next();
+ try
+ {
+ Class servletClass = di.annotationsCl.loadClass(servletClassName);
+ if (servletClass.isAnnotationPresent(WebService.class) ||
servletClass.isAnnotationPresent(WebServiceProvider.class))
+ {
+ di.context.put("UnifiedDeploymentInfo.Type",
UnifiedDeploymentInfo.DeploymentType.JAXWS_JSE);
+ isWebserviceDeployment = true;
+ }
+ }
+ catch (ClassNotFoundException ex)
+ {
+ log.warn("Cannot load servlet class: " + servletClassName);
+ }
+ }
+ }
+
+ webMetaData.setWebServiceDeployment(isWebserviceDeployment);
+ return isWebserviceDeployment;
+ }
+
protected UnifiedDeploymentInfo createUnifiedDeploymentInfo(DeploymentInfo di) throws
Exception
{
UnifiedDeploymentInfo udi;
@@ -105,51 +153,6 @@
}
}
- /** Return true if the deployment is a web service endpoint
- */
- protected boolean isWebserviceDeployment(DeploymentInfo di)
- {
- WebMetaData webMetaData = (WebMetaData)di.metaData;
- boolean isWebserviceDeployment = webMetaData.isWebServiceDeployment();
-
- // Check if we have a webservices.xml descriptor
- if (isWebserviceDeployment == false)
- {
- if (getWebservicesDescriptor(di) != null)
- {
- di.context.put("UnifiedDeploymentInfo.Type",
UnifiedDeploymentInfo.DeploymentType.JAXRPC_JSE);
- isWebserviceDeployment = true;
- }
- }
-
- // Check if the web.xml contains annotated endpoint impl
- if (isWebserviceDeployment == false)
- {
- Map servletClassMap = webMetaData.getServletClassMap();
- Iterator<String> it = servletClassMap.values().iterator();
- while (it.hasNext() && isWebserviceDeployment == false)
- {
- String servletClassName = it.next();
- try
- {
- Class servletClass = di.annotationsCl.loadClass(servletClassName);
- if (servletClass.isAnnotationPresent(javax.jws.WebService.class))
- {
- di.context.put("UnifiedDeploymentInfo.Type",
UnifiedDeploymentInfo.DeploymentType.JAXWS_JSE);
- isWebserviceDeployment = true;
- }
- }
- catch (ClassNotFoundException ex)
- {
- log.warn("Cannot load servlet class: " + servletClassName);
- }
- }
- }
-
- webMetaData.setWebServiceDeployment(isWebserviceDeployment);
- return isWebserviceDeployment;
- }
-
/**
* Get the resource name of the webservices.xml descriptor.
*/
Modified:
branches/tdiesler/trunk/integration-jboss42/src/main/java/org/jboss/ws/integration/jboss42/WebMetaDataAdaptor.java
===================================================================
---
branches/tdiesler/trunk/integration-jboss42/src/main/java/org/jboss/ws/integration/jboss42/WebMetaDataAdaptor.java 2006-12-24
00:55:18 UTC (rev 1771)
+++
branches/tdiesler/trunk/integration-jboss42/src/main/java/org/jboss/ws/integration/jboss42/WebMetaDataAdaptor.java 2006-12-24
00:55:22 UTC (rev 1772)
@@ -27,6 +27,8 @@
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
import org.jboss.metadata.WebMetaData;
import org.jboss.metadata.WebSecurityMetaData;
@@ -49,6 +51,7 @@
UnifiedWebMetaData umd = new UnifiedWebMetaData();
umd.setContextRoot(wmd.getContextRoot());
umd.setServletMappings(wmd.getServletMappings());
+ umd.setServletClassNames(getServletClassMap(wmd));
umd.setConfigName(wmd.getConfigName());
umd.setConfigFile(wmd.getConfigFile());
umd.setSecurityDomain(wmd.getSecurityDomain());
@@ -98,4 +101,19 @@
return unifiedsecurityMetaData;
}
+ private static Map<String, String> getServletClassMap(WebMetaData wmd)
+ {
+ Map<String, String> mappings = new HashMap<String, String>();
+ Iterator it = wmd.getServletClassMap().entrySet().iterator();
+ while(it.hasNext())
+ {
+ Map.Entry entry = (Entry)it.next();
+ String servletName = (String)entry.getKey();
+ String servletClass = (String)entry.getValue();
+ // Skip JSPs
+ if (servletClass != null)
+ mappings.put(servletName, servletClass);
+ }
+ return mappings;
+ }
}
Show replies by date