JBossWS SVN: r10401 - stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2009-07-28 12:16:08 -0400 (Tue, 28 Jul 2009)
New Revision: 10401
Modified:
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/ServletControllerExt.java
Log:
[JBWS-2227] Setting autoRewriteSoapAddress prop on EndpointInfo to enable soap:address rewrite (requires new CXF version)
Modified: stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/ServletControllerExt.java
===================================================================
--- stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/ServletControllerExt.java 2009-07-28 13:54:43 UTC (rev 10400)
+++ stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/ServletControllerExt.java 2009-07-28 16:16:08 UTC (rev 10401)
@@ -39,8 +39,12 @@
import org.apache.cxf.transport.servlet.ServletTransportFactory;
import org.apache.cxf.transports.http.QueryHandler;
import org.apache.cxf.transports.http.QueryHandlerRegistry;
+import org.jboss.wsf.spi.SPIProvider;
+import org.jboss.wsf.spi.SPIProviderResolver;
import org.jboss.wsf.spi.deployment.Endpoint;
import org.jboss.wsf.spi.management.EndpointMetrics;
+import org.jboss.wsf.spi.management.ServerConfig;
+import org.jboss.wsf.spi.management.ServerConfigFactory;
/**
* An extension to the CXF servlet controller
@@ -53,6 +57,7 @@
private ServletTransportFactory cxfTransport;
private ServletContext servletCtx;
private Bus bus;
+ private ServerConfig serverConfig;
public ServletControllerExt(ServletTransportFactory cxfTransport, ServletConfig config, ServletContext servletCtx, Bus bus)
{
@@ -60,6 +65,8 @@
this.cxfTransport = cxfTransport;
this.servletCtx = servletCtx;
this.bus = bus;
+ SPIProvider spiProvider = SPIProviderResolver.getInstance().getProvider();
+ serverConfig = spiProvider.getSPI(ServerConfigFactory.class).getServerConfig();
}
/**
@@ -128,6 +135,10 @@
String ctxUri = req.getRequestURI();
String baseUri = req.getRequestURL().toString() + "?" + req.getQueryString();
EndpointInfo endpointInfo = dest.getEndpointInfo();
+ if (ServerConfig.UNDEFINED_HOSTNAME.equals(serverConfig.getWebServiceHost()))
+ {
+ endpointInfo.setProperty("autoRewriteSoapAddress", true);
+ }
for (QueryHandler queryHandler : bus.getExtension(QueryHandlerRegistry.class).getHandlers())
{
15 years, 5 months
JBossWS SVN: r10400 - framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/swaref.
by jbossws-commits@lists.jboss.org
Author: mageshbk(a)jboss.com
Date: 2009-07-28 09:54:43 -0400 (Tue, 28 Jul 2009)
New Revision: 10400
Added:
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/swaref/DocumentPayloadWithList.java
Modified:
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/swaref/SWARefTestCase.java
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/swaref/WrappedEndpoint.java
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/swaref/WrappedEndpointImpl.java
Log:
[JBWS-2708] XmlAttachmentRef annotation on List<DataHandler> is not identified as an Attachment part - Added testcase
Added: framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/swaref/DocumentPayloadWithList.java
===================================================================
--- framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/swaref/DocumentPayloadWithList.java (rev 0)
+++ framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/swaref/DocumentPayloadWithList.java 2009-07-28 13:54:43 UTC (rev 10400)
@@ -0,0 +1,51 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.ws.jaxws.samples.swaref;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.activation.DataHandler;
+import javax.xml.bind.annotation.XmlAttachmentRef;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+
+@XmlRootElement
+public class DocumentPayloadWithList
+{
+ @XmlElement
+ @XmlAttachmentRef
+ private List<DataHandler> data;
+
+ public DocumentPayloadWithList()
+ {
+ }
+
+ public List<DataHandler> getData()
+ {
+ if (data == null)
+ {
+ data = new ArrayList<DataHandler>();
+ }
+ return data;
+ }
+}
Modified: framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/swaref/SWARefTestCase.java
===================================================================
--- framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/swaref/SWARefTestCase.java 2009-07-28 11:36:39 UTC (rev 10399)
+++ framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/swaref/SWARefTestCase.java 2009-07-28 13:54:43 UTC (rev 10400)
@@ -91,4 +91,17 @@
assertTrue(response.getData().getContent().equals("Server data"));
}
+
+ public void testListAnnotationWithWrapped() throws Exception
+ {
+ //[JBWS-2708]
+ Service service = Service.create(new URL(wrappedEndpointURL+"?wsdl"), wrappedServiceQName);
+ WrappedEndpoint port = service.getPort(WrappedEndpoint.class);
+ DocumentPayloadWithList payload = new DocumentPayloadWithList();
+ payload.getData().add(data);
+
+ DocumentPayloadWithList response = port.listAnnotation(payload, "Wrapped test");
+ assertTrue(response.getData().get(0).getContent().equals("Server data"));
+
+ }
}
Modified: framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/swaref/WrappedEndpoint.java
===================================================================
--- framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/swaref/WrappedEndpoint.java 2009-07-28 11:36:39 UTC (rev 10399)
+++ framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/swaref/WrappedEndpoint.java 2009-07-28 13:54:43 UTC (rev 10400)
@@ -33,6 +33,9 @@
DocumentPayload beanAnnotation(DocumentPayload dhw, String test);
@WebMethod
+ DocumentPayloadWithList listAnnotation(DocumentPayloadWithList dhw, String test);
+
+ @WebMethod
@XmlAttachmentRef
DataHandler parameterAnnotation(DocumentPayload payload, String test, @XmlAttachmentRef DataHandler data);
Modified: framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/swaref/WrappedEndpointImpl.java
===================================================================
--- framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/swaref/WrappedEndpointImpl.java 2009-07-28 11:36:39 UTC (rev 10399)
+++ framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/swaref/WrappedEndpointImpl.java 2009-07-28 13:54:43 UTC (rev 10400)
@@ -75,7 +75,44 @@
return new DocumentPayload(dh);
}
+ @WebMethod
+ public DocumentPayloadWithList listAnnotation(DocumentPayloadWithList dhw, String test)
+ {
+ DataHandler dh;
+
+ try {
+ System.out.println("[TestServiceImpl] ---> Dans le service");
+ if (dhw != null && dhw.getData() != null && dhw.getData().get(0) != null) {
+ dh=dhw.getData().get(0);
+ dumpDH(dh);
+ }
+ else
+ {
+ System.out.println("[TestServiceImpl] ---> Le DataHandler est NULL.");
+ }
+ }
+ catch (Exception ex) {
+ ex.printStackTrace();
+ }
+
+ dh = new DataHandler("Server data", "text/plain") ;
+
+ try{
+ System.out.println("[TestServiceImpl] ---> Le DataHandler returned.");
+ dumpDH(dh);
+ }
+ catch (Exception ex) {
+ ex.printStackTrace();
+ }
+
+ DocumentPayloadWithList payload = new DocumentPayloadWithList();
+ payload.getData().add(dh);
+
+ return payload;
+ }
+
+
@WebMethod
@XmlAttachmentRef
public DataHandler parameterAnnotation(DocumentPayload payload, String test, @XmlAttachmentRef DataHandler data)
15 years, 5 months
JBossWS SVN: r10399 - stack/native/trunk/modules/core/src/main/java/org/jboss/ws/extensions/xop/jaxws.
by jbossws-commits@lists.jboss.org
Author: mageshbk(a)jboss.com
Date: 2009-07-28 07:36:39 -0400 (Tue, 28 Jul 2009)
New Revision: 10399
Modified:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/extensions/xop/jaxws/ReflectiveAttachmentRefScanner.java
Log:
[JBWS-2708] XmlAttachmentRef annotation on List<DataHandler> is not identified as an Attachment part - fixed
Modified: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/extensions/xop/jaxws/ReflectiveAttachmentRefScanner.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/extensions/xop/jaxws/ReflectiveAttachmentRefScanner.java 2009-07-28 10:39:39 UTC (rev 10398)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/extensions/xop/jaxws/ReflectiveAttachmentRefScanner.java 2009-07-28 11:36:39 UTC (rev 10399)
@@ -86,6 +86,7 @@
boolean exceptionToTheRule = isAttachmentDataType(type);
if (! exceptionToTheRule) {
type = getFieldComponentType(field);
+ exceptionToTheRule = isAttachmentDataType(type);
}
// only non JDK types are inspected except for byte[] and java.lang.String
if( !alreadyScanned(field) && (exceptionToTheRule || !isJDKType(type)) )
15 years, 5 months
JBossWS SVN: r10398 - common/branches/ropalka/src/main/java/org/jboss/wsf/test.
by jbossws-commits@lists.jboss.org
Author: richard.opalka(a)jboss.com
Date: 2009-07-28 06:39:39 -0400 (Tue, 28 Jul 2009)
New Revision: 10398
Modified:
common/branches/ropalka/src/main/java/org/jboss/wsf/test/JBossWSTestHelper.java
Log:
adding option to disable test deployments
Modified: common/branches/ropalka/src/main/java/org/jboss/wsf/test/JBossWSTestHelper.java
===================================================================
--- common/branches/ropalka/src/main/java/org/jboss/wsf/test/JBossWSTestHelper.java 2009-07-28 08:48:31 UTC (rev 10397)
+++ common/branches/ropalka/src/main/java/org/jboss/wsf/test/JBossWSTestHelper.java 2009-07-28 10:39:39 UTC (rev 10398)
@@ -50,6 +50,7 @@
private static final String SYSPROP_JBOSS_BIND_ADDRESS = "jboss.bind.address";
private static final String SYSPROP_TEST_ARCHIVE_DIRECTORY = "test.archive.directory";
private static final String SYSPROP_TEST_RESOURCES_DIRECTORY = "test.resources.directory";
+ private static final boolean DEPLOY_PROCESS_ENABLED = !Boolean.getBoolean("test.disable.deployment");
private static MBeanServerConnection server;
private static String integrationTarget;
@@ -63,16 +64,22 @@
*/
public void deploy(String archive) throws Exception
{
- URL url = getArchiveFile(archive).toURL();
- getDeployer().deploy(url);
+ if ( DEPLOY_PROCESS_ENABLED )
+ {
+ URL archiveURL = getArchiveFile(archive).toURL();
+ getDeployer().deploy(archiveURL);
+ }
}
/** Undeploy the given archive
*/
public void undeploy(String archive) throws Exception
{
- URL url = getArchiveFile(archive).toURL();
- getDeployer().undeploy(url);
+ if ( DEPLOY_PROCESS_ENABLED )
+ {
+ URL archiveURL = getArchiveFile(archive).toURL();
+ getDeployer().undeploy(archiveURL);
+ }
}
/** True, if -Djbossws.integration.target=jboss5x */
15 years, 5 months
JBossWS SVN: r10397 - container/jboss50/branches/ropalka-jboss510/src/main/resources/jbossws-jboss50.deployer/META-INF.
by jbossws-commits@lists.jboss.org
Author: richard.opalka(a)jboss.com
Date: 2009-07-28 04:48:31 -0400 (Tue, 28 Jul 2009)
New Revision: 10397
Modified:
container/jboss50/branches/ropalka-jboss510/src/main/resources/jbossws-jboss50.deployer/META-INF/stack-agnostic-jboss-beans.xml
Log:
[JBWS-2699] fixing issue
Modified: container/jboss50/branches/ropalka-jboss510/src/main/resources/jbossws-jboss50.deployer/META-INF/stack-agnostic-jboss-beans.xml
===================================================================
--- container/jboss50/branches/ropalka-jboss510/src/main/resources/jbossws-jboss50.deployer/META-INF/stack-agnostic-jboss-beans.xml 2009-07-28 08:47:35 UTC (rev 10396)
+++ container/jboss50/branches/ropalka-jboss510/src/main/resources/jbossws-jboss50.deployer/META-INF/stack-agnostic-jboss-beans.xml 2009-07-28 08:48:31 UTC (rev 10397)
@@ -129,7 +129,7 @@
<property name="relativeOrder">35</property> <!-- [JBDEPLOY-201] workaround -->
</bean>
- <bean name="WSURLPatternDeploymentAspect" class="org.jboss.wsf.framework.deployment.BackwardCompatibleURLPatternDeploymentAspect">
+ <bean name="WSURLPatternDeploymentAspect" class="org.jboss.wsf.framework.deployment.URLPatternDeploymentAspect">
<property name="requires">ContextRoot, ContainerMetaData</property>
<property name="provides">URLPattern</property>
<property name="relativeOrder">15</property> <!-- [JBDEPLOY-201] workaround -->
15 years, 5 months
JBossWS SVN: r10396 - framework/branches/ropalka/src/main/java/org/jboss/wsf/framework/deployment.
by jbossws-commits@lists.jboss.org
Author: richard.opalka(a)jboss.com
Date: 2009-07-28 04:47:35 -0400 (Tue, 28 Jul 2009)
New Revision: 10396
Removed:
framework/branches/ropalka/src/main/java/org/jboss/wsf/framework/deployment/BackwardCompatibleURLPatternDeploymentAspect.java
Modified:
framework/branches/ropalka/src/main/java/org/jboss/wsf/framework/deployment/URLPatternDeploymentAspect.java
Log:
[JBWS-2699] fixing issue
Deleted: framework/branches/ropalka/src/main/java/org/jboss/wsf/framework/deployment/BackwardCompatibleURLPatternDeploymentAspect.java
===================================================================
--- framework/branches/ropalka/src/main/java/org/jboss/wsf/framework/deployment/BackwardCompatibleURLPatternDeploymentAspect.java 2009-07-27 12:49:11 UTC (rev 10395)
+++ framework/branches/ropalka/src/main/java/org/jboss/wsf/framework/deployment/BackwardCompatibleURLPatternDeploymentAspect.java 2009-07-28 08:47:35 UTC (rev 10396)
@@ -1,64 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.wsf.framework.deployment;
-
-import org.jboss.wsf.framework.deployment.URLPatternDeploymentAspect;
-import org.jboss.wsf.spi.deployment.Deployment;
-import org.jboss.wsf.spi.deployment.Endpoint;
-
-import java.util.StringTokenizer;
-
-
-/**
- * A deployer that assigns the URLPattern to endpoints.
- *
- * This deployer uses the first token from the <port-component-uri>
- * as the context root.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 19-May-2007
- */
-public class BackwardCompatibleURLPatternDeploymentAspect extends URLPatternDeploymentAspect
-{
-
- @Override
- protected String getExplicitPattern(Deployment dep, Endpoint ep)
- {
- String contextRoot = dep.getService().getContextRoot();
- if (contextRoot == null)
- throw new IllegalStateException("Cannot obtain context root");
-
- String urlPattern = super.getExplicitPattern(dep, ep);
- if (urlPattern != null)
- {
- if (urlPattern.startsWith("/") == false)
- urlPattern = "/" + urlPattern;
-
- StringTokenizer st = new StringTokenizer(urlPattern, "/");
- if (st.countTokens() > 1 && urlPattern.startsWith(contextRoot + "/"))
- {
- urlPattern = urlPattern.substring(contextRoot.length());
- }
- }
- return urlPattern;
- }
-}
Modified: framework/branches/ropalka/src/main/java/org/jboss/wsf/framework/deployment/URLPatternDeploymentAspect.java
===================================================================
--- framework/branches/ropalka/src/main/java/org/jboss/wsf/framework/deployment/URLPatternDeploymentAspect.java 2009-07-27 12:49:11 UTC (rev 10395)
+++ framework/branches/ropalka/src/main/java/org/jboss/wsf/framework/deployment/URLPatternDeploymentAspect.java 2009-07-28 08:47:35 UTC (rev 10396)
@@ -21,6 +21,8 @@
*/
package org.jboss.wsf.framework.deployment;
+import java.util.StringTokenizer;
+
import org.jboss.wsf.spi.annotation.WebContext;
import org.jboss.wsf.spi.deployment.Deployment;
import org.jboss.wsf.spi.deployment.DeploymentAspect;
@@ -78,6 +80,19 @@
{
EJBMetaData bmd = appMetaData.getBeanByEjbName(ep.getShortName());
urlPattern = bmd.getPortComponentURI();
+ if (urlPattern != null)
+ {
+ String contextRoot = dep.getService().getContextRoot();
+
+ if (urlPattern.startsWith("/") == false)
+ urlPattern = "/" + urlPattern;
+
+ StringTokenizer st = new StringTokenizer(urlPattern, "/");
+ if (st.countTokens() > 1 && urlPattern.startsWith(contextRoot + "/"))
+ {
+ urlPattern = urlPattern.substring(contextRoot.length());
+ }
+ }
}
// #3 For EJB use @WebContext.urlPattern
15 years, 5 months
JBossWS SVN: r10395 - stack/native/branches/ropalka/modules/core/src/main/resources.
by jbossws-commits@lists.jboss.org
Author: richard.opalka(a)jboss.com
Date: 2009-07-27 08:49:11 -0400 (Mon, 27 Jul 2009)
New Revision: 10395
Modified:
stack/native/branches/ropalka/modules/core/src/main/resources/jbossws-native-config.xml
Log:
[JBWS-2332] refactoring
Modified: stack/native/branches/ropalka/modules/core/src/main/resources/jbossws-native-config.xml
===================================================================
--- stack/native/branches/ropalka/modules/core/src/main/resources/jbossws-native-config.xml 2009-07-27 12:42:07 UTC (rev 10394)
+++ stack/native/branches/ropalka/modules/core/src/main/resources/jbossws-native-config.xml 2009-07-27 12:49:11 UTC (rev 10395)
@@ -26,7 +26,7 @@
<property name="contextProperties">
<map keyClass="java.lang.String" valueClass="java.lang.String">
<entry>
- <key>org.jboss.wsf.common.integration.Constants.StackTransportClass</key>
+ <key>stack.transport.class</key>
<value>org.jboss.wsf.stack.jbws.EndpointServlet</value>
</entry>
</map>
15 years, 5 months
JBossWS SVN: r10394 - in stack/metro/branches/ropalka/modules/server/src/main: java/org/jboss/wsf/stack/metro/metadata and 1 other directories.
by jbossws-commits@lists.jboss.org
Author: richard.opalka(a)jboss.com
Date: 2009-07-27 08:42:07 -0400 (Mon, 27 Jul 2009)
New Revision: 10394
Modified:
stack/metro/branches/ropalka/modules/server/src/main/java/org/jboss/wsf/stack/metro/SunJaxwsDeploymentAspect.java
stack/metro/branches/ropalka/modules/server/src/main/java/org/jboss/wsf/stack/metro/metadata/RuntimeModelDeploymentAspect.java
stack/metro/branches/ropalka/modules/server/src/main/resources/jbossws-metro-config.xml
Log:
[JBWS-2332] refactoring
Modified: stack/metro/branches/ropalka/modules/server/src/main/java/org/jboss/wsf/stack/metro/SunJaxwsDeploymentAspect.java
===================================================================
--- stack/metro/branches/ropalka/modules/server/src/main/java/org/jboss/wsf/stack/metro/SunJaxwsDeploymentAspect.java 2009-07-27 12:35:51 UTC (rev 10393)
+++ stack/metro/branches/ropalka/modules/server/src/main/java/org/jboss/wsf/stack/metro/SunJaxwsDeploymentAspect.java 2009-07-27 12:42:07 UTC (rev 10394)
@@ -21,7 +21,7 @@
*/
package org.jboss.wsf.stack.metro;
-import org.jboss.wsf.common.integration.Constants;
+import org.jboss.wsf.common.integration.WSConstants;
import org.jboss.wsf.spi.deployment.Deployment;
import org.jboss.wsf.spi.deployment.DeploymentAspect;
import org.jboss.wsf.spi.deployment.Endpoint;
@@ -93,17 +93,17 @@
*
* @param dep webservice deployment
* @param jaxwsConfigURL Metro DD URL
- * @see org.jboss.wsf.common.integration.Constants.STACK_CONTEXT_PARAMS
+ * @see org.jboss.wsf.common.integration.WSConstants.STACK_CONTEXT_PARAMS
*/
private static void putSunJaxwsConfigToDeployment(Deployment dep, URL jaxwsConfigURL)
{
// get property map
- Map<String, String> contextParams = (Map<String, String>)dep.getProperty(Constants.STACK_CONTEXT_PARAMS);
+ Map<String, String> contextParams = (Map<String, String>)dep.getProperty(WSConstants.STACK_CONTEXT_PARAMS);
if (contextParams == null)
{
// if there's no associated map with the property create it now
contextParams = new HashMap<String, String>();
- dep.setProperty(Constants.STACK_CONTEXT_PARAMS, contextParams);
+ dep.setProperty(WSConstants.STACK_CONTEXT_PARAMS, contextParams);
}
// put sun jaxws config URL to the property map
contextParams.put(RuntimeModelDeploymentAspect.PARAM_SUN_JAXWS_URL, jaxwsConfigURL.toExternalForm());
Modified: stack/metro/branches/ropalka/modules/server/src/main/java/org/jboss/wsf/stack/metro/metadata/RuntimeModelDeploymentAspect.java
===================================================================
--- stack/metro/branches/ropalka/modules/server/src/main/java/org/jboss/wsf/stack/metro/metadata/RuntimeModelDeploymentAspect.java 2009-07-27 12:35:51 UTC (rev 10393)
+++ stack/metro/branches/ropalka/modules/server/src/main/java/org/jboss/wsf/stack/metro/metadata/RuntimeModelDeploymentAspect.java 2009-07-27 12:42:07 UTC (rev 10394)
@@ -33,7 +33,7 @@
import org.jboss.logging.Logger;
import org.jboss.wsf.common.ResourceLoaderAdapter;
-import org.jboss.wsf.common.integration.Constants;
+import org.jboss.wsf.common.integration.WSConstants;
import org.jboss.wsf.spi.deployment.ArchiveDeployment;
import org.jboss.wsf.spi.deployment.Deployment;
import org.jboss.wsf.spi.deployment.DeploymentAspect;
@@ -143,7 +143,7 @@
private URL getDDUrlFromContext(Deployment deployment) throws MalformedURLException
{
Map<String, String> contextProperties =
- (Map<String, String>)deployment.getProperty(Constants.STACK_CONTEXT_PARAMS);
+ (Map<String, String>)deployment.getProperty(WSConstants.STACK_CONTEXT_PARAMS);
return new URL(contextProperties.get(PARAM_SUN_JAXWS_URL));
}
Modified: stack/metro/branches/ropalka/modules/server/src/main/resources/jbossws-metro-config.xml
===================================================================
--- stack/metro/branches/ropalka/modules/server/src/main/resources/jbossws-metro-config.xml 2009-07-27 12:35:51 UTC (rev 10393)
+++ stack/metro/branches/ropalka/modules/server/src/main/resources/jbossws-metro-config.xml 2009-07-27 12:42:07 UTC (rev 10394)
@@ -30,8 +30,10 @@
<property name="provides">ContextProperties</property>
<property name="contextProperties">
<map keyClass="java.lang.String" valueClass="java.lang.String">
- <entry><key>org.jboss.wsf.common.integration.Constants.StackTransportClass</key>
- <value>org.jboss.wsf.stack.metro.EndpointServlet</value></entry>
+ <entry>
+ <key>stack.transport.class</key>
+ <value>org.jboss.wsf.stack.metro.EndpointServlet</value>
+ </entry>
</map>
</property>
<property name="relativeOrder">31</property> <!-- [JBDEPLOY-201] workaround -->
15 years, 5 months
JBossWS SVN: r10393 - in container/jboss50/branches/ropalka-jboss510/src/main: java/org/jboss/webservices/integration/deployers and 8 other directories.
by jbossws-commits@lists.jboss.org
Author: richard.opalka(a)jboss.com
Date: 2009-07-27 08:35:51 -0400 (Mon, 27 Jul 2009)
New Revision: 10393
Added:
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/security/
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/security/JACCPermissionsDeploymentAspect.java
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/tomcat/jse/WebMetaDataModifyingDeploymentAspect.java
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/util/ASHelper.java
Removed:
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/tomcat/jse/WebAppDeploymentAspect.java
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/util/Helper.java
Modified:
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/deployers/WSDeploymentAspectDeployer.java
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/deployers/WSDeploymentDeployer.java
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/deployers/WSEJBAdapterDeployer.java
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/deployers/WSTypeDeployer.java
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/injection/InjectionMetaDataDeploymentAspect.java
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerEJB21.java
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/metadata/ContainerMetaDataDeploymentAspect.java
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/metadata/EJB21MetaDataBuilder.java
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/metadata/EJB3MetaDataBuilder.java
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/metadata/JSEMetaDataBuilder.java
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/tomcat/ejb/SecurityHandlerEJB21.java
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/tomcat/ejb/SecurityHandlerEJB3.java
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/tomcat/ejb/WebAppGeneratorDeploymentAspect.java
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/tomcat/jse/WebMetaDataModifier.java
container/jboss50/branches/ropalka-jboss510/src/main/resources/jbossws-jboss50.deployer/META-INF/stack-agnostic-jboss-beans.xml
Log:
[JBWS-2332] refactoring
Modified: container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/deployers/WSDeploymentAspectDeployer.java
===================================================================
--- container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/deployers/WSDeploymentAspectDeployer.java 2009-07-27 12:33:37 UTC (rev 10392)
+++ container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/deployers/WSDeploymentAspectDeployer.java 2009-07-27 12:35:51 UTC (rev 10393)
@@ -27,7 +27,7 @@
import org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer;
import org.jboss.deployers.structure.spi.DeploymentUnit;
import org.jboss.metadata.web.jboss.JBossWebMetaData;
-import org.jboss.webservices.integration.util.Helper;
+import org.jboss.webservices.integration.util.ASHelper;
import org.jboss.wsf.spi.deployment.Deployment;
import org.jboss.wsf.spi.deployment.DeploymentAspect;
@@ -98,10 +98,10 @@
@Override
public void internalDeploy( final DeploymentUnit unit ) throws DeploymentException
{
- if ( Helper.isWebServiceDeployment( unit ) )
+ if ( ASHelper.isWebServiceDeployment( unit ) )
{
log.debug( this.aspect.getClass() + " deploy: " + unit.getName() );
- final Deployment dep = Helper.getRequiredAttachment( unit, Deployment.class );
+ final Deployment dep = ASHelper.getRequiredAttachment( unit, Deployment.class );
this.aspect.start( dep );
}
}
@@ -115,10 +115,10 @@
@Override
public void internalUndeploy( final DeploymentUnit unit )
{
- if ( Helper.isWebServiceDeployment( unit ) )
+ if ( ASHelper.isWebServiceDeployment( unit ) )
{
log.debug( this.aspect.getClass() + " undeploy: " + unit.getName() );
- final Deployment dep = Helper.getRequiredAttachment( unit, Deployment.class );
+ final Deployment dep = ASHelper.getRequiredAttachment( unit, Deployment.class );
this.aspect.stop( dep );
}
}
Modified: container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/deployers/WSDeploymentDeployer.java
===================================================================
--- container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/deployers/WSDeploymentDeployer.java 2009-07-27 12:33:37 UTC (rev 10392)
+++ container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/deployers/WSDeploymentDeployer.java 2009-07-27 12:35:51 UTC (rev 10393)
@@ -39,7 +39,7 @@
import org.jboss.metadata.web.spec.ServletMetaData;
import org.jboss.virtual.VirtualFile;
import org.jboss.webservices.integration.invocation.InvocationHandlerEJB3;
-import org.jboss.webservices.integration.util.Helper;
+import org.jboss.webservices.integration.util.ASHelper;
import org.jboss.wsf.spi.SPIProvider;
import org.jboss.wsf.spi.SPIProviderResolver;
import org.jboss.wsf.spi.deployment.ArchiveDeployment;
@@ -97,19 +97,19 @@
@Override
protected void internalDeploy( final DeploymentUnit unit ) throws DeploymentException
{
- if ( Helper.isJaxwsJseDeployment( unit ) )
+ if ( ASHelper.isJaxwsJseDeployment( unit ) )
{
this.newJaxwsJseDeployment( unit );
}
- else if ( Helper.isJaxwsEjbDeployment( unit ) )
+ else if ( ASHelper.isJaxwsEjbDeployment( unit ) )
{
this.newJaxwsEjbDeployment( unit );
}
- else if ( Helper.isJaxrpcJseDeployment( unit ) )
+ else if ( ASHelper.isJaxrpcJseDeployment( unit ) )
{
this.newJaxrpcJseDeployment( unit );
}
- else if ( Helper.isJaxrpcEjbDeployment( unit ) )
+ else if ( ASHelper.isJaxrpcEjbDeployment( unit ) )
{
this.newJaxrpcEjbDeployment( unit );
}
@@ -153,7 +153,7 @@
final ArchiveDeployment dep = this.newDeployment( unit );
this.getAndPropagateAttachment( WebServiceDeployment.class, unit, dep );
- final Iterator< WebServiceDeclaration > ejbIterator = Helper.getJaxwsEjbs( unit ).iterator();
+ final Iterator< WebServiceDeclaration > ejbIterator = ASHelper.getJaxwsEjbs( unit ).iterator();
while ( ejbIterator.hasNext() )
{
final WebServiceDeclaration container = ejbIterator.next();
@@ -184,8 +184,8 @@
for ( PortComponentMetaData pcmd : wsd.getPortComponents() )
{
final String servletName = pcmd.getServletLink();
- final ServletMetaData servletMD = Helper.getServletForName( webMetaData, servletName );
- final String servletClass = Helper.getEndpointName( servletMD );
+ final ServletMetaData servletMD = ASHelper.getServletForName( webMetaData, servletName );
+ final String servletClass = ASHelper.getEndpointName( servletMD );
this.createEndpoint( servletClass, servletName, dep );
}
@@ -205,11 +205,11 @@
final ArchiveDeployment dep = this.newDeployment( unit );
this.getAndPropagateAttachment( JBossWebMetaData.class, unit, dep );
- final List< ServletMetaData > servlets = Helper.getJaxwsServlets( unit );
+ final List< ServletMetaData > servlets = ASHelper.getJaxwsServlets( unit );
for ( ServletMetaData servlet : servlets )
{
final String servletName = servlet.getName();
- final String servletClass = Helper.getEndpointName( servlet );
+ final String servletClass = ASHelper.getEndpointName( servlet );
this.createEndpoint( servletClass, servletName, dep );
}
@@ -259,7 +259,7 @@
dep.setRootFile( new VirtualFileAdaptor( ( ( VFSDeploymentUnit ) unit ).getRoot() ) );
dep.setRuntimeClassLoader( unit.getClassLoader() );
- final DeploymentType deploymentType = Helper.getRequiredAttachment( unit, DeploymentType.class );
+ final DeploymentType deploymentType = ASHelper.getRequiredAttachment( unit, DeploymentType.class );
dep.setType( deploymentType );
return dep;
@@ -308,7 +308,7 @@
final Class< A > attachment, final DeploymentUnit unit, final Deployment dep
)
{
- final A attachmentValue = Helper.getOptionalAttachment( unit, attachment );
+ final A attachmentValue = ASHelper.getOptionalAttachment( unit, attachment );
if ( attachmentValue != null )
{
Modified: container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/deployers/WSEJBAdapterDeployer.java
===================================================================
--- container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/deployers/WSEJBAdapterDeployer.java 2009-07-27 12:33:37 UTC (rev 10392)
+++ container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/deployers/WSEJBAdapterDeployer.java 2009-07-27 12:35:51 UTC (rev 10393)
@@ -39,7 +39,7 @@
import org.jboss.ejb3.Ejb3Deployment;
import org.jboss.metadata.ejb.jboss.JBossEnterpriseBeanMetaData;
import org.jboss.metadata.ejb.jboss.JBossMetaData;
-import org.jboss.webservices.integration.util.Helper;
+import org.jboss.webservices.integration.util.ASHelper;
import org.jboss.wsf.spi.deployment.integration.WebServiceDeclaration;
import org.jboss.wsf.spi.deployment.integration.WebServiceDeployment;
import org.jboss.wsf.spi.metadata.webservices.WebservicesMetaData;
@@ -81,7 +81,7 @@
final JBossMetaData mergedMD = ( JBossMetaData ) unit.getAttachment(
MergedJBossMetaDataDeployer.EJB_MERGED_ATTACHMENT_NAME
);
- final Ejb3Deployment ejb3Deployment = Helper.getOptionalAttachment( unit, Ejb3Deployment.class );
+ final Ejb3Deployment ejb3Deployment = ASHelper.getOptionalAttachment( unit, Ejb3Deployment.class );
if ( mergedMD != null )
{
Modified: container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/deployers/WSTypeDeployer.java
===================================================================
--- container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/deployers/WSTypeDeployer.java 2009-07-27 12:33:37 UTC (rev 10392)
+++ container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/deployers/WSTypeDeployer.java 2009-07-27 12:35:51 UTC (rev 10393)
@@ -26,7 +26,7 @@
import org.jboss.deployers.structure.spi.DeploymentUnit;
import org.jboss.metadata.ejb.jboss.JBossMetaData;
import org.jboss.metadata.web.jboss.JBossWebMetaData;
-import org.jboss.webservices.integration.util.Helper;
+import org.jboss.webservices.integration.util.ASHelper;
import org.jboss.wsf.spi.deployment.Deployment.DeploymentType;
import org.jboss.wsf.spi.deployment.integration.WebServiceDeployment;
import org.jboss.wsf.spi.metadata.webservices.WebservicesMetaData;
@@ -91,7 +91,7 @@
*/
private boolean isJaxrpcEjbDeployment( final DeploymentUnit unit )
{
- final boolean hasWebservicesMD = Helper.hasAttachment( unit, WebservicesMetaData.class );
+ final boolean hasWebservicesMD = ASHelper.hasAttachment( unit, WebservicesMetaData.class );
final boolean hasJBossMD = unit.getAllMetaData( JBossMetaData.class ).size() > 0;
return hasWebservicesMD && hasJBossMD;
@@ -105,12 +105,12 @@
*/
private boolean isJaxrpcJseDeployment( final DeploymentUnit unit )
{
- final boolean hasWebservicesMD = Helper.hasAttachment( unit, WebservicesMetaData.class );
- final boolean hasJBossWebMD = Helper.hasAttachment( unit, JBossWebMetaData.class );
+ final boolean hasWebservicesMD = ASHelper.hasAttachment( unit, WebservicesMetaData.class );
+ final boolean hasJBossWebMD = ASHelper.hasAttachment( unit, JBossWebMetaData.class );
if ( hasWebservicesMD && hasJBossWebMD )
{
- return Helper.getJaxrpcServlets( unit ).size() > 0;
+ return ASHelper.getJaxrpcServlets( unit ).size() > 0;
}
return false;
@@ -124,11 +124,11 @@
*/
private boolean isJaxwsEjbDeployment( final DeploymentUnit unit )
{
- final boolean hasWSDeployment = Helper.hasAttachment( unit, WebServiceDeployment.class );
+ final boolean hasWSDeployment = ASHelper.hasAttachment( unit, WebServiceDeployment.class );
if ( hasWSDeployment )
{
- return Helper.getJaxwsEjbs( unit ).size() > 0;
+ return ASHelper.getJaxwsEjbs( unit ).size() > 0;
}
return false;
@@ -142,11 +142,11 @@
*/
private boolean isJaxwsJseDeployment( final DeploymentUnit unit )
{
- final boolean hasJBossWebMD = Helper.hasAttachment( unit, JBossWebMetaData.class );
+ final boolean hasJBossWebMD = ASHelper.hasAttachment( unit, JBossWebMetaData.class );
if ( hasJBossWebMD )
{
- return Helper.getJaxwsServlets( unit ).size() > 0;
+ return ASHelper.getJaxwsServlets( unit ).size() > 0;
}
return false;
Modified: container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/injection/InjectionMetaDataDeploymentAspect.java
===================================================================
--- container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/injection/InjectionMetaDataDeploymentAspect.java 2009-07-27 12:33:37 UTC (rev 10392)
+++ container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/injection/InjectionMetaDataDeploymentAspect.java 2009-07-27 12:35:51 UTC (rev 10393)
@@ -45,8 +45,9 @@
import org.jboss.metadata.javaee.spec.EnvironmentEntryMetaData;
import org.jboss.metadata.javaee.spec.ResourceInjectionTargetMetaData;
import org.jboss.metadata.web.jboss.JBossWebMetaData;
-import org.jboss.webservices.integration.util.Helper;
+import org.jboss.webservices.integration.util.ASHelper;
import org.jboss.wsf.common.injection.resolvers.ResourceReferenceResolver;
+import org.jboss.wsf.common.integration.WSHelper;
import org.jboss.wsf.spi.deployment.Deployment;
import org.jboss.wsf.spi.deployment.DeploymentAspect;
import org.jboss.wsf.spi.deployment.Endpoint;
@@ -73,8 +74,8 @@
{
super.start(dep);
- DeploymentUnit unit = Helper.getRequiredAttachment( dep, DeploymentUnit.class );
- JBossWebMetaData webMD = Helper.getRequiredAttachment( dep, JBossWebMetaData.class );
+ DeploymentUnit unit = WSHelper.getRequiredAttachment( dep, DeploymentUnit.class );
+ JBossWebMetaData webMD = WSHelper.getRequiredAttachment( dep, JBossWebMetaData.class );
List<InjectionMetaData> injectionMD = new LinkedList<InjectionMetaData>();
Map<Class<? extends Annotation>, ReferenceResolver> resolvers = createResolvers(unit);
@@ -82,7 +83,7 @@
try
{
- if ( Helper.isJaxwsJseDeployment( unit ) )
+ if ( WSHelper.isJaxwsJseDeployment( dep ) )
{
injectionMD.addAll(buildInjectionMetaData(webMD.getEnvironmentEntries()));
for (Endpoint endpoint : dep.getService().getEndpoints())
@@ -91,10 +92,10 @@
endpoint.addAttachment(InjectionsMetaData.class, injectionsMD);
}
}
- else if ( Helper.isJaxwsEjbDeployment( unit ) )
+ else if ( WSHelper.isJaxwsEjbDeployment( dep ) )
{
- WebServiceDeployment webServiceDeployment = Helper.getRequiredAttachment( unit, WebServiceDeployment.class );
- JBossMetaData jbossMD = Helper.getRequiredAttachment( unit, JBossMetaData.class );
+ WebServiceDeployment webServiceDeployment = ASHelper.getRequiredAttachment( unit, WebServiceDeployment.class );
+ JBossMetaData jbossMD = ASHelper.getRequiredAttachment( unit, JBossMetaData.class );
JBossEnterpriseBeansMetaData jebMDs = jbossMD.getEnterpriseBeans();
Iterator<WebServiceDeclaration> it = webServiceDeployment.getServiceEndpoints().iterator();
Modified: container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerEJB21.java
===================================================================
--- container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerEJB21.java 2009-07-27 12:33:37 UTC (rev 10392)
+++ container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerEJB21.java 2009-07-27 12:35:51 UTC (rev 10393)
@@ -41,8 +41,8 @@
import org.jboss.security.SecurityContext;
import org.jboss.security.SecurityContextAssociation;
import org.jboss.webservices.integration.invocation.ServiceEndpointInterceptor;
-import org.jboss.webservices.integration.util.Helper;
import org.jboss.wsf.common.ObjectNameFactory;
+import org.jboss.wsf.common.integration.WSHelper;
import org.jboss.wsf.spi.SPIProvider;
import org.jboss.wsf.spi.SPIProviderResolver;
import org.jboss.wsf.spi.deployment.Deployment;
@@ -83,7 +83,7 @@
{
String ejbName = ep.getShortName();
Deployment dep = ep.getService().getDeployment();
- EJBArchiveMetaData apMetaData = Helper.getRequiredAttachment( dep, EJBArchiveMetaData.class );
+ EJBArchiveMetaData apMetaData = WSHelper.getRequiredAttachment( dep, EJBArchiveMetaData.class );
EJBMetaData beanMetaData = (EJBMetaData)apMetaData.getBeanByEjbName(ejbName);
if (beanMetaData == null)
throw new WebServiceException("Cannot obtain ejb meta data for: " + ejbName);
Modified: container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/metadata/ContainerMetaDataDeploymentAspect.java
===================================================================
--- container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/metadata/ContainerMetaDataDeploymentAspect.java 2009-07-27 12:33:37 UTC (rev 10392)
+++ container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/metadata/ContainerMetaDataDeploymentAspect.java 2009-07-27 12:35:51 UTC (rev 10393)
@@ -22,7 +22,8 @@
package org.jboss.webservices.integration.metadata;
import org.jboss.deployers.structure.spi.DeploymentUnit;
-import org.jboss.webservices.integration.util.Helper;
+import org.jboss.webservices.integration.util.ASHelper;
+import org.jboss.wsf.common.integration.WSHelper;
import org.jboss.wsf.spi.deployment.Deployment;
import org.jboss.wsf.spi.deployment.DeploymentAspect;
import org.jboss.wsf.spi.metadata.j2ee.EJBArchiveMetaData;
@@ -60,19 +61,19 @@
@Override
public void start( final Deployment dep )
{
- final DeploymentUnit unit = Helper.getRequiredAttachment( dep, DeploymentUnit.class );
+ final DeploymentUnit unit = WSHelper.getRequiredAttachment( dep, DeploymentUnit.class );
- if ( Helper.isJseDeployment( unit ) )
+ if ( ASHelper.isJseDeployment( unit ) )
{
final JSEArchiveMetaData jseMetaData = this.jseMetaDataBuilder.create( dep, unit );
dep.addAttachment( JSEArchiveMetaData.class, jseMetaData );
}
- else if ( Helper.isJaxwsEjbDeployment( unit ) )
+ else if ( ASHelper.isJaxwsEjbDeployment( unit ) )
{
final EJBArchiveMetaData ejbMetaData = this.ejb3MetaDataBuilder.create( dep, unit );
dep.addAttachment( EJBArchiveMetaData.class, ejbMetaData );
}
- else if ( Helper.isJaxrpcEjbDeployment( unit ) )
+ else if ( ASHelper.isJaxrpcEjbDeployment( unit ) )
{
final EJBArchiveMetaData ejbMetaData = this.ejb21MetaDataBuilder.create( dep, unit );
dep.addAttachment( EJBArchiveMetaData.class, ejbMetaData );
Modified: container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/metadata/EJB21MetaDataBuilder.java
===================================================================
--- container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/metadata/EJB21MetaDataBuilder.java 2009-07-27 12:33:37 UTC (rev 10392)
+++ container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/metadata/EJB21MetaDataBuilder.java 2009-07-27 12:35:51 UTC (rev 10393)
@@ -36,7 +36,7 @@
import org.jboss.metadata.ejb.jboss.JBossSessionBeanMetaData;
import org.jboss.metadata.ejb.jboss.WebservicesMetaData;
import org.jboss.metadata.javaee.spec.PortComponent;
-import org.jboss.webservices.integration.util.Helper;
+import org.jboss.webservices.integration.util.ASHelper;
import org.jboss.wsf.spi.deployment.Deployment;
import org.jboss.wsf.spi.metadata.j2ee.EJBArchiveMetaData;
import org.jboss.wsf.spi.metadata.j2ee.EJBMetaData;
@@ -57,7 +57,7 @@
EJBArchiveMetaData create(Deployment dep, DeploymentUnit unit)
{
- JBossMetaData jbossMetaData = Helper.getRequiredAttachment( unit, JBossMetaData.class );
+ JBossMetaData jbossMetaData = ASHelper.getRequiredAttachment( unit, JBossMetaData.class );
dep.addAttachment(JBossMetaData.class, jbossMetaData);
EJBArchiveMetaData ejbMetaData = new EJBArchiveMetaData();
Modified: container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/metadata/EJB3MetaDataBuilder.java
===================================================================
--- container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/metadata/EJB3MetaDataBuilder.java 2009-07-27 12:33:37 UTC (rev 10392)
+++ container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/metadata/EJB3MetaDataBuilder.java 2009-07-27 12:35:51 UTC (rev 10393)
@@ -27,7 +27,8 @@
import org.jboss.metadata.common.jboss.WebserviceDescriptionsMetaData;
import org.jboss.metadata.ejb.jboss.JBossMetaData;
import org.jboss.metadata.ejb.jboss.WebservicesMetaData;
-import org.jboss.webservices.integration.util.Helper;
+import org.jboss.webservices.integration.util.ASHelper;
+import org.jboss.wsf.common.integration.WSHelper;
import org.jboss.wsf.spi.deployment.Deployment;
import org.jboss.wsf.spi.deployment.integration.WebServiceDeclaration;
import org.jboss.wsf.spi.deployment.integration.WebServiceDeployment;
@@ -54,10 +55,10 @@
{
EJBArchiveMetaData umd = new EJBArchiveMetaData();
- WebServiceDeployment webServiceDeployment = Helper.getRequiredAttachment( dep, WebServiceDeployment.class );
+ WebServiceDeployment webServiceDeployment = WSHelper.getRequiredAttachment( dep, WebServiceDeployment.class );
buildEnterpriseBeansMetaData(umd, webServiceDeployment);
- JBossMetaData jbMetaData = Helper.getRequiredAttachment( unit, JBossMetaData.class );
+ JBossMetaData jbMetaData = ASHelper.getRequiredAttachment( unit, JBossMetaData.class );
buildWebservicesMetaData(umd, jbMetaData);
return umd;
Modified: container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/metadata/JSEMetaDataBuilder.java
===================================================================
--- container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/metadata/JSEMetaDataBuilder.java 2009-07-27 12:33:37 UTC (rev 10392)
+++ container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/metadata/JSEMetaDataBuilder.java 2009-07-27 12:35:51 UTC (rev 10393)
@@ -41,7 +41,7 @@
import org.jboss.metadata.web.spec.ServletMetaData;
import org.jboss.metadata.web.spec.WebResourceCollectionMetaData;
import org.jboss.metadata.web.spec.WebResourceCollectionsMetaData;
-import org.jboss.webservices.integration.util.Helper;
+import org.jboss.webservices.integration.util.ASHelper;
import org.jboss.wsf.spi.deployment.Deployment;
import org.jboss.wsf.spi.metadata.j2ee.JSEArchiveMetaData;
import org.jboss.wsf.spi.metadata.j2ee.JSESecurityMetaData;
@@ -62,11 +62,11 @@
{
String contextRoot = null;
- JBossWebMetaData jbossWebMetaData = Helper.getRequiredAttachment( unit, JBossWebMetaData.class );
+ JBossWebMetaData jbossWebMetaData = ASHelper.getRequiredAttachment( unit, JBossWebMetaData.class );
if (unit.getParent() != null)
{
- JBossAppMetaData appmd = Helper.getOptionalAttachment( unit.getParent(), JBossAppMetaData.class );
+ JBossAppMetaData appmd = ASHelper.getOptionalAttachment( unit.getParent(), JBossAppMetaData.class );
if (appmd != null)
{
ModuleMetaData module = appmd.getModule(dep.getSimpleName());
Added: container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/security/JACCPermissionsDeploymentAspect.java
===================================================================
--- container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/security/JACCPermissionsDeploymentAspect.java (rev 0)
+++ container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/security/JACCPermissionsDeploymentAspect.java 2009-07-27 12:35:51 UTC (rev 10393)
@@ -0,0 +1,81 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.webservices.integration.security;
+
+import javax.security.jacc.PolicyConfiguration;
+import javax.security.jacc.PolicyConfigurationFactory;
+
+import org.jboss.metadata.web.jboss.JBossWebMetaData;
+import org.jboss.web.WebPermissionMapping;
+import org.jboss.wsf.common.integration.WSHelper;
+import org.jboss.wsf.spi.deployment.Deployment;
+import org.jboss.wsf.spi.deployment.DeploymentAspect;
+
+/**
+ * Generates JACC permissions. (This is temporary and really hacky solution).
+ *
+ * TODO: remove this deployment aspect and update
+ * particular JACC deployer to execute after
+ * JBossWS has modified web meta data.
+ *
+ * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
+ */
+public final class JACCPermissionsDeploymentAspect extends DeploymentAspect
+{
+
+ /**
+ * Constructor.
+ */
+ public JACCPermissionsDeploymentAspect()
+ {
+ super();
+ }
+
+ /**
+ * JBAS-5935: The dynamic web application generated by the JBossWS
+ * does not go through the war security deployer. Hence the JACC
+ * permissions are not created. There is a need to explicitly create
+ * the war jacc permissions.
+ *
+ * @param dep webservice deployment
+ */
+ public void start( final Deployment dep )
+ {
+ final JBossWebMetaData jbossWebMD = WSHelper.getRequiredAttachment( dep, JBossWebMetaData.class );
+
+ try
+ {
+ final PolicyConfigurationFactory policyConfigurationFactory =
+ PolicyConfigurationFactory.getPolicyConfigurationFactory();
+ final PolicyConfiguration policyConfiguration =
+ policyConfigurationFactory.getPolicyConfiguration( dep.getSimpleName(), false );
+
+ WebPermissionMapping.createPermissions( jbossWebMD, policyConfiguration );
+ policyConfiguration.commit();
+ }
+ catch ( Exception e )
+ {
+ throw new RuntimeException( "Exception generating JACC perms: ", e );
+ }
+ }
+
+}
Modified: container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/tomcat/ejb/SecurityHandlerEJB21.java
===================================================================
--- container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/tomcat/ejb/SecurityHandlerEJB21.java 2009-07-27 12:33:37 UTC (rev 10392)
+++ container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/tomcat/ejb/SecurityHandlerEJB21.java 2009-07-27 12:35:51 UTC (rev 10393)
@@ -25,7 +25,7 @@
import org.jboss.metadata.ejb.jboss.JBossMetaData;
import org.jboss.metadata.javaee.spec.SecurityRolesMetaData;
import org.jboss.metadata.web.jboss.JBossWebMetaData;
-import org.jboss.webservices.integration.util.Helper;
+import org.jboss.wsf.common.integration.WSHelper;
import org.jboss.wsf.spi.deployment.Deployment;
import org.jboss.wsf.spi.metadata.j2ee.EJBArchiveMetaData;
@@ -39,7 +39,7 @@
{
public void addSecurityDomain(JBossWebMetaData jbossWeb, Deployment dep)
{
- EJBArchiveMetaData ejbMetaData = Helper.getRequiredAttachment( dep, EJBArchiveMetaData.class );
+ EJBArchiveMetaData ejbMetaData = WSHelper.getRequiredAttachment( dep, EJBArchiveMetaData.class );
String securityDomain = ejbMetaData.getSecurityDomain();
if (securityDomain != null)
@@ -53,7 +53,7 @@
public void addSecurityRoles(JBossWebMetaData webApp, Deployment dep)
{
- JBossMetaData jbmd = Helper.getRequiredAttachment( dep, JBossMetaData.class );
+ JBossMetaData jbmd = WSHelper.getRequiredAttachment( dep, JBossMetaData.class );
IAssemblyDescriptorMetaData assemblyDescriptor = jbmd.getAssemblyDescriptor();
if (assemblyDescriptor != null)
{
Modified: container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/tomcat/ejb/SecurityHandlerEJB3.java
===================================================================
--- container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/tomcat/ejb/SecurityHandlerEJB3.java 2009-07-27 12:33:37 UTC (rev 10392)
+++ container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/tomcat/ejb/SecurityHandlerEJB3.java 2009-07-27 12:35:51 UTC (rev 10393)
@@ -25,7 +25,7 @@
import org.jboss.metadata.javaee.spec.SecurityRoleMetaData;
import org.jboss.metadata.javaee.spec.SecurityRolesMetaData;
import org.jboss.metadata.web.jboss.JBossWebMetaData;
-import org.jboss.webservices.integration.util.Helper;
+import org.jboss.wsf.common.integration.WSHelper;
import org.jboss.wsf.spi.deployment.Deployment;
import org.jboss.wsf.spi.deployment.integration.WebServiceDeclaration;
import org.jboss.wsf.spi.deployment.integration.WebServiceDeployment;
@@ -43,7 +43,7 @@
{
public void addSecurityDomain(JBossWebMetaData jbossWeb, Deployment dep)
{
- WebServiceDeployment webServiceDeployment = Helper.getRequiredAttachment( dep, WebServiceDeployment.class );
+ WebServiceDeployment webServiceDeployment = WSHelper.getRequiredAttachment( dep, WebServiceDeployment.class );
String securityDomain = null;
Iterator<WebServiceDeclaration> it = webServiceDeployment.getServiceEndpoints().iterator();
@@ -71,7 +71,7 @@
public void addSecurityRoles(JBossWebMetaData webApp, Deployment dep)
{
- WebServiceDeployment webServiceDeployment = Helper.getRequiredAttachment( dep, WebServiceDeployment.class );
+ WebServiceDeployment webServiceDeployment = WSHelper.getRequiredAttachment( dep, WebServiceDeployment.class );
Iterator<WebServiceDeclaration> it = webServiceDeployment.getServiceEndpoints().iterator();
while (it.hasNext())
Modified: container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/tomcat/ejb/WebAppGeneratorDeploymentAspect.java
===================================================================
--- container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/tomcat/ejb/WebAppGeneratorDeploymentAspect.java 2009-07-27 12:33:37 UTC (rev 10392)
+++ container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/tomcat/ejb/WebAppGeneratorDeploymentAspect.java 2009-07-27 12:35:51 UTC (rev 10393)
@@ -25,6 +25,7 @@
import java.util.Arrays;
import java.util.List;
+import org.jboss.deployers.structure.spi.DeploymentUnit;
import org.jboss.metadata.web.jboss.JBossServletMetaData;
import org.jboss.metadata.web.jboss.JBossServletsMetaData;
import org.jboss.metadata.web.jboss.JBossWebMetaData;
@@ -36,14 +37,11 @@
import org.jboss.metadata.web.spec.UserDataConstraintMetaData;
import org.jboss.metadata.web.spec.WebResourceCollectionMetaData;
import org.jboss.metadata.web.spec.WebResourceCollectionsMetaData;
-import org.jboss.webservices.integration.util.Helper;
+import org.jboss.wsf.common.integration.WSHelper;
import org.jboss.wsf.spi.annotation.WebContext;
-import org.jboss.wsf.spi.deployment.ArchiveDeployment;
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.deployment.WSFDeploymentException;
-import org.jboss.wsf.spi.deployment.Deployment.DeploymentType;
import org.jboss.wsf.spi.metadata.j2ee.EJBArchiveMetaData;
import org.jboss.wsf.spi.metadata.j2ee.EJBMetaData;
import org.jboss.wsf.spi.metadata.j2ee.EJBSecurityMetaData;
@@ -72,17 +70,19 @@
@Override
public void start(Deployment dep)
{
- final DeploymentType deploymentType = dep.getType();
+ final DeploymentUnit unit = WSHelper.getRequiredAttachment( dep, DeploymentUnit.class );
- if (DeploymentType.JAXRPC_EJB21.equals(deploymentType))
+ if ( WSHelper.isJaxrpcEjbDeployment( dep ) )
{
JBossWebMetaData jbwmd = generateWebDeployment(dep, securityHandlerEJB21);
dep.addAttachment(JBossWebMetaData.class, jbwmd);
+ unit.addAttachment(JBossWebMetaData.class, jbwmd);
}
- else if (DeploymentType.JAXWS_EJB3.equals(deploymentType))
+ else if ( WSHelper.isJaxwsEjbDeployment( dep ) )
{
JBossWebMetaData jbwmd = generateWebDeployment(dep, securityHandlerEJB3);
dep.addAttachment(JBossWebMetaData.class, jbwmd);
+ unit.addAttachment(JBossWebMetaData.class, jbwmd);
}
}
@@ -153,7 +153,7 @@
secureWSDLAccess = anWebContext.secureWSDLAccess();
}
- EJBArchiveMetaData appMetaData = Helper.getOptionalAttachment( dep, EJBArchiveMetaData.class );
+ EJBArchiveMetaData appMetaData = WSHelper.getOptionalAttachment( dep, EJBArchiveMetaData.class );
if (appMetaData != null && appMetaData.getBeanByEjbName(ejbName) != null)
{
EJBMetaData bmd = appMetaData.getBeanByEjbName(ejbName);
Deleted: container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/tomcat/jse/WebAppDeploymentAspect.java
===================================================================
--- container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/tomcat/jse/WebAppDeploymentAspect.java 2009-07-27 12:33:37 UTC (rev 10392)
+++ container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/tomcat/jse/WebAppDeploymentAspect.java 2009-07-27 12:35:51 UTC (rev 10393)
@@ -1,98 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.webservices.integration.tomcat.jse;
-
-import javax.security.jacc.PolicyConfiguration;
-import javax.security.jacc.PolicyConfigurationFactory;
-import org.jboss.web.WebPermissionMapping;
-import org.jboss.webservices.integration.util.Helper;
-
-import javax.xml.ws.WebServiceException;
-import org.jboss.deployers.structure.spi.DeploymentUnit;
-import org.jboss.metadata.web.jboss.JBossWebMetaData;
-import org.jboss.wsf.spi.deployment.Deployment;
-import org.jboss.wsf.spi.deployment.DeploymentAspect;
-import org.jboss.wsf.spi.deployment.WSFDeploymentException;
-
-/**
- * Deploy the generated webapp to JBoss
- *
- * @author Thomas.Diesler(a)jboss.org
- * @author Anil.Saldhana(a)jboss.com
- * @since 12-May-2006
- */
-public class WebAppDeploymentAspect extends DeploymentAspect
-{
- private WebMetaDataModifier webMetaDataModifier;
-
- public void setWebMetaDataModifier(WebMetaDataModifier webMetaDataModifier)
- {
- this.webMetaDataModifier = webMetaDataModifier;
- }
-
- public void start(Deployment dep)
- {
- final JBossWebMetaData jbwmd = Helper.getRequiredAttachment( dep, JBossWebMetaData.class );
- final DeploymentUnit unit = Helper.getRequiredAttachment( dep, DeploymentUnit.class );
-
- try
- {
- webMetaDataModifier.modifyMetaData(dep);
-
- try
- {
- generateJACCPermissions(dep.getSimpleName(), jbwmd); // TODO: make it another deployment aspect
- }
- catch (Exception e)
- {
- throw new RuntimeException("Exception generating JACC perms:",e);
- }
-
- // Attaching it to the DeploymentUnit will cause a new webapp deployment
- unit.addAttachment(JBossWebMetaData.class, jbwmd);
- }
- catch (Exception ex)
- {
- WSFDeploymentException.rethrow(ex);
- }
- }
-
- /**
- * JBAS-5935: The dynamic web application generated by the JBossWS
- * does not go through the war security deployer. Hence the JACC
- * permissions are not created. There is a need to explicitly create
- * the war jacc permissions.
- * @param depName
- * @param jbwmd
- * @throws Exception
- */
- protected void generateJACCPermissions(String depName, JBossWebMetaData jbwmd)
- throws Exception
- {
- PolicyConfigurationFactory policyConfigurationFactory =
- PolicyConfigurationFactory.getPolicyConfigurationFactory();
- PolicyConfiguration policyConfiguration =
- policyConfigurationFactory.getPolicyConfiguration(depName, false);
- WebPermissionMapping.createPermissions(jbwmd, policyConfiguration);
- policyConfiguration.commit();
- }
-}
Modified: container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/tomcat/jse/WebMetaDataModifier.java
===================================================================
--- container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/tomcat/jse/WebMetaDataModifier.java 2009-07-27 12:33:37 UTC (rev 10392)
+++ container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/tomcat/jse/WebMetaDataModifier.java 2009-07-27 12:35:51 UTC (rev 10393)
@@ -30,15 +30,16 @@
import org.jboss.metadata.web.jboss.JBossServletMetaData;
import org.jboss.metadata.web.jboss.JBossWebMetaData;
import org.jboss.metadata.web.spec.ServletMetaData;
-import org.jboss.webservices.integration.util.Helper;
-import org.jboss.wsf.common.integration.Constants;
+import org.jboss.webservices.integration.util.ASHelper;
+import org.jboss.wsf.common.integration.WSConstants;
+import org.jboss.wsf.common.integration.WSHelper;
import org.jboss.wsf.spi.deployment.Deployment;
import org.jboss.wsf.spi.deployment.Endpoint;
/**
- * The rewriter of jboss web meta data.
+ * The modifier of jboss web meta data.
* It configures WS transport for every webservice endpoint
- * plus propagates WS stack specific context parameters if requested.
+ * plus propagates WS stack specific context parameters if required.
*
* @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
*/
@@ -54,20 +55,20 @@
}
/**
- * Modifies web meta data to configure webservice stack.
+ * Modifies web meta data to configure webservice stack transport and properties.
*
* @param dep webservice deployment
*/
- public void modifyMetaData( final Deployment dep )
+ public void modify( final Deployment dep )
{
- final JBossWebMetaData jbossWebMD = Helper.getRequiredAttachment( dep, JBossWebMetaData.class );
+ final JBossWebMetaData jbossWebMD = WSHelper.getRequiredAttachment( dep, JBossWebMetaData.class );
this.propagateContextProps( dep, jbossWebMD );
this.configureEndpoints( dep, jbossWebMD );
}
/**
- * Propagates webservice specific context parameters if requested.
+ * Propagates stack specific context parameters if specified.
*
* @param dep webservice deployment
* @param jbossWebMD web meta data
@@ -75,14 +76,14 @@
@SuppressWarnings( "unchecked" )
private void propagateContextProps( final Deployment dep, final JBossWebMetaData jbossWebMD )
{
- final Map< String, String > webserviceContextParams = ( Map< String, String > )
- dep.getProperty( Constants.STACK_CONTEXT_PARAMS );
+ final Map< String, String > stackContextParams = ( Map< String, String > )
+ dep.getProperty( WSConstants.STACK_CONTEXT_PARAMS );
- if ( webserviceContextParams != null )
+ if ( stackContextParams != null )
{
final List< ParamValueMetaData > contextParams = this.getContextParams( jbossWebMD );
- for ( Map.Entry< String, String > entry : webserviceContextParams.entrySet() )
+ for ( Map.Entry< String, String > entry : stackContextParams.entrySet() )
{
final ParamValueMetaData newParam = this.newParameter( entry.getKey(), entry.getValue() );
contextParams.add( newParam );
@@ -104,7 +105,7 @@
{
final ServletMetaData servletMD = servlets.next();
final ClassLoader loader = dep.getInitialClassLoader();
- final boolean isWebserviceEndpoint = Helper.getEndpointClass( servletMD, loader ) != null;
+ final boolean isWebserviceEndpoint = ASHelper.getEndpointClass( servletMD, loader ) != null;
if ( isWebserviceEndpoint )
{
@@ -131,11 +132,11 @@
*/
private String getTransportClassName( final Deployment dep )
{
- final String transportClassName = ( String ) dep.getProperty( Constants.STACK_TRANSPORT_CLASS );
+ final String transportClassName = ( String ) dep.getProperty( WSConstants.STACK_TRANSPORT_CLASS );
if ( transportClassName == null )
{
- throw new IllegalStateException( "Cannot obtain deployment property: " + Constants.STACK_TRANSPORT_CLASS );
+ throw new IllegalStateException( "Cannot obtain deployment property: " + WSConstants.STACK_TRANSPORT_CLASS );
}
return transportClassName;
Added: container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/tomcat/jse/WebMetaDataModifyingDeploymentAspect.java
===================================================================
--- container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/tomcat/jse/WebMetaDataModifyingDeploymentAspect.java (rev 0)
+++ container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/tomcat/jse/WebMetaDataModifyingDeploymentAspect.java 2009-07-27 12:35:51 UTC (rev 10393)
@@ -0,0 +1,66 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.webservices.integration.tomcat.jse;
+
+import org.jboss.wsf.spi.deployment.Deployment;
+import org.jboss.wsf.spi.deployment.DeploymentAspect;
+
+/**
+ * Modifies web meta data to configure webservice stack endpoints and properties.
+ *
+ * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
+ */
+public final class WebMetaDataModifyingDeploymentAspect extends DeploymentAspect
+{
+
+ /** Web meta data modifier. */
+ private WebMetaDataModifier webMetaDataModifier;
+
+ /**
+ * Constructor.
+ */
+ public WebMetaDataModifyingDeploymentAspect()
+ {
+ super();
+ }
+
+ /**
+ * Sets Web meta data modifier. This method is called using MC injection.
+ *
+ * @param webMDModifier web meta data modifier
+ */
+ public void setWebMetaDataModifier( final WebMetaDataModifier webMDModifier )
+ {
+ this.webMetaDataModifier = webMDModifier;
+ }
+
+ /**
+ * Modifies web meta data.
+ *
+ * @param dep webservice deployment
+ */
+ public void start( final Deployment dep )
+ {
+ this.webMetaDataModifier.modify( dep );
+ }
+
+}
Added: container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/util/ASHelper.java
===================================================================
--- container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/util/ASHelper.java (rev 0)
+++ container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/util/ASHelper.java 2009-07-27 12:35:51 UTC (rev 10393)
@@ -0,0 +1,387 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.webservices.integration.util;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import javax.jws.WebService;
+import javax.servlet.Servlet;
+import javax.xml.ws.WebServiceProvider;
+
+import org.jboss.deployers.structure.spi.DeploymentUnit;
+import org.jboss.logging.Logger;
+import org.jboss.metadata.web.jboss.JBossServletMetaData;
+import org.jboss.metadata.web.jboss.JBossWebMetaData;
+import org.jboss.metadata.web.spec.ServletMetaData;
+import org.jboss.wsf.spi.deployment.Deployment.DeploymentType;
+import org.jboss.wsf.spi.deployment.integration.WebServiceDeclaration;
+import org.jboss.wsf.spi.deployment.integration.WebServiceDeployment;
+
+/**
+ * JBoss AS integration helper class.
+ *
+ * @author <a href="ropalka(a)redhat.com">Richard Opalka</a>
+ */
+public final class ASHelper
+{
+
+ /** Logger. */
+ private static final Logger LOG = Logger.getLogger( ASHelper.class );
+
+ /**
+ * Forbidden constructor.
+ */
+ private ASHelper()
+ {
+ super();
+ }
+
+ /**
+ * Returns true if unit contains JAXWS JSE, JAXRPC JSE, JAXWS EJB or JAXRPC EJB deployment.
+ *
+ * @param unit deployment unit
+ * @return true if JAXWS JSE, JAXRPC JSE, JAXWS EJB or JAXRPC EJB deployment, false otherwise.
+ */
+ public static boolean isWebServiceDeployment( final DeploymentUnit unit )
+ {
+ return ASHelper.getOptionalAttachment( unit, DeploymentType.class ) != null;
+ }
+
+ /**
+ * Returns true if unit contains JAXRPC EJB deployment.
+ *
+ * @param unit deployment unit
+ * @return true if JAXRPC EJB deployment, false otherwise
+ */
+ public static boolean isJaxrpcEjbDeployment( final DeploymentUnit unit )
+ {
+ final DeploymentType deploymentType = ASHelper.getOptionalAttachment( unit, DeploymentType.class );
+
+ return DeploymentType.JAXRPC_EJB21.equals( deploymentType );
+ }
+
+ /**
+ * Returns true if unit contains JAXRPC JSE deployment.
+ *
+ * @param unit deployment unit
+ * @return true if JAXRPC JSE deployment, false otherwise
+ */
+ public static boolean isJaxrpcJseDeployment( final DeploymentUnit unit )
+ {
+ final DeploymentType deploymentType = ASHelper.getOptionalAttachment( unit, DeploymentType.class );
+
+ return DeploymentType.JAXRPC_JSE.equals( deploymentType );
+ }
+
+ /**
+ * Returns true if unit contains JAXWS EJB deployment.
+ *
+ * @param unit deployment unit
+ * @return true if JAXWS EJB deployment, false otherwise
+ */
+ public static boolean isJaxwsEjbDeployment( final DeploymentUnit unit )
+ {
+ final DeploymentType deploymentType = ASHelper.getOptionalAttachment( unit, DeploymentType.class );
+
+ return DeploymentType.JAXWS_EJB3.equals( deploymentType );
+ }
+
+ /**
+ * Returns true if unit contains JAXWS JSE deployment.
+ *
+ * @param unit deployment unit
+ * @return true if JAXWS JSE deployment, false otherwise
+ */
+ public static boolean isJaxwsJseDeployment( final DeploymentUnit unit )
+ {
+ final DeploymentType deploymentType = ASHelper.getOptionalAttachment( unit, DeploymentType.class );
+
+ return DeploymentType.JAXWS_JSE.equals( deploymentType );
+ }
+
+ /**
+ * Returns true if unit contains either JAXWS JSE or JAXRPC JSE deployment.
+ *
+ * @param unit deployment unit
+ * @return true if either JAXWS JSE or JAXRPC JSE deployment, false otherwise.
+ */
+ public static boolean isJseDeployment( final DeploymentUnit unit )
+ {
+ final boolean isJaxwsJse = ASHelper.isJaxwsJseDeployment( unit );
+ final boolean isJaxrpcJse = ASHelper.isJaxrpcJseDeployment( unit );
+
+ return isJaxwsJse || isJaxrpcJse;
+ }
+
+ /**
+ * Returns true if unit contains either JAXWS EJB or JAXRPC EJB deployment.
+ *
+ * @param unit deployment unit
+ * @return true if either JAXWS EJB or JAXRPC EJB deployment, false otherwise
+ */
+ public static boolean isEjbDeployment( final DeploymentUnit unit )
+ {
+ final boolean isJaxwsEjb = ASHelper.isJaxwsEjbDeployment( unit );
+ final boolean isJaxrpcEjb = ASHelper.isJaxrpcEjbDeployment( unit );
+
+ return isJaxwsEjb || isJaxrpcEjb;
+ }
+
+ /**
+ * Returns true if unit contains either JAXWS EJB or JAXWS JSE deployment.
+ *
+ * @param unit deployment unit
+ * @return true if either JAXWS EJB or JAXWS JSE deployment, false otherwise
+ */
+ public static boolean isJaxwsDeployment( final DeploymentUnit unit )
+ {
+ final boolean isJaxwsEjb = ASHelper.isJaxwsEjbDeployment( unit );
+ final boolean isJaxwsJse = ASHelper.isJaxwsJseDeployment( unit );
+
+ return isJaxwsEjb || isJaxwsJse;
+ }
+
+ /**
+ * Returns true if unit contains either JAXRPC EJB or JAXRPC JSE deployment.
+ *
+ * @param unit deployment unit
+ * @return true if either JAXRPC EJB or JAXRPC JSE deployment, false otherwise
+ */
+ public static boolean isJaxrpcDeployment( final DeploymentUnit unit )
+ {
+ final boolean isJaxrpcEjb = ASHelper.isJaxrpcEjbDeployment( unit );
+ final boolean isJaxrpcJse = ASHelper.isJaxrpcJseDeployment( unit );
+
+ return isJaxrpcEjb || isJaxrpcJse;
+ }
+
+ /**
+ * Gets list of JAXWS servlets meta data.
+ *
+ * @param unit deployment unit
+ * @return list of JAXWS servlets meta data
+ */
+ public static List< ServletMetaData > getJaxwsServlets( final DeploymentUnit unit )
+ {
+ return ASHelper.getWebServiceServlets( unit, true );
+ }
+
+ /**
+ * Gets list of JAXRPC servlets meta data.
+ *
+ * @param unit deployment unit
+ * @return list of JAXRPC servlets meta data
+ */
+ public static List< ServletMetaData > getJaxrpcServlets( final DeploymentUnit unit )
+ {
+ return ASHelper.getWebServiceServlets( unit, false );
+ }
+
+ /**
+ * Gets list of JAXWS EJBs meta data.
+ *
+ * @param unit deployment unit
+ * @return list of JAXWS EJBs meta data
+ */
+ public static List< WebServiceDeclaration > getJaxwsEjbs( final DeploymentUnit unit )
+ {
+ final WebServiceDeployment wsDeployment = ASHelper.getRequiredAttachment( unit, WebServiceDeployment.class );
+ final List< WebServiceDeclaration > endpoints = new ArrayList< WebServiceDeclaration >();
+
+ final Iterator< WebServiceDeclaration > ejbIterator = wsDeployment.getServiceEndpoints().iterator();
+ while ( ejbIterator.hasNext() )
+ {
+ final WebServiceDeclaration ejbContainer = ejbIterator.next();
+ if ( ASHelper.isWebServiceBean( ejbContainer ) )
+ {
+ endpoints.add( ejbContainer );
+ }
+ }
+
+ return endpoints;
+ }
+
+ /**
+ * Returns true if EJB container is webservice endpoint.
+ *
+ * @param ejbContainerAdapter EJB container adapter
+ * @return true if EJB container is webservice endpoint, false otherwise
+ */
+ public static boolean isWebServiceBean( final WebServiceDeclaration ejbContainerAdapter )
+ {
+ final boolean isWebService = ejbContainerAdapter.getAnnotation( WebService.class ) != null;
+ final boolean isWebServiceProvider = ejbContainerAdapter.getAnnotation( WebServiceProvider.class ) != null;
+
+ return isWebService || isWebServiceProvider;
+ }
+
+ /**
+ * Returns endpoint class name.
+ *
+ * @param servletMD servlet meta data
+ * @return endpoint class name
+ */
+ public static String getEndpointName( final ServletMetaData servletMD )
+ {
+ final String endpointClass = servletMD.getServletClass();
+
+ return endpointClass != null ? endpointClass.trim() : null;
+ }
+
+ /**
+ * Returns servlet meta data for requested servlet name.
+ *
+ * @param jbossWebMD jboss web meta data
+ * @param servletName servlet name
+ * @return servlet meta data
+ */
+ public static ServletMetaData getServletForName( final JBossWebMetaData jbossWebMD, final String servletName )
+ {
+ for ( JBossServletMetaData servlet : jbossWebMD.getServlets() )
+ {
+ if ( servlet.getName().equals( servletName ) )
+ {
+ return servlet;
+ }
+ }
+
+ throw new IllegalStateException( "Cannot find servlet for link: " + servletName );
+ }
+
+ /**
+ * Returns webservice endpoint class or null if passed servlet meta data belong to either JSP or servlet instance.
+ *
+ * @param servletMD servlet meta data
+ * @param loader class loader
+ * @return webservice endpoint class or null
+ */
+ public static Class< ? > getEndpointClass( final ServletMetaData servletMD, final ClassLoader loader )
+ {
+ final String endpointClassName = ASHelper.getEndpointName( servletMD );
+ final boolean notJSP = endpointClassName != null && endpointClassName.length() > 0;
+
+ if ( notJSP )
+ {
+ try
+ {
+ final Class< ? > endpointClass = loader.loadClass( endpointClassName );
+ final boolean notServlet = !Servlet.class.isAssignableFrom( endpointClass );
+
+ if ( notServlet )
+ {
+ return endpointClass;
+ }
+ }
+ catch ( ClassNotFoundException cnfe )
+ {
+ ASHelper.LOG.warn( "Cannot load servlet class: " + endpointClassName, cnfe );
+ }
+ }
+
+ return null;
+ }
+
+ /**
+ * Returns required attachment value from deployment unit.
+ *
+ * @param <A> expected value
+ * @param unit deployment unit
+ * @param key attachment key
+ * @return required attachment
+ * @throws IllegalStateException if attachment value is null
+ */
+ public static <A> A getRequiredAttachment( final DeploymentUnit unit, final Class< A > key )
+ {
+ final A value = unit.getAttachment( key );
+ if ( value == null )
+ {
+ ASHelper.LOG.error( "Cannot find attachment in deployment unit: " + key );
+ throw new IllegalStateException();
+ }
+
+ return value;
+ }
+
+ /**
+ * Returns optional attachment value from deployment unit or null if not bound.
+ *
+ * @param <A> expected value
+ * @param unit deployment unit
+ * @param key attachment key
+ * @return optional attachment value or null
+ */
+ public static <A> A getOptionalAttachment( final DeploymentUnit unit, final Class< A > key )
+ {
+ return unit.getAttachment( key );
+ }
+
+ /**
+ * Returns true if deployment unit have attachment value associated with the <b>key</b>.
+ *
+ * @param unit deployment unit
+ * @param key attachment key
+ * @return true if contains attachment, false otherwise
+ */
+ public static boolean hasAttachment( final DeploymentUnit unit, final Class< ? > key )
+ {
+ return ASHelper.getOptionalAttachment( unit, key ) != null;
+ }
+
+ /**
+ * Gets list of JAXRPC or JAXWS servlets meta data.
+ *
+ * @param unit deployment unit
+ * @param jaxws if passed value is <b>true</b> JAXWS servlets list will be returned, otherwise JAXRPC servlets list
+ * @return either JAXRPC or JAXWS servlets list
+ */
+ private static List< ServletMetaData > getWebServiceServlets( final DeploymentUnit unit, final boolean jaxws )
+ {
+ final JBossWebMetaData jbossWebMD = ASHelper.getRequiredAttachment( unit, JBossWebMetaData.class );
+ final ClassLoader loader = unit.getClassLoader();
+ final List< ServletMetaData > endpoints = new ArrayList< ServletMetaData >();
+
+ for ( ServletMetaData servletMD : jbossWebMD.getServlets() )
+ {
+ final Class< ? > endpointClass = ASHelper.getEndpointClass( servletMD, loader );
+
+ if ( endpointClass != null )
+ {
+ // check webservice annotations
+ final boolean isWebService = endpointClass.isAnnotationPresent( WebService.class );
+ final boolean isWebServiceProvider = endpointClass.isAnnotationPresent( WebServiceProvider.class );
+ // detect webservice type
+ final boolean isJaxwsEndpoint = jaxws && ( isWebService || isWebServiceProvider );
+ final boolean isJaxrpcEndpoint = !jaxws && ( !isWebService && !isWebServiceProvider );
+
+ if ( isJaxwsEndpoint || isJaxrpcEndpoint )
+ {
+ endpoints.add( servletMD );
+ }
+ }
+ }
+
+ return endpoints;
+ }
+
+}
Deleted: container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/util/Helper.java
===================================================================
--- container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/util/Helper.java 2009-07-27 12:33:37 UTC (rev 10392)
+++ container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/util/Helper.java 2009-07-27 12:35:51 UTC (rev 10393)
@@ -1,434 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2009, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.webservices.integration.util;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import javax.jws.WebService;
-import javax.servlet.Servlet;
-import javax.xml.ws.WebServiceProvider;
-
-import org.jboss.deployers.structure.spi.DeploymentUnit;
-import org.jboss.logging.Logger;
-import org.jboss.metadata.web.jboss.JBossServletMetaData;
-import org.jboss.metadata.web.jboss.JBossWebMetaData;
-import org.jboss.metadata.web.spec.ServletMetaData;
-import org.jboss.wsf.spi.deployment.Deployment;
-import org.jboss.wsf.spi.deployment.Deployment.DeploymentType;
-import org.jboss.wsf.spi.deployment.integration.WebServiceDeclaration;
-import org.jboss.wsf.spi.deployment.integration.WebServiceDeployment;
-
-/**
- * JBoss AS integration helper class.
- *
- * @author <a href="ropalka(a)redhat.com">Richard Opalka</a>
- */
-public final class Helper
-{
-
- /** Logger. */
- private static final Logger LOG = Logger.getLogger( Helper.class );
-
- /**
- * Forbidden constructor.
- */
- private Helper()
- {
- super();
- }
-
- /**
- * Returns true if unit contains JAXWS JSE, JAXRPC JSE, JAXWS EJB or JAXRPC EJB deployment.
- *
- * @param unit deployment unit
- * @return true if JAXWS JSE, JAXRPC JSE, JAXWS EJB or JAXRPC EJB deployment, false otherwise.
- */
- public static boolean isWebServiceDeployment( final DeploymentUnit unit )
- {
- return Helper.getOptionalAttachment( unit, DeploymentType.class ) != null;
- }
-
- /**
- * Returns true if unit contains JAXRPC EJB deployment.
- *
- * @param unit deployment unit
- * @return true if JAXRPC EJB deployment, false otherwise
- */
- public static boolean isJaxrpcEjbDeployment( final DeploymentUnit unit )
- {
- final DeploymentType deploymentType = Helper.getOptionalAttachment( unit, DeploymentType.class );
-
- return DeploymentType.JAXRPC_EJB21.equals( deploymentType );
- }
-
- /**
- * Returns true if unit contains JAXRPC JSE deployment.
- *
- * @param unit deployment unit
- * @return true if JAXRPC JSE deployment, false otherwise
- */
- public static boolean isJaxrpcJseDeployment( final DeploymentUnit unit )
- {
- final DeploymentType deploymentType = Helper.getOptionalAttachment( unit, DeploymentType.class );
-
- return DeploymentType.JAXRPC_JSE.equals( deploymentType );
- }
-
- /**
- * Returns true if unit contains JAXWS EJB deployment.
- *
- * @param unit deployment unit
- * @return true if JAXWS EJB deployment, false otherwise
- */
- public static boolean isJaxwsEjbDeployment( final DeploymentUnit unit )
- {
- final DeploymentType deploymentType = Helper.getOptionalAttachment( unit, DeploymentType.class );
-
- return DeploymentType.JAXWS_EJB3.equals( deploymentType );
- }
-
- /**
- * Returns true if unit contains JAXWS JSE deployment.
- *
- * @param unit deployment unit
- * @return true if JAXWS JSE deployment, false otherwise
- */
- public static boolean isJaxwsJseDeployment( final DeploymentUnit unit )
- {
- final DeploymentType deploymentType = Helper.getOptionalAttachment( unit, DeploymentType.class );
-
- return DeploymentType.JAXWS_JSE.equals( deploymentType );
- }
-
- /**
- * Returns true if unit contains either JAXWS JSE or JAXRPC JSE deployment.
- *
- * @param unit deployment unit
- * @return true if either JAXWS JSE or JAXRPC JSE deployment, false otherwise.
- */
- public static boolean isJseDeployment( final DeploymentUnit unit )
- {
- final boolean isJaxwsJse = Helper.isJaxwsJseDeployment( unit );
- final boolean isJaxrpcJse = Helper.isJaxrpcJseDeployment( unit );
-
- return isJaxwsJse || isJaxrpcJse;
- }
-
- /**
- * Returns true if unit contains either JAXWS EJB or JAXRPC EJB deployment.
- *
- * @param unit deployment unit
- * @return true if either JAXWS EJB or JAXRPC EJB deployment, false otherwise
- */
- public static boolean isEjbDeployment( final DeploymentUnit unit )
- {
- final boolean isJaxwsEjb = Helper.isJaxwsEjbDeployment( unit );
- final boolean isJaxrpcEjb = Helper.isJaxrpcEjbDeployment( unit );
-
- return isJaxwsEjb || isJaxrpcEjb;
- }
-
- /**
- * Returns true if unit contains either JAXWS EJB or JAXWS JSE deployment.
- *
- * @param unit deployment unit
- * @return true if either JAXWS EJB or JAXWS JSE deployment, false otherwise
- */
- public static boolean isJaxwsDeployment( final DeploymentUnit unit )
- {
- final boolean isJaxwsEjb = Helper.isJaxwsEjbDeployment( unit );
- final boolean isJaxwsJse = Helper.isJaxwsJseDeployment( unit );
-
- return isJaxwsEjb || isJaxwsJse;
- }
-
- /**
- * Returns true if unit contains either JAXRPC EJB or JAXRPC JSE deployment.
- *
- * @param unit deployment unit
- * @return true if either JAXRPC EJB or JAXRPC JSE deployment, false otherwise
- */
- public static boolean isJaxrpcDeployment( final DeploymentUnit unit )
- {
- final boolean isJaxrpcEjb = Helper.isJaxrpcEjbDeployment( unit );
- final boolean isJaxrpcJse = Helper.isJaxrpcJseDeployment( unit );
-
- return isJaxrpcEjb || isJaxrpcJse;
- }
-
- /**
- * Gets list of JAXWS servlets meta data.
- *
- * @param unit deployment unit
- * @return list of JAXWS servlets meta data
- */
- public static List< ServletMetaData > getJaxwsServlets( final DeploymentUnit unit )
- {
- return Helper.getWebServiceServlets( unit, true );
- }
-
- /**
- * Gets list of JAXRPC servlets meta data.
- *
- * @param unit deployment unit
- * @return list of JAXRPC servlets meta data
- */
- public static List< ServletMetaData > getJaxrpcServlets( final DeploymentUnit unit )
- {
- return Helper.getWebServiceServlets( unit, false );
- }
-
- /**
- * Gets list of JAXWS EJBs meta data.
- *
- * @param unit deployment unit
- * @return list of JAXWS EJBs meta data
- */
- public static List< WebServiceDeclaration > getJaxwsEjbs( final DeploymentUnit unit )
- {
- final WebServiceDeployment wsDeployment = Helper.getRequiredAttachment( unit, WebServiceDeployment.class );
- final List< WebServiceDeclaration > endpoints = new ArrayList< WebServiceDeclaration >();
-
- final Iterator< WebServiceDeclaration > ejbIterator = wsDeployment.getServiceEndpoints().iterator();
- while ( ejbIterator.hasNext() )
- {
- final WebServiceDeclaration ejbContainer = ejbIterator.next();
- if ( Helper.isWebServiceBean( ejbContainer ) )
- {
- endpoints.add( ejbContainer );
- }
- }
-
- return endpoints;
- }
-
- /**
- * Returns true if EJB container is webservice endpoint.
- *
- * @param ejbContainerAdapter EJB container adapter
- * @return true if EJB container is webservice endpoint, false otherwise
- */
- public static boolean isWebServiceBean( final WebServiceDeclaration ejbContainerAdapter )
- {
- final boolean isWebService = ejbContainerAdapter.getAnnotation( WebService.class ) != null;
- final boolean isWebServiceProvider = ejbContainerAdapter.getAnnotation( WebServiceProvider.class ) != null;
-
- return isWebService || isWebServiceProvider;
- }
-
- /**
- * Returns endpoint class name.
- *
- * @param servletMD servlet meta data
- * @return endpoint class name
- */
- public static String getEndpointName( final ServletMetaData servletMD )
- {
- final String endpointClass = servletMD.getServletClass();
-
- return endpointClass != null ? endpointClass.trim() : null;
- }
-
- /**
- * Returns servlet meta data for requested servlet name.
- *
- * @param jbossWebMD jboss web meta data
- * @param servletName servlet name
- * @return servlet meta data
- */
- public static ServletMetaData getServletForName( final JBossWebMetaData jbossWebMD, final String servletName )
- {
- for ( JBossServletMetaData servlet : jbossWebMD.getServlets() )
- {
- if ( servlet.getName().equals( servletName ) )
- {
- return servlet;
- }
- }
-
- throw new IllegalStateException( "Cannot find servlet for link: " + servletName );
- }
-
- /**
- * Returns webservice endpoint class or null if passed servlet meta data belong to either JSP or servlet instance.
- *
- * @param servletMD servlet meta data
- * @param loader class loader
- * @return webservice endpoint class or null
- */
- public static Class< ? > getEndpointClass( final ServletMetaData servletMD, final ClassLoader loader )
- {
- final String endpointClassName = Helper.getEndpointName( servletMD );
- final boolean notJSP = endpointClassName != null && endpointClassName.length() > 0;
-
- if ( notJSP )
- {
- try
- {
- final Class< ? > endpointClass = loader.loadClass( endpointClassName );
- final boolean notServlet = !Servlet.class.isAssignableFrom( endpointClass );
-
- if ( notServlet )
- {
- return endpointClass;
- }
- }
- catch ( ClassNotFoundException cnfe )
- {
- Helper.LOG.warn( "Cannot load servlet class: " + endpointClassName, cnfe );
- }
- }
-
- return null;
- }
-
- /**
- * Returns required attachment value from deployment unit.
- *
- * @param <A> expected value
- * @param unit deployment unit
- * @param key attachment key
- * @return required attachment
- * @throws IllegalStateException if attachment value is null
- */
- public static <A> A getRequiredAttachment( final DeploymentUnit unit, final Class< A > key )
- {
- final A value = unit.getAttachment( key );
- if ( value == null )
- {
- Helper.LOG.error( "Cannot find attachment in deployment unit: " + key );
- throw new IllegalStateException();
- }
-
- return value;
- }
-
- /**
- * Returns optional attachment value from deployment unit or null if not bound.
- *
- * @param <A> expected value
- * @param unit deployment unit
- * @param key attachment key
- * @return optional attachment value or null
- */
- public static <A> A getOptionalAttachment( final DeploymentUnit unit, final Class< A > key )
- {
- return unit.getAttachment( key );
- }
-
- /**
- * Returns true if deployment unit have attachment value associated with the <b>key</b>.
- *
- * @param unit deployment unit
- * @param key attachment key
- * @return true if contains attachment, false otherwise
- */
- public static boolean hasAttachment( final DeploymentUnit unit, final Class< ? > key )
- {
- return Helper.getOptionalAttachment( unit, key ) != null;
- }
-
- /**
- * Returns required attachment value from webservice deployment.
- *
- * @param <A> expected value
- * @param dep webservice deployment
- * @param key attachment key
- * @return required attachment
- * @throws IllegalStateException if attachment value is null
- */
- public static <A> A getRequiredAttachment( final Deployment dep, final Class< A > key )
- {
- final A value = dep.getAttachment( key );
- if ( value == null )
- {
- Helper.LOG.error( "Cannot find attachment in webservice deployment: " + key );
- throw new IllegalStateException();
- }
-
- return value;
- }
-
- /**
- * Returns optional attachment value from webservice deployment or null if not bound.
- *
- * @param <A> expected value
- * @param dep webservice deployment
- * @param key attachment key
- * @return optional attachment value or null
- */
- public static <A> A getOptionalAttachment( final Deployment dep, final Class< A > key )
- {
- return dep.getAttachment( key );
- }
-
- /**
- * Returns true if webservice deployment have attachment value associated with the <b>key</b>.
- *
- * @param dep webservice deployment
- * @param key attachment key
- * @return true if contains attachment, false otherwise
- */
- public static boolean hasAttachment( final Deployment dep, final Class< ? > key )
- {
- return Helper.getOptionalAttachment( dep, key ) != null;
- }
-
- /**
- * Gets list of JAXRPC or JAXWS servlets meta data.
- *
- * @param unit deployment unit
- * @param jaxws if passed value is <b>true</b> JAXWS servlets list will be returned, otherwise JAXRPC servlets list
- * @return either JAXRPC or JAXWS servlets list
- */
- private static List< ServletMetaData > getWebServiceServlets( final DeploymentUnit unit, final boolean jaxws )
- {
- final JBossWebMetaData jbossWebMD = Helper.getRequiredAttachment( unit, JBossWebMetaData.class );
- final ClassLoader loader = unit.getClassLoader();
- final List< ServletMetaData > endpoints = new ArrayList< ServletMetaData >();
-
- for ( ServletMetaData servletMD : jbossWebMD.getServlets() )
- {
- final Class< ? > endpointClass = Helper.getEndpointClass( servletMD, loader );
-
- if ( endpointClass != null )
- {
- // check webservice annotations
- final boolean isWebService = endpointClass.isAnnotationPresent( WebService.class );
- final boolean isWebServiceProvider = endpointClass.isAnnotationPresent( WebServiceProvider.class );
- // detect webservice type
- final boolean isJaxwsEndpoint = jaxws && ( isWebService || isWebServiceProvider );
- final boolean isJaxrpcEndpoint = !jaxws && ( !isWebService && !isWebServiceProvider );
-
- if ( isJaxwsEndpoint || isJaxrpcEndpoint )
- {
- endpoints.add( servletMD );
- }
- }
- }
-
- return endpoints;
- }
-
-}
Modified: container/jboss50/branches/ropalka-jboss510/src/main/resources/jbossws-jboss50.deployer/META-INF/stack-agnostic-jboss-beans.xml
===================================================================
--- container/jboss50/branches/ropalka-jboss510/src/main/resources/jbossws-jboss50.deployer/META-INF/stack-agnostic-jboss-beans.xml 2009-07-27 12:33:37 UTC (rev 10392)
+++ container/jboss50/branches/ropalka-jboss510/src/main/resources/jbossws-jboss50.deployer/META-INF/stack-agnostic-jboss-beans.xml 2009-07-27 12:35:51 UTC (rev 10393)
@@ -81,6 +81,13 @@
<property name="relativeOrder">34</property> <!-- [JBDEPLOY-201] workaround -->
</bean>
+ <!-- TODO: remove this hacky aspect in AS trunk -->
+ <bean name="WSJACCPermissionsDeploymentAspect" class="org.jboss.webservices.integration.security.JACCPermissionsDeploymentAspect">
+ <property name="requires">WebMetaData</property>
+ <property name="provides">JACCPermisions</property>
+ <property name="relativeOrder">34</property> <!-- [JBDEPLOY-201] workaround -->
+ </bean>
+
<bean name="WSContextRootDeploymentAspect" class="org.jboss.wsf.framework.deployment.BackwardCompatibleContextRootDeploymentAspect">
<property name="requires">ContainerMetaData</property>
<property name="provides">ContextRoot</property>
@@ -128,7 +135,7 @@
<property name="relativeOrder">15</property> <!-- [JBDEPLOY-201] workaround -->
</bean>
- <bean name="WSWebAppDeploymentAspect" class="org.jboss.webservices.integration.tomcat.jse.WebAppDeploymentAspect">
+ <bean name="WSWebMetaDataModifyingDeploymentAspect" class="org.jboss.webservices.integration.tomcat.jse.WebMetaDataModifyingDeploymentAspect">
<property name="requires">WebMetaData, ContextProperties, StackDescriptor</property>
<property name="provides">WebMetaData</property>
<property name="webMetaDataModifier"><inject bean="WSWebMetaDataModifier"/></property>
15 years, 5 months