Author: alessio.soldano(a)jboss.com
Date: 2011-05-03 06:48:29 -0400 (Tue, 03 May 2011)
New Revision: 14224
Removed:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/config/CommonConfig.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/config/binding/OMFactoryJAXWS.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/config/jaxws/
Modified:
stack/native/trunk/modules/client/pom.xml
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/client/transport/NettyClient.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/config/JBossWSConfigFactory.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/config/binding/OMFactoryJAXRPC.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/config/jaxrpc/CommonConfigJAXRPC.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/umdm/EndpointConfigMetaData.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/umdm/FeatureAwareClientEndpointMetaDataAdapter.java
stack/native/trunk/modules/core/src/main/resources/META-INF/standard-jaxws-client-config.xml
stack/native/trunk/modules/core/src/main/resources/META-INF/standard-jaxws-endpoint-config.xml
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/handlerlifecycle/META-INF/jaxws-client-config.xml
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/handlerlifecycle/WEB-INF/jaxws-endpoint-config.xml
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2187/META-INF/jbws2187-client-config.xml
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2259/WEB-INF/jaxws-endpoint-config.xml
Log:
[JBWS-3282] Update jbossws-native to use new client/endpoint configurations
(urn:jboss:jbossws-jaxws-config:4.0) and the corresponding parser for jaxws. Also update
jaxrpc configurations to be an extension of the stack agnostic common configuration
metadata.
Modified: stack/native/trunk/modules/client/pom.xml
===================================================================
--- stack/native/trunk/modules/client/pom.xml 2011-05-03 10:42:20 UTC (rev 14223)
+++ stack/native/trunk/modules/client/pom.xml 2011-05-03 10:48:29 UTC (rev 14224)
@@ -47,7 +47,7 @@
<configuration>
<archive>
<manifestEntries>
- <Class-Path>jbossws-api.jar jbossws-spi.jar jbossws-common.jar
jbossws-common-tools.jar jbossws-native-core.jar jbossws-native-factories.jar
jbossws-native-services.jar jaxrpc-api.jar jaxws-api.jar jsr181-api.jar saaj-api.jar
activation.jar commons-logging.jar concurrent.jar javassist.jar jaxb-api.jar jaxb-impl.jar
mail.jar jboss-logging-spi.jar jboss-logging-log4j.jar jcl-over-slf4j.jar slf4j-api.jar
slf4j-jboss-logging.jar jbosssx-client.jar jboss-javaee.jar jboss-xml-binding.jar
jbossxb.jar netty.jar wscommons-policy.jar stax-api.jar wsdl4j.jar</Class-Path>
+ <Class-Path>jbossws-api.jar jbossws-spi.jar jbossws-common.jar
jbossws-common-tools.jar jbossws-native-core.jar jbossws-native-factories.jar
jbossws-native-services.jar jaxrpc-api.jar jaxws-api.jar jsr181-api.jar saaj-api.jar
activation.jar commons-logging.jar concurrent.jar javassist.jar jaxb-api.jar jaxb-impl.jar
mail.jar jboss-logging-spi.jar jboss-logging-log4j.jar jcl-over-slf4j.jar slf4j-api.jar
slf4j-jboss-logging.jar jbosssx-client.jar jboss-javaee.jar jboss-xml-binding.jar
jbossxb.jar netty.jar wscommons-policy.jar stax-api.jar wsdl4j.jar
wstx.jar</Class-Path>
</manifestEntries>
</archive>
</configuration>
Modified:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/client/transport/NettyClient.java
===================================================================
---
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/client/transport/NettyClient.java 2011-05-03
10:42:20 UTC (rev 14223)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/client/transport/NettyClient.java 2011-05-03
10:48:29 UTC (rev 14224)
@@ -62,9 +62,9 @@
import org.jboss.ws.core.client.transport.WSResponseHandler.Result;
import org.jboss.ws.core.soap.MessageContextAssociation;
import org.jboss.ws.feature.FastInfosetFeature;
-import org.jboss.ws.metadata.config.CommonConfig;
import org.jboss.ws.metadata.config.EndpointProperty;
import org.jboss.ws.metadata.umdm.EndpointMetaData;
+import org.jboss.wsf.spi.metadata.config.CommonConfig;
/**
* A http client using Netty
Deleted:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/config/CommonConfig.java
===================================================================
---
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/config/CommonConfig.java 2011-05-03
10:42:20 UTC (rev 14223)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/config/CommonConfig.java 2011-05-03
10:48:29 UTC (rev 14224)
@@ -1,125 +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.ws.metadata.config;
-
-import java.net.URI;
-import java.net.URISyntaxException;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.jboss.ws.extensions.wsrm.config.RMConfig;
-import org.jboss.ws.metadata.umdm.EndpointMetaData;
-import org.jboss.ws.metadata.umdm.HandlerMetaData;
-import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedHandlerMetaData.HandlerType;
-
-/**
- * A common configuration
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 18-Dec-2005
- */
-public abstract class CommonConfig
-{
- private String configName;
- private RMConfig wsrmCfg;
- private List<URI> features = new ArrayList<URI>();
- private List<EndpointProperty> properties = new
ArrayList<EndpointProperty>();
-
- public String getConfigName()
- {
- return configName;
- }
-
- public void setConfigName(String configName)
- {
- this.configName = configName;
- }
-
- public abstract List<HandlerMetaData> getHandlers(EndpointMetaData epMetaData,
HandlerType type);
-
- public boolean hasFeature(URI type) {
- return features.contains(type);
- }
-
- public boolean hasFeature(String uri)
- {
- return hasFeature(nameToURI(uri));
- }
-
- public void setFeature(String type, boolean enabled) {
-
- if(enabled) {
- features.add(nameToURI(type));
- }
- else
- features.remove(nameToURI(type));
- }
-
- public void setRMMetaData(RMConfig wsrmCfg)
- {
- this.wsrmCfg = wsrmCfg;
- }
-
- public RMConfig getRMMetaData()
- {
- return this.wsrmCfg;
- }
-
- public void addProperty(String name, String value)
- {
- EndpointProperty p = new EndpointProperty();
- p.name = nameToURI(name);
- p.value = value;
- properties.add(p);
- }
-
- public String getProperty(String name)
- {
- String value = null;
- URI uri = nameToURI(name);
-
- for(EndpointProperty wsp : properties)
- {
- if(wsp.name.equals(uri))
- {
- value = wsp.value;
- break;
- }
- }
- return value;
- }
-
- public List<EndpointProperty> getProperties() {
- return properties;
- }
-
- private static URI nameToURI(String name)
- {
- URI uri = null;
- try {
- uri = new URI(name);
- } catch (URISyntaxException e) {
- throw new IllegalArgumentException(e.getMessage());
- }
- return uri;
- }
-}
Modified:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/config/JBossWSConfigFactory.java
===================================================================
---
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/config/JBossWSConfigFactory.java 2011-05-03
10:42:20 UTC (rev 14223)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/config/JBossWSConfigFactory.java 2011-05-03
10:48:29 UTC (rev 14224)
@@ -1,6 +1,6 @@
/*
* JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * Copyright 2011, 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.
*
@@ -32,13 +32,14 @@
import org.jboss.ws.core.utils.DelegateClassLoader;
import org.jboss.ws.core.utils.JBossWSEntityResolver;
import org.jboss.ws.metadata.config.binding.OMFactoryJAXRPC;
-import org.jboss.ws.metadata.config.binding.OMFactoryJAXWS;
import org.jboss.ws.metadata.config.jaxrpc.ConfigRootJAXRPC;
-import org.jboss.ws.metadata.config.jaxws.ConfigRootJAXWS;
import org.jboss.wsf.common.DOMUtils;
import org.jboss.wsf.common.ResourceLoaderAdapter;
import org.jboss.wsf.spi.classloading.ClassLoaderProvider;
import org.jboss.wsf.spi.deployment.UnifiedVirtualFile;
+import org.jboss.wsf.spi.metadata.config.CommonConfig;
+import org.jboss.wsf.spi.metadata.config.ConfigMetaDataParser;
+import org.jboss.wsf.spi.metadata.config.ConfigRoot;
import org.jboss.xb.binding.JBossXBException;
import org.jboss.xb.binding.Unmarshaller;
import org.jboss.xb.binding.UnmarshallerFactory;
@@ -56,7 +57,7 @@
private final Logger log = Logger.getLogger(JBossWSConfigFactory.class);
private static String URN_JAXRPC_CONFIG = "urn:jboss:jaxrpc-config:2.0";
- private static String URN_JAXWS_CONFIG = "urn:jboss:jaxws-config:2.0";
+ private static String URN_JAXWS_CONFIG =
"urn:jboss:jbossws-jaxws-config:4.0";
private ClassLoader loader;
@@ -102,7 +103,7 @@
}
else if (URN_JAXWS_CONFIG.equals(nsURI))
{
- wsConfig = unmarshaller.unmarshal(is, new OMFactoryJAXWS(), null);
+ wsConfig = ConfigMetaDataParser.parse(is);
}
else
{
@@ -173,7 +174,7 @@
}
else
{
- config = ((ConfigRootJAXWS)configRoot).getConfigByName(configName);
+ config = ((ConfigRoot)configRoot).getConfigByName(configName);
}
if (config == null)
Modified:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/config/binding/OMFactoryJAXRPC.java
===================================================================
---
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/config/binding/OMFactoryJAXRPC.java 2011-05-03
10:42:20 UTC (rev 14223)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/config/binding/OMFactoryJAXRPC.java 2011-05-03
10:48:29 UTC (rev 14224)
@@ -99,7 +99,7 @@
else if("property-value".equals(localName))
{
int lastEntry = commonConfig.getProperties().isEmpty() ? 0 :
commonConfig.getProperties().size()-1;
- EndpointProperty p = commonConfig.getProperties().get(lastEntry);
+ EndpointProperty p = commonConfig.getAllProperties().get(lastEntry);
p.value = value;
}
}
Deleted:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/config/binding/OMFactoryJAXWS.java
===================================================================
---
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/config/binding/OMFactoryJAXWS.java 2011-05-03
10:42:20 UTC (rev 14223)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/config/binding/OMFactoryJAXWS.java 2011-05-03
10:48:29 UTC (rev 14224)
@@ -1,368 +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.ws.metadata.config.binding;
-
-import javax.xml.namespace.QName;
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.metadata.config.EndpointProperty;
-import org.jboss.ws.metadata.config.jaxws.ClientConfigJAXWS;
-import org.jboss.ws.metadata.config.jaxws.CommonConfigJAXWS;
-import org.jboss.ws.metadata.config.jaxws.ConfigRootJAXWS;
-import org.jboss.ws.metadata.config.jaxws.EndpointConfigJAXWS;
-import org.jboss.ws.metadata.config.jaxws.HandlerChainsConfigJAXWS;
-import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedHandlerChainMetaData;
-import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedHandlerChainsMetaData;
-import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedHandlerMetaData;
-import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedInitParamMetaData;
-import org.jboss.xb.binding.ObjectModelFactory;
-import org.jboss.xb.binding.UnmarshallingContext;
-import org.xml.sax.Attributes;
-import org.jboss.ws.extensions.wsrm.config.RMBackPortsServerConfig;
-import org.jboss.ws.extensions.wsrm.config.RMDeliveryAssuranceConfig;
-import org.jboss.ws.extensions.wsrm.config.RMMessageRetransmissionConfig;
-import org.jboss.ws.extensions.wsrm.config.RMConfig;
-import org.jboss.ws.extensions.wsrm.config.RMPortConfig;
-
-/**
- * ObjectModelFactory for JAXWS configurations.
- * @deprecated This is to be replaced by a stax based configuration parser
- *
- * @author Thomas.Diesler(a)jboss.org
- * @author Heiko.Braun(a)jboss.org
- * @since 18-Dec-2005
- */
-@Deprecated
-public class OMFactoryJAXWS implements ObjectModelFactory
-{
- // provide logging
- private final Logger log = Logger.getLogger(OMFactoryJAXWS.class);
-
- public Object newRoot(Object root, UnmarshallingContext ctx, String namespaceURI,
String localName, Attributes attrs)
- {
- return new ConfigRootJAXWS();
- }
-
- public Object completeRoot(Object root, UnmarshallingContext ctx, String namespaceURI,
String localName)
- {
- return root;
- }
-
- /**
- * Called when parsing of a new element started.
- */
- public Object newChild(ConfigRootJAXWS config, UnmarshallingContext navigator, String
namespaceURI, String localName, Attributes attrs)
- {
- log.trace("WSConfig newChild: " + localName);
- if ("endpoint-config".equals(localName))
- {
- EndpointConfigJAXWS wsEndpointConfig = new EndpointConfigJAXWS();
- config.getEndpointConfig().add(wsEndpointConfig);
- return wsEndpointConfig;
- }
- if ("client-config".equals(localName))
- {
- ClientConfigJAXWS clientConfig = new ClientConfigJAXWS();
- config.getClientConfig().add(clientConfig);
- return clientConfig;
- }
- return null;
- }
-
- /**
- * Called when a new simple child element with text value was read from the XML
content.
- */
- public void setValue(CommonConfigJAXWS commonConfig, UnmarshallingContext navigator,
String namespaceURI, String localName, String value)
- {
- if (log.isTraceEnabled())
- log.trace("CommonConfig setValue: nuri=" + namespaceURI + "
localName=" + localName + " value=" + value);
-
- if (localName.equals("config-name"))
- commonConfig.setConfigName(value);
- if(localName.equals("feature"))
- commonConfig.setFeature(value, true);
-
- if("property-name".equals(localName))
- {
- commonConfig.addProperty(value, null);
- }
- else if("property-value".equals(localName))
- {
- int lastEntry = commonConfig.getProperties().isEmpty() ? 0 :
commonConfig.getProperties().size()-1;
- EndpointProperty p = commonConfig.getProperties().get(lastEntry);
- p.value = value;
- }
- }
-
- /**
- * Called when parsing of a new element started.
- */
- public Object newChild(CommonConfigJAXWS commonConfig, UnmarshallingContext navigator,
String namespaceURI, String localName, Attributes attrs)
- {
- log.trace("CommonConfig newChild: " + localName);
-
- if ("pre-handler-chains".equals(localName))
- {
- HandlerChainsConfigJAXWS preHandlerChains = new HandlerChainsConfigJAXWS();
- commonConfig.setPreHandlerChains(preHandlerChains);
- return preHandlerChains;
- }
- if ("post-handler-chains".equals(localName))
- {
- HandlerChainsConfigJAXWS postHandlerChains = new HandlerChainsConfigJAXWS();
- commonConfig.setPostHandlerChains(postHandlerChains);
- return postHandlerChains;
- }
- if ("reliable-messaging".equals(localName))
- {
- RMConfig wsrmCfg = new RMConfig();
- commonConfig.setRMMetaData(wsrmCfg);
- return wsrmCfg;
- }
-
- return null;
- }
-
- public Object newChild(RMConfig wsrmConfig, UnmarshallingContext navigator, String
namespaceURI, String localName, Attributes attrs)
- {
- int countOfAttributes = attrs.getLength();
-
- if (localName.equals("delivery-assurance"))
- {
- RMDeliveryAssuranceConfig deliveryAssurance = getDeliveryAssurance(attrs);
- wsrmConfig.setDeliveryAssurance(deliveryAssurance);
- return deliveryAssurance;
- }
- if (localName.equals("message-retransmission"))
- {
- int interval = 0, attempts = 0, timeout=0;
- for (int i = 0; i < countOfAttributes; i++)
- {
- String attrLocalName = attrs.getLocalName(i);
- if (attrLocalName.equals("interval"))
- interval = Integer.valueOf(attrs.getValue(i));
- if (attrLocalName.equals("attempts"))
- attempts = Integer.valueOf(attrs.getValue(i));
- if (attrLocalName.equals("timeout"))
- timeout = Integer.valueOf(attrs.getValue(i));
- }
-
- RMMessageRetransmissionConfig retransmissionConfig = new
RMMessageRetransmissionConfig();
- retransmissionConfig.setCountOfAttempts(attempts);
- retransmissionConfig.setRetransmissionInterval(interval);
- retransmissionConfig.setMessageTimeout(timeout);
- wsrmConfig.setMessageRetransmission(retransmissionConfig);
- return retransmissionConfig;
- }
- if (localName.equals("backports-server"))
- {
- String host = null, port = null;
- for (int i = 0; i < countOfAttributes && (host == null || port ==
null); i++)
- {
- String attrLocalName = attrs.getLocalName(i);
- if (attrLocalName.equals("host"))
- host = attrs.getValue(i);
- if (attrLocalName.equals("port"))
- port = attrs.getValue(i);
- }
-
- RMBackPortsServerConfig backportsServer = new RMBackPortsServerConfig();
- backportsServer.setHost(host);
- backportsServer.setPort(port);
- wsrmConfig.setBackPortsServer(backportsServer);
- return backportsServer;
- }
- if (localName.equals("port"))
- {
- String portName = null;
- for (int i = 0; i < countOfAttributes; i++)
- {
- if (attrs.getLocalName(i).equals("name"))
- {
- portName = attrs.getValue(i);
- break;
- }
- }
- RMPortConfig port = new RMPortConfig();
- port.setPortName(QName.valueOf(portName));
- wsrmConfig.getPorts().add(port);
- return port;
- }
-
- return null;
- }
-
- public Object newChild(RMPortConfig port, UnmarshallingContext navigator, String
namespaceURI, String localName, Attributes attrs)
- {
- if (localName.equals("delivery-assurance"))
- {
- RMDeliveryAssuranceConfig deliveryAssurance = getDeliveryAssurance(attrs);
- port.setDeliveryAssurance(deliveryAssurance);
- return deliveryAssurance;
- }
-
- return null;
- }
-
- private RMDeliveryAssuranceConfig getDeliveryAssurance(Attributes attrs)
- {
- String inOrder = null, quality = null;
- for (int i = 0; i < attrs.getLength() && (inOrder == null || quality ==
null); i++)
- {
- String attrLocalName = attrs.getLocalName(i);
- if (attrLocalName.equals("inOrder"))
- inOrder = attrs.getValue(i);
- if (attrLocalName.equals("quality"))
- quality = attrs.getValue(i);
- }
- RMDeliveryAssuranceConfig deliveryAssurance = new RMDeliveryAssuranceConfig();
- deliveryAssurance.setQuality(quality);
- deliveryAssurance.setInOrder(inOrder);
- return deliveryAssurance;
- }
-
- /**
- * Called when parsing of a new element started.
- */
- public Object newChild(HandlerChainsConfigJAXWS handlerChains, UnmarshallingContext
navigator, String namespaceURI, String localName, Attributes attrs)
- {
- log.trace("WSHandlerChainsConfig newChild: " + localName);
-
- if ("handler-chain".equals(localName))
- {
- UnifiedHandlerChainMetaData handlerChain = new
UnifiedHandlerChainMetaData(null);
- handlerChains.getHandlerChains().add(handlerChain);
- return handlerChain;
- }
- return null;
- }
-
- //here below are methods that used to be inherited from import
org.jboss.wsf.spi.metadata.j2ee.serviceref.HandlerChainsObjectFactory
- //which is not in this class' type hierarchy any more given it has been deprecated
in jbossws-spi in order to remove JBossXB dependency
-
- /**
- * Called when parsing of a new element started.
- */
- public Object newChild(UnifiedHandlerChainsMetaData handlerConfig,
UnmarshallingContext navigator, String namespaceURI, String localName, Attributes attrs)
- {
- if ("handler-chain".equals(localName))
- return new UnifiedHandlerChainMetaData(handlerConfig);
- else return null;
- }
-
- /**
- * Called when parsing character is complete.
- */
- public void addChild(UnifiedHandlerChainsMetaData handlerConfig,
UnifiedHandlerChainMetaData handlerChain, UnmarshallingContext navigator, String
namespaceURI,
- String localName)
- {
- if (!handlerChain.isExcluded()) handlerConfig.addHandlerChain(handlerChain);
- }
-
- /**
- * Called when parsing of a new element started.
- */
- public Object newChild(UnifiedHandlerChainMetaData chainConfig, UnmarshallingContext
navigator, String namespaceURI, String localName, Attributes attrs)
- {
- if ("handler".equals(localName))
- return new UnifiedHandlerMetaData(chainConfig);
- else return null;
- }
-
- /**
- * Called when parsing character is complete.
- */
- public void addChild(UnifiedHandlerChainMetaData handlerConfig, UnifiedHandlerMetaData
handler, UnmarshallingContext navigator, String namespaceURI, String localName)
- {
- handlerConfig.addHandler(handler);
- }
-
- /**
- * Called when parsing of a new element started.
- */
- public Object newChild(UnifiedHandlerMetaData handler, UnmarshallingContext navigator,
String namespaceURI, String localName, Attributes attrs)
- {
- if ("init-param".equals(localName))
- return new UnifiedInitParamMetaData();
- else return null;
- }
-
- /**
- * Called when parsing character is complete.
- */
- public void addChild(UnifiedHandlerMetaData handler, UnifiedInitParamMetaData param,
UnmarshallingContext navigator, String namespaceURI, String localName)
- {
- handler.addInitParam(param);
- }
-
- /**
- * Called when a new simple child element with text value was read from the XML
content.
- */
- public void setValue(UnifiedHandlerChainMetaData handlerChain, UnmarshallingContext
navigator, String namespaceURI, String localName, String value)
- {
- if (log.isTraceEnabled())
- log.trace("UnifiedHandlerChainMetaData setValue: nuri=" + namespaceURI
+ " localName=" + localName + " value=" + value);
- try
- {
- if (localName.equals("protocol-bindings"))
- handlerChain.setProtocolBindings(value);
- else if (localName.equals("service-name-pattern"))
- handlerChain.setServiceNamePattern(navigator.resolveQName(value));
- else if (localName.equals("port-name-pattern"))
- handlerChain.setPortNamePattern(navigator.resolveQName(value));
- }
- catch (java.lang.IllegalStateException ex)
- {
- log.warn("Could not get " + localName + " value : "
- + ex.getMessage() + ", this handler chain will be ingored");
- handlerChain.setExcluded(true);
- }
- }
-
- /**
- * Called when a new simple child element with text value was read from the XML
content.
- */
- public void setValue(UnifiedHandlerMetaData handler, UnmarshallingContext navigator,
String namespaceURI, String localName, String value)
- {
- if (log.isTraceEnabled())
- log.trace("UnifiedHandlerMetaData setValue: nuri=" + namespaceURI +
" localName=" + localName + " value=" + value);
-
- if (localName.equals("handler-name"))
- handler.setHandlerName(value);
- else if (localName.equals("handler-class"))
- handler.setHandlerClass(value);
- }
-
- /**
- * Called when a new simple child element with text value was read from the XML
content.
- */
- public void setValue(UnifiedInitParamMetaData param, UnmarshallingContext navigator,
String namespaceURI, String localName, String value)
- {
- if (log.isTraceEnabled())
- log.trace("UnifiedInitParamMetaData setValue: nuri=" + namespaceURI +
" localName=" + localName + " value=" + value);
-
- if (localName.equals("param-name"))
- param.setParamName(value);
- else if (localName.equals("param-value"))
- param.setParamValue(value);
- }
-}
Modified:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/config/jaxrpc/CommonConfigJAXRPC.java
===================================================================
---
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/config/jaxrpc/CommonConfigJAXRPC.java 2011-05-03
10:42:20 UTC (rev 14223)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/config/jaxrpc/CommonConfigJAXRPC.java 2011-05-03
10:48:29 UTC (rev 14224)
@@ -1,6 +1,6 @@
/*
* JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * Copyright 2011, 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,16 +21,15 @@
*/
package org.jboss.ws.metadata.config.jaxrpc;
+import java.net.URI;
+import java.net.URISyntaxException;
import java.util.ArrayList;
import java.util.List;
-import org.jboss.ws.metadata.config.CommonConfig;
-import org.jboss.ws.metadata.umdm.EndpointMetaData;
-import org.jboss.ws.metadata.umdm.HandlerMetaData;
-import org.jboss.ws.metadata.umdm.HandlerMetaDataJAXRPC;
+import org.jboss.ws.metadata.config.EndpointProperty;
+import org.jboss.wsf.spi.metadata.config.AbstractCommonConfig;
+import org.jboss.wsf.spi.metadata.config.Feature;
import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedHandlerChainMetaData;
-import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedHandlerMetaData;
-import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedHandlerMetaData.HandlerType;
/**
* A JBossWS client configuration
@@ -38,53 +37,112 @@
* @author Thomas.Diesler(a)jboss.org
* @since 18-Dec-2005
*/
-public abstract class CommonConfigJAXRPC extends CommonConfig
+public abstract class CommonConfigJAXRPC extends AbstractCommonConfig
{
- private UnifiedHandlerChainMetaData preHandlerChain;
- private UnifiedHandlerChainMetaData postHandlerChain;
-
+ private List<EndpointProperty> properties = new
ArrayList<EndpointProperty>();
+
public UnifiedHandlerChainMetaData getPostHandlerChain()
{
- return postHandlerChain;
+ //adapt the jbossws-spi common config to this legacy jaxrpc one
+ List<UnifiedHandlerChainMetaData> chains = getPostHandlerChains();
+ if (chains != null && !chains.isEmpty())
+ {
+ return chains.get(0);
+ }
+ else
+ {
+ return null;
+ }
}
public void setPostHandlerChain(UnifiedHandlerChainMetaData postHandlerChain)
{
- this.postHandlerChain = postHandlerChain;
+ //adapt the jbossws-spi common config to this legacy jaxrpc one
+ List<UnifiedHandlerChainMetaData> chains = new
ArrayList<UnifiedHandlerChainMetaData>(1);
+ chains.add(postHandlerChain);
+ setPostHandlerChains(chains);
}
public UnifiedHandlerChainMetaData getPreHandlerChain()
{
- return preHandlerChain;
+ //adapt the jbossws-spi common config to this legacy jaxrpc one
+ List<UnifiedHandlerChainMetaData> chains = getPreHandlerChains();
+ if (chains != null && !chains.isEmpty())
+ {
+ return chains.get(0);
+ }
+ else
+ {
+ return null;
+ }
}
public void setPreHandlerChain(UnifiedHandlerChainMetaData preHandlerChain)
{
- this.preHandlerChain = preHandlerChain;
+ //adapt the jbossws-spi common config to this legacy jaxrpc one
+ List<UnifiedHandlerChainMetaData> chains = new
ArrayList<UnifiedHandlerChainMetaData>(1);
+ chains.add(preHandlerChain);
+ setPreHandlerChains(chains);
}
+ public boolean hasFeature(URI type) {
+ return hasFeature(type.toString());
+ }
+
+ public boolean hasFeature(String uri)
+ {
+ return super.hasFeature(uri);
+ //return hasFeature(nameToURI(uri));
+ }
+
+ public void setFeature(String type, boolean enabled) {
+ super.setFeature(new Feature(type), enabled);
+ }
+
@Override
- public List<HandlerMetaData> getHandlers(EndpointMetaData epMetaData,
HandlerType type)
+ public void setProperty(String name, String value)
{
- List<HandlerMetaData> handlers = new ArrayList<HandlerMetaData>();
-
- UnifiedHandlerChainMetaData handlerChain;
- if (type == HandlerType.PRE)
- handlerChain = getPreHandlerChain();
- else if (type == HandlerType.POST)
- handlerChain = getPostHandlerChain();
- else
- throw new IllegalArgumentException("Invalid handler type: " + type);
-
- if (handlerChain != null)
+ addProperty(name, value);
+ }
+
+ public void addProperty(String name, String value)
+ {
+ EndpointProperty p = new EndpointProperty();
+ p.name = nameToURI(name);
+ p.value = value;
+ properties.add(p);
+ //keep common config in synch
+ super.setProperty(name, value);
+ }
+
+ public String getProperty(String name)
+ {
+ String value = null;
+ URI uri = nameToURI(name);
+
+ for (EndpointProperty wsp : properties)
{
- for (UnifiedHandlerMetaData uhmd : handlerChain.getHandlers())
+ if (wsp.name.equals(uri))
{
- HandlerMetaDataJAXRPC hmd = HandlerMetaDataJAXRPC.newInstance(uhmd, type);
- handlers.add(hmd);
+ value = wsp.value;
+ break;
}
}
-
- return handlers;
+ return value;
}
+
+ public List<EndpointProperty> getAllProperties() {
+ return properties;
+ }
+
+ private static URI nameToURI(String name)
+ {
+ URI uri = null;
+ try {
+ uri = new URI(name);
+ } catch (URISyntaxException e) {
+ throw new IllegalArgumentException(e.getMessage());
+ }
+ return uri;
+ }
}
Modified:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/umdm/EndpointConfigMetaData.java
===================================================================
---
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/umdm/EndpointConfigMetaData.java 2011-05-03
10:42:20 UTC (rev 14223)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/umdm/EndpointConfigMetaData.java 2011-05-03
10:48:29 UTC (rev 14224)
@@ -25,7 +25,10 @@
import java.util.List;
import org.jboss.logging.Logger;
-import org.jboss.ws.metadata.config.CommonConfig;
+import org.jboss.ws.metadata.config.jaxrpc.CommonConfigJAXRPC;
+import org.jboss.wsf.spi.metadata.config.CommonConfig;
+import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedHandlerChainMetaData;
+import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedHandlerMetaData;
import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedHandlerMetaData.HandlerType;
/**
@@ -110,8 +113,8 @@
List<HandlerMetaData> sepHandlers =
getHandlerMetaData(HandlerType.ENDPOINT);
clearHandlers();
- List<HandlerMetaData> preHandlers = config.getHandlers(epMetaData,
HandlerType.PRE);
- List<HandlerMetaData> postHandlers = config.getHandlers(epMetaData,
HandlerType.POST);
+ List<HandlerMetaData> preHandlers = getHandlers(epMetaData,
HandlerType.PRE);
+ List<HandlerMetaData> postHandlers = getHandlers(epMetaData,
HandlerType.POST);
addHandlers(preHandlers);
addHandlers(sepHandlers);
@@ -124,6 +127,26 @@
log.debug("Added " + postHandlers.size() + " POST
handlers");
}
}
+
+ private List<HandlerMetaData> getHandlers(EndpointMetaData epMetaData,
HandlerType type)
+ {
+ List<UnifiedHandlerChainMetaData> handlerChains = config.getHandlers(type);
+ boolean isJAXRPCConfig = (config instanceof CommonConfigJAXRPC);
+ List<HandlerMetaData> handlers = new ArrayList<HandlerMetaData>();
+ if (handlerChains != null)
+ {
+ for (UnifiedHandlerChainMetaData handlerChain : handlerChains)
+ {
+ for (UnifiedHandlerMetaData uhmd : handlerChain.getHandlers())
+ {
+ HandlerMetaData hmd = isJAXRPCConfig ?
HandlerMetaDataJAXRPC.newInstance(uhmd, type) : HandlerMetaDataJAXWS.newInstance(uhmd,
type);
+ hmd.setEndpointMetaData(epMetaData);
+ handlers.add(hmd);
+ }
+ }
+ }
+ return handlers;
+ }
public EndpointMetaData getEndpointMetaData()
{
Modified:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/umdm/FeatureAwareClientEndpointMetaDataAdapter.java
===================================================================
---
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/umdm/FeatureAwareClientEndpointMetaDataAdapter.java 2011-05-03
10:42:20 UTC (rev 14223)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/umdm/FeatureAwareClientEndpointMetaDataAdapter.java 2011-05-03
10:48:29 UTC (rev 14224)
@@ -39,10 +39,10 @@
import org.jboss.ws.core.jaxws.wsaddressing.NativeEndpointReference;
import org.jboss.ws.core.soap.Style;
import org.jboss.ws.core.soap.Use;
-import org.jboss.ws.metadata.config.CommonConfig;
import org.jboss.ws.metadata.config.Configurable;
import org.jboss.wsf.spi.binding.BindingCustomization;
import org.jboss.wsf.spi.deployment.UnifiedVirtualFile;
+import org.jboss.wsf.spi.metadata.config.CommonConfig;
import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedPortComponentRefMetaData;
import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedHandlerMetaData.HandlerType;
Modified:
stack/native/trunk/modules/core/src/main/resources/META-INF/standard-jaxws-client-config.xml
===================================================================
---
stack/native/trunk/modules/core/src/main/resources/META-INF/standard-jaxws-client-config.xml 2011-05-03
10:42:20 UTC (rev 14223)
+++
stack/native/trunk/modules/core/src/main/resources/META-INF/standard-jaxws-client-config.xml 2011-05-03
10:48:29 UTC (rev 14224)
@@ -1,11 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
-<jaxws-config xmlns="urn:jboss:jaxws-config:2.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:javaee="http://java.sun.com/xml/ns/javaee"
- xsi:schemaLocation="urn:jboss:jaxws-config:2.0
schema/jaxws-config_2_0.xsd">
+<jaxws-config xmlns="urn:jboss:jbossws-jaxws-config:4.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:javaee="http://java.sun.com/xml/ns/javaee"
+ xsi:schemaLocation="urn:jboss:jbossws-jaxws-config:4.0
schema/jaxws-config_2_0.xsd">
<client-config>
<config-name>Standard Client</config-name>
- <feature>http://org.jboss.ws/dispatch/validate</feature>
+
<feature><feature-name>http://org.jboss.ws/dispatch/validate</feature-name></feature>
<property>
<property-name>http://org.jboss.ws/http#chunksize</property-name>
<property-value>2048</property-value>
@@ -14,7 +14,7 @@
<client-config>
<config-name>HTTP 1.0 Client</config-name>
- <feature>http://org.jboss.ws/dispatch/validate</feature>
+
<feature><feature-name>http://org.jboss.ws/dispatch/validate</feature-name></feature>
</client-config>
<client-config>
Modified:
stack/native/trunk/modules/core/src/main/resources/META-INF/standard-jaxws-endpoint-config.xml
===================================================================
---
stack/native/trunk/modules/core/src/main/resources/META-INF/standard-jaxws-endpoint-config.xml 2011-05-03
10:42:20 UTC (rev 14223)
+++
stack/native/trunk/modules/core/src/main/resources/META-INF/standard-jaxws-endpoint-config.xml 2011-05-03
10:48:29 UTC (rev 14224)
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
-<jaxws-config xmlns="urn:jboss:jaxws-config:2.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:javaee="http://java.sun.com/xml/ns/javaee"
- xsi:schemaLocation="urn:jboss:jaxws-config:2.0
schema/jaxws-config_2_0.xsd">
+<jaxws-config xmlns="urn:jboss:jbossws-jaxws-config:4.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:javaee="http://java.sun.com/xml/ns/javaee"
+ xsi:schemaLocation="urn:jboss:jbossws-jaxws-config:4.0
schema/jaxws-config_2_0.xsd">
<endpoint-config>
<config-name>Standard Endpoint</config-name>
@@ -22,7 +22,7 @@
-->
<endpoint-config>
<
config-name>.NET friendly Endpoint</config-name>
- <feature>http://org.jboss.ws/binding/wsdl/dotnet</feature>
+
<feature><feature-name>http://org.jboss.ws/binding/wsdl/dotnet</feature-name></feature>
</endpoint-config>
<endpoint-config>
Modified:
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/handlerlifecycle/META-INF/jaxws-client-config.xml
===================================================================
---
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/handlerlifecycle/META-INF/jaxws-client-config.xml 2011-05-03
10:42:20 UTC (rev 14223)
+++
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/handlerlifecycle/META-INF/jaxws-client-config.xml 2011-05-03
10:48:29 UTC (rev 14224)
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
-<jaxws-config xmlns="urn:jboss:jaxws-config:2.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:javaee="http://java.sun.com/xml/ns/javaee"
- xsi:schemaLocation="urn:jboss:jaxws-config:2.0
jaxws-config_2_0.xsd">
+<jaxws-config xmlns="urn:jboss:jbossws-jaxws-config:4.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:javaee="http://java.sun.com/xml/ns/javaee"
+ xsi:schemaLocation="urn:jboss:jbossws-jaxws-config:4.0
jaxws-config_2_0.xsd">
<client-config>
<config-name> Custom Client Config </config-name>
Modified:
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/handlerlifecycle/WEB-INF/jaxws-endpoint-config.xml
===================================================================
---
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/handlerlifecycle/WEB-INF/jaxws-endpoint-config.xml 2011-05-03
10:42:20 UTC (rev 14223)
+++
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/handlerlifecycle/WEB-INF/jaxws-endpoint-config.xml 2011-05-03
10:48:29 UTC (rev 14224)
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
-<jaxws-config xmlns="urn:jboss:jaxws-config:2.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:javaee="http://java.sun.com/xml/ns/javaee"
- xsi:schemaLocation="urn:jboss:jaxws-config:2.0
jaxws-config_2_0.xsd">
+<jaxws-config xmlns="urn:jboss:jbossws-jaxws-config:4.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:javaee="http://java.sun.com/xml/ns/javaee"
+ xsi:schemaLocation="urn:jboss:jbossws-jaxws-config:4.0
jaxws-config_2_0.xsd">
<client-config>
<config-name> Custom Server Config </config-name>
Modified:
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2187/META-INF/jbws2187-client-config.xml
===================================================================
---
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2187/META-INF/jbws2187-client-config.xml 2011-05-03
10:42:20 UTC (rev 14223)
+++
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2187/META-INF/jbws2187-client-config.xml 2011-05-03
10:48:29 UTC (rev 14224)
@@ -1,10 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<jaxws-config
- xmlns="urn:jboss:jaxws-config:2.0"
+ xmlns="urn:jboss:jbossws-jaxws-config:4.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:javaee="http://java.sun.com/xml/ns/javaee"
- xsi:schemaLocation="urn:jboss:jaxws-config:2.0 jaxws-config_2_0.xsd">
+ xsi:schemaLocation="urn:jboss:jbossws-jaxws-config:4.0
jaxws-config_2_0.xsd">
<client-config>
<config-name>JBWS2187 Config</config-name>
Modified:
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2259/WEB-INF/jaxws-endpoint-config.xml
===================================================================
---
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2259/WEB-INF/jaxws-endpoint-config.xml 2011-05-03
10:42:20 UTC (rev 14223)
+++
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2259/WEB-INF/jaxws-endpoint-config.xml 2011-05-03
10:48:29 UTC (rev 14224)
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
-<jaxws-config xmlns="urn:jboss:jaxws-config:2.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:javaee="http://java.sun.com/xml/ns/javaee"
- xsi:schemaLocation="urn:jboss:jaxws-config:2.0
jaxws-config_2_0.xsd">
+<jaxws-config xmlns="urn:jboss:jbossws-jaxws-config:4.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:javaee="http://java.sun.com/xml/ns/javaee"
+ xsi:schemaLocation="urn:jboss:jbossws-jaxws-config:4.0
jaxws-config_2_0.xsd">
<client-config>
<config-name>Custom Server Config</config-name>