Author: alessio.soldano(a)jboss.com
Date: 2012-10-11 10:38:55 -0400 (Thu, 11 Oct 2012)
New Revision: 16859
Removed:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/Message.properties
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/accessor/Message.properties
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/builder/Message.properties
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/builder/jaxrpc/Message.properties
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/jaxrpcmapping/Message.properties
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/umdm/Message.properties
Modified:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/NativeLoggers.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/NativeMessages.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/CommonClient.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/CommonMessageContext.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/CommonSOAPBinding.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/EndpointInvocation.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/MessageTrace.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/accessor/ReflectiveFieldAccessorFactory.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/accessor/ReflectiveMethodAccessorFactory.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/builder/MetaDataBuilder.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/builder/jaxrpc/JAXRPCClientMetaDataBuilder.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/builder/jaxrpc/JAXRPCMetaDataBuilder.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/builder/jaxrpc/JAXRPCServerMetaDataBuilder.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/jaxrpcmapping/ExceptionMapping.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/jaxrpcmapping/JavaWsdlMapping.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/jaxrpcmapping/JavaWsdlMappingFactory.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/jaxrpcmapping/MethodParamPartsMapping.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/jaxrpcmapping/WsdlMessageMapping.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/umdm/EndpointConfigMetaData.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/umdm/EndpointMetaData.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/umdm/FaultMetaData.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/umdm/HandlerMetaData.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/umdm/OperationMetaData.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/umdm/ParameterMetaData.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/umdm/ServerEndpointMetaData.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/umdm/ServiceMetaData.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/umdm/TypeMappingMetaData.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/umdm/TypesMetaData.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/umdm/UnifiedMetaData.java
Log:
[JBWS-3509] WIP on convertin native messages to new logging...
Modified: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/NativeLoggers.java
===================================================================
---
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/NativeLoggers.java 2012-10-11
10:07:17 UTC (rev 16858)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/NativeLoggers.java 2012-10-11
14:38:55 UTC (rev 16859)
@@ -126,4 +126,68 @@
@Message(id = 25097, value = "Cannot parse XSModel string: %s")
void cannotParseXSModelString(String s, @Cause Throwable cause);
+ @LogMessage(level = WARN)
+ @Message(id = 25101, value = "Cannot obtain javaTypeName for xmlType: %s")
+ void cannotObtainJavaTypeName(QName qname);
+
+ @LogMessage(level = WARN)
+ @Message(id = 25104, value = "Multiple possible endpoints implementing SEI:
%s")
+ void multiplePossibleEndpointImplementingSEI(String seiName);
+
+ @LogMessage(level = WARN)
+ @Message(id = 25112, value = "Set java type name after eager initialization:
%s")
+ void setJavaTypeAfterEagerInit(String typeName);
+
+ @LogMessage(level = WARN)
+ @Message(id = 25122, value = "Loading java type after eager
initialization")
+ void loadingJavaTypeAfterEagerInit();
+
+ @LogMessage(level = WARN)
+ @Message(id = 25129, value = "Setting name of or loading SEI after eager
initialization")
+ void loadingSettingSEIAfterEagerInit();
+
+ @LogMessage(level = WARN)
+ @Message(id = 25130, value = "Cannot load class for type %s %s")
+ void cannotLoadClassForType(QName q, String s, @Cause Throwable cause);
+
+ @LogMessage(level = WARN)
+ @Message(id = 25131, value = "Loading java method after eager
initialization")
+ void loadingJavaMethodAfterEagerInit();
+
+ @LogMessage(level = WARN)
+ @Message(id = 25135, value = "Cannot find jaxrpc-mapping for type: %s")
+ void cannotFindJAXRPCMappingForType(QName type);
+
+ @LogMessage(level = WARN)
+ @Message(id = 25138, value = "Malformed URL: %s")
+ void malformedURL(String url);
+
+ @LogMessage(level = WARN)
+ @Message(id = 25140, value = "Cannot obtain fault type for element: %s")
+ void cannotObtainFaultTypeForElement(QName qname);
+
+ @LogMessage(level = WARN)
+ @Message(id = 25141, value = "Cannot obtain java type mapping for: %s")
+ void cannotObtainJavaTypeMappingFor(QName qname);
+
+ @LogMessage(level = WARN)
+ @Message(id = 25144, value = "Cannot obtain SEI mapping for: %s")
+ void cannotObtainSEIMappingFor(String name);
+
+ @LogMessage(level = WARN)
+ @Message(id = 25161, value = "Mime type %s not allowed for parameter %s allowed
types are: %s")
+ void mimeTypeNotAllowed(String type, QName param, Collection<String> allowed);
+
+ @LogMessage(level = WARN)
+ @Message(id = 25169, value = "Expected SOAP %s envelope, but got: %s")
+ void unexpectedSoapEnvelopeVersion(String expectedEnvelopeVersion, String
envelopeNS);
+
+ @LogMessage(level = WARN)
+ @Message(id = 25174, value = "Failed to cleanup attachment part")
+ void failedToCleanupAttachmentPart(@Cause Throwable cause);
+
+ @LogMessage(level = ERROR)
+ @Message(id = 25177, value = "Exception caught while (preparing for) performing
invocation")
+ void exceptionWhilePreparingForInvocation(@Cause Throwable cause);
+
}
Modified: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/NativeMessages.java
===================================================================
---
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/NativeMessages.java 2012-10-11
10:07:17 UTC (rev 16858)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/NativeMessages.java 2012-10-11
14:38:55 UTC (rev 16859)
@@ -22,12 +22,14 @@
package org.jboss.ws;
import java.io.File;
+import java.io.IOException;
import java.net.URL;
import java.util.Collection;
import javax.management.ObjectName;
import javax.wsdl.Part;
import javax.xml.namespace.QName;
+import javax.xml.soap.Name;
import javax.xml.soap.SOAPException;
import org.apache.xerces.xni.XNIException;
@@ -35,6 +37,8 @@
import org.jboss.logging.Cause;
import org.jboss.logging.Message;
import org.jboss.logging.MessageBundle;
+import org.jboss.ws.core.binding.BindingException;
+import org.jboss.ws.core.soap.utils.Use;
import org.jboss.ws.metadata.wsdl.WSDLException;
import org.jboss.ws.metadata.wsdl.WSDLTypes;
import org.jboss.wsf.spi.deployment.Deployment;
@@ -95,7 +99,7 @@
WSException cannotLoadClass(String className, @Cause Throwable cause);
@Message(id = 25021, value = "Cannot obtain endpoint for: %s")
- WSException cannotObtainEndpoint(ObjectName oname);
+ WSException cannotObtainEndpoint(Object oname);
@Message(id = 25023, value = "Schema mapping, %s argument is null")
IllegalArgumentException illegalNullArgumentInSchemaMapping(String argument);
@@ -289,4 +293,190 @@
@Message(id = 25099, value = "Parser should stop, the key value is %s")
XNIException parserShouldStopKeyValueIs(String keyValue, @Cause Exception cause);
+ @Message(id = 25100, value = "Classloader not available")
+ IllegalStateException classloaderNotAvailable();
+
+ @Message(id = 25102, value = "Ambiguous type mappping for: %s")
+ WSException ambiguousTypeMapping(QName qname);
+
+ @Message(id = 25103, value = "Invalid qname scope: %s")
+ IllegalArgumentException invalidQNameScope(String scope);
+
+ @Message(id = 25105, value = "EndpointMetaData name must be unique: %s")
+ WSException endpointMetadataMustBeUnique(QName qname);
+
+ @Message(id = 25106, value = "No type mapping for encoding style: %s")
+ WSException noTypeMapping(Use use);
+
+ @Message(id = 25107, value = "Conflicting encoding styles not supported: %s,
%s")
+ WSException conflictingEncodingStyles(Object obj1, Object obj2);
+
+ @Message(id = 25108, value = "Requested namespace is not WSDL target namespace:
%s")
+ WSException notWsdlTargetNamespace(String ns);
+
+ @Message(id = 25109, value = "context root should start with '/':
%s")
+ IllegalArgumentException contextRootShouldStartsWith(String ctxRoot);
+
+ @Message(id = 25110, value = "URL pattern should start with '/':
%s")
+ IllegalArgumentException urlPatternShouldStartsWith(String urlPattern);
+
+ @Message(id = 25111, value = "Endpoint not available")
+ IllegalStateException endpointNotAvailable();
+
+ @Message(id = 25113, value = "Invalid mode: %s")
+ IllegalArgumentException invalidMode(String mode);
+
+ @Message(id = 25114, value = "Invalid mime type: %s")
+ IllegalArgumentException invalidMimeType(QName xmlType);
+
+ @Message(id = 25115, value = "Autogeneration of wrapper beans not supported with
JAXRPC")
+ WSException jaxrpcWrapperBeanAutogenNotSupported();
+
+ @Message(id = 25116, value = "Cannot load: %s")
+ WSException cannotLoad(String className);
+
+ @Message(id = 25117, value = "Cannot find java method: %s")
+ WSException cannotFindJavaMethod(String method);
+
+ @Message(id = 25118, value = "OneWay operations cannot have a return
parameter")
+ WSException onewayOperationCannotHaveReturn();
+
+ @Message(id = 25119, value = "OneWay operations cannot have checked
exceptions")
+ WSException onewayOperationCannotHaveCheckedExc();
+
+ @Message(id = 25120, value = "OneWay operations cannot have INOUT or OUT
parameters")
+ WSException onewayOperationCannotHaveInOutPars();
+
+ @Message(id = 25121, value = "Handler class name cannot be null")
+ IllegalStateException handlerClassNameCannotBeNull();
+
+ @Message(id = 25123, value = "%s is not assignable to Exception")
+ IllegalStateException notAssignableToException(Class<?> clazz);
+
+ @Message(id = 25124, value = "%s is not a java.lang.Exception")
+ WSException notAnException(String clazz);
+
+ @Message(id = 25125, value = "Could not instantiate service exception (%s),
since neither a faultInfo nor sorted constructor is present: %s")
+ WSException couldNotInstanciateServiceException(String exc, String s);
+
+ @Message(id = 25126, value = "Unsupported binding: %s")
+ WSException unsupportedBinding(String bindingID);
+
+ @Message(id = 25127, value = "Mixed SOAP parameter styles not supported: %s,
%s")
+ WSException conflictingSOAPParameterStyles(Object obj1, Object obj2);
+
+ @Message(id = 25128, value = "Cannot uniquely indentify operation: %s")
+ WSException cannotUniquelyIdentifyOp(QName op);
+
+ @Message(id = 25132, value = "Invalid parameter mode: %s")
+ IllegalArgumentException invalidParameterMode(String mode);
+
+ @Message(id = 25133, value = "Cannot parse: %s")
+ IOException cannotParse(URL url);
+
+ @Message(id = 25134, value = "Invalid anonymous qname: %s")
+ IllegalArgumentException invalidAnonymousQName(String value);
+
+ @Message(id = 25136, value = "Service path cannot be null")
+ WSException servicePathCannotBeNull();
+
+ @Message(id = 25137, value = "Cannot find <url-pattern> for servlet-name:
%s")
+ WSException cannotFindURLPatternForServletName(String s);
+
+ @Message(id = 25139, value = "Cannot find port in wsdl: %s")
+ IllegalArgumentException cannotFindPortInWsdl2(QName port);
+
+ @Message(id = 25142, value = "jaxrpc-mapping-file not configured from
webservices.xml")
+ WSException mappingFileNotConfigured();
+
+ @Message(id = 25143, value = "Cannot obtain UnifiedBeanMetaData for: %s")
+ WSException cannotObtainUnifiedBeanMetaData(String name);
+
+ @Message(id = 25145, value = "Cannot find port in wsdl: %s")
+ WSException cannotFindPortInWsdl(QName port);
+
+ @Message(id = 25146, value = "Cannot obtain java type mapping for: %s")
+ WSException cannotObtainJavaTypeMappingFor(QName qname);
+
+ @Message(id = 25147, value = "Cannot obtain java/xml type mapping for:
%s")
+ WSException cannotObtainJavaXmlTypeMappingFor(QName qname);
+
+ @Message(id = 25148, value = "Cannot locate binding operation for: %s")
+ WSException cannotLocateBindingOperationFor(QName q);
+
+ @Message(id = 25149, value = "Cannot obtain method mapping for: %s")
+ WSException cannotObtainMethodMappingFor(QName qname);
+
+ @Message(id = 25150, value = "Cannot obtain method parameter mapping for message
part '%s' in wsdl operation %s")
+ WSException cannotObtainMethodParameterMappingFor(String part, String wsdlOp);
+
+ @Message(id = 25151, value = "RPC style was missing an output, and was not an
IN-ONLY MEP.")
+ WSException rpcStyleMissingOutputAndNotAInOnlyMEP();
+
+ @Message(id = 25152, value = "Cannot wrap parameters without SEI method
mapping")
+ IllegalArgumentException cannotWrapParametersWithoutSEIMethodMapping();
+
+ @Message(id = 25153, value = "Could not determine variable name for element:
%s")
+ IllegalArgumentException couldNotDetermineVariableNameForElement(String elem);
+
+ @Message(id = 25154, value = "Invalid parameter mode for element %s")
+ IllegalArgumentException invalidParameterModeForElement(String elem);
+
+ @Message(id = 25155, value = "Could not update IN parameter to be INOUT, as
indicated in the mapping: %s")
+ WSException couldNotUpdateInParameterAsIndicated(String part);
+
+ @Message(id = 25156, value = "Cannot obtain wsdl service: %s")
+ IllegalArgumentException cannotObtainWSDLService(QName service);
+
+ @Message(id = 25157, value = "Field cannot be static: %s")
+ WSException fieldCannotBeStatic(String field);
+
+ @Message(id = 25158, value = "Unsupported message type: %s")
+ String unsupportedMessageType(Object obj);
+
+ @Message(id = 25159, value = "Cannot trace SOAP Message")
+ String cannotTraceSOAPMessage();
+
+ @Message(id = 25160, value = "Operation %s does not have a return value")
+ WSException operationDoesNotHaveReturnValue(QName op);
+
+ @Message(id = 25162, value = "Mime type %s not allowed for parameter %s allowed
types are: %s")
+ SOAPException mimeTypeNotAllowed(String type, QName param, Collection<String>
allowed);
+
+ @Message(id = 25163, value = "javaType [%s] is not assignable from attachment
content: %s")
+ SOAPException javaTypeIsNotAssignable(String javaType, String contentType);
+
+ @Message(id = 25164, value = "Parameter %s not assignable from %s")
+ WSException parameterNotAssignable(Object clazz1, Object clazz2);
+
+ @Message(id = 25165, value = "javaType %s is not assignable from: %s")
+ BindingException javaTypeIsNotAssignableFrom(String s1, String s2);
+
+ @Message(id = 25166, value = "Cannot find RPC element in %s")
+ SOAPException cannotFindRPCElement(Object parent);
+
+ @Message(id = 25167, value = "Invalid number of payload elements: %s")
+ WSException invalidNumberOfPayloadElements(int n);
+
+ @Message(id = 25168, value = "Cannot unbind response message with empty soap
body")
+ WSException emptySOAPBody();
+
+ @Message(id = 25170, value = "Could not determine mime type for attachment
parameter: %s")
+ BindingException couldNotDetermineMimeType(String par);
+
+ @Message(id = 25171, value = "Could not locate attachment for parameter:
%s")
+ BindingException couldNotLocateAttachment(QName qname);
+
+ @Message(id = 25172, value = "Cannot find child element: %s")
+ WSException cannotFindChildElement(Name name);
+
+ @Message(id = 25173, value = "No SOAPMessage available. Current message context
carries: %s")
+ UnsupportedOperationException noSoapMessageAvailable(Class<?> clazz);
+
+ @Message(id = 25175, value = "Cannot obtain operation meta data for %s")
+ WSException cannotObtainOperationMetaData(QName opName);
+
+ @Message(id = 25176, value = "Target endpoint address not set")
+ WSException targetEndpointAddressNotSet();
+
}
Modified:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/CommonClient.java
===================================================================
---
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/CommonClient.java 2012-10-11
10:07:17 UTC (rev 16858)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/CommonClient.java 2012-10-11
14:38:55 UTC (rev 16859)
@@ -21,13 +21,12 @@
*/
package org.jboss.ws.core;
+import static org.jboss.ws.NativeMessages.MESSAGES;
+
import java.util.ArrayList;
import java.util.HashMap;
-import java.util.Iterator;
-import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
-import java.util.ResourceBundle;
import javax.xml.namespace.QName;
import javax.xml.rpc.JAXRPCException;
@@ -38,8 +37,7 @@
import javax.xml.soap.SOAPMessage;
import org.jboss.logging.Logger;
-import org.jboss.ws.WSException;
-import org.jboss.ws.api.util.BundleUtils;
+import org.jboss.ws.NativeLoggers;
import org.jboss.ws.common.Constants;
import org.jboss.ws.common.ResourceLoaderAdapter;
import org.jboss.ws.core.DirectionHolder.Direction;
@@ -68,7 +66,6 @@
*/
public abstract class CommonClient implements StubExt, HeaderSource
{
- private static final ResourceBundle bundle =
BundleUtils.getBundle(CommonClient.class);
// provide logging
private static Logger log = Logger.getLogger(CommonClient.class);
@@ -118,7 +115,7 @@
{
epMetaData = serviceMetaData.getEndpoint(portName);
if (epMetaData == null)
- throw new WSException(BundleUtils.getMessage(bundle,
"CANNOT_FIND_ENDPOINT_FOR_NAME", portName));
+ throw MESSAGES.cannotObtainEndpoint(portName);
}
if (epMetaData != null)
@@ -163,9 +160,6 @@
*/
public OperationMetaData getOperationMetaData()
{
- if (operationName == null)
- throw new WSException(BundleUtils.getMessage(bundle,
"OPERATION_NAME_NOT_SET"));
-
return getOperationMetaData(operationName);
}
@@ -174,7 +168,7 @@
public OperationMetaData getOperationMetaData(QName opName)
{
if (opName == null)
- throw new IllegalArgumentException(BundleUtils.getMessage(bundle,
"CANNOT_GET_OPERATIONMETADATA"));
+ throw MESSAGES.illegalNullArgument("opName");
EndpointMetaData epMetaData = getEndpointMetaData();
OperationMetaData opMetaData = epMetaData.getOperation(opName);
@@ -185,7 +179,7 @@
}
if (opMetaData == null)
- throw new WSException(BundleUtils.getMessage(bundle,
"CANNOT_OBTAIN_OPERATION_META_DATA_FOR", opName));
+ throw MESSAGES.cannotObtainOperationMetaData(opName);
return opMetaData;
}
@@ -300,7 +294,7 @@
// The endpoint address must be known beyond this point
if (targetAddress == null)
- throw new WSException(BundleUtils.getMessage(bundle,
"TARGET_ENDPOINT_ADDRESS_NOT_SET"));
+ throw MESSAGES.targetEndpointAddressNotSet();
Map<String, Object> callProps = new HashMap<String,
Object>(requestCtx);
EndpointInfo epInfo = new EndpointInfo(epMetaData, targetAddress,
callProps);
@@ -366,7 +360,7 @@
}
catch (Exception ex)
{
- log.error(BundleUtils.getMessage(bundle,
"EXCEPTION_CAUGHT_WHILE_(PREPARING_FOR)_PERFORMING_THE_INVOCATION"), ex);
+ NativeLoggers.ROOT_LOGGER.exceptionWhilePreparingForInvocation(ex);
// Reverse the message direction
processPivotInternal(msgContext, direction);
if (faultType[2] != null)
@@ -540,7 +534,7 @@
}
catch (SOAPException ex)
{
- throw new JAXRPCException(BundleUtils.getMessage(bundle,
"CANNOT_CREATE_ATTACHMENT_PART"));
+ throw new JAXRPCException(ex);
}
}
}
Modified:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/CommonMessageContext.java
===================================================================
---
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/CommonMessageContext.java 2012-10-11
10:07:17 UTC (rev 16858)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/CommonMessageContext.java 2012-10-11
14:38:55 UTC (rev 16859)
@@ -25,7 +25,6 @@
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
-import java.util.ResourceBundle;
import java.util.Set;
import javax.xml.soap.AttachmentPart;
@@ -33,7 +32,8 @@
import javax.xml.soap.SOAPMessage;
import org.jboss.logging.Logger;
-import org.jboss.ws.api.util.BundleUtils;
+import org.jboss.ws.NativeLoggers;
+import org.jboss.ws.NativeMessages;
import org.jboss.ws.core.binding.SerializationContext;
import org.jboss.ws.core.soap.attachment.SwapableMemoryDataSource;
import org.jboss.ws.metadata.umdm.EndpointMetaData;
@@ -48,9 +48,6 @@
*/
public abstract class CommonMessageContext implements Map<String, Object>
{
- private static final ResourceBundle bundle =
BundleUtils.getBundle(CommonMessageContext.class);
- private static Logger log = Logger.getLogger(CommonMessageContext.class);
-
public static final String REMOTING_METADATA =
"org.jboss.ws.remoting.metadata";
// The serialization context for this message ctx
@@ -106,7 +103,7 @@
public SOAPMessage getSOAPMessage()
{
if(message!=null && ((message instanceof SOAPMessage) == false))
- throw new UnsupportedOperationException(BundleUtils.getMessage(bundle,
"NO_SOAPMESSAGE_AVILABLE", message.getClass()));
+ throw NativeMessages.MESSAGES.noSoapMessageAvailable(message.getClass());
return (SOAPMessage)message;
}
@@ -207,6 +204,7 @@
}
catch (IllegalArgumentException ex)
{
+ Logger log = Logger.getLogger(CommonMessageContext.class);
if (log.isDebugEnabled())
log.debug("Ignore: " + ex.getMessage());
}
@@ -239,7 +237,7 @@
if(msg!=null && (msg instanceof SOAPMessage)) // in case of http binding
{
- Iterator it = ((SOAPMessage)msg).getAttachments();
+ Iterator<?> it = ((SOAPMessage)msg).getAttachments();
while(it.hasNext())
{
AttachmentPart attachment = (AttachmentPart)it.next();
@@ -253,7 +251,7 @@
}
catch (SOAPException e)
{
- log.warn(BundleUtils.getMessage(bundle,
"FAILED_TO_CLEANUP_ATTACHMENT_PART"), e);
+ NativeLoggers.ROOT_LOGGER.failedToCleanupAttachmentPart(e);
}
}
}
Modified:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/CommonSOAPBinding.java
===================================================================
---
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/CommonSOAPBinding.java 2012-10-11
10:07:17 UTC (rev 16858)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/CommonSOAPBinding.java 2012-10-11
14:38:55 UTC (rev 16859)
@@ -22,7 +22,6 @@
package org.jboss.ws.core;
import java.util.Iterator;
-import java.util.ResourceBundle;
import java.util.Set;
import javax.activation.DataHandler;
@@ -45,8 +44,8 @@
import org.apache.xerces.xs.XSElementDeclaration;
import org.apache.xerces.xs.XSTypeDefinition;
import org.jboss.logging.Logger;
-import org.jboss.ws.WSException;
-import org.jboss.ws.api.util.BundleUtils;
+import org.jboss.ws.NativeLoggers;
+import org.jboss.ws.NativeMessages;
import org.jboss.ws.common.Constants;
import org.jboss.ws.common.DOMUtils;
import org.jboss.ws.common.JavaUtils;
@@ -79,7 +78,6 @@
*/
public abstract class CommonSOAPBinding implements CommonBinding
{
- private static final ResourceBundle bundle =
BundleUtils.getBundle(CommonSOAPBinding.class);
// provide logging
protected Logger log = Logger.getLogger(getClass());
@@ -119,8 +117,7 @@
try
{
CommonMessageContext msgContext =
MessageContextAssociation.peekMessageContext();
- if (msgContext == null)
- throw new WSException(BundleUtils.getMessage(bundle,
"MESSAGECONTEXT_NOT_AVAILABLE"));
+ assert(msgContext != null);
// Associate current message with message context
SOAPMessage reqMessage = createMessage(opMetaData);
@@ -209,8 +206,7 @@
EndpointInvocation epInv = new EndpointInvocation(opMetaData);
CommonMessageContext msgContext =
MessageContextAssociation.peekMessageContext();
- if (msgContext == null)
- throw new WSException(BundleUtils.getMessage(bundle,
"MESSAGECONTEXT_NOT_AVAILABLE"));
+ assert(msgContext != null);
// Get the namespace registry
NamespaceRegistry namespaceRegistry = msgContext.getNamespaceRegistry();
@@ -233,7 +229,7 @@
}
if (payloadParent == null)
- throw new SOAPException(BundleUtils.getMessage(bundle,
"CANNOT_FIND_RPC_ELEMENT"));
+ throw NativeMessages.MESSAGES.cannotFindRPCElement(soapBody);
QName elName = payloadParent.getElementQName();
elName = namespaceRegistry.registerQName(elName);
@@ -277,7 +273,7 @@
numChildElements++;
}
if (numChildElements != numParameters)
- throw new WSException(BundleUtils.getMessage(bundle,
"INVALID_NUMBER_OF_PAYLOAD_ELEMENTS", numChildElements));
+ throw
NativeMessages.MESSAGES.invalidNumberOfPayloadElements(numChildElements);
}
// Generic message endpoint
@@ -309,8 +305,7 @@
try
{
CommonMessageContext msgContext =
MessageContextAssociation.peekMessageContext();
- if (msgContext == null)
- throw new WSException(BundleUtils.getMessage(bundle,
"MESSAGECONTEXT_NOT_AVAILABLE"));
+ assert(msgContext != null);
// Associate current message with message context
SOAPMessage resMessage = (SOAPMessage)createMessage(opMetaData);
@@ -434,8 +429,7 @@
// Get the SOAP message context that is associated with the current thread
CommonMessageContext msgContext =
MessageContextAssociation.peekMessageContext();
- if (msgContext == null)
- throw new WSException(BundleUtils.getMessage(bundle,
"MESSAGECONTEXT_NOT_AVAILABLE"));
+ assert(msgContext != null);
SOAPHeader soapHeader = soapEnvelope.getHeader();
SOAPBody soapBody = (SOAPBody)soapEnvelope.getBody();
@@ -450,7 +444,7 @@
if (style == Style.RPC)
{
if (soapBodyElement == null)
- throw new WSException(BundleUtils.getMessage(bundle,
"EMPTY_SOAP_BODY"));
+ throw NativeMessages.MESSAGES.emptySOAPBody();
soapElement = soapBodyElement;
}
@@ -499,10 +493,6 @@
{
msgContext.setSOAPMessage(faultMessage);
}
- else
- {
- log.warn(BundleUtils.getMessage(bundle, "CANNOT_SET_FAULT_MESSAGE"));
- }
return faultMessage;
}
@@ -513,10 +503,10 @@
String envNS = soapEnvelope.getNamespaceURI();
String bindingId = opMetaData.getEndpointMetaData().getBindingId();
if (CommonSOAPBinding.SOAP11HTTP_BINDING.equals(bindingId) &&
Constants.NS_SOAP11_ENV.equals(envNS) == false)
- log.warn(BundleUtils.getMessage(bundle, "EXPECTED_SOAP11", envNS));
+ NativeLoggers.ROOT_LOGGER.unexpectedSoapEnvelopeVersion("1.1",
envNS);
if (CommonSOAPBinding.SOAP12HTTP_BINDING.equals(bindingId) &&
Constants.NS_SOAP12_ENV.equals(envNS) == false)
- log.warn(BundleUtils.getMessage(bundle, "EXPECTED_SOAP12", envNS));
+ NativeLoggers.ROOT_LOGGER.unexpectedSoapEnvelopeVersion("1.2",
envNS);
}
private AttachmentPart createAttachmentPart(ParameterMetaData paramMetaData, Object
value) throws SOAPException, BindingException
@@ -534,7 +524,7 @@
// Conformance (MIME type mismatch): On receipt of a message where the MIME type
of a part does not
// match that described in the WSDL an implementation SHOULD throw a
WebServiceException.
if (mimeTypes != null && !MimeUtils.isMemberOf(mimeType, mimeTypes))
- log.warn(BundleUtils.getMessage(bundle, "MIME_TYPE_NOT_ALLOWED",
new Object[]{ mimeType , partName , mimeTypes}));
+ NativeLoggers.ROOT_LOGGER.mimeTypeNotAllowed(mimeType,
paramMetaData.getXmlName(), mimeTypes);
part.setDataHandler((DataHandler)value);
}
@@ -551,7 +541,7 @@
}
if (mimeType == null)
- throw new BindingException(BundleUtils.getMessage(bundle,
"COULD_NOT_DETERMINE_MIME_TYPE", partName));
+ throw NativeMessages.MESSAGES.couldNotDetermineMimeType(partName);
part.setContent(value, mimeType);
}
@@ -571,7 +561,7 @@
AttachmentPart part = getAttachmentByPartName(xmlName.getLocalPart(), message);
if (part == null)
- throw new BindingException(BundleUtils.getMessage(bundle,
"COULD_NOT_LOCATE_ATTACHMENT", paramMetaData.getXmlName()));
+ throw
NativeMessages.MESSAGES.couldNotLocateAttachment(paramMetaData.getXmlName());
return part;
}
@@ -593,13 +583,13 @@
private SOAPContentElement addParameterToMessage(ParameterMetaData paramMetaData,
Object value, SOAPElement soapElement, SOAPEnvelope soapEnvelope) throws SOAPException,
BindingException
{
QName xmlName = paramMetaData.getXmlName();
- Class javaType = paramMetaData.getJavaType();
+ Class<?> javaType = paramMetaData.getJavaType();
if (value != null)
{
- Class valueType = value.getClass();
+ Class<?> valueType = value.getClass();
if (JavaUtils.isAssignableFrom(javaType, valueType) == false)
- throw new BindingException(BundleUtils.getMessage(bundle,
"JAVATYPE_IS_NOT_ASSIGNABLE", new Object[]{ javaType.getName() ,
valueType.getName()}));
+ throw NativeMessages.MESSAGES.javaTypeIsNotAssignableFrom(javaType.getName(),
valueType.getName());
}
// Make sure we have a prefix on qualified names
@@ -733,7 +723,7 @@
}
if (soapContentElement == null && optional == false)
- throw new WSException(BundleUtils.getMessage(bundle,
"CANNOT_FIND_CHILD_ELEMENT", xmlName));
+ throw NativeMessages.MESSAGES.cannotFindChildElement(xmlName);
return soapContentElement;
}
@@ -745,15 +735,14 @@
public void checkMustUnderstand(OperationMetaData opMetaData) throws Exception
{
CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
- if (msgContext == null)
- throw new WSException(BundleUtils.getMessage(bundle,
"MESSAGECONTEXT_NOT_AVAILABLE"));
+ assert(msgContext != null);
SOAPMessage soapMessage = (SOAPMessage)msgContext.getSOAPMessage();
SOAPEnvelope soapEnvelope = soapMessage.getSOAPPart().getEnvelope();
if (soapEnvelope == null || soapEnvelope.getHeader() == null)
return;
- Iterator it = soapEnvelope.getHeader().examineAllHeaderElements();
+ Iterator<?> it = soapEnvelope.getHeader().examineAllHeaderElements();
while (it.hasNext())
{
SOAPHeaderElement soapHeaderElement = (SOAPHeaderElement)it.next();
Modified:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/EndpointInvocation.java
===================================================================
---
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/EndpointInvocation.java 2012-10-11
10:07:17 UTC (rev 16858)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/EndpointInvocation.java 2012-10-11
14:38:55 UTC (rev 16859)
@@ -28,7 +28,6 @@
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
-import java.util.ResourceBundle;
import java.util.Set;
import javax.activation.DataHandler;
@@ -38,8 +37,9 @@
import javax.xml.soap.SOAPException;
import org.jboss.logging.Logger;
+import org.jboss.ws.NativeLoggers;
+import org.jboss.ws.NativeMessages;
import org.jboss.ws.WSException;
-import org.jboss.ws.api.util.BundleUtils;
import org.jboss.ws.common.JavaUtils;
import org.jboss.ws.core.jaxrpc.ParameterWrapping;
import org.jboss.ws.core.soap.SOAPContentElement;
@@ -58,7 +58,6 @@
*/
public class EndpointInvocation
{
- private static final ResourceBundle bundle =
BundleUtils.getBundle(EndpointInvocation.class);
// provide logging
private static final Logger log = Logger.getLogger(EndpointInvocation.class);
@@ -167,7 +166,7 @@
paramValue = transformPayloadValue(paramMetaData, paramValue);
if (paramValue != null)
{
- Class valueType = paramValue.getClass();
+ Class<?> valueType = paramValue.getClass();
if (HolderUtils.isHolderType(valueType))
{
paramValue = HolderUtils.getHolderValue(paramValue);
@@ -180,7 +179,7 @@
{
ParameterMetaData retMetaData = opMetaData.getReturnParameter();
if (value != null && retMetaData == null)
- throw new WSException(BundleUtils.getMessage(bundle,
"OPERATION_DOES_NOT_HAVE_A_RETURN_VALUE", opMetaData.getQName()));
+ throw
NativeMessages.MESSAGES.operationDoesNotHaveReturnValue(opMetaData.getQName());
if (log.isDebugEnabled())
log.debug("setReturnValue: " + getTypeName(value));
@@ -214,7 +213,7 @@
String javaName = paramMetaData.getJavaTypeName();
if (xmlType == null)
- throw new IllegalStateException(BundleUtils.getMessage(bundle,
"CANNOT_OBTAIN_XML_TYPE", new Object[]{ xmlName , javaName }));
+ throw NativeMessages.MESSAGES.cannotObtainXmlType(xmlName);
Object retValue = paramValue;
@@ -223,7 +222,7 @@
{
AttachmentPart part = (AttachmentPart)paramValue;
- Set mimeTypes = paramMetaData.getMimeTypes();
+ Set<String> mimeTypes = paramMetaData.getMimeTypes();
if (DataHandler.class.isAssignableFrom(javaType) &&
!javaType.equals(Object.class))
{
DataHandler handler = part.getDataHandler();
@@ -233,7 +232,7 @@
// Conformance (MIME type mismatch): On receipt of a message where the MIME
type of a part does not
// match that described in the WSDL an implementation SHOULD throw a
WebServiceException.
if (mimeTypes != null && !MimeUtils.isMemberOf(mimeType, mimeTypes))
- log.warn(BundleUtils.getMessage(bundle, "MIME_TYPE_NOT_ALLOWED",
new Object[]{ mimeType , xmlName , mimeTypes}));
+ NativeLoggers.ROOT_LOGGER.mimeTypeNotAllowed(mimeType, xmlName,
mimeTypes);
retValue = part.getDataHandler();
}
@@ -243,7 +242,7 @@
String mimeType = MimeUtils.getBaseMimeType(part.getContentType());
if (mimeTypes != null && !MimeUtils.isMemberOf(mimeType, mimeTypes))
- throw new SOAPException(BundleUtils.getMessage(bundle,
"MIME_TYPE_NOT_ALLOWED", new Object[]{ mimeType , xmlName , mimeTypes}));
+ throw NativeMessages.MESSAGES.mimeTypeNotAllowed(mimeType, xmlName,
mimeTypes);
if (retValue != null)
{
@@ -257,8 +256,7 @@
}
else
{
- throw new SOAPException(BundleUtils.getMessage(bundle,
"JAVATYPE_IS_NOT_ASSIGNABLE",
- new Object[]{ javaType.getName(), valueType.getName()}));
+ throw
NativeMessages.MESSAGES.javaTypeIsNotAssignable(javaType.getName(), valueType.getName());
}
}
}
@@ -296,7 +294,7 @@
continue;
QName xmlName = paramMetaData.getXmlName();
- Class javaType = paramMetaData.getJavaType();
+ Class<?> javaType = paramMetaData.getJavaType();
Object value;
if (opMetaData.isDocumentWrapped() && !paramMetaData.isInHeader()
&& !paramMetaData.isSwA())
@@ -308,7 +306,7 @@
value = inputParams[index];
if (value != null)
{
- Class inputType = value.getClass();
+ Class<?> inputType = value.getClass();
if (HolderUtils.isHolderType(inputType))
{
@@ -323,7 +321,7 @@
if (value != null && !paramMetaData.isSwA())
{
if (JavaUtils.isAssignableFrom(javaType, inputType) == false)
- throw new WSException(BundleUtils.getMessage(bundle,
"PARAMETER_NOT_ASSIGNABLE", new Object[]{ javaType , inputType}));
+ throw NativeMessages.MESSAGES.parameterNotAssignable(javaType,
inputType);
}
}
}
@@ -339,7 +337,7 @@
{
Object retValue = paramValue;
Method method = opMetaData.getJavaMethod();
- Class[] targetParameterTypes = method.getParameterTypes();
+ Class<?>[] targetParameterTypes = method.getParameterTypes();
if (opMetaData.isDocumentWrapped() && !paramMetaData.isInHeader()
&& !paramMetaData.isSwA() && !paramMetaData.isMessageType())
{
@@ -350,7 +348,7 @@
{
// Replace INOUT and OUT parameters by their respective holder values
int index = paramMetaData.getIndex();
- Class targetParameterType = targetParameterTypes[index];
+ Class<?> targetParameterType = targetParameterTypes[index];
if (paramMetaData.getMode() == ParameterMode.INOUT || paramMetaData.getMode() ==
ParameterMode.OUT)
{
@@ -362,9 +360,9 @@
if (retValue != null)
{
- Class valueType = retValue.getClass();
+ Class<?> valueType = retValue.getClass();
if (JavaUtils.isAssignableFrom(targetParameterType, valueType) == false)
- throw new WSException(BundleUtils.getMessage(bundle,
"PARAMETER_NOT_ASSIGNABLE", new Object[]{ targetParameterType.getName() ,
getTypeName(retValue)}));
+ throw
NativeMessages.MESSAGES.parameterNotAssignable(targetParameterType.getName(),
getTypeName(retValue));
if (valueType.isArray())
retValue = JavaUtils.syncArray(retValue, targetParameterType);
@@ -376,7 +374,7 @@
}
}
- private void syncOutWrappedParameters(Class[] targetParameterTypes, Object[] payload)
+ private void syncOutWrappedParameters(Class<?>[] targetParameterTypes, Object[]
payload)
{
ParameterMetaData returnMetaData = opMetaData.getReturnParameter();
if (returnMetaData != null)
@@ -395,7 +393,7 @@
}
catch (Exception e)
{
- throw new WSException(BundleUtils.getMessage(bundle,
"COULD_NOT_ADD_OUTPUT_PARAM", param.getName()), e);
+ throw new WSException(e);
}
}
Deleted:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/Message.properties
===================================================================
---
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/Message.properties 2012-10-11
10:07:17 UTC (rev 16858)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/Message.properties 2012-10-11
14:38:55 UTC (rev 16859)
@@ -1,37 +0,0 @@
-MESSAGECONTEXT_NOT_AVAILABLE=MessageContext not available
-CANNOT_FIND_RPC_ELEMENT=Cannot find RPC element in
-INVALID_NUMBER_OF_PAYLOAD_ELEMENTS=Invalid number of payload elements: {0}
-EMPTY_SOAP_BODY=Cannot unbind response message with empty soap body
-CANNOT_SET_FAULT_MESSAGE=Cannot set fault message in message context
-EXPECTED_SOAP11=Expected SOAP-1.1 envelope, but got: {0}
-EXPECTED_SOAP12=Expected SOAP-1.2 envelope, but got: {0}
-MIME_TYPE_NOT_ALLOWED=Mime type {0}not allowed for parameter {1} allowed types are {2}
-COULD_NOT_DETERMINE_MIME_TYPE=Could not determine mime type for attachment parameter:
{0}
-COULD_NOT_LOCATE_ATTACHMENT=Could not locate attachment for parameter: {0}
-JAVATYPE_IS_NOT_ASSIGNABLE=javaType {0} is not assignable from: {1}
-CANNOT_FIND_CHILD_ELEMENT=Cannot find child element: {0}
-MESSAGECONTEXT_NOT_AVAILABLE=MessageContext not available
-OPERATION_DOES_NOT_HAVE_A_RETURN_VALUE=Operation does not have a return value: {0}
-CANNOT_OBTAIN_XML_TYPE=Cannot obtain xml type for: [xmlName={0},javaName={1}]
-MIME_TYPE_NOT_ALLOWED=Mime type {0} not allowed for parameter {1} allowed types are {2}
-JAVATYPE_IS_NOT_ASSIGNABLE=javaType [{0}] is not assignable from attachment content: {1}
-PARAMETER_NOT_ASSIGNABLE=Parameter {0} not assignable from {1}
-COULD_NOT_ADD_OUTPUT_PARAM=Could not add output param: {0}
-CANNOT_TRACE_SOAPMESSAGE=Cannot trace SOAPMessage
-UNSUPPORTED_MESSAGE_TYPE=Unsupported message type: {0}
-NO_SOAPMESSAGE_AVILABLE=No SOAPMessage avilable. Current message context carries {0}
-CANNOT_SET_VALUE_FOR_HANDLER_SCOPED_PROPERTY=Cannot set value for HANDLER scoped
property: {0}
-CANNOT_SET_REMOVE_FOR_HANDLER_SCOPED_PROPERTY=Cannot set remove for HANDLER scoped
property: {0}
-FAILED_TO_CLEANUP_ATTACHMENT_PART=Failed to cleanup attachment part
-CANNOT_GET_EPR=Cannot get EPR for BindingProvider instances using the XML/HTTP binding
-CANNOT_GET_EPR_FROM_EMD=Cannot get endpoint reference info from endpoint metadata!
-CANNOT_FIND_ENDPOINT_FOR_NAME=Cannot find endpoint for name: {0}
-OPERATION_NAME_NOT_SET=Operation name not set
-CANNOT_GET_OPERATIONMETADATA=Cannot get OperationMetaData for null
-CANNOT_OBTAIN_OPERATION_META_DATA_FOR=Cannot obtain operation meta data for: {0}
-TARGET_ENDPOINT_ADDRESS_NOT_SET=Target endpoint address not set
-EXCEPTION_WHILE_PERFORMING_INVOCATION=Exception caught while (preparing for) performing
the invocation:
-RPC_LITERAL_OPERATION_PARAMS_IS_NULL=The RPC/Literal Operation [{0}] parameters can not
be null
-RPC_LITERAL_OPERATION_RETURN_IS_NULL=THE_RPC/LITERAL_OPERATION [{0}] return value can not
be null, it's WS-BP:2211 violation
-CANNOT_FIND_UNBOUND_HEADER=Cannot find unbound header: {0}
-CANNOT_CREATE_ATTACHMENT_PART=Cannot create attachment part
Modified:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/MessageTrace.java
===================================================================
---
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/MessageTrace.java 2012-10-11
10:07:17 UTC (rev 16858)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/MessageTrace.java 2012-10-11
14:38:55 UTC (rev 16859)
@@ -23,7 +23,6 @@
import java.io.ByteArrayInputStream;
import java.io.StringWriter;
-import java.util.ResourceBundle;
import javax.xml.soap.SOAPEnvelope;
import javax.xml.soap.SOAPMessage;
@@ -34,7 +33,7 @@
import javax.xml.transform.stream.StreamSource;
import org.jboss.logging.Logger;
-import org.jboss.ws.api.util.BundleUtils;
+import org.jboss.ws.NativeMessages;
import org.jboss.ws.common.DOMWriter;
import org.jboss.ws.core.soap.SOAPMessageImpl;
import org.jboss.ws.core.soap.attachment.MimeConstants;
@@ -58,7 +57,6 @@
*/
public final class MessageTrace
{
- private static final ResourceBundle bundle =
BundleUtils.getBundle(MessageTrace.class);
private static final Logger msgLog = Logger.getLogger(MessageTrace.class);
private static ServerConfig serverConfig = null;
private static boolean serverConfigInit = false;
@@ -127,7 +125,7 @@
}
catch (Exception ex)
{
- msgLog.error(BundleUtils.getMessage(bundle,
"CANNOT_TRACE_SOAPMESSAGE"), ex);
+ msgLog.error(NativeMessages.MESSAGES.cannotTraceSOAPMessage(), ex);
}
}
else if (message instanceof byte[])
@@ -144,7 +142,7 @@
}
else
{
- msgLog.warn(BundleUtils.getMessage(bundle,
"UNSUPPORTED_MESSAGE_TYPE", message));
+ msgLog.warn(NativeMessages.MESSAGES.unsupportedMessageType(message));
}
}
Deleted:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/accessor/Message.properties
===================================================================
---
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/accessor/Message.properties 2012-10-11
10:07:17 UTC (rev 16858)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/accessor/Message.properties 2012-10-11
14:38:55 UTC (rev 16859)
@@ -1,4 +0,0 @@
-COULD_NOT_OBTAIN_ACCESSOR=Could not obtain accessor for parameter: {0}
-FIELD_CAN_NOT_BE_STATIC=Field can not be static: {0}
-ERROR_ACCESSING_FIELD=Error accessing field: {0}: {1}
-JAXBCONTEXT_NOT_AVAILABLE=JAXBContext not available
Modified:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/accessor/ReflectiveFieldAccessorFactory.java
===================================================================
---
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/accessor/ReflectiveFieldAccessorFactory.java 2012-10-11
10:07:17 UTC (rev 16858)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/accessor/ReflectiveFieldAccessorFactory.java 2012-10-11
14:38:55 UTC (rev 16859)
@@ -23,18 +23,16 @@
import java.lang.reflect.Field;
import java.lang.reflect.Modifier;
-import java.util.ResourceBundle;
+import org.jboss.ws.NativeMessages;
import org.jboss.ws.WSException;
-import org.jboss.ws.api.util.BundleUtils;
import org.jboss.ws.metadata.umdm.WrappedParameter;
final class ReflectiveFieldAccessorFactory implements AccessorFactory
{
- private static final ResourceBundle bundle =
BundleUtils.getBundle(ReflectiveFieldAccessorFactory.class);
- private final Class clazz;
+ private final Class<?> clazz;
- ReflectiveFieldAccessorFactory(Class clazz)
+ ReflectiveFieldAccessorFactory(Class<?> clazz)
{
this.clazz = clazz;
}
@@ -58,15 +56,13 @@
}
if (Modifier.isStatic(field.getModifiers()))
- throw new WSException(BundleUtils.getMessage(bundle,
"FIELD_CAN_NOT_BE_STATIC", fieldName));
+ throw NativeMessages.MESSAGES.fieldCannotBeStatic(fieldName);
return new ReflectiveFieldAccessor(field);
}
catch (Throwable t)
{
- WSException ex = new WSException(BundleUtils.getMessage(bundle,
"ERROR_ACCESSING_FIELD", new Object[]{ fieldName , t.getMessage()}));
- ex.setStackTrace(t.getStackTrace());
- throw ex;
+ throw new WSException(t);
}
}
}
Modified:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/accessor/ReflectiveMethodAccessorFactory.java
===================================================================
---
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/accessor/ReflectiveMethodAccessorFactory.java 2012-10-11
10:07:17 UTC (rev 16858)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/accessor/ReflectiveMethodAccessorFactory.java 2012-10-11
14:38:55 UTC (rev 16859)
@@ -28,9 +28,9 @@
final class ReflectiveMethodAccessorFactory implements AccessorFactory
{
- private final Class clazz;
+ private final Class<?> clazz;
- ReflectiveMethodAccessorFactory(Class clazz)
+ ReflectiveMethodAccessorFactory(Class<?> clazz)
{
this.clazz = clazz;
}
Deleted:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/builder/Message.properties
===================================================================
---
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/builder/Message.properties 2012-10-11
10:07:17 UTC (rev 16858)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/builder/Message.properties 2012-10-11
14:38:55 UTC (rev 16859)
@@ -1,11 +0,0 @@
-CANNOT_OBTAIN_BINDING=Cannot obtain binding: {0}
-CANNOT_GET_EJB_LINK=Cannot obtain ejb-link from port component
-CANNOT_GET_EJB_META_DATA=Cannot obtain ejb meta data for: {0}
-SERVICE_PATH_CANNOT_BE_NULL=Service path cannot be null
-MALFORMED_URL_DETAIL=Malformed URL: uriScheme={0} host={1} port={2} servicePath={3}
-CANNOT_FIND_URL_PATTERN=Cannot find <url-pattern> for servlet-name: {0}
-MALFORMED_URL=Malformed URL: {0}
-CANNOT_FIND_PORT_IN_WSDL=Cannot find port in wsdl: {0}
-CANNOT_FIND_PORT=Cannot find port with name '{0}' in wsdl document
-CANNOT_OBTAIN_FAULT_TYPE=Cannot obtain fault type for element: {0}
-CANNOT_OBTAIN_JAVA_TYPE_MAPPING=Cannot obtain java type mapping for: {0}
Modified:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/builder/MetaDataBuilder.java
===================================================================
---
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/builder/MetaDataBuilder.java 2012-10-11
10:07:17 UTC (rev 16858)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/builder/MetaDataBuilder.java 2012-10-11
14:38:55 UTC (rev 16859)
@@ -21,6 +21,7 @@
*/
package org.jboss.ws.metadata.builder;
+import static org.jboss.ws.NativeMessages.MESSAGES;
import static org.jboss.ws.common.integration.WSHelper.isJseEndpoint;
import java.io.IOException;
@@ -31,7 +32,6 @@
import java.util.Iterator;
import java.util.List;
import java.util.Map;
-import java.util.ResourceBundle;
import javax.management.ObjectName;
import javax.wsdl.Definition;
@@ -43,8 +43,8 @@
import javax.xml.namespace.QName;
import org.jboss.logging.Logger;
+import org.jboss.ws.NativeLoggers;
import org.jboss.ws.WSException;
-import org.jboss.ws.api.util.BundleUtils;
import org.jboss.ws.common.Constants;
import org.jboss.ws.common.ObjectNameFactory;
import org.jboss.ws.core.jaxrpc.UnqualifiedFaultException;
@@ -83,7 +83,6 @@
*/
public abstract class MetaDataBuilder
{
- private static final ResourceBundle bundle =
BundleUtils.getBundle(MetaDataBuilder.class);
// provide logging
private final static Logger log = Logger.getLogger(MetaDataBuilder.class);
@@ -119,7 +118,7 @@
QName bindQName = wsdlEndpoint.getBinding();
WSDLBinding wsdlBinding = wsdlDefinitions.getBinding(bindQName);
if (wsdlBinding == null)
- throw new WSException(BundleUtils.getMessage(bundle,
"CANNOT_OBTAIN_BINDING", bindQName));
+ throw MESSAGES.cannotObtainBinding(bindQName);
for (WSDLBindingOperation wsdlBindingOperation :
wsdlBinding.getOperations())
{
@@ -203,7 +202,7 @@
public static String getServiceEndpointAddress(String uriScheme, String servicePath,
int servicePort, ServerConfig config)
{
if (servicePath == null || servicePath.length() == 0)
- throw new WSException(BundleUtils.getMessage(bundle,
"SERVICE_PATH_CANNOT_BE_NULL"));
+ throw MESSAGES.servicePathCannotBeNull();
if (servicePath.endsWith("/*"))
servicePath = servicePath.substring(0, servicePath.length() - 2);
@@ -253,7 +252,7 @@
}
catch (MalformedURLException e)
{
- throw new WSException(BundleUtils.getMessage(bundle,
"MALFORMED_URL_DETAIL", new Object[]{ uriScheme , host , port , servicePath
}), e);
+ throw new WSException(e);
}
}
@@ -270,7 +269,7 @@
String urlPattern = servletMappings.get(servletLink);
if (urlPattern == null)
- throw new WSException(BundleUtils.getMessage(bundle,
"CANNOT_FIND_URL_PATTERN", servletLink));
+ throw MESSAGES.cannotFindURLPatternForServletName(servletLink);
List<JSESecurityMetaData> securityList =
webMetaData.getSecurityMetaData();
for (JSESecurityMetaData currentSecurity : securityList)
@@ -342,7 +341,7 @@
}
catch (MalformedURLException e)
{
- log.warn(BundleUtils.getMessage(bundle, "MALFORMED_URL",
orgAddress));
+ NativeLoggers.ROOT_LOGGER.malformedURL(orgAddress);
sepMetaData.setEndpointAddress(orgAddress);
}
}
@@ -351,7 +350,7 @@
}
if (endpointFound == false)
- throw new WSException(BundleUtils.getMessage(bundle,
"CANNOT_FIND_PORT_IN_WSDL", portName));
+ throw MESSAGES.cannotFindPortInWsdl(portName);
}
private static boolean requiresRewrite(String orgAddress, String uriScheme,
ServerConfig config)
@@ -389,11 +388,11 @@
if (!wsdlOneOneDefinition.getImports().isEmpty())
{
- Iterator imports = wsdlOneOneDefinition.getImports().values().iterator();
+ Iterator<?> imports =
wsdlOneOneDefinition.getImports().values().iterator();
while (imports.hasNext())
{
- List l = (List)imports.next();
- Iterator importsByNS = l.iterator();
+ List<?> l = (List<?>)imports.next();
+ Iterator<?> importsByNS = l.iterator();
while (importsByNS.hasNext())
{
Import anImport = (Import)importsByNS.next();
@@ -405,7 +404,7 @@
}
}
- throw new IllegalArgumentException(BundleUtils.getMessage(bundle,
"CANNOT_FIND_PORT", portQName ));
+ throw MESSAGES.cannotFindPortInWsdl2(portQName);
}
/**
@@ -487,7 +486,7 @@
if (xmlType == null)
{
- log.warn(BundleUtils.getMessage(bundle, "CANNOT_OBTAIN_FAULT_TYPE",
xmlName));
+ NativeLoggers.ROOT_LOGGER.cannotObtainFaultTypeForElement(xmlName);
xmlType = xmlName;
}
@@ -497,7 +496,7 @@
if (javaTypeName == null)
{
- log.warn(BundleUtils.getMessage(bundle,
"CANNOT_OBTAIN_JAVA_TYPE_MAPPING", xmlType));
+ NativeLoggers.ROOT_LOGGER.cannotObtainJavaTypeMappingFor(xmlType);
javaTypeName = new UnqualifiedFaultException(xmlType).getClass().getName();
}
Modified:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/builder/jaxrpc/JAXRPCClientMetaDataBuilder.java
===================================================================
---
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/builder/jaxrpc/JAXRPCClientMetaDataBuilder.java 2012-10-11
10:07:17 UTC (rev 16858)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/builder/jaxrpc/JAXRPCClientMetaDataBuilder.java 2012-10-11
14:38:55 UTC (rev 16859)
@@ -23,14 +23,13 @@
import java.io.IOException;
import java.net.URL;
-import java.util.ResourceBundle;
import java.util.Set;
import javax.xml.namespace.QName;
-import org.jboss.logging.Logger;
+import org.jboss.ws.NativeLoggers;
+import org.jboss.ws.NativeMessages;
import org.jboss.ws.WSException;
-import org.jboss.ws.api.util.BundleUtils;
import org.jboss.ws.common.Constants;
import org.jboss.ws.common.ResourceLoaderAdapter;
import org.jboss.ws.metadata.jaxrpcmapping.JavaWsdlMapping;
@@ -57,10 +56,6 @@
*/
public class JAXRPCClientMetaDataBuilder extends JAXRPCMetaDataBuilder
{
- private static final ResourceBundle bundle =
BundleUtils.getBundle(JAXRPCClientMetaDataBuilder.class);
- // provide logging
- private final Logger log = Logger.getLogger(JAXRPCClientMetaDataBuilder.class);
-
/** Build from WSDL and jaxrpc-mapping.xml
*/
public ServiceMetaData buildMetaData(QName serviceQName, URL wsdlURL, URL mappingURL,
@@ -83,7 +78,7 @@
}
catch (Exception ex)
{
- throw new WSException(BundleUtils.getMessage(bundle,
"CANNOT_BUILD_META_DATA", ex.getMessage()), ex);
+ throw new WSException(ex);
}
}
@@ -131,7 +126,7 @@
}
catch (Exception ex)
{
- throw new WSException(BundleUtils.getMessage(bundle,
"CANNOT_BUILD_META_DATA", ex.getMessage()), ex);
+ throw new WSException(ex);
}
}
@@ -144,9 +139,6 @@
WSDLService wsdlService = null;
if (serviceQName == null)
{
- if (wsdlDefinitions.getServices().length != 1)
- throw new IllegalArgumentException(BundleUtils.getMessage(bundle,
"EXPECTED_A_SINGLE_SERVICE_ELEMENT"));
-
wsdlService = wsdlDefinitions.getServices()[0];
serviceMetaData.setServiceName(wsdlService.getName());
}
@@ -155,7 +147,7 @@
wsdlService = wsdlDefinitions.getService(serviceQName);
}
if (wsdlService == null)
- throw new IllegalArgumentException(BundleUtils.getMessage(bundle,
"CANNOT_OBTAIN_WSDL_SERVICE", serviceQName));
+ throw NativeMessages.MESSAGES.cannotObtainWSDLService(serviceQName);
// Build type mapping meta data
setupTypesMetaData(serviceMetaData);
@@ -191,7 +183,7 @@
}
else
{
- log.warn(BundleUtils.getMessage(bundle,
"CANNOT_OBTAIN_SEI_MAPPING", portType));
+
NativeLoggers.ROOT_LOGGER.cannotObtainSEIMappingFor(portType.toString());
}
}
Modified:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/builder/jaxrpc/JAXRPCMetaDataBuilder.java
===================================================================
---
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/builder/jaxrpc/JAXRPCMetaDataBuilder.java 2012-10-11
10:07:17 UTC (rev 16858)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/builder/jaxrpc/JAXRPCMetaDataBuilder.java 2012-10-11
14:38:55 UTC (rev 16859)
@@ -21,19 +21,18 @@
*/
package org.jboss.ws.metadata.builder.jaxrpc;
+import static org.jboss.ws.NativeMessages.MESSAGES;
+
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
-import java.util.ResourceBundle;
import javax.xml.namespace.QName;
import javax.xml.rpc.ParameterMode;
import javax.xml.rpc.encoding.TypeMappingRegistry;
import org.jboss.logging.Logger;
-import org.jboss.ws.WSException;
-import org.jboss.ws.api.util.BundleUtils;
import org.jboss.ws.common.Constants;
import org.jboss.ws.common.JavaUtils;
import org.jboss.ws.core.binding.TypeMappingImpl;
@@ -85,7 +84,6 @@
*/
public abstract class JAXRPCMetaDataBuilder extends MetaDataBuilder
{
- private static final ResourceBundle bundle =
BundleUtils.getBundle(JAXRPCMetaDataBuilder.class);
// provide logging
final Logger log = Logger.getLogger(JAXRPCMetaDataBuilder.class);
@@ -151,12 +149,8 @@
String opName = opQName.getLocalPart();
WSDLBindingOperation wsdlBindingOperation =
wsdlOperation.getBindingOperation();
- if (wsdlBindingOperation == null)
+ if (wsdlBindingOperation != null)
{
- log.warn(BundleUtils.getMessage(bundle, "COULD_NOT_LOCATE_BP",
opQName));
- }
- else
- {
// Change operation according namespace defined on binding
// <soap:body use="encoded"
namespace="http://MarshallTestW2J.org/"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
String namespaceURI = wsdlBindingOperation.getNamespaceURI();
@@ -173,7 +167,7 @@
seiMethodMapping =
seiMapping.getServiceEndpointMethodMappingByWsdlOperation(opName);
if (seiMethodMapping == null)
- throw new WSException(BundleUtils.getMessage(bundle,
"CANNOT_OBTAIN_METHOD_MAPPING", opName));
+ throw MESSAGES.cannotObtainMethodMappingFor(opQName);
javaName = seiMethodMapping.getJavaMethodName();
}
@@ -233,8 +227,7 @@
}
else if (!optional)
{
- throw new WSException(BundleUtils.getMessage(bundle,
"CANNOT_OBTAIN_METHOD_PARAMETER_MAPPING", new Object[]{partName,
seiMethodMapping.getWsdlOperation()}));
-
+ throw MESSAGES.cannotObtainMethodParameterMappingFor(partName,
seiMethodMapping.getWsdlOperation());
}
}
@@ -249,12 +242,13 @@
if (packageName != null)
{
javaTypeName = packageName + "." + xmlType.getLocalPart();
- log.warn(BundleUtils.getMessage(bundle, "GUESS_JAVA_TYPE", new
Object[]{ xmlType , javaTypeName }));
+ if (log.isDebugEnabled())
+ log.debug("Guess java type from package mapping: [xmlType=" +
xmlType + " javaType=" + javaTypeName + "]");
}
}
if (javaTypeName == null)
- throw new WSException(BundleUtils.getMessage(bundle,
"CANNOT_OBTAIN_JAVA_TYPE_MAPPING", xmlType));
+ throw MESSAGES.cannotObtainJavaTypeMappingFor(xmlType);
ParameterMetaData inMetaData = new ParameterMetaData(opMetaData, xmlName, xmlType,
javaTypeName);
inMetaData.setPartName(partName);
@@ -329,12 +323,13 @@
if (packageName != null)
{
javaTypeName = packageName + "." + xmlType.getLocalPart();
- log.warn(BundleUtils.getMessage(bundle, "GUESS_JAVA_TYPE", new
Object[]{ xmlType, javaTypeName}));
+ if (log.isDebugEnabled())
+ log.debug("Guess java type from package mapping: [xmlType=" +
xmlType + " javaType=" + javaTypeName + "]");
}
}
if (javaTypeName == null)
- throw new WSException(BundleUtils.getMessage(bundle,
"CANNOT_OBTAIN_JAVA_TYPE_MAPPING", xmlType));
+ throw MESSAGES.cannotObtainJavaTypeMappingFor(xmlType);
ParameterMetaData outMetaData = new ParameterMetaData(opMetaData, xmlName, xmlType,
javaTypeName);
outMetaData.setPartName(partName);
@@ -515,7 +510,7 @@
WSDLBindingOperation bindingOperation = wsdlOperation.getBindingOperation();
if (bindingOperation == null)
- throw new WSException(BundleUtils.getMessage(bundle,
"COULD_NOT_LOCATE_BP", opMetaData.getQName()));
+ throw MESSAGES.cannotLocateBindingOperationFor(opMetaData.getQName());
// RPC has one input
WSDLInterfaceOperationInput input = wsdlOperation.getInputs()[0];
@@ -563,7 +558,7 @@
}
else if (wsdlOperation.getPattern() != Constants.WSDL20_PATTERN_IN_ONLY)
{
- throw new WSException(BundleUtils.getMessage(bundle,
"RPC_STYLE_WAS_MISSING_AN_OUTPUT"));
+ throw MESSAGES.rpcStyleMissingOutputAndNotAInOnlyMEP();
}
}
@@ -585,7 +580,7 @@
javaTypeName = typeMetaData.getJavaTypeName();
if (javaTypeName == null)
- throw new WSException(BundleUtils.getMessage(bundle,
"CANNOT_OBTAIN_JAVA_TYPE_MAPPING", xmlType));
+ throw MESSAGES.cannotObtainJavaTypeMappingFor(xmlType);
// Check if we need to wrap the parameters
boolean isWrapped = isWrapped(seiMethodMapping, javaTypeName);
@@ -598,12 +593,12 @@
if (inMetaData.getOperationMetaData().isDocumentWrapped())
{
if (seiMethodMapping == null)
- throw new IllegalArgumentException(BundleUtils.getMessage(bundle,
"CANNOT_WRAP_PARAMETERS"));
+ throw MESSAGES.cannotWrapParametersWithoutSEIMethodMapping();
ServiceEndpointInterfaceMapping seiMapping =
seiMethodMapping.getServiceEndpointInterfaceMapping();
JavaXmlTypeMapping javaXmlTypeMapping =
seiMapping.getJavaWsdlMapping().getTypeMappingForQName(xmlType);
if (javaXmlTypeMapping == null)
- throw new WSException(BundleUtils.getMessage(bundle,
"CANNOT_OBTAIN_JAVA/XML_TYPE_MAPPING", xmlType));
+ throw MESSAGES.cannotObtainJavaXmlTypeMappingFor(xmlType);
Map<String, String> variableMap =
createVariableMappingMap(javaXmlTypeMapping.getVariableMappings());
for (MethodParamPartsMapping partMapping :
seiMethodMapping.getMethodParamPartsMappings())
@@ -612,9 +607,6 @@
if (wsdlMessageMapping.isSoapHeader())
continue;
- if (wsdlMessageMapping == null)
- throw new IllegalArgumentException(BundleUtils.getMessage(bundle,
"M2M_MAPPING_REQUIRED"));
-
String elementName = wsdlMessageMapping.getWsdlMessagePartName();
// Skip attachments
@@ -623,13 +615,13 @@
String variable = variableMap.get(elementName);
if (variable == null)
- throw new IllegalArgumentException(BundleUtils.getMessage(bundle,
"COULD_NOT_DETERMINE_VARIABLE_NAME", elementName));
+ throw MESSAGES.couldNotDetermineVariableNameForElement(elementName);
WrappedParameter wrapped = new WrappedParameter(new QName(elementName),
partMapping.getParamType(), variable, partMapping.getParamPosition());
String parameterMode = wsdlMessageMapping.getParameterMode();
if (parameterMode == null || parameterMode.length() < 2)
- throw new IllegalArgumentException(BundleUtils.getMessage(bundle,
"INVALID_PARAMETER_MODE", elementName));
+ throw MESSAGES.invalidParameterModeForElement(elementName);
if (!"OUT".equals(parameterMode))
wrappedParameters.add(wrapped);
@@ -735,7 +727,7 @@
javaTypeName =
typesMetaData.getTypeMappingByXMLType(xmlType).getJavaTypeName();
if (javaTypeName == null)
- throw new WSException(BundleUtils.getMessage(bundle,
"CANNOT_OBTAIN_JAVA/XML_TYPE_MAPPING", xmlType));
+ throw MESSAGES.cannotObtainJavaXmlTypeMappingFor(xmlType);
ParameterMetaData outMetaData = new ParameterMetaData(opMetaData, xmlName, xmlType,
javaTypeName);
@@ -743,7 +735,7 @@
if (opMetaData.isDocumentWrapped())
{
if (seiMethodMapping == null)
- throw new IllegalArgumentException(BundleUtils.getMessage(bundle,
"CANNOT_WRAP_PARAMETERS"));
+ throw MESSAGES.cannotWrapParametersWithoutSEIMethodMapping();
WsdlReturnValueMapping returnValueMapping =
seiMethodMapping.getWsdlReturnValueMapping();
if (returnValueMapping != null)
@@ -752,7 +744,7 @@
JavaWsdlMapping javaWsdlMapping = seiMapping.getJavaWsdlMapping();
JavaXmlTypeMapping javaXmlTypeMapping =
javaWsdlMapping.getTypeMappingForQName(xmlType);
if (javaXmlTypeMapping == null)
- throw new WSException(BundleUtils.getMessage(bundle,
"CANNOT_OBTAIN_JAVA/XML_TYPE_MAPPING", xmlType));
+ throw MESSAGES.cannotObtainJavaXmlTypeMappingFor(xmlType);
Map<String, String> map =
createVariableMappingMap(javaXmlTypeMapping.getVariableMappings());
if (map.size() > 0)
@@ -760,7 +752,7 @@
String elementName = returnValueMapping.getWsdlMessagePartName();
String variable = map.get(elementName);
if (variable == null)
- throw new IllegalArgumentException(BundleUtils.getMessage(bundle,
"COULD_NOT_DETERMINE_VARIABLE_NAME", elementName));
+ throw MESSAGES.couldNotDetermineVariableNameForElement(elementName);
String wrappedType = returnValueMapping.getMethodReturnValue();
QName element = new QName(elementName);
@@ -791,7 +783,7 @@
return wsdlPosition;
}
- throw new WSException(BundleUtils.getMessage(bundle,
"COULD_NOT_UPDATE_IN_PARAMETER", opOutput.getPartName()));
+ throw
MESSAGES.couldNotUpdateInParameterAsIndicated(opOutput.getPartName());
}
// It's potentialy possible that an input parameter could exist with the
same part name
else if ("OUT".equals(mode))
@@ -836,7 +828,7 @@
WSDLBindingOperation bindingOperation = wsdlOperation.getBindingOperation();
if (bindingOperation == null)
- throw new WSException(BundleUtils.getMessage(bundle,
"COULD_NOT_LOCATE_BP", bindingOperation));
+ throw MESSAGES.cannotLocateBindingOperationFor(wsdlOperation.getName());
List<WrappedParameter> wrappedParameters = new
ArrayList<WrappedParameter>();
List<WrappedParameter> wrappedResponseParameters = new
ArrayList<WrappedParameter>();
Modified:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/builder/jaxrpc/JAXRPCServerMetaDataBuilder.java
===================================================================
---
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/builder/jaxrpc/JAXRPCServerMetaDataBuilder.java 2012-10-11
10:07:17 UTC (rev 16858)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/builder/jaxrpc/JAXRPCServerMetaDataBuilder.java 2012-10-11
14:38:55 UTC (rev 16859)
@@ -21,15 +21,16 @@
*/
package org.jboss.ws.metadata.builder.jaxrpc;
-import java.util.ResourceBundle;
+import static org.jboss.ws.NativeMessages.MESSAGES;
+
import java.util.Set;
import javax.management.ObjectName;
import javax.xml.namespace.QName;
import org.jboss.logging.Logger;
+import org.jboss.ws.NativeLoggers;
import org.jboss.ws.WSException;
-import org.jboss.ws.api.util.BundleUtils;
import org.jboss.ws.metadata.jaxrpcmapping.JavaWsdlMapping;
import org.jboss.ws.metadata.jaxrpcmapping.ServiceEndpointInterfaceMapping;
import org.jboss.ws.metadata.umdm.HandlerMetaDataJAXRPC;
@@ -59,7 +60,6 @@
*/
public class JAXRPCServerMetaDataBuilder extends JAXRPCMetaDataBuilder
{
- private static final ResourceBundle bundle =
BundleUtils.getBundle(JAXRPCServerMetaDataBuilder.class);
// provide logging
final Logger log = Logger.getLogger(JAXRPCServerMetaDataBuilder.class);
@@ -76,8 +76,7 @@
UnifiedMetaData wsMetaData = new UnifiedMetaData(dep.getRootFile());
wsMetaData.setDeploymentName(dep.getCanonicalName());
ClassLoader runtimeClassLoader = dep.getRuntimeClassLoader();
- if(null == runtimeClassLoader)
- throw new IllegalArgumentException(BundleUtils.getMessage(bundle,
"RUNTIME_LOADER_CANNOT_BE_NULL"));
+ assert(runtimeClassLoader != null);
wsMetaData.setClassLoader(runtimeClassLoader);
WebservicesMetaData jaxrpcMapping =
dep.getAttachment(WebservicesMetaData.class);
@@ -100,7 +99,7 @@
serviceMetaData.setMappingLocation(dep.getResourceResolver().resolve(mappingFile));
JavaWsdlMapping javaWsdlMapping = serviceMetaData.getJavaWsdlMapping();
if (javaWsdlMapping == null)
- throw new WSException(BundleUtils.getMessage(bundle,
"MAPPING_FILE_NOT_CONFIGURED"));
+ throw MESSAGES.mappingFileNotConfigured();
// Build type mapping meta data
setupTypesMetaData(serviceMetaData);
@@ -118,13 +117,12 @@
{
String nsURI = wsdlDefinitions.getTargetNamespace();
portName = new QName(nsURI, portName.getLocalPart());
- log.warn(BundleUtils.getMessage(bundle, "ADDING_WSDL_TNS",
portName));
pcMetaData.setWsdlPort(portName);
}
WSDLEndpoint wsdlEndpoint = getWsdlEndpoint(wsdlDefinitions, portName);
if (wsdlEndpoint == null)
- throw new WSException(BundleUtils.getMessage(bundle,
"CANNOT_FIND_PORT", portName));
+ throw MESSAGES.cannotFindPortInWsdl(portName);
// set service name
serviceMetaData.setServiceName(wsdlEndpoint.getWsdlService().getName());
@@ -155,7 +153,7 @@
// Copy <port-component> meta data
EJBMetaData bmd = apMetaData.getBeanByEjbName(linkName);
if (bmd == null)
- throw new WSException(BundleUtils.getMessage(bundle,
"CANNOT_OBTAIN_UNIFIEDBEANMETADATA", linkName));
+ throw MESSAGES.cannotObtainUnifiedBeanMetaData(linkName);
EJBSecurityMetaData smd = bmd.getSecurityMetaData();
if (smd != null)
@@ -193,7 +191,7 @@
ServiceEndpointInterfaceMapping seiMapping =
javaWsdlMapping.getServiceEndpointInterfaceMapping(seiName);
if (seiMapping == null)
- log.warn(BundleUtils.getMessage(bundle,
"CANNOT_OBTAIN_SEI_MAPPING", seiName));
+ NativeLoggers.ROOT_LOGGER.cannotObtainSEIMappingFor(seiName);
// Setup the endpoint operations
setupOperationsFromWSDL(sepMetaData, wsdlEndpoint, seiMapping);
@@ -221,7 +219,7 @@
}
catch (Exception ex)
{
- throw new WSException(BundleUtils.getMessage(bundle,
"CANNOT_BUILD_META_DATA", ex.getMessage()), ex);
+ throw new WSException(ex);
}
}
Deleted:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/builder/jaxrpc/Message.properties
===================================================================
---
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/builder/jaxrpc/Message.properties 2012-10-11
10:07:17 UTC (rev 16858)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/builder/jaxrpc/Message.properties 2012-10-11
14:38:55 UTC (rev 16859)
@@ -1,24 +0,0 @@
-RUNTIME_LOADER_CANNOT_BE_NULL=Runtime loader cannot be null
-MAPPING_FILE_NOT_CONFIGURED=jaxrpc-mapping-file not configured from webservices.xml
-ADDING_WSDL_TNS=Adding wsdl targetNamespace to: {0}
-CANNOT_FIND_PORT=Cannot find port in wsdl: {0}
-CANNOT_OBTAIN_UNIFIEDBEANMETADATA=Cannot obtain UnifiedBeanMetaData for: {0}
-CANNOT_OBTAIN_SEI_MAPPING=Cannot obtain SEI mapping for: {0}
-
-CANNOT_BUILD_META_DATA=Cannot build meta data: {0}
-EXPECTED_A_SINGLE_SERVICE_ELEMENT=Expected a single service element
-CANNOT_OBTAIN_WSDL_SERVICE=Cannot obtain wsdl service: {0}
-
-COULD_NOT_LOCATE_BP=Could not locate binding operation for:{0}
-CANNOT_OBTAIN_METHOD_MAPPING=Cannot obtain method mapping for: {0}
-CANNOT_OBTAIN_METHOD_PARAMETER_MAPPING=Cannot obtain method parameter mapping for message
part '{0}' in wsdl operation {1}
-GUESS_JAVA_TYPE=Guess java type from package mapping: [xmlType={0} javaType={1}]
-CANNOT_OBTAIN_JAVA_TYPE_MAPPING=Cannot obtain java type mapping for: {0}
-RPC_STYLE_WAS_MISSING_AN_OUTPUT=RPC style was missing an output, and was not an IN-ONLY
MEP.
-CANNOT_WRAP_PARAMETERS=Cannot wrap parameters without SEI method mapping
-CANNOT_OBTAIN_JAVA/XML_TYPE_MAPPING=Cannot obtain java/xml type mapping for: {0}
-M2M_MAPPING_REQUIRED=wsdl-message-message mapping required for document/literal wrapped
-COULD_NOT_DETERMINE_VARIABLE_NAME=Could not determine variable name for element: {0}
-INVALID_PARAMETER_MODE=Invalid parameter mode for element: {0}
-COULD_NOT_UPDATE_IN_PARAMETER=Could not update IN parameter to be INOUT, as indicated in
the mapping: {0}
-COULD_NOT_LOCATE_BINDING_OPERATION_FOR=Could not locate binding operation for:{0}
Modified:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/jaxrpcmapping/ExceptionMapping.java
===================================================================
---
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/jaxrpcmapping/ExceptionMapping.java 2012-10-11
10:07:17 UTC (rev 16858)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/jaxrpcmapping/ExceptionMapping.java 2012-10-11
14:38:55 UTC (rev 16859)
@@ -45,7 +45,7 @@
// The required <wsdl-message> element
private QName wsdlMessage;
// The optional <constructor-parameter-order> element
- private ArrayList constructorParameterOrder = new ArrayList();
+ private ArrayList<String> constructorParameterOrder = new
ArrayList<String>();
public ExceptionMapping(JavaWsdlMapping javaWsdlMapping)
{
@@ -101,7 +101,7 @@
if (constructorParameterOrder.size() > 0)
{
sb.append("<constructor-parameter-order>");
- for (Iterator i = constructorParameterOrder.iterator(); i.hasNext();)
+ for (Iterator<String> i = constructorParameterOrder.iterator();
i.hasNext();)
sb.append("<element-name>").append(i.next()).append("</element-name>");
sb.append("</constructor-parameter-order>");
}
Modified:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/jaxrpcmapping/JavaWsdlMapping.java
===================================================================
---
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/jaxrpcmapping/JavaWsdlMapping.java 2012-10-11
10:07:17 UTC (rev 16858)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/jaxrpcmapping/JavaWsdlMapping.java 2012-10-11
14:38:55 UTC (rev 16859)
@@ -25,12 +25,10 @@
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
-import java.util.ResourceBundle;
import javax.xml.namespace.QName;
-import org.jboss.logging.Logger;
-import org.jboss.ws.api.util.BundleUtils;
+import org.jboss.ws.NativeLoggers;
/**
* XML mapping of the java-wsdl-mapping root element in jaxrpc-mapping.xml
@@ -40,12 +38,8 @@
*/
public class JavaWsdlMapping implements Serializable
{
- private static final ResourceBundle bundle =
BundleUtils.getBundle(JavaWsdlMapping.class);
private static final long serialVersionUID = -142671631068024054L;
- // provide logging
- private static Logger log = Logger.getLogger(JavaWsdlMapping.class);
-
// One or more <package-mapping> elements
private List packageMappings = new ArrayList();
// Zero or more <java-xml-type-mapping> elements
@@ -145,7 +139,7 @@
}
if (typeMapping == null)
- log.warn(BundleUtils.getMessage(bundle, "CANNOT_FIND_MAPPING",
xmlType));
+ NativeLoggers.ROOT_LOGGER.cannotFindJAXRPCMappingForType(xmlType);
}
return typeMapping;
Modified:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/jaxrpcmapping/JavaWsdlMappingFactory.java
===================================================================
---
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/jaxrpcmapping/JavaWsdlMappingFactory.java 2012-10-11
10:07:17 UTC (rev 16858)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/jaxrpcmapping/JavaWsdlMappingFactory.java 2012-10-11
14:38:55 UTC (rev 16859)
@@ -24,12 +24,11 @@
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
-import java.util.ResourceBundle;
import javax.xml.namespace.QName;
import org.jboss.logging.Logger;
-import org.jboss.ws.api.util.BundleUtils;
+import org.jboss.ws.NativeMessages;
import org.jboss.ws.common.utils.ResourceURL;
import org.jboss.xb.binding.JBossXBException;
import org.jboss.xb.binding.ObjectModelFactory;
@@ -46,7 +45,6 @@
*/
public class JavaWsdlMappingFactory implements ObjectModelFactory
{
- private static final ResourceBundle bundle =
BundleUtils.getBundle(JavaWsdlMappingFactory.class);
// provide logging
private static Logger log = Logger.getLogger(JavaWsdlMappingFactory.class);
@@ -70,7 +68,7 @@
{
if (mappingURL == null)
{
- throw new IllegalArgumentException(BundleUtils.getMessage(bundle,
"URL_CANNOT_BE_NULL"));
+ throw NativeMessages.MESSAGES.illegalNullArgument("mappingURL");
}
// setup the XML binding Unmarshaller
@@ -83,7 +81,7 @@
}
catch (JBossXBException e)
{
- IOException ioex = new IOException(BundleUtils.getMessage(bundle,
"CANNOT_PARSE", mappingURL));
+ IOException ioex = NativeMessages.MESSAGES.cannotParse(mappingURL);
Throwable cause = e.getCause();
if (cause != null)
ioex.initCause(cause);
@@ -263,7 +261,7 @@
}
if (qname == null)
- throw new IllegalArgumentException(BundleUtils.getMessage(bundle,
"INVALID_ANONYMOUS_QNAME", value));
+ throw NativeMessages.MESSAGES.invalidAnonymousQName(value);
typeMapping.setAnonymousTypeQName(qname);
}
Deleted:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/jaxrpcmapping/Message.properties
===================================================================
---
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/jaxrpcmapping/Message.properties 2012-10-11
10:07:17 UTC (rev 16858)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/jaxrpcmapping/Message.properties 2012-10-11
14:38:55 UTC (rev 16859)
@@ -1,6 +0,0 @@
-CANNOT_FIND_MAPPING=Cannot find jaxrpc-mapping for type: {0}
-URL_CANNOT_BE_NULL=JAXRPC mapping URL cannot be null
-CANNOT_PARSE=Cannot parse: {0}
-INVALID_ANONYMOUS_QNAME=Invalid anonymous qname: {0}
-WSDLMESSAGEMAPPING_IS_NULL=wsdlMessageMapping is null
-INVALID_PARAMETER_MODE=Invalid parameter mode: {0}
Modified:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/jaxrpcmapping/MethodParamPartsMapping.java
===================================================================
---
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/jaxrpcmapping/MethodParamPartsMapping.java 2012-10-11
10:07:17 UTC (rev 16858)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/jaxrpcmapping/MethodParamPartsMapping.java 2012-10-11
14:38:55 UTC (rev 16859)
@@ -22,10 +22,7 @@
package org.jboss.ws.metadata.jaxrpcmapping;
import java.io.Serializable;
-import java.util.ResourceBundle;
-import org.jboss.ws.api.util.BundleUtils;
-
/**
* XML mapping of the
java-wsdl-mapping/service-endpoint-interface-mapping/service-endpoint-method-mapping/method-param-parts-mapping
element.
*
@@ -34,7 +31,6 @@
*/
public class MethodParamPartsMapping implements Serializable
{
- private static final ResourceBundle bundle =
BundleUtils.getBundle(MethodParamPartsMapping.class);
private static final long serialVersionUID = -1351920471783503813L;
// The parent <service-endpoint-method-mapping> element
@@ -92,8 +88,6 @@
StringBuffer sb = new StringBuffer();
sb.append("<method-param-parts-mapping><param-position>").append(paramPosition).append("</param-position>");
sb.append("<param-type>").append(paramType).append("</param-type>");
- if(wsdlMessageMapping == null)
- throw new IllegalStateException(BundleUtils.getMessage(bundle,
"WSDLMESSAGEMAPPING_IS_NULL"));
sb.append(wsdlMessageMapping.serialize());
sb.append("</method-param-parts-mapping>");
Modified:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/jaxrpcmapping/WsdlMessageMapping.java
===================================================================
---
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/jaxrpcmapping/WsdlMessageMapping.java 2012-10-11
10:07:17 UTC (rev 16858)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/jaxrpcmapping/WsdlMessageMapping.java 2012-10-11
14:38:55 UTC (rev 16859)
@@ -22,11 +22,10 @@
package org.jboss.ws.metadata.jaxrpcmapping;
import java.io.Serializable;
-import java.util.ResourceBundle;
import javax.xml.namespace.QName;
-import org.jboss.ws.api.util.BundleUtils;
+import org.jboss.ws.NativeMessages;
/**
* Created by IntelliJ IDEA.
@@ -36,7 +35,6 @@
*/
public class WsdlMessageMapping implements Serializable
{
- private static final ResourceBundle bundle =
BundleUtils.getBundle(WsdlMessageMapping.class);
private static final long serialVersionUID = -3212852147033081838L;
// The parent <method-param-parts-mapping> element
@@ -68,7 +66,7 @@
public void setParameterMode(String parameterMode)
{
if ("IN".equals(parameterMode) == false &&
"OUT".equals(parameterMode) == false &&
"INOUT".equals(parameterMode) == false)
- throw new IllegalArgumentException(BundleUtils.getMessage(bundle,
"INVALID_PARAMETER_MODE", parameterMode));
+ throw NativeMessages.MESSAGES.invalidParameterMode(parameterMode);
this.parameterMode = parameterMode;
}
Modified:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/umdm/EndpointConfigMetaData.java
===================================================================
---
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/umdm/EndpointConfigMetaData.java 2012-10-11
10:07:17 UTC (rev 16858)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/umdm/EndpointConfigMetaData.java 2012-10-11
14:38:55 UTC (rev 16859)
@@ -24,7 +24,6 @@
import java.util.ArrayList;
import java.util.List;
-import org.jboss.logging.Logger;
import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedHandlerMetaData.HandlerType;
/**
@@ -40,9 +39,6 @@
*/
public class EndpointConfigMetaData
{
-
- private static Logger log = Logger.getLogger(EndpointConfigMetaData.class);
-
private final EndpointMetaData epMetaData;
// The optional handlers
private List<HandlerMetaData> handlers = new
ArrayList<HandlerMetaData>();
@@ -96,8 +92,6 @@
void configHandlerMetaData()
{
- log.debug("Configure EndpointMetaData");
-
List<HandlerMetaData> sepHandlers =
getHandlerMetaData(HandlerType.ENDPOINT);
clearHandlers();
Modified:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/umdm/EndpointMetaData.java
===================================================================
---
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/umdm/EndpointMetaData.java 2012-10-11
10:07:17 UTC (rev 16858)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/umdm/EndpointMetaData.java 2012-10-11
14:38:55 UTC (rev 16859)
@@ -21,6 +21,8 @@
*/
package org.jboss.ws.metadata.umdm;
+import static org.jboss.ws.NativeMessages.MESSAGES;
+
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.Arrays;
@@ -28,15 +30,14 @@
import java.util.HashSet;
import java.util.List;
import java.util.Map;
-import java.util.ResourceBundle;
import java.util.Set;
import javax.xml.namespace.QName;
import javax.xml.rpc.ParameterMode;
import org.jboss.logging.Logger;
+import org.jboss.ws.NativeLoggers;
import org.jboss.ws.WSException;
-import org.jboss.ws.api.util.BundleUtils;
import org.jboss.ws.common.Constants;
import org.jboss.ws.common.JavaUtils;
import org.jboss.ws.core.binding.TypeMappingImpl;
@@ -59,7 +60,6 @@
*/
public abstract class EndpointMetaData extends ExtensibleMetaData implements
InitalizableMetaData
{
- private static final ResourceBundle bundle =
BundleUtils.getBundle(EndpointMetaData.class);
// provide logging
private static Logger log = Logger.getLogger(EndpointMetaData.class);
@@ -85,7 +85,7 @@
// The endpoint interface name
private String seiName;
// The endpoint interface
- private Class seiClass;
+ private Class<?> seiClass;
// The optional authentication method
private String authMethod;
// The SOAPBinding style
@@ -141,7 +141,7 @@
public void setBindingId(String bindingId)
{
if (SUPPORTED_BINDINGS.contains(bindingId) == false)
- throw new WSException(BundleUtils.getMessage(bundle,
"UNSUPPORTED_BINDING", bindingId));
+ throw MESSAGES.unsupportedBinding(bindingId);
this.bindingId = bindingId;
}
@@ -160,7 +160,7 @@
if (wsMetaData.isEagerInitialized())
{
if (UnifiedMetaData.isFinalRelease() == false)
- log.warn(BundleUtils.getMessage(bundle,
"SET_SEI_NAME_AFTER_EAGER_INIT"));
+ NativeLoggers.ROOT_LOGGER.loadingSettingSEIAfterEagerInit();
// reinitialize
initializeInternal();
@@ -177,9 +177,9 @@
* Load the service endpoint interface.
* It should only be cached during eager initialization.
*/
- public Class getServiceEndpointInterface()
+ public Class<?> getServiceEndpointInterface()
{
- Class tmpClass = seiClass;
+ Class<?> tmpClass = seiClass;
if (tmpClass == null && seiName != null)
{
try
@@ -188,13 +188,13 @@
tmpClass = classLoader.loadClass(seiName);
if (serviceMetaData.getUnifiedMetaData().isEagerInitialized())
{
- log.warn(BundleUtils.getMessage(bundle,
"LOADING_SEI_AFTER_EAGER_INIT"));
+ NativeLoggers.ROOT_LOGGER.loadingSettingSEIAfterEagerInit();
seiClass = tmpClass;
}
}
catch (ClassNotFoundException ex)
{
- throw new WSException(BundleUtils.getMessage(bundle,
"CANNOT_LOAD_SEI", seiName), ex);
+ throw new WSException(ex);
}
}
return tmpClass;
@@ -214,7 +214,7 @@
public void setEncodingStyle(Use value)
{
if (value != null && use != null && !use.equals(value))
- throw new WSException(BundleUtils.getMessage(bundle,
"MIXED_STYLES_NOT_SUPPORTED"));
+ throw MESSAGES.conflictingEncodingStyles(value, use);
log.trace("setEncodingStyle: " + value);
this.use = value;
@@ -234,7 +234,7 @@
public void setStyle(Style value)
{
if (value != null && style != null && !style.equals(value))
- throw new WSException(BundleUtils.getMessage(bundle,
"MIXED_STYLES_NOT_SUPPORTED"));
+ throw MESSAGES.conflictingEncodingStyles(value, style);
if (log.isTraceEnabled())
log.trace("setStyle: " + value);
@@ -253,7 +253,7 @@
public void setWrappedParameterStyle(final Boolean value)
{
if (value != null && wrappedParameterStyle != null &&
!wrappedParameterStyle.equals(value))
- throw new WSException(BundleUtils.getMessage(bundle,
"MIXED_SOAP_PARAMETER_STYLES_NOT_SUPPORTED"));
+ throw MESSAGES.conflictingSOAPParameterStyles(value, wrappedParameterStyle);
this.wrappedParameterStyle = value;
}
@@ -288,7 +288,7 @@
}
else
{
- throw new WSException(BundleUtils.getMessage(bundle,
"CANNOT_UNIQUELY_INDENTIFY_OP", xmlName));
+ throw MESSAGES.cannotUniquelyIdentifyOp(xmlName);
}
}
}
@@ -315,7 +315,7 @@
}
else
{
- throw new WSException(BundleUtils.getMessage(bundle,
"CANNOT_UNIQUELY_INDENTIFY_OP", xmlName));
+ throw MESSAGES.cannotUniquelyIdentifyOp(xmlName);
}
}
}
@@ -329,7 +329,6 @@
if (opMetaDataCache.size() == 0)
{
// This can happen when the SEI mapping was not found
- log.warn(BundleUtils.getMessage(bundle,
"ACCESS_TO_EMPTY_OP_META_DATA_CACHE"));
initializeInternal();
}
@@ -451,7 +450,7 @@
{
TypeMappingImpl typeMapping = serviceMetaData.getTypeMapping();
List<TypeMappingMetaData> typeMappings =
serviceMetaData.getTypesMetaData().getTypeMappings();
- List<Class> registeredTypes = new
ArrayList<Class>(typeMappings.size());
+ List<Class<?>> registeredTypes = new
ArrayList<Class<?>>(typeMappings.size());
for (TypeMappingMetaData tmMetaData : typeMappings)
{
String javaTypeName = tmMetaData.getJavaTypeName();
@@ -462,7 +461,7 @@
// TODO: Clarification. In which cases is the type already registered?
boolean registered = false;
- for (Class current : types)
+ for (Class<?> current : types)
{
if (current.getName().equals(javaTypeName))
{
@@ -477,7 +476,7 @@
try
{
ClassLoader classLoader = getClassLoader();
- Class javaType = JavaUtils.loadJavaType(javaTypeName, classLoader);
+ Class<?> javaType = JavaUtils.loadJavaType(javaTypeName,
classLoader);
if (JavaUtils.isPrimitive(javaTypeName))
javaType = JavaUtils.getWrapperType(javaType);
@@ -495,7 +494,7 @@
}
catch (ClassNotFoundException e)
{
- log.warn(BundleUtils.getMessage(bundle, "CANNOT_LOAD_CLASS",
new Object[]{ xmlType, javaTypeName}));
+ NativeLoggers.ROOT_LOGGER.cannotLoadClassForType(xmlType, javaTypeName,
e);
}
}
}
@@ -505,7 +504,7 @@
private void eagerInitializeAccessors()
{
// Collect the list of all used types
- List<Class> types = new ArrayList<Class>();
+ List<Class<?>> types = new ArrayList<Class<?>>();
for (OperationMetaData opMetaData : operations)
{
for (ParameterMetaData paramMetaData : opMetaData.getParameters())
Modified:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/umdm/FaultMetaData.java
===================================================================
---
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/umdm/FaultMetaData.java 2012-10-11
10:07:17 UTC (rev 16858)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/umdm/FaultMetaData.java 2012-10-11
14:38:55 UTC (rev 16859)
@@ -21,17 +21,18 @@
*/
package org.jboss.ws.metadata.umdm;
+import static org.jboss.ws.NativeMessages.MESSAGES;
+
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.Arrays;
-import java.util.ResourceBundle;
import javax.xml.namespace.QName;
import org.jboss.logging.Logger;
+import org.jboss.ws.NativeLoggers;
import org.jboss.ws.WSException;
-import org.jboss.ws.api.util.BundleUtils;
import org.jboss.ws.common.JavaUtils;
/**
@@ -43,7 +44,6 @@
*/
public class FaultMetaData implements InitalizableMetaData
{
- private static final ResourceBundle bundle =
BundleUtils.getBundle(FaultMetaData.class);
// provide logging
private final Logger log = Logger.getLogger(FaultMetaData.class);
@@ -54,16 +54,16 @@
private QName xmlType;
private String javaTypeName;
private String faultBeanName;
- private Class javaType;
- private Class faultBean;
+ private Class<?> javaType;
+ private Class<?> faultBean;
private Method faultInfoMethod;
- private Constructor serviceExceptionConstructor;
+ private Constructor<?> serviceExceptionConstructor;
private Method[] serviceExceptionGetters;
private WrappedParameter[] faultBeanProperties;
- private Class[] propertyTypes;
+ private Class<?>[] propertyTypes;
public FaultMetaData(OperationMetaData operation, QName xmlName, QName xmlType, String
javaTypeName)
{
@@ -74,9 +74,9 @@
public FaultMetaData(OperationMetaData operation, QName xmlName, String javaTypeName)
{
if (xmlName == null)
- throw new IllegalArgumentException(BundleUtils.getMessage(bundle,
"INVALID_NULL_XMLNAME_ARGUMENT"));
+ throw MESSAGES.illegalNullArgument("xmlName");
if (javaTypeName == null)
- throw new IllegalArgumentException(BundleUtils.getMessage(bundle,
"INVALID_NULL_JAVATYPENAME_ARGUMENT", xmlName));
+ throw MESSAGES.illegalNullArgument("javaTypeName");
this.opMetaData = operation;
this.xmlName = xmlName;
@@ -101,7 +101,7 @@
public void setXmlType(QName xmlType)
{
if (xmlType == null)
- throw new IllegalArgumentException(BundleUtils.getMessage(bundle,
"INVALID_NULL_XMLTYPE_ARGUMENT", xmlName));
+ throw MESSAGES.illegalNullArgument("xmlType");
this.xmlType = xmlType;
}
@@ -119,7 +119,7 @@
/** Load the java type.
* It should only be cached during eager initialization.
*/
- public Class getJavaType()
+ public Class<?> getJavaType()
{
if (javaType != null)
return javaType;
@@ -130,20 +130,20 @@
try
{
ClassLoader loader = opMetaData.getEndpointMetaData().getClassLoader();
- Class exceptionType = JavaUtils.loadJavaType(javaTypeName, loader);
+ Class<?> exceptionType = JavaUtils.loadJavaType(javaTypeName, loader);
if (Exception.class.isAssignableFrom(exceptionType) == false)
- throw new IllegalStateException(BundleUtils.getMessage(bundle,
"NOT_ASSIGNABLE_TO_EXCEPTION", exceptionType));
+ throw MESSAGES.notAssignableToException(exceptionType);
if
(opMetaData.getEndpointMetaData().getServiceMetaData().getUnifiedMetaData().isEagerInitialized())
{
- log.warn(BundleUtils.getMessage(bundle, "LOADING_JAVA_TYPE"));
+ NativeLoggers.ROOT_LOGGER.loadingJavaTypeAfterEagerInit();
javaType = exceptionType;
}
return exceptionType;
}
catch (ClassNotFoundException ex)
{
- throw new WSException(BundleUtils.getMessage(bundle,
"CANNOT_LOAD_JAVA_TYPE", javaTypeName), ex);
+ throw new WSException(ex);
}
}
@@ -184,7 +184,7 @@
}
catch (ClassNotFoundException ex)
{
- throw new WSException(BundleUtils.getMessage(bundle,
"CANNOT_LOAD_FAULT_BEAN", faultBeanName), ex);
+ throw new WSException(ex);
}
}
return tmpFaultBean;
@@ -200,10 +200,10 @@
// Initialize the cache
javaType = getJavaType();
if (javaType == null)
- throw new WSException(BundleUtils.getMessage(bundle,
"CANNOT_LOAD_JAVA_TYPE", javaTypeName));
+ throw MESSAGES.cannotLoad(javaTypeName);
if (JavaUtils.isAssignableFrom(Exception.class, javaType) == false)
- throw new WSException(BundleUtils.getMessage(bundle,
"FAULT_JAVA_TYPE_NOT_EXCEPTION", javaTypeName));
+ throw MESSAGES.notAnException(javaTypeName);
}
public Object toFaultBean(Exception serviceException)
@@ -227,7 +227,7 @@
}
catch (InstantiationException e)
{
- throw new WSException(BundleUtils.getMessage(bundle,
"FAULT_BEAN_CLASS_IS_NOT_INSTANTIABLE"), e);
+ throw new WSException(e);
}
// copy the properties from the service exception to the fault bean
@@ -270,8 +270,7 @@
else
{
if (serviceExceptionConstructor == null)
- throw new WSException(BundleUtils.getMessage(bundle,
"COULD_NOT_INSTANTIATE_SERVICE_EXCEPTION",
- new Object[]{ javaType.getSimpleName(),
Arrays.toString(propertyTypes)}));
+ throw
MESSAGES.couldNotInstanciateServiceException(javaType.getSimpleName(),
Arrays.toString(propertyTypes));
// extract the properties from the fault bean
int propertyCount = faultBeanProperties.length;
@@ -287,7 +286,7 @@
}
catch (InstantiationException e)
{
- throw new WSException(BundleUtils.getMessage(bundle,
"EXCEPTION_IS_NOT_INSTANTIABLE"), e);
+ throw new WSException(e);
}
catch (IllegalAccessException e)
{
Modified:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/umdm/HandlerMetaData.java
===================================================================
---
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/umdm/HandlerMetaData.java 2012-10-11
10:07:17 UTC (rev 16858)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/umdm/HandlerMetaData.java 2012-10-11
14:38:55 UTC (rev 16859)
@@ -25,14 +25,12 @@
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
-import java.util.ResourceBundle;
import java.util.Set;
import javax.xml.namespace.QName;
-import org.jboss.logging.Logger;
+import org.jboss.ws.NativeMessages;
import org.jboss.ws.WSException;
-import org.jboss.ws.api.util.BundleUtils;
import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedHandlerMetaData.HandlerType;
import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedInitParamMetaData;
@@ -44,10 +42,6 @@
*/
public abstract class HandlerMetaData implements InitalizableMetaData, Serializable
{
- private static final ResourceBundle bundle =
BundleUtils.getBundle(HandlerMetaData.class);
- // provide logging
- private final Logger log = Logger.getLogger(HandlerMetaData.class);
-
private transient EndpointMetaData epMetaData;
// The required <handler-name> element
@@ -61,7 +55,7 @@
// The optional <init-param> elements
private List<UnifiedInitParamMetaData> initParams = new
ArrayList<UnifiedInitParamMetaData>();
// The cached handler class
- private Class handlerClass;
+ private Class<?> handlerClass;
public HandlerMetaData(HandlerType type)
{
@@ -98,12 +92,12 @@
return handlerClassName;
}
- public Class getHandlerClass()
+ public Class<?> getHandlerClass()
{
if (handlerClassName == null)
- throw new IllegalStateException(BundleUtils.getMessage(bundle,
"HANDLER_CLASS_NAME_CANNOT_BE_NULL"));
+ throw NativeMessages.MESSAGES.handlerClassNameCannotBeNull();
- Class localClass = handlerClass;
+ Class<?> localClass = handlerClass;
if (localClass == null)
{
try
@@ -113,7 +107,7 @@
}
catch (ClassNotFoundException ex)
{
- throw new WSException(BundleUtils.getMessage(bundle,
"CANNOT_LOAD_HANDLER", handlerClassName), ex);
+ throw new WSException(ex);
}
}
return localClass;
Deleted:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/umdm/Message.properties
===================================================================
---
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/umdm/Message.properties 2012-10-11
10:07:17 UTC (rev 16858)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/umdm/Message.properties 2012-10-11
14:38:55 UTC (rev 16859)
@@ -1,61 +0,0 @@
-INVALID_NULL_XMLNAME_ARGUMENT=Invalid null xmlName argument
-INVALID_NULL_XMLTYPE=Invalid null xmlType
-SET_JAVA_TYPE_NAME_AFTER_EAGER_INIT=Set java type name after eager initialization
-CANNOT_LOAD_JAVA_TYPE=Cannot load java type: {0}
-INVALID_MODE=Invalid mode: {0}
-INVALID_MIME_TYPE=Invalid mime type: {0}
-WRAPPER_BEANS_AUTOGEN_NOT_SUPPORTED=Autogeneration of wrapper beans not supported with
JAXRPC
-CLASSLOADER_NOT_AVAILABLE=ClassLoader not available
-AMBIGUOUS_TYPE_MAPPPING=Ambiguous type mappping for: {0}
-CANNOT_OBTAIN_JAVATYPENAME=Cannot obtain javaTypeName for xmlType: {0}
-UNSUPPORTED_BINDING=Unsupported binding: {0}
-SET_SEI_NAME_AFTER_EAGER_INIT=Set SEI name after eager initialization
-LOADING_SEI_AFTER_EAGER_INIT=Loading SEI after eager initialization
-CANNOT_LOAD_SEI=Cannot load service endpoint interface: {0}
-MIXED_STYLES_NOT_SUPPORTED=Mixed encoding styles not supported
-MIXED_SOAP_PARAMETER_STYLES_NOT_SUPPORTED=Mixed SOAP parameter styles not supported
-CANNOT_UNIQUELY_INDENTIFY_OP=Cannot uniquely indentify operation: {0}
-ACCESS_TO_EMPTY_OP_META_DATA_CACHE=Access to empty operation meta data cache,
reinitializing
-CANNOT_LOAD_CLASS=Cannot load class for type: {0} {1}
-CONFIG_NAME_CANNOT_BE_NULL=Config name cannot be null
-INVALID_NULL_XMLTYPE=Invalid null xmlType
-INVALID_NULL_JAVATYPENAME=Invalid null javaTypeName
-INVALID_QNAME_SCOPE=Invalid qname scope: {0}
-INVALID_NULL_QNAME_ARGUMENT=Invalid null qname argument
-INVALID_NULL_JAVANAME_ARGUMENT=Invalid null javaName argument, for: {0}
-LOADING_JAVA_METHOD=Loading java method after eager initialization
-CANNOT_FIND_JAVA_METHOD=Cannot find java method: {0}
-ONEWAY_CANNOT_HAVE_RETURN=OneWay operations cannot have a return parameter
-ONEWAY_CANNOT_HAVE_CHECKEDEX=OneWay operations cannot have checked exceptions
-ONEWAY_CANNOT_HAVE_INOUT=OneWay operations cannot have INOUT or OUT parameters
-DOC_LIT_BARE_REQUIRE=The body of a document/literal bare message requires at most 1 input
and at most 1 output (or 0 if oneway). method: {0} in: {1} out: {2}
-MULTIPLE_POSSIBLE_ENDPOINTS_IMPLEMENTING_SEI=Multiple possible endpoints implementing
SEI: {0}
-ENDPOINTMETADATA_NAME_MUST_BE_UNIQUE=EndpointMetaData name must be unique: {0}
-CANNOT_PARSE_MAPPING=Cannot parse jaxrpc-mapping.xml
-CANNOT_FIND_WSDL=Cannot find wsdl: {0}
-NO_TYPE_MAPPING=No type mapping for encoding style: {0}
-CONFLICTING_ENCODING_STYLES=Conflicting encoding styles not supported
-REQUIRES_A_SECURITY_HANDLER=WS-Security requires a security handler to be configured
-NOT_WSDL_TNS=Requested namespace is not WSDL target namespace: {0}
-INVALID_NULL_XMLNAME_ARGUMENT=Invalid null xmlName argument
-INVALID_NULL_JAVATYPENAME_ARGUMENT=Invalid null javaTypeName argument, for: {0}
-INVALID_NULL_XMLTYPE_ARGUMENT=Invalid null xmlType argument, for: {0}
-NOT_ASSIGNABLE_TO_EXCEPTION=Is not assignable to exception: {0}
-LOADING_JAVA_TYPE=Loading java type after eager initialization
-CANNOT_LOAD_JAVA_TYPE=Cannot load java type: {0}
-CANNOT_LOAD_FAULT_BEAN=Cannot load fault bean: {0}
-FAULT_JAVA_TYPE_NOT_EXCEPTION=Fault java type is not a java.lang.Exception: {0}
-XMLTYPE_MISSING=@XmlType missing from fault bean: {0}
-PROPERTY_NOT_FOUND_IN_BEAN=Property '{0}' not found in fault bean '{1}'
-PROPERTY_NOT_FOUND_IN_EXCEPTION=Property '{0}' not found in service exception
'{1}
-FAULT_BEAN_CLASS_IS_NOT_INSTANTIABLE=Fault bean class is not instantiable
-COULD_NOT_INSTANTIATE_SERVICE_EXCEPTION=Could not instantiate service exception ({0}),
since neither a faultInfo nor sorted constructor is present: {1}
-EXCEPTION_IS_NOT_INSTANTIABLE=Service exception is not instantiable
-HANDLER_CLASS_NAME_CANNOT_BE_NULL=Handler class name cannot be null
-CANNOT_LOAD_HANDLER=Cannot load handler: {0}
-REQUIRES_SECURITY_CONFIGURATION=WS-Security requires security configuration
-CONTEXT_ROOT_START_WITH=context root should start with '/'
-URL_PATTERN_START_WITH=URL pattern should start with '/'
-ENDPOINT_NOT_AVAILABLE=Endpoint not available
-VFS_ROOT_CANNOT_BE_NULL=VFS root cannot be null
-CLASS_LOADER_NOT_AVAILABLE=Class loader not available
Modified:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/umdm/OperationMetaData.java
===================================================================
---
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/umdm/OperationMetaData.java 2012-10-11
10:07:17 UTC (rev 16858)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/umdm/OperationMetaData.java 2012-10-11
14:38:55 UTC (rev 16859)
@@ -21,19 +21,19 @@
*/
package org.jboss.ws.metadata.umdm;
+import static org.jboss.ws.NativeMessages.MESSAGES;
+
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
-import java.util.ResourceBundle;
import java.util.Set;
import javax.xml.namespace.QName;
import javax.xml.rpc.ParameterMode;
import org.jboss.logging.Logger;
-import org.jboss.ws.WSException;
-import org.jboss.ws.api.util.BundleUtils;
+import org.jboss.ws.NativeLoggers;
import org.jboss.ws.common.JavaUtils;
import org.jboss.ws.core.soap.utils.Style;
import org.jboss.ws.core.soap.utils.Use;
@@ -48,7 +48,6 @@
*/
public class OperationMetaData extends ExtensibleMetaData implements
InitalizableMetaData
{
- private static final ResourceBundle bundle =
BundleUtils.getBundle(OperationMetaData.class);
// provide logging
private final Logger log = Logger.getLogger(OperationMetaData.class);
@@ -78,9 +77,9 @@
this.javaName = javaName;
if (qname == null)
- throw new IllegalArgumentException(BundleUtils.getMessage(bundle,
"INVALID_NULL_QNAME_ARGUMENT"));
+ throw MESSAGES.illegalNullArgument("qname");
if (javaName == null)
- throw new IllegalArgumentException(BundleUtils.getMessage(bundle,
"INVALID_NULL_JAVANAME_ARGUMENT", qname));
+ throw MESSAGES.illegalNullArgument("javaName");
String nsURI = qname.getNamespaceURI();
String localPart = qname.getLocalPart();
@@ -155,7 +154,7 @@
public Method getJavaMethod()
{
Method tmpMethod = javaMethod;
- Class seiClass = epMetaData.getServiceEndpointInterface();
+ Class<?> seiClass = epMetaData.getServiceEndpointInterface();
if (tmpMethod == null && seiClass != null)
{
for (Method method : seiClass.getMethods())
@@ -168,7 +167,7 @@
if (wsMetaData.isEagerInitialized())
{
if (UnifiedMetaData.isFinalRelease() == false)
- log.warn(BundleUtils.getMessage(bundle,
"LOADING_JAVA_METHOD"), new IllegalStateException());
+ NativeLoggers.ROOT_LOGGER.loadingJavaMethodAfterEagerInit();
javaMethod = method;
}
@@ -178,7 +177,7 @@
}
if (tmpMethod == null)
- throw new WSException(BundleUtils.getMessage(bundle,
"CANNOT_FIND_JAVA_METHOD", javaName));
+ throw MESSAGES.cannotFindJavaMethod(javaName);
}
return tmpMethod;
}
@@ -388,15 +387,15 @@
if (oneWay)
{
if (returnParam != null)
- throw new WSException(BundleUtils.getMessage(bundle,
"ONEWAY_CANNOT_HAVE_RETURN"));
+ throw MESSAGES.onewayOperationCannotHaveReturn();
if (faults.size() > 0)
- throw new WSException(BundleUtils.getMessage(bundle,
"ONEWAY_CANNOT_HAVE_CHECKEDEX"));
+ throw MESSAGES.onewayOperationCannotHaveCheckedExc();
for (ParameterMetaData paramMetaData : parameters)
{
if (paramMetaData.getMode() != ParameterMode.IN)
- throw new WSException(BundleUtils.getMessage(bundle,
"ONEWAY_CANNOT_HAVE_INOUT"));
+ throw MESSAGES.onewayOperationCannotHaveInOutPars();
}
}
}
Modified:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/umdm/ParameterMetaData.java
===================================================================
---
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/umdm/ParameterMetaData.java 2012-10-11
10:07:17 UTC (rev 16858)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/umdm/ParameterMetaData.java 2012-10-11
14:38:55 UTC (rev 16859)
@@ -25,7 +25,6 @@
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
-import java.util.ResourceBundle;
import java.util.Set;
import java.util.StringTokenizer;
@@ -33,8 +32,9 @@
import javax.xml.rpc.ParameterMode;
import org.jboss.logging.Logger;
+import org.jboss.ws.NativeLoggers;
+import org.jboss.ws.NativeMessages;
import org.jboss.ws.WSException;
-import org.jboss.ws.api.util.BundleUtils;
import org.jboss.ws.common.Constants;
import org.jboss.ws.common.JavaUtils;
import org.jboss.ws.core.jaxrpc.ParameterWrapping;
@@ -51,7 +51,6 @@
*/
public class ParameterMetaData implements InitalizableMetaData
{
- private static final ResourceBundle bundle =
BundleUtils.getBundle(ParameterMetaData.class);
// provide logging
private final Logger log = Logger.getLogger(ParameterMetaData.class);
@@ -62,7 +61,7 @@
private String partName;
private QName xmlType;
private String javaTypeName;
- private Class javaType;
+ private Class<?> javaType;
private ParameterMode mode;
private Set<String> mimeTypes;
private boolean inHeader;
@@ -91,7 +90,7 @@
public ParameterMetaData(OperationMetaData opMetaData, QName xmlName, String
javaTypeName)
{
if (xmlName == null)
- throw new IllegalArgumentException(BundleUtils.getMessage(bundle,
"INVALID_NULL_XMLNAME_ARGUMENT"));
+ throw NativeMessages.MESSAGES.illegalNullArgument("xmlName");
// Remove the prefixes
if (xmlName.getNamespaceURI().length() > 0)
@@ -104,14 +103,14 @@
this.partName = xmlName.getLocalPart();
}
- private static boolean matchParameter(Method method, int index, Class expectedType,
Set<Integer> matches, boolean exact, boolean holder)
+ private static boolean matchParameter(Method method, int index, Class<?>
expectedType, Set<Integer> matches, boolean exact, boolean holder)
{
- Class returnType = method.getReturnType();
+ Class<?> returnType = method.getReturnType();
if (index == -1 && matchTypes(returnType, expectedType, exact, false))
return true;
- Class[] classParameters = method.getParameterTypes();
+ Class<?>[] classParameters = method.getParameterTypes();
if (index < 0 || index >= classParameters.length)
return false;
@@ -136,13 +135,13 @@
return false;
}
- private static boolean matchTypes(java.lang.reflect.Type actualType, Class
expectedType, boolean exact, boolean holder)
+ private static boolean matchTypes(java.lang.reflect.Type actualType, Class<?>
expectedType, boolean exact, boolean holder)
{
if (holder && HolderUtils.isHolderType(actualType) == false)
return false;
java.lang.reflect.Type valueType = (holder ? HolderUtils.getValueType(actualType) :
actualType);
- Class valueClass = JavaUtils.erasure(valueType);
+ Class<?> valueClass = JavaUtils.erasure(valueType);
return matchTypesInternal(valueClass, expectedType, exact);
}
@@ -150,20 +149,20 @@
// This duplication is needed because Class does not implement Type in 1.4,
// which makes retrotranslation not possible. This takes advantage of overloading to
// prevent the problem.
- private static boolean matchTypes(Class actualType, Class expectedType, boolean exact,
boolean holder)
+ private static boolean matchTypes(Class<?> actualType, Class<?>
expectedType, boolean exact, boolean holder)
{
if (holder && HolderUtils.isHolderType(actualType) == false)
return false;
- Class valueClass = (holder ? HolderUtils.getValueType(actualType) : actualType);
+ Class<?> valueClass = (holder ? HolderUtils.getValueType(actualType) :
actualType);
return matchTypesInternal(valueClass, expectedType, exact);
}
- private static boolean matchTypesInternal(Class valueClass, Class expectedType,
boolean exact)
+ private static boolean matchTypesInternal(Class<?> valueClass, Class<?>
expectedType, boolean exact)
{
// FIXME - Why do we need this hack? The method signature should _ALWAYS_ match,
else we will get ambiguous or incorrect results
- List<Class> anyTypes = new ArrayList<Class>();
+ List<Class<?>> anyTypes = new ArrayList<Class<?>>();
anyTypes.add(javax.xml.soap.SOAPElement.class);
anyTypes.add(org.w3c.dom.Element.class);
@@ -199,7 +198,7 @@
public void setXmlType(QName xmlType)
{
if (xmlType == null)
- throw new IllegalArgumentException(BundleUtils.getMessage(bundle,
"INVALID_NULL_XMLTYPE"));
+ throw NativeMessages.MESSAGES.illegalNullArgument("xmlType");
// Remove potential prefix
if (xmlType.getNamespaceURI().length() > 0)
@@ -226,14 +225,14 @@
// Warn if this is called after eager initialization
UnifiedMetaData wsMetaData =
opMetaData.getEndpointMetaData().getServiceMetaData().getUnifiedMetaData();
if (wsMetaData.isEagerInitialized() && UnifiedMetaData.isFinalRelease() ==
false)
- log.warn(BundleUtils.getMessage(bundle,
"SET_JAVA_TYPE_NAME_AFTER_EAGER_INIT"), new IllegalStateException());
+ NativeLoggers.ROOT_LOGGER.setJavaTypeAfterEagerInit(typeName);
javaTypeName = typeName;
javaType = null;
}
- public Class loadWrapperBean()
+ public Class<?> loadWrapperBean()
{
- Class wrapperBean = null;
+ Class<?> wrapperBean = null;
try
{
ClassLoader loader = getClassLoader();
@@ -249,9 +248,9 @@
/** Load the java type.
* It should only be cached during eager initialization.
*/
- public Class getJavaType()
+ public Class<?> getJavaType()
{
- Class tmpJavaType = javaType;
+ Class<?> tmpJavaType = javaType;
if (tmpJavaType == null && javaTypeName != null)
{
try
@@ -268,7 +267,7 @@
}
catch (ClassNotFoundException ex)
{
- throw new WSException(BundleUtils.getMessage(bundle,
"CANNOT_LOAD_JAVA_TYPE", javaTypeName), ex);
+ throw new WSException(ex);
}
}
return tmpJavaType;
@@ -288,7 +287,7 @@
else if ("OUT".equals(mode))
setMode(ParameterMode.OUT);
else
- throw new IllegalArgumentException(BundleUtils.getMessage(bundle,
"INVALID_MODE", mode));
+ throw NativeMessages.MESSAGES.invalidMode(mode);
}
public void setMode(ParameterMode mode)
@@ -375,7 +374,7 @@
StringBuilder mimeName = new StringBuilder(xmlType.getLocalPart());
int pos = mimeName.indexOf("_");
if (pos == -1)
- throw new IllegalArgumentException(BundleUtils.getMessage(bundle,
"INVALID_MIME_TYPE", xmlType));
+ throw NativeMessages.MESSAGES.invalidMimeType(xmlType);
mimeName.setCharAt(pos, '/');
return mimeName.toString();
@@ -435,20 +434,20 @@
{
if (loadWrapperBean() == null)
{
- throw new WSException(BundleUtils.getMessage(bundle,
"WRAPPER_BEANS_AUTOGEN_NOT_SUPPORTED"));
+ throw NativeMessages.MESSAGES.jaxrpcWrapperBeanAutogenNotSupported();
}
}
javaType = getJavaType();
if (javaType == null)
- throw new WSException(BundleUtils.getMessage(bundle,
"CANNOT_LOAD_JAVA_TYPE", javaTypeName));
+ throw NativeMessages.MESSAGES.cannotLoad(javaTypeName);
}
private ClassLoader getClassLoader()
{
ClassLoader loader = opMetaData.getEndpointMetaData().getClassLoader();
if (loader == null)
- throw new WSException(BundleUtils.getMessage(bundle,
"CLASSLOADER_NOT_AVAILABLE"));
+ throw NativeMessages.MESSAGES.classloaderNotAvailable();
return loader;
}
@@ -456,7 +455,7 @@
{
ClassLoader loader =
getOperationMetaData().getEndpointMetaData().getClassLoader();
List<WrappedParameter> wrappedParameters = getWrappedParameters();
- Class wrapperType = getJavaType();
+ Class<?> wrapperType = getJavaType();
// Standard type
if (wrappedParameters == null)
@@ -469,7 +468,7 @@
try
{
- Class type = (typeName != null) ? JavaUtils.loadJavaType(typeName, loader) :
ParameterWrapping.getWrappedType(wrapped.getVariable(), wrapperType);
+ Class<?> type = (typeName != null) ? JavaUtils.loadJavaType(typeName,
loader) : ParameterWrapping.getWrappedType(wrapped.getVariable(), wrapperType);
if (type == null)
return false;
if (!matchParameter(method, wrapped.getIndex(), type, matches, exact,
wrapped.isHolder()))
Modified:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/umdm/ServerEndpointMetaData.java
===================================================================
---
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/umdm/ServerEndpointMetaData.java 2012-10-11
10:07:17 UTC (rev 16858)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/umdm/ServerEndpointMetaData.java 2012-10-11
14:38:55 UTC (rev 16859)
@@ -21,13 +21,10 @@
*/
package org.jboss.ws.metadata.umdm;
-import java.util.ResourceBundle;
-
import javax.management.ObjectName;
import javax.xml.namespace.QName;
-import org.jboss.logging.Logger;
-import org.jboss.ws.api.util.BundleUtils;
+import org.jboss.ws.NativeMessages;
import org.jboss.wsf.spi.deployment.Endpoint;
import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedHandlerMetaData.HandlerType;
@@ -40,9 +37,6 @@
*/
public class ServerEndpointMetaData extends EndpointMetaData
{
- private static final ResourceBundle bundle =
BundleUtils.getBundle(ServerEndpointMetaData.class);
- protected static final Logger log = Logger.getLogger(ServerEndpointMetaData.class);
-
public static final String SEPID_DOMAIN = "jboss.ws";
public static final String SEPID_PROPERTY_CONTEXT = "context";
public static final String SEPID_PROPERTY_ENDPOINT = "endpoint";
@@ -131,7 +125,7 @@
public void setContextRoot(String contextRoot)
{
if (contextRoot != null && !(contextRoot.startsWith("/")))
- throw new IllegalArgumentException(BundleUtils.getMessage(bundle,
"CONTEXT_ROOT_START_WITH"));
+ throw NativeMessages.MESSAGES.contextRootShouldStartsWith(contextRoot);
this.contextRoot = contextRoot;
}
@@ -144,7 +138,7 @@
public void setURLPattern(String urlPattern)
{
if (urlPattern != null && !urlPattern.startsWith("/"))
- throw new IllegalArgumentException(BundleUtils.getMessage(bundle,
"URL_PATTERN_START_WITH"));
+ throw NativeMessages.MESSAGES.urlPatternShouldStartsWith(urlPattern);
this.urlPattern = urlPattern;
}
@@ -179,7 +173,7 @@
public void setEndpointAddress(String endpointAddress)
{
if (endpoint == null)
- throw new IllegalStateException(BundleUtils.getMessage(bundle,
"ENDPOINT_NOT_AVAILABLE"));
+ throw NativeMessages.MESSAGES.endpointNotAvailable();
endpoint.setAddress(endpointAddress);
}
Modified:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/umdm/ServiceMetaData.java
===================================================================
---
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/umdm/ServiceMetaData.java 2012-10-11
10:07:17 UTC (rev 16858)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/umdm/ServiceMetaData.java 2012-10-11
14:38:55 UTC (rev 16859)
@@ -26,19 +26,17 @@
import java.net.MalformedURLException;
import java.net.URL;
import java.util.ArrayList;
-import java.util.Collections;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Properties;
-import java.util.ResourceBundle;
import javax.xml.namespace.QName;
import javax.xml.rpc.encoding.TypeMappingRegistry;
-import org.jboss.logging.Logger;
+import org.jboss.ws.NativeLoggers;
+import org.jboss.ws.NativeMessages;
import org.jboss.ws.WSException;
-import org.jboss.ws.api.util.BundleUtils;
import org.jboss.ws.core.binding.TypeMappingImpl;
import org.jboss.ws.core.jaxrpc.TypeMappingRegistryImpl;
import org.jboss.ws.core.jaxrpc.binding.jbossxb.SchemaBindingBuilder;
@@ -61,10 +59,6 @@
*/
public class ServiceMetaData implements InitalizableMetaData, Serializable
{
- private static final ResourceBundle bundle =
BundleUtils.getBundle(ServiceMetaData.class);
- // provide logging
- private static final Logger log = Logger.getLogger(ServiceMetaData.class);
-
// The parent meta data.
private UnifiedMetaData wsMetaData;
@@ -205,7 +199,7 @@
if (epMetaData != null)
{
// The CTS uses Service.getPort(Class) with multiple endpoints
implementing the same SEI
- log.warn(BundleUtils.getMessage(bundle,
"MULTIPLE_POSSIBLE_ENDPOINTS_IMPLEMENTING_SEI", seiName));
+
NativeLoggers.ROOT_LOGGER.multiplePossibleEndpointImplementingSEI(seiName);
}
epMetaData = epmd;
}
@@ -220,7 +214,7 @@
// This happends when we have multiple port components in sharing the same wsdl
port
// The EndpointMetaData name is the wsdl port, so we cannot have multiple meta data
for the same port.
if (endpoints.get(portName) != null)
- throw new WSException(BundleUtils.getMessage(bundle,
"ENDPOINTMETADATA_NAME_MUST_BE_UNIQUE", portName));
+ throw NativeMessages.MESSAGES.endpointMetadataMustBeUnique(portName);
endpoints.put(portName, epMetaData);
}
@@ -251,7 +245,7 @@
}
catch (IOException e)
{
- throw new WSException(BundleUtils.getMessage(bundle,
"CANNOT_PARSE_MAPPING"), e);
+ throw new WSException(e);
}
}
}
@@ -308,7 +302,7 @@
}
catch (IOException ex)
{
- throw new IllegalStateException(BundleUtils.getMessage(bundle,
"CANNOT_FIND_WSDL", wsdlFile));
+ throw new IllegalStateException(ex);
}
}
}
@@ -320,7 +314,7 @@
Use encStyle = getEncodingStyle();
TypeMappingImpl typeMapping =
(TypeMappingImpl)tmRegistry.getTypeMapping(encStyle.toURI());
if (typeMapping == null)
- throw new WSException(BundleUtils.getMessage(bundle,
"NO_TYPE_MAPPING", encStyle));
+ throw NativeMessages.MESSAGES.noTypeMapping(encStyle);
return typeMapping;
}
@@ -339,7 +333,7 @@
}
else if (encStyle.equals(epMetaData.getEncodingStyle()) == false)
{
- throw new WSException(BundleUtils.getMessage(bundle,
"CONFLICTING_ENCODING_STYLES"));
+ throw NativeMessages.MESSAGES.conflictingEncodingStyles(encStyle,
epMetaData.getEncodingStyle());
}
}
}
@@ -403,7 +397,7 @@
public void assertTargetNamespace(String targetNS)
{
if (getServiceName().getNamespaceURI().equals(targetNS) == false)
- throw new WSException(BundleUtils.getMessage(bundle, "NOT_WSDL_TNS",
targetNS));
+ throw NativeMessages.MESSAGES.notWsdlTargetNamespace(targetNS);
}
public String toString()
Modified:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/umdm/TypeMappingMetaData.java
===================================================================
---
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/umdm/TypeMappingMetaData.java 2012-10-11
10:07:17 UTC (rev 16858)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/umdm/TypeMappingMetaData.java 2012-10-11
14:38:55 UTC (rev 16859)
@@ -23,11 +23,10 @@
import java.util.Arrays;
import java.util.List;
-import java.util.ResourceBundle;
import javax.xml.namespace.QName;
-import org.jboss.ws.api.util.BundleUtils;
+import org.jboss.ws.NativeMessages;
/**
@@ -38,7 +37,6 @@
*/
public class TypeMappingMetaData
{
- private static final ResourceBundle bundle =
BundleUtils.getBundle(TypeMappingMetaData.class);
// The parent meta data.
private TypesMetaData typesMetaData;
@@ -55,9 +53,9 @@
public TypeMappingMetaData(TypesMetaData typesMetaData, QName xmlType, String
javaTypeName)
{
if (xmlType == null)
- throw new IllegalArgumentException(BundleUtils.getMessage(bundle,
"INVALID_NULL_XMLTYPE"));
+ throw NativeMessages.MESSAGES.illegalNullArgument("xmlType");
if (javaTypeName == null)
- throw new IllegalArgumentException(BundleUtils.getMessage(bundle,
"INVALID_NULL_JAVATYPENAME"));
+ throw NativeMessages.MESSAGES.illegalNullArgument("javaTypeName");
this.typesMetaData = typesMetaData;
this.javaTypeName = javaTypeName;
@@ -88,7 +86,7 @@
public void setQNameScope(String qnameScope)
{
if (allowedScopes.contains(qnameScope) == false)
- throw new IllegalArgumentException(BundleUtils.getMessage(bundle,
"INVALID_QNAME_SCOPE", qnameScope));
+ throw NativeMessages.MESSAGES.invalidQNameScope(qnameScope);
this.qnameScope = qnameScope;
}
Modified:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/umdm/TypesMetaData.java
===================================================================
---
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/umdm/TypesMetaData.java 2012-10-11
10:07:17 UTC (rev 16858)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/umdm/TypesMetaData.java 2012-10-11
14:38:55 UTC (rev 16859)
@@ -23,15 +23,14 @@
import java.util.ArrayList;
import java.util.List;
-import java.util.ResourceBundle;
import javax.xml.namespace.QName;
import org.apache.xerces.xs.XSSimpleTypeDefinition;
import org.apache.xerces.xs.XSTypeDefinition;
import org.jboss.logging.Logger;
-import org.jboss.ws.WSException;
-import org.jboss.ws.api.util.BundleUtils;
+import org.jboss.ws.NativeLoggers;
+import org.jboss.ws.NativeMessages;
import org.jboss.ws.core.jaxrpc.LiteralTypeMapping;
import org.jboss.ws.metadata.wsdl.xmlschema.JBossXSModel;
@@ -43,7 +42,6 @@
*/
public class TypesMetaData
{
- private static final ResourceBundle bundle =
BundleUtils.getBundle(TypesMetaData.class);
// provide logging
private static final Logger log = Logger.getLogger(TypesMetaData.class);
@@ -111,7 +109,7 @@
if (tmMetaData != null)
{
log.error(tmMetaData + "\n" + aux);
- throw new WSException(BundleUtils.getMessage(bundle,
"AMBIGUOUS_TYPE_MAPPPING", xmlType));
+ throw NativeMessages.MESSAGES.ambiguousTypeMapping(xmlType);
}
tmMetaData = aux;
}
@@ -162,7 +160,7 @@
}
else
{
- log.warn(BundleUtils.getMessage(bundle,
"CANNOT_OBTAIN_JAVATYPENAME", xmlType));
+ NativeLoggers.ROOT_LOGGER.cannotObtainJavaTypeName(xmlType);
}
}
}
Modified:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/umdm/UnifiedMetaData.java
===================================================================
---
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/umdm/UnifiedMetaData.java 2012-10-11
10:07:17 UTC (rev 16858)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/umdm/UnifiedMetaData.java 2012-10-11
14:38:55 UTC (rev 16859)
@@ -25,11 +25,9 @@
import java.util.HashMap;
import java.util.List;
import java.util.Map;
-import java.util.ResourceBundle;
import java.util.StringTokenizer;
-import org.jboss.logging.Logger;
-import org.jboss.ws.api.util.BundleUtils;
+import org.jboss.ws.NativeMessages;
import org.jboss.ws.metadata.jaxrpcmapping.JavaWsdlMapping;
import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
import org.jboss.wsf.spi.deployment.UnifiedVirtualFile;
@@ -50,10 +48,6 @@
*/
public class UnifiedMetaData implements InitalizableMetaData
{
- private static final ResourceBundle bundle =
BundleUtils.getBundle(UnifiedMetaData.class);
- // provide logging
- private static Logger log = Logger.getLogger(UnifiedMetaData.class);
-
// The canonical deployment name
private String deploymentName;
// The modules class loader
@@ -87,7 +81,7 @@
public UnifiedMetaData(UnifiedVirtualFile vfsRoot, ClassLoader classLoader)
{
if (vfsRoot == null)
- throw new IllegalArgumentException(BundleUtils.getMessage(bundle,
"VFS_ROOT_CANNOT_BE_NULL"));
+ throw NativeMessages.MESSAGES.illegalNullArgument("VFS root");
this.vfsRoot = vfsRoot;
this.classLoader = classLoader;
@@ -96,7 +90,7 @@
public ClassLoader getClassLoader()
{
if (classLoader == null)
- throw new IllegalStateException(BundleUtils.getMessage(bundle,
"CLASS_LOADER_NOT_AVAILABLE"));
+ throw NativeMessages.MESSAGES.classloaderNotAvailable();
return classLoader;
}
@@ -196,7 +190,6 @@
{
if (eagerInitialized == false)
{
- log.debug("Eagerly initialize the meta data model");
for (ServiceMetaData service : services)
{
service.eagerInitialize();