JBossWS SVN: r10392 - in stack/cxf/branches/ropalka/modules/server/src/main: resources and 1 other directory.
by jbossws-commits@lists.jboss.org
Author: richard.opalka(a)jboss.com
Date: 2009-07-27 08:33:37 -0400 (Mon, 27 Jul 2009)
New Revision: 10392
Modified:
stack/cxf/branches/ropalka/modules/server/src/main/java/org/jboss/wsf/stack/cxf/DescriptorDeploymentAspect.java
stack/cxf/branches/ropalka/modules/server/src/main/resources/jbossws-cxf-config.xml
Log:
[JBWS-2332] refactoring
Modified: stack/cxf/branches/ropalka/modules/server/src/main/java/org/jboss/wsf/stack/cxf/DescriptorDeploymentAspect.java
===================================================================
--- stack/cxf/branches/ropalka/modules/server/src/main/java/org/jboss/wsf/stack/cxf/DescriptorDeploymentAspect.java 2009-07-27 12:30:32 UTC (rev 10391)
+++ stack/cxf/branches/ropalka/modules/server/src/main/java/org/jboss/wsf/stack/cxf/DescriptorDeploymentAspect.java 2009-07-27 12:33:37 UTC (rev 10392)
@@ -27,7 +27,7 @@
import java.util.Map;
import org.jboss.logging.Logger;
-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;
@@ -200,17 +200,17 @@
*
* @param dep webservice deployment
* @param cxfURL CXF DD URL
- * @see org.jboss.wsf.common.integration.Constants.STACK_CONTEXT_PARAMS
+ * @see org.jboss.wsf.common.integration.WSConstants.STACK_CONTEXT_PARAMS
*/
private void putCXFConfigToDeployment(Deployment dep, URL cxfURL)
{
// 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 cxf config URL to the property map
contextParams.put(CXFServletExt.PARAM_CXF_BEANS_URL, cxfURL.toExternalForm());
Modified: stack/cxf/branches/ropalka/modules/server/src/main/resources/jbossws-cxf-config.xml
===================================================================
--- stack/cxf/branches/ropalka/modules/server/src/main/resources/jbossws-cxf-config.xml 2009-07-27 12:30:32 UTC (rev 10391)
+++ stack/cxf/branches/ropalka/modules/server/src/main/resources/jbossws-cxf-config.xml 2009-07-27 12:33:37 UTC (rev 10392)
@@ -29,8 +29,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.cxf.CXFServletExt</value></entry>
+ <entry>
+ <key>stack.transport.class</key>
+ <value>org.jboss.wsf.stack.cxf.CXFServletExt</value>
+ </entry>
</map>
</property>
<property name="relativeOrder">31</property> <!-- [JBDEPLOY-201] workaround -->
15 years, 5 months
JBossWS SVN: r10391 - common/branches/ropalka/src/main/java/org/jboss/wsf/common/integration.
by jbossws-commits@lists.jboss.org
Author: richard.opalka(a)jboss.com
Date: 2009-07-27 08:30:32 -0400 (Mon, 27 Jul 2009)
New Revision: 10391
Added:
common/branches/ropalka/src/main/java/org/jboss/wsf/common/integration/WSConstants.java
common/branches/ropalka/src/main/java/org/jboss/wsf/common/integration/WSHelper.java
Removed:
common/branches/ropalka/src/main/java/org/jboss/wsf/common/integration/Constants.java
Log:
[JBWS-2332] refactoring
Deleted: common/branches/ropalka/src/main/java/org/jboss/wsf/common/integration/Constants.java
===================================================================
--- common/branches/ropalka/src/main/java/org/jboss/wsf/common/integration/Constants.java 2009-07-27 09:36:28 UTC (rev 10390)
+++ common/branches/ropalka/src/main/java/org/jboss/wsf/common/integration/Constants.java 2009-07-27 12:30:32 UTC (rev 10391)
@@ -1,49 +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.wsf.common.integration;
-
-/**
- * Cross WS stack and JBoss AS integrations constants.
- *
- * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
- */
-public final class Constants
-{
-
- /**
- * Stack specific context parameters configuration property.
- */
- public static final String STACK_CONTEXT_PARAMS = Constants.class.getName() + ".StackContextParams";
- /**
- * Stack specific transport class configuration property.
- */
- public static final String STACK_TRANSPORT_CLASS = Constants.class.getName() + ".StackTransportClass";
-
- /**
- * Forbidden constructor.
- */
- private Constants()
- {
- super();
- }
-
-}
Added: common/branches/ropalka/src/main/java/org/jboss/wsf/common/integration/WSConstants.java
===================================================================
--- common/branches/ropalka/src/main/java/org/jboss/wsf/common/integration/WSConstants.java (rev 0)
+++ common/branches/ropalka/src/main/java/org/jboss/wsf/common/integration/WSConstants.java 2009-07-27 12:30:32 UTC (rev 10391)
@@ -0,0 +1,49 @@
+/*
+ * 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.wsf.common.integration;
+
+/**
+ * Cross WS stack and JBoss AS integration constants.
+ *
+ * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
+ */
+public final class WSConstants
+{
+
+ /**
+ * Stack specific context parameters configuration property.
+ */
+ public static final String STACK_CONTEXT_PARAMS = "stack.context.parameters";
+ /**
+ * Stack specific transport class configuration property.
+ */
+ public static final String STACK_TRANSPORT_CLASS = "stack.transport.class";
+
+ /**
+ * Forbidden constructor.
+ */
+ private WSConstants()
+ {
+ super();
+ }
+
+}
Added: common/branches/ropalka/src/main/java/org/jboss/wsf/common/integration/WSHelper.java
===================================================================
--- common/branches/ropalka/src/main/java/org/jboss/wsf/common/integration/WSHelper.java (rev 0)
+++ common/branches/ropalka/src/main/java/org/jboss/wsf/common/integration/WSHelper.java 2009-07-27 12:30:32 UTC (rev 10391)
@@ -0,0 +1,193 @@
+/*
+ * 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.wsf.common.integration;
+
+import org.jboss.logging.Logger;
+import org.jboss.wsf.spi.deployment.Deployment;
+import org.jboss.wsf.spi.deployment.Deployment.DeploymentType;
+
+/**
+ * Cross WS stack and JBoss AS integration helper.
+ *
+ * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
+ */
+public final class WSHelper
+{
+
+ /** Logger. */
+ private static final Logger LOG = Logger.getLogger( WSHelper.class );
+
+ /**
+ * Forbidden constructor.
+ */
+ private WSHelper()
+ {
+ super();
+ }
+
+ /**
+ * 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 )
+ {
+ WSHelper.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 WSHelper.getOptionalAttachment( dep, key ) != null;
+ }
+
+ /**
+ * Returns true if deployment represents JAXRPC EJB deployment.
+ *
+ * @param dep webservice deployment
+ * @return true if JAXRPC EJB deployment, false otherwise
+ */
+ public static boolean isJaxrpcEjbDeployment( final Deployment dep )
+ {
+ return DeploymentType.JAXRPC_EJB21.equals( dep.getType() );
+ }
+
+ /**
+ * Returns true if deployment represents JAXRPC JSE deployment.
+ *
+ * @param dep webservice deployment
+ * @return true if JAXRPC JSE deployment, false otherwise
+ */
+ public static boolean isJaxrpcJseDeployment( final Deployment dep )
+ {
+ return DeploymentType.JAXRPC_JSE.equals( dep.getType() );
+ }
+
+ /**
+ * Returns true if deployment represents JAXWS EJB deployment.
+ *
+ * @param dep webservice deployment
+ * @return true if JAXWS EJB deployment, false otherwise
+ */
+ public static boolean isJaxwsEjbDeployment( final Deployment dep )
+ {
+ return DeploymentType.JAXWS_EJB3.equals( dep.getType() );
+ }
+
+ /**
+ * Returns true if deployment represents JAXWS JSE deployment.
+ *
+ * @param dep webservice deployment
+ * @return true if JAXWS JSE deployment, false otherwise
+ */
+ public static boolean isJaxwsJseDeployment( final Deployment dep )
+ {
+ return DeploymentType.JAXWS_JSE.equals( dep.getType() );
+ }
+
+ /**
+ * Returns true if deployment represents either JAXWS JSE or JAXRPC JSE deployment.
+ *
+ * @param dep webservice deployment
+ * @return true if either JAXWS JSE or JAXRPC JSE deployment, false otherwise.
+ */
+ public static boolean isJseDeployment( final Deployment dep )
+ {
+ final boolean isJaxwsJse = WSHelper.isJaxwsJseDeployment( dep );
+ final boolean isJaxrpcJse = WSHelper.isJaxrpcJseDeployment( dep );
+
+ return isJaxwsJse || isJaxrpcJse;
+ }
+
+ /**
+ * Returns true if deployment represents either JAXWS EJB or JAXRPC EJB deployment.
+ *
+ * @param dep webservice deployment
+ * @return true if either JAXWS EJB or JAXRPC EJB deployment, false otherwise
+ */
+ public static boolean isEjbDeployment( final Deployment dep )
+ {
+ final boolean isJaxwsEjb = WSHelper.isJaxwsEjbDeployment( dep );
+ final boolean isJaxrpcEjb = WSHelper.isJaxrpcEjbDeployment( dep );
+
+ return isJaxwsEjb || isJaxrpcEjb;
+ }
+
+ /**
+ * Returns true if deployment represents either JAXWS EJB or JAXWS JSE deployment.
+ *
+ * @param dep webservice deployment
+ * @return true if either JAXWS EJB or JAXWS JSE deployment, false otherwise
+ */
+ public static boolean isJaxwsDeployment( final Deployment dep )
+ {
+ final boolean isJaxwsEjb = WSHelper.isJaxwsEjbDeployment( dep );
+ final boolean isJaxwsJse = WSHelper.isJaxwsJseDeployment( dep );
+
+ return isJaxwsEjb || isJaxwsJse;
+ }
+
+ /**
+ * Returns true if deployment represents either JAXRPC EJB or JAXRPC JSE deployment.
+ *
+ * @param dep webservice deployment
+ * @return true if either JAXRPC EJB or JAXRPC JSE deployment, false otherwise
+ */
+ public static boolean isJaxrpcDeployment( final Deployment dep )
+ {
+ final boolean isJaxrpcEjb = WSHelper.isJaxrpcEjbDeployment( dep );
+ final boolean isJaxrpcJse = WSHelper.isJaxrpcJseDeployment( dep );
+
+ return isJaxrpcEjb || isJaxrpcJse;
+ }
+
+}
15 years, 5 months
JBossWS SVN: r10390 - stack/native/trunk.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2009-07-27 05:36:28 -0400 (Mon, 27 Jul 2009)
New Revision: 10390
Modified:
stack/native/trunk/pom.xml
Log:
[JBWS-2702] Moving to Netty 3.1.0.GA
Modified: stack/native/trunk/pom.xml
===================================================================
--- stack/native/trunk/pom.xml 2009-07-27 08:33:40 UTC (rev 10389)
+++ stack/native/trunk/pom.xml 2009-07-27 09:36:28 UTC (rev 10390)
@@ -71,7 +71,7 @@
<jboss.jaxr.version>1.2.1.GA</jboss.jaxr.version>
<apache.scout.version>0.7rc2</apache.scout.version>
<juddi.version>0.9RC4</juddi.version>
- <netty.version>3.1.0.CR1</netty.version>
+ <netty.version>3.1.0.GA</netty.version>
<sun.fastinfoset.version>1.2.2</sun.fastinfoset.version>
<sun.jaxws.version>2.1.3</sun.jaxws.version>
<woodstox.version>3.2.6</woodstox.version>
15 years, 5 months
JBossWS SVN: r10389 - 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 04:33:40 -0400 (Mon, 27 Jul 2009)
New Revision: 10389
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 08:28:25 UTC (rev 10388)
+++ stack/native/branches/ropalka/modules/core/src/main/resources/jbossws-native-config.xml 2009-07-27 08:33:40 UTC (rev 10389)
@@ -25,7 +25,10 @@
<property name="provides">ContextProperties, StackDescriptor</property>
<property name="contextProperties">
<map keyClass="java.lang.String" valueClass="java.lang.String">
- <entry><key>org.jboss.ws.webapp.ServletClass</key><value>org.jboss.wsf.stack.jbws.EndpointServlet</value></entry>
+ <entry>
+ <key>org.jboss.wsf.common.integration.Constants.StackTransportClass</key>
+ <value>org.jboss.wsf.stack.jbws.EndpointServlet</value>
+ </entry>
</map>
</property>
<property name="relativeOrder">31</property> <!-- [JBDEPLOY-201] workaround -->
15 years, 5 months
JBossWS SVN: r10388 - 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 04:28:25 -0400 (Mon, 27 Jul 2009)
New Revision: 10388
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 08:21:15 UTC (rev 10387)
+++ stack/metro/branches/ropalka/modules/server/src/main/java/org/jboss/wsf/stack/metro/SunJaxwsDeploymentAspect.java 2009-07-27 08:28:25 UTC (rev 10388)
@@ -21,6 +21,7 @@
*/
package org.jboss.wsf.stack.metro;
+import org.jboss.wsf.common.integration.Constants;
import org.jboss.wsf.spi.deployment.Deployment;
import org.jboss.wsf.spi.deployment.DeploymentAspect;
import org.jboss.wsf.spi.deployment.Endpoint;
@@ -88,20 +89,21 @@
}
/**
- * Puts SUN JAX-WS config file to deployment property <b>org.jboss.ws.webapp.ContextParameterMap</b> map
- * @param dep deployment where to put
- * @param dd beans to be put
+ * Puts Metro config file reference to the stack specific context properties.
+ *
+ * @param dep webservice deployment
+ * @param jaxwsConfigURL Metro DD URL
+ * @see org.jboss.wsf.common.integration.Constants.STACK_CONTEXT_PARAMS
*/
private static void putSunJaxwsConfigToDeployment(Deployment dep, URL jaxwsConfigURL)
{
// get property map
- String propKey = "org.jboss.ws.webapp.ContextParameterMap";
- Map<String, String> contextParams = (Map<String, String>)dep.getProperty(propKey);
+ Map<String, String> contextParams = (Map<String, String>)dep.getProperty(Constants.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(propKey, contextParams);
+ dep.setProperty(Constants.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 08:21:15 UTC (rev 10387)
+++ stack/metro/branches/ropalka/modules/server/src/main/java/org/jboss/wsf/stack/metro/metadata/RuntimeModelDeploymentAspect.java 2009-07-27 08:28:25 UTC (rev 10388)
@@ -33,6 +33,7 @@
import org.jboss.logging.Logger;
import org.jboss.wsf.common.ResourceLoaderAdapter;
+import org.jboss.wsf.common.integration.Constants;
import org.jboss.wsf.spi.deployment.ArchiveDeployment;
import org.jboss.wsf.spi.deployment.Deployment;
import org.jboss.wsf.spi.deployment.DeploymentAspect;
@@ -142,7 +143,7 @@
private URL getDDUrlFromContext(Deployment deployment) throws MalformedURLException
{
Map<String, String> contextProperties =
- (Map<String, String>)deployment.getProperty("org.jboss.ws.webapp.ContextParameterMap");
+ (Map<String, String>)deployment.getProperty(Constants.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 08:21:15 UTC (rev 10387)
+++ stack/metro/branches/ropalka/modules/server/src/main/resources/jbossws-metro-config.xml 2009-07-27 08:28:25 UTC (rev 10388)
@@ -30,7 +30,8 @@
<property name="provides">ContextProperties</property>
<property name="contextProperties">
<map keyClass="java.lang.String" valueClass="java.lang.String">
- <entry><key>org.jboss.ws.webapp.ServletClass</key><value>org.jboss.wsf.stack.metro.EndpointServlet</value></entry>
+ <entry><key>org.jboss.wsf.common.integration.Constants.StackTransportClass</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: r10387 - in stack/cxf/branches/ropalka/modules/server/src/main: resources and 1 other directory.
by jbossws-commits@lists.jboss.org
Author: richard.opalka(a)jboss.com
Date: 2009-07-27 04:21:15 -0400 (Mon, 27 Jul 2009)
New Revision: 10387
Modified:
stack/cxf/branches/ropalka/modules/server/src/main/java/org/jboss/wsf/stack/cxf/DescriptorDeploymentAspect.java
stack/cxf/branches/ropalka/modules/server/src/main/resources/jbossws-cxf-config.xml
Log:
[JBWS-2332] refactoring
Modified: stack/cxf/branches/ropalka/modules/server/src/main/java/org/jboss/wsf/stack/cxf/DescriptorDeploymentAspect.java
===================================================================
--- stack/cxf/branches/ropalka/modules/server/src/main/java/org/jboss/wsf/stack/cxf/DescriptorDeploymentAspect.java 2009-07-27 08:15:17 UTC (rev 10386)
+++ stack/cxf/branches/ropalka/modules/server/src/main/java/org/jboss/wsf/stack/cxf/DescriptorDeploymentAspect.java 2009-07-27 08:21:15 UTC (rev 10387)
@@ -27,6 +27,7 @@
import java.util.Map;
import org.jboss.logging.Logger;
+import org.jboss.wsf.common.integration.Constants;
import org.jboss.wsf.spi.deployment.ArchiveDeployment;
import org.jboss.wsf.spi.deployment.Deployment;
import org.jboss.wsf.spi.deployment.DeploymentAspect;
@@ -195,20 +196,21 @@
}
/**
- * Puts CXF config file to deployment property <b>org.jboss.ws.webapp.ContextParameterMap</b> map
- * @param dep deployment where to put
- * @param cxfURL to be put
+ * Puts CXF config file reference to the stack specific context properties.
+ *
+ * @param dep webservice deployment
+ * @param cxfURL CXF DD URL
+ * @see org.jboss.wsf.common.integration.Constants.STACK_CONTEXT_PARAMS
*/
private void putCXFConfigToDeployment(Deployment dep, URL cxfURL)
{
// get property map
- String propKey = "org.jboss.ws.webapp.ContextParameterMap";
- Map<String, String> contextParams = (Map<String, String>)dep.getProperty(propKey);
+ Map<String, String> contextParams = (Map<String, String>)dep.getProperty(Constants.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(propKey, contextParams);
+ dep.setProperty(Constants.STACK_CONTEXT_PARAMS, contextParams);
}
// put cxf config URL to the property map
contextParams.put(CXFServletExt.PARAM_CXF_BEANS_URL, cxfURL.toExternalForm());
Modified: stack/cxf/branches/ropalka/modules/server/src/main/resources/jbossws-cxf-config.xml
===================================================================
--- stack/cxf/branches/ropalka/modules/server/src/main/resources/jbossws-cxf-config.xml 2009-07-27 08:15:17 UTC (rev 10386)
+++ stack/cxf/branches/ropalka/modules/server/src/main/resources/jbossws-cxf-config.xml 2009-07-27 08:21:15 UTC (rev 10387)
@@ -29,7 +29,8 @@
<property name="provides">ContextProperties</property>
<property name="contextProperties">
<map keyClass="java.lang.String" valueClass="java.lang.String">
- <entry><key>org.jboss.ws.webapp.ServletClass</key><value>org.jboss.wsf.stack.cxf.CXFServletExt</value></entry>
+ <entry><key>org.jboss.wsf.common.integration.Constants.StackTransportClass</key>
+ <value>org.jboss.wsf.stack.cxf.CXFServletExt</value></entry>
</map>
</property>
<property name="relativeOrder">31</property> <!-- [JBDEPLOY-201] workaround -->
15 years, 5 months
JBossWS SVN: r10386 - common/branches/ropalka/src/main/java/org/jboss/wsf/common/integration.
by jbossws-commits@lists.jboss.org
Author: richard.opalka(a)jboss.com
Date: 2009-07-27 04:15:17 -0400 (Mon, 27 Jul 2009)
New Revision: 10386
Modified:
common/branches/ropalka/src/main/java/org/jboss/wsf/common/integration/Constants.java
Log:
[JBWS-2332] refactoring + fixing typo
Modified: common/branches/ropalka/src/main/java/org/jboss/wsf/common/integration/Constants.java
===================================================================
--- common/branches/ropalka/src/main/java/org/jboss/wsf/common/integration/Constants.java 2009-07-27 07:57:01 UTC (rev 10385)
+++ common/branches/ropalka/src/main/java/org/jboss/wsf/common/integration/Constants.java 2009-07-27 08:15:17 UTC (rev 10386)
@@ -36,7 +36,7 @@
/**
* Stack specific transport class configuration property.
*/
- public static final String STACK_TRANSPORT_CLASS = Constants.class.getName() + ".StackTransportParams";
+ public static final String STACK_TRANSPORT_CLASS = Constants.class.getName() + ".StackTransportClass";
/**
* Forbidden constructor.
15 years, 5 months
JBossWS SVN: r10385 - in container/jboss50/branches/ropalka-jboss510/src/main: resources/jbossws-jboss50.deployer/META-INF and 1 other directory.
by jbossws-commits@lists.jboss.org
Author: richard.opalka(a)jboss.com
Date: 2009-07-27 03:57:01 -0400 (Mon, 27 Jul 2009)
New Revision: 10385
Removed:
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/tomcat/jse/WebMetaDataModifierImpl.java
Modified:
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 + javadoc
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 07:50:34 UTC (rev 10384)
+++ container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/tomcat/jse/WebMetaDataModifier.java 2009-07-27 07:57:01 UTC (rev 10385)
@@ -1,6 +1,6 @@
/*
* JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * 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.
*
@@ -21,20 +21,178 @@
*/
package org.jboss.webservices.integration.tomcat.jse;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+import org.jboss.metadata.javaee.spec.ParamValueMetaData;
+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.wsf.spi.deployment.Deployment;
+import org.jboss.wsf.spi.deployment.Endpoint;
-// TODO: remove this
/**
- * Modifies the web app according to the stack requirements.
+ * The rewriter of jboss web meta data.
+ * It configures WS transport for every webservice endpoint
+ * plus propagates WS stack specific context parameters if requested.
*
- * @author Thomas.Diesler(a)jboss.org
* @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
*/
-public interface WebMetaDataModifier
-{
- // TODO: move these properties to jbossws-common and reuse them in AS integration and in stacks
- static String PROPERTY_WEBAPP_CONTEXT_PARAMETERS = "org.jboss.ws.webapp.ContextParameterMap";
- static String PROPERTY_WEBAPP_SERVLET_CLASS = "org.jboss.ws.webapp.ServletClass";
+public final class WebMetaDataModifier
+{
- void modifyMetaData( Deployment dep );
+ /**
+ * Constructor.
+ */
+ public WebMetaDataModifier()
+ {
+ super();
+ }
+
+ /**
+ * Modifies web meta data to configure webservice stack.
+ *
+ * @param dep webservice deployment
+ */
+ public void modifyMetaData( final Deployment dep )
+ {
+ final JBossWebMetaData jbossWebMD = Helper.getRequiredAttachment( dep, JBossWebMetaData.class );
+
+ this.propagateContextProps( dep, jbossWebMD );
+ this.configureEndpoints( dep, jbossWebMD );
+ }
+
+ /**
+ * Propagates webservice specific context parameters if requested.
+ *
+ * @param dep webservice deployment
+ * @param jbossWebMD web meta data
+ */
+ @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 );
+
+ if ( webserviceContextParams != null )
+ {
+ final List< ParamValueMetaData > contextParams = this.getContextParams( jbossWebMD );
+
+ for ( Map.Entry< String, String > entry : webserviceContextParams.entrySet() )
+ {
+ final ParamValueMetaData newParam = this.newParameter( entry.getKey(), entry.getValue() );
+ contextParams.add( newParam );
+ }
+ }
+ }
+
+ /**
+ * Configures transport servlet class for every found webservice endpoint.
+ *
+ * @param dep webservice deployment
+ * @param jbossWebMD web meta data
+ */
+ private void configureEndpoints( final Deployment dep, final JBossWebMetaData jbossWebMD )
+ {
+ final Iterator< JBossServletMetaData > servlets = jbossWebMD.getServlets().iterator();
+
+ while ( servlets.hasNext() )
+ {
+ final ServletMetaData servletMD = servlets.next();
+ final ClassLoader loader = dep.getInitialClassLoader();
+ final boolean isWebserviceEndpoint = Helper.getEndpointClass( servletMD, loader ) != null;
+
+ if ( isWebserviceEndpoint )
+ {
+ // set transport servlet
+ servletMD.setServletClass( this.getTransportClassName( dep ) );
+
+ // configure webservice endpoint
+ final String endpointClassName = servletMD.getServletClass();
+ final List< ParamValueMetaData > initParams = this.getServletInitParams( servletMD );
+ final ParamValueMetaData endpointParam = this.newParameter(
+ Endpoint.SEPID_DOMAIN_ENDPOINT, endpointClassName );
+
+ initParams.add( endpointParam );
+ }
+ }
+ }
+
+ /**
+ * Returns stack specific transport class name.
+ *
+ * @param dep webservice deployment
+ * @return stack specific transport class name
+ * @throws IllegalStateException if transport class name is not found in deployment properties map
+ */
+ private String getTransportClassName( final Deployment dep )
+ {
+ final String transportClassName = ( String ) dep.getProperty( Constants.STACK_TRANSPORT_CLASS );
+
+ if ( transportClassName == null )
+ {
+ throw new IllegalStateException( "Cannot obtain deployment property: " + Constants.STACK_TRANSPORT_CLASS );
+ }
+
+ return transportClassName;
+ }
+
+ /**
+ * Creates new parameter with specified key and value.
+ *
+ * @param key the key
+ * @param value the value
+ * @return new parameter
+ */
+ private ParamValueMetaData newParameter( final String key, final String value )
+ {
+ final ParamValueMetaData paramMD = new ParamValueMetaData();
+ paramMD.setParamName( key );
+ paramMD.setParamValue( value );
+
+ return paramMD;
+ }
+
+ /**
+ * Gets servlet init params list. Constructs new init params list if it does not exist yet.
+ *
+ * @param servletMD servlet meta data
+ * @return servlet init params list
+ */
+ private List< ParamValueMetaData > getServletInitParams( final ServletMetaData servletMD )
+ {
+ List< ParamValueMetaData > initParams = servletMD.getInitParam();
+
+ if ( initParams == null )
+ {
+ initParams = new ArrayList< ParamValueMetaData >();
+ servletMD.setInitParam( initParams );
+ }
+
+ return initParams;
+ }
+
+ /**
+ * Gets context params list. Constructs new context params list if it does not exist yet.
+ *
+ * @param jbossWebMD web meta data
+ * @return context params list
+ */
+ private List< ParamValueMetaData > getContextParams( final JBossWebMetaData jbossWebMD )
+ {
+ List< ParamValueMetaData > contextParams = jbossWebMD.getContextParams();
+
+ if ( contextParams == null )
+ {
+ contextParams = new ArrayList< ParamValueMetaData >();
+ jbossWebMD.setContextParams( contextParams );
+ }
+
+ return contextParams;
+ }
+
}
Deleted: container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/tomcat/jse/WebMetaDataModifierImpl.java
===================================================================
--- container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/tomcat/jse/WebMetaDataModifierImpl.java 2009-07-27 07:50:34 UTC (rev 10384)
+++ container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/tomcat/jse/WebMetaDataModifierImpl.java 2009-07-27 07:57:01 UTC (rev 10385)
@@ -1,134 +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 org.jboss.logging.Logger;
-import org.jboss.metadata.javaee.spec.ParamValueMetaData;
-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.spi.deployment.Deployment;
-import org.jboss.wsf.spi.deployment.Endpoint;
-
-import javax.xml.ws.WebServiceException;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-/**
- * The rewriter of web.xml metadata.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
- */
-public class WebMetaDataModifierImpl implements WebMetaDataModifier
-{
-
- public void modifyMetaData( final Deployment dep )
- {
- final JBossWebMetaData jbossWebMD = Helper.getRequiredAttachment( dep, JBossWebMetaData.class );
-
- propagateContextProperties( dep, jbossWebMD );
- configureWebserviceEndpoints( dep, jbossWebMD );
- }
-
- private void propagateContextProperties( final Deployment dep, final JBossWebMetaData jbossWebMD )
- {
- Map< String, String > depCtxParams = ( Map< String, String > ) dep.getProperty( PROPERTY_WEBAPP_CONTEXT_PARAMETERS );
- if ( depCtxParams != null )
- {
- List< ParamValueMetaData > contextParams = getContextParameters( jbossWebMD );
-
- for ( Map.Entry< String, String > entry : depCtxParams.entrySet() )
- {
- ParamValueMetaData param = newParameter( entry.getKey(), entry.getValue() );
- contextParams.add( param );
- }
- }
- }
-
- private void configureWebserviceEndpoints( final Deployment dep, final JBossWebMetaData jbossWebMD )
- {
- for (Iterator it = jbossWebMD.getServlets().iterator(); it.hasNext();)
- {
- ServletMetaData servletMD = (ServletMetaData)it.next();
- String endpointClassName = servletMD.getServletClass();
- ClassLoader loader = dep.getInitialClassLoader();
- Class< ? > endpointClass = Helper.getEndpointClass( servletMD, loader );
- String stackEndpointServletName = getStackEndpointServletName(dep);
-
- if ( endpointClass != null )
- {
- servletMD.setServletClass(stackEndpointServletName);
- List<ParamValueMetaData> initParams = getServletInitParameters( servletMD );
- ParamValueMetaData endpointClassParameter = newParameter(Endpoint.SEPID_DOMAIN_ENDPOINT, endpointClassName );
- initParams.add( endpointClassParameter );
- }
- }
- }
-
- private String getStackEndpointServletName( final Deployment dep )
- {
- final String stackSpecificEndpointServlet = ( String ) dep.getProperty( PROPERTY_WEBAPP_SERVLET_CLASS );
- if ( stackSpecificEndpointServlet == null )
- {
- throw new IllegalStateException( "Cannot obtain context property: " + PROPERTY_WEBAPP_SERVLET_CLASS );
- }
-
- return stackSpecificEndpointServlet;
- }
-
- private ParamValueMetaData newParameter( final String key, final String value )
- {
- ParamValueMetaData paramMD = new ParamValueMetaData();
- paramMD.setParamName( key );
- paramMD.setParamValue( value );
- return paramMD;
- }
-
- private List< ParamValueMetaData > getServletInitParameters( final ServletMetaData servletMD )
- {
- List< ParamValueMetaData > initParams = servletMD.getInitParam();
- if (initParams == null)
- {
- initParams = new ArrayList< ParamValueMetaData >();
- servletMD.setInitParam(initParams);
- }
-
- return initParams;
- }
-
- private List< ParamValueMetaData > getContextParameters( final JBossWebMetaData jbossWebMD )
- {
- List< ParamValueMetaData > contextParams = jbossWebMD.getContextParams();
- if (contextParams == null)
- {
- contextParams = new ArrayList< ParamValueMetaData >();
- jbossWebMD.setContextParams( contextParams );
- }
-
- return contextParams;
- }
-
-}
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 07:50:34 UTC (rev 10384)
+++ container/jboss50/branches/ropalka-jboss510/src/main/resources/jbossws-jboss50.deployer/META-INF/stack-agnostic-jboss-beans.xml 2009-07-27 07:57:01 UTC (rev 10385)
@@ -66,7 +66,7 @@
<!-- Deployment aspect helper beans -->
<bean name="WSSecurityHandlerEJB21" class="org.jboss.webservices.integration.tomcat.ejb.SecurityHandlerEJB21"/>
<bean name="WSSecurityHandlerEJB3" class="org.jboss.webservices.integration.tomcat.ejb.SecurityHandlerEJB3"/>
- <bean name="WSWebMetaDataModifier" class="org.jboss.webservices.integration.tomcat.jse.WebMetaDataModifierImpl"/>
+ <bean name="WSWebMetaDataModifier" class="org.jboss.webservices.integration.tomcat.jse.WebMetaDataModifier"/>
<!-- The AS specific deployment aspects -->
<bean name="WSContainerMetaDataDeploymentAspect" class="org.jboss.webservices.integration.metadata.ContainerMetaDataDeploymentAspect">
15 years, 5 months
JBossWS SVN: r10384 - in common/branches/ropalka/src/main/java/org/jboss/wsf/common: integration and 1 other directory.
by jbossws-commits@lists.jboss.org
Author: richard.opalka(a)jboss.com
Date: 2009-07-27 03:50:34 -0400 (Mon, 27 Jul 2009)
New Revision: 10384
Added:
common/branches/ropalka/src/main/java/org/jboss/wsf/common/integration/
common/branches/ropalka/src/main/java/org/jboss/wsf/common/integration/Constants.java
Log:
[JBWS-2332] refactoring constants
Added: common/branches/ropalka/src/main/java/org/jboss/wsf/common/integration/Constants.java
===================================================================
--- common/branches/ropalka/src/main/java/org/jboss/wsf/common/integration/Constants.java (rev 0)
+++ common/branches/ropalka/src/main/java/org/jboss/wsf/common/integration/Constants.java 2009-07-27 07:50:34 UTC (rev 10384)
@@ -0,0 +1,49 @@
+/*
+ * 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.wsf.common.integration;
+
+/**
+ * Cross WS stack and JBoss AS integrations constants.
+ *
+ * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
+ */
+public final class Constants
+{
+
+ /**
+ * Stack specific context parameters configuration property.
+ */
+ public static final String STACK_CONTEXT_PARAMS = Constants.class.getName() + ".StackContextParams";
+ /**
+ * Stack specific transport class configuration property.
+ */
+ public static final String STACK_TRANSPORT_CLASS = Constants.class.getName() + ".StackTransportParams";
+
+ /**
+ * Forbidden constructor.
+ */
+ private Constants()
+ {
+ super();
+ }
+
+}
15 years, 5 months