You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by xu...@apache.org on 2011/05/17 14:11:48 UTC
svn commit: r1104183 - in /geronimo/server/trunk/plugins:
axis2/geronimo-axis2-builder/src/main/java/org/apache/geronimo/axis2/builder/
axis2/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/
axis2/geronimo-axis2/src/main/java/org/apache/geronimo...
Author: xuhaihong
Date: Tue May 17 12:11:47 2011
New Revision: 1104183
URL: http://svn.apache.org/viewvc?rev=1104183&view=rev
Log:
1. Support lookup attribute for webservice ref
2. Enable webservices.xml override the configurations from annotations
Added:
geronimo/server/trunk/plugins/axis2/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/feature/
geronimo/server/trunk/plugins/axis2/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/feature/AddressingFeatureConfigurator.java
geronimo/server/trunk/plugins/axis2/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/feature/MTOMFeatureConfigurator.java
geronimo/server/trunk/plugins/axis2/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/feature/RespectBindingFeatureConfigurator.java
- copied, changed from r1102685, geronimo/server/trunk/plugins/jaxws/geronimo-jaxws/src/main/java/org/apache/geronimo/jaxws/feature/RespectBindingFeatureInfo.java
geronimo/server/trunk/plugins/axis2/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/feature/ServerFeaturesConfigurator.java
geronimo/server/trunk/plugins/axis2/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/feature/WebServiceFeatureConfigurator.java
- copied, changed from r1102685, geronimo/server/trunk/plugins/jaxws/geronimo-jaxws/src/main/java/org/apache/geronimo/jaxws/feature/RespectBindingFeatureInfo.java
Modified:
geronimo/server/trunk/plugins/axis2/geronimo-axis2-builder/src/main/java/org/apache/geronimo/axis2/builder/Axis2Builder.java
geronimo/server/trunk/plugins/axis2/geronimo-axis2-builder/src/main/java/org/apache/geronimo/axis2/builder/Axis2ServiceRefBuilder.java
geronimo/server/trunk/plugins/axis2/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/Axis2WebServiceContainer.java
geronimo/server/trunk/plugins/axis2/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/AxisServiceGenerator.java
geronimo/server/trunk/plugins/cxf/geronimo-cxf-builder/src/main/java/org/apache/geronimo/cxf/builder/CXFBuilder.java
geronimo/server/trunk/plugins/cxf/geronimo-cxf-builder/src/main/java/org/apache/geronimo/cxf/builder/CXFServiceRefBuilder.java
geronimo/server/trunk/plugins/cxf/geronimo-cxf/src/main/java/org/apache/geronimo/cxf/CXFEndpoint.java
geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/annotation/WebServiceRefAnnotationHelper.java
geronimo/server/trunk/plugins/jaxws/geronimo-jaxws-builder/src/main/java/org/apache/geronimo/jaxws/builder/EndpointInfoBuilder.java
geronimo/server/trunk/plugins/jaxws/geronimo-jaxws-builder/src/main/java/org/apache/geronimo/jaxws/builder/JAXWSServiceBuilder.java
geronimo/server/trunk/plugins/jaxws/geronimo-jaxws/src/main/java/org/apache/geronimo/jaxws/PortInfo.java
geronimo/server/trunk/plugins/jaxws/geronimo-jaxws/src/main/java/org/apache/geronimo/jaxws/feature/AddressingFeatureInfo.java
geronimo/server/trunk/plugins/jaxws/geronimo-jaxws/src/main/java/org/apache/geronimo/jaxws/feature/MTOMFeatureInfo.java
geronimo/server/trunk/plugins/jaxws/geronimo-jaxws/src/main/java/org/apache/geronimo/jaxws/feature/RespectBindingFeatureInfo.java
Modified: geronimo/server/trunk/plugins/axis2/geronimo-axis2-builder/src/main/java/org/apache/geronimo/axis2/builder/Axis2Builder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/axis2/geronimo-axis2-builder/src/main/java/org/apache/geronimo/axis2/builder/Axis2Builder.java?rev=1104183&r1=1104182&r2=1104183&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/axis2/geronimo-axis2-builder/src/main/java/org/apache/geronimo/axis2/builder/Axis2Builder.java (original)
+++ geronimo/server/trunk/plugins/axis2/geronimo-axis2-builder/src/main/java/org/apache/geronimo/axis2/builder/Axis2Builder.java Tue May 17 12:11:47 2011
@@ -17,20 +17,11 @@
package org.apache.geronimo.axis2.builder;
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URL;
import java.util.Collection;
import java.util.Collections;
-import java.util.HashMap;
-import java.util.Map;
-
-import javax.xml.bind.JAXBException;
-
import org.apache.geronimo.axis2.osgi.Axis2ModuleRegistry;
import org.apache.geronimo.axis2.pojo.POJOWebServiceContainerFactoryGBean;
import org.apache.geronimo.common.DeploymentException;
-import org.apache.geronimo.deployment.Deployable;
import org.apache.geronimo.gbean.AbstractNameQuery;
import org.apache.geronimo.gbean.GBeanData;
import org.apache.geronimo.gbean.GBeanInfo;
@@ -48,15 +39,8 @@ import org.apache.geronimo.jaxws.builder
import org.apache.geronimo.jaxws.builder.WARWebServiceFinder;
import org.apache.geronimo.jaxws.builder.wsdl.WsdlGenerator;
import org.apache.geronimo.jaxws.builder.wsdl.WsdlGeneratorOptions;
-import org.apache.geronimo.kernel.config.ConfigurationModuleType;
import org.apache.geronimo.kernel.repository.Artifact;
import org.apache.geronimo.kernel.repository.Environment;
-import org.apache.openejb.jee.HandlerChains;
-import org.apache.openejb.jee.JaxbJavaee;
-import org.apache.openejb.jee.PortComponent;
-import org.apache.openejb.jee.ServiceImplBean;
-import org.apache.openejb.jee.WebserviceDescription;
-import org.apache.openejb.jee.Webservices;
import org.osgi.framework.Bundle;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -76,8 +60,8 @@ public class Axis2Builder extends JAXWSS
private GBeanInfo defaultContainerFactoryGBeanInfo;
- public Axis2Builder(@ParamAttribute(name = "defaultEnvironment")Environment defaultEnviroment,
- @ParamReference(name="WsdlGenerator", namingType = GBeanInfoBuilder.DEFAULT_J2EE_TYPE)Collection<WsdlGenerator> wsdlGenerators) {
+ public Axis2Builder(@ParamAttribute(name = "defaultEnvironment") Environment defaultEnviroment,
+ @ParamReference(name = "WsdlGenerator", namingType = GBeanInfoBuilder.DEFAULT_J2EE_TYPE) Collection<WsdlGenerator> wsdlGenerators) {
super(defaultEnviroment);
this.wsdlGenerators = wsdlGenerators;
this.webServiceFinder = new WARWebServiceFinder();
@@ -85,7 +69,7 @@ public class Axis2Builder extends JAXWSS
defaultContainerFactoryGBeanInfo = annotationGBeanInfoBuilder.buildGBeanInfo();
}
- public Axis2Builder(){
+ public Axis2Builder() {
super(null);
}
@@ -93,112 +77,6 @@ public class Axis2Builder extends JAXWSS
return defaultContainerFactoryGBeanInfo;
}
- @Override
- protected Map<String, PortInfo> parseWebServiceDescriptor(InputStream in,
- URL wsDDUrl,
- Deployable deployable,
- boolean isEJB,
- Map<String, String> correctedPortLocations)
- throws DeploymentException {
-
- if (log.isDebugEnabled()) {
- log.debug("Parsing descriptor " + wsDDUrl);
- }
- Map<String, PortInfo> map = null;
-
- try {
- //the checking is needed as we also send JAX-RPC based webservices.xml here
-// if ("http://java.sun.com/xml/ns/javaee".equals(cursor.getName().getNamespaceURI())) {
- Webservices wst = (Webservices) JaxbJavaee.unmarshalJavaee(Webservices.class, in);
-
- for (WebserviceDescription desc : wst.getWebserviceDescription()) {
- String wsdlFile = null;
- if (desc.getWsdlFile() != null) {
- wsdlFile = getString(desc.getWsdlFile());
- }
-
- String serviceName = desc.getWebserviceDescriptionName();
-
- for (PortComponent port : desc.getPortComponent()) {
-
- PortInfo portInfo = new PortInfo();
- String serviceLink = null;
- ServiceImplBean beanType = port.getServiceImplBean();
- if (beanType.getEjbLink() != null) {
- serviceLink = beanType.getEjbLink();
- } else if (beanType.getServletLink() != null) {
- serviceLink = beanType.getServletLink();
- }
- portInfo.setServiceLink(serviceLink);
-
- if (port.getServiceEndpointInterface() != null) {
- String sei = port.getServiceEndpointInterface();
- portInfo.setServiceEndpointInterfaceName(sei);
- }
-
- String portName = port.getPortComponentName();
- portInfo.setPortName(portName);
-
- portInfo.setProtocolBinding(port.getProtocolBinding());
- portInfo.setServiceName(serviceName);
- portInfo.setWsdlFile(wsdlFile);
-
- portInfo.setEnableMTOM(port.isEnableMtom());
-
- if (port.getHandlerChains() != null) {
- String handlerChains = JaxbJavaee.marshal(HandlerChains.class, port.getHandlerChains());
- portInfo.setHandlersAsXML(handlerChains);
- }
-
- if (port.getWsdlPort() != null) {
- portInfo.setWsdlPort(port.getWsdlPort());
- }
-
- if (port.getWsdlService() != null) {
- portInfo.setWsdlService(port.getWsdlService());
- }
-
- String location = correctedPortLocations.get(serviceLink);
- portInfo.setLocation(location);
-
- if (map == null) {
- map = new HashMap<String, PortInfo>();
- }
-
- map.put(serviceLink, portInfo);
- }
- }
-// } else {
-// log.debug("Descriptor ignored (not a Java EE 5 descriptor)");
-// }
-
- return map;
-
- } catch (JAXBException e) {
- //we hope it's jax-rpc
- log.debug("Descriptor ignored (not a Java EE 5 descriptor)");
- return Collections.emptyMap();
- } catch (Exception ex) {
- throw new DeploymentException("Unknown deployment error", ex);
- } finally {
- try {
- in.close();
- } catch (IOException e) {
- // ignore
- }
- }
- }
-
- private static String getString(String in) {
- if (in != null) {
- in = in.trim();
- if (in.length() == 0) {
- return null;
- }
- }
- return in;
- }
-
protected WsdlGenerator getWsdlGenerator() throws DeploymentException {
if (this.wsdlGenerators == null || this.wsdlGenerators.isEmpty()) {
throw new DeploymentException("Wsdl generator not found");
@@ -213,23 +91,23 @@ public class Axis2Builder extends JAXWSS
new AbstractNameQuery(Artifact.create("org.apache.geronimo.configs/axis2//car"), Collections.emptyMap(), Axis2ModuleRegistry.class.getName()));
String serviceName = (portInfo.getServiceName() == null ? serviceClass.getName() : portInfo.getServiceName());
String wsdlFile = portInfo.getWsdlFile();
- if(wsdlFile != null && wsdlFile.trim().length() > 0) {
+ if (wsdlFile != null && wsdlFile.trim().length() > 0) {
//TODO Workaround codes for web modules in the EAR package, need to add web module name prefix
portInfo.setWsdlFile(JAXWSBuilderUtils.normalizeWsdlPath(module, wsdlFile));
-
+
if (log.isDebugEnabled()) {
log.debug("Service " + serviceName + " has WSDL. " + portInfo.getWsdlFile());
}
return;
- }
-
- if(JAXWSUtils.containsWsdlLocation(serviceClass, bundle)){
+ }
+
+ if (JAXWSUtils.containsWsdlLocation(serviceClass, bundle)) {
wsdlFile = JAXWSUtils.getServiceWsdlLocation(serviceClass, bundle);
//TODO Workaround codes for web modules in the EAR package, need to add web module name prefix
portInfo.setWsdlFile(JAXWSBuilderUtils.normalizeWsdlPath(module, wsdlFile));
-
- if(log.isDebugEnabled()) {
- log.debug("Service " + serviceName + " has WSDL configured in annotation " + wsdlFile + " and is resolved as " + portInfo.getWsdlFile());
+
+ if (log.isDebugEnabled()) {
+ log.debug("Service " + serviceName + " has WSDL configured in annotation " + wsdlFile + " and is resolved as " + portInfo.getWsdlFile());
}
return;
}
@@ -280,5 +158,4 @@ public class Axis2Builder extends JAXWSS
}
}
-
}
Modified: geronimo/server/trunk/plugins/axis2/geronimo-axis2-builder/src/main/java/org/apache/geronimo/axis2/builder/Axis2ServiceRefBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/axis2/geronimo-axis2-builder/src/main/java/org/apache/geronimo/axis2/builder/Axis2ServiceRefBuilder.java?rev=1104183&r1=1104182&r2=1104183&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/axis2/geronimo-axis2-builder/src/main/java/org/apache/geronimo/axis2/builder/Axis2ServiceRefBuilder.java (original)
+++ geronimo/server/trunk/plugins/axis2/geronimo-axis2-builder/src/main/java/org/apache/geronimo/axis2/builder/Axis2ServiceRefBuilder.java Tue May 17 12:11:47 2011
@@ -43,9 +43,9 @@ import org.apache.geronimo.jaxws.builder
import org.apache.geronimo.jaxws.client.EndpointInfo;
import org.apache.geronimo.kernel.GBeanAlreadyExistsException;
import org.apache.geronimo.kernel.GBeanNotFoundException;
-import org.apache.geronimo.kernel.config.ConfigurationModuleType;
import org.apache.geronimo.kernel.repository.Artifact;
import org.apache.geronimo.kernel.repository.Environment;
+import org.apache.geronimo.naming.reference.JndiReference;
import org.apache.geronimo.xbeans.geronimo.naming.GerServiceRefType;
import org.apache.openejb.jee.PortComponentRef;
import org.apache.openejb.jee.ServiceRef;
@@ -66,6 +66,11 @@ public class Axis2ServiceRefBuilder exte
protected Object createService(ServiceRef serviceRef, GerServiceRefType gerServiceRef, Module module, Bundle bundle, Class serviceInterfaceClass, QName serviceQName, URI wsdlURI,
Class serviceReferenceType, Map<Class<?>, PortComponentRef> portComponentRefMap) throws DeploymentException {
registerConfigGBean(module);
+
+ if(serviceRef.getLookupName() != null && !serviceRef.getLookupName().isEmpty()) {
+ return new JndiReference(serviceRef.getLookupName());
+ }
+
EndpointInfoBuilder builder = new EndpointInfoBuilder(serviceInterfaceClass, gerServiceRef, portComponentRefMap, module, bundle, wsdlURI, serviceQName);
builder.build();
Modified: geronimo/server/trunk/plugins/axis2/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/Axis2WebServiceContainer.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/axis2/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/Axis2WebServiceContainer.java?rev=1104183&r1=1104182&r2=1104183&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/axis2/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/Axis2WebServiceContainer.java (original)
+++ geronimo/server/trunk/plugins/axis2/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/Axis2WebServiceContainer.java Tue May 17 12:11:47 2011
@@ -38,7 +38,6 @@ import org.apache.axiom.soap.SOAPFault;
import org.apache.axiom.util.UIDGenerator;
import org.apache.axis2.AxisFault;
import org.apache.axis2.Constants;
-import org.apache.axis2.addressing.AddressingConstants.Final;
import org.apache.axis2.addressing.AddressingHelper;
import org.apache.axis2.addressing.EndpointReference;
import org.apache.axis2.context.ConfigurationContext;
@@ -92,15 +91,15 @@ import org.slf4j.LoggerFactory;
* @version $Rev$ $Date$
*/
public abstract class Axis2WebServiceContainer implements WebServiceContainer {
-
+
private static final Logger LOG = LoggerFactory.getLogger(Axis2WebServiceContainer.class);
public static final String REQUEST = Axis2WebServiceContainer.class.getName() + "@Request";
- public static final String RESPONSE = Axis2WebServiceContainer.class.getName() + "@Response";
-
+ public static final String RESPONSE = Axis2WebServiceContainer.class.getName() + "@Response";
+
private static final boolean SOAP_1_1_FAULT_DETAIL_COMPATIBLE_WHEN_ADDRESSING_FAULTS = Boolean.getBoolean("org.apache.geronimo.axis2.soap_1_1FaultDetailCompatibleWhenAddressingFaults");
-
+
private transient final Bundle bundle;
protected String endpointClassName;
@@ -144,8 +143,8 @@ public abstract class Axis2WebServiceCon
Axis2ConfigGBean.registerClientConfigurationFactory(axis2ModuleRegistry);
GeronimoConfigurator configurator = new GeronimoConfigurator("META-INF/geronimo-axis2.xml");
- configurationContext = ConfigurationContextFactory.createConfigurationContext(configurator);
-
+ configurationContext = ConfigurationContextFactory.createConfigurationContext(configurator);
+
axis2ModuleRegistry.configureModules(configurationContext);
// check to see if the wsdlLocation property is set in portInfo,
// if not checking if wsdlLocation exists in annotation
@@ -164,7 +163,7 @@ public abstract class Axis2WebServiceCon
service = serviceGen.getServiceFromWSDL(portInfo, endpointClass, bundle);
} else {
// No WSDL, let Axis2 handle it.
- service = serviceGen.getServiceFromClass(this.endpointClass);
+ service = serviceGen.getServiceFromClass(this.endpointClass, portInfo);
}
service.setScope(Constants.SCOPE_APPLICATION);
@@ -332,7 +331,7 @@ public abstract class Axis2WebServiceCon
throw new UnsupportedOperationException("[" + request.getMethod() + " ] method not supported");
}
- // Finalize response
+ // Finalize response
if (TransportUtils.isResponseWritten(msgContext)) {
OperationContext operationContext = msgContext.getOperationContext();
Object isTwoChannel = null;
Modified: geronimo/server/trunk/plugins/axis2/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/AxisServiceGenerator.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/axis2/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/AxisServiceGenerator.java?rev=1104183&r1=1104182&r2=1104183&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/axis2/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/AxisServiceGenerator.java (original)
+++ geronimo/server/trunk/plugins/axis2/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/AxisServiceGenerator.java Tue May 17 12:11:47 2011
@@ -54,6 +54,7 @@ import org.apache.axis2.jaxws.descriptio
import org.apache.axis2.jaxws.server.JAXWSMessageReceiver;
import org.apache.axis2.jaxws.util.WSDL4JWrapper;
import org.apache.axis2.wsdl.WSDLUtil;
+import org.apache.geronimo.axis2.feature.ServerFeaturesConfigurator;
import org.apache.geronimo.jaxws.JAXWSUtils;
import org.apache.geronimo.jaxws.PortInfo;
import org.apache.ws.commons.schema.utils.NamespaceMap;
@@ -69,6 +70,8 @@ public class AxisServiceGenerator
{
private static final Logger log = LoggerFactory.getLogger(AxisServiceGenerator.class);
+ private static final ServerFeaturesConfigurator SERVER_FEATURES_CONFIGURATOR = new ServerFeaturesConfigurator();
+
private MessageReceiver messageReceiver;
private ConfigurationContext configurationContext;
private String catalogName;
@@ -89,18 +92,26 @@ public class AxisServiceGenerator
this.catalogName = catalogName;
}
- public AxisService getServiceFromClass(Class endpointClass) throws Exception {
- ServiceDescription serviceDescription =
- DescriptionFactory.createServiceDescription(endpointClass);
- EndpointDescription[] edArray = serviceDescription.getEndpointDescriptions();
- AxisService service = edArray[0].getAxisService();
+ public AxisService getServiceFromClass(Class endpointClass, PortInfo portInfo) throws Exception {
+ ServiceDescription serviceDescription = DescriptionFactory.createServiceDescription(endpointClass);
+ EndpointDescription targetEndpointDescription = null;
+ for (EndpointDescription endpointDescription : serviceDescription.getEndpointDescriptions()) {
+ DescriptionBuilderComposite dbc = endpointDescription.getDescriptionBuilderComposite();
+ if (endpointClass.getName().equals(dbc.getClassName())) {
+ targetEndpointDescription = endpointDescription;
+ break;
+ }
+ }
+ if (targetEndpointDescription == null) {
+ throw new RuntimeException("No endpoint found for SEI class " + endpointClass.getName());
+ }
+ configureWebServiceFeatures(targetEndpointDescription, portInfo);
+ AxisService service = targetEndpointDescription.getAxisService();
if (service.getNamespaceMap() == null) {
NamespaceMap map = new NamespaceMap();
- map.put(Java2WSDLConstants.AXIS2_NAMESPACE_PREFIX,
- Java2WSDLConstants.AXIS2_XSD);
- map.put(Java2WSDLConstants.DEFAULT_SCHEMA_NAMESPACE_PREFIX,
- Java2WSDLConstants.URI_2001_SCHEMA_XSD);
+ map.put(Java2WSDLConstants.AXIS2_NAMESPACE_PREFIX, Java2WSDLConstants.AXIS2_XSD);
+ map.put(Java2WSDLConstants.DEFAULT_SCHEMA_NAMESPACE_PREFIX, Java2WSDLConstants.URI_2001_SCHEMA_XSD);
service.setNamespaceMap(map);
}
@@ -115,8 +126,7 @@ public class AxisServiceGenerator
operation.setMessageReceiver(this.messageReceiver);
}
- Parameter serviceDescriptionParam =
- new Parameter(EndpointDescription.AXIS_SERVICE_PARAMETER, edArray[0]);
+ Parameter serviceDescriptionParam = new Parameter(EndpointDescription.AXIS_SERVICE_PARAMETER, targetEndpointDescription);
service.addParameter(serviceDescriptionParam);
return service;
@@ -167,7 +177,7 @@ public class AxisServiceGenerator
protocolBinding = getBindingFromWSDL(port);
}
- Class endPointClass = classLoader.loadClass(endpointClassName);
+ Class<?> endPointClass = classLoader.loadClass(endpointClassName);
JavaClassToDBCConverter converter = new JavaClassToDBCConverter(endPointClass);
HashMap<String, DescriptionBuilderComposite> dbcMap = converter.produceDBC();
@@ -192,11 +202,11 @@ public class AxisServiceGenerator
processServiceBinding(dbc, protocolBinding);
}
- if (portInfo.isMTOMEnabled() != null) {
- dbc.setIsMTOMEnabled(portInfo.isMTOMEnabled().booleanValue());
- }
-
- AxisService service = getService(dbcMap, endpointClassName);
+ EndpointDescription endpointDescription = getEndpointDescription(dbcMap, endpointClassName);
+ //The portInfo is a mixed content of the annotations and webservices.xml file, currently, we have no way to pass the final portInfo
+ //to Axis2, so reconfigure those web service features in the endpoint description here.
+ configureWebServiceFeatures(endpointDescription, portInfo);
+ AxisService service = endpointDescription.getAxisService();
service.setName(serviceQName.getLocalPart());
service.setEndpointName(portQName.getLocalPart());
@@ -266,15 +276,11 @@ public class AxisServiceGenerator
}
}
- private AxisService getService(HashMap<String, DescriptionBuilderComposite> dbcMap, String endpointClassName) {
- return getEndpointDescription(dbcMap, endpointClassName).getAxisService();
- }
-
private EndpointDescription getEndpointDescription(HashMap<String, DescriptionBuilderComposite> dbcMap, String endpointClassName) {
List<ServiceDescription> serviceDescList = DescriptionFactory.createServiceDescriptionFromDBCMap(dbcMap, this.configurationContext);
if (serviceDescList == null || serviceDescList.isEmpty()) {
throw new RuntimeException("No service found for SEI class " + endpointClassName);
- }
+ }
for(ServiceDescription serviceDescription : serviceDescList) {
for(EndpointDescription endpointDescription : serviceDescription.getEndpointDescriptions()) {
DescriptionBuilderComposite dbc = endpointDescription.getDescriptionBuilderComposite();
@@ -282,8 +288,20 @@ public class AxisServiceGenerator
return endpointDescription;
}
}
- }
- throw new RuntimeException("No endpoint found for SEI class " + endpointClassName);
+ }
+ throw new RuntimeException("No endpoint found for SEI class " + endpointClassName);
+ }
+
+ private void configureWebServiceFeatures(EndpointDescription endpointDescription, PortInfo portInfo) {
+ if (portInfo.getAddressingFeatureInfo() != null) {
+ SERVER_FEATURES_CONFIGURATOR.configure(endpointDescription, portInfo.getAddressingFeatureInfo());
+ }
+ if (portInfo.getMtomFeatureInfo() != null) {
+ SERVER_FEATURES_CONFIGURATOR.configure(endpointDescription, portInfo.getMtomFeatureInfo());
+ }
+ if (portInfo.getRespectBindingFeatureInfo() != null) {
+ SERVER_FEATURES_CONFIGURATOR.configure(endpointDescription, portInfo.getRespectBindingFeatureInfo());
+ }
}
private static class WSDLGeneratorImpl implements WsdlGenerator {
Added: geronimo/server/trunk/plugins/axis2/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/feature/AddressingFeatureConfigurator.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/axis2/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/feature/AddressingFeatureConfigurator.java?rev=1104183&view=auto
==============================================================================
--- geronimo/server/trunk/plugins/axis2/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/feature/AddressingFeatureConfigurator.java (added)
+++ geronimo/server/trunk/plugins/axis2/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/feature/AddressingFeatureConfigurator.java Tue May 17 12:11:47 2011
@@ -0,0 +1,92 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.geronimo.axis2.feature;
+
+import javax.xml.ws.soap.AddressingFeature.Responses;
+
+import org.apache.axis2.Constants;
+import org.apache.axis2.addressing.AddressingConstants;
+import org.apache.axis2.description.AxisService;
+import org.apache.axis2.description.Parameter;
+import org.apache.axis2.engine.AxisConfiguration;
+import org.apache.axis2.jaxws.ExceptionFactory;
+import org.apache.axis2.jaxws.description.EndpointDescription;
+import org.apache.axis2.jaxws.description.ServiceDescription;
+import org.apache.axis2.jaxws.i18n.Messages;
+import org.apache.axis2.jaxws.server.config.AddressingConfigurator;
+import org.apache.axis2.util.JavaUtils;
+import org.apache.axis2.util.Utils;
+import org.apache.geronimo.jaxws.feature.AddressingFeatureInfo;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class AddressingFeatureConfigurator implements WebServiceFeatureConfigurator<AddressingFeatureInfo> {
+
+ private static Logger logger = LoggerFactory.getLogger(AddressingConfigurator.class);
+
+ @Override
+ public void configure(EndpointDescription endpointDescription, AddressingFeatureInfo webServiceFeatureInfo) {
+
+ if (webServiceFeatureInfo == null) {
+ return;
+ }
+
+ Parameter disabled = new Parameter(AddressingConstants.DISABLE_ADDRESSING_FOR_IN_MESSAGES, String.valueOf(!webServiceFeatureInfo.isEnabled()));
+ Parameter required = new Parameter(AddressingConstants.ADDRESSING_REQUIREMENT_PARAMETER, webServiceFeatureInfo.isRequired() ? AddressingConstants.ADDRESSING_REQUIRED
+ : AddressingConstants.ADDRESSING_UNSPECIFIED);
+ Parameter responses = new Parameter(AddressingConstants.WSAM_INVOCATION_PATTERN_PARAMETER_NAME, mapResponseAttributeToAddressing(webServiceFeatureInfo.getResponses()));
+
+ try {
+ AxisService service = endpointDescription.getAxisService();
+
+ service.addParameter(disabled);
+ service.addParameter(required);
+ service.addParameter(responses);
+
+ String value = Utils.getParameterValue(disabled);
+ if (JavaUtils.isFalseExplicitly(value)) {
+ ServiceDescription sd = endpointDescription.getServiceDescription();
+ AxisConfiguration axisConfig = sd.getAxisConfigContext().getAxisConfiguration();
+ if (!axisConfig.isEngaged(Constants.MODULE_ADDRESSING))
+ axisConfig.engageModule(Constants.MODULE_ADDRESSING);
+ }
+ } catch (Exception e) {
+ logger.error("Fail to configure addressing info ", e);
+ throw ExceptionFactory.makeWebServiceException(Messages.getMessage("AddressingEngagementError", e.toString()));
+ }
+ }
+
+ private String mapResponseAttributeToAddressing(Responses responses) {
+ String addressingType = null;
+ switch (responses) {
+ case ALL:
+ addressingType = AddressingConstants.WSAM_INVOCATION_PATTERN_BOTH;
+ break;
+ case ANONYMOUS:
+ addressingType = AddressingConstants.WSAM_INVOCATION_PATTERN_SYNCHRONOUS;
+ break;
+ case NON_ANONYMOUS:
+ addressingType = AddressingConstants.WSAM_INVOCATION_PATTERN_ASYNCHRONOUS;
+ break;
+ }
+ return addressingType;
+ }
+}
Added: geronimo/server/trunk/plugins/axis2/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/feature/MTOMFeatureConfigurator.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/axis2/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/feature/MTOMFeatureConfigurator.java?rev=1104183&view=auto
==============================================================================
--- geronimo/server/trunk/plugins/axis2/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/feature/MTOMFeatureConfigurator.java (added)
+++ geronimo/server/trunk/plugins/axis2/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/feature/MTOMFeatureConfigurator.java Tue May 17 12:11:47 2011
@@ -0,0 +1,48 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.geronimo.axis2.feature;
+
+import org.apache.axis2.Constants;
+import org.apache.axis2.description.AxisService;
+import org.apache.axis2.description.Parameter;
+import org.apache.axis2.jaxws.ExceptionFactory;
+import org.apache.axis2.jaxws.description.EndpointDescription;
+import org.apache.axis2.jaxws.i18n.Messages;
+import org.apache.geronimo.jaxws.feature.MTOMFeatureInfo;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class MTOMFeatureConfigurator implements WebServiceFeatureConfigurator<MTOMFeatureInfo> {
+
+ @Override
+ public void configure(EndpointDescription endpointDescription, MTOMFeatureInfo webServiceFeatureInfo) {
+ AxisService service = endpointDescription.getAxisService();
+
+ Parameter enableMTOM = new Parameter(Constants.Configuration.ENABLE_MTOM, webServiceFeatureInfo.isEnabled());
+ Parameter threshold = new Parameter(Constants.Configuration.MTOM_THRESHOLD, webServiceFeatureInfo.getThreshold());
+
+ try {
+ service.addParameter(enableMTOM);
+ service.addParameter(threshold);
+ } catch (Exception e) {
+ throw ExceptionFactory.makeWebServiceException(Messages.getMessage("mtomEnableErr"), e);
+ }
+ }
+
+}
Copied: geronimo/server/trunk/plugins/axis2/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/feature/RespectBindingFeatureConfigurator.java (from r1102685, geronimo/server/trunk/plugins/jaxws/geronimo-jaxws/src/main/java/org/apache/geronimo/jaxws/feature/RespectBindingFeatureInfo.java)
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/axis2/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/feature/RespectBindingFeatureConfigurator.java?p2=geronimo/server/trunk/plugins/axis2/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/feature/RespectBindingFeatureConfigurator.java&p1=geronimo/server/trunk/plugins/jaxws/geronimo-jaxws/src/main/java/org/apache/geronimo/jaxws/feature/RespectBindingFeatureInfo.java&r1=1102685&r2=1104183&rev=1104183&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/jaxws/geronimo-jaxws/src/main/java/org/apache/geronimo/jaxws/feature/RespectBindingFeatureInfo.java (original)
+++ geronimo/server/trunk/plugins/axis2/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/feature/RespectBindingFeatureConfigurator.java Tue May 17 12:11:47 2011
@@ -15,30 +15,19 @@
* limitations under the License.
*/
-package org.apache.geronimo.jaxws.feature;
+package org.apache.geronimo.axis2.feature;
-import javax.xml.ws.RespectBinding;
-import javax.xml.ws.RespectBindingFeature;
-import javax.xml.ws.WebServiceFeature;
+import org.apache.axis2.jaxws.description.EndpointDescription;
+import org.apache.geronimo.jaxws.feature.RespectBindingFeatureInfo;
/**
* @version $Rev$ $Date$
*/
-public class RespectBindingFeatureInfo implements WebServiceFeatureInfo {
-
- private boolean enabled;
-
- public RespectBindingFeatureInfo(RespectBinding respectBinding) {
- this(respectBinding.enabled());
- }
-
- public RespectBindingFeatureInfo(boolean enabled) {
- this.enabled = enabled;
- }
+public class RespectBindingFeatureConfigurator implements WebServiceFeatureConfigurator<RespectBindingFeatureInfo> {
@Override
- public WebServiceFeature getWebServiceFeature() {
- return new RespectBindingFeature(enabled);
+ public void configure(EndpointDescription endpointDescription, RespectBindingFeatureInfo webServiceFeatureInfo) {
+ endpointDescription.setRespectBinding(webServiceFeatureInfo.isEnabled());
}
}
Added: geronimo/server/trunk/plugins/axis2/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/feature/ServerFeaturesConfigurator.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/axis2/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/feature/ServerFeaturesConfigurator.java?rev=1104183&view=auto
==============================================================================
--- geronimo/server/trunk/plugins/axis2/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/feature/ServerFeaturesConfigurator.java (added)
+++ geronimo/server/trunk/plugins/axis2/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/feature/ServerFeaturesConfigurator.java Tue May 17 12:11:47 2011
@@ -0,0 +1,63 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.geronimo.axis2.feature;
+
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+
+import org.apache.axis2.jaxws.description.EndpointDescription;
+import org.apache.geronimo.jaxws.feature.AddressingFeatureInfo;
+import org.apache.geronimo.jaxws.feature.MTOMFeatureInfo;
+import org.apache.geronimo.jaxws.feature.RespectBindingFeatureInfo;
+import org.apache.geronimo.jaxws.feature.WebServiceFeatureInfo;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class ServerFeaturesConfigurator implements WebServiceFeatureConfigurator<WebServiceFeatureInfo> {
+
+ private static final Logger logger = LoggerFactory.getLogger(ServerFeaturesConfigurator.class);
+
+ private Map<String, WebServiceFeatureConfigurator> classNameConfiguratorMap = new ConcurrentHashMap<String, WebServiceFeatureConfigurator>();
+
+ public ServerFeaturesConfigurator() {
+ classNameConfiguratorMap.put(AddressingFeatureInfo.class.getName(), new AddressingFeatureConfigurator());
+ classNameConfiguratorMap.put(MTOMFeatureInfo.class.getName(), new MTOMFeatureConfigurator());
+ classNameConfiguratorMap.put(RespectBindingFeatureInfo.class.getName(), new RespectBindingFeatureConfigurator());
+ }
+
+ @Override
+ public void configure(EndpointDescription endpointDescription, WebServiceFeatureInfo webServiceFeatureInfo) {
+ WebServiceFeatureConfigurator configurator = classNameConfiguratorMap.get(webServiceFeatureInfo.getClass().getName());
+ if (configurator == null) {
+ logger.warn("No web service configurator supports the target webServiceFeatureInfo" + webServiceFeatureInfo);
+ return;
+ }
+ configurator.configure(endpointDescription, webServiceFeatureInfo);
+ }
+
+ public void registerWebServiceFeatureConfigurator(String className, WebServiceFeatureConfigurator configurator) {
+ classNameConfiguratorMap.put(className, configurator);
+ }
+
+ public WebServiceFeatureConfigurator unregisterWebServiceFeatureConfigurator(String className) {
+ return classNameConfiguratorMap.remove(className);
+ }
+}
Copied: geronimo/server/trunk/plugins/axis2/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/feature/WebServiceFeatureConfigurator.java (from r1102685, geronimo/server/trunk/plugins/jaxws/geronimo-jaxws/src/main/java/org/apache/geronimo/jaxws/feature/RespectBindingFeatureInfo.java)
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/axis2/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/feature/WebServiceFeatureConfigurator.java?p2=geronimo/server/trunk/plugins/axis2/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/feature/WebServiceFeatureConfigurator.java&p1=geronimo/server/trunk/plugins/jaxws/geronimo-jaxws/src/main/java/org/apache/geronimo/jaxws/feature/RespectBindingFeatureInfo.java&r1=1102685&r2=1104183&rev=1104183&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/jaxws/geronimo-jaxws/src/main/java/org/apache/geronimo/jaxws/feature/RespectBindingFeatureInfo.java (original)
+++ geronimo/server/trunk/plugins/axis2/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/feature/WebServiceFeatureConfigurator.java Tue May 17 12:11:47 2011
@@ -15,30 +15,16 @@
* limitations under the License.
*/
-package org.apache.geronimo.jaxws.feature;
+package org.apache.geronimo.axis2.feature;
-import javax.xml.ws.RespectBinding;
-import javax.xml.ws.RespectBindingFeature;
-import javax.xml.ws.WebServiceFeature;
+import org.apache.axis2.jaxws.description.EndpointDescription;
+import org.apache.geronimo.jaxws.feature.WebServiceFeatureInfo;
/**
* @version $Rev$ $Date$
*/
-public class RespectBindingFeatureInfo implements WebServiceFeatureInfo {
+public interface WebServiceFeatureConfigurator<T extends WebServiceFeatureInfo> {
- private boolean enabled;
-
- public RespectBindingFeatureInfo(RespectBinding respectBinding) {
- this(respectBinding.enabled());
- }
-
- public RespectBindingFeatureInfo(boolean enabled) {
- this.enabled = enabled;
- }
-
- @Override
- public WebServiceFeature getWebServiceFeature() {
- return new RespectBindingFeature(enabled);
- }
+ public void configure(EndpointDescription endpointDescription, T webServiceFeatureInfo);
}
Modified: geronimo/server/trunk/plugins/cxf/geronimo-cxf-builder/src/main/java/org/apache/geronimo/cxf/builder/CXFBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/cxf/geronimo-cxf-builder/src/main/java/org/apache/geronimo/cxf/builder/CXFBuilder.java?rev=1104183&r1=1104182&r2=1104183&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/cxf/geronimo-cxf-builder/src/main/java/org/apache/geronimo/cxf/builder/CXFBuilder.java (original)
+++ geronimo/server/trunk/plugins/cxf/geronimo-cxf-builder/src/main/java/org/apache/geronimo/cxf/builder/CXFBuilder.java Tue May 17 12:11:47 2011
@@ -53,7 +53,7 @@ import org.apache.geronimo.jaxws.builder
import org.apache.geronimo.jaxws.builder.WARWebServiceFinder;
import org.apache.geronimo.jaxws.builder.wsdl.WsdlGenerator;
import org.apache.geronimo.jaxws.builder.wsdl.WsdlGeneratorOptions;
-import org.apache.geronimo.kernel.config.ConfigurationModuleType;
+import org.apache.geronimo.jaxws.feature.MTOMFeatureInfo;
import org.apache.geronimo.kernel.repository.Environment;
import org.osgi.framework.Bundle;
import org.slf4j.Logger;
@@ -88,118 +88,6 @@ public class CXFBuilder extends JAXWSSer
return POJOWebServiceContainerFactoryGBean.GBEAN_INFO;
}
- protected Map<String, PortInfo> parseWebServiceDescriptor(InputStream in,
- URL wsDDUrl,
- Deployable deployable,
- boolean isEJB,
- Map<String, String> correctedPortLocations)
- throws DeploymentException {
-
- if (LOG.isDebugEnabled()) {
- LOG.debug("Parsing descriptor " + wsDDUrl);
- }
-
- Map<String, PortInfo> map = null;
-
- try {
- JAXBContext ctx = JAXBContext.newInstance(WebservicesType.class);
- Unmarshaller unmarshaller = ctx.createUnmarshaller();
- Object obj = unmarshaller.unmarshal(new StreamSource(in), WebservicesType.class);
-
- if (obj instanceof JAXBElement) {
- obj = ((JAXBElement) obj).getValue();
- }
-
- if (!(obj instanceof WebservicesType)) {
- return map;
- }
- WebservicesType wst = (WebservicesType) obj;
-
- for (WebserviceDescriptionType desc : wst.getWebserviceDescription()) {
- String wsdlFile = null;
- if (desc.getWsdlFile() != null) {
- wsdlFile = getString(desc.getWsdlFile().getValue());
- }
-
- String serviceName = desc.getWebserviceDescriptionName().getValue();
-
- for (PortComponentType port : desc.getPortComponent()) {
-
- PortInfo portInfo = new PortInfo();
-
- String serviceLink = null;
- ServiceImplBeanType beanType = port.getServiceImplBean();
- if (beanType.getEjbLink() != null) {
- serviceLink = beanType.getEjbLink().getValue();
- } else if (beanType.getServletLink().getValue() != null) {
- serviceLink = beanType.getServletLink().getValue();
- }
- portInfo.setServiceLink(serviceLink);
-
- if (port.getServiceEndpointInterface() != null) {
- String sei = port.getServiceEndpointInterface().getValue();
- portInfo.setServiceEndpointInterfaceName(sei);
- }
-
- String portName = port.getPortComponentName().getValue();
- portInfo.setPortName(portName);
-
- portInfo.setProtocolBinding(port.getProtocolBinding());
- portInfo.setServiceName(serviceName);
- portInfo.setWsdlFile(wsdlFile);
-
- if (port.getEnableMtom() != null) {
- portInfo.setEnableMTOM(port.getEnableMtom().isValue());
- }
-
- portInfo.setHandlers(HandlerChainsType.class, port.getHandlerChains());
-
- if (port.getWsdlPort() != null) {
- portInfo.setWsdlPort(port.getWsdlPort().getValue());
- }
-
- if (port.getWsdlService() != null) {
- portInfo.setWsdlService(port.getWsdlService().getValue());
- }
-
- String location = correctedPortLocations.get(serviceLink);
- portInfo.setLocation(location);
-
- if (map == null) {
- map = new HashMap<String, PortInfo>();
- }
- map.put(serviceLink, portInfo);
- }
- }
-
- return map;
- } catch (FileNotFoundException e) {
- return Collections.emptyMap();
- } catch (IOException ex) {
- throw new DeploymentException("Unable to read " + wsDDUrl, ex);
- } catch (JAXBException ex) {
- throw new DeploymentException("Unable to parse " + wsDDUrl, ex);
- } catch (Exception ex) {
- throw new DeploymentException("Unknown deployment error", ex);
- } finally {
- try {
- in.close();
- } catch (IOException e) {
- // ignore
- }
- }
- }
-
- private static String getString(String in) {
- if (in != null) {
- in = in.trim();
- if (in.length() == 0) {
- return null;
- }
- }
- return in;
- }
-
@Override
protected void initialize(GBeanData targetGBean, Class serviceClass, PortInfo portInfo, Module module, Bundle bundle) throws DeploymentException {
if (Boolean.getBoolean(USE_WSGEN_PROPERTY)) {
Modified: geronimo/server/trunk/plugins/cxf/geronimo-cxf-builder/src/main/java/org/apache/geronimo/cxf/builder/CXFServiceRefBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/cxf/geronimo-cxf-builder/src/main/java/org/apache/geronimo/cxf/builder/CXFServiceRefBuilder.java?rev=1104183&r1=1104182&r2=1104183&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/cxf/geronimo-cxf-builder/src/main/java/org/apache/geronimo/cxf/builder/CXFServiceRefBuilder.java (original)
+++ geronimo/server/trunk/plugins/cxf/geronimo-cxf-builder/src/main/java/org/apache/geronimo/cxf/builder/CXFServiceRefBuilder.java Tue May 17 12:11:47 2011
@@ -33,9 +33,9 @@ import org.apache.geronimo.jaxws.builder
import org.apache.geronimo.jaxws.builder.JAXWSBuilderUtils;
import org.apache.geronimo.jaxws.builder.JAXWSServiceRefBuilder;
import org.apache.geronimo.jaxws.client.EndpointInfo;
-import org.apache.geronimo.kernel.config.ConfigurationModuleType;
import org.apache.geronimo.kernel.repository.Environment;
import org.apache.geronimo.naming.deployment.ServiceRefBuilder;
+import org.apache.geronimo.naming.reference.JndiReference;
import org.apache.geronimo.xbeans.geronimo.naming.GerServiceRefType;
import org.apache.openejb.jee.PortComponentRef;
import org.apache.openejb.jee.ServiceRef;
@@ -57,6 +57,11 @@ public class CXFServiceRefBuilder extend
Module module, Bundle bundle, Class serviceInterface,
QName serviceQName, URI wsdlURI, Class serviceReference,
Map<Class<?>, PortComponentRef> portComponentRefMap) throws DeploymentException {
+
+ if(serviceRef.getLookupName() != null && !serviceRef.getLookupName().isEmpty()) {
+ return new JndiReference(serviceRef.getLookupName());
+ }
+
EndpointInfoBuilder builder = new EndpointInfoBuilder(serviceInterface,
gerServiceRef, portComponentRefMap, module, bundle,
wsdlURI, serviceQName);
Modified: geronimo/server/trunk/plugins/cxf/geronimo-cxf/src/main/java/org/apache/geronimo/cxf/CXFEndpoint.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/cxf/geronimo-cxf/src/main/java/org/apache/geronimo/cxf/CXFEndpoint.java?rev=1104183&r1=1104182&r2=1104183&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/cxf/geronimo-cxf/src/main/java/org/apache/geronimo/cxf/CXFEndpoint.java (original)
+++ geronimo/server/trunk/plugins/cxf/geronimo-cxf/src/main/java/org/apache/geronimo/cxf/CXFEndpoint.java Tue May 17 12:11:47 2011
@@ -167,10 +167,10 @@ public abstract class CXFEndpoint {
init();
- org.apache.cxf.endpoint.Endpoint endpoint = getEndpoint();
+ //org.apache.cxf.endpoint.Endpoint endpoint = getEndpoint();
- if (getBinding() instanceof SOAPBinding && this.portInfo.isMTOMEnabled() != null) {
- ((SOAPBinding)getBinding()).setMTOMEnabled(this.portInfo.isMTOMEnabled());
+ if (getBinding() instanceof SOAPBinding && this.portInfo.getMtomFeatureInfo() != null) {
+ ((SOAPBinding) getBinding()).setMTOMEnabled(this.portInfo.getMtomFeatureInfo().isEnabled());
}
server.start();
Modified: geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/annotation/WebServiceRefAnnotationHelper.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/annotation/WebServiceRefAnnotationHelper.java?rev=1104183&r1=1104182&r2=1104183&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/annotation/WebServiceRefAnnotationHelper.java (original)
+++ geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/annotation/WebServiceRefAnnotationHelper.java Tue May 17 12:11:47 2011
@@ -291,6 +291,11 @@ public final class WebServiceRefAnnotati
// <service-ref> optional elements:
//------------------------------------------------------------------------------
+ // Look-up
+ if (serviceRef.getLookupName() == null && !annotation.lookup().trim().isEmpty()) {
+ serviceRef.setLookupName(annotation.lookup().trim());
+ }
+
// service-ref-type
if (serviceRef.getServiceRefType() == null && !webServiceRefType.equals(Object.class)) {
serviceRef.setServiceRefType(webServiceRefType.getName());
@@ -411,7 +416,9 @@ public final class WebServiceRefAnnotati
} else if (webServiceFeatureAnnotationType == RespectBinding.class) {
RespectBinding respectBinding = (RespectBinding) webServiceFeatureAnnotation;
if (portComponentRef.getRespectBinding() == null) {
- portComponentRef.setRespectBinding(respectBinding.enabled());
+ org.apache.openejb.jee.RespectBinding respectBindingValue = new org.apache.openejb.jee.RespectBinding();
+ respectBindingValue.setEnabled(respectBinding.enabled());
+ portComponentRef.setRespectBinding(respectBindingValue);
}
} else {
log.warn("Unsupport web service feature annotation " + webServiceFeatureAnnotation + " on " + webServiceRefName);
Modified: geronimo/server/trunk/plugins/jaxws/geronimo-jaxws-builder/src/main/java/org/apache/geronimo/jaxws/builder/EndpointInfoBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/jaxws/geronimo-jaxws-builder/src/main/java/org/apache/geronimo/jaxws/builder/EndpointInfoBuilder.java?rev=1104183&r1=1104182&r2=1104183&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/jaxws/geronimo-jaxws-builder/src/main/java/org/apache/geronimo/jaxws/builder/EndpointInfoBuilder.java (original)
+++ geronimo/server/trunk/plugins/jaxws/geronimo-jaxws-builder/src/main/java/org/apache/geronimo/jaxws/builder/EndpointInfoBuilder.java Tue May 17 12:11:47 2011
@@ -378,8 +378,8 @@ public class EndpointInfoBuilder {
if (portComponentRef.getEnableMtom() != null) {
webServiceFeatureInfos.add(new MTOMFeatureInfo(portComponentRef.isEnableMtom(), portComponentRef.getMtomThreshold() == null ? 0 : portComponentRef.getMtomThreshold()));
}
- if (portComponentRef.getRespectBinding() != null) {
- webServiceFeatureInfos.add(new RespectBindingFeatureInfo(portComponentRef.getRespectBinding()));
+ if (portComponentRef.getRespectBinding() != null && portComponentRef.getRespectBinding().getEnabled() != null) {
+ webServiceFeatureInfos.add(new RespectBindingFeatureInfo(portComponentRef.getRespectBinding().getEnabled()));
}
return webServiceFeatureInfos;
}
Modified: geronimo/server/trunk/plugins/jaxws/geronimo-jaxws-builder/src/main/java/org/apache/geronimo/jaxws/builder/JAXWSServiceBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/jaxws/geronimo-jaxws-builder/src/main/java/org/apache/geronimo/jaxws/builder/JAXWSServiceBuilder.java?rev=1104183&r1=1104182&r2=1104183&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/jaxws/geronimo-jaxws-builder/src/main/java/org/apache/geronimo/jaxws/builder/JAXWSServiceBuilder.java (original)
+++ geronimo/server/trunk/plugins/jaxws/geronimo-jaxws-builder/src/main/java/org/apache/geronimo/jaxws/builder/JAXWSServiceBuilder.java Tue May 17 12:11:47 2011
@@ -17,11 +17,13 @@
package org.apache.geronimo.jaxws.builder;
-import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
import java.util.Map;
+
+import javax.xml.bind.JAXBException;
import javax.xml.ws.http.HTTPBinding;
+import javax.xml.ws.soap.AddressingFeature;
import org.apache.geronimo.common.DeploymentException;
import org.apache.geronimo.deployment.Deployable;
@@ -39,10 +41,20 @@ import org.apache.geronimo.j2ee.deployme
import org.apache.geronimo.jaxws.JAXWSUtils;
import org.apache.geronimo.jaxws.PortInfo;
import org.apache.geronimo.jaxws.annotations.AnnotationHolder;
+import org.apache.geronimo.jaxws.feature.AddressingFeatureInfo;
+import org.apache.geronimo.jaxws.feature.MTOMFeatureInfo;
+import org.apache.geronimo.jaxws.feature.RespectBindingFeatureInfo;
import org.apache.geronimo.kernel.GBeanAlreadyExistsException;
import org.apache.geronimo.kernel.GBeanNotFoundException;
import org.apache.geronimo.kernel.repository.Environment;
import org.apache.geronimo.kernel.util.IOUtils;
+import org.apache.openejb.jee.Addressing;
+import org.apache.openejb.jee.HandlerChains;
+import org.apache.openejb.jee.JaxbJavaee;
+import org.apache.openejb.jee.PortComponent;
+import org.apache.openejb.jee.ServiceImplBean;
+import org.apache.openejb.jee.WebserviceDescription;
+import org.apache.openejb.jee.Webservices;
import org.osgi.framework.Bundle;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -66,12 +78,8 @@ public abstract class JAXWSServiceBuilde
}
@Override
- public void findWebServices(Module module,
- boolean isEJB,
- Map<String, String> servletLocations,
- Environment environment,
- Map sharedContext) throws DeploymentException {
- Map<String, PortInfo> portMap = null;
+ public void findWebServices(Module module, boolean isEJB, Map<String, String> servletLocations, Environment environment, Map sharedContext) throws DeploymentException {
+ Map<String, PortInfo> serviceLinkPortInfoMap = discoverWebServices(module, isEJB, servletLocations);
String path = isEJB ? "META-INF/webservices.xml" : "WEB-INF/webservices.xml";
Deployable deployable = module.getDeployable();
URL wsDDUrl = deployable.getResource(path);
@@ -79,22 +87,132 @@ public abstract class JAXWSServiceBuilde
InputStream in = null;
try {
in = wsDDUrl.openStream();
- portMap = parseWebServiceDescriptor(in, wsDDUrl, deployable, isEJB, servletLocations);
- } catch (IOException e) {
+
+ Webservices wst = (Webservices) JaxbJavaee.unmarshalJavaee(Webservices.class, in);
+ for (WebserviceDescription desc : wst.getWebserviceDescription()) {
+ String wsdlFile = null;
+ if (desc.getWsdlFile() != null) {
+ wsdlFile = getString(desc.getWsdlFile());
+ }
+ String serviceName = desc.getWebserviceDescriptionName();
+ for (PortComponent port : desc.getPortComponent()) {
+
+ String serviceLink = null;
+ ServiceImplBean beanType = port.getServiceImplBean();
+ if (beanType.getEjbLink() != null) {
+ serviceLink = beanType.getEjbLink();
+ } else if (beanType.getServletLink() != null) {
+ serviceLink = beanType.getServletLink();
+ }
+
+ PortInfo portInfo = serviceLinkPortInfoMap.get(serviceLink);
+ if (portInfo == null) {
+ portInfo = new PortInfo();
+ portInfo.setServiceLink(serviceLink);
+ serviceLinkPortInfoMap.put(serviceLink, portInfo);
+ }
+
+ if (port.getServiceEndpointInterface() != null) {
+ String sei = port.getServiceEndpointInterface();
+ portInfo.setServiceEndpointInterfaceName(sei);
+ }
+
+ if (port.getPortComponentName() != null) {
+ portInfo.setPortName(port.getPortComponentName());
+ }
+
+ if (port.getProtocolBinding() != null) {
+ portInfo.setProtocolBinding(port.getProtocolBinding());
+ }
+
+ portInfo.setServiceName(serviceName);
+
+ if (wsdlFile != null) {
+ portInfo.setWsdlFile(wsdlFile);
+ }
+
+ if (port.getHandlerChains() != null) {
+ String handlerChains = JaxbJavaee.marshal(HandlerChains.class, port.getHandlerChains());
+ portInfo.setHandlersAsXML(handlerChains);
+ }
+
+ if (port.getWsdlPort() != null) {
+ portInfo.setWsdlPort(port.getWsdlPort());
+ }
+
+ if (port.getWsdlService() != null) {
+ portInfo.setWsdlService(port.getWsdlService());
+ }
+
+ String location = servletLocations.get(serviceLink);
+ portInfo.setLocation(location);
+
+ Addressing addressing = port.getAddressing();
+ if (addressing != null) {
+ AddressingFeatureInfo addressingFeatureInfo = portInfo.getAddressingFeatureInfo();
+ if (addressingFeatureInfo == null) {
+ addressingFeatureInfo = new AddressingFeatureInfo();
+ portInfo.setAddressingFeatureInfo(addressingFeatureInfo);
+ }
+ if (addressing.getEnabled() != null) {
+ addressingFeatureInfo.setEnabled(addressing.getEnabled());
+ }
+ if (addressing.getRequired() != null) {
+ addressingFeatureInfo.setRequired(addressing.getRequired());
+ }
+ if (addressing.getResponses() != null) {
+ addressingFeatureInfo.setResponses(AddressingFeature.Responses.valueOf(addressing.getResponses().name()));
+ }
+ }
+
+ if (port.getEnableMtom() != null || port.getMtomThreshold() != null) {
+ MTOMFeatureInfo mtomFeatureInfo = portInfo.getMtomFeatureInfo();
+ if (mtomFeatureInfo == null) {
+ mtomFeatureInfo = new MTOMFeatureInfo();
+ portInfo.setMtomFeatureInfo(mtomFeatureInfo);
+ }
+ if (port.getEnableMtom() != null) {
+ mtomFeatureInfo.setEnabled(port.getEnableMtom());
+ }
+ if (port.getMtomThreshold() != null) {
+ mtomFeatureInfo.setThreshold(port.getMtomThreshold());
+ }
+ }
+
+ if (port.getRespectBinding() != null && port.getRespectBinding().getEnabled() != null) {
+ RespectBindingFeatureInfo respectBindingFeatureInfo = portInfo.getRespectBindingFeatureInfo();
+ if (respectBindingFeatureInfo == null) {
+ respectBindingFeatureInfo = new RespectBindingFeatureInfo();
+ portInfo.setRespectBindingFeatureInfo(respectBindingFeatureInfo);
+ }
+ respectBindingFeatureInfo.setEnabled(port.getRespectBinding().getEnabled());
+ }
+ }
+ }
+ } catch (JAXBException e) {
+ //we hope it's jax-rpc
+ LOG.debug("Descriptor ignored (not a Java EE 5 descriptor)");
+ } catch (Exception e) {
throw new DeploymentException("Failed to parse " + path, e);
} finally {
IOUtils.close(in);
}
- } else {
- // webservices.xml does not exist
- portMap = discoverWebServices(module, isEJB, servletLocations);
}
- if (portMap != null && !portMap.isEmpty()) {
+ if (serviceLinkPortInfoMap != null && !serviceLinkPortInfoMap.isEmpty()) {
EnvironmentBuilder.mergeEnvironments(environment, defaultEnvironment);
- sharedContext.put(getKey(), portMap);
+ sharedContext.put(getKey(), serviceLinkPortInfoMap);
}
+ }
+ private String getString(String in) {
+ if (in != null) {
+ in = in.trim();
+ if (in.length() == 0) {
+ return null;
+ }
+ }
+ return in;
}
private Map<String, PortInfo> discoverWebServices(Module module,
@@ -107,13 +225,6 @@ public abstract class JAXWSServiceBuilde
return webServiceFinder.discoverWebServices(module, correctedPortLocations);
}
- protected abstract Map<String, PortInfo> parseWebServiceDescriptor(InputStream in,
- URL wsDDUrl,
- Deployable deployable,
- boolean isEJB,
- Map<String, String> correctedPortLocations)
- throws DeploymentException;
-
@Override
public boolean configurePOJO(GBeanData targetGBean,
String servletName,
Modified: geronimo/server/trunk/plugins/jaxws/geronimo-jaxws/src/main/java/org/apache/geronimo/jaxws/PortInfo.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/jaxws/geronimo-jaxws/src/main/java/org/apache/geronimo/jaxws/PortInfo.java?rev=1104183&r1=1104182&r2=1104183&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/jaxws/geronimo-jaxws/src/main/java/org/apache/geronimo/jaxws/PortInfo.java (original)
+++ geronimo/server/trunk/plugins/jaxws/geronimo-jaxws/src/main/java/org/apache/geronimo/jaxws/PortInfo.java Tue May 17 12:11:47 2011
@@ -24,6 +24,10 @@ import javax.xml.bind.JAXBElement;
import javax.xml.bind.Marshaller;
import javax.xml.namespace.QName;
+import org.apache.geronimo.jaxws.feature.AddressingFeatureInfo;
+import org.apache.geronimo.jaxws.feature.MTOMFeatureInfo;
+import org.apache.geronimo.jaxws.feature.RespectBindingFeatureInfo;
+
public class PortInfo implements Serializable {
private String serviceName;
@@ -38,8 +42,6 @@ public class PortInfo implements Seriali
private String handlersAsXML;
- private Boolean mtomEnabled;
-
private String binding;
private QName wsdlPort;
@@ -48,6 +50,12 @@ public class PortInfo implements Seriali
private String location;
+ private MTOMFeatureInfo mtomFeatureInfo;
+
+ private AddressingFeatureInfo addressingFeatureInfo;
+
+ private RespectBindingFeatureInfo respectBindingFeatureInfo;
+
public String getPortName() {
return portName;
}
@@ -88,14 +96,6 @@ public class PortInfo implements Seriali
serviceName = sn;
}
- public void setEnableMTOM(Boolean mtomEnabled) {
- this.mtomEnabled = mtomEnabled;
- }
-
- public Boolean isMTOMEnabled() {
- return this.mtomEnabled;
- }
-
public void setProtocolBinding(String binding) {
this.binding = binding;
}
@@ -155,11 +155,28 @@ public class PortInfo implements Seriali
this.location = location;
}
- @Override
- public String toString() {
- return "PortInfo [serviceName=" + serviceName + ", portName=" + portName + ", seiInterfaceName=" + seiInterfaceName + ", wsdlFile=" + wsdlFile + ", servletLink=" + servletLink
- + ", handlersAsXML=" + handlersAsXML + ", mtomEnabled=" + mtomEnabled + ", binding=" + binding + ", wsdlPort=" + wsdlPort + ", wsdlService=" + wsdlService + ", location=" + location
- + "]";
+ public MTOMFeatureInfo getMtomFeatureInfo() {
+ return mtomFeatureInfo;
+ }
+
+ public void setMtomFeatureInfo(MTOMFeatureInfo mtomFeatureInfo) {
+ this.mtomFeatureInfo = mtomFeatureInfo;
+ }
+
+ public AddressingFeatureInfo getAddressingFeatureInfo() {
+ return addressingFeatureInfo;
+ }
+
+ public void setAddressingFeatureInfo(AddressingFeatureInfo addressingFeatureInfo) {
+ this.addressingFeatureInfo = addressingFeatureInfo;
+ }
+
+ public RespectBindingFeatureInfo getRespectBindingFeatureInfo() {
+ return respectBindingFeatureInfo;
+ }
+
+ public void setRespectBindingFeatureInfo(RespectBindingFeatureInfo respectBindingFeatureInfo) {
+ this.respectBindingFeatureInfo = respectBindingFeatureInfo;
}
public String getHandlersAsXML() {
@@ -169,4 +186,12 @@ public class PortInfo implements Seriali
public void setHandlersAsXML(String handlersAsXML) {
this.handlersAsXML = handlersAsXML;
}
+
+ @Override
+ public String toString() {
+ return "PortInfo [serviceName=" + serviceName + ", portName=" + portName + ", seiInterfaceName=" + seiInterfaceName + ", wsdlFile=" + wsdlFile + ", servletLink=" + servletLink
+ + ", handlersAsXML=" + handlersAsXML + ", binding=" + binding + ", wsdlPort=" + wsdlPort + ", wsdlService=" + wsdlService + ", location=" + location + ", mtomFeatureInfo="
+ + mtomFeatureInfo + ", addressingFeatureInfo=" + addressingFeatureInfo + ", respectBindingFeatureInfo=" + respectBindingFeatureInfo + "]";
+ }
+
}
Modified: geronimo/server/trunk/plugins/jaxws/geronimo-jaxws/src/main/java/org/apache/geronimo/jaxws/feature/AddressingFeatureInfo.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/jaxws/geronimo-jaxws/src/main/java/org/apache/geronimo/jaxws/feature/AddressingFeatureInfo.java?rev=1104183&r1=1104182&r2=1104183&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/jaxws/geronimo-jaxws/src/main/java/org/apache/geronimo/jaxws/feature/AddressingFeatureInfo.java (original)
+++ geronimo/server/trunk/plugins/jaxws/geronimo-jaxws/src/main/java/org/apache/geronimo/jaxws/feature/AddressingFeatureInfo.java Tue May 17 12:11:47 2011
@@ -32,6 +32,12 @@ public class AddressingFeatureInfo imple
private AddressingFeature.Responses responses;
+ public AddressingFeatureInfo() {
+ enabled = true;
+ required = false;
+ responses = AddressingFeature.Responses.ALL;
+ }
+
public AddressingFeatureInfo(Addressing addressing) {
this(addressing.enabled(), addressing.required(), addressing.responses());
}
@@ -46,4 +52,62 @@ public class AddressingFeatureInfo imple
public WebServiceFeature getWebServiceFeature() {
return new AddressingFeature(enabled, required, responses);
}
+
+ public void setEnabled(boolean enabled) {
+ this.enabled = enabled;
+ }
+
+ public void setRequired(boolean required) {
+ this.required = required;
+ }
+
+ public void setResponses(AddressingFeature.Responses responses) {
+ this.responses = responses;
+ }
+
+ public boolean isEnabled() {
+ return enabled;
+ }
+
+ public boolean isRequired() {
+ return required;
+ }
+
+ public AddressingFeature.Responses getResponses() {
+ return responses;
+ }
+
+ @Override
+ public String toString() {
+ return "AddressingFeatureInfo [enabled=" + enabled + ", required=" + required + ", responses=" + responses + "]";
+ }
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + (enabled ? 1231 : 1237);
+ result = prime * result + (required ? 1231 : 1237);
+ result = prime * result + ((responses == null) ? 0 : responses.hashCode());
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (getClass() != obj.getClass())
+ return false;
+ AddressingFeatureInfo other = (AddressingFeatureInfo) obj;
+ if (enabled != other.enabled)
+ return false;
+ if (required != other.required)
+ return false;
+ if (responses != other.responses)
+ return false;
+ return true;
+ }
+
}
Modified: geronimo/server/trunk/plugins/jaxws/geronimo-jaxws/src/main/java/org/apache/geronimo/jaxws/feature/MTOMFeatureInfo.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/jaxws/geronimo-jaxws/src/main/java/org/apache/geronimo/jaxws/feature/MTOMFeatureInfo.java?rev=1104183&r1=1104182&r2=1104183&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/jaxws/geronimo-jaxws/src/main/java/org/apache/geronimo/jaxws/feature/MTOMFeatureInfo.java (original)
+++ geronimo/server/trunk/plugins/jaxws/geronimo-jaxws/src/main/java/org/apache/geronimo/jaxws/feature/MTOMFeatureInfo.java Tue May 17 12:11:47 2011
@@ -30,6 +30,11 @@ public class MTOMFeatureInfo implements
private int threshold;
+ public MTOMFeatureInfo() {
+ enabled = false;
+ threshold = 0;
+ }
+
public MTOMFeatureInfo(MTOM mtom) {
this(mtom.enabled(), mtom.threshold());
}
@@ -47,9 +52,47 @@ public class MTOMFeatureInfo implements
return threshold;
}
+ public void setEnabled(boolean enabled) {
+ this.enabled = enabled;
+ }
+
+ public void setThreshold(int threshold) {
+ this.threshold = threshold;
+ }
+
@Override
public WebServiceFeature getWebServiceFeature() {
return new MTOMFeature(enabled, threshold);
}
+ @Override
+ public String toString() {
+ return "MTOMFeatureInfo [enabled=" + enabled + ", threshold=" + threshold + "]";
+ }
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + (enabled ? 1231 : 1237);
+ result = prime * result + threshold;
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (getClass() != obj.getClass())
+ return false;
+ MTOMFeatureInfo other = (MTOMFeatureInfo) obj;
+ if (enabled != other.enabled)
+ return false;
+ if (threshold != other.threshold)
+ return false;
+ return true;
+ }
+
}
Modified: geronimo/server/trunk/plugins/jaxws/geronimo-jaxws/src/main/java/org/apache/geronimo/jaxws/feature/RespectBindingFeatureInfo.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/jaxws/geronimo-jaxws/src/main/java/org/apache/geronimo/jaxws/feature/RespectBindingFeatureInfo.java?rev=1104183&r1=1104182&r2=1104183&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/jaxws/geronimo-jaxws/src/main/java/org/apache/geronimo/jaxws/feature/RespectBindingFeatureInfo.java (original)
+++ geronimo/server/trunk/plugins/jaxws/geronimo-jaxws/src/main/java/org/apache/geronimo/jaxws/feature/RespectBindingFeatureInfo.java Tue May 17 12:11:47 2011
@@ -28,6 +28,10 @@ public class RespectBindingFeatureInfo i
private boolean enabled;
+ public RespectBindingFeatureInfo() {
+ enabled = false;
+ }
+
public RespectBindingFeatureInfo(RespectBinding respectBinding) {
this(respectBinding.enabled());
}
@@ -41,4 +45,39 @@ public class RespectBindingFeatureInfo i
return new RespectBindingFeature(enabled);
}
+ public boolean isEnabled() {
+ return enabled;
+ }
+
+ public void setEnabled(boolean enabled) {
+ this.enabled = enabled;
+ }
+
+ @Override
+ public String toString() {
+ return "RespectBindingFeatureInfo [enabled=" + enabled + "]";
+ }
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + (enabled ? 1231 : 1237);
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (getClass() != obj.getClass())
+ return false;
+ RespectBindingFeatureInfo other = (RespectBindingFeatureInfo) obj;
+ if (enabled != other.enabled)
+ return false;
+ return true;
+ }
+
}