Author: alessio.soldano(a)jboss.com
Date: 2012-10-12 07:16:22 -0400 (Fri, 12 Oct 2012)
New Revision: 16864
Removed:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxrpc/binding/Message.properties
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxrpc/binding/jbossxb/Message.properties
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxrpc/client/Message.properties
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxrpc/client/serviceref/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/jaxrpc/binding/CalendarDeserializer.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxrpc/binding/CalendarSerializer.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxrpc/binding/ElementSerializer.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxrpc/binding/SOAPArrayDeserializer.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxrpc/binding/SOAPArraySerializer.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxrpc/binding/SOAPElementSerializer.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxrpc/binding/jbossxb/JBossXBMarshallerImpl.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxrpc/binding/jbossxb/JBossXBSupport.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxrpc/binding/jbossxb/JBossXBUnmarshallerImpl.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxrpc/binding/jbossxb/SchemaBindingBuilder.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxrpc/client/CallImpl.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxrpc/client/HandlerRegistryImpl.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxrpc/client/PortProxy.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxrpc/client/ServiceFactoryImpl.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxrpc/client/ServiceImpl.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxrpc/client/serviceref/NativeServiceObjectFactoryJAXRPC.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxrpc/client/serviceref/NativeServiceReferenceableJAXRPC.java
Log:
[JBWS-3509] Converting 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-12
08:30:12 UTC (rev 16863)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/NativeLoggers.java 2012-10-12
11:16:22 UTC (rev 16864)
@@ -40,6 +40,7 @@
import org.jboss.logging.LogMessage;
import org.jboss.logging.Message;
import org.jboss.logging.MessageLogger;
+import org.jboss.ws.metadata.umdm.HandlerMetaDataJAXRPC;
/**
* JBossWS-CXF log messages
@@ -273,4 +274,48 @@
@Message(id = 25250, value = "JAX-RPC Service error")
void jaxRpcServiceError(@Cause Throwable cause);
-}
+ @LogMessage(level = INFO)
+ @Message(id = 25257, value = "Deprecated use of <call-properties> on
JAXRPC Stub. Use <stub-properties>")
+ void deprecatedUseOfCallPropsOnJAXRPCStub();
+
+ @LogMessage(level = DEBUG)
+ @Message(id = 25258, value = "Adding client side handler to endpoint
'%s': %s")
+ void addingClientSideHandlerToEndpoint(QName portName, Object handlerInfo);
+
+ @LogMessage(level = INFO)
+ @Message(id = 25259, value = "Using jaxrpc-mapping from: %s")
+ void useJaxRpcMappingFrom(URL mappingURL);
+
+ @LogMessage(level = DEBUG)
+ @Message(id = 25260, value = "Add handler to: %s%s")
+ void addHandlerTo(QName portName, HandlerMetaDataJAXRPC handler);
+
+ @LogMessage(level = WARN)
+ @Message(id = 25269, value = "Cannot set endpoint address for
port-component-link, unsuported number of endpoints.")
+ void cannotSetEndpointAddressForPCL();
+
+ @LogMessage(level = ERROR)
+ @Message(id = 25271, value = "Cannot create Service")
+ void cannotCreateService(@Cause Throwable cause);
+
+ @LogMessage(level = WARN)
+ @Message(id = 25274, value = "Unable to narrow port selection for %s")
+ void unableToNarrowPortSelection(Object obj);
+
+ @LogMessage(level = WARN)
+ @Message(id = 25284, value = "Cannot obtain TypeBinding for: %s")
+ void cannotObtainTypeBindingFor(QName type);
+
+ @LogMessage(level = WARN)
+ @Message(id = 25285, value = "Ambiguous binding for attribute: %s")
+ void ambiguosBinding(String attr);
+
+ @LogMessage(level = WARN)
+ @Message(id = 25288, value = "Type definition not found in schema: %s")
+ void typeDefinitionNotInSchema(QName qname);
+
+ @LogMessage(level = WARN)
+ @Message(id = 25289, value = "Global element not found in schema: %s")
+ void globalElementNotInSchema(QName qname);
+
+}
\ No newline at end of file
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-12
08:30:12 UTC (rev 16863)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/NativeMessages.java 2012-10-12
11:16:22 UTC (rev 16864)
@@ -29,9 +29,11 @@
import java.util.Collection;
import javax.management.ObjectName;
+import javax.naming.NamingException;
import javax.wsdl.Part;
import javax.xml.namespace.QName;
import javax.xml.rpc.JAXRPCException;
+import javax.xml.rpc.ServiceException;
import javax.xml.soap.Name;
import javax.xml.soap.SOAPException;
import javax.xml.transform.Source;
@@ -481,7 +483,7 @@
UnsupportedOperationException noSoapMessageAvailable(Class<?> clazz);
@Message(id = 25175, value = "Cannot obtain operation meta data for %s")
- WSException cannotObtainOperationMetaData(QName opName);
+ WSException cannotObtainOperationMetaData(Object opName);
@Message(id = 25176, value = "Target endpoint address not set")
WSException targetEndpointAddressNotSet();
@@ -648,4 +650,100 @@
@Message(id = 25251, value = "Don't know how to invoke method %s")
JAXRPCException dontKnowHowToInvoke(Method method);
-}
+ @Message(id = 25252, value = "Cannot find endpoint for name: %s")
+ ServiceException cannotFindEndpointForName(QName portName);
+
+ @Message(id = 25253, value = "Components should not use the %s method.")
+ UnsupportedOperationException shouldNotUseMethod(String m);
+
+ @Message(id = 25254, value = "SEI does not implement java.rmi.Remote: %s")
+ String notImplementRemote(String sei);
+
+ @Message(id = 25255, value = "Service meta data not available")
+ ServiceException serviceMetaDataNotAvailable();
+
+ @Message(id = 25256, value = "Cannot find endpoint meta data for: %s")
+ ServiceException cannotFindEndpointMetaData(Object obj);
+
+ @Message(id = 25261, value = "Unsupported property: %s")
+ JAXRPCException unsupportedPropery(String prop);
+
+ @Message(id = 25262, value = "Return value not supported by: %s")
+ WSException returnValueNotSupportedBy(Object obj);
+
+ @Message(id = 25263, value = "Call invocation failed with code [%s] because of:
%s")
+ String callInvocationFailedBecauseOf(String faultCode, String faultString);
+
+ @Message(id = 25264, value = "Call invocation failed")
+ String callInvocationFailed();
+
+ @Message(id = 25265, value = "Different java type already registered: %s")
+ IllegalArgumentException differentJavaTypeAlreadyRegistered(String t);
+
+ @Message(id = 25266, value = "Cannot obtain response payload")
+ JAXRPCException cannotObtainResponsePayload(@Cause Throwable cause);
+
+ @Message(id = 25267, value = "Output parameters not available")
+ JAXRPCException outputParamsNotAvailable();
+
+ @Message(id = 25268, value = "Cannot obtain path to
PortComponentLinkServlet")
+ NamingException cannotObtainPathToPCLServlet(@Cause Throwable cause);
+
+ @Message(id = 25270, value = "The service interface does not implement
javax.xml.rpc.Service: %s")
+ JAXRPCException interfaceDoesNotImplementJAXRPCService(String intf);
+
+ @Message(id = 25272, value = "Within a <service-ref> it's not allowed
to use a SEI across different <port-component-ref>'s: %s")
+ WSException notAllowedToUseInServiceRef(String seiName);
+
+ @Message(id = 25273, value = "Failed to narrow available endpoints by
<port-component-ref> declaration")
+ WSException failedToNarrowavailableEpsByPcRef();
+
+ @Message(id = 25275, value = "Cannot unmarshal jaxrpc-mapping file: %s")
+ WSException cannotUnmarshallJAXRPCMapping(String jaxrpcMappingFile, @Cause Throwable
cause);
+
+ @Message(id = 25276, value = "Value is not a %s: %s")
+ IllegalArgumentException valueIsNotA(Class<?> expectedClass, Class<?>
actualClass);
+
+ @Message(id = 25277, value = "Cannot obtain component xmlType: %s")
+ WSException cannotObtainComponentXmlType(Object t);
+
+ @Message(id = 25278, value = "Cannot obtain component serializer for: %s")
+ WSException cannotObtainComponentSerializerFor(QName qname);
+
+ @Message(id = 25279, value = "Unsupported array type: %s")
+ WSException unsupportedArrayType(Class<?> t);
+
+ @Message(id = 25280, value = "Cannot obtain component deserializer for:
%s")
+ WSException cannotObtainComponentDeserializerFor(QName qname);
+
+ @Message(id = 25281, value = "Unsupported array dimensions: %s")
+ WSException unsupportedArrayDimensions(int l);
+
+ @Message(id = 25282, value = "Cannot obtain attribute: %s")
+ WSException cannotObtainAttribute(QName qname);
+
+ @Message(id = 25283, value = "Invalid xmlType: %s")
+ IllegalArgumentException invalidXmlType(QName xmlType);
+
+ @Message(id = 25286, value = "Attribute %s found in jaxrpc-mapping but not in
the schema: %s")
+ WSException attributeNotInSchema(QName attr, QName schema);
+
+ @Message(id = 25287, value = "Element %s found in jaxrpc-mapping but not in the
schema: %s")
+ WSException elementNotInSchema(QName el, QName schema);
+
+ @Message(id = 25290, value = "Unexpected qname-scope for %s: %s")
+ WSException unexpectedQNameScope(String s1, String s2);
+
+ @Message(id = 25291, value = "Root type %s not found in the schema.")
+ WSException rootTypeNotFoundInSchema(QName qname);
+
+ @Message(id = 25292, value = "Cannot find required property: %s")
+ WSException cannotFindRequiredProperty(String prop);
+
+ @Message(id = 25293, value = "Failed to marshal DOM element %s")
+ IllegalStateException failedToMarshalDOMElement(QName elem, @Cause Throwable cause);
+
+ @Message(id = 25294, value = "The given root element name must be prefix
qualified: %s")
+ IllegalArgumentException mustBePrefixQualified(QName elem);
+
+}
\ No newline at end of file
Modified:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxrpc/binding/CalendarDeserializer.java
===================================================================
---
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxrpc/binding/CalendarDeserializer.java 2012-10-12
08:30:12 UTC (rev 16863)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxrpc/binding/CalendarDeserializer.java 2012-10-12
11:16:22 UTC (rev 16864)
@@ -22,13 +22,12 @@
package org.jboss.ws.core.jaxrpc.binding;
import java.util.Calendar;
-import java.util.ResourceBundle;
import javax.xml.namespace.QName;
import javax.xml.transform.Source;
import org.jboss.logging.Logger;
-import org.jboss.ws.api.util.BundleUtils;
+import org.jboss.ws.NativeMessages;
import org.jboss.ws.common.Constants;
import org.jboss.ws.core.binding.BindingException;
import org.jboss.ws.core.binding.DeserializerSupport;
@@ -43,7 +42,6 @@
*/
public class CalendarDeserializer extends DeserializerSupport
{
- private static final ResourceBundle bundle =
BundleUtils.getBundle(CalendarDeserializer.class);
// provide logging
private static final Logger log = Logger.getLogger(CalendarDeserializer.class);
@@ -68,7 +66,7 @@
value = SimpleTypeBindings.unmarshalTime(valueStr);
else if (Constants.TYPE_LITERAL_DATETIME.equals(xmlType))
value = SimpleTypeBindings.unmarshalDateTime(valueStr);
- else throw new IllegalArgumentException(BundleUtils.getMessage(bundle,
"INVALID_XMLTYPE", xmlType));
+ else throw NativeMessages.MESSAGES.invalidXmlType(xmlType);
}
return value;
Modified:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxrpc/binding/CalendarSerializer.java
===================================================================
---
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxrpc/binding/CalendarSerializer.java 2012-10-12
08:30:12 UTC (rev 16863)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxrpc/binding/CalendarSerializer.java 2012-10-12
11:16:22 UTC (rev 16864)
@@ -22,13 +22,12 @@
package org.jboss.ws.core.jaxrpc.binding;
import java.util.Calendar;
-import java.util.ResourceBundle;
import javax.xml.namespace.QName;
import javax.xml.transform.Result;
import org.jboss.logging.Logger;
-import org.jboss.ws.api.util.BundleUtils;
+import org.jboss.ws.NativeMessages;
import org.jboss.ws.common.Constants;
import org.jboss.ws.core.binding.BindingException;
import org.jboss.ws.core.binding.SerializationContext;
@@ -45,7 +44,6 @@
*/
public class CalendarSerializer extends SerializerSupport
{
- private static final ResourceBundle bundle =
BundleUtils.getBundle(CalendarSerializer.class);
// provide logging
private static final Logger log = Logger.getLogger(CalendarSerializer.class);
@@ -62,7 +60,7 @@
else if (Constants.TYPE_LITERAL_DATETIME.equals(xmlType))
valueStr = SimpleTypeBindings.marshalDateTime((Calendar)value);
else
- throw new IllegalArgumentException(BundleUtils.getMessage(bundle,
"INVALID_XMLTYPE", xmlType));
+ throw NativeMessages.MESSAGES.invalidXmlType(xmlType);
NamespaceRegistry nsRegistry = serContext.getNamespaceRegistry();
String xmlFragment = wrapValueStr(xmlName, valueStr, nsRegistry, null, attributes,
true);
Modified:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxrpc/binding/ElementSerializer.java
===================================================================
---
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxrpc/binding/ElementSerializer.java 2012-10-12
08:30:12 UTC (rev 16863)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxrpc/binding/ElementSerializer.java 2012-10-12
11:16:22 UTC (rev 16864)
@@ -21,13 +21,11 @@
*/
package org.jboss.ws.core.jaxrpc.binding;
-import java.util.ResourceBundle;
-
import javax.xml.namespace.QName;
import javax.xml.transform.Result;
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.binding.BindingException;
import org.jboss.ws.core.binding.SerializationContext;
@@ -44,7 +42,6 @@
*/
public class ElementSerializer extends SerializerSupport
{
- private static final ResourceBundle bundle =
BundleUtils.getBundle(ElementSerializer.class);
// provide logging
private static final Logger log = Logger.getLogger(ElementSerializer.class);
@@ -59,9 +56,9 @@
{
log.debug("serialize: [xmlName=" + xmlName + ",xmlType=" +
xmlType + "]");
if (value == null)
- throw new IllegalArgumentException(BundleUtils.getMessage(bundle,
"ELEMENT_VALUE_CANNOT_BE_NULL"));
+ throw NativeMessages.MESSAGES.illegalNullArgument("value");
if ((value instanceof Element) == false)
- throw new IllegalArgumentException(BundleUtils.getMessage(bundle,
"VALUE_IS_NOT_A_ELEMENT", value.getClass().getName()));
+ throw NativeMessages.MESSAGES.valueIsNotA(Element.class, value.getClass());
String xmlFragment = DOMWriter.printNode((Element)value, false);
return new BufferedStreamResult(xmlFragment);
Deleted:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxrpc/binding/Message.properties
===================================================================
---
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxrpc/binding/Message.properties 2012-10-12
08:30:12 UTC (rev 16863)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxrpc/binding/Message.properties 2012-10-12
11:16:22 UTC (rev 16864)
@@ -1,17 +0,0 @@
-ELEMENT_VALUE_CANNOT_BE_NULL=Element value cannot be null
-VALUE_IS_NOT_A_ELEMENT=Value is not a Element: {0}
-USE_SERIALIZE=Use serialize(SOAPContenentElement, SerializationContext)
-
-CANNOT_OBTAIN_COMPONENT_XMLTYPE=Cannot obtain component xmlType for: {0}
-CANNOT_OBTAIN_COMPONENT_DESERIALIZER=Cannot obtain component serializer for: javaType={0}
xmlType={1}
-CANNOT_OBTAIN_COMPONENT_DESERIALIZER_FOR=Cannot obtain component serializer for: {1}
-CANNOT_OBTAIN_COMPONENT_SERIALIZER=Cannot obtain component serializer for: {0}
-UNSUPPORTED_ARRAY_TYPE=Unsupported array type: {0}
-CANNOT_OBTAIN_COMPONENT_XMLTYPE=Cannot obtain component xmlType: {0}
-
-UNSUPPORTED_ARRAY_DIMENSIONS=Unsupported array dimensions: {0}
-CANNOT_OBTAIN_ATTRIBUTE=Cannot obtain attribute: {0}
-CANNOT_OBTAIN_JAVATYPE=Cannot obtain javaType for: {0}
-INVALID_XMLTYPE=Invalid xmlType: {0}
-SOAPELEMENT_VALUE_CANNOT_BE_NULL=SOAPElement value cannot be null
-VALUE_IS_NOT_A_SOAPELEMENT=Value is not a SOAPElement: {0}
Modified:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxrpc/binding/SOAPArrayDeserializer.java
===================================================================
---
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxrpc/binding/SOAPArrayDeserializer.java 2012-10-12
08:30:12 UTC (rev 16863)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxrpc/binding/SOAPArrayDeserializer.java 2012-10-12
11:16:22 UTC (rev 16864)
@@ -21,9 +21,10 @@
*/
package org.jboss.ws.core.jaxrpc.binding;
+import static org.jboss.ws.NativeMessages.MESSAGES;
+
import java.lang.reflect.Array;
import java.util.Iterator;
-import java.util.ResourceBundle;
import java.util.StringTokenizer;
import javax.xml.namespace.QName;
@@ -31,8 +32,6 @@
import javax.xml.transform.dom.DOMSource;
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.DOMUtils;
import org.jboss.ws.common.JavaUtils;
@@ -52,7 +51,6 @@
*/
public class SOAPArrayDeserializer extends DeserializerSupport
{
- private static final ResourceBundle bundle =
BundleUtils.getBundle(SOAPArrayDeserializer.class);
// provide logging
private static final Logger log = Logger.getLogger(SOAPArrayDeserializer.class);
@@ -71,7 +69,7 @@
paramMetaData.setSOAPArrayCompType(compXmlType);
if (compXmlType == null)
- throw new WSException(BundleUtils.getMessage(bundle,
"CANNOT_OBTAIN_COMPONENT_XMLTYPE", paramMetaData.getPartName()));
+ throw MESSAGES.cannotObtainComponentXmlType(paramMetaData.getPartName());
Class compJavaType = getJavaTypeForComponentType(compXmlType, serContext);
@@ -85,18 +83,17 @@
AbstractDeserializerFactory compDeserializerFactory =
(AbstractDeserializerFactory)typeMapping.getDeserializer(compJavaType, compXmlType);
if (compDeserializerFactory == null)
{
- log.warn(BundleUtils.getMessage(bundle,
"CANNOT_OBTAIN_COMPONENT_DESERIALIZER", new Object[]{ compJavaType.getName() ,
compXmlType }));
compDeserializerFactory =
(AbstractDeserializerFactory)typeMapping.getDeserializer(null, compXmlType);
}
if (compDeserializerFactory == null)
- throw new WSException(BundleUtils.getMessage(bundle,
"CANNOT_OBTAIN_COMPONENT_DESERIALIZER_FOR", compXmlType));
+ throw MESSAGES.cannotObtainComponentDeserializerFor(compXmlType);
// Get the component type deserializer
componentDeserializer =
(DeserializerSupport)compDeserializerFactory.getDeserializer();
if (arrDims.length < 1 || 2 < arrDims.length)
- throw new WSException(BundleUtils.getMessage(bundle,
"UNSUPPORTED_ARRAY_DIMENSIONS", arrDims));
+ throw MESSAGES.unsupportedArrayDimensions(arrDims.length);
Iterator it = DOMUtils.getChildElements(soapElement);
if (arrDims.length == 1)
@@ -150,7 +147,7 @@
QName attrQName = new QName(Constants.URI_SOAP11_ENC, "arrayType");
QName arrayType = DOMUtils.getAttributeValueAsQName(arrayElement, attrQName);
if (arrayType == null)
- throw new WSException(BundleUtils.getMessage(bundle,
"CANNOT_OBTAIN_ATTRIBUTE", attrQName));
+ throw MESSAGES.cannotObtainAttribute(attrQName);
String localPart = arrayType.getLocalPart();
int dimIndex = localPart.indexOf("[");
@@ -169,7 +166,7 @@
QName attrQName = new QName(Constants.URI_SOAP11_ENC, "arrayType");
QName arrayType = DOMUtils.getAttributeValueAsQName(arrayElement, attrQName);
if (arrayType == null)
- throw new WSException(BundleUtils.getMessage(bundle,
"CANNOT_OBTAIN_ATTRIBUTE", attrQName));
+ throw MESSAGES.cannotObtainAttribute(attrQName);
String nsURI = arrayType.getNamespaceURI();
String localPart = arrayType.getLocalPart();
@@ -184,7 +181,7 @@
TypeMappingImpl typeMapping = serContext.getTypeMapping();
Class javaType = typeMapping.getJavaType(compXmlType);
if (javaType == null)
- throw new WSException(BundleUtils.getMessage(bundle,
"CANNOT_OBTAIN_JAVATYPE", compXmlType));
+ throw MESSAGES.cannotObtainAttribute(compXmlType);
return JavaUtils.getWrapperType(javaType);
}
Modified:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxrpc/binding/SOAPArraySerializer.java
===================================================================
---
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxrpc/binding/SOAPArraySerializer.java 2012-10-12
08:30:12 UTC (rev 16863)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxrpc/binding/SOAPArraySerializer.java 2012-10-12
11:16:22 UTC (rev 16864)
@@ -21,14 +21,12 @@
*/
package org.jboss.ws.core.jaxrpc.binding;
-import java.util.ResourceBundle;
+import static org.jboss.ws.NativeMessages.MESSAGES;
import javax.xml.namespace.QName;
import javax.xml.transform.Result;
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.AbstractSerializerFactory;
@@ -50,7 +48,6 @@
*/
public class SOAPArraySerializer extends SerializerSupport
{
- private static final ResourceBundle bundle =
BundleUtils.getBundle(SOAPArraySerializer.class);
// provide logging
private static final Logger log = Logger.getLogger(SOAPArraySerializer.class);
@@ -81,7 +78,7 @@
try
{
if (paramMetaData == null)
- throw new IllegalStateException(BundleUtils.getMessage(bundle,
"USE_SERIALIZE"));
+ throw new IllegalStateException();
QName compXmlName = paramMetaData.getXmlName();
QName compXmlType = paramMetaData.getSOAPArrayCompType();
@@ -103,18 +100,17 @@
}
if (compXmlType == null)
- throw new WSException(BundleUtils.getMessage(bundle,
"CANNOT_OBTAIN_COMPONENT_XMLTYPE", compJavaType));
+ throw MESSAGES.cannotObtainComponentXmlType(compJavaType);
// Get the component type serializer factory
log.debug("Get component serializer for: [javaType=" +
compJavaType.getName() + ",xmlType=" + compXmlType + "]");
AbstractSerializerFactory compSerializerFactory =
(AbstractSerializerFactory)typeMapping.getSerializer(compJavaType, compXmlType);
if (compSerializerFactory == null)
{
- log.warn(BundleUtils.getMessage(bundle,
"CANNOT_OBTAIN_COMPONENT_SERIALIZER", new Object[]{ compJavaType.getName() ,
compXmlType }));
compSerializerFactory =
(AbstractSerializerFactory)typeMapping.getSerializer(null, compXmlType);
}
if (compSerializerFactory == null)
- throw new WSException(BundleUtils.getMessage(bundle,
"CANNOT_OBTAIN_COMPONENT_SERIALIZER", compXmlType));
+ throw MESSAGES.cannotObtainComponentSerializerFor(compXmlType);
// Get the component type serializer
compSerializer = (SerializerSupport)compSerializerFactory.getSerializer();
@@ -128,7 +124,7 @@
buffer = new StringBuilder("<" + nodeName + " xmlns:" +
Constants.PREFIX_SOAP11_ENC + "='" + Constants.URI_SOAP11_ENC + "'
");
if (!(value instanceof Object[]))
- throw new WSException(BundleUtils.getMessage(bundle,
"UNSUPPORTED_ARRAY_TYPE", javaType));
+ throw MESSAGES.unsupportedArrayType(javaType);
Object[] objArr = (Object[])value;
String arrayDim = "" + objArr.length;
Modified:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxrpc/binding/SOAPElementSerializer.java
===================================================================
---
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxrpc/binding/SOAPElementSerializer.java 2012-10-12
08:30:12 UTC (rev 16863)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxrpc/binding/SOAPElementSerializer.java 2012-10-12
11:16:22 UTC (rev 16864)
@@ -21,14 +21,12 @@
*/
package org.jboss.ws.core.jaxrpc.binding;
-import java.util.ResourceBundle;
-
import javax.xml.namespace.QName;
import javax.xml.soap.SOAPElement;
import javax.xml.transform.Result;
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.binding.BindingException;
import org.jboss.ws.core.binding.SerializationContext;
@@ -44,7 +42,6 @@
*/
public class SOAPElementSerializer extends SerializerSupport
{
- private static final ResourceBundle bundle =
BundleUtils.getBundle(SOAPElementSerializer.class);
// provide logging
private static final Logger log = Logger.getLogger(SOAPElementSerializer.class);
@@ -58,9 +55,9 @@
{
log.debug("serialize: [xmlName=" + xmlName + ",xmlType=" +
xmlType + "]");
if (value == null)
- throw new IllegalArgumentException(BundleUtils.getMessage(bundle,
"SOAPELEMENT_VALUE_CANNOT_BE_NULL"));
+ throw NativeMessages.MESSAGES.illegalNullArgument("value");
if ((value instanceof SOAPElement) == false)
- throw new IllegalArgumentException(BundleUtils.getMessage(bundle,
"VALUE_IS_NOT_A_SOAPELEMENT", value.getClass().getName()));
+ throw NativeMessages.MESSAGES.valueIsNotA(SOAPElement.class, value.getClass());
String xmlFragment = DOMWriter.printNode((SOAPElement)value, false);
return new BufferedStreamResult(xmlFragment);
Modified:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxrpc/binding/jbossxb/JBossXBMarshallerImpl.java
===================================================================
---
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxrpc/binding/jbossxb/JBossXBMarshallerImpl.java 2012-10-12
08:30:12 UTC (rev 16863)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxrpc/binding/jbossxb/JBossXBMarshallerImpl.java 2012-10-12
11:16:22 UTC (rev 16864)
@@ -25,13 +25,10 @@
import java.io.OutputStreamWriter;
import java.io.Writer;
import java.util.HashMap;
-import java.util.ResourceBundle;
import javax.xml.namespace.QName;
-import org.jboss.logging.Logger;
-import org.jboss.ws.WSException;
-import org.jboss.ws.api.util.BundleUtils;
+import org.jboss.ws.NativeMessages;
import org.jboss.ws.common.JavaUtils;
import org.jboss.ws.metadata.jaxrpcmapping.JavaWsdlMapping;
import org.jboss.ws.metadata.jaxrpcmapping.JavaXmlTypeMapping;
@@ -50,11 +47,6 @@
* @since 05-Jul-2006
*/
public class JBossXBMarshallerImpl implements JBossXBMarshaller {
- private static final ResourceBundle bundle =
BundleUtils.getBundle(JBossXBMarshallerImpl.class);
-
- // provide logging
- private static final Logger log = Logger.getLogger(JBossXBMarshallerImpl.class);
-
// The marshaller properties
private HashMap properties = new HashMap();
@@ -184,7 +176,7 @@
public Object getProperty(String name)
{
if (name == null)
- throw new IllegalArgumentException(BundleUtils.getMessage(bundle,
"NAME_PARAMETER_IS_NULL"));
+ throw NativeMessages.MESSAGES.illegalNullArgument("name");
return properties.get(name);
}
@@ -197,7 +189,7 @@
public void setProperty(String name, Object value)
{
if (name == null)
- throw new IllegalArgumentException(BundleUtils.getMessage(bundle,
"NAME_PARAMETER_IS_NULL"));
+ throw NativeMessages.MESSAGES.illegalNullArgument("name");
properties.put(name, value);
}
@@ -216,16 +208,16 @@
private void assertRequiredProperties()
{
if (getProperty(JBossXBConstants.JBXB_SCHEMA_READER) == null &&
getProperty(JBossXBConstants.JBXB_XS_MODEL) == null)
- throw new WSException(BundleUtils.getMessage(bundle,
"CANNOT_FIND_REQUIRED_PROPERTY", JBossXBConstants.JBXB_XS_MODEL));
+ throw
NativeMessages.MESSAGES.cannotFindRequiredProperty(JBossXBConstants.JBXB_XS_MODEL);
if (getProperty(JBossXBConstants.JBXB_JAVA_MAPPING) == null)
- throw new WSException(BundleUtils.getMessage(bundle,
"CANNOT_FIND_REQUIRED_PROPERTY", JBossXBConstants.JBXB_JAVA_MAPPING));
+ throw
NativeMessages.MESSAGES.cannotFindRequiredProperty(JBossXBConstants.JBXB_JAVA_MAPPING);
QName xmlName = (QName)getProperty(JBossXBConstants.JBXB_ROOT_QNAME);
if (xmlName == null)
- throw new WSException(BundleUtils.getMessage(bundle,
"CANNOT_FIND_REQUIRED_PROPERTY", JBossXBConstants.JBXB_ROOT_QNAME));
+ throw
NativeMessages.MESSAGES.cannotFindRequiredProperty(JBossXBConstants.JBXB_ROOT_QNAME);
if (xmlName.getNamespaceURI().length() > 0 &&
xmlName.getPrefix().length() == 0)
- throw new IllegalArgumentException(BundleUtils.getMessage(bundle,
"MUST_BE_PREFIX_QUALIFIED", xmlName));
+ throw NativeMessages.MESSAGES.mustBePrefixQualified(xmlName);
}
}
Modified:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxrpc/binding/jbossxb/JBossXBSupport.java
===================================================================
---
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxrpc/binding/jbossxb/JBossXBSupport.java 2012-10-12
08:30:12 UTC (rev 16863)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxrpc/binding/jbossxb/JBossXBSupport.java 2012-10-12
11:16:22 UTC (rev 16864)
@@ -22,11 +22,10 @@
package org.jboss.ws.core.jaxrpc.binding.jbossxb;
import java.util.Map;
-import java.util.ResourceBundle;
import javax.xml.namespace.QName;
-import org.jboss.ws.api.util.BundleUtils;
+import org.jboss.ws.NativeMessages;
import org.jboss.ws.core.CommonMessageContext;
import org.jboss.ws.core.soap.utils.MessageContextAssociation;
import org.jboss.ws.metadata.jaxrpcmapping.JavaWsdlMapping;
@@ -47,7 +46,6 @@
* @since May 31, 2006
*/
public class JBossXBSupport {
- private static final ResourceBundle bundle =
BundleUtils.getBundle(JBossXBSupport.class);
/**
* Setup SchemaBinding associated with the ServiceMetaData.
@@ -122,7 +120,7 @@
}
catch (SAXException e1)
{
- throw new IllegalStateException(BundleUtils.getMessage(bundle,
"FAILED_TO_MARSHAL_DOM_ELEMENT", new Object[]{new QName(e.getNamespaceURI(),
e.getLocalName()) , e1.getMessage()}));
+ throw NativeMessages.MESSAGES.failedToMarshalDOMElement(new
QName(e.getNamespaceURI(), e.getLocalName()), e1);
}
}
};
Modified:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxrpc/binding/jbossxb/JBossXBUnmarshallerImpl.java
===================================================================
---
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxrpc/binding/jbossxb/JBossXBUnmarshallerImpl.java 2012-10-12
08:30:12 UTC (rev 16863)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxrpc/binding/jbossxb/JBossXBUnmarshallerImpl.java 2012-10-12
11:16:22 UTC (rev 16864)
@@ -23,10 +23,8 @@
import java.io.InputStream;
import java.util.HashMap;
-import java.util.ResourceBundle;
-import org.jboss.ws.WSException;
-import org.jboss.ws.api.util.BundleUtils;
+import org.jboss.ws.NativeMessages;
import org.jboss.xb.binding.JBossXBException;
import org.jboss.xb.binding.UnmarshallerFactory;
import org.jboss.xb.binding.sunday.unmarshalling.SchemaBinding;
@@ -40,7 +38,6 @@
*/
public class JBossXBUnmarshallerImpl implements JBossXBUnmarshaller
{
- private static final ResourceBundle bundle =
BundleUtils.getBundle(JBossXBUnmarshallerImpl.class);
// The marshaller properties
private HashMap<String, Object> properties = new HashMap<String,
Object>();
@@ -70,7 +67,7 @@
public Object getProperty(String name)
{
if (name == null)
- throw new IllegalArgumentException(BundleUtils.getMessage(bundle,
"NAME_PARAMETER_IS_NULL"));
+ throw NativeMessages.MESSAGES.illegalNullArgument("name");
return properties.get(name);
}
@@ -81,7 +78,7 @@
public void setProperty(String name, Object value)
{
if (name == null)
- throw new IllegalArgumentException(BundleUtils.getMessage(bundle,
"NAME_PARAMETER_IS_NULL"));
+ throw NativeMessages.MESSAGES.illegalNullArgument("name");
properties.put(name, value);
}
@@ -93,12 +90,12 @@
{
if (getProperty(JBossXBConstants.JBXB_XS_MODEL) == null)
{
- throw new WSException(BundleUtils.getMessage(bundle,
"CANNOT_FIND_REQUIRED_PROPERTY", JBossXBConstants.JBXB_XS_MODEL));
+ throw
NativeMessages.MESSAGES.cannotFindRequiredProperty(JBossXBConstants.JBXB_XS_MODEL);
}
if (getProperty(JBossXBConstants.JBXB_JAVA_MAPPING) == null)
{
- throw new WSException(BundleUtils.getMessage(bundle,
"CANNOT_FIND_REQUIRED_PROPERTY", JBossXBConstants.JBXB_JAVA_MAPPING));
+ throw
NativeMessages.MESSAGES.cannotFindRequiredProperty(JBossXBConstants.JBXB_JAVA_MAPPING);
}
}
}
Deleted:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxrpc/binding/jbossxb/Message.properties
===================================================================
---
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxrpc/binding/jbossxb/Message.properties 2012-10-12
08:30:12 UTC (rev 16863)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxrpc/binding/jbossxb/Message.properties 2012-10-12
11:16:22 UTC (rev 16864)
@@ -1,14 +0,0 @@
-CANNOT_OBTAIN_TYPE_BINDING=Cannot obtain type binding for: {0}
-AMBIGUOUS_BINDING=Ambiguous binding for attribute: {0}
-ATTRIBUTE_NOT_IN_SCHEMA=Attribute {0} found in jaxrpc-mapping but not in the schema: {1}
-ELEMENT_NOT_IN_SCHEMA=Element {0} found in jaxrpc-mapping but not in the schema: {1}
-TYPE_DEFINITION_NOT_FOUND_IN_SCHEMA=Type definition not found in schema: {0}
-GLOBAL_ELEMENT_NOT_FOUND_IN_SCHEMA=Global element not found in schema: {0}
-UNEXPECTED_QNAME_SCOPE=Unexpected qname-scope for {0}: {1}
-ROOT_TYPE_NOT_FOUND_IN_SCHEMA=Root type {0} not found in the schema.
-FAILED_TO_CREATE_SOAPELEMENT=Failed to create SOAPElement
-FAILED_TO_CREATE_SOAPELEMENT_FACTORY=Failed to create soap element factory
-NAME_PARAMETER_IS_NULL=name parameter is null
-CANNOT_FIND_REQUIRED_PROPERTY=Cannot find required property: {0}
-FAILED_TO_MARSHAL_DOM_ELEMENT=Failed to marshal DOM element {0}: {1}
-MUST_BE_PREFIX_QUALIFIED=The given root element name must be prefix qualified: {0}
Modified:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxrpc/binding/jbossxb/SchemaBindingBuilder.java
===================================================================
---
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxrpc/binding/jbossxb/SchemaBindingBuilder.java 2012-10-12
08:30:12 UTC (rev 16863)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxrpc/binding/jbossxb/SchemaBindingBuilder.java 2012-10-12
11:16:22 UTC (rev 16864)
@@ -23,7 +23,6 @@
import java.util.ArrayList;
import java.util.Iterator;
-import java.util.ResourceBundle;
import javax.xml.namespace.NamespaceContext;
import javax.xml.namespace.QName;
@@ -34,8 +33,8 @@
import org.apache.xerces.xs.XSModel;
import org.jboss.logging.Logger;
import org.jboss.util.xml.JBossEntityResolver;
-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.utils.JBossWSEntityResolver;
import org.jboss.ws.metadata.jaxrpcmapping.ExceptionMapping;
@@ -77,7 +76,6 @@
*/
public class SchemaBindingBuilder
{
- private static final ResourceBundle bundle =
BundleUtils.getBundle(SchemaBindingBuilder.class);
// provide logging
private static final Logger log = Logger.getLogger(SchemaBindingBuilder.class);
@@ -236,7 +234,7 @@
}
else
{
- log.warn(BundleUtils.getMessage(bundle, "CANNOT_OBTAIN_TYPE_BINDING",
xmlType));
+ NativeLoggers.JAXRPC_LOGGER.cannotObtainTypeBindingFor(xmlType);
}
}
@@ -256,7 +254,7 @@
if (auxBinding.getQName().getLocalPart().equals(xmlAttrName))
{
if (attrBinding != null)
- log.warn(BundleUtils.getMessage(bundle, "AMBIGUOUS_BINDING",
xmlAttrName));
+ NativeLoggers.JAXRPC_LOGGER.ambiguosBinding(xmlAttrName);
attrBinding = auxBinding;
}
@@ -279,7 +277,7 @@
if (attrBinding == null)
{
QName typeQName = typeBinding.getQName();
- throw new WSException(BundleUtils.getMessage(bundle,
"ATTRIBUTE_NOT_IN_SCHEMA", new Object[]{ xmlName , typeQName}));
+ throw NativeMessages.MESSAGES.attributeNotInSchema(xmlName, typeQName);
}
String javaVariableName = varMapping.getJavaVariableName();
@@ -322,7 +320,7 @@
}
if (element == null)
- throw new WSException(BundleUtils.getMessage(bundle,
"ELEMENT_NOT_IN_SCHEMA", new Object[]{ xmlName , typeQName}));
+ throw NativeMessages.MESSAGES.elementNotInSchema(xmlName, typeQName);
String javaVariableName = varMapping.getJavaVariableName();
if (javaVariableName != null)
@@ -380,7 +378,7 @@
typeBinding = schemaBinding.getType(xmlType);
if (typeBinding == null)
{
- log.warn(BundleUtils.getMessage(bundle,
"TYPE_DEFINITION_NOT_FOUND_IN_SCHEMA", xmlType));
+ NativeLoggers.JAXRPC_LOGGER.typeDefinitionNotInSchema(xmlType);
}
}
else if ("element".equals(qnameScope))
@@ -392,12 +390,12 @@
}
else
{
- log.warn(BundleUtils.getMessage(bundle,
"GLOBAL_ELEMENT_NOT_FOUND_IN_SCHEMA", xmlType));
+ NativeLoggers.JAXRPC_LOGGER.globalElementNotInSchema(xmlType);
}
}
else
{
- throw new WSException(BundleUtils.getMessage(bundle,
"UNEXPECTED_QNAME_SCOPE", new Object[]{ typeMapping.getJavaType() ,
qnameScope}));
+ throw NativeMessages.MESSAGES.unexpectedQNameScope(typeMapping.getJavaType(),
qnameScope);
}
return typeBinding;
}
@@ -462,7 +460,7 @@
}
else if (xmlType.equals(Constants.TYPE_LITERAL_ANYTYPE) == false)
{
- throw new WSException(BundleUtils.getMessage(bundle,
"ROOT_TYPE_NOT_FOUND_IN_SCHEMA", xmlType ));
+ throw NativeMessages.MESSAGES.rootTypeNotFoundInSchema(xmlType);
}
}
@@ -605,7 +603,7 @@
}
catch (SOAPException e)
{
- throw new IllegalStateException(BundleUtils.getMessage(bundle,
"FAILED_TO_CREATE_SOAPELEMENT"), e);
+ throw new IllegalStateException(e);
}
if (attrs != null)
@@ -646,7 +644,7 @@
}
catch (SOAPException e)
{
- throw new IllegalStateException(BundleUtils.getMessage(bundle,
"FAILED_TO_CREATE_SOAPELEMENT_FACTORY"), e);
+ throw new IllegalStateException(e);
}
}
return factory;
Modified:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxrpc/client/CallImpl.java
===================================================================
---
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxrpc/client/CallImpl.java 2012-10-12
08:30:12 UTC (rev 16863)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxrpc/client/CallImpl.java 2012-10-12
11:16:22 UTC (rev 16864)
@@ -21,6 +21,8 @@
*/
package org.jboss.ws.core.jaxrpc.client;
+import static org.jboss.ws.NativeMessages.MESSAGES;
+
import java.rmi.RemoteException;
import java.util.ArrayList;
import java.util.Arrays;
@@ -31,7 +33,6 @@
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
-import java.util.ResourceBundle;
import java.util.Set;
import javax.xml.namespace.QName;
@@ -45,7 +46,6 @@
import javax.xml.soap.SOAPException;
import org.jboss.logging.Logger;
-import org.jboss.ws.api.util.BundleUtils;
import org.jboss.ws.common.Constants;
import org.jboss.ws.common.JavaUtils;
import org.jboss.ws.core.CommonBindingProvider;
@@ -81,7 +81,6 @@
*/
public class CallImpl extends CommonClient implements Call, RoleSource
{
- private static final ResourceBundle bundle = BundleUtils.getBundle(CallImpl.class);
// provide logging
private static Logger log = Logger.getLogger(CallImpl.class);
@@ -198,7 +197,6 @@
// the javaType can be derived from the xmlType
if (javaType == null)
{
- log.warn(BundleUtils.getMessage(bundle,
"REGISTER_UNQUALIFIED_PARAMETER", xmlType));
javaType = new UnqualifiedCallParameter(xmlType).getClass();
typeMapping.register(javaType, xmlType, null, null);
}
@@ -219,8 +217,10 @@
*/
public void addParameter(QName xmlName, QName xmlType, Class javaType, ParameterMode
mode, boolean inHeader)
{
- if (xmlType == null || javaType == null)
- throw new IllegalArgumentException(BundleUtils.getMessage(bundle,
"INVALID_NULL_PARAMETER"));
+ if (xmlType == null)
+ throw MESSAGES.illegalNullArgument("xmlType");
+ if (javaType == null)
+ throw MESSAGES.illegalNullArgument("javaType");
OperationMetaData opMetaData = getOperationMetaData();
ParameterMetaData paramMetaData = new ParameterMetaData(opMetaData, xmlName,
xmlType, javaType.getName());
@@ -256,8 +256,10 @@
*/
public void setReturnType(QName xmlType, Class javaType)
{
- if (xmlType == null || javaType == null)
- throw new IllegalArgumentException(BundleUtils.getMessage(bundle,
"INVALID_NULL_PARAMETER"));
+ if (xmlType == null)
+ throw MESSAGES.illegalNullArgument("xmlType");
+ if (javaType == null)
+ throw MESSAGES.illegalNullArgument("javaType");
OperationMetaData opMetaData = getOperationMetaData();
QName xmlName = new QName("");
@@ -309,7 +311,7 @@
public List getOutputValues()
{
if (epInv == null)
- throw new JAXRPCException(BundleUtils.getMessage(bundle,
"OUTPUT_PARAMS_NOT_AVAILABLE"));
+ throw MESSAGES.outputParamsNotAvailable();
try
{
@@ -333,7 +335,7 @@
}
catch (SOAPException ex)
{
- throw new JAXRPCException(BundleUtils.getMessage(bundle,
"CANNOT_OBTAIN_RESPONSE_PAYLOAD"), ex);
+ throw MESSAGES.cannotObtainResponsePayload(ex);
}
}
@@ -346,7 +348,7 @@
public Map getOutputParams()
{
if (epInv == null)
- throw new JAXRPCException(BundleUtils.getMessage(bundle,
"OUTPUT_PARAMS_NOT_AVAILABLE"));
+ throw MESSAGES.outputParamsNotAvailable();
try
{
@@ -360,7 +362,7 @@
}
catch (SOAPException ex)
{
- throw new JAXRPCException(BundleUtils.getMessage(bundle,
"CANNOT_OBTAIN_RESPONSE_PAYLOAD"), ex);
+ throw MESSAGES.cannotObtainResponsePayload(ex);
}
}
@@ -449,10 +451,10 @@
public Object getProperty(String name)
{
if (null == name)
- throw new JAXRPCException(BundleUtils.getMessage(bundle,
"UNSUPPORTED_PROPERTY", name));
+ throw MESSAGES.unsupportedPropery(name);
// CTS:
com/sun/ts/tests/jaxrpc/api/javax_xml_rpc/Call/Client.java#SetGetPropertyTest2
if (name.startsWith("javax.xml.rpc") &&
standardProperties.contains(name) == false)
- throw new JAXRPCException(BundleUtils.getMessage(bundle,
"UNSUPPORTED_PROPERTY", name));
+ throw MESSAGES.unsupportedPropery(name);
return properties.get(name);
}
@@ -462,11 +464,11 @@
public void setProperty(String name, Object value)
{
if (null == name)
- throw new JAXRPCException(BundleUtils.getMessage(bundle,
"UNSUPPORTED_PROPERTY", name));
+ throw MESSAGES.unsupportedPropery(name);
// CTS:
com/sun/ts/tests/jaxrpc/api/javax_xml_rpc/Call/Client.java#SetGetPropertyTest2
if (name.startsWith("javax.xml.rpc") &&
standardProperties.contains(name) == false)
- throw new JAXRPCException(BundleUtils.getMessage(bundle,
"UNSUPPORTED_PROPERTY", name));
+ throw MESSAGES.unsupportedPropery(name);
if (log.isDebugEnabled())
log.debug("setProperty: [name=" + name + ",value=" + value +
"]");
@@ -532,9 +534,9 @@
}
catch (SOAPFaultException ex)
{
- log.error(BundleUtils.getMessage(bundle, "CALL_INVOCATION_FAILED"),
ex);
+ log.error(MESSAGES.callInvocationFailed(), ex);
String faultCode = ex.getFaultCode().getLocalPart();
- throw new RemoteException(BundleUtils.getMessage(bundle,
"CALL_INVOCATION_FAILED_CAUSE", new Object[]{ faultCode ,
ex.getFaultString()}), ex);
+ throw new RemoteException(MESSAGES.callInvocationFailedBecauseOf(faultCode,
ex.getFaultString()), ex);
}
catch (RemoteException rex)
{
@@ -546,7 +548,7 @@
}
catch (Exception ex)
{
- throw new RemoteException(BundleUtils.getMessage(bundle,
"CALL_INVOCATION_FAILED"), ex);
+ throw new RemoteException(MESSAGES.callInvocationFailed(), ex);
}
finally
{
@@ -656,7 +658,7 @@
}
else if (regJavaType != null && JavaUtils.isAssignableFrom(regJavaType,
javaType) == false)
{
- throw new IllegalArgumentException(BundleUtils.getMessage(bundle,
"ALREADY_REGISTERED", regJavaType.getName()));
+ throw MESSAGES.differentJavaTypeAlreadyRegistered(regJavaType.getName());
}
}
}
Modified:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxrpc/client/HandlerRegistryImpl.java
===================================================================
---
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxrpc/client/HandlerRegistryImpl.java 2012-10-12
08:30:12 UTC (rev 16863)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxrpc/client/HandlerRegistryImpl.java 2012-10-12
11:16:22 UTC (rev 16864)
@@ -27,7 +27,6 @@
import java.util.Iterator;
import java.util.List;
import java.util.Map;
-import java.util.ResourceBundle;
import java.util.Set;
import javax.xml.namespace.QName;
@@ -35,8 +34,8 @@
import javax.xml.rpc.handler.HandlerInfo;
import javax.xml.rpc.handler.HandlerRegistry;
-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.jaxrpc.handler.ClientHandlerChain;
import org.jboss.ws.metadata.umdm.EndpointMetaData;
import org.jboss.ws.metadata.umdm.HandlerMetaDataJAXRPC;
@@ -60,10 +59,6 @@
*/
public class HandlerRegistryImpl implements HandlerRegistry
{
- private static final ResourceBundle bundle =
BundleUtils.getBundle(HandlerRegistryImpl.class);
- // provide logging
- private static Logger log = Logger.getLogger(HandlerRegistryImpl.class);
-
// Map<QName,HandlerChain> the endpoint name to a HandlerChain
private Map<QName, HandlerChain> handlerChains = new HashMap<QName,
HandlerChain>();
// Maps the port name to a list of HandlerInfo objects
@@ -108,7 +103,7 @@
EndpointMetaData epMetaData = serviceMetaData.getEndpoint(portName);
if (epMetaData == null)
- throw new IllegalStateException(BundleUtils.getMessage(bundle,
"CANNOT_OBTAIN_ENDPOINT_META_DATA", portName));
+ throw NativeMessages.MESSAGES.cannotObtainEndpointMetaData(portName);
epMetaData.clearHandlers();
for (HandlerInfo info : infos)
@@ -142,7 +137,7 @@
handler.setInitParams(initParams);
epMetaData.addHandler(handler);
- log.debug("Add handler to: " + portName + handler);
+ NativeLoggers.JAXRPC_LOGGER.addHandlerTo(portName, handler);
}
}
}
Deleted:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxrpc/client/Message.properties
===================================================================
---
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxrpc/client/Message.properties 2012-10-12
08:30:12 UTC (rev 16863)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxrpc/client/Message.properties 2012-10-12
11:16:22 UTC (rev 16864)
@@ -1,27 +0,0 @@
-REGISTER_UNQUALIFIED_PARAMETER=Register unqualified call parameter for: {0}
-INVALID_NULL_PARAMETER=Invalid null parameter
-OUTPUT_PARAMS_NOT_AVAILABLE=Output params not available
-CANNOT_OBTAIN_RESPONSE_PAYLOAD=Cannot obtain response payload
-CALL_INVOCATION_FAILED=Call invocation failed
-CALL_INVOCATION_FAILED_CAUSE=Call invocation failed with code [{0}] because of: {1}
-ALREADY_REGISTERED=Different java type already registered: {0}
-
-CANNOT_OBTAIN_ENDPOINT_META_DATA=Cannot obtain endpoint meta data for: {0}
-CANNOT_FIND_ENDPOINT=Cannot find endpoint for name: {0}
-SHOULD_NOT_USE_METHOD=Components should not use the {0} method.
-SEI_CLASS_CANNOT_BE_NULL=SEI class cannot be null
-
-SERVICE_META_DATA_NOT_AVAILABLE=Service meta data not available
-CANNOT_FIND_ENDPOINT_META_DATA=Cannot find endpoint meta data for: {0}
-
-NOT_IMPLEMENT_REMOTE=SEI does not implement java.rmi.Remote: {0}
-CANNOT_CREATE_PROXY=Cannot create proxy
-SEI_CLASS_CANNOT_BE_NULL=SEI class cannot be null
-SERVICE_META_DATA_NOT_AVAILABLE=Service meta data not available
-SEI_DOES_NOT_IMPLEMENT_JAVA.RMI.REMOTE=SEI does not implement java.rmi.Remote: {0}
-CANNOT_OBTAIN_ENDPOINT_META_DATA_FOR=Cannot obtain endpoint meta data for: {0}
-CANNOT_CREATE_PROXY=Cannot create proxy
-CANNOT_OBTAIN_OPERATION_META_DATA=Cannot obtain operation meta data for: {0}
-RETURN_VALUE_NOT_SUPPORTED=Return value not supported by: {0}
-UNSUPPORTED_PROPERTY=Unsupported property: {0}
-LEGACY_PROPERY=Legacy propery {0} mapped to {1}
Modified:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxrpc/client/PortProxy.java
===================================================================
---
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxrpc/client/PortProxy.java 2012-10-12
08:30:12 UTC (rev 16863)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxrpc/client/PortProxy.java 2012-10-12
11:16:22 UTC (rev 16864)
@@ -30,16 +30,12 @@
import java.util.HashSet;
import java.util.List;
import java.util.Map;
-import java.util.ResourceBundle;
import java.util.Set;
-import javax.xml.rpc.JAXRPCException;
import javax.xml.rpc.Stub;
import javax.xml.rpc.soap.SOAPFaultException;
-import org.jboss.logging.Logger;
-import org.jboss.ws.WSException;
-import org.jboss.ws.api.util.BundleUtils;
+import org.jboss.ws.NativeMessages;
import org.jboss.ws.common.JavaUtils;
import org.jboss.ws.core.StubExt;
import org.jboss.ws.metadata.umdm.EndpointMetaData;
@@ -53,10 +49,6 @@
*/
public class PortProxy implements InvocationHandler
{
- private static final ResourceBundle bundle = BundleUtils.getBundle(PortProxy.class);
- // provide logging
- private static final Logger log = Logger.getLogger(PortProxy.class);
-
// The underlying Call
private CallImpl call;
// List<Method> of the Stub methods
@@ -141,7 +133,7 @@
EndpointMetaData epMetaData = call.getEndpointMetaData();
OperationMetaData opMetaData = epMetaData.getOperation(method);
if (opMetaData == null)
- throw new WSException(BundleUtils.getMessage(bundle,
"CANNOT_OBTAIN_OPERATION_META_DATA", methodName));
+ throw NativeMessages.MESSAGES.cannotObtainOperationMetaData(methodName);
call.setOperationName(opMetaData.getQName());
@@ -159,7 +151,7 @@
{
Class retType = method.getReturnType();
if (retType == null)
- throw new WSException(BundleUtils.getMessage(bundle,
"RETURN_VALUE_NOT_SUPPORTED", opMetaData));
+ throw
NativeMessages.MESSAGES.returnValueNotSupportedBy(opMetaData);
if (JavaUtils.isPrimitive(retType))
retObj = JavaUtils.getPrimitiveValueArray(retObj);
@@ -190,12 +182,11 @@
private String assertPropertyName(String name)
{
if (name != null && name.startsWith("javax.xml.rpc") &&
standardProperties.contains(name) == false)
- throw new JAXRPCException(BundleUtils.getMessage(bundle,
"UNSUPPORTED_PROPERTY", name));
+ throw NativeMessages.MESSAGES.unsupportedPropery(name);
if (legacyPropertyMap.keySet().contains(name))
{
String jbosswsName = legacyPropertyMap.get(name);
- log.warn(BundleUtils.getMessage(bundle, "LEGACY_PROPERY", new
Object[]{ name , jbosswsName }));
name = jbosswsName;
}
Modified:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxrpc/client/ServiceFactoryImpl.java
===================================================================
---
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxrpc/client/ServiceFactoryImpl.java 2012-10-12
08:30:12 UTC (rev 16863)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxrpc/client/ServiceFactoryImpl.java 2012-10-12
11:16:22 UTC (rev 16864)
@@ -29,7 +29,7 @@
import javax.xml.rpc.ServiceException;
import javax.xml.rpc.ServiceFactory;
-import org.jboss.logging.Logger;
+import org.jboss.ws.NativeLoggers;
/**
* Service class acts as a factory for:
@@ -44,9 +44,6 @@
*/
public class ServiceFactoryImpl extends ServiceFactory
{
- // provide logging
- private final Logger log = Logger.getLogger(ServiceFactoryImpl.class);
-
/**
* Create an instance of the generated service implementation class for a given
service interface, if available.
*
@@ -120,7 +117,7 @@
URL mappingURL = SecurityActions.getResource(cl,
"META-INF/jaxrpc-mapping.xml");
if (mappingURL != null)
- log.info("Use jaxrpc-mapping from: " + mappingURL);
+ NativeLoggers.JAXRPC_LOGGER.useJaxRpcMappingFrom(mappingURL);
return createService(wsdlURL, serviceName, mappingURL, null);
}
Modified:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxrpc/client/ServiceImpl.java
===================================================================
---
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxrpc/client/ServiceImpl.java 2012-10-12
08:30:12 UTC (rev 16863)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxrpc/client/ServiceImpl.java 2012-10-12
11:16:22 UTC (rev 16864)
@@ -21,6 +21,8 @@
*/
package org.jboss.ws.core.jaxrpc.client;
+import static org.jboss.ws.NativeMessages.MESSAGES;
+
import java.io.Externalizable;
import java.io.IOException;
import java.io.ObjectInput;
@@ -34,7 +36,6 @@
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
-import java.util.ResourceBundle;
import java.util.Set;
import javax.xml.namespace.QName;
@@ -46,8 +47,7 @@
import javax.xml.rpc.handler.HandlerInfo;
import javax.xml.rpc.handler.HandlerRegistry;
-import org.jboss.logging.Logger;
-import org.jboss.ws.api.util.BundleUtils;
+import org.jboss.ws.NativeLoggers;
import org.jboss.ws.common.ResourceLoaderAdapter;
import org.jboss.ws.core.StubExt;
import org.jboss.ws.metadata.builder.jaxrpc.JAXRPCClientMetaDataBuilder;
@@ -79,10 +79,6 @@
*/
public class ServiceImpl implements ServiceExt, Serializable, Externalizable
{
- private static final ResourceBundle bundle =
BundleUtils.getBundle(ServiceImpl.class);
- // provide logging
- private static final Logger log = Logger.getLogger(ServiceImpl.class);
-
// The service meta data that is associated with this JAXRPC Service
private transient ServiceMetaData serviceMetaData;
private QName serviceName;
@@ -291,7 +287,7 @@
{
EndpointMetaData epMetaData = serviceMetaData.getEndpoint(portName);
if (epMetaData == null)
- throw new ServiceException(BundleUtils.getMessage(bundle,
"CANNOT_FIND_ENDPOINT", portName));
+ throw MESSAGES.cannotFindEndpointForName(portName);
List<Call> calls = new ArrayList<Call>();
for (OperationMetaData opMetaData : epMetaData.getOperations())
@@ -314,7 +310,7 @@
*/
public HandlerRegistry getHandlerRegistry()
{
- throw new UnsupportedOperationException(BundleUtils.getMessage(bundle,
"SHOULD_NOT_USE_METHOD", "getHandlerRegistry()"));
+ throw MESSAGES.shouldNotUseMethod("getHandlerRegistry()");
}
/**
@@ -333,7 +329,7 @@
*/
public TypeMappingRegistry getTypeMappingRegistry()
{
- throw new UnsupportedOperationException(BundleUtils.getMessage(bundle,
"SHOULD_NOT_USE_METHOD", "getTypeMappingRegistry()"));
+ throw MESSAGES.shouldNotUseMethod("getTypeMappingRegistry()");
}
/**
@@ -371,14 +367,14 @@
public Remote getPort(Class seiClass) throws ServiceException
{
if (seiClass == null)
- throw new IllegalArgumentException(BundleUtils.getMessage(bundle,
"SEI_CLASS_CANNOT_BE_NULL"));
+ throw MESSAGES.illegalNullArgument("seiClass");
String seiName = seiClass.getName();
if (Remote.class.isAssignableFrom(seiClass) == false)
- throw new ServiceException(BundleUtils.getMessage(bundle,
"NOT_IMPLEMENT_REMOTE", seiName));
+ throw new ServiceException(MESSAGES.notImplementRemote(seiName));
if (serviceMetaData == null)
- throw new ServiceException(BundleUtils.getMessage(bundle,
"SERVICE_META_DATA_NOT_AVAILABLE"));
+ throw MESSAGES.serviceMetaDataNotAvailable();
try
{
@@ -390,7 +386,7 @@
}
if (epMetaData == null)
- throw new ServiceException(BundleUtils.getMessage(bundle,
"CANNOT_FIND_ENDPOINT_META_DATA", seiName));
+ throw MESSAGES.cannotFindEndpointMetaData(seiName);
return createProxy(seiClass, epMetaData);
}
@@ -400,7 +396,7 @@
}
catch (Exception ex)
{
- throw new ServiceException(BundleUtils.getMessage(bundle,
"CANNOT_CREATE_PROXY"), ex);
+ throw new ServiceException(ex);
}
}
@@ -414,18 +410,18 @@
public Remote getPort(QName portName, Class seiClass) throws ServiceException
{
if (seiClass == null)
- throw new IllegalArgumentException(BundleUtils.getMessage(bundle,
"SEI_CLASS_CANNOT_BE_NULL"));
+ throw MESSAGES.illegalNullArgument("seiClass");
if (serviceMetaData == null)
- throw new ServiceException(BundleUtils.getMessage(bundle,
"SERVICE_META_DATA_NOT_AVAILABLE"));
+ throw MESSAGES.serviceMetaDataNotAvailable();
String seiName = seiClass.getName();
if (Remote.class.isAssignableFrom(seiClass) == false)
- throw new ServiceException(BundleUtils.getMessage(bundle,
"NOT_IMPLEMENT_REMOTE", seiName));
+ throw new ServiceException(MESSAGES.notImplementRemote(seiName));
EndpointMetaData epMetaData = serviceMetaData.getEndpoint(portName);
if (epMetaData == null)
- throw new ServiceException(BundleUtils.getMessage(bundle,
"CANNOT_OBTAIN_ENDPOINT_META_DATA", portName));
+ throw MESSAGES.cannotFindEndpointMetaData(portName);
try
{
@@ -440,7 +436,7 @@
}
catch (Exception ex)
{
- throw new ServiceException(BundleUtils.getMessage(bundle,
"CANNOT_CREATE_PROXY"), ex);
+ throw new ServiceException(ex);
}
}
@@ -451,7 +447,7 @@
// JBoss-4.0.x does not support <stub-properties>
if (initCallProperties(call, seiClass.getName()) > 0)
- log.info("Deprecated use of <call-properties> on JAXRPC Stub. Use
<stub-properties>");
+ NativeLoggers.JAXRPC_LOGGER.deprecatedUseOfCallPropsOnJAXRPCStub();
PortProxy handler = new PortProxy(call);
ClassLoader cl = epMetaData.getClassLoader();
@@ -561,7 +557,7 @@
hConfig.put(HandlerType.class.getName(), jaxrpcMetaData.getHandlerType());
HandlerInfo info = new HandlerInfo(hClass, hConfig, headerArr);
- log.debug("Adding client side handler to endpoint '" + portName
+ "': " + info);
+ NativeLoggers.JAXRPC_LOGGER.addingClientSideHandlerToEndpoint(portName,
info);
handlerInfos.add(info);
}
Deleted:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxrpc/client/serviceref/Message.properties
===================================================================
---
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxrpc/client/serviceref/Message.properties 2012-10-12
08:30:12 UTC (rev 16863)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxrpc/client/serviceref/Message.properties 2012-10-12
11:16:22 UTC (rev 16864)
@@ -1,17 +0,0 @@
-# NativeServiceReferenceableJAXRPC.java
-CANNOT_OBTAIN_PATH=Cannot obtain path to PortComponentLinkServlet: {0}
-CANNOT_MARSHALL_SERVICE_REF_META_DATA=Cannot marshall service ref meta data, cause: {0}
-CANNOT_MARSHALL_SECURITY_CONFIG=Cannot marshall security config, cause: {0}
-
-# NativeServiceObjectFactoryJAXRPC.java
-NOT_IMPLEMENT_REMOTE=SEI does not implement java.rmi.Remote: {0}
-CANNOT_UNMARSHALL_SERVICE_REF_META_DATA=Cannot unmarshall service ref meta data
-CANNOT_UNMARSHALL_SECURITY_CONFIG=Cannot unmarshall security config, cause: {0}
-CANNOT_RESOLVE_PORT_COMPONENT_LINK=Cannot resolve port-component-link: {0}
-CANNOT_SET_ENDPOINT_ADDRESS=Cannot set endpoint address for port-component-link,
unsuported number of endpoints
-NOT_IMPLEMENT_SERVICE=The service interface does not implement javax.xml.rpc.Service:
{0}
-CANNOT_CREATE_SERVICE=Cannot create service
-NOT_ALLOWED_TO_USE=Within a <service-ref> it's not allowed to use a SEI across
different <port-component-ref>'s: {0}
-FAILED_TO_NARROW_ENDPOINTS=Failed to narrow available endpoints by
<port-component-ref> declaration
-UNABLE_TO_NARROW_PORT_SELECTION=Unable to narrow port selection for {0}
-CANNOT_UNMARSHALL_JAXRPC_MAPPING_FILE=Cannot unmarshal jaxrpc-mapping-file: {0}
Modified:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxrpc/client/serviceref/NativeServiceObjectFactoryJAXRPC.java
===================================================================
---
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxrpc/client/serviceref/NativeServiceObjectFactoryJAXRPC.java 2012-10-12
08:30:12 UTC (rev 16863)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxrpc/client/serviceref/NativeServiceObjectFactoryJAXRPC.java 2012-10-12
11:16:22 UTC (rev 16864)
@@ -21,6 +21,8 @@
*/
package org.jboss.ws.core.jaxrpc.client.serviceref;
+import static org.jboss.ws.NativeMessages.MESSAGES;
+
import java.io.BufferedReader;
import java.io.ByteArrayInputStream;
import java.io.IOException;
@@ -38,7 +40,6 @@
import java.util.List;
import java.util.Map;
import java.util.Properties;
-import java.util.ResourceBundle;
import javax.naming.Context;
import javax.naming.Name;
@@ -47,12 +48,10 @@
import javax.naming.Reference;
import javax.naming.spi.ObjectFactory;
import javax.xml.namespace.QName;
-import javax.xml.rpc.JAXRPCException;
import javax.xml.rpc.Service;
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.core.jaxrpc.client.ServiceExt;
import org.jboss.ws.core.jaxrpc.client.ServiceImpl;
@@ -83,7 +82,6 @@
*/
public final class NativeServiceObjectFactoryJAXRPC implements ObjectFactory
{
- private static final ResourceBundle bundle =
BundleUtils.getBundle(NativeServiceObjectFactoryJAXRPC.class);
// provide logging
private static final Logger log =
Logger.getLogger(NativeServiceObjectFactoryJAXRPC.class);
@@ -125,7 +123,7 @@
}
catch (IOException ex)
{
- NamingException ne = new NamingException(BundleUtils.getMessage(bundle,
"CANNOT_UNMARSHALL_SERVICE_REF_META_DATA"));
+ NamingException ne = new NamingException();
ne.setRootCause(ex);
throw ne;
}
@@ -176,7 +174,7 @@
EndpointRegistry epRegistry =
spiProvider.getSPI(EndpointRegistryFactory.class).getEndpointRegistry();
Endpoint endpoint = epRegistry.resolve( new PortComponentResolver(pcLink)
);
if (endpoint == null)
- throw new WSException(BundleUtils.getMessage(bundle,
"CANNOT_RESOLVE_PORT_COMPONENT_LINK", pcLink));
+ throw MESSAGES.cannotResolvePortComponentLink(pcLink);
ServerEndpointMetaData sepMetaData =
endpoint.getAttachment(ServerEndpointMetaData.class);
endpointAddress = sepMetaData.getEndpointAddress();
@@ -207,7 +205,7 @@
}
else
{
- log.warn(BundleUtils.getMessage(bundle,
"CANNOT_SET_ENDPOINT_ADDRESS"));
+ NativeLoggers.JAXRPC_LOGGER.cannotSetEndpointAddressForPCL();
}
}
@@ -221,7 +219,7 @@
ClassLoader contextCL = SecurityActions.getContextClassLoader();
Class<?> siClass = SecurityActions.loadClass(contextCL,
serviceRef.getServiceInterface());
if (Service.class.isAssignableFrom(siClass) == false)
- throw new JAXRPCException(BundleUtils.getMessage(bundle,
"NOT_IMPLEMENT_SERVICE", siClass.getName()));
+ throw MESSAGES.interfaceDoesNotImplementJAXRPCService(siClass.getName());
// load all service endpoint interface classes
for (UnifiedPortComponentRefMetaData pcr : serviceRef.getPortComponentRefs())
@@ -231,7 +229,7 @@
{
Class<?> seiClass = contextCL.loadClass(seiName);
if (Remote.class.isAssignableFrom(seiClass) == false)
- throw new IllegalArgumentException(BundleUtils.getMessage(bundle,
"NOT_IMPLEMENT_REMOTE", seiClass.getName()));
+ throw new
IllegalArgumentException(MESSAGES.notImplementRemote(seiClass.getName()));
}
}
@@ -243,7 +241,7 @@
}
catch (Exception ex)
{
- log.error(BundleUtils.getMessage(bundle, "CANNOT_CREATE_SERVICE"),
ex);
+ NativeLoggers.JAXRPC_LOGGER.cannotCreateService(ex);
throw ex;
}
}
@@ -263,7 +261,7 @@
// Constraint#1: within a service-ref it's not allowed to use a SEI
across different pcref's
if (pcrefs.get(seiName) != null)
- throw new WSException(BundleUtils.getMessage(bundle,
"NOT_ALLOWED_TO_USE", seiName));
+ throw MESSAGES.notAllowedToUseInServiceRef(seiName);
pcrefs.put(seiName, pcref);
}
@@ -297,7 +295,7 @@
// Constraint: Dont exclude all of them ;)
if (pcRef2EndpointMapping.size() > 0 &&
(pcRef2EndpointMapping.size() == narrowedEndpoints.size()))
- throw new WSException(BundleUtils.getMessage(bundle,
"FAILED_TO_NARROW_ENDPOINTS"));
+ throw MESSAGES.failedToNarrowavailableEpsByPcRef();
for (QName q : narrowedEndpoints)
{
@@ -309,7 +307,7 @@
else
{
// TODO: In case there is more then one EMPD this should cause an
exception
- log.warn(BundleUtils.getMessage(bundle,
"UNABLE_TO_NARROW_PORT_SELECTION", pcref));
+ NativeLoggers.JAXRPC_LOGGER.unableToNarrowPortSelection(pcref);
}
}
}
@@ -341,7 +339,7 @@
}
catch (Exception e)
{
- throw new WSException(BundleUtils.getMessage(bundle,
"CANNOT_UNMARSHALL_JAXRPC_MAPPING_FILE", mappingFile), e);
+ throw MESSAGES.cannotUnmarshallJAXRPCMapping(mappingFile, e);
}
}
return javaWsdlMapping;
Modified:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxrpc/client/serviceref/NativeServiceReferenceableJAXRPC.java
===================================================================
---
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxrpc/client/serviceref/NativeServiceReferenceableJAXRPC.java 2012-10-12
08:30:12 UTC (rev 16863)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxrpc/client/serviceref/NativeServiceReferenceableJAXRPC.java 2012-10-12
11:16:22 UTC (rev 16864)
@@ -24,7 +24,6 @@
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.ObjectOutputStream;
-import java.util.ResourceBundle;
import javax.naming.BinaryRefAddr;
import javax.naming.NamingException;
@@ -32,7 +31,7 @@
import javax.naming.Referenceable;
import javax.naming.StringRefAddr;
-import org.jboss.ws.api.util.BundleUtils;
+import org.jboss.ws.NativeMessages;
import org.jboss.wsf.spi.SPIProvider;
import org.jboss.wsf.spi.SPIProviderResolver;
import org.jboss.wsf.spi.management.ServerConfig;
@@ -51,7 +50,6 @@
*/
public final class NativeServiceReferenceableJAXRPC implements Referenceable
{
- private static final ResourceBundle bundle =
BundleUtils.getBundle(NativeServiceReferenceableJAXRPC.class);
public static final String SERVICE_REF_META_DATA = "SERVICE_REF_META_DATA";
public static final String PORT_COMPONENT_LINK = "PORT_COMPONENT_LINK";
public static final String PORT_COMPONENT_LINK_SERVLET =
"PORT_COMPONENT_LINK_SERVLET";
@@ -99,7 +97,7 @@
}
catch (Exception ex)
{
- throw new NamingException(BundleUtils.getMessage(bundle,
"CANNOT_OBTAIN_PATH", ex));
+ throw NativeMessages.MESSAGES.cannotObtainPathToPCLServlet(ex);
}
}
}
@@ -120,7 +118,7 @@
}
catch (IOException e)
{
- throw new NamingException(BundleUtils.getMessage(bundle,
"CANNOT_MARSHALL_SERVICE_REF_META_DATA", e.toString()));
+ throw new NamingException(e.toString());
}
return baos.toByteArray();
}