You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tomee.apache.org by an...@apache.org on 2014/07/17 09:53:05 UTC
svn commit: r1611274 [3/15] - in /tomee/tomee/branches/tomee-1.7.x/server:
./ openejb-activemq/
openejb-activemq/src/main/java/org/apache/openejb/server/activemq/
openejb-axis/ openejb-axis/src/main/java/org/apache/openejb/server/axis/
openejb-axis/src...
Modified: tomee/tomee/branches/tomee-1.7.x/server/openejb-axis/src/main/java/org/apache/openejb/server/axis/assembler/HeavyweightOperationInfoBuilder.java
URL: http://svn.apache.org/viewvc/tomee/tomee/branches/tomee-1.7.x/server/openejb-axis/src/main/java/org/apache/openejb/server/axis/assembler/HeavyweightOperationInfoBuilder.java?rev=1611274&r1=1611273&r2=1611274&view=diff
==============================================================================
--- tomee/tomee/branches/tomee-1.7.x/server/openejb-axis/src/main/java/org/apache/openejb/server/axis/assembler/HeavyweightOperationInfoBuilder.java (original)
+++ tomee/tomee/branches/tomee-1.7.x/server/openejb-axis/src/main/java/org/apache/openejb/server/axis/assembler/HeavyweightOperationInfoBuilder.java Thu Jul 17 07:52:58 2014
@@ -27,6 +27,7 @@ import org.apache.openejb.jee.PackageMap
import org.apache.openejb.jee.ServiceEndpointMethodMapping;
import org.apache.openejb.jee.WsdlMessageMapping;
import org.apache.openejb.jee.WsdlReturnValueMapping;
+
import static org.apache.openejb.server.axis.assembler.JaxRpcParameterInfo.Mode;
import javax.wsdl.BindingInput;
@@ -73,7 +74,7 @@ import java.util.List;
import java.util.Map;
import java.util.Set;
-public class HeavyweightOperationInfoBuilder{
+public class HeavyweightOperationInfoBuilder {
private final JavaWsdlMapping mapping;
private final ServiceEndpointMethodMapping methodMapping;
@@ -106,15 +107,15 @@ public class HeavyweightOperationInfoBui
private JaxRpcOperationInfo operationInfo;
- public HeavyweightOperationInfoBuilder(BindingOperation bindingOperation, ServiceEndpointMethodMapping methodMapping, JavaWsdlMapping mapping, XmlSchemaInfo schemaInfo) throws OpenEJBException {
- Operation operation = bindingOperation.getOperation();
+ public HeavyweightOperationInfoBuilder(final BindingOperation bindingOperation, final ServiceEndpointMethodMapping methodMapping, final JavaWsdlMapping mapping, final XmlSchemaInfo schemaInfo) throws OpenEJBException {
+ final Operation operation = bindingOperation.getOperation();
this.operationName = operation.getName();
this.operationStyle = JaxRpcOperationInfo.OperationStyle.valueOf(operation.getStyle().toString());
this.outputMessage = operation.getOutput() == null ? null : operation.getOutput().getMessage();
this.inputMessage = operation.getInput().getMessage();
// faults
- for (Object o : operation.getFaults().values()) {
+ for (final Object o : operation.getFaults().values()) {
faults.add((Fault) o);
}
@@ -123,13 +124,13 @@ public class HeavyweightOperationInfoBui
this.schemaInfo = schemaInfo;
// index types - used to process build exception class constructor args
- for (JavaXmlTypeMapping javaXmlTypeMapping : mapping.getJavaXmlTypeMapping()) {
- String javaClassName = javaXmlTypeMapping.getJavaType();
+ for (final JavaXmlTypeMapping javaXmlTypeMapping : mapping.getJavaXmlTypeMapping()) {
+ final String javaClassName = javaXmlTypeMapping.getJavaType();
if (javaXmlTypeMapping.getAnonymousTypeQname() != null) {
- String anonymousTypeQName = javaXmlTypeMapping.getAnonymousTypeQname();
+ final String anonymousTypeQName = javaXmlTypeMapping.getAnonymousTypeQname();
anonymousTypes.put(anonymousTypeQName, javaClassName);
} else if (javaXmlTypeMapping.getRootTypeQname() != null) {
- QName qname = javaXmlTypeMapping.getRootTypeQname();
+ final QName qname = javaXmlTypeMapping.getRootTypeQname();
publicTypes.put(qname, javaClassName);
}
}
@@ -138,17 +139,17 @@ public class HeavyweightOperationInfoBui
if (methodMapping.getWrappedElement() != null) {
bindingStyle = BindingStyle.DOCUMENT_LITERAL_WRAPPED;
} else {
- BindingInput bindingInput = bindingOperation.getBindingInput();
+ final BindingInput bindingInput = bindingOperation.getBindingInput();
- SOAPOperation soapOperation = JaxRpcServiceInfoBuilder.getExtensibilityElement(SOAPOperation.class, bindingOperation.getExtensibilityElements());
+ final SOAPOperation soapOperation = JaxRpcServiceInfoBuilder.getExtensibilityElement(SOAPOperation.class, bindingOperation.getExtensibilityElements());
String styleString = soapOperation.getStyle();
if (styleString == null) {
- SOAPBinding soapBinding = JaxRpcServiceInfoBuilder.getExtensibilityElement(SOAPBinding.class, bindingInput.getExtensibilityElements());
+ final SOAPBinding soapBinding = JaxRpcServiceInfoBuilder.getExtensibilityElement(SOAPBinding.class, bindingInput.getExtensibilityElements());
styleString = soapBinding.getStyle();
}
- SOAPBody soapBody = JaxRpcServiceInfoBuilder.getExtensibilityElement(SOAPBody.class, bindingInput.getExtensibilityElements());
- String useString = soapBody.getUse();
+ final SOAPBody soapBody = JaxRpcServiceInfoBuilder.getExtensibilityElement(SOAPBody.class, bindingInput.getExtensibilityElements());
+ final String useString = soapBody.getUse();
bindingStyle = BindingStyle.getBindingStyle(styleString, useString);
}
@@ -190,14 +191,14 @@ public class HeavyweightOperationInfoBui
// Validate output mapping is complete
if (outputMessage != null && bindingStyle.isWrapped()) {
- Part inputPart = getWrappedPart(outputMessage);
+ final Part inputPart = getWrappedPart(outputMessage);
- QName wrapperName = inputPart.getElementName();
- XmlElementInfo wraperElement = schemaInfo.elements.get(wrapperName);
- XmlTypeInfo wrapperType = schemaInfo.types.get(wraperElement.xmlType);
+ final QName wrapperName = inputPart.getElementName();
+ final XmlElementInfo wraperElement = schemaInfo.elements.get(wrapperName);
+ final XmlTypeInfo wrapperType = schemaInfo.types.get(wraperElement.xmlType);
- Set<String> expectedOutParams = new HashSet<String>();
- for (XmlElementInfo expectedOutParam : wrapperType.elements.values()) {
+ final Set<String> expectedOutParams = new HashSet<String>();
+ for (final XmlElementInfo expectedOutParam : wrapperType.elements.values()) {
expectedOutParams.add(expectedOutParam.qname.getLocalPart());
}
if (!outParamNames.equals(expectedOutParams)) {
@@ -212,8 +213,8 @@ public class HeavyweightOperationInfoBui
//
// Map faults (exception)
//
- for (Fault fault : faults) {
- JaxRpcFaultInfo faultInfo = mapFaults(fault);
+ for (final Fault fault : faults) {
+ final JaxRpcFaultInfo faultInfo = mapFaults(fault);
operationInfo.faults.add(faultInfo);
}
@@ -221,15 +222,15 @@ public class HeavyweightOperationInfoBui
}
private JaxRpcParameterInfo[] mapParameters() throws OpenEJBException {
- List<MethodParamPartsMapping> paramMappings = methodMapping.getMethodParamPartsMapping();
+ final List<MethodParamPartsMapping> paramMappings = methodMapping.getMethodParamPartsMapping();
//
// Map the ParameterDesc instance in an array so they can be ordered properly
// before they are added to the the OperationDesc.
//
- JaxRpcParameterInfo[] parameterInfos = new JaxRpcParameterInfo[paramMappings.size()];
- for (MethodParamPartsMapping paramMapping : paramMappings) {
- JaxRpcParameterInfo parameterInfo = mapParameter(paramMapping);
+ final JaxRpcParameterInfo[] parameterInfos = new JaxRpcParameterInfo[paramMappings.size()];
+ for (final MethodParamPartsMapping paramMapping : paramMappings) {
+ final JaxRpcParameterInfo parameterInfo = mapParameter(paramMapping);
parameterInfos[paramMapping.getParamPosition().intValue()] = parameterInfo;
}
@@ -247,14 +248,14 @@ public class HeavyweightOperationInfoBui
//
if (bindingStyle.isWrapped()) {
// verify that all child elements have a parameter mapping
- Part inputPart = getWrappedPart(inputMessage);
+ final Part inputPart = getWrappedPart(inputMessage);
- QName wrapperName = inputPart.getElementName();
- XmlElementInfo wrapperElement = schemaInfo.elements.get(wrapperName);
- XmlTypeInfo wrapperType = schemaInfo.types.get(wrapperElement.xmlType);
+ final QName wrapperName = inputPart.getElementName();
+ final XmlElementInfo wrapperElement = schemaInfo.elements.get(wrapperName);
+ final XmlTypeInfo wrapperType = schemaInfo.types.get(wrapperElement.xmlType);
- Set<String> expectedInParams = new HashSet<String>();
- for (XmlElementInfo expectedInParam : wrapperType.elements.values()) {
+ final Set<String> expectedInParams = new HashSet<String>();
+ for (final XmlElementInfo expectedInParam : wrapperType.elements.values()) {
expectedInParams.add(expectedInParam.qname.getLocalPart());
}
if (!inParamNames.equals(expectedInParams)) {
@@ -270,12 +271,12 @@ public class HeavyweightOperationInfoBui
return parameterInfos;
}
- private JaxRpcParameterInfo mapParameter(MethodParamPartsMapping paramMapping) throws OpenEJBException {
- WsdlMessageMapping wsdlMessageMappingType = paramMapping.getWsdlMessageMapping();
- QName wsdlMessageQName = wsdlMessageMappingType.getWsdlMessage();
- String wsdlMessagePartName = wsdlMessageMappingType.getWsdlMessagePartName();
+ private JaxRpcParameterInfo mapParameter(final MethodParamPartsMapping paramMapping) throws OpenEJBException {
+ final WsdlMessageMapping wsdlMessageMappingType = paramMapping.getWsdlMessageMapping();
+ final QName wsdlMessageQName = wsdlMessageMappingType.getWsdlMessage();
+ final String wsdlMessagePartName = wsdlMessageMappingType.getWsdlMessagePartName();
- Mode mode = Mode.valueOf(wsdlMessageMappingType.getParameterMode());
+ final Mode mode = Mode.valueOf(wsdlMessageMappingType.getParameterMode());
if ((mode == Mode.OUT || mode == Mode.INOUT) && outputMessage == null) {
throw new OpenEJBException("Mapping for output parameter " + wsdlMessagePartName + " found, but no output message for operation " + operationName);
}
@@ -291,19 +292,19 @@ public class HeavyweightOperationInfoBui
//
if (!wsdlMessageQName.equals(inputMessage.getQName())) {
throw new OpenEJBException("QName of input message: " + inputMessage.getQName() +
- " does not match mapping message QName: " + wsdlMessageQName + " for operation " + operationName);
+ " does not match mapping message QName: " + wsdlMessageQName + " for operation " + operationName);
}
Part part = null;
XmlElementInfo inParameter = null;
if (bindingStyle.isWrapped()) {
- Part inPart = getWrappedPart(inputMessage);
+ final Part inPart = getWrappedPart(inputMessage);
// operation name == wraper element name
- QName name = inPart.getElementName();
+ final QName name = inPart.getElementName();
if (!name.getLocalPart().equals(operationName)) {
throw new OpenEJBException("message " + inputMessage.getQName() + " refers to a global element named " +
- name.getLocalPart() + ", which is not equal to the operation name " + operationName);
+ name.getLocalPart() + ", which is not equal to the operation name " + operationName);
}
inParameter = getWrapperChild(inPart, wsdlMessagePartName);
@@ -316,7 +317,7 @@ public class HeavyweightOperationInfoBui
}
paramQName = new QName("", part.getName());
-
+
// RPC can only use type
paramXmlType = part.getTypeName();
} else {
@@ -336,14 +337,14 @@ public class HeavyweightOperationInfoBui
if (mode == Mode.INOUT) {
if (bindingStyle.isWrapped()) {
// Verify output message supports this inout parameter
- Part outPart = getWrappedPart(outputMessage);
- XmlElementInfo outParameter = getWrapperChild(outPart, wsdlMessagePartName);
+ final Part outPart = getWrappedPart(outputMessage);
+ final XmlElementInfo outParameter = getWrapperChild(outPart, wsdlMessagePartName);
if (inParameter.xmlType != outParameter.xmlType) {
throw new OpenEJBException("The wrapper children " + wsdlMessagePartName + " do not have the same type for operation " + operationName);
}
} else if (bindingStyle.isRpc()) {
// Verify output message supports this inout parameter
- Part outPart = outputMessage.getPart(wsdlMessagePartName);
+ final Part outPart = outputMessage.getPart(wsdlMessagePartName);
if (outPart == null) {
throw new OpenEJBException("No part for wsdlMessagePartName " + wsdlMessagePartName + " in output message for INOUT parameter of operation " + operationName);
}
@@ -374,17 +375,17 @@ public class HeavyweightOperationInfoBui
//
if (!wsdlMessageQName.equals(outputMessage.getQName())) {
throw new OpenEJBException("QName of output message: " + outputMessage.getQName() +
- " does not match mapping message QName: " + wsdlMessageQName + " for operation " + operationName);
+ " does not match mapping message QName: " + wsdlMessageQName + " for operation " + operationName);
}
if (bindingStyle.isWrapped()) {
- Part outPart = getWrappedPart(outputMessage);
- XmlElementInfo outParameter = getWrapperChild(outPart, wsdlMessagePartName);
+ final Part outPart = getWrappedPart(outputMessage);
+ final XmlElementInfo outParameter = getWrapperChild(outPart, wsdlMessagePartName);
paramQName = new QName("", outParameter.qname.getLocalPart());
paramXmlType = outParameter.xmlType;
} else if (bindingStyle.isRpc()) {
- Part part = outputMessage.getPart(wsdlMessagePartName);
+ final Part part = outputMessage.getPart(wsdlMessagePartName);
if (part == null) {
throw new OpenEJBException("No part for wsdlMessagePartName " + wsdlMessagePartName + " in output message for operation " + operationName);
}
@@ -394,7 +395,7 @@ public class HeavyweightOperationInfoBui
// RPC can only use type
paramXmlType = part.getTypeName();
} else {
- Part part = outputMessage.getPart(wsdlMessagePartName);
+ final Part part = outputMessage.getPart(wsdlMessagePartName);
if (part == null) {
throw new OpenEJBException("No part for wsdlMessagePartName " + wsdlMessagePartName + " in output message for operation " + operationName);
}
@@ -408,7 +409,7 @@ public class HeavyweightOperationInfoBui
//
// Determine the param java type
//
- String paramJavaType;
+ final String paramJavaType;
if (mode == Mode.IN) {
// IN only prarmeters don't have holders
paramJavaType = paramMapping.getParamType();
@@ -417,10 +418,10 @@ public class HeavyweightOperationInfoBui
paramJavaType = rpcHolderClasses.get(paramMapping.getParamType());
} else {
// holderClass == ${packageName}.holders.${typeName}Holder
- String packageName;
+ final String packageName;
String typeName;
- PackageMapping packageMapping = mapping.getPackageMappingMap().get(paramXmlType.getNamespaceURI());
+ final PackageMapping packageMapping = mapping.getPackageMappingMap().get(paramXmlType.getNamespaceURI());
if (packageMapping != null) {
packageName = packageMapping.getPackageType();
@@ -429,8 +430,8 @@ public class HeavyweightOperationInfoBui
typeName = Character.toUpperCase(typeName.charAt(0)) + typeName.substring(1);
} else {
// a.b.foo.Bar >>> a.b.foo.holders.BarHolder
- String paramJavaTypeName = paramMapping.getParamType();
- int lastDot = paramJavaTypeName.lastIndexOf(".");
+ final String paramJavaTypeName = paramMapping.getParamType();
+ final int lastDot = paramJavaTypeName.lastIndexOf(".");
packageName = paramJavaTypeName.substring(0, lastDot);
typeName = paramJavaTypeName.substring(lastDot + 1);
}
@@ -441,7 +442,7 @@ public class HeavyweightOperationInfoBui
//
// Build JaxRpcParameterInfo
//
- JaxRpcParameterInfo parameterInfo = new JaxRpcParameterInfo();
+ final JaxRpcParameterInfo parameterInfo = new JaxRpcParameterInfo();
parameterInfo.qname = paramQName;
parameterInfo.xmlType = paramXmlType;
parameterInfo.javaType = paramJavaType;
@@ -457,7 +458,7 @@ public class HeavyweightOperationInfoBui
}
// verify mapped return value qname matches expected output message name
- WsdlReturnValueMapping wsdlReturnValueMapping = methodMapping.getWsdlReturnValueMapping();
+ final WsdlReturnValueMapping wsdlReturnValueMapping = methodMapping.getWsdlReturnValueMapping();
if (!wsdlReturnValueMapping.getWsdlMessage().equals(outputMessage.getQName())) {
throw new OpenEJBException("OutputMessage has QName: " + outputMessage.getQName() + " but mapping specifies: " + wsdlReturnValueMapping.getWsdlMessage() + " for operation " + operationName);
}
@@ -468,19 +469,19 @@ public class HeavyweightOperationInfoBui
QName returnQName = null;
QName returnXmlType = null;
if (wsdlReturnValueMapping.getWsdlMessagePartName() != null) {
- String wsdlMessagePartName = wsdlReturnValueMapping.getWsdlMessagePartName();
+ final String wsdlMessagePartName = wsdlReturnValueMapping.getWsdlMessagePartName();
if (outParamNames.contains(wsdlMessagePartName)) {
throw new OpenEJBException("output message part " + wsdlMessagePartName + " has both an INOUT or OUT mapping and a return value mapping for operation " + operationName);
}
if (bindingStyle.isWrapped()) {
- Part outPart = getWrappedPart(outputMessage);
- XmlElementInfo returnParticle = getWrapperChild(outPart, wsdlMessagePartName);
+ final Part outPart = getWrappedPart(outputMessage);
+ final XmlElementInfo returnParticle = getWrapperChild(outPart, wsdlMessagePartName);
returnQName = new QName("", returnParticle.qname.getLocalPart());
returnXmlType = returnParticle.xmlType;
} else if (bindingStyle.isRpc()) {
- Part part = outputMessage.getPart(wsdlMessagePartName);
+ final Part part = outputMessage.getPart(wsdlMessagePartName);
if (part == null) {
throw new OpenEJBException("No part for wsdlMessagePartName " + wsdlMessagePartName + " in output message for operation " + operationName);
}
@@ -490,7 +491,7 @@ public class HeavyweightOperationInfoBui
// RPC can only use type
returnXmlType = part.getTypeName();
} else {
- Part part = outputMessage.getPart(wsdlMessagePartName);
+ final Part part = outputMessage.getPart(wsdlMessagePartName);
if (part == null) {
throw new OpenEJBException("No part for wsdlMessagePartName " + wsdlMessagePartName + " in output message for operation " + operationName);
}
@@ -509,9 +510,9 @@ public class HeavyweightOperationInfoBui
operationInfo.returnJavaType = wsdlReturnValueMapping.getMethodReturnValue();
}
- private JaxRpcFaultInfo mapFaults(Fault fault) throws OpenEJBException {
- Message message = fault.getMessage();
- ExceptionMapping exceptionMapping = mapping.getExceptionMappingMap().get(message.getQName());
+ private JaxRpcFaultInfo mapFaults(final Fault fault) throws OpenEJBException {
+ final Message message = fault.getMessage();
+ final ExceptionMapping exceptionMapping = mapping.getExceptionMappingMap().get(message.getQName());
if (exceptionMapping == null) {
throw new OpenEJBException("No exception mapping for fault " + fault.getName() + " and fault message " + message.getQName() + " for operation " + operationName);
}
@@ -519,20 +520,20 @@ public class HeavyweightOperationInfoBui
// TODO investigate whether there are other cases in which the namespace of faultQName can be determined.
// this is weird, but I can't figure out what it should be.
// if part has an element rather than a type, it should be part.getElementName() (see below)
- Part part;
+ final Part part;
if (exceptionMapping.getWsdlMessagePartName() != null) {
// According to schema documentation, this will only be set when several headerfaults use the same message.
- String headerFaultMessagePartName = exceptionMapping.getWsdlMessagePartName();
+ final String headerFaultMessagePartName = exceptionMapping.getWsdlMessagePartName();
part = message.getPart(headerFaultMessagePartName);
} else {
part = (Part) message.getOrderedParts(null).iterator().next();
}
// Determine the fault qname and xml schema type
- QName faultQName;
- XmlTypeInfo faultTypeInfo;
+ final QName faultQName;
+ final XmlTypeInfo faultTypeInfo;
if (part.getElementName() != null) {
- XmlElementInfo elementInfo = schemaInfo.elements.get(part.getElementName());
+ final XmlElementInfo elementInfo = schemaInfo.elements.get(part.getElementName());
if (elementInfo == null) {
throw new OpenEJBException("Can not find element: " + part.getElementName() + ", known elements: " + schemaInfo.elements.keySet());
}
@@ -556,7 +557,7 @@ public class HeavyweightOperationInfoBui
//
// Build the fault info
//
- JaxRpcFaultInfo faultInfo = new JaxRpcFaultInfo();
+ final JaxRpcFaultInfo faultInfo = new JaxRpcFaultInfo();
faultInfo.qname = faultQName;
faultInfo.xmlType = faultTypeInfo.qname;
faultInfo.javaType = exceptionMapping.getExceptionType();
@@ -570,24 +571,24 @@ public class HeavyweightOperationInfoBui
throw new OpenEJBException("ConstructorParameterOrder can only be set for complex types, not " + faultTypeInfo.qname);
}
- Map<String, XmlElementInfo> elements = new HashMap<String, XmlElementInfo>();
- for (XmlElementInfo element : faultTypeInfo.elements.values()) {
+ final Map<String, XmlElementInfo> elements = new HashMap<String, XmlElementInfo>();
+ for (final XmlElementInfo element : faultTypeInfo.elements.values()) {
elements.put(element.qname.getLocalPart(), element);
}
- ConstructorParameterOrder constructorParameterOrder = exceptionMapping.getConstructorParameterOrder();
+ final ConstructorParameterOrder constructorParameterOrder = exceptionMapping.getConstructorParameterOrder();
for (int i = 0; i < constructorParameterOrder.getElementName().size(); i++) {
- String paramName = constructorParameterOrder.getElementName().get(i);
+ final String paramName = constructorParameterOrder.getElementName().get(i);
// get the parameter element
- XmlElementInfo paramElementInfo = elements.get(paramName);
+ final XmlElementInfo paramElementInfo = elements.get(paramName);
if (paramElementInfo == null) {
throw new OpenEJBException("Can not find element " + paramName + " in fault type " + faultTypeInfo.qname + ", known elements: " + elements.keySet());
}
// Java Type
String paramJavaType = null;
- XmlTypeInfo paramTypeInfo = schemaInfo.types.get(paramElementInfo.xmlType);
+ final XmlTypeInfo paramTypeInfo = schemaInfo.types.get(paramElementInfo.xmlType);
if (paramTypeInfo != null) {
if (paramTypeInfo.anonymous) {
paramJavaType = anonymousTypes.get(paramTypeInfo.qname.getLocalPart());
@@ -603,7 +604,7 @@ public class HeavyweightOperationInfoBui
throw new OpenEJBException("No class mapped for element type: " + paramElementInfo.xmlType);
}
- JaxRpcParameterInfo parameterInfo = new JaxRpcParameterInfo();
+ final JaxRpcParameterInfo parameterInfo = new JaxRpcParameterInfo();
parameterInfo.qname = paramElementInfo.qname;
parameterInfo.mode = Mode.OUT;
// todo could be a soap header
@@ -618,40 +619,40 @@ public class HeavyweightOperationInfoBui
}
- private QName getPartName(Part part) {
+ private QName getPartName(final Part part) {
return part.getElementName() == null ? part.getTypeName() : part.getElementName();
}
- private Part getWrappedPart(Message message) throws OpenEJBException {
+ private Part getWrappedPart(final Message message) throws OpenEJBException {
// a wrapped element can only have one part
- Collection parts = message.getParts().values();
+ final Collection parts = message.getParts().values();
if (parts.size() != 1) {
throw new OpenEJBException("message " + message.getQName() + " has " + parts.size() +
- " parts and should only have one as wrapper style mapping is specified for operation " +
- operationName);
+ " parts and should only have one as wrapper style mapping is specified for operation " +
+ operationName);
}
return (Part) parts.iterator().next();
}
- private XmlElementInfo getWrapperChild(Part part, String wsdlMessagePartName) throws OpenEJBException {
+ private XmlElementInfo getWrapperChild(final Part part, final String wsdlMessagePartName) throws OpenEJBException {
// get the part name
- QName elementName = part.getElementName();
+ final QName elementName = part.getElementName();
wrapperElementQNames.add(elementName);
// get the wrapper element
- XmlElementInfo wrapperElement = schemaInfo.elements.get(elementName);
+ final XmlElementInfo wrapperElement = schemaInfo.elements.get(elementName);
if (wrapperElement == null) {
throw new OpenEJBException("No global element named " + elementName + " for operation " + operationName);
}
// get the wrapper type
- XmlTypeInfo wrapperType = schemaInfo.types.get(wrapperElement.xmlType);
+ final XmlTypeInfo wrapperType = schemaInfo.types.get(wrapperElement.xmlType);
if (wrapperType == null) {
throw new OpenEJBException("Can not find type " + wrapperElement.xmlType + " for element " + wrapperElement.qname + ", known types: " + schemaInfo.types.keySet());
}
// get the part type
- for (XmlElementInfo wrapperChild : wrapperType.elements.values()) {
+ for (final XmlElementInfo wrapperChild : wrapperType.elements.values()) {
if (wrapperChild.qname.getLocalPart().equals(wsdlMessagePartName)) {
return wrapperChild;
}
@@ -689,9 +690,9 @@ public class HeavyweightOperationInfoBui
/**
* Supporting the Document/Literal Wrapped pattern
- *
+ * <p/>
* See http://www-106.ibm.com/developerworks/webservices/library/ws-whichwsdl/ for a nice explanation and example
- *
+ * <p/>
* wrapped-element tag is used
* WSDL message with a single part
* part uses the 'element' attribute to point to an elemement in the types section
@@ -699,7 +700,7 @@ public class HeavyweightOperationInfoBui
*/
// standard holder classes by type
- private static final Map<String,String> rpcHolderClasses = new HashMap<String, String>();
+ private static final Map<String, String> rpcHolderClasses = new HashMap<String, String>();
static {
rpcHolderClasses.put(BigDecimal.class.getName(), BigDecimalHolder.class.getName());
Modified: tomee/tomee/branches/tomee-1.7.x/server/openejb-axis/src/main/java/org/apache/openejb/server/axis/assembler/HeavyweightTypeInfoBuilder.java
URL: http://svn.apache.org/viewvc/tomee/tomee/branches/tomee-1.7.x/server/openejb-axis/src/main/java/org/apache/openejb/server/axis/assembler/HeavyweightTypeInfoBuilder.java?rev=1611274&r1=1611273&r2=1611274&view=diff
==============================================================================
--- tomee/tomee/branches/tomee-1.7.x/server/openejb-axis/src/main/java/org/apache/openejb/server/axis/assembler/HeavyweightTypeInfoBuilder.java (original)
+++ tomee/tomee/branches/tomee-1.7.x/server/openejb-axis/src/main/java/org/apache/openejb/server/axis/assembler/HeavyweightTypeInfoBuilder.java Thu Jul 17 07:52:58 2014
@@ -23,6 +23,7 @@ import org.apache.openejb.OpenEJBExcepti
import org.apache.openejb.jee.JavaWsdlMapping;
import org.apache.openejb.jee.JavaXmlTypeMapping;
import org.apache.openejb.jee.VariableMapping;
+
import static org.apache.openejb.server.axis.assembler.JaxRpcTypeInfo.SerializerType;
import javax.xml.namespace.QName;
@@ -54,7 +55,7 @@ public class HeavyweightTypeInfoBuilder
private final Collection<JaxRpcOperationInfo> operations;
private final boolean hasEncoded;
- public HeavyweightTypeInfoBuilder(JavaWsdlMapping mapping, XmlSchemaInfo schemaInfo, ClassLoader classLoader, Set wrapperElementQNames, Collection<JaxRpcOperationInfo> operations, boolean hasEncoded) {
+ public HeavyweightTypeInfoBuilder(final JavaWsdlMapping mapping, final XmlSchemaInfo schemaInfo, final ClassLoader classLoader, final Set wrapperElementQNames, final Collection<JaxRpcOperationInfo> operations, final boolean hasEncoded) {
this.mapping = mapping;
this.classLoader = classLoader;
this.schemaInfo = schemaInfo;
@@ -63,17 +64,17 @@ public class HeavyweightTypeInfoBuilder
this.hasEncoded = hasEncoded;
}
- public List<JaxRpcTypeInfo> buildTypeInfo() throws OpenEJBException {
- List<JaxRpcTypeInfo> typeInfos = new ArrayList<JaxRpcTypeInfo>();
+ public List<JaxRpcTypeInfo> buildTypeInfo() throws OpenEJBException {
+ final List<JaxRpcTypeInfo> typeInfos = new ArrayList<JaxRpcTypeInfo>();
- Set<QName> mappedTypeQNames = new HashSet<QName>();
+ final Set<QName> mappedTypeQNames = new HashSet<QName>();
//
// Map types with explicity Java to XML mappings
//
- for (JavaXmlTypeMapping javaXmlTypeMapping : mapping.getJavaXmlTypeMapping()) {
+ for (final JavaXmlTypeMapping javaXmlTypeMapping : mapping.getJavaXmlTypeMapping()) {
// get the QName for this mapping
- QName qname;
+ final QName qname;
if (javaXmlTypeMapping.getRootTypeQname() != null) {
qname = javaXmlTypeMapping.getRootTypeQname();
@@ -82,15 +83,15 @@ public class HeavyweightTypeInfoBuilder
continue;
}
} else if (javaXmlTypeMapping.getAnonymousTypeQname() != null) {
- String anonTypeQNameString = javaXmlTypeMapping.getAnonymousTypeQname();
+ final String anonTypeQNameString = javaXmlTypeMapping.getAnonymousTypeQname();
// this appears to be ignored...
- int pos = anonTypeQNameString.lastIndexOf(":");
+ final int pos = anonTypeQNameString.lastIndexOf(":");
if (pos == -1) {
throw new OpenEJBException("anon QName is invalid, no final ':' " + anonTypeQNameString);
}
- String namespace = anonTypeQNameString.substring(0, pos);
- String localPart = anonTypeQNameString.substring(pos + 1);
+ final String namespace = anonTypeQNameString.substring(0, pos);
+ final String localPart = anonTypeQNameString.substring(pos + 1);
qname = new QName(namespace, localPart);
// Skip the wrapper elements.
@@ -103,9 +104,9 @@ public class HeavyweightTypeInfoBuilder
}
// get the xml type qname of this mapping
- QName xmlTypeQName;
+ final QName xmlTypeQName;
if ("element".equals(javaXmlTypeMapping.getQNameScope())) {
- XmlElementInfo elementInfo = schemaInfo.elements.get(qname);
+ final XmlElementInfo elementInfo = schemaInfo.elements.get(qname);
if (elementInfo == null) {
log.warn("Element [" + qname + "] not been found in schema, known elements: " + schemaInfo.elements.keySet());
}
@@ -115,7 +116,7 @@ public class HeavyweightTypeInfoBuilder
}
// finally, get the xml type info for the mapping
- XmlTypeInfo xmlTypeInfo = schemaInfo.types.get(xmlTypeQName);
+ final XmlTypeInfo xmlTypeInfo = schemaInfo.types.get(xmlTypeQName);
if (xmlTypeInfo == null) {
// if this is a built in type then assume this is a redundant mapping
if (WebserviceNameSpaces.contains(xmlTypeInfo.qname.getNamespaceURI())) {
@@ -129,15 +130,15 @@ public class HeavyweightTypeInfoBuilder
mappedTypeQNames.add(xmlTypeInfo.qname);
// load the java class
- Class clazz;
+ final Class clazz;
try {
clazz = Class.forName(javaXmlTypeMapping.getJavaType(), false, classLoader);
- } catch (ClassNotFoundException e) {
+ } catch (final ClassNotFoundException e) {
throw new OpenEJBException("Could not load java type " + javaXmlTypeMapping.getJavaType(), e);
}
// create the jax-rpc type mapping
- JaxRpcTypeInfo typeInfo = createTypeInfo(qname, xmlTypeInfo, clazz);
+ final JaxRpcTypeInfo typeInfo = createTypeInfo(qname, xmlTypeInfo, clazz);
mapFields(clazz, xmlTypeInfo, javaXmlTypeMapping, typeInfo);
typeInfos.add(typeInfo);
@@ -146,31 +147,31 @@ public class HeavyweightTypeInfoBuilder
//
// Map types used in operations
//
- for (JaxRpcOperationInfo operationInfo : operations) {
- List<JaxRpcParameterInfo> parameters = new ArrayList<JaxRpcParameterInfo>(operationInfo.parameters);
+ for (final JaxRpcOperationInfo operationInfo : operations) {
+ final List<JaxRpcParameterInfo> parameters = new ArrayList<JaxRpcParameterInfo>(operationInfo.parameters);
// add the return type to the parameters so it is processed below
if (operationInfo.returnXmlType != null) {
- JaxRpcParameterInfo returnParameter = new JaxRpcParameterInfo();
+ final JaxRpcParameterInfo returnParameter = new JaxRpcParameterInfo();
returnParameter.xmlType = operationInfo.returnXmlType;
returnParameter.javaType = operationInfo.returnJavaType;
parameters.add(returnParameter);
}
// add type mappings for each parameter (including the return type)
- for (JaxRpcParameterInfo parameterInfo : parameters) {
- QName xmlType = parameterInfo.xmlType;
+ for (final JaxRpcParameterInfo parameterInfo : parameters) {
+ final QName xmlType = parameterInfo.xmlType;
// skip types that have already been mapped or are built in types
if (xmlType == null ||
- mappedTypeQNames.contains(xmlType) ||
- xmlType.getNamespaceURI().equals(XML_SCHEMA_NS) ||
- xmlType.getNamespaceURI().equals(SOAP_ENCODING_NS)) {
+ mappedTypeQNames.contains(xmlType) ||
+ xmlType.getNamespaceURI().equals(XML_SCHEMA_NS) ||
+ xmlType.getNamespaceURI().equals(SOAP_ENCODING_NS)) {
continue;
}
// get the xml type info
- XmlTypeInfo xmlTypeInfo = schemaInfo.types.get(xmlType);
+ final XmlTypeInfo xmlTypeInfo = schemaInfo.types.get(xmlType);
if (xmlTypeInfo == null) {
log.warn("Type QName [" + xmlType + "] defined by operation [" + operationInfo + "] has not been found in schema: " + schemaInfo.types.keySet());
continue;
@@ -178,10 +179,10 @@ public class HeavyweightTypeInfoBuilder
mappedTypeQNames.add(xmlTypeInfo.qname);
// load the java class
- Class<?> clazz;
+ final Class<?> clazz;
try {
clazz = classLoader.loadClass(parameterInfo.javaType);
- } catch (ClassNotFoundException e) {
+ } catch (final ClassNotFoundException e) {
throw new OpenEJBException("Could not load paramter");
}
@@ -195,7 +196,7 @@ public class HeavyweightTypeInfoBuilder
}
// create the jax-rpc type mapping
- JaxRpcTypeInfo typeInfo = createTypeInfo(parameterInfo.qname, xmlTypeInfo, clazz);
+ final JaxRpcTypeInfo typeInfo = createTypeInfo(parameterInfo.qname, xmlTypeInfo, clazz);
typeInfos.add(typeInfo);
}
}
@@ -205,13 +206,14 @@ public class HeavyweightTypeInfoBuilder
/**
* Creates a JaxRpcTypeInfo based on the information contained in the XML Schema Type and Java Class.
+ *
* @param xmlTypeInfo the xml schema for the type
- * @param clazz the java class for the type
+ * @param clazz the java class for the type
* @return the JaxRpcTypeInfo object
* @throws OpenEJBException if the schema is invalid
*/
- private JaxRpcTypeInfo createTypeInfo(QName qname, XmlTypeInfo xmlTypeInfo, Class clazz) throws OpenEJBException {
- SerializerType serializerType;
+ private JaxRpcTypeInfo createTypeInfo(final QName qname, final XmlTypeInfo xmlTypeInfo, final Class clazz) throws OpenEJBException {
+ final SerializerType serializerType;
if (xmlTypeInfo.listType) {
serializerType = SerializerType.LIST;
} else if (clazz.isArray()) {
@@ -222,7 +224,7 @@ public class HeavyweightTypeInfoBuilder
serializerType = SerializerType.OTHER;
}
- JaxRpcTypeInfo typeInfo = new JaxRpcTypeInfo();
+ final JaxRpcTypeInfo typeInfo = new JaxRpcTypeInfo();
typeInfo.qname = qname;
typeInfo.javaType = clazz.getName();
typeInfo.serializerType = serializerType;
@@ -238,13 +240,14 @@ public class HeavyweightTypeInfoBuilder
/**
* Map the (nested) fields of a XML Schema Type to Java Beans properties or public fields of the specified Java Class.
- * @param javaClass the java class to map
- * @param xmlTypeInfo the xml schema for the type
+ *
+ * @param javaClass the java class to map
+ * @param xmlTypeInfo the xml schema for the type
* @param javaXmlTypeMapping the java to xml type mapping metadata
- * @param typeInfo the JaxRpcTypeInfo for this type
+ * @param typeInfo the JaxRpcTypeInfo for this type
* @throws OpenEJBException if the XML Schema Type can not be mapped to the Java Class
*/
- private void mapFields(Class javaClass, XmlTypeInfo xmlTypeInfo, JavaXmlTypeMapping javaXmlTypeMapping, JaxRpcTypeInfo typeInfo) throws OpenEJBException {
+ private void mapFields(final Class javaClass, final XmlTypeInfo xmlTypeInfo, final JavaXmlTypeMapping javaXmlTypeMapping, final JaxRpcTypeInfo typeInfo) throws OpenEJBException {
// Skip arrays since they can't define a variable-mapping element
if (!javaClass.isArray()) {
// if there is a variable-mapping, log a warning
@@ -255,31 +258,31 @@ public class HeavyweightTypeInfoBuilder
}
// Index Java bean properties by name
- Map<String,Class> properties = new HashMap<String,Class>();
+ final Map<String, Class> properties = new HashMap<String, Class>();
try {
- PropertyDescriptor[] propertyDescriptors = Introspector.getBeanInfo(javaClass).getPropertyDescriptors();
- for (PropertyDescriptor propertyDescriptor : propertyDescriptors) {
+ final PropertyDescriptor[] propertyDescriptors = Introspector.getBeanInfo(javaClass).getPropertyDescriptors();
+ for (final PropertyDescriptor propertyDescriptor : propertyDescriptors) {
properties.put(propertyDescriptor.getName(), propertyDescriptor.getPropertyType());
}
- } catch (IntrospectionException e) {
+ } catch (final IntrospectionException e) {
throw new OpenEJBException("Class " + javaClass + " is not a valid javabean", e);
}
- for (VariableMapping variableMapping : javaXmlTypeMapping.getVariableMapping()) {
- String fieldName = variableMapping.getJavaVariableName();
+ for (final VariableMapping variableMapping : javaXmlTypeMapping.getVariableMapping()) {
+ final String fieldName = variableMapping.getJavaVariableName();
if (variableMapping.getXmlAttributeName() != null) {
- JaxRpcFieldInfo fieldInfo = new JaxRpcFieldInfo();
+ final JaxRpcFieldInfo fieldInfo = new JaxRpcFieldInfo();
fieldInfo.name = fieldName;
// verify that the property exists on the java class
- Class javaType = properties.get(fieldName);
+ final Class javaType = properties.get(fieldName);
if (javaType == null) {
throw new OpenEJBException("field name " + fieldName + " not found in " + properties);
}
- String attributeLocalName = variableMapping.getXmlAttributeName();
- QName xmlName = new QName("", attributeLocalName);
+ final String attributeLocalName = variableMapping.getXmlAttributeName();
+ final QName xmlName = new QName("", attributeLocalName);
fieldInfo.xmlName = xmlName;
fieldInfo.xmlType = xmlTypeInfo.attributes.get(attributeLocalName);
@@ -289,7 +292,7 @@ public class HeavyweightTypeInfoBuilder
typeInfo.fields.add(fieldInfo);
} else {
- JaxRpcFieldInfo fieldInfo = new JaxRpcFieldInfo();
+ final JaxRpcFieldInfo fieldInfo = new JaxRpcFieldInfo();
fieldInfo.isElement = true;
fieldInfo.name = fieldName;
@@ -298,9 +301,9 @@ public class HeavyweightTypeInfoBuilder
if (javaType == null) {
//see if it is a public field
try {
- Field field = javaClass.getField(fieldName);
+ final Field field = javaClass.getField(fieldName);
javaType = field.getType();
- } catch (NoSuchFieldException e) {
+ } catch (final NoSuchFieldException e) {
throw new OpenEJBException("field name " + fieldName + " not found in " + properties, e);
}
}
@@ -309,7 +312,7 @@ public class HeavyweightTypeInfoBuilder
QName xmlName = new QName("", variableMapping.getXmlElementName());
XmlElementInfo nestedElement = xmlTypeInfo.elements.get(xmlName);
if (nestedElement == null) {
- String ns = xmlTypeInfo.qname.getNamespaceURI();
+ final String ns = xmlTypeInfo.qname.getNamespaceURI();
xmlName = new QName(ns, variableMapping.getXmlElementName());
nestedElement = xmlTypeInfo.elements.get(xmlName);
if (nestedElement == null) {
@@ -323,13 +326,13 @@ public class HeavyweightTypeInfoBuilder
if (nestedElement.xmlType != null) {
fieldInfo.xmlType = nestedElement.xmlType;
} else {
- QName anonymousName;
+ final QName anonymousName;
if (xmlTypeInfo.anonymous) {
anonymousName = new QName(xmlTypeInfo.qname.getNamespaceURI(), xmlTypeInfo.qname.getLocalPart() +
- ">" + nestedElement.qname.getLocalPart());
+ ">" + nestedElement.qname.getLocalPart());
} else {
anonymousName = new QName(xmlTypeInfo.qname.getNamespaceURI(),
- ">" + xmlTypeInfo.qname.getLocalPart() + ">" + nestedElement.qname.getLocalPart());
+ ">" + xmlTypeInfo.qname.getLocalPart() + ">" + nestedElement.qname.getLocalPart());
}
fieldInfo.xmlType = anonymousName;
}
@@ -348,12 +351,12 @@ public class HeavyweightTypeInfoBuilder
* All of the known built in XML Schemas used by webservices. This is used to supress unknown type exceptions
*/
private static final Set<String> WebserviceNameSpaces = Collections.unmodifiableSet(new LinkedHashSet<String>(Arrays.asList(
- "http://schemas.xmlsoap.org/soap/encoding/", // SOAP 1.1
- "http://www.w3.org/2003/05/soap-encoding", // SOAP 1.2
- "http://xml.apache.org/xml-soap", // Apache XMLSOAP
- "http://www.w3.org/1999/XMLSchema", // XSD 1999
- "http://www.w3.org/2000/10/XMLSchema", // XSD 2000
- "http://www.w3.org/2001/XMLSchema", // XSD 2001
- "http://www.w3.org/XML/1998/namespace" // XML (for xml-any)
+ "http://schemas.xmlsoap.org/soap/encoding/", // SOAP 1.1
+ "http://www.w3.org/2003/05/soap-encoding", // SOAP 1.2
+ "http://xml.apache.org/xml-soap", // Apache XMLSOAP
+ "http://www.w3.org/1999/XMLSchema", // XSD 1999
+ "http://www.w3.org/2000/10/XMLSchema", // XSD 2000
+ "http://www.w3.org/2001/XMLSchema", // XSD 2001
+ "http://www.w3.org/XML/1998/namespace" // XML (for xml-any)
)));
}
Modified: tomee/tomee/branches/tomee-1.7.x/server/openejb-axis/src/main/java/org/apache/openejb/server/axis/assembler/JaxRpcParameterInfo.java
URL: http://svn.apache.org/viewvc/tomee/tomee/branches/tomee-1.7.x/server/openejb-axis/src/main/java/org/apache/openejb/server/axis/assembler/JaxRpcParameterInfo.java?rev=1611274&r1=1611273&r2=1611274&view=diff
==============================================================================
--- tomee/tomee/branches/tomee-1.7.x/server/openejb-axis/src/main/java/org/apache/openejb/server/axis/assembler/JaxRpcParameterInfo.java (original)
+++ tomee/tomee/branches/tomee-1.7.x/server/openejb-axis/src/main/java/org/apache/openejb/server/axis/assembler/JaxRpcParameterInfo.java Thu Jul 17 07:52:58 2014
@@ -34,7 +34,7 @@ public class JaxRpcParameterInfo {
private boolean in;
private boolean out;
- Mode(boolean in, boolean out) {
+ Mode(final boolean in, final boolean out) {
this.in = in;
this.out = out;
}
@@ -43,7 +43,7 @@ public class JaxRpcParameterInfo {
return in;
}
- public void setIn(boolean in) {
+ public void setIn(final boolean in) {
this.in = in;
}
@@ -51,7 +51,7 @@ public class JaxRpcParameterInfo {
return out;
}
- public void setOut(boolean out) {
+ public void setOut(final boolean out) {
this.out = out;
}
}
Modified: tomee/tomee/branches/tomee-1.7.x/server/openejb-axis/src/main/java/org/apache/openejb/server/axis/assembler/JaxRpcServiceInfoBuilder.java
URL: http://svn.apache.org/viewvc/tomee/tomee/branches/tomee-1.7.x/server/openejb-axis/src/main/java/org/apache/openejb/server/axis/assembler/JaxRpcServiceInfoBuilder.java?rev=1611274&r1=1611273&r2=1611274&view=diff
==============================================================================
--- tomee/tomee/branches/tomee-1.7.x/server/openejb-axis/src/main/java/org/apache/openejb/server/axis/assembler/JaxRpcServiceInfoBuilder.java (original)
+++ tomee/tomee/branches/tomee-1.7.x/server/openejb-axis/src/main/java/org/apache/openejb/server/axis/assembler/JaxRpcServiceInfoBuilder.java Thu Jul 17 07:52:58 2014
@@ -47,7 +47,7 @@ public class JaxRpcServiceInfoBuilder {
private final ClassLoader classLoader;
private JaxRpcServiceInfo serviceInfo;
- public JaxRpcServiceInfoBuilder(JavaWsdlMapping javaWsdlMapping, XmlSchemaInfo schemaInfo, PortComponent portComponent, Port port, String wsdlFile, ClassLoader classLoader) {
+ public JaxRpcServiceInfoBuilder(final JavaWsdlMapping javaWsdlMapping, final XmlSchemaInfo schemaInfo, final PortComponent portComponent, final Port port, final String wsdlFile, final ClassLoader classLoader) {
this.javaWsdlMapping = javaWsdlMapping;
this.schemaInfo = schemaInfo;
this.portComponent = portComponent;
@@ -57,10 +57,10 @@ public class JaxRpcServiceInfoBuilder {
}
public JaxRpcServiceInfo createServiceInfo() throws OpenEJBException {
- Class serviceEndpointInterface;
+ final Class serviceEndpointInterface;
try {
serviceEndpointInterface = classLoader.loadClass(portComponent.getServiceEndpointInterface());
- } catch (ClassNotFoundException e) {
+ } catch (final ClassNotFoundException e) {
throw new OpenEJBException("Unable to load the service-endpoint interface for port-component " + portComponent.getPortComponentName(), e);
}
@@ -72,22 +72,22 @@ public class JaxRpcServiceInfoBuilder {
serviceInfo.defaultBindingStyle = getStyle(port.getBinding());
// The service is using lightweight mappings if there are no Java to XML service mappings
- boolean isLightweight = javaWsdlMapping.getServiceEndpointInterfaceMapping().isEmpty();
+ final boolean isLightweight = javaWsdlMapping.getServiceEndpointInterfaceMapping().isEmpty();
//
// Map Operations
//
- Set wrapperElementQNames = buildOperations(port.getBinding(), serviceEndpointInterface, isLightweight);
+ final Set wrapperElementQNames = buildOperations(port.getBinding(), serviceEndpointInterface, isLightweight);
//
// Map Types
//
- Collection<JaxRpcTypeInfo> types;
+ final Collection<JaxRpcTypeInfo> types;
if (isLightweight) {
- LightweightTypeInfoBuilder builder = new LightweightTypeInfoBuilder(javaWsdlMapping, schemaInfo, classLoader);
+ final LightweightTypeInfoBuilder builder = new LightweightTypeInfoBuilder(javaWsdlMapping, schemaInfo, classLoader);
types = builder.buildTypeInfo();
} else {
- HeavyweightTypeInfoBuilder builder = new HeavyweightTypeInfoBuilder(javaWsdlMapping, schemaInfo, classLoader, wrapperElementQNames, serviceInfo.operations, serviceInfo.defaultBindingStyle.isEncoded());
+ final HeavyweightTypeInfoBuilder builder = new HeavyweightTypeInfoBuilder(javaWsdlMapping, schemaInfo, classLoader, wrapperElementQNames, serviceInfo.operations, serviceInfo.defaultBindingStyle.isEncoded());
types = builder.buildTypeInfo();
}
serviceInfo.types.addAll(types);
@@ -95,33 +95,33 @@ public class JaxRpcServiceInfoBuilder {
return serviceInfo;
}
- private Set<QName> buildOperations(Binding binding, Class serviceEndpointInterface, boolean lightweight) throws OpenEJBException {
- Set<QName> wrappedElementQNames = new HashSet<QName>();
+ private Set<QName> buildOperations(final Binding binding, final Class serviceEndpointInterface, final boolean lightweight) throws OpenEJBException {
+ final Set<QName> wrappedElementQNames = new HashSet<QName>();
- for (Object op : binding.getBindingOperations()) {
- BindingOperation bindingOperation = (BindingOperation) op;
- String operationName = bindingOperation.getOperation().getName();
+ for (final Object op : binding.getBindingOperations()) {
+ final BindingOperation bindingOperation = (BindingOperation) op;
+ final String operationName = bindingOperation.getOperation().getName();
if (lightweight) {
// Lightweight mappings are solely based on the Java method
- Method method = getMethodForOperation(operationName, serviceEndpointInterface);
+ final Method method = getMethodForOperation(operationName, serviceEndpointInterface);
// Build the operation info using the method
- LightweightOperationInfoBuilder operationInfoBuilder = new LightweightOperationInfoBuilder(bindingOperation, method);
- JaxRpcOperationInfo operationInfo = operationInfoBuilder.buildOperationInfo();
+ final LightweightOperationInfoBuilder operationInfoBuilder = new LightweightOperationInfoBuilder(bindingOperation, method);
+ final JaxRpcOperationInfo operationInfo = operationInfoBuilder.buildOperationInfo();
serviceInfo.operations.add(operationInfo);
} else {
// Heavyweight mappings are solely based on the Java to XML mapping declarations
- ServiceEndpointMethodMapping methodMapping = getMethodMappingForOperation(operationName, serviceEndpointInterface);
+ final ServiceEndpointMethodMapping methodMapping = getMethodMappingForOperation(operationName, serviceEndpointInterface);
// Build the operation info using the Java to XML method mapping
- HeavyweightOperationInfoBuilder operationInfoBuilder = new HeavyweightOperationInfoBuilder(bindingOperation, methodMapping, javaWsdlMapping, schemaInfo);
- JaxRpcOperationInfo operationInfo = operationInfoBuilder.buildOperationInfo();
+ final HeavyweightOperationInfoBuilder operationInfoBuilder = new HeavyweightOperationInfoBuilder(bindingOperation, methodMapping, javaWsdlMapping, schemaInfo);
+ final JaxRpcOperationInfo operationInfo = operationInfoBuilder.buildOperationInfo();
serviceInfo.operations.add(operationInfo);
// remember wrapped elements for type mapping
- Set<QName> wrappedElementQNamesForOper = operationInfoBuilder.getWrapperElementQNames();
+ final Set<QName> wrappedElementQNamesForOper = operationInfoBuilder.getWrapperElementQNames();
wrappedElementQNames.addAll(wrappedElementQNamesForOper);
}
}
@@ -129,27 +129,27 @@ public class JaxRpcServiceInfoBuilder {
return wrappedElementQNames;
}
- private BindingStyle getStyle(Binding binding) throws OpenEJBException {
- SOAPBinding soapBinding = getExtensibilityElement(SOAPBinding.class, binding.getExtensibilityElements());
- String styleString = soapBinding.getStyle();
-
- BindingInput bindingInput = ((BindingOperation) binding.getBindingOperations().get(0)).getBindingInput();
- SOAPBody soapBody = getExtensibilityElement(SOAPBody.class, bindingInput.getExtensibilityElements());
- String useString = soapBody.getUse();
+ private BindingStyle getStyle(final Binding binding) throws OpenEJBException {
+ final SOAPBinding soapBinding = getExtensibilityElement(SOAPBinding.class, binding.getExtensibilityElements());
+ final String styleString = soapBinding.getStyle();
+
+ final BindingInput bindingInput = ((BindingOperation) binding.getBindingOperations().get(0)).getBindingInput();
+ final SOAPBody soapBody = getExtensibilityElement(SOAPBody.class, bindingInput.getExtensibilityElements());
+ final String useString = soapBody.getUse();
- BindingStyle bindingStyle = BindingStyle.getBindingStyle(styleString, useString);
+ final BindingStyle bindingStyle = BindingStyle.getBindingStyle(styleString, useString);
return bindingStyle;
}
- private String getAddressLocation(List extensibilityElements) throws OpenEJBException {
- SOAPAddress soapAddress = getExtensibilityElement(SOAPAddress.class, extensibilityElements);
- String locationURIString = soapAddress.getLocationURI();
+ private String getAddressLocation(final List extensibilityElements) throws OpenEJBException {
+ final SOAPAddress soapAddress = getExtensibilityElement(SOAPAddress.class, extensibilityElements);
+ final String locationURIString = soapAddress.getLocationURI();
return locationURIString;
}
- private Method getMethodForOperation(String operationName, Class serviceEndpointInterface) throws OpenEJBException {
+ private Method getMethodForOperation(final String operationName, final Class serviceEndpointInterface) throws OpenEJBException {
Method found = null;
- for (Method method : serviceEndpointInterface.getMethods()) {
+ for (final Method method : serviceEndpointInterface.getMethods()) {
if (method.getName().equals(operationName)) {
if (found != null) {
throw new OpenEJBException("Overloaded methods are not allowed in lightweight mappings");
@@ -163,32 +163,32 @@ public class JaxRpcServiceInfoBuilder {
return found;
}
- private ServiceEndpointMethodMapping getMethodMappingForOperation(String operationName, Class serviceEndpointInterface) throws OpenEJBException {
+ private ServiceEndpointMethodMapping getMethodMappingForOperation(final String operationName, final Class serviceEndpointInterface) throws OpenEJBException {
// get mapping for service endpoint interface
- ServiceEndpointInterfaceMapping interfaceMapping = javaWsdlMapping.getServiceEndpointInterfaceMappingMap().get(serviceEndpointInterface.getName());
+ final ServiceEndpointInterfaceMapping interfaceMapping = javaWsdlMapping.getServiceEndpointInterfaceMappingMap().get(serviceEndpointInterface.getName());
if (interfaceMapping == null) {
throw new OpenEJBException("No java-wsdl mapping found for the service interface " + serviceEndpointInterface);
}
// match by operation name
- for (ServiceEndpointMethodMapping methodMapping : interfaceMapping.getServiceEndpointMethodMapping()) {
+ for (final ServiceEndpointMethodMapping methodMapping : interfaceMapping.getServiceEndpointMethodMapping()) {
if (operationName.equals(methodMapping.getWsdlOperation())) {
return methodMapping;
}
}
// failed - throw nice exception message
- StringBuffer availOps = new StringBuffer(128);
- for (ServiceEndpointMethodMapping methodMapping : interfaceMapping.getServiceEndpointMethodMapping()) {
+ final StringBuffer availOps = new StringBuffer(128);
+ for (final ServiceEndpointMethodMapping methodMapping : interfaceMapping.getServiceEndpointMethodMapping()) {
if (availOps.length() > 0) availOps.append(",");
availOps.append(methodMapping.getWsdlOperation());
}
throw new OpenEJBException("No method found for operation named '" + operationName + "'. Available operations: " + availOps);
}
- public static <T extends ExtensibilityElement> T getExtensibilityElement(Class<T> clazz, List extensibilityElements) throws OpenEJBException {
- for (Object o : extensibilityElements) {
- ExtensibilityElement extensibilityElement = (ExtensibilityElement) o;
+ public static <T extends ExtensibilityElement> T getExtensibilityElement(final Class<T> clazz, final List extensibilityElements) throws OpenEJBException {
+ for (final Object o : extensibilityElements) {
+ final ExtensibilityElement extensibilityElement = (ExtensibilityElement) o;
if (clazz.isAssignableFrom(extensibilityElement.getClass())) {
return clazz.cast(extensibilityElement);
}
Modified: tomee/tomee/branches/tomee-1.7.x/server/openejb-axis/src/main/java/org/apache/openejb/server/axis/assembler/LightweightOperationInfoBuilder.java
URL: http://svn.apache.org/viewvc/tomee/tomee/branches/tomee-1.7.x/server/openejb-axis/src/main/java/org/apache/openejb/server/axis/assembler/LightweightOperationInfoBuilder.java?rev=1611274&r1=1611273&r2=1611274&view=diff
==============================================================================
--- tomee/tomee/branches/tomee-1.7.x/server/openejb-axis/src/main/java/org/apache/openejb/server/axis/assembler/LightweightOperationInfoBuilder.java (original)
+++ tomee/tomee/branches/tomee-1.7.x/server/openejb-axis/src/main/java/org/apache/openejb/server/axis/assembler/LightweightOperationInfoBuilder.java Thu Jul 17 07:52:58 2014
@@ -35,12 +35,12 @@ public class LightweightOperationInfoBui
private JaxRpcOperationInfo operationInfo;
- public LightweightOperationInfoBuilder(BindingOperation bindingOperation, Method method) throws OpenEJBException{
+ public LightweightOperationInfoBuilder(final BindingOperation bindingOperation, final Method method) throws OpenEJBException {
if (bindingOperation == null) {
throw new OpenEJBException("No BindingOperation supplied for method " + method.getName());
}
- Operation operation = bindingOperation.getOperation();
+ final Operation operation = bindingOperation.getOperation();
this.operationName = operation.getName();
this.inputMessage = operation.getInput().getMessage();
this.outputMessage = operation.getOutput() == null ? null : operation.getOutput().getMessage();
@@ -58,18 +58,18 @@ public class LightweightOperationInfoBui
operationInfo.javaMethodName = method.getName();
// Verify we have the right number of args for this method
- Class[] methodParamTypes = method.getParameterTypes();
- List inputParts = inputMessage.getOrderedParts(null);
+ final Class[] methodParamTypes = method.getParameterTypes();
+ final List inputParts = inputMessage.getOrderedParts(null);
if (methodParamTypes.length != inputParts.size()) {
throw new OpenEJBException("mismatch in parameter counts: method has " + methodParamTypes.length + " whereas the input message has " + inputParts.size());
}
// Map parameters
int i = 0;
- for (Object inputPart : inputParts) {
- Part part = (Part) inputPart;
+ for (final Object inputPart : inputParts) {
+ final Part part = (Part) inputPart;
- JaxRpcParameterInfo parameter = new JaxRpcParameterInfo();
+ final JaxRpcParameterInfo parameter = new JaxRpcParameterInfo();
parameter.qname = new QName("", part.getName());
parameter.mode = JaxRpcParameterInfo.Mode.IN;
@@ -92,7 +92,7 @@ public class LightweightOperationInfoBui
// Map return type mapping
if (outputMessage != null && outputMessage.getParts().size() == 1) {
- Part part = (Part) outputMessage.getParts().values().iterator().next();
+ final Part part = (Part) outputMessage.getParts().values().iterator().next();
// return qname
if (part.getElementName() == null) {
Modified: tomee/tomee/branches/tomee-1.7.x/server/openejb-axis/src/main/java/org/apache/openejb/server/axis/assembler/LightweightTypeInfoBuilder.java
URL: http://svn.apache.org/viewvc/tomee/tomee/branches/tomee-1.7.x/server/openejb-axis/src/main/java/org/apache/openejb/server/axis/assembler/LightweightTypeInfoBuilder.java?rev=1611274&r1=1611273&r2=1611274&view=diff
==============================================================================
--- tomee/tomee/branches/tomee-1.7.x/server/openejb-axis/src/main/java/org/apache/openejb/server/axis/assembler/LightweightTypeInfoBuilder.java (original)
+++ tomee/tomee/branches/tomee-1.7.x/server/openejb-axis/src/main/java/org/apache/openejb/server/axis/assembler/LightweightTypeInfoBuilder.java Thu Jul 17 07:52:58 2014
@@ -35,27 +35,27 @@ public class LightweightTypeInfoBuilder
private final XmlSchemaInfo schemaInfo;
private final ClassLoader classLoader;
- public LightweightTypeInfoBuilder(JavaWsdlMapping mapping, XmlSchemaInfo schemaInfo, ClassLoader classLoader) {
+ public LightweightTypeInfoBuilder(final JavaWsdlMapping mapping, final XmlSchemaInfo schemaInfo, final ClassLoader classLoader) {
this.mapping = mapping;
this.classLoader = classLoader;
this.schemaInfo = schemaInfo;
}
public List<JaxRpcTypeInfo> buildTypeInfo() throws OpenEJBException {
- List<JaxRpcTypeInfo> typeInfoList = new ArrayList<JaxRpcTypeInfo>();
+ final List<JaxRpcTypeInfo> typeInfoList = new ArrayList<JaxRpcTypeInfo>();
- for (XmlTypeInfo xmlTypeInfo : schemaInfo.types.values()) {
+ for (final XmlTypeInfo xmlTypeInfo : schemaInfo.types.values()) {
// skip anonymous elements
if (!xmlTypeInfo.anonymous) {
- QName typeQName = xmlTypeInfo.qname;
- Class clazz = loadClass(typeQName, mapping);
+ final QName typeQName = xmlTypeInfo.qname;
+ final Class clazz = loadClass(typeQName, mapping);
JaxRpcTypeInfo.SerializerType serializerType = JaxRpcTypeInfo.SerializerType.OTHER;
if (clazz.isArray()) {
serializerType = JaxRpcTypeInfo.SerializerType.ARRAY;
}
- JaxRpcTypeInfo typeInfo = new JaxRpcTypeInfo();
+ final JaxRpcTypeInfo typeInfo = new JaxRpcTypeInfo();
typeInfo.qname = typeQName;
typeInfo.javaType = clazz.getName();
typeInfo.serializerType = serializerType;
@@ -70,26 +70,26 @@ public class LightweightTypeInfoBuilder
return typeInfoList;
}
- private void mapFields(Class javaClass, XmlTypeInfo xmlTypeInfo, JaxRpcTypeInfo typeInfo) throws OpenEJBException {
+ private void mapFields(final Class javaClass, final XmlTypeInfo xmlTypeInfo, final JaxRpcTypeInfo typeInfo) throws OpenEJBException {
// Map JavaBean property name to propertyType
- Map<String, Class> propertyToClass = new HashMap<String, Class>();
+ final Map<String, Class> propertyToClass = new HashMap<String, Class>();
try {
- for (PropertyDescriptor descriptor : Introspector.getBeanInfo(javaClass).getPropertyDescriptors()) {
+ for (final PropertyDescriptor descriptor : Introspector.getBeanInfo(javaClass).getPropertyDescriptors()) {
propertyToClass.put(descriptor.getName(), descriptor.getPropertyType());
}
- } catch (IntrospectionException e) {
+ } catch (final IntrospectionException e) {
throw new OpenEJBException("Class " + javaClass + " is not a valid javabean", e);
}
// Map the elements nexted in the XML Schema Type
- for (XmlElementInfo nestedElement : xmlTypeInfo.elements.values()) {
- String fieldName = nestedElement.qname.getLocalPart();
- Class javaType = propertyToClass.get(fieldName);
+ for (final XmlElementInfo nestedElement : xmlTypeInfo.elements.values()) {
+ final String fieldName = nestedElement.qname.getLocalPart();
+ final Class javaType = propertyToClass.get(fieldName);
if (javaType == null) {
throw new OpenEJBException("Field " + fieldName + " is not defined by class " + javaClass.getName());
}
- JaxRpcFieldInfo fieldInfo = new JaxRpcFieldInfo();
+ final JaxRpcFieldInfo fieldInfo = new JaxRpcFieldInfo();
fieldInfo.name = fieldName;
fieldInfo.isNillable = nestedElement.nillable;
fieldInfo.xmlName = nestedElement.qname;
@@ -104,23 +104,23 @@ public class LightweightTypeInfoBuilder
}
}
- private Class loadClass(QName typeQName, JavaWsdlMapping mapping) throws OpenEJBException {
- String namespace = typeQName.getNamespaceURI();
+ private Class loadClass(final QName typeQName, final JavaWsdlMapping mapping) throws OpenEJBException {
+ final String namespace = typeQName.getNamespaceURI();
// package name comes from the package mapping
- PackageMapping packageMapping = mapping.getPackageMappingMap().get(namespace);
+ final PackageMapping packageMapping = mapping.getPackageMappingMap().get(namespace);
if (packageMapping == null) {
throw new OpenEJBException("Namespace " + namespace + " was not mapped in jaxrpc mapping file");
}
- String packageName = packageMapping.getPackageType();
+ final String packageName = packageMapping.getPackageType();
// class name is package + type local part
- String className = packageName + "." + typeQName.getLocalPart();
+ final String className = packageName + "." + typeQName.getLocalPart();
try {
- Class clazz = Class.forName(className, false, classLoader);
+ final Class clazz = Class.forName(className, false, classLoader);
return clazz;
- } catch (ClassNotFoundException e) {
+ } catch (final ClassNotFoundException e) {
throw new OpenEJBException("Could not load java type " + className, e);
}
}
Modified: tomee/tomee/branches/tomee-1.7.x/server/openejb-axis/src/main/java/org/apache/openejb/server/axis/assembler/XmlTypeInfo.java
URL: http://svn.apache.org/viewvc/tomee/tomee/branches/tomee-1.7.x/server/openejb-axis/src/main/java/org/apache/openejb/server/axis/assembler/XmlTypeInfo.java?rev=1611274&r1=1611273&r2=1611274&view=diff
==============================================================================
--- tomee/tomee/branches/tomee-1.7.x/server/openejb-axis/src/main/java/org/apache/openejb/server/axis/assembler/XmlTypeInfo.java (original)
+++ tomee/tomee/branches/tomee-1.7.x/server/openejb-axis/src/main/java/org/apache/openejb/server/axis/assembler/XmlTypeInfo.java Thu Jul 17 07:52:58 2014
@@ -32,6 +32,6 @@ public class XmlTypeInfo extends InfoObj
public boolean listType;
public QName arrayComponentType;
- public final Map<String, QName> attributes = new LinkedHashMap<String,QName>();
+ public final Map<String, QName> attributes = new LinkedHashMap<String, QName>();
public final Map<QName, XmlElementInfo> elements = new LinkedHashMap<QName, XmlElementInfo>();
}
\ No newline at end of file
Modified: tomee/tomee/branches/tomee-1.7.x/server/openejb-axis/src/main/java/org/apache/openejb/server/axis/client/ArrayTypeInfo.java
URL: http://svn.apache.org/viewvc/tomee/tomee/branches/tomee-1.7.x/server/openejb-axis/src/main/java/org/apache/openejb/server/axis/client/ArrayTypeInfo.java?rev=1611274&r1=1611273&r2=1611274&view=diff
==============================================================================
--- tomee/tomee/branches/tomee-1.7.x/server/openejb-axis/src/main/java/org/apache/openejb/server/axis/client/ArrayTypeInfo.java (original)
+++ tomee/tomee/branches/tomee-1.7.x/server/openejb-axis/src/main/java/org/apache/openejb/server/axis/client/ArrayTypeInfo.java Thu Jul 17 07:52:58 2014
@@ -28,28 +28,28 @@ public class ArrayTypeInfo extends TypeI
private final QName componentType;
private final QName componentQName;
- public ArrayTypeInfo(Class clazz,
- QName qName,
- Class serializerClass,
- Class deserializerClass,
- boolean canSearchParents,
- FieldDesc[] fields,
- QName componentType,
- QName componentQName) {
+ public ArrayTypeInfo(final Class clazz,
+ final QName qName,
+ final Class serializerClass,
+ final Class deserializerClass,
+ final boolean canSearchParents,
+ final FieldDesc[] fields,
+ final QName componentType,
+ final QName componentQName) {
super(clazz, qName, serializerClass, deserializerClass, canSearchParents, fields);
this.componentType = componentType;
this.componentQName = componentQName;
}
- public void register(TypeMapping typeMapping) {
+ public void register(final TypeMapping typeMapping) {
// SerializerFactory ser = BaseSerializerFactory.createFactory(getSerFactoryClass(), getClazz(), getqName());
// ((ArraySerializerFactory)ser).setComponentType(componentType);
// ((ArraySerializerFactory)ser).setComponentQName(componentQName);
// DeserializerFactory deser = BaseDeserializerFactory.createFactory(getDeserFactoryClass(), getClazz(), getqName());
// ((ArrayDeserializerFactory)deser).setComponentType(componentType);
- ArraySerializerFactory ser = new ArraySerializerFactory(componentType, componentQName);
- ArrayDeserializerFactory deser = new ArrayDeserializerFactory();
+ final ArraySerializerFactory ser = new ArraySerializerFactory(componentType, componentQName);
+ final ArrayDeserializerFactory deser = new ArrayDeserializerFactory();
typeMapping.register(getClazz(), getqName(), ser, deser);
}
@@ -82,11 +82,11 @@ public class ArrayTypeInfo extends TypeI
return componentQName;
}
- public void setComponentType(QName componentType) {
+ public void setComponentType(final QName componentType) {
this.componentType = componentType;
}
- public void setComponentQName(QName componentQName) {
+ public void setComponentQName(final QName componentQName) {
this.componentQName = componentQName;
}
}
Modified: tomee/tomee/branches/tomee-1.7.x/server/openejb-axis/src/main/java/org/apache/openejb/server/axis/client/AxisClientImpl.java
URL: http://svn.apache.org/viewvc/tomee/tomee/branches/tomee-1.7.x/server/openejb-axis/src/main/java/org/apache/openejb/server/axis/client/AxisClientImpl.java?rev=1611274&r1=1611273&r2=1611274&view=diff
==============================================================================
--- tomee/tomee/branches/tomee-1.7.x/server/openejb-axis/src/main/java/org/apache/openejb/server/axis/client/AxisClientImpl.java (original)
+++ tomee/tomee/branches/tomee-1.7.x/server/openejb-axis/src/main/java/org/apache/openejb/server/axis/client/AxisClientImpl.java Thu Jul 17 07:52:58 2014
@@ -28,23 +28,23 @@ import java.util.Map;
public class AxisClientImpl extends AxisClient {
private final Map portNameToSEIFactoryMap;
- public AxisClientImpl(EngineConfiguration engineConfiguration, Map portNameToSEIFactoryMap) {
+ public AxisClientImpl(final EngineConfiguration engineConfiguration, final Map portNameToSEIFactoryMap) {
super(engineConfiguration);
this.portNameToSEIFactoryMap = portNameToSEIFactoryMap;
}
- protected HandlerChain getJAXRPChandlerChain(MessageContext context) {
- QName portQName = (QName) context.getProperty(Call.WSDL_PORT_NAME);
+ protected HandlerChain getJAXRPChandlerChain(final MessageContext context) {
+ final QName portQName = (QName) context.getProperty(Call.WSDL_PORT_NAME);
if (portQName == null) {
return null;
}
- String portName = portQName.getLocalPart();
+ final String portName = portQName.getLocalPart();
- SeiFactory seiFactory = (SeiFactory) portNameToSEIFactoryMap.get(portName);
+ final SeiFactory seiFactory = (SeiFactory) portNameToSEIFactoryMap.get(portName);
if (seiFactory == null) {
return null;
}
- HandlerChain handlerChain = seiFactory.createHandlerChain();
+ final HandlerChain handlerChain = seiFactory.createHandlerChain();
return handlerChain;
}
}
Modified: tomee/tomee/branches/tomee-1.7.x/server/openejb-axis/src/main/java/org/apache/openejb/server/axis/client/AxisServiceReference.java
URL: http://svn.apache.org/viewvc/tomee/tomee/branches/tomee-1.7.x/server/openejb-axis/src/main/java/org/apache/openejb/server/axis/client/AxisServiceReference.java?rev=1611274&r1=1611273&r2=1611274&view=diff
==============================================================================
--- tomee/tomee/branches/tomee-1.7.x/server/openejb-axis/src/main/java/org/apache/openejb/server/axis/client/AxisServiceReference.java (original)
+++ tomee/tomee/branches/tomee-1.7.x/server/openejb-axis/src/main/java/org/apache/openejb/server/axis/client/AxisServiceReference.java Thu Jul 17 07:52:58 2014
@@ -43,38 +43,38 @@ public class AxisServiceReference extend
private Callback[] methodInterceptors;
private Class enhancedServiceClass;
- public AxisServiceReference(String serviceInterfaceClassName, Map seiPortNameToFactoryMap, Map seiClassNameToFactoryMap) {
+ public AxisServiceReference(final String serviceInterfaceClassName, final Map seiPortNameToFactoryMap, final Map seiClassNameToFactoryMap) {
this.serviceInterfaceClassName = serviceInterfaceClassName;
this.seiPortNameToFactoryMap = seiPortNameToFactoryMap;
this.seiClassNameToFactoryMap = seiClassNameToFactoryMap;
}
- public void setClassLoader(ClassLoader classLoader) {
+ public void setClassLoader(final ClassLoader classLoader) {
this.classLoader = classLoader;
}
public Object getObject() throws NamingException {
- Object serviceInstance = createServiceInterfaceProxy(serviceInterfaceClassName, seiPortNameToFactoryMap, seiClassNameToFactoryMap, classLoader);
+ final Object serviceInstance = createServiceInterfaceProxy(serviceInterfaceClassName, seiPortNameToFactoryMap, seiClassNameToFactoryMap, classLoader);
return serviceInstance;
}
- private Object createServiceInterfaceProxy(String serviceInterfaceClassName, Map seiPortNameToFactoryMap, Map seiClassNameToFactoryMap, ClassLoader classLoader) throws NamingException {
- boolean initialize = (this.serviceConstructor == null);
+ private Object createServiceInterfaceProxy(final String serviceInterfaceClassName, final Map seiPortNameToFactoryMap, final Map seiClassNameToFactoryMap, final ClassLoader classLoader) throws NamingException {
+ final boolean initialize = (this.serviceConstructor == null);
if (initialize) {
- Class serviceInterface;
+ final Class serviceInterface;
try {
serviceInterface = classLoader.loadClass(serviceInterfaceClassName);
- } catch (ClassNotFoundException e) {
+ } catch (final ClassNotFoundException e) {
throw (NamingException) new NamingException("Could not load service interface class " + serviceInterfaceClassName).initCause(e);
}
// create method interceptors
- Callback callback = new ServiceMethodInterceptor(seiPortNameToFactoryMap);
+ final Callback callback = new ServiceMethodInterceptor(seiPortNameToFactoryMap);
this.methodInterceptors = new Callback[]{NoOp.INSTANCE, callback};
// create service class
- Enhancer enhancer = new Enhancer();
+ final Enhancer enhancer = new Enhancer();
enhancer.setClassLoader(classLoader);
enhancer.setSuperclass(ServiceImpl.class);
enhancer.setInterfaces(new Class[]{serviceInterface});
@@ -91,22 +91,22 @@ public class AxisServiceReference extend
// associate the method interceptors with the generated service class on the current thread
Enhancer.registerCallbacks(this.enhancedServiceClass, this.methodInterceptors);
- Object[] arguments = new Object[]{seiPortNameToFactoryMap, seiClassNameToFactoryMap};
+ final Object[] arguments = new Object[]{seiPortNameToFactoryMap, seiClassNameToFactoryMap};
Object serviceInstance = null;
try {
serviceInstance = this.serviceConstructor.newInstance(arguments);
- } catch (InvocationTargetException e) {
+ } catch (final InvocationTargetException e) {
throw (NamingException) new NamingException("Could not construct service instance").initCause(e.getTargetException());
}
if (initialize) {
- for (Iterator iterator = seiPortNameToFactoryMap.values().iterator(); iterator.hasNext();) {
- SeiFactoryImpl seiFactory = (SeiFactoryImpl) iterator.next();
+ for (final Iterator iterator = seiPortNameToFactoryMap.values().iterator(); iterator.hasNext(); ) {
+ final SeiFactoryImpl seiFactory = (SeiFactoryImpl) iterator.next();
try {
seiFactory.initialize(serviceInstance, classLoader);
- } catch (ClassNotFoundException e) {
+ } catch (final ClassNotFoundException e) {
throw (NamingException) new NamingException("Could not load service interface class; " + e.getMessage()).initCause(e);
}
}
Modified: tomee/tomee/branches/tomee-1.7.x/server/openejb-axis/src/main/java/org/apache/openejb/server/axis/client/GenericServiceEndpoint.java
URL: http://svn.apache.org/viewvc/tomee/tomee/branches/tomee-1.7.x/server/openejb-axis/src/main/java/org/apache/openejb/server/axis/client/GenericServiceEndpoint.java?rev=1611274&r1=1611273&r2=1611274&view=diff
==============================================================================
--- tomee/tomee/branches/tomee-1.7.x/server/openejb-axis/src/main/java/org/apache/openejb/server/axis/client/GenericServiceEndpoint.java (original)
+++ tomee/tomee/branches/tomee-1.7.x/server/openejb-axis/src/main/java/org/apache/openejb/server/axis/client/GenericServiceEndpoint.java Thu Jul 17 07:52:58 2014
@@ -25,7 +25,7 @@ import org.apache.axis.client.Call;
import org.apache.axis.client.Service;
public class GenericServiceEndpoint extends org.apache.axis.client.Stub {
- public GenericServiceEndpoint(QName portQName, Service service, URL location) {
+ public GenericServiceEndpoint(final QName portQName, final Service service, final URL location) {
this.service = service;
cachedEndpoint = location;
cachedPortName = portQName;
@@ -34,8 +34,8 @@ public class GenericServiceEndpoint exte
Call createCall() throws java.rmi.RemoteException {
try {
- org.apache.axis.client.Call _call =
- (org.apache.axis.client.Call) service.createCall();
+ final org.apache.axis.client.Call _call =
+ (org.apache.axis.client.Call) service.createCall();
if (super.maintainSessionSet) {
_call.setMaintainSession(super.maintainSession);
}
@@ -54,9 +54,9 @@ public class GenericServiceEndpoint exte
if (super.cachedPortName != null) {
_call.setPortName(super.cachedPortName);
}
- java.util.Enumeration keys = super.cachedProperties.keys();
+ final java.util.Enumeration keys = super.cachedProperties.keys();
while (keys.hasMoreElements()) {
- java.lang.String key = (java.lang.String) keys.nextElement();
+ final java.lang.String key = (java.lang.String) keys.nextElement();
_call.setProperty(key, super.cachedProperties.get(key));
}
// All the type mapping information is registered
@@ -87,7 +87,7 @@ public class GenericServiceEndpoint exte
// }
// }
return _call;
- } catch (java.lang.Throwable t) {
+ } catch (final java.lang.Throwable t) {
throw new org.apache.axis.AxisFault("Failure trying to get the Call object", t);
}
}
@@ -98,7 +98,7 @@ public class GenericServiceEndpoint exte
}
}
- void setUpCall(Call call) throws AxisFault {
+ void setUpCall(final Call call) throws AxisFault {
setRequestHeaders(call);
setAttachments(call);
}