Author: jim.ma
Date: 2011-06-22 04:06:38 -0400 (Wed, 22 Jun 2011)
New Revision: 14600
Added:
common/trunk/src/main/java/org/jboss/ws/common/Message.properties
common/trunk/src/main/java/org/jboss/ws/common/deployment/Message.properties
common/trunk/src/main/java/org/jboss/ws/common/injection/Message.properties
common/trunk/src/main/java/org/jboss/ws/common/injection/finders/Message.properties
common/trunk/src/main/java/org/jboss/ws/common/injection/resolvers/Message.properties
common/trunk/src/main/java/org/jboss/ws/common/integration/Message.properties
common/trunk/src/main/java/org/jboss/ws/common/invocation/Message.properties
common/trunk/src/main/java/org/jboss/ws/common/logging/Message.properties
common/trunk/src/main/java/org/jboss/ws/common/management/Message.properties
common/trunk/src/main/java/org/jboss/ws/common/monitoring/Message.properties
common/trunk/src/main/java/org/jboss/ws/common/reflection/Message.properties
common/trunk/src/main/java/org/jboss/ws/common/serviceref/Message.properties
common/trunk/src/main/java/org/jboss/ws/common/servlet/Message.properties
common/trunk/src/main/java/org/jboss/ws/common/sort/Message.properties
common/trunk/src/main/java/org/jboss/ws/common/spi/Message.properties
common/trunk/src/main/java/org/jboss/ws/common/utils/Message.properties
Modified:
common/trunk/pom.xml
common/trunk/src/main/java/org/jboss/ws/common/DOMUtils.java
common/trunk/src/main/java/org/jboss/ws/common/DOMWriter.java
common/trunk/src/main/java/org/jboss/ws/common/IOUtils.java
common/trunk/src/main/java/org/jboss/ws/common/JavaUtils.java
common/trunk/src/main/java/org/jboss/ws/common/ResourceLoaderAdapter.java
common/trunk/src/main/java/org/jboss/ws/common/URLLoaderAdapter.java
common/trunk/src/main/java/org/jboss/ws/common/deployment/AbstractDefaultEndpoint.java
common/trunk/src/main/java/org/jboss/ws/common/deployment/BackwardCompatibleContextRootDeploymentAspect.java
common/trunk/src/main/java/org/jboss/ws/common/deployment/ContextRootDeploymentAspect.java
common/trunk/src/main/java/org/jboss/ws/common/deployment/DefaultLifecycleHandler.java
common/trunk/src/main/java/org/jboss/ws/common/deployment/DeploymentAspectManagerImpl.java
common/trunk/src/main/java/org/jboss/ws/common/deployment/EndpointAPIDeploymentAspect.java
common/trunk/src/main/java/org/jboss/ws/common/deployment/EndpointAddressDeploymentAspect.java
common/trunk/src/main/java/org/jboss/ws/common/deployment/EndpointLifecycleDeploymentAspect.java
common/trunk/src/main/java/org/jboss/ws/common/deployment/EndpointNameDeploymentAspect.java
common/trunk/src/main/java/org/jboss/ws/common/deployment/EndpointRecordProcessorDeploymentAspect.java
common/trunk/src/main/java/org/jboss/ws/common/deployment/JAXBIntroDeploymentAspect.java
common/trunk/src/main/java/org/jboss/ws/common/deployment/ResourceResolverImpl.java
common/trunk/src/main/java/org/jboss/ws/common/deployment/SOAPAddressWSDLParser.java
common/trunk/src/main/java/org/jboss/ws/common/deployment/URLPatternDeploymentAspect.java
common/trunk/src/main/java/org/jboss/ws/common/deployment/VirtualHostDeploymentAspect.java
common/trunk/src/main/java/org/jboss/ws/common/injection/InjectionException.java
common/trunk/src/main/java/org/jboss/ws/common/injection/InjectionHelper.java
common/trunk/src/main/java/org/jboss/ws/common/injection/finders/InjectionFieldFinder.java
common/trunk/src/main/java/org/jboss/ws/common/injection/finders/InjectionMethodFinder.java
common/trunk/src/main/java/org/jboss/ws/common/injection/finders/ReflectionUtils.java
common/trunk/src/main/java/org/jboss/ws/common/injection/resolvers/AbstractReferenceResolver.java
common/trunk/src/main/java/org/jboss/ws/common/integration/WSHelper.java
common/trunk/src/main/java/org/jboss/ws/common/invocation/AbstractInvocationHandlerJSE.java
common/trunk/src/main/java/org/jboss/ws/common/invocation/RecordingServerHandler.java
common/trunk/src/main/java/org/jboss/ws/common/logging/JDKLogHandler.java
common/trunk/src/main/java/org/jboss/ws/common/management/AbstractServerConfig.java
common/trunk/src/main/java/org/jboss/ws/common/management/DefaultEndpointRegistry.java
common/trunk/src/main/java/org/jboss/ws/common/management/DefaultEndpointRegistryFactory.java
common/trunk/src/main/java/org/jboss/ws/common/management/ManagedEndpoint.java
common/trunk/src/main/java/org/jboss/ws/common/management/ManagedEndpointRegistry.java
common/trunk/src/main/java/org/jboss/ws/common/monitoring/LogRecorder.java
common/trunk/src/main/java/org/jboss/ws/common/reflection/AbstractAnnotatedClassProcessor.java
common/trunk/src/main/java/org/jboss/ws/common/serviceref/AbstractServiceObjectFactoryJAXWS.java
common/trunk/src/main/java/org/jboss/ws/common/serviceref/DefaultServiceRefHandler.java
common/trunk/src/main/java/org/jboss/ws/common/serviceref/ServiceRefSerializer.java
common/trunk/src/main/java/org/jboss/ws/common/servlet/AbstractEndpointServlet.java
common/trunk/src/main/java/org/jboss/ws/common/sort/DeploymentAspectSorter.java
common/trunk/src/main/java/org/jboss/ws/common/spi/DefaultSPIProvider.java
common/trunk/src/main/java/org/jboss/ws/common/utils/AbstractWSDLFilePublisher.java
common/trunk/src/main/java/org/jboss/ws/common/utils/JBossWSEntityResolver.java
common/trunk/src/main/java/org/jboss/ws/common/utils/JarUrlConnection.java
common/trunk/src/main/java/org/jboss/ws/common/utils/UUIDGenerator.java
common/trunk/src/main/java/org/jboss/ws/common/utils/XMLPredefinedEntityReferenceResolver.java
Log:
[JBWS-3316]:i18n common's log and message
Modified: common/trunk/pom.xml
===================================================================
--- common/trunk/pom.xml 2011-06-22 06:46:21 UTC (rev 14599)
+++ common/trunk/pom.xml 2011-06-22 08:06:38 UTC (rev 14600)
@@ -115,6 +115,14 @@
<!-- Plugins -->
<build>
+ <resources>
+ <resource>
+ <directory>src/main/java</directory>
+ <includes>
+ <include>**/*.properties</include>
+ </includes>
+ </resource>
+ </resources>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
Modified: common/trunk/src/main/java/org/jboss/ws/common/DOMUtils.java
===================================================================
--- common/trunk/src/main/java/org/jboss/ws/common/DOMUtils.java 2011-06-22 06:46:21 UTC
(rev 14599)
+++ common/trunk/src/main/java/org/jboss/ws/common/DOMUtils.java 2011-06-22 08:06:38 UTC
(rev 14600)
@@ -28,6 +28,7 @@
import java.io.PrintWriter;
import java.io.Reader;
import java.io.UnsupportedEncodingException;
+import java.util.ResourceBundle;
import javax.xml.XMLConstants;
import javax.xml.namespace.QName;
@@ -45,6 +46,7 @@
import javax.xml.transform.stream.StreamSource;
import org.jboss.logging.Logger;
+import org.jboss.ws.api.util.BundleUtils;
import org.jboss.ws.common.utils.JBossWSEntityResolver;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
@@ -64,6 +66,7 @@
*/
public final class DOMUtils extends org.jboss.ws.api.util.DOMUtils
{
+ private static final ResourceBundle bundle = BundleUtils.getBundle(DOMUtils.class);
private static Logger log = Logger.getLogger(DOMUtils.class);
private static final String DISABLE_DEFERRED_NODE_EXPANSION =
"org.jboss.ws.disable_deferred_node_expansion";
@@ -130,7 +133,7 @@
}
catch (Exception e)
{
- throw new RuntimeException("Unable to create document builder",
e);
+ throw new RuntimeException(BundleUtils.getMessage(bundle,
"UNABLE_TO_CREATE_DOCUMENT_BUILDER"), e);
}
}
@@ -200,7 +203,7 @@
}
catch (IOException e)
{
- log.error("Cannot parse: " + xmlString);
+ log.error(BundleUtils.getMessage(bundle, "CANNOT_PARSE",
xmlString));
throw e;
}
}
@@ -418,7 +421,7 @@
}
else
{
- throw new RuntimeException("Source type not implemented: " +
source.getClass().getName());
+ throw new RuntimeException(BundleUtils.getMessage(bundle,
"SOURCE_TYPE_NOT_IMPLEMENTED", source.getClass()));
}
return retElement;
Modified: common/trunk/src/main/java/org/jboss/ws/common/DOMWriter.java
===================================================================
--- common/trunk/src/main/java/org/jboss/ws/common/DOMWriter.java 2011-06-22 06:46:21 UTC
(rev 14599)
+++ common/trunk/src/main/java/org/jboss/ws/common/DOMWriter.java 2011-06-22 08:06:38 UTC
(rev 14600)
@@ -64,9 +64,9 @@
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
+import java.util.ResourceBundle;
-import org.jboss.ws.common.DOMWriter;
-import org.jboss.ws.common.Normalizer;
+import org.jboss.ws.api.util.BundleUtils;
import org.w3c.dom.Attr;
import org.w3c.dom.Element;
import org.w3c.dom.NamedNodeMap;
@@ -82,6 +82,7 @@
@SuppressWarnings("unchecked")
public class DOMWriter
{
+ private static final ResourceBundle bundle = BundleUtils.getBundle(DOMWriter.class);
// Print writer
private PrintWriter out;
// True, if canonical output
@@ -139,7 +140,7 @@
}
catch (UnsupportedEncodingException e)
{
- throw new IllegalArgumentException("Unsupported encoding: " +
charsetName);
+ throw new IllegalArgumentException(BundleUtils.getMessage(bundle,
"UNSUPPORTED_ENCODING", charsetName));
}
}
@@ -229,7 +230,7 @@
public void print(Node node)
{
if (prettyprint && ignoreWhitespace)
- throw new IllegalStateException("Cannot pretty print and ignore
whitespace");
+ throw new IllegalStateException(BundleUtils.getMessage(bundle,
"CANNOT_PRETTY_PRINT_AND_IGNORE_WHITESPACE"));
rootNode = node;
printInternal(node, false);
Modified: common/trunk/src/main/java/org/jboss/ws/common/IOUtils.java
===================================================================
--- common/trunk/src/main/java/org/jboss/ws/common/IOUtils.java 2011-06-22 06:46:21 UTC
(rev 14599)
+++ common/trunk/src/main/java/org/jboss/ws/common/IOUtils.java 2011-06-22 08:06:38 UTC
(rev 14600)
@@ -31,14 +31,16 @@
import java.io.OutputStreamWriter;
import java.io.Reader;
import java.io.Writer;
+import java.util.ResourceBundle;
import javax.activation.DataHandler;
import javax.xml.ws.WebServiceException;
+import org.jboss.ws.api.util.BundleUtils;
+import org.jboss.wsf.spi.SPIProvider;
+import org.jboss.wsf.spi.SPIProviderResolver;
import org.jboss.wsf.spi.management.ServerConfig;
import org.jboss.wsf.spi.management.ServerConfigFactory;
-import org.jboss.wsf.spi.SPIProvider;
-import org.jboss.wsf.spi.SPIProviderResolver;
/**
* IO utilites
@@ -47,6 +49,7 @@
*/
public final class IOUtils
{
+ private static final ResourceBundle bundle = BundleUtils.getBundle(IOUtils.class);
// Hide the constructor
private IOUtils()
{
@@ -114,7 +117,7 @@
}
catch (IOException e)
{
- throw new WebServiceException("Unable to convert DataHandler to byte[]:
" + e.getMessage());
+ throw new WebServiceException(BundleUtils.getMessage(bundle,
"UNABLE_TO_CONVERT_DATAHANDLER", e.getMessage()));
}
}
Modified: common/trunk/src/main/java/org/jboss/ws/common/JavaUtils.java
===================================================================
--- common/trunk/src/main/java/org/jboss/ws/common/JavaUtils.java 2011-06-22 06:46:21 UTC
(rev 14599)
+++ common/trunk/src/main/java/org/jboss/ws/common/JavaUtils.java 2011-06-22 08:06:38 UTC
(rev 14600)
@@ -21,12 +21,19 @@
*/
package org.jboss.ws.common;
-import java.lang.reflect.*;
+import java.lang.reflect.Array;
+import java.lang.reflect.GenericArrayType;
+import java.lang.reflect.Method;
+import java.lang.reflect.ParameterizedType;
+import java.lang.reflect.Type;
+import java.lang.reflect.TypeVariable;
+import java.lang.reflect.WildcardType;
import java.util.HashMap;
import java.util.HashSet;
+import java.util.ResourceBundle;
import org.jboss.logging.Logger;
-import org.jboss.ws.common.JavaUtils;
+import org.jboss.ws.api.util.BundleUtils;
/** Java utilities
*
@@ -35,6 +42,7 @@
*/
public class JavaUtils
{
+ private static final ResourceBundle bundle = BundleUtils.getBundle(JavaUtils.class);
// provide logging
private static final Logger log = Logger.getLogger(JavaUtils.class);
@@ -211,7 +219,7 @@
componentType = loader.loadClass(name);
break;
default:
- throw new IllegalArgumentException("Invalid binary component for array:
" + javaType.charAt(componentStart));
+ throw new IllegalArgumentException(BundleUtils.getMessage(bundle,
"INVALID_BINARY_COMPONENT_FOR_ARRAY", javaType.charAt(componentStart)));
}
// componentStart doubles as the number of '['s which is the number of
dimensions
@@ -431,9 +439,9 @@
public static boolean isAssignableFrom(Class<?> dest, Class<?> src)
{
if (dest == null)
- throw new IllegalArgumentException("Destination class cannot be
null");
+ throw new IllegalArgumentException(BundleUtils.getMessage(bundle,
"DESTINATION_CLASS_CANNOT_BE_NULL"));
if (src == null)
- throw new IllegalArgumentException("Source class cannot be null");
+ throw new IllegalArgumentException(BundleUtils.getMessage(bundle,
"SOURCE_CLASS_CANNOT_BE_NULL"));
boolean isAssignable = dest.isAssignableFrom(src);
if (isAssignable == false && dest.getName().equals(src.getName()))
Added: common/trunk/src/main/java/org/jboss/ws/common/Message.properties
===================================================================
--- common/trunk/src/main/java/org/jboss/ws/common/Message.properties
(rev 0)
+++ common/trunk/src/main/java/org/jboss/ws/common/Message.properties 2011-06-22 08:06:38
UTC (rev 14600)
@@ -0,0 +1,15 @@
+INVALID_BINARY_COMPONENT_FOR_ARRAY=Invalid binary component for array: {0}
+DESTINATION_CLASS_CANNOT_BE_NULL=Destination class cannot be null
+SOURCE_CLASS_CANNOT_BE_NULL=Source class cannot be null
+UNABLE_TO_CREATE_DOCUMENT_BUILDER=Unable to create document builder
+CANNOT_PARSE=Cannot parse: {0}
+SOURCE_TYPE_NOT_IMPLEMENTED=Source type not implemented: {0}
+UNSUPPORTED_ENCODING=Unsupported encoding: {0}
+CANNOT_PRETTY_PRINT_AND_IGNORE_WHITESPACE=Cannot pretty print and ignore whitespace
+UNABLE_TO_CONVERT_DATAHANDLER=Unable to convert DataHandler to byte[]: {0}
+CANNOT_GET_URL_FOR=Cannot get URL for: {0}
+UNIFIEDVIRTUALFILE_NOT_INITIALIZED=UnifiedVirtualFile not initialized
+CANNOT_GET_CHILDREN_FOR_RESOURCE=Cannot get children for resource: {0}
+UNIFIEDVIRTUALFILE_NOT_INITIALIZED=UnifiedVirtualFile not initialized
+CANNOT_GET_NAME_FOR_RESOURCE=Cannot get name for resource: {0}
+CANNOT_GET_URL_FOR=Cannot get URL for: {0}
\ No newline at end of file
Modified: common/trunk/src/main/java/org/jboss/ws/common/ResourceLoaderAdapter.java
===================================================================
--- common/trunk/src/main/java/org/jboss/ws/common/ResourceLoaderAdapter.java 2011-06-22
06:46:21 UTC (rev 14599)
+++ common/trunk/src/main/java/org/jboss/ws/common/ResourceLoaderAdapter.java 2011-06-22
08:06:38 UTC (rev 14600)
@@ -30,10 +30,12 @@
import java.util.Enumeration;
import java.util.LinkedList;
import java.util.List;
+import java.util.ResourceBundle;
import java.util.jar.JarEntry;
import java.util.jar.JarFile;
import org.jboss.logging.Logger;
+import org.jboss.ws.api.util.BundleUtils;
import org.jboss.wsf.spi.deployment.UnifiedVirtualFile;
/**
@@ -46,6 +48,7 @@
*/
public class ResourceLoaderAdapter implements UnifiedVirtualFile
{
+ private static final ResourceBundle bundle =
BundleUtils.getBundle(ResourceLoaderAdapter.class);
private URL resourceURL;
private ClassLoader loader;
private static Logger log = Logger.getLogger(ResourceLoaderAdapter.class);
@@ -112,7 +115,7 @@
}
if (resourceURL == null)
- throw new IOException("Cannot get URL for: " + resourcePath);
+ throw new IOException(BundleUtils.getMessage(bundle,
"CANNOT_GET_URL_FOR", resourcePath));
return new ResourceLoaderAdapter(loader, resourceURL);
}
@@ -120,14 +123,14 @@
public URL toURL()
{
if (null == this.resourceURL)
- throw new IllegalStateException("UnifiedVirtualFile not
initialized");
+ throw new IllegalStateException(BundleUtils.getMessage(bundle,
"UNIFIEDVIRTUALFILE_NOT_INITIALIZED"));
return resourceURL;
}
public List<UnifiedVirtualFile> getChildren() throws IOException
{
if (null == this.resourceURL)
- throw new IllegalStateException("UnifiedVirtualFile not
initialized");
+ throw new IllegalStateException(BundleUtils.getMessage(bundle,
"UNIFIEDVIRTUALFILE_NOT_INITIALIZED"));
List<UnifiedVirtualFile> list = new LinkedList<UnifiedVirtualFile>();
if (resourceURL.getProtocol().equals("jar"))
{
@@ -188,7 +191,7 @@
}
catch (Exception e)
{
- log.error("Cannot get children for resource: " + resourceURL, e);
+ log.error(BundleUtils.getMessage(bundle,
"CANNOT_GET_CHILDREN_FOR_RESOURCE", resourceURL), e);
}
}
else //std file/dir
@@ -210,7 +213,7 @@
}
catch (Exception e)
{
- log.error("Cannot get children for resource: " + resourceURL, e);
+ log.error(BundleUtils.getMessage(bundle,
"CANNOT_GET_CHILDREN_FOR_RESOURCE", resourceURL), e);
}
}
return list;
@@ -219,7 +222,7 @@
public String getName()
{
if (null == this.resourceURL)
- throw new IllegalStateException("UnifiedVirtualFile not
initialized");
+ throw new IllegalStateException(BundleUtils.getMessage(bundle,
"UNIFIEDVIRTUALFILE_NOT_INITIALIZED"));
String name = null;
try
{
@@ -231,7 +234,7 @@
}
catch (Exception e)
{
- log.error("Cannot get name for resource: " + resourceURL);
+ log.error(BundleUtils.getMessage(bundle,
"CANNOT_GET_NAME_FOR_RESOURCE", resourceURL));
}
return name;
}
Modified: common/trunk/src/main/java/org/jboss/ws/common/URLLoaderAdapter.java
===================================================================
--- common/trunk/src/main/java/org/jboss/ws/common/URLLoaderAdapter.java 2011-06-22
06:46:21 UTC (rev 14599)
+++ common/trunk/src/main/java/org/jboss/ws/common/URLLoaderAdapter.java 2011-06-22
08:06:38 UTC (rev 14600)
@@ -31,10 +31,12 @@
import java.util.Enumeration;
import java.util.LinkedList;
import java.util.List;
+import java.util.ResourceBundle;
import java.util.jar.JarEntry;
import java.util.jar.JarFile;
import org.jboss.logging.Logger;
+import org.jboss.ws.api.util.BundleUtils;
import org.jboss.wsf.spi.deployment.UnifiedVirtualFile;
/**
@@ -48,6 +50,7 @@
*/
public class URLLoaderAdapter implements UnifiedVirtualFile
{
+ private static final ResourceBundle bundle =
BundleUtils.getBundle(URLLoaderAdapter.class);
private static final long serialVersionUID = 8263115387770740414L;
private URL rootURL;
@@ -113,7 +116,7 @@
}
if (resourceURL == null)
- throw new IOException("Cannot get URL for: " + resourcePath);
+ throw new IOException(BundleUtils.getMessage(bundle,
"CANNOT_GET_URL_FOR", resourcePath));
return new URLLoaderAdapter(rootURL, loader, resourceURL);
}
@@ -201,7 +204,7 @@
catch (Exception e)
{
e.printStackTrace();
- log.error("Cannot get children for resource: " + url);
+ log.error(BundleUtils.getMessage(bundle,
"CANNOT_GET_CHILDREN_FOR_RESOURCE", url));
}
}
else //std file/dir
@@ -223,7 +226,7 @@
}
catch (Exception e)
{
- log.error("Cannot get children for resource: " + url, e);
+ log.error(BundleUtils.getMessage(bundle,
"CANNOT_GET_CHILDREN_FOR_RESOURCE", url), e);
}
}
return list;
@@ -242,7 +245,7 @@
}
catch (Exception e)
{
- log.error("Cannot get name for resource: " + toURL(), e);
+ log.error(BundleUtils.getMessage(bundle,
"CANNOT_GET_NAME_FOR_RESOURCE", toURL()), e);
}
return name;
}
Modified:
common/trunk/src/main/java/org/jboss/ws/common/deployment/AbstractDefaultEndpoint.java
===================================================================
---
common/trunk/src/main/java/org/jboss/ws/common/deployment/AbstractDefaultEndpoint.java 2011-06-22
06:46:21 UTC (rev 14599)
+++
common/trunk/src/main/java/org/jboss/ws/common/deployment/AbstractDefaultEndpoint.java 2011-06-22
08:06:38 UTC (rev 14600)
@@ -23,25 +23,27 @@
import java.util.Iterator;
import java.util.List;
+import java.util.ResourceBundle;
import java.util.Vector;
import javax.management.MalformedObjectNameException;
import javax.management.ObjectName;
+import org.jboss.ws.api.monitoring.Record;
+import org.jboss.ws.api.monitoring.RecordFilter;
+import org.jboss.ws.api.monitoring.RecordProcessor;
+import org.jboss.ws.api.util.BundleUtils;
+import org.jboss.ws.common.injection.PreDestroyHolder;
import org.jboss.wsf.spi.deployment.AbstractExtensible;
import org.jboss.wsf.spi.deployment.Endpoint;
+import org.jboss.wsf.spi.deployment.Endpoint.EndpointState;
import org.jboss.wsf.spi.deployment.LifecycleHandler;
import org.jboss.wsf.spi.deployment.Service;
import org.jboss.wsf.spi.deployment.WSFDeploymentException;
-import org.jboss.wsf.spi.deployment.Endpoint.EndpointState;
import org.jboss.wsf.spi.invocation.InvocationHandler;
import org.jboss.wsf.spi.invocation.RequestHandler;
import org.jboss.wsf.spi.management.EndpointMetrics;
import org.jboss.wsf.spi.security.SecurityDomainContext;
-import org.jboss.ws.api.monitoring.Record;
-import org.jboss.ws.api.monitoring.RecordFilter;
-import org.jboss.ws.api.monitoring.RecordProcessor;
-import org.jboss.ws.common.injection.PreDestroyHolder;
/**
* A general abstract JAXWS endpoint.
@@ -51,6 +53,7 @@
*/
public class AbstractDefaultEndpoint extends AbstractExtensible
{
+ private static final ResourceBundle bundle =
BundleUtils.getBundle(AbstractDefaultEndpoint.class);
protected Service service;
protected ObjectName name;
protected String shortName;
@@ -97,7 +100,7 @@
public synchronized Class<?> getTargetBeanClass()
{
if (targetBean == null)
- throw new IllegalStateException("Target bean not set");
+ throw new IllegalStateException(BundleUtils.getMessage(bundle,
"TARGET_BEAN_NOT_SET"));
if (targetBeanClass != null)
return targetBeanClass;
@@ -238,7 +241,7 @@
protected void assertEndpointSetterAccess()
{
if (state == EndpointState.STARTED)
- throw new IllegalStateException("Cannot modify endpoint properties in
state: " + state);
+ throw new IllegalStateException(BundleUtils.getMessage(bundle,
"CANNOT_MODIFY_ENDPOINT_PROPERTIES_IN_STATE", state));
}
public List<RecordProcessor> getRecordProcessors()
Modified:
common/trunk/src/main/java/org/jboss/ws/common/deployment/BackwardCompatibleContextRootDeploymentAspect.java
===================================================================
---
common/trunk/src/main/java/org/jboss/ws/common/deployment/BackwardCompatibleContextRootDeploymentAspect.java 2011-06-22
06:46:21 UTC (rev 14599)
+++
common/trunk/src/main/java/org/jboss/ws/common/deployment/BackwardCompatibleContextRootDeploymentAspect.java 2011-06-22
08:06:38 UTC (rev 14600)
@@ -21,12 +21,14 @@
*/
package org.jboss.ws.common.deployment;
+import java.util.ResourceBundle;
import java.util.StringTokenizer;
+import org.jboss.ws.api.util.BundleUtils;
import org.jboss.wsf.spi.deployment.Deployment;
import org.jboss.wsf.spi.deployment.Endpoint;
+import org.jboss.wsf.spi.metadata.j2ee.EJBArchiveMetaData;
import org.jboss.wsf.spi.metadata.j2ee.EJBMetaData;
-import org.jboss.wsf.spi.metadata.j2ee.EJBArchiveMetaData;
/**
* A deployer that assigns the context root to the service.
@@ -39,6 +41,7 @@
*/
public class BackwardCompatibleContextRootDeploymentAspect extends
ContextRootDeploymentAspect
{
+ private static final ResourceBundle bundle =
BundleUtils.getBundle(BackwardCompatibleContextRootDeploymentAspect.class);
@Override
protected String getExplicitContextRoot(Deployment dep)
{
@@ -55,7 +58,7 @@
{
String firstToken = st.nextToken();
if (contextRoot != null && contextRoot.equals(firstToken) ==
false)
- throw new IllegalStateException("All endpoints must share the
same <context-root>: " + contextRoot + "!=" + firstToken);
+ throw new IllegalStateException(BundleUtils.getMessage(bundle,
"MUST_SHARE_THE_SAME_CONTEXT_ROOT", new Object[]{ contextRoot ,firstToken}));
contextRoot = firstToken;
}
Modified:
common/trunk/src/main/java/org/jboss/ws/common/deployment/ContextRootDeploymentAspect.java
===================================================================
---
common/trunk/src/main/java/org/jboss/ws/common/deployment/ContextRootDeploymentAspect.java 2011-06-22
06:46:21 UTC (rev 14599)
+++
common/trunk/src/main/java/org/jboss/ws/common/deployment/ContextRootDeploymentAspect.java 2011-06-22
08:06:38 UTC (rev 14600)
@@ -21,9 +21,12 @@
*/
package org.jboss.ws.common.deployment;
+import java.util.ResourceBundle;
+
import org.jboss.ws.api.annotation.AuthMethod;
import org.jboss.ws.api.annotation.TransportGuarantee;
import org.jboss.ws.api.annotation.WebContext;
+import org.jboss.ws.api.util.BundleUtils;
import org.jboss.ws.common.Constants;
import org.jboss.ws.common.integration.AbstractDeploymentAspect;
import org.jboss.wsf.spi.deployment.ArchiveDeployment;
@@ -40,6 +43,7 @@
*/
public class ContextRootDeploymentAspect extends AbstractDeploymentAspect
{
+ private static final ResourceBundle bundle =
BundleUtils.getBundle(ContextRootDeploymentAspect.class);
@Override
public void start(Deployment dep)
{
@@ -78,7 +82,7 @@
if (anWebContext != null && anWebContext.contextRoot().length() >
0)
{
if (contextRoot != null &&
contextRoot.equals(anWebContext.contextRoot()) == false)
- throw new IllegalStateException("Context root must be the same for
all deployed endpoints");
+ throw new IllegalStateException(BundleUtils.getMessage(bundle,
"MUST_SHARE_THE_SAME_CONTEXT_ROOT"));
contextRoot = anWebContext.contextRoot();
}
Modified:
common/trunk/src/main/java/org/jboss/ws/common/deployment/DefaultLifecycleHandler.java
===================================================================
---
common/trunk/src/main/java/org/jboss/ws/common/deployment/DefaultLifecycleHandler.java 2011-06-22
06:46:21 UTC (rev 14599)
+++
common/trunk/src/main/java/org/jboss/ws/common/deployment/DefaultLifecycleHandler.java 2011-06-22
08:06:38 UTC (rev 14600)
@@ -21,10 +21,13 @@
*/
package org.jboss.ws.common.deployment;
+import java.util.ResourceBundle;
+
import org.jboss.logging.Logger;
+import org.jboss.ws.api.util.BundleUtils;
+import org.jboss.wsf.spi.deployment.Endpoint;
import org.jboss.wsf.spi.deployment.Endpoint.EndpointState;
import org.jboss.wsf.spi.deployment.LifecycleHandler;
-import org.jboss.wsf.spi.deployment.Endpoint;
import org.jboss.wsf.spi.invocation.InvocationHandler;
/**
@@ -35,6 +38,7 @@
*/
public class DefaultLifecycleHandler implements LifecycleHandler
{
+ private static final ResourceBundle bundle =
BundleUtils.getBundle(DefaultLifecycleHandler.class);
// provide logging
protected final Logger log = Logger.getLogger(getClass());
@@ -46,7 +50,7 @@
EndpointState state = ep.getState();
if (state != EndpointState.UNDEFINED)
{
- log.error("Cannot start endpoint in state: " + state);
+ log.error(BundleUtils.getMessage(bundle,
"CANNOT_START_ENDPOINT_IN_STATE", state));
}
else
{
@@ -55,7 +59,7 @@
InvocationHandler invHandler = ep.getInvocationHandler();
if (invHandler == null)
- throw new IllegalStateException("Invocation handler not
available");
+ throw new IllegalStateException(BundleUtils.getMessage(bundle,
"INVOCATION_HANDLER_NOT_AVAILABLE"));
invHandler.init(ep);
ep.setState(EndpointState.STARTED);
@@ -70,7 +74,7 @@
EndpointState state = ep.getState();
if (state != EndpointState.STARTED)
{
- log.error("Cannot stop endpoint in state: " + state);
+ log.error(BundleUtils.getMessage(bundle,
"CANNOT_STOP_ENDPOINT_IN_STATE", state));
}
else
{
Modified:
common/trunk/src/main/java/org/jboss/ws/common/deployment/DeploymentAspectManagerImpl.java
===================================================================
---
common/trunk/src/main/java/org/jboss/ws/common/deployment/DeploymentAspectManagerImpl.java 2011-06-22
06:46:21 UTC (rev 14599)
+++
common/trunk/src/main/java/org/jboss/ws/common/deployment/DeploymentAspectManagerImpl.java 2011-06-22
08:06:38 UTC (rev 14600)
@@ -29,10 +29,10 @@
import org.jboss.logging.Logger;
import org.jboss.wsf.spi.deployment.Deployment;
+import org.jboss.wsf.spi.deployment.Deployment.DeploymentState;
import org.jboss.wsf.spi.deployment.DeploymentAspect;
import org.jboss.wsf.spi.deployment.DeploymentAspectManager;
import org.jboss.wsf.spi.deployment.WSFDeploymentException;
-import org.jboss.wsf.spi.deployment.Deployment.DeploymentState;
/**
* A general service deployment manger.
Modified:
common/trunk/src/main/java/org/jboss/ws/common/deployment/EndpointAPIDeploymentAspect.java
===================================================================
---
common/trunk/src/main/java/org/jboss/ws/common/deployment/EndpointAPIDeploymentAspect.java 2011-06-22
06:46:21 UTC (rev 14599)
+++
common/trunk/src/main/java/org/jboss/ws/common/deployment/EndpointAPIDeploymentAspect.java 2011-06-22
08:06:38 UTC (rev 14600)
@@ -21,14 +21,17 @@
*/
package org.jboss.ws.common.deployment;
+import java.util.ResourceBundle;
+
+import org.jboss.ws.api.util.BundleUtils;
import org.jboss.ws.common.ResourceLoaderAdapter;
import org.jboss.ws.common.integration.AbstractDeploymentAspect;
import org.jboss.wsf.spi.deployment.ArchiveDeployment;
import org.jboss.wsf.spi.deployment.Deployment;
+import org.jboss.wsf.spi.deployment.Deployment.DeploymentType;
import org.jboss.wsf.spi.deployment.Endpoint;
import org.jboss.wsf.spi.deployment.HttpEndpoint;
import org.jboss.wsf.spi.deployment.UnifiedVirtualFile;
-import org.jboss.wsf.spi.deployment.Deployment.DeploymentType;
/**
* A deployment aspect for JAXWS Endpoint API endpoints.
@@ -39,6 +42,7 @@
// TODO: [JBWS-2674] review this deployment aspect once AS IL is rewritten
public class EndpointAPIDeploymentAspect extends AbstractDeploymentAspect
{
+ private static final ResourceBundle bundle =
BundleUtils.getBundle(EndpointAPIDeploymentAspect.class);
@Override
public void start(Deployment dep)
{
@@ -59,7 +63,7 @@
if (rtcl == null)
{
// TODO: What's this? Look's quiet hacky...
- log.warn("Using inital class laoder as runtime laoder. Hack?", new
IllegalArgumentException());
+ log.warn(BundleUtils.getMessage(bundle,
"USING_INITAL_CLASS_LAODER_AS_RUNTIME_LAODER"), new
IllegalArgumentException());
dep.setRuntimeClassLoader(dep.getInitialClassLoader());
}
Modified:
common/trunk/src/main/java/org/jboss/ws/common/deployment/EndpointAddressDeploymentAspect.java
===================================================================
---
common/trunk/src/main/java/org/jboss/ws/common/deployment/EndpointAddressDeploymentAspect.java 2011-06-22
06:46:21 UTC (rev 14599)
+++
common/trunk/src/main/java/org/jboss/ws/common/deployment/EndpointAddressDeploymentAspect.java 2011-06-22
08:06:38 UTC (rev 14600)
@@ -25,15 +25,17 @@
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
+import java.util.ResourceBundle;
import org.jboss.ws.api.annotation.WebContext;
+import org.jboss.ws.api.util.BundleUtils;
import org.jboss.ws.common.integration.AbstractDeploymentAspect;
import org.jboss.wsf.spi.SPIProvider;
import org.jboss.wsf.spi.SPIProviderResolver;
import org.jboss.wsf.spi.deployment.Deployment;
+import org.jboss.wsf.spi.deployment.Deployment.DeploymentType;
import org.jboss.wsf.spi.deployment.Endpoint;
import org.jboss.wsf.spi.deployment.HttpEndpoint;
-import org.jboss.wsf.spi.deployment.Deployment.DeploymentType;
import org.jboss.wsf.spi.management.ServerConfig;
import org.jboss.wsf.spi.management.ServerConfigFactory;
import org.jboss.wsf.spi.metadata.j2ee.EJBArchiveMetaData;
@@ -51,12 +53,13 @@
*/
public class EndpointAddressDeploymentAspect extends AbstractDeploymentAspect
{
+ private static final ResourceBundle bundle =
BundleUtils.getBundle(EndpointAddressDeploymentAspect.class);
@Override
public void start(Deployment dep)
{
String contextRoot = dep.getService().getContextRoot();
if (contextRoot == null)
- throw new IllegalStateException("Cannot obtain context root");
+ throw new IllegalStateException(BundleUtils.getMessage(bundle,
"CANNOT_OBTAIN_CONTEXT_ROOT"));
// TODO: remove this hack - review API
String protocol = (String)dep.getService().getProperty("protocol");
@@ -87,7 +90,7 @@
HttpEndpoint httpEp = (HttpEndpoint)ep;
String urlPattern = httpEp.getURLPattern();
if (urlPattern == null)
- throw new IllegalStateException("Cannot obtain url pattern");
+ throw new IllegalStateException(BundleUtils.getMessage(bundle,
"CANNOT_OBTAIN_URL_PATTERN"));
if (urlPattern.endsWith("/*"))
urlPattern = urlPattern.substring(0, urlPattern.length() - 2);
@@ -128,7 +131,7 @@
String urlPattern = servletMappings.get(servletLink);
if (urlPattern == null)
- throw new RuntimeException("Cannot find <url-pattern> for
servlet-name: " + servletLink);
+ throw new RuntimeException(BundleUtils.getMessage(bundle,
"CANNOT_FIND_URL_PATTERN", servletLink));
List<JSESecurityMetaData> securityList =
webMetaData.getSecurityMetaData();
for (JSESecurityMetaData currentSecurity : securityList)
Modified:
common/trunk/src/main/java/org/jboss/ws/common/deployment/EndpointLifecycleDeploymentAspect.java
===================================================================
---
common/trunk/src/main/java/org/jboss/ws/common/deployment/EndpointLifecycleDeploymentAspect.java 2011-06-22
06:46:21 UTC (rev 14599)
+++
common/trunk/src/main/java/org/jboss/ws/common/deployment/EndpointLifecycleDeploymentAspect.java 2011-06-22
08:06:38 UTC (rev 14600)
@@ -21,6 +21,9 @@
*/
package org.jboss.ws.common.deployment;
+import java.util.ResourceBundle;
+
+import org.jboss.ws.api.util.BundleUtils;
import org.jboss.ws.common.integration.AbstractDeploymentAspect;
import org.jboss.wsf.spi.deployment.Deployment;
import org.jboss.wsf.spi.deployment.Endpoint;
@@ -35,6 +38,7 @@
*/
public class EndpointLifecycleDeploymentAspect extends AbstractDeploymentAspect
{
+ private static final ResourceBundle bundle =
BundleUtils.getBundle(EndpointLifecycleDeploymentAspect.class);
@Override
public void start(Deployment dep)
@@ -64,7 +68,7 @@
{
LifecycleHandler lifecycleHandler = ep.getLifecycleHandler();
if (lifecycleHandler == null && assertHandler)
- throw new IllegalStateException("LifecycleHandler not initialised");
+ throw new IllegalStateException(BundleUtils.getMessage(bundle,
"LIFECYCLEHANDLER_NOT_INITIALISED"));
return lifecycleHandler;
}
Modified:
common/trunk/src/main/java/org/jboss/ws/common/deployment/EndpointNameDeploymentAspect.java
===================================================================
---
common/trunk/src/main/java/org/jboss/ws/common/deployment/EndpointNameDeploymentAspect.java 2011-06-22
06:46:21 UTC (rev 14599)
+++
common/trunk/src/main/java/org/jboss/ws/common/deployment/EndpointNameDeploymentAspect.java 2011-06-22
08:06:38 UTC (rev 14600)
@@ -21,6 +21,9 @@
*/
package org.jboss.ws.common.deployment;
+import java.util.ResourceBundle;
+
+import org.jboss.ws.api.util.BundleUtils;
import org.jboss.ws.common.ObjectNameFactory;
import org.jboss.ws.common.integration.AbstractDeploymentAspect;
import org.jboss.wsf.spi.deployment.Deployment;
@@ -37,12 +40,13 @@
*/
public class EndpointNameDeploymentAspect extends AbstractDeploymentAspect
{
+ private static final ResourceBundle bundle =
BundleUtils.getBundle(EndpointNameDeploymentAspect.class);
@Override
public void start(Deployment dep)
{
String contextRoot = dep.getService().getContextRoot();
if (contextRoot == null || contextRoot.startsWith("/") == false)
- throw new IllegalStateException("Context root expected to start with
leading slash: " + contextRoot);
+ throw new IllegalStateException(BundleUtils.getMessage(bundle,
"CONTEXT_ROOT_EXPECTED_TO_START_WITH_LEADING_SLASH", contextRoot));
for (Endpoint ep : dep.getService().getEndpoints())
{
Modified:
common/trunk/src/main/java/org/jboss/ws/common/deployment/EndpointRecordProcessorDeploymentAspect.java
===================================================================
---
common/trunk/src/main/java/org/jboss/ws/common/deployment/EndpointRecordProcessorDeploymentAspect.java 2011-06-22
06:46:21 UTC (rev 14599)
+++
common/trunk/src/main/java/org/jboss/ws/common/deployment/EndpointRecordProcessorDeploymentAspect.java 2011-06-22
08:06:38 UTC (rev 14600)
@@ -23,16 +23,18 @@
import java.util.LinkedList;
import java.util.List;
+import java.util.ResourceBundle;
import javax.management.JMException;
import javax.management.MBeanServer;
-import org.jboss.wsf.spi.deployment.Deployment;
-import org.jboss.wsf.spi.deployment.Endpoint;
import org.jboss.ws.api.monitoring.RecordProcessor;
+import org.jboss.ws.api.util.BundleUtils;
import org.jboss.ws.common.ObjectNameFactory;
import org.jboss.ws.common.integration.AbstractDeploymentAspect;
import org.jboss.ws.common.monitoring.ManagedRecordProcessor;
+import org.jboss.wsf.spi.deployment.Deployment;
+import org.jboss.wsf.spi.deployment.Endpoint;
/**
* A deployer that sets the record processors for each endpoint
@@ -42,6 +44,7 @@
*/
public class EndpointRecordProcessorDeploymentAspect extends AbstractDeploymentAspect
{
+ private static final ResourceBundle bundle =
BundleUtils.getBundle(EndpointRecordProcessorDeploymentAspect.class);
private MBeanServer mbeanServer;
private List<RecordProcessor> processors;
@@ -104,7 +107,7 @@
}
catch (JMException innerEx)
{
- log.error("Cannot register endpoint with JMX server", innerEx);
+ log.error(BundleUtils.getMessage(bundle,
"CANNOT_REGISTER_ENDPOINT_WITH_JMX_SERVER"), innerEx);
}
}
}
@@ -117,7 +120,7 @@
}
catch (JMException ex)
{
- log.error("Cannot unregister record processor with JMX server", ex);
+ log.error(BundleUtils.getMessage(bundle,
"CANNOT_UNREGISTER_RECORD_PROCESSOR_WITH_JMX_SERVER"), ex);
}
}
Modified:
common/trunk/src/main/java/org/jboss/ws/common/deployment/JAXBIntroDeploymentAspect.java
===================================================================
---
common/trunk/src/main/java/org/jboss/ws/common/deployment/JAXBIntroDeploymentAspect.java 2011-06-22
06:46:21 UTC (rev 14599)
+++
common/trunk/src/main/java/org/jboss/ws/common/deployment/JAXBIntroDeploymentAspect.java 2011-06-22
08:06:38 UTC (rev 14600)
@@ -23,11 +23,13 @@
import java.io.IOException;
import java.io.InputStream;
+import java.util.ResourceBundle;
import org.jboss.jaxb.intros.BindingCustomizationFactory;
import org.jboss.logging.Logger;
import org.jboss.ws.api.binding.BindingCustomization;
import org.jboss.ws.api.binding.JAXBBindingCustomization;
+import org.jboss.ws.api.util.BundleUtils;
import org.jboss.ws.common.integration.AbstractDeploymentAspect;
import org.jboss.wsf.spi.deployment.ArchiveDeployment;
import org.jboss.wsf.spi.deployment.Deployment;
@@ -42,6 +44,7 @@
*/
public class JAXBIntroDeploymentAspect extends AbstractDeploymentAspect
{
+ private static final ResourceBundle bundle =
BundleUtils.getBundle(JAXBIntroDeploymentAspect.class);
private static Logger logger = Logger.getLogger(JAXBIntroDeploymentAspect.class);
private static final String META_INF_JAXB_INTROS_XML =
"META-INF/jaxb-intros.xml";
private static final String WEB_INF_JAXB_INTROS_XML =
"WEB-INF/jaxb-intros.xml";
@@ -104,7 +107,7 @@
try {
introsConfigStream.close();
} catch (IOException e) {
- logger.error("[" + deployment.getService().getContextRoot() +
"] Error closing JAXB Introductions Configurations stream ", e);
+ logger.error(BundleUtils.getMessage(bundle,
"ERROR_CLOSING_JAXB_INTRODUCTIONS", deployment.getService().getContextRoot() ),
e);
}
}
}
Added: common/trunk/src/main/java/org/jboss/ws/common/deployment/Message.properties
===================================================================
--- common/trunk/src/main/java/org/jboss/ws/common/deployment/Message.properties
(rev 0)
+++
common/trunk/src/main/java/org/jboss/ws/common/deployment/Message.properties 2011-06-22
08:06:38 UTC (rev 14600)
@@ -0,0 +1,23 @@
+REQUIRED_CONDITIONS_''_NOT_SATISFIED_BY_''_FOR=Required conditions
'{0}' not satisfied by '{1}' for: {2}
+CONTEXT_ROOT_EXPECTED_TO_START_WITH_LEADING_SLASH=Context root expected to start with
leading slash: {0}
+TARGET_BEAN_NOT_SET=Target bean not set
+CANNOT_MODIFY_ENDPOINT_PROPERTIES_IN_STATE=Cannot modify endpoint properties in state:
{0}
+CONTEXT_ROOT_MUST_BE_THE_SAME_FOR_ALL_DEPLOYED_ENDPOINTS=Context root must be the same
for all deployed endpoints
+CANNOT_REGISTER_ENDPOINT_WITH_JMX_SERVER=Cannot register endpoint with JMX server
+CANNOT_UNREGISTER_RECORD_PROCESSOR_WITH_JMX_SERVER=Cannot unregister record processor
with JMX server
+MUST_SHARE_THE_SAME_CONTEXT_ROOT=All endpoints must share the same <context-root>:
{0}!={1}
+FAILED_TO_READ=Failed to read {0}:{1}
+UNEXPECTED_ELEMENT=Unexpected element: {0}
+REACHED_END_OF_XML_DOCUMENT_UNEXPECTEDLY=Reached end of xml document unexpectedly
+CANNOT_START_ENDPOINT_IN_STATE=Cannot start endpoint in state: {0}
+INVOCATION_HANDLER_NOT_AVAILABLE=Invocation handler not available
+CANNOT_STOP_ENDPOINT_IN_STATE=Cannot stop endpoint in state: {0}
+COULD_NOT_FIND_IN_THE_ADDITIONAL_METADATAFILES=Could not find {0} in the additional
metadatafiles!
+VIRTUALHOSTS_MUST_BE_THE_SAME_FOR_ALL_DEPLOYED_ENDPOINTS=virtualHosts must be the same
for all deployed endpoints
+CANNOT_OBTAIN_SERVLET_MAPPING_FOR=Cannot obtain servlet mapping for: {0}
+LIFECYCLEHANDLER_NOT_INITIALISED=LifecycleHandler not initialised
+CANNOT_OBTAIN_CONTEXT_ROOT=Cannot obtain context root
+CANNOT_OBTAIN_URL_PATTERN=Cannot obtain url pattern
+CANNOT_FIND_URL_PATTERN=Cannot find <url-pattern> for servlet-name: {0}
+USING_INITAL_CLASS_LAODER_AS_RUNTIME_LAODER=Using inital class laoder as runtime laoder.
Hack?
+ERROR_CLOSING_JAXB_INTRODUCTIONS=[{0}] Error closing JAXB Introductions Configurations
stream
Modified:
common/trunk/src/main/java/org/jboss/ws/common/deployment/ResourceResolverImpl.java
===================================================================
---
common/trunk/src/main/java/org/jboss/ws/common/deployment/ResourceResolverImpl.java 2011-06-22
06:46:21 UTC (rev 14599)
+++
common/trunk/src/main/java/org/jboss/ws/common/deployment/ResourceResolverImpl.java 2011-06-22
08:06:38 UTC (rev 14600)
@@ -26,8 +26,10 @@
import java.net.URL;
import java.util.Collection;
import java.util.Iterator;
+import java.util.ResourceBundle;
import org.jboss.logging.Logger;
+import org.jboss.ws.api.util.BundleUtils;
import org.jboss.wsf.spi.deployment.ResourceResolver;
import org.jboss.wsf.spi.deployment.UnifiedVirtualFile;
@@ -40,6 +42,7 @@
*/
public class ResourceResolverImpl implements ResourceResolver
{
+ private static final ResourceBundle bundle =
BundleUtils.getBundle(ResourceResolverImpl.class);
private static Logger log = Logger.getLogger(ResourceResolverImpl.class);
private UnifiedVirtualFile rootFile;
@@ -118,7 +121,7 @@
}
}
if (vfResource == null)
- throw new IOException("Could not find " + resourcePath + "
in the additional metadatafiles!");
+ throw new IOException(BundleUtils.getMessage(bundle,
"COULD_NOT_FIND_IN_THE_ADDITIONAL_METADATAFILES", resourcePath ));
resourceURL = vfResource.toURL();
}
Modified:
common/trunk/src/main/java/org/jboss/ws/common/deployment/SOAPAddressWSDLParser.java
===================================================================
---
common/trunk/src/main/java/org/jboss/ws/common/deployment/SOAPAddressWSDLParser.java 2011-06-22
06:46:21 UTC (rev 14599)
+++
common/trunk/src/main/java/org/jboss/ws/common/deployment/SOAPAddressWSDLParser.java 2011-06-22
08:06:38 UTC (rev 14600)
@@ -32,6 +32,7 @@
import java.net.URL;
import java.util.HashMap;
import java.util.Map;
+import java.util.ResourceBundle;
import javax.xml.namespace.QName;
import javax.xml.stream.XMLStreamConstants;
@@ -39,6 +40,7 @@
import javax.xml.stream.XMLStreamReader;
import javax.xml.ws.WebServiceException;
+import org.jboss.ws.api.util.BundleUtils;
import org.jboss.wsf.spi.util.StAXUtils;
/**
@@ -48,6 +50,7 @@
*/
public final class SOAPAddressWSDLParser
{
+ private static final ResourceBundle bundle =
BundleUtils.getBundle(SOAPAddressWSDLParser.class);
public static final String SOAP_OVER_JMS_NS =
"http://www.w3.org/2010/soapjms/";
private static final String WSDL_NS = "http://schemas.xmlsoap.org/wsdl/";
private static final String SOAP_NS =
"http://schemas.xmlsoap.org/wsdl/soap/";
@@ -99,7 +102,7 @@
}
catch (Exception e)
{
- throw new WebServiceException("Failed to read " + wsdlUrl +
":" + e.getMessage(), e);
+ throw new WebServiceException(BundleUtils.getMessage(bundle,
"FAILED_TO_READ", new Object[]{ wsdlUrl , e.getMessage()}), e);
}
finally
{
@@ -139,7 +142,7 @@
}
else
{
- throw new IllegalStateException("Unexpected element: " +
reader.getLocalName());
+ throw new IllegalStateException(BundleUtils.getMessage(bundle,
"UNEXPECTED_ELEMENT", reader.getLocalName()));
}
}
}
@@ -176,7 +179,7 @@
}
}
}
- throw new IllegalStateException("Reached end of xml document
unexpectedly");
+ throw new IllegalStateException(BundleUtils.getMessage(bundle,
"REACHED_END_OF_XML_DOCUMENT_UNEXPECTEDLY"));
}
private static WSDLServiceMetaData parseService(XMLStreamReader reader, String
targetNS) throws XMLStreamException
@@ -206,7 +209,7 @@
}
}
}
- throw new IllegalStateException("Reached end of xml document
unexpectedly");
+ throw new IllegalStateException(BundleUtils.getMessage(bundle,
"REACHED_END_OF_XML_DOCUMENT_UNEXPECTEDLY"));
}
private static WSDLPortMetaData parsePort(XMLStreamReader reader) throws
XMLStreamException
@@ -233,7 +236,7 @@
}
}
}
- throw new IllegalStateException("Reached end of xml document
unexpectedly");
+ throw new IllegalStateException(BundleUtils.getMessage(bundle,
"REACHED_END_OF_XML_DOCUMENT_UNEXPECTEDLY"));
}
private static WSDLBindingMetaData parseBinding(XMLStreamReader reader) throws
XMLStreamException
@@ -260,7 +263,7 @@
}
}
}
- throw new IllegalStateException("Reached end of xml document
unexpectedly");
+ throw new IllegalStateException(BundleUtils.getMessage(bundle,
"REACHED_END_OF_XML_DOCUMENT_UNEXPECTEDLY"));
}
private static class WSDLMetaData
Modified:
common/trunk/src/main/java/org/jboss/ws/common/deployment/URLPatternDeploymentAspect.java
===================================================================
---
common/trunk/src/main/java/org/jboss/ws/common/deployment/URLPatternDeploymentAspect.java 2011-06-22
06:46:21 UTC (rev 14599)
+++
common/trunk/src/main/java/org/jboss/ws/common/deployment/URLPatternDeploymentAspect.java 2011-06-22
08:06:38 UTC (rev 14600)
@@ -21,11 +21,13 @@
*/
package org.jboss.ws.common.deployment;
+import java.util.ResourceBundle;
import java.util.StringTokenizer;
import javax.jws.WebService;
import org.jboss.ws.api.annotation.WebContext;
+import org.jboss.ws.api.util.BundleUtils;
import org.jboss.ws.common.Constants;
import org.jboss.ws.common.integration.AbstractDeploymentAspect;
import org.jboss.wsf.spi.deployment.Deployment;
@@ -43,6 +45,7 @@
*/
public class URLPatternDeploymentAspect extends AbstractDeploymentAspect
{
+ private static final ResourceBundle bundle =
BundleUtils.getBundle(URLPatternDeploymentAspect.class);
@Override
public void start(Deployment dep)
@@ -80,7 +83,7 @@
String epName = ep.getShortName();
urlPattern = webMetaData.getServletMappings().get(epName);
if (urlPattern == null)
- throw new IllegalStateException("Cannot obtain servlet mapping for:
" + epName);
+ throw new IllegalStateException(BundleUtils.getMessage(bundle,
"CANNOT_OBTAIN_SERVLET_MAPPING_FOR", epName));
}
// #2 Use the explicit urlPattern from port-component/port-component-uri
Modified:
common/trunk/src/main/java/org/jboss/ws/common/deployment/VirtualHostDeploymentAspect.java
===================================================================
---
common/trunk/src/main/java/org/jboss/ws/common/deployment/VirtualHostDeploymentAspect.java 2011-06-22
06:46:21 UTC (rev 14599)
+++
common/trunk/src/main/java/org/jboss/ws/common/deployment/VirtualHostDeploymentAspect.java 2011-06-22
08:06:38 UTC (rev 14600)
@@ -24,12 +24,14 @@
import java.util.Arrays;
import java.util.List;
+import java.util.ResourceBundle;
import org.jboss.ws.api.annotation.WebContext;
+import org.jboss.ws.api.util.BundleUtils;
import org.jboss.ws.common.integration.AbstractDeploymentAspect;
import org.jboss.wsf.spi.deployment.Deployment;
+import org.jboss.wsf.spi.deployment.Deployment.DeploymentType;
import org.jboss.wsf.spi.deployment.Endpoint;
-import org.jboss.wsf.spi.deployment.Deployment.DeploymentType;
/**
* A deployer that assigns the virtual hosts to the service
@@ -39,6 +41,7 @@
*/
public class VirtualHostDeploymentAspect extends AbstractDeploymentAspect
{
+ private static final ResourceBundle bundle =
BundleUtils.getBundle(VirtualHostDeploymentAspect.class);
@Override
public void start(Deployment dep)
@@ -74,7 +77,7 @@
{
if (Arrays.equals(virtualHosts, temp) == false)
{
- throw new IllegalStateException("virtualHosts must be the same for
all deployed endpoints");
+ throw new IllegalStateException(BundleUtils.getMessage(bundle,
"VIRTUALHOSTS_MUST_BE_THE_SAME_FOR_ALL_DEPLOYED_ENDPOINTS"));
}
}
}
Modified:
common/trunk/src/main/java/org/jboss/ws/common/injection/InjectionException.java
===================================================================
---
common/trunk/src/main/java/org/jboss/ws/common/injection/InjectionException.java 2011-06-22
06:46:21 UTC (rev 14599)
+++
common/trunk/src/main/java/org/jboss/ws/common/injection/InjectionException.java 2011-06-22
08:06:38 UTC (rev 14600)
@@ -21,7 +21,10 @@
*/
package org.jboss.ws.common.injection;
+import java.util.ResourceBundle;
+
import org.jboss.logging.Logger;
+import org.jboss.ws.api.util.BundleUtils;
/**
* Represents generic injection error.
@@ -30,6 +33,7 @@
*/
public class InjectionException extends RuntimeException
{
+ private static final ResourceBundle bundle =
BundleUtils.getBundle(InjectionException.class);
/**
* Serial version UID.
@@ -99,7 +103,7 @@
{
if (reason == null)
{
- throw new IllegalArgumentException("Reason expected");
+ throw new IllegalArgumentException(BundleUtils.getMessage(bundle,
"REASON_EXPECTED"));
}
LOG.error(message == null ? reason.getMessage() : message, reason);
Modified: common/trunk/src/main/java/org/jboss/ws/common/injection/InjectionHelper.java
===================================================================
---
common/trunk/src/main/java/org/jboss/ws/common/injection/InjectionHelper.java 2011-06-22
06:46:21 UTC (rev 14599)
+++
common/trunk/src/main/java/org/jboss/ws/common/injection/InjectionHelper.java 2011-06-22
08:06:38 UTC (rev 14600)
@@ -24,6 +24,7 @@
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.util.Collection;
+import java.util.ResourceBundle;
import javax.annotation.Resource;
import javax.ejb.EJB;
@@ -33,6 +34,7 @@
import javax.xml.ws.WebServiceContext;
import org.jboss.logging.Logger;
+import org.jboss.ws.api.util.BundleUtils;
import org.jboss.ws.common.injection.finders.EJBFieldFinder;
import org.jboss.ws.common.injection.finders.EJBMethodFinder;
import org.jboss.ws.common.injection.finders.InjectionFieldFinder;
@@ -52,6 +54,7 @@
*/
public final class InjectionHelper
{
+ private static final ResourceBundle bundle =
BundleUtils.getBundle(InjectionHelper.class);
private static final Logger LOG = Logger.getLogger(InjectionHelper.class);
@@ -95,7 +98,7 @@
public static void injectResources(final Object instance, final InjectionsMetaData
injections, final Context ctx)
{
if (instance == null)
- throw new IllegalArgumentException("Object instance cannot be null");
+ throw new IllegalArgumentException(BundleUtils.getMessage(bundle,
"OBJECT_INSTANCE_CANNOT_BE_NULL"));
if (injections == null)
return;
@@ -164,7 +167,7 @@
public static void callPostConstructMethod(final Object instance)
{
if (instance == null)
- throw new IllegalArgumentException("Object instance cannot be null");
+ throw new IllegalArgumentException(BundleUtils.getMessage(bundle,
"OBJECT_INSTANCE_CANNOT_BE_NULL"));
final Collection<Method> methods =
POST_CONSTRUCT_METHOD_FINDER.process(instance.getClass());
@@ -195,7 +198,7 @@
public static void callPreDestroyMethod(final Object instance)
{
if (instance == null)
- throw new IllegalArgumentException("Object instance cannot be null");
+ throw new IllegalArgumentException(BundleUtils.getMessage(bundle,
"OBJECT_INSTANCE_CANNOT_BE_NULL"));
final Collection<Method> methods =
PRE_DESTROY_METHOD_FINDER.process(instance.getClass());
Added: common/trunk/src/main/java/org/jboss/ws/common/injection/Message.properties
===================================================================
--- common/trunk/src/main/java/org/jboss/ws/common/injection/Message.properties
(rev 0)
+++ common/trunk/src/main/java/org/jboss/ws/common/injection/Message.properties 2011-06-22
08:06:38 UTC (rev 14600)
@@ -0,0 +1,2 @@
+REASON_EXPECTED=Reason expected
+OBJECT_INSTANCE_CANNOT_BE_NULL=Object instance cannot be null
Modified:
common/trunk/src/main/java/org/jboss/ws/common/injection/finders/InjectionFieldFinder.java
===================================================================
---
common/trunk/src/main/java/org/jboss/ws/common/injection/finders/InjectionFieldFinder.java 2011-06-22
06:46:21 UTC (rev 14599)
+++
common/trunk/src/main/java/org/jboss/ws/common/injection/finders/InjectionFieldFinder.java 2011-06-22
08:06:38 UTC (rev 14600)
@@ -23,7 +23,9 @@
import java.lang.reflect.Field;
import java.util.Collection;
+import java.util.ResourceBundle;
+import org.jboss.ws.api.util.BundleUtils;
import org.jboss.ws.common.injection.InjectionException;
import org.jboss.ws.common.reflection.FieldFinder;
import org.jboss.wsf.spi.metadata.injection.InjectionMetaData;
@@ -36,6 +38,7 @@
public final class InjectionFieldFinder
extends FieldFinder
{
+ private static final ResourceBundle bundle =
BundleUtils.getBundle(InjectionFieldFinder.class);
/**
* Descriptor injection metadata.
@@ -50,7 +53,7 @@
public InjectionFieldFinder(final InjectionMetaData injectionMD)
{
if (injectionMD == null)
- throw new IllegalArgumentException("Injection metadata cannot be
null");
+ throw new IllegalArgumentException(BundleUtils.getMessage(bundle,
"INJECTION_METADATA_CANNOT_BE_NULL"));
this.injectionMD = injectionMD;
}
@@ -83,7 +86,7 @@
if (fields.size() > 2)
{
- throw new InjectionException("More than one field found matching the
criteria: " + injectionMD);
+ throw new InjectionException(BundleUtils.getMessage(bundle,
"MORE_THAN_ONE_FIELD_FOUND_MATCHING_THE_CRITERIA", injectionMD));
}
}
Modified:
common/trunk/src/main/java/org/jboss/ws/common/injection/finders/InjectionMethodFinder.java
===================================================================
---
common/trunk/src/main/java/org/jboss/ws/common/injection/finders/InjectionMethodFinder.java 2011-06-22
06:46:21 UTC (rev 14599)
+++
common/trunk/src/main/java/org/jboss/ws/common/injection/finders/InjectionMethodFinder.java 2011-06-22
08:06:38 UTC (rev 14600)
@@ -23,7 +23,9 @@
import java.lang.reflect.Method;
import java.util.Collection;
+import java.util.ResourceBundle;
+import org.jboss.ws.api.util.BundleUtils;
import org.jboss.ws.common.injection.InjectionException;
import org.jboss.ws.common.reflection.MethodFinder;
import org.jboss.wsf.spi.metadata.injection.InjectionMetaData;
@@ -36,6 +38,7 @@
public final class InjectionMethodFinder
extends MethodFinder
{
+ private static final ResourceBundle bundle =
BundleUtils.getBundle(InjectionMethodFinder.class);
/**
* Descriptor injection metadata.
@@ -50,7 +53,7 @@
public InjectionMethodFinder(final InjectionMetaData injectionMD)
{
if (injectionMD == null)
- throw new IllegalArgumentException("Injection metadata cannot be
null");
+ throw new IllegalArgumentException(BundleUtils.getMessage(bundle,
"INJECTION_METADATA_CANNOT_BE_NULL"));
this.injectionMD = injectionMD;
}
@@ -89,7 +92,7 @@
if (methods.size() > 2)
{
- throw new InjectionException("More than one method found matching the
criteria: " + injectionMD);
+ throw new InjectionException(BundleUtils.getMessage(bundle,
"MORE_THAN_ONE_METHOD_FOUND_MATCHING_THE_CRITERIA", injectionMD));
}
}
Added:
common/trunk/src/main/java/org/jboss/ws/common/injection/finders/Message.properties
===================================================================
--- common/trunk/src/main/java/org/jboss/ws/common/injection/finders/Message.properties
(rev 0)
+++
common/trunk/src/main/java/org/jboss/ws/common/injection/finders/Message.properties 2011-06-22
08:06:38 UTC (rev 14600)
@@ -0,0 +1,15 @@
+METHOD_CANNOT_DECLARE_PRIMITIVE_PARAMETERS=Method {0} can't declare primitive
parameters: {1}
+FIELD_CANNOT_BE_OF_PRIMITIVE_TYPE=Field {0} can't be of primitive type: {1}
+METHOD_HAVE_TO_HAVE_NO_PARAMETERS=Method {0} have to have no parameters: {1}
+METHOD_HAVE_TO_RETURN_VOID=Method {0} have to return void: {1}
+FIELD_CANNOT_BE_OF_VOID_TYPE=Field {0} cannot be of void type: {1}
+METHOD_CANNOT_THROW_CHECKED_EXCEPTIONS=Method {0} cannot throw checked exceptions: {1}
+METHOD_CANNOT_BE_STATIC=Method {0} cannot be static: {1}
+FIELD_CANNOT_BE_STATIC=Field {0} cannot be static: {1}
+FIELD_CANNOT_BE_FINAL=Field {0} cannot be final: {1}
+METHOD_HAVE_TO_DECLARE_EXACTLY_ONE_PARAMETER=Method {0} have to declare exactly one
parameter: {1}
+METHOD_DOESN'T_FOLLOW_JAVA_BEANS_SETTER_METHOD_NAME=Method {0} doesn't follow
Java Beans setter method name: {1}
+ONLY_ONE_METHOD_CAN_EXIST=Only one method {0} can exist
+INJECTION_METADATA_CANNOT_BE_NULL=Injection metadata cannot be null
+MORE_THAN_ONE_FIELD_FOUND_MATCHING_THE_CRITERIA=More than one field found matching the
criteria: {0}
+MORE_THAN_ONE_METHOD_FOUND_MATCHING_THE_CRITERIA=More than one method found matching the
criteria: {0}
Modified:
common/trunk/src/main/java/org/jboss/ws/common/injection/finders/ReflectionUtils.java
===================================================================
---
common/trunk/src/main/java/org/jboss/ws/common/injection/finders/ReflectionUtils.java 2011-06-22
06:46:21 UTC (rev 14599)
+++
common/trunk/src/main/java/org/jboss/ws/common/injection/finders/ReflectionUtils.java 2011-06-22
08:06:38 UTC (rev 14600)
@@ -26,7 +26,9 @@
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
import java.util.Collection;
+import java.util.ResourceBundle;
+import org.jboss.ws.api.util.BundleUtils;
import org.jboss.ws.common.injection.InjectionException;
/**
@@ -36,6 +38,7 @@
*/
final class ReflectionUtils
{
+ private static final ResourceBundle bundle =
BundleUtils.getBundle(ReflectionUtils.class);
/**
* Constructor.
@@ -57,7 +60,7 @@
{
if (type.isPrimitive())
{
- throw new InjectionException("Method " +
getAnnotationMessage(annotation) + "can't declare primitive parameters: " +
method);
+ throw new InjectionException(BundleUtils.getMessage(bundle,
"METHOD_CANNOT_DECLARE_PRIMITIVE_PARAMETERS", new Object[]{
getAnnotationMessage(annotation) , method}));
}
}
}
@@ -82,7 +85,7 @@
{
if (field.getType().isPrimitive())
{
- throw new InjectionException("Field " +
getAnnotationMessage(annotation) + "can't be of primitive type: " + field);
+ throw new InjectionException(BundleUtils.getMessage(bundle,
"FIELD_CANNOT_BE_OF_PRIMITIVE_TYPE", new Object[]{
getAnnotationMessage(annotation) , field}));
}
}
@@ -106,7 +109,7 @@
{
if (method.getParameterTypes().length != 0)
{
- throw new InjectionException("Method " +
getAnnotationMessage(annotation) + "have to have no parameters: " + method);
+ throw new InjectionException(BundleUtils.getMessage(bundle,
"METHOD_HAVE_TO_HAVE_NO_PARAMETERS", new Object[]{
getAnnotationMessage(annotation) , method}));
}
}
@@ -130,7 +133,7 @@
{
if ((!method.getReturnType().equals(Void.class)) &&
(!method.getReturnType().equals(Void.TYPE)))
{
- throw new InjectionException("Method " +
getAnnotationMessage(annotation) + "have to return void: " + method);
+ throw new InjectionException(BundleUtils.getMessage(bundle,
"METHOD_HAVE_TO_RETURN_VOID", new Object[]{ getAnnotationMessage(annotation) ,
method}));
}
}
@@ -154,7 +157,7 @@
{
if ((field.getClass().equals(Void.class)) &&
(field.getClass().equals(Void.TYPE)))
{
- throw new InjectionException("Field " +
getAnnotationMessage(annotation) + "cannot be of void type: " + field);
+ throw new InjectionException(BundleUtils.getMessage(bundle,
"FIELD_CANNOT_BE_OF_VOID_TYPE", new Object[]{ getAnnotationMessage(annotation) ,
field}));
}
}
@@ -182,7 +185,7 @@
Class<?> exception = declaredExceptions[i];
if (!exception.isAssignableFrom(RuntimeException.class))
{
- throw new InjectionException("Method " +
getAnnotationMessage(annotation) + "cannot throw checked exceptions: " +
method);
+ throw new InjectionException(BundleUtils.getMessage(bundle,
"METHOD_CANNOT_THROW_CHECKED_EXCEPTIONS", new Object[]{
getAnnotationMessage(annotation) , method}));
}
}
}
@@ -207,7 +210,7 @@
{
if (Modifier.isStatic(method.getModifiers()))
{
- throw new InjectionException("Method " +
getAnnotationMessage(annotation) + "cannot be static: " + method);
+ throw new InjectionException(BundleUtils.getMessage(bundle,
"METHOD_CANNOT_BE_STATIC", new Object[]{ getAnnotationMessage(annotation) ,
method}));
}
}
@@ -231,7 +234,7 @@
{
if (Modifier.isStatic(field.getModifiers()))
{
- throw new InjectionException("Field " +
getAnnotationMessage(annotation) + "cannot be static: " + field);
+ throw new InjectionException(BundleUtils.getMessage(bundle,
"FIELD_CANNOT_BE_STATIC", new Object[]{ getAnnotationMessage(annotation) ,
field}));
}
}
@@ -255,7 +258,7 @@
{
if (Modifier.isFinal(field.getModifiers()))
{
- throw new InjectionException("Field " +
getAnnotationMessage(annotation) + "cannot be final: " + field);
+ throw new InjectionException(BundleUtils.getMessage(bundle,
"FIELD_CANNOT_BE_FINAL", new Object[]{ getAnnotationMessage(annotation) ,
field}));
}
}
@@ -279,7 +282,7 @@
{
if (method.getParameterTypes().length != 1)
{
- throw new InjectionException("Method " +
getAnnotationMessage(annotation) + "have to declare exactly one parameter: " +
method);
+ throw new InjectionException(BundleUtils.getMessage(bundle,
"METHOD_HAVE_TO_DECLARE_EXACTLY_ONE_PARAMETER", new Object[]{
getAnnotationMessage(annotation) , method}));
}
}
@@ -308,7 +311,7 @@
if (!correctMethodNameLength || !isSetterMethodName || !isUpperCasedPropertyName)
{
- throw new InjectionException("Method " +
getAnnotationMessage(annotation) + "doesn't follow Java Beans setter method name:
" + method);
+ throw new InjectionException(BundleUtils.getMessage(bundle,
"METHOD_DOESN'T_FOLLOW_JAVA_BEANS_SETTER_METHOD_NAME", new Object[]{
getAnnotationMessage(annotation) , method}));
}
}
@@ -332,7 +335,7 @@
{
if (methods.size() > 1)
{
- throw new InjectionException("Only one method " +
getAnnotationMessage(annotation) + "can exist");
+ throw new InjectionException(BundleUtils.getMessage(bundle,
"ONLY_ONE_METHOD_CAN_EXIST", getAnnotationMessage(annotation) ));
}
}
Modified:
common/trunk/src/main/java/org/jboss/ws/common/injection/resolvers/AbstractReferenceResolver.java
===================================================================
---
common/trunk/src/main/java/org/jboss/ws/common/injection/resolvers/AbstractReferenceResolver.java 2011-06-22
06:46:21 UTC (rev 14599)
+++
common/trunk/src/main/java/org/jboss/ws/common/injection/resolvers/AbstractReferenceResolver.java 2011-06-22
08:06:38 UTC (rev 14600)
@@ -25,7 +25,9 @@
import java.lang.reflect.AccessibleObject;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
+import java.util.ResourceBundle;
+import org.jboss.ws.api.util.BundleUtils;
import org.jboss.wsf.spi.metadata.injection.ReferenceResolver;
/**
@@ -40,6 +42,7 @@
public abstract class AbstractReferenceResolver<A extends Annotation>
implements ReferenceResolver
{
+ private static final ResourceBundle bundle =
BundleUtils.getBundle(AbstractReferenceResolver.class);
/**
* Resolved annotation.
@@ -55,7 +58,7 @@
if (annotationClass == null)
{
- throw new IllegalArgumentException("Annotation class cannot be
null");
+ throw new IllegalArgumentException(BundleUtils.getMessage(bundle,
"ANNOTATION_CLASS_CANNOT_BE_NULL"));
}
this.annotationClass = annotationClass;
@@ -68,7 +71,7 @@
{
if (!this.canResolve(accessibleObject))
{
- throw new IllegalArgumentException("Cannot resolve: " +
accessibleObject);
+ throw new IllegalArgumentException(BundleUtils.getMessage(bundle,
"CANNOT_RESOLVE", accessibleObject));
}
if (accessibleObject.getClass().equals(Method.class))
@@ -120,7 +123,7 @@
{
if (accessibleObject == null)
{
- throw new IllegalArgumentException("AccessibleObject cannot be
null");
+ throw new IllegalArgumentException(BundleUtils.getMessage(bundle,
"ACCESSIBLEOBJECT_CANNOT_BE_NULL"));
}
}
Added:
common/trunk/src/main/java/org/jboss/ws/common/injection/resolvers/Message.properties
===================================================================
--- common/trunk/src/main/java/org/jboss/ws/common/injection/resolvers/Message.properties
(rev 0)
+++
common/trunk/src/main/java/org/jboss/ws/common/injection/resolvers/Message.properties 2011-06-22
08:06:38 UTC (rev 14600)
@@ -0,0 +1,3 @@
+ANNOTATION_CLASS_CANNOT_BE_NULL=Annotation class cannot be null
+CANNOT_RESOLVE=Cannot resolve: {0}
+ACCESSIBLEOBJECT_CANNOT_BE_NULL=AccessibleObject cannot be null
Added: common/trunk/src/main/java/org/jboss/ws/common/integration/Message.properties
===================================================================
--- common/trunk/src/main/java/org/jboss/ws/common/integration/Message.properties
(rev 0)
+++
common/trunk/src/main/java/org/jboss/ws/common/integration/Message.properties 2011-06-22
08:06:38 UTC (rev 14600)
@@ -0,0 +1 @@
+CAN_NOT_FIND_ATTACHMENT=Cannot find attachment in webservice deployment :{0}
Modified: common/trunk/src/main/java/org/jboss/ws/common/integration/WSHelper.java
===================================================================
--- common/trunk/src/main/java/org/jboss/ws/common/integration/WSHelper.java 2011-06-22
06:46:21 UTC (rev 14599)
+++ common/trunk/src/main/java/org/jboss/ws/common/integration/WSHelper.java 2011-06-22
08:06:38 UTC (rev 14600)
@@ -21,7 +21,10 @@
*/
package org.jboss.ws.common.integration;
+import java.util.ResourceBundle;
+
import org.jboss.logging.Logger;
+import org.jboss.ws.api.util.BundleUtils;
import org.jboss.wsf.spi.deployment.Deployment;
import org.jboss.wsf.spi.deployment.Deployment.DeploymentType;
@@ -32,6 +35,7 @@
*/
public final class WSHelper
{
+ private static final ResourceBundle bundle = BundleUtils.getBundle(WSHelper.class);
/** Logger. */
private static final Logger LOG = Logger.getLogger( WSHelper.class );
@@ -58,7 +62,7 @@
final A value = dep.getAttachment( key );
if ( value == null )
{
- WSHelper.LOG.error( "Cannot find attachment in webservice deployment:
" + key );
+ LOG.error(BundleUtils.getMessage(bundle, "CAN_NOT_FIND_ATTACHMENT",
key ));
throw new IllegalStateException();
}
Modified:
common/trunk/src/main/java/org/jboss/ws/common/invocation/AbstractInvocationHandlerJSE.java
===================================================================
---
common/trunk/src/main/java/org/jboss/ws/common/invocation/AbstractInvocationHandlerJSE.java 2011-06-22
06:46:21 UTC (rev 14599)
+++
common/trunk/src/main/java/org/jboss/ws/common/invocation/AbstractInvocationHandlerJSE.java 2011-06-22
08:06:38 UTC (rev 14600)
@@ -22,11 +22,13 @@
package org.jboss.ws.common.invocation;
import java.lang.reflect.Method;
+import java.util.ResourceBundle;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;
+import org.jboss.ws.api.util.BundleUtils;
import org.jboss.wsf.spi.deployment.Endpoint;
import org.jboss.wsf.spi.invocation.Invocation;
@@ -38,6 +40,7 @@
*/
public abstract class AbstractInvocationHandlerJSE extends AbstractInvocationHandler
{
+ private static final ResourceBundle bundle =
BundleUtils.getBundle(AbstractInvocationHandlerJSE.class);
private static final String POJO_JNDI_PREFIX = "java:comp/env/";
@@ -112,7 +115,7 @@
}
catch (Exception e)
{
- this.log.error("Method invocation failed with exception: " +
e.getMessage(), e);
+ this.log.error(BundleUtils.getMessage(bundle,
"METHOD_INVOCATION_FAILED_WITH_EXCEPTION", e.getMessage()), e);
// propagate exception
this.handleInvocationException(e);
}
Added: common/trunk/src/main/java/org/jboss/ws/common/invocation/Message.properties
===================================================================
--- common/trunk/src/main/java/org/jboss/ws/common/invocation/Message.properties
(rev 0)
+++
common/trunk/src/main/java/org/jboss/ws/common/invocation/Message.properties 2011-06-22
08:06:38 UTC (rev 14600)
@@ -0,0 +1,3 @@
+METHOD_INVOCATION_FAILED_WITH_EXCEPTION=Method invocation failed with exception: {0}
+UNABLE_TO_READ_FROM_THE_HTTP_SERVLET_REQUEST=Unable to read from the http servlet
request: {0}
+CANNOT_TRACE_SOAPMESSAGE=Cannot trace SOAPMessage
Modified:
common/trunk/src/main/java/org/jboss/ws/common/invocation/RecordingServerHandler.java
===================================================================
---
common/trunk/src/main/java/org/jboss/ws/common/invocation/RecordingServerHandler.java 2011-06-22
06:46:21 UTC (rev 14599)
+++
common/trunk/src/main/java/org/jboss/ws/common/invocation/RecordingServerHandler.java 2011-06-22
08:06:38 UTC (rev 14600)
@@ -27,6 +27,7 @@
import java.util.Iterator;
import java.util.List;
import java.util.Map;
+import java.util.ResourceBundle;
import javax.servlet.http.HttpServletRequest;
import javax.xml.namespace.QName;
@@ -36,15 +37,16 @@
import javax.xml.ws.handler.soap.SOAPMessageContext;
import org.jboss.logging.Logger;
-import org.jboss.wsf.spi.deployment.Endpoint;
-import org.jboss.wsf.spi.invocation.EndpointAssociation;
+import org.jboss.ws.api.handler.GenericSOAPHandler;
import org.jboss.ws.api.monitoring.Record;
+import org.jboss.ws.api.monitoring.Record.MessageType;
import org.jboss.ws.api.monitoring.RecordGroupAssociation;
import org.jboss.ws.api.monitoring.RecordProcessor;
-import org.jboss.ws.api.monitoring.Record.MessageType;
-import org.jboss.ws.api.handler.GenericSOAPHandler;
+import org.jboss.ws.api.util.BundleUtils;
import org.jboss.ws.common.DOMWriter;
import org.jboss.ws.common.monitoring.RecordFactory;
+import org.jboss.wsf.spi.deployment.Endpoint;
+import org.jboss.wsf.spi.invocation.EndpointAssociation;
/**
* This handler is responsible for collecting the information about the
@@ -57,6 +59,7 @@
*/
public class RecordingServerHandler extends GenericSOAPHandler
{
+ private static final ResourceBundle bundle =
BundleUtils.getBundle(RecordingServerHandler.class);
// provide logging
private static Logger log = Logger.getLogger(RecordingServerHandler.class);
@@ -79,7 +82,7 @@
}
catch (Exception e)
{
- log.warn("Unable to read from the http servlet request! " +
e.getMessage());
+ log.warn(BundleUtils.getMessage(bundle,
"UNABLE_TO_READ_FROM_THE_HTTP_SERVLET_REQUEST", e.getMessage()));
}
}
record.setHeaders((Map<String,List<String>>)(ctx.get(MessageContext.HTTP_REQUEST_HEADERS)));
@@ -103,7 +106,7 @@
}
catch (SOAPException ex)
{
- log.error("Cannot trace SOAPMessage", ex);
+ log.error(BundleUtils.getMessage(bundle,
"CANNOT_TRACE_SOAPMESSAGE"), ex);
}
}
endpoint.processRecord(record);
@@ -141,7 +144,7 @@
}
catch (SOAPException ex)
{
- log.error("Cannot trace SOAPMessage", ex);
+ log.error(BundleUtils.getMessage(bundle,
"CANNOT_TRACE_SOAPMESSAGE"), ex);
}
}
endpoint.processRecord(record);
Modified: common/trunk/src/main/java/org/jboss/ws/common/logging/JDKLogHandler.java
===================================================================
--- common/trunk/src/main/java/org/jboss/ws/common/logging/JDKLogHandler.java 2011-06-22
06:46:21 UTC (rev 14599)
+++ common/trunk/src/main/java/org/jboss/ws/common/logging/JDKLogHandler.java 2011-06-22
08:06:38 UTC (rev 14600)
@@ -40,6 +40,7 @@
*/
public class JDKLogHandler extends Handler
{
+
public JDKLogHandler()
{
super.setFormatter(new SimpleFormatter());
@@ -72,12 +73,12 @@
else if (level == Level.WARNING)
{
String msg = getMessage(record);
- logger.warn(msg, th);
+ logger.warn(msg, th);
}
else if (level == Level.SEVERE)
{
String msg = getMessage(record);
- logger.error(msg, th);
+ logger.error(msg, th);
}
else if (level == Level.OFF)
{
Added: common/trunk/src/main/java/org/jboss/ws/common/logging/Message.properties
===================================================================
--- common/trunk/src/main/java/org/jboss/ws/common/logging/Message.properties
(rev 0)
+++ common/trunk/src/main/java/org/jboss/ws/common/logging/Message.properties 2011-06-22
08:06:38 UTC (rev 14600)
@@ -0,0 +1,2 @@
+=
+=
Modified:
common/trunk/src/main/java/org/jboss/ws/common/management/AbstractServerConfig.java
===================================================================
---
common/trunk/src/main/java/org/jboss/ws/common/management/AbstractServerConfig.java 2011-06-22
06:46:21 UTC (rev 14599)
+++
common/trunk/src/main/java/org/jboss/ws/common/management/AbstractServerConfig.java 2011-06-22
08:06:38 UTC (rev 14600)
@@ -26,6 +26,7 @@
import java.net.UnknownHostException;
import java.util.ArrayList;
import java.util.List;
+import java.util.ResourceBundle;
import java.util.Set;
import javax.management.AttributeNotFoundException;
@@ -34,6 +35,7 @@
import javax.management.ObjectName;
import org.jboss.logging.Logger;
+import org.jboss.ws.api.util.BundleUtils;
import org.jboss.ws.common.ObjectNameFactory;
import org.jboss.wsf.spi.SPIProvider;
import org.jboss.wsf.spi.SPIProviderResolver;
@@ -53,6 +55,7 @@
*/
public abstract class AbstractServerConfig implements AbstractServerConfigMBean,
ServerConfig
{
+ private static final ResourceBundle bundle =
BundleUtils.getBundle(AbstractServerConfig.class);
private static final Logger log = Logger.getLogger(AbstractServerConfig.class);
protected static final ObjectName OBJECT_NAME_SERVER_CONFIG;
@@ -116,7 +119,7 @@
}
catch (UnknownHostException e)
{
- log.warn("Could not get address for host: " + host, e);
+ log.warn(BundleUtils.getMessage(bundle,
"COULD_NOT_GET_ADDRESS_FOR_HOST", host), e);
//ignore, leave isIPv6Address to false
}
final boolean isIPv6Formatted = isIPv6Address &&
host.startsWith("[");
@@ -216,7 +219,7 @@
{
if (port > -1)
{
- log.warn("Found multiple connectors for protocol='" +
protocol + "' and secure='" + secure + "', using first port
found '" + port + "'");
+ log.warn(BundleUtils.getMessage(bundle,
"FOUND_MULTIPLE_CONNECTORS", new Object[]{ protocol, secure, port }));
}
else
{
Modified:
common/trunk/src/main/java/org/jboss/ws/common/management/DefaultEndpointRegistry.java
===================================================================
---
common/trunk/src/main/java/org/jboss/ws/common/management/DefaultEndpointRegistry.java 2011-06-22
06:46:21 UTC (rev 14599)
+++
common/trunk/src/main/java/org/jboss/ws/common/management/DefaultEndpointRegistry.java 2011-06-22
08:06:38 UTC (rev 14600)
@@ -21,16 +21,19 @@
*/
package org.jboss.ws.common.management;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.ResourceBundle;
+import java.util.Set;
+
+import javax.management.ObjectName;
+
import org.jboss.logging.Logger;
+import org.jboss.ws.api.util.BundleUtils;
import org.jboss.wsf.spi.deployment.Endpoint;
import org.jboss.wsf.spi.management.EndpointRegistry;
import org.jboss.wsf.spi.management.EndpointResolver;
-import javax.management.ObjectName;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Set;
-
/**
* A general endpoint registry.
*
@@ -39,6 +42,7 @@
*/
public class DefaultEndpointRegistry implements EndpointRegistry
{
+ private static final ResourceBundle bundle =
BundleUtils.getBundle(DefaultEndpointRegistry.class);
// provide logging
private static final Logger log = Logger.getLogger(DefaultEndpointRegistry.class);
@@ -47,10 +51,10 @@
public Endpoint getEndpoint(ObjectName epName)
{
if (epName == null)
- throw new IllegalArgumentException("Endpoint name cannot be null");
+ throw new IllegalArgumentException(BundleUtils.getMessage(bundle,
"ENDPOINT_NAME_CANNOT_BE_NULL"));
if (isRegistered(epName) == false)
- throw new IllegalStateException("Endpoint not registered: " +
epName);
+ throw new IllegalStateException(BundleUtils.getMessage(bundle,
"ENDPOINT_NOT_REGISTERED", epName));
Endpoint endpoint = endpoints.get(epName);
return endpoint;
@@ -64,7 +68,7 @@
public boolean isRegistered(ObjectName epName)
{
if (epName == null)
- throw new IllegalArgumentException("Endpoint name cannot be null");
+ throw new IllegalArgumentException(BundleUtils.getMessage(bundle,
"ENDPOINT_NAME_CANNOT_BE_NULL"));
return endpoints.get(epName) != null;
}
@@ -77,14 +81,14 @@
public void register(Endpoint endpoint)
{
if (endpoint == null)
- throw new IllegalArgumentException("Endpoint cannot be null");
+ throw new IllegalArgumentException(BundleUtils.getMessage(bundle,
"ENDPOINT_CANNOT_BE_NULL"));
ObjectName epName = endpoint.getName();
if (epName == null)
- throw new IllegalStateException("Endpoint name cannot be null for: " +
endpoint);
+ throw new IllegalStateException(BundleUtils.getMessage(bundle,
"ENDPOINT_NAME_CANNOT_BE_NULL_FOR", endpoint));
if (isRegistered(epName))
- throw new IllegalStateException("Endpoint already registered: " +
epName);
+ throw new IllegalStateException(BundleUtils.getMessage(bundle,
"ENDPOINT_ALREADY_REGISTERED", epName));
log.info("register: " + epName);
endpoints.put(epName, endpoint);
@@ -93,11 +97,11 @@
public void unregister(Endpoint endpoint)
{
if (endpoint == null)
- throw new IllegalArgumentException("Endpoint cannot be null");
+ throw new IllegalArgumentException(BundleUtils.getMessage(bundle,
"ENDPOINT_CANNOT_BE_NULL"));
ObjectName epName = endpoint.getName();
if (isRegistered(epName) == false)
- throw new IllegalStateException("Endpoint not registered: " +
epName);
+ throw new IllegalStateException(BundleUtils.getMessage(bundle,
"ENDPOINT_NOT_REGISTERED", epName));
log.info("remove: " + epName);
endpoints.remove(epName);
Modified:
common/trunk/src/main/java/org/jboss/ws/common/management/DefaultEndpointRegistryFactory.java
===================================================================
---
common/trunk/src/main/java/org/jboss/ws/common/management/DefaultEndpointRegistryFactory.java 2011-06-22
06:46:21 UTC (rev 14599)
+++
common/trunk/src/main/java/org/jboss/ws/common/management/DefaultEndpointRegistryFactory.java 2011-06-22
08:06:38 UTC (rev 14600)
@@ -22,6 +22,8 @@
package org.jboss.ws.common.management;
import org.jboss.logging.Logger;
+import java.util.ResourceBundle;
+import org.jboss.ws.api.util.BundleUtils;
import org.jboss.wsf.spi.SPIProvider;
import org.jboss.wsf.spi.SPIProviderResolver;
import org.jboss.wsf.spi.WSFException;
@@ -39,6 +41,7 @@
*/
public final class DefaultEndpointRegistryFactory extends EndpointRegistryFactory
{
+ private static final ResourceBundle bundle =
BundleUtils.getBundle(DefaultEndpointRegistryFactory.class);
private Logger log = Logger.getLogger(DefaultEndpointRegistryFactory.class);
/** The bean name in the kernel registry. */
@@ -88,7 +91,7 @@
}
catch (Exception e)
{
- log.warn("Unable to get WSEndpointRegistry from IoC, using default
one");
+ log.warn(BundleUtils.getMessage(bundle,
"UNABLE_TO_GET_WSENDPOINTREGISTRY"));
return fallbackRegistry; // JSE environment
}
}
Modified: common/trunk/src/main/java/org/jboss/ws/common/management/ManagedEndpoint.java
===================================================================
---
common/trunk/src/main/java/org/jboss/ws/common/management/ManagedEndpoint.java 2011-06-22
06:46:21 UTC (rev 14599)
+++
common/trunk/src/main/java/org/jboss/ws/common/management/ManagedEndpoint.java 2011-06-22
08:06:38 UTC (rev 14600)
@@ -23,17 +23,19 @@
import java.util.Date;
import java.util.List;
+import java.util.ResourceBundle;
import javax.management.JMException;
import javax.management.MBeanServer;
import org.jboss.logging.Logger;
-import org.jboss.wsf.spi.deployment.Endpoint;
-import org.jboss.wsf.spi.management.EndpointMetrics;
import org.jboss.ws.api.monitoring.Record;
import org.jboss.ws.api.monitoring.RecordProcessor;
+import org.jboss.ws.api.util.BundleUtils;
import org.jboss.ws.common.ObjectNameFactory;
import org.jboss.ws.common.monitoring.ManagedRecordProcessor;
+import org.jboss.wsf.spi.deployment.Endpoint;
+import org.jboss.wsf.spi.management.EndpointMetrics;
/**
* The endpoint MBean representation
@@ -43,6 +45,7 @@
*/
public class ManagedEndpoint implements ManagedEndpointMBean
{
+ private static final ResourceBundle bundle =
BundleUtils.getBundle(ManagedEndpoint.class);
private Endpoint endpoint;
private MBeanServer mbeanServer;
private Logger log = Logger.getLogger(this.getClass());
@@ -143,7 +146,7 @@
}
catch (JMException innerEx)
{
- log.error("Cannot register endpoint with JMX server", innerEx);
+ log.error(BundleUtils.getMessage(bundle,
"CANNOT_REGISTER_ENDPOINT_WITH_JMX_SERVER"), innerEx);
}
}
}
@@ -164,7 +167,7 @@
}
catch (JMException ex)
{
- log.error("Cannot unregister record processor with JMX server",
ex);
+ log.error(BundleUtils.getMessage(bundle,
"CANNOT_UNREGISTER_RECORD_PROCESSOR_WITH_JMX_SERVER"), ex);
}
}
//set and register the new processors
@@ -184,7 +187,7 @@
}
catch (JMException innerEx)
{
- log.error("Cannot register endpoint with JMX server", innerEx);
+ log.error(BundleUtils.getMessage(bundle,
"CANNOT_REGISTER_ENDPOINT_WITH_JMX_SERVER"), innerEx);
}
}
}
Modified:
common/trunk/src/main/java/org/jboss/ws/common/management/ManagedEndpointRegistry.java
===================================================================
---
common/trunk/src/main/java/org/jboss/ws/common/management/ManagedEndpointRegistry.java 2011-06-22
06:46:21 UTC (rev 14599)
+++
common/trunk/src/main/java/org/jboss/ws/common/management/ManagedEndpointRegistry.java 2011-06-22
08:06:38 UTC (rev 14600)
@@ -22,6 +22,8 @@
package org.jboss.ws.common.management;
import javax.management.JMException;
+import java.util.ResourceBundle;
+import org.jboss.ws.api.util.BundleUtils;
import javax.management.MBeanServer;
import org.jboss.logging.Logger;
@@ -35,6 +37,7 @@
*/
public class ManagedEndpointRegistry extends DefaultEndpointRegistry implements
ManagedEndpointRegistryMBean
{
+ private static final ResourceBundle bundle =
BundleUtils.getBundle(ManagedEndpointRegistry.class);
// provide logging
private static final Logger log = Logger.getLogger(ManagedEndpointRegistry.class);
@@ -63,7 +66,7 @@
}
catch (Exception ex)
{
- log.error("Cannot register endpoint with JMX server", ex);
+ log.error(BundleUtils.getMessage(bundle,
"CANNOT_REGISTER_ENDPOINT_WITH_JMX_SERVER"), ex);
}
}
@@ -76,11 +79,11 @@
if (getMbeanServer() != null)
getMbeanServer().unregisterMBean(endpoint.getName());
else
- log.warn("MBeanServer not available, cannot unregister endpoint with JMX
server");
+ log.warn(BundleUtils.getMessage(bundle,
"MBEANSERVER_NOT_AVAILABLE"));
}
catch (JMException ex)
{
- log.error("Cannot unregister endpoint with JMX server", ex);
+ log.error(BundleUtils.getMessage(bundle,
"CANNOT_UNREGISTER_ENDPOINT_WITH_JMX_SERVER"), ex);
}
}
Added: common/trunk/src/main/java/org/jboss/ws/common/management/Message.properties
===================================================================
--- common/trunk/src/main/java/org/jboss/ws/common/management/Message.properties
(rev 0)
+++
common/trunk/src/main/java/org/jboss/ws/common/management/Message.properties 2011-06-22
08:06:38 UTC (rev 14600)
@@ -0,0 +1,14 @@
+CANNOT_REGISTER_ENDPOINT_WITH_JMX_SERVER=Cannot register endpoint with JMX server
+CANNOT_UNREGISTER_RECORD_PROCESSOR_WITH_JMX_SERVER=Cannot unregister record processor
with JMX server
+UNABLE_TO_GET_WSENDPOINTREGISTRY=Unable to get WSEndpointRegistry from IoC, using default
one
+COULD_NOT_GET_ADDRESS_FOR_HOST=Could not get address for host: {0}
+FOUND_MULTIPLE_CONNECTORS=Found multiple connectors for protocol={0} and secure={1},
using first port found {2}
+CANNOT_REGISTER_ENDPOINT_WITH_JMX_SERVER=Cannot register endpoint with JMX server
+MBEANSERVER_NOT_AVAILABLE=MBeanServer not available, cannot unregister endpoint with JMX
server
+CANNOT_UNREGISTER_ENDPOINT_WITH_JMX_SERVER=Cannot unregister endpoint with JMX server
+ENDPOINT_NAME_CANNOT_BE_NULL=Endpoint name cannot be null
+ENDPOINT_NOT_REGISTERED=Endpoint not registered: {0}
+ENDPOINT_CANNOT_BE_NULL=Endpoint cannot be null
+ENDPOINT_NAME_CANNOT_BE_NULL_FOR=Endpoint name cannot be null for: {0}
+ENDPOINT_ALREADY_REGISTERED=Endpoint already registered: {0}
+ENDPOINT_NOT_REGISTERED=Endpoint not registered: {0}
Modified: common/trunk/src/main/java/org/jboss/ws/common/monitoring/LogRecorder.java
===================================================================
--- common/trunk/src/main/java/org/jboss/ws/common/monitoring/LogRecorder.java 2011-06-22
06:46:21 UTC (rev 14599)
+++ common/trunk/src/main/java/org/jboss/ws/common/monitoring/LogRecorder.java 2011-06-22
08:06:38 UTC (rev 14600)
@@ -24,10 +24,12 @@
import java.io.Serializable;
import java.util.List;
import java.util.Map;
+import java.util.ResourceBundle;
import org.jboss.logging.Logger;
import org.jboss.ws.api.monitoring.Record;
import org.jboss.ws.api.monitoring.Record.MessageType;
+import org.jboss.ws.api.util.BundleUtils;
/**
* A simple record processor that writes records to the configured log.
@@ -37,6 +39,7 @@
*/
public class LogRecorder extends AbstractRecordProcessor implements Serializable
{
+ private static final ResourceBundle bundle =
BundleUtils.getBundle(LogRecorder.class);
private static final long serialVersionUID = -7126227194320867819L;
private Logger log = Logger.getLogger(this.getClass());
@@ -72,7 +75,7 @@
}
else
{
- log.warn("Unknown message type: " + record.getMessageType());
+ log.warn(BundleUtils.getMessage(bundle, "UNKNOWN_MESSAGE_TYPE",
record.getMessageType()));
if (this.isProcessSourceHost() && record.getSourceHost() != null)
{
sb.append("from ");
Added: common/trunk/src/main/java/org/jboss/ws/common/monitoring/Message.properties
===================================================================
--- common/trunk/src/main/java/org/jboss/ws/common/monitoring/Message.properties
(rev 0)
+++
common/trunk/src/main/java/org/jboss/ws/common/monitoring/Message.properties 2011-06-22
08:06:38 UTC (rev 14600)
@@ -0,0 +1 @@
+UNKNOWN_MESSAGE_TYPE=Unknown message type: {0}
Modified:
common/trunk/src/main/java/org/jboss/ws/common/reflection/AbstractAnnotatedClassProcessor.java
===================================================================
---
common/trunk/src/main/java/org/jboss/ws/common/reflection/AbstractAnnotatedClassProcessor.java 2011-06-22
06:46:21 UTC (rev 14599)
+++
common/trunk/src/main/java/org/jboss/ws/common/reflection/AbstractAnnotatedClassProcessor.java 2011-06-22
08:06:38 UTC (rev 14600)
@@ -23,7 +23,10 @@
import java.lang.annotation.Annotation;
import java.lang.reflect.AccessibleObject;
+import java.util.ResourceBundle;
+import org.jboss.ws.api.util.BundleUtils;
+
/**
* All annotation aware class processors should extend this class.
*
@@ -33,6 +36,7 @@
extends AbstractClassProcessor<AO>
implements AnnotationAware<A>
{
+ private static final ResourceBundle bundle =
BundleUtils.getBundle(AbstractAnnotatedClassProcessor.class);
/**
* Annotation class.
@@ -47,7 +51,7 @@
public AbstractAnnotatedClassProcessor(final Class<A> annotationClass)
{
if (annotationClass == null)
- throw new IllegalArgumentException("annotation class cannot be
null");
+ throw new IllegalArgumentException(BundleUtils.getMessage(bundle,
"ANNOTATION_CLASS_CANNOT_BE_NULL"));
this.annotationClass = annotationClass;
}
Added: common/trunk/src/main/java/org/jboss/ws/common/reflection/Message.properties
===================================================================
--- common/trunk/src/main/java/org/jboss/ws/common/reflection/Message.properties
(rev 0)
+++
common/trunk/src/main/java/org/jboss/ws/common/reflection/Message.properties 2011-06-22
08:06:38 UTC (rev 14600)
@@ -0,0 +1 @@
+ANNOTATION_CLASS_CANNOT_BE_NULL=annotation class cannot be null
Modified:
common/trunk/src/main/java/org/jboss/ws/common/serviceref/AbstractServiceObjectFactoryJAXWS.java
===================================================================
---
common/trunk/src/main/java/org/jboss/ws/common/serviceref/AbstractServiceObjectFactoryJAXWS.java 2011-06-22
06:46:21 UTC (rev 14599)
+++
common/trunk/src/main/java/org/jboss/ws/common/serviceref/AbstractServiceObjectFactoryJAXWS.java 2011-06-22
08:06:38 UTC (rev 14600)
@@ -29,6 +29,7 @@
import java.util.Hashtable;
import java.util.LinkedList;
import java.util.List;
+import java.util.ResourceBundle;
import javax.naming.Context;
import javax.naming.Name;
@@ -42,6 +43,7 @@
import javax.xml.ws.soap.AddressingFeature;
import javax.xml.ws.soap.MTOMFeature;
+import org.jboss.ws.api.util.BundleUtils;
import org.jboss.wsf.spi.WSFException;
import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedPortComponentRefMetaData;
import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedServiceRefMetaData;
@@ -54,6 +56,7 @@
*/
public abstract class AbstractServiceObjectFactoryJAXWS implements ObjectFactory
{
+ private static final ResourceBundle bundle =
BundleUtils.getBundle(AbstractServiceObjectFactoryJAXWS.class);
/**
* Creates an object using the location or reference information specified.
* <p/>
@@ -232,8 +235,7 @@
}
else
{
- throw new IllegalArgumentException("Cannot create generic
javax.xml.ws.Service without wsdlLocation: "
- + serviceRefMD);
+ throw new IllegalArgumentException(BundleUtils.getMessage(bundle,
"CANNOT_CREATE_SERVICE_WITHOUT_WSDLLOCATION", serviceRefMD));
}
}
else
Modified:
common/trunk/src/main/java/org/jboss/ws/common/serviceref/DefaultServiceRefHandler.java
===================================================================
---
common/trunk/src/main/java/org/jboss/ws/common/serviceref/DefaultServiceRefHandler.java 2011-06-22
06:46:21 UTC (rev 14599)
+++
common/trunk/src/main/java/org/jboss/ws/common/serviceref/DefaultServiceRefHandler.java 2011-06-22
08:06:38 UTC (rev 14600)
@@ -21,8 +21,11 @@
*/
package org.jboss.ws.common.serviceref;
+import java.util.ResourceBundle;
+
import javax.naming.Referenceable;
+import org.jboss.ws.api.util.BundleUtils;
import org.jboss.wsf.spi.SPIProvider;
import org.jboss.wsf.spi.SPIProviderResolver;
import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedServiceRefMetaData;
@@ -37,16 +40,17 @@
*/
public final class DefaultServiceRefHandler implements ServiceRefHandler
{
+ private static final ResourceBundle bundle =
BundleUtils.getBundle(DefaultServiceRefHandler.class);
@Override
public Referenceable createReferenceable(final UnifiedServiceRefMetaData
serviceRefMD)
{
if (serviceRefMD.getVfsRoot() == null)
{
- throw new IllegalStateException("VFSRoot must be provided");
+ throw new IllegalStateException(BundleUtils.getMessage(bundle,
"VFSROOT_MUST_BE_PROVIDED"));
}
if (serviceRefMD.getType() == null)
{
- throw new IllegalStateException("Service reference type must be
provided");
+ throw new IllegalStateException(BundleUtils.getMessage(bundle,
"SERVICE_REFERENCE_TYPE_MUST_BE_PROVIDED"));
}
return this.getBinder(serviceRefMD.getType()).createReferenceable(serviceRefMD);
Added: common/trunk/src/main/java/org/jboss/ws/common/serviceref/Message.properties
===================================================================
--- common/trunk/src/main/java/org/jboss/ws/common/serviceref/Message.properties
(rev 0)
+++
common/trunk/src/main/java/org/jboss/ws/common/serviceref/Message.properties 2011-06-22
08:06:38 UTC (rev 14600)
@@ -0,0 +1,5 @@
+CANNOT_CREATE_SERVICE_WITHOUT_WSDLLOCATION=Cannot create generic javax.xml.ws.Service
without wsdlLocation: {0}
+VFSROOT_MUST_BE_PROVIDED=VFSRoot must be provided
+SERVICE_REFERENCE_TYPE_MUST_BE_PROVIDED=Service reference type must be provided
+CANNOT_MARSHALL_SERVICE_REF_META_DATA=Cannot marshall service ref meta data, cause: {0}
+CANNOT_UNMARSHALL_SERVICE_REF_META_DATA=Cannot unmarshall service ref meta data, cause:
{0}
Modified:
common/trunk/src/main/java/org/jboss/ws/common/serviceref/ServiceRefSerializer.java
===================================================================
---
common/trunk/src/main/java/org/jboss/ws/common/serviceref/ServiceRefSerializer.java 2011-06-22
06:46:21 UTC (rev 14599)
+++
common/trunk/src/main/java/org/jboss/ws/common/serviceref/ServiceRefSerializer.java 2011-06-22
08:06:38 UTC (rev 14600)
@@ -26,9 +26,11 @@
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
+import java.util.ResourceBundle;
import javax.naming.NamingException;
+import org.jboss.ws.api.util.BundleUtils;
import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedServiceRefMetaData;
/**
@@ -38,6 +40,7 @@
*/
final class ServiceRefSerializer
{
+ private static final ResourceBundle bundle =
BundleUtils.getBundle(ServiceRefSerializer.class);
static final String SERVICE_REF_META_DATA = "SERVICE_REF_META_DATA";
private ServiceRefSerializer()
@@ -57,7 +60,7 @@
}
catch (final IOException e)
{
- throw new NamingException("Cannot marshall service ref meta data, cause:
" + e.toString());
+ throw new NamingException(BundleUtils.getMessage(bundle,
"CANNOT_MARSHALL_SERVICE_REF_META_DATA", e.getMessage()));
}
return baos.toByteArray();
@@ -76,11 +79,11 @@
}
catch (final IOException e)
{
- throw new NamingException("Cannot unmarshall service ref meta data, cause:
" + e.toString());
+ throw new NamingException(BundleUtils.getMessage(bundle,
"CANNOT_UNMARSHALL_SERVICE_REF_META_DATA", e.getMessage()));
}
catch (final ClassNotFoundException e)
{
- throw new NamingException("Cannot unmarshall service ref meta data, cause:
" + e.toString());
+ throw new NamingException(BundleUtils.getMessage(bundle,
"CANNOT_UNMARSHALL_SERVICE_REF_META_DATA", e.getMessage()));
}
return sref;
Modified:
common/trunk/src/main/java/org/jboss/ws/common/servlet/AbstractEndpointServlet.java
===================================================================
---
common/trunk/src/main/java/org/jboss/ws/common/servlet/AbstractEndpointServlet.java 2011-06-22
06:46:21 UTC (rev 14599)
+++
common/trunk/src/main/java/org/jboss/ws/common/servlet/AbstractEndpointServlet.java 2011-06-22
08:06:38 UTC (rev 14600)
@@ -24,6 +24,7 @@
import java.io.IOException;
import java.security.AccessController;
import java.security.PrivilegedAction;
+import java.util.ResourceBundle;
import javax.management.ObjectName;
import javax.servlet.ServletConfig;
@@ -31,7 +32,9 @@
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
+import javax.xml.ws.WebServiceException;
+import org.jboss.ws.api.util.BundleUtils;
import org.jboss.ws.common.ObjectNameFactory;
import org.jboss.wsf.spi.SPIProvider;
import org.jboss.wsf.spi.SPIProviderResolver;
@@ -44,8 +47,6 @@
import org.jboss.wsf.spi.management.EndpointRegistryFactory;
import org.jboss.wsf.spi.management.EndpointResolver;
-import javax.xml.ws.WebServiceException;
-
/**
* A cross stack webservice endpoint servlet.
* @author thomas.diesler(a)jboss.org
@@ -54,6 +55,7 @@
*/
public abstract class AbstractEndpointServlet extends HttpServlet
{
+ private static final ResourceBundle bundle =
BundleUtils.getBundle(AbstractEndpointServlet.class);
protected Endpoint endpoint;
private EndpointRegistry epRegistry;
@@ -154,7 +156,7 @@
Endpoint.SEPID_PROPERTY_CONTEXT + "=" + contextPath + ","
+
Endpoint.SEPID_PROPERTY_ENDPOINT + "=" + servletName
);
- throw new WebServiceException("Cannot obtain endpoint for: " +
oname);
+ throw new WebServiceException(BundleUtils.getMessage(bundle,
"CANNOT_OBTAIN_ENDPOINT_FOR", oname));
}
}
Added: common/trunk/src/main/java/org/jboss/ws/common/servlet/Message.properties
===================================================================
--- common/trunk/src/main/java/org/jboss/ws/common/servlet/Message.properties
(rev 0)
+++ common/trunk/src/main/java/org/jboss/ws/common/servlet/Message.properties 2011-06-22
08:06:38 UTC (rev 14600)
@@ -0,0 +1 @@
+CANNOT_OBTAIN_ENDPOINT_FOR=Cannot obtain endpoint for: {0}
Modified: common/trunk/src/main/java/org/jboss/ws/common/sort/DeploymentAspectSorter.java
===================================================================
---
common/trunk/src/main/java/org/jboss/ws/common/sort/DeploymentAspectSorter.java 2011-06-22
06:46:21 UTC (rev 14599)
+++
common/trunk/src/main/java/org/jboss/ws/common/sort/DeploymentAspectSorter.java 2011-06-22
08:06:38 UTC (rev 14600)
@@ -27,8 +27,10 @@
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
+import java.util.ResourceBundle;
import java.util.Set;
+import org.jboss.ws.api.util.BundleUtils;
import org.jboss.wsf.spi.deployment.DeploymentAspect;
/**
@@ -39,6 +41,7 @@
*/
public final class DeploymentAspectSorter
{
+ private static final ResourceBundle bundle =
BundleUtils.getBundle(DeploymentAspectSorter.class);
private static final DeploymentAspectSorter INSTANCE = new DeploymentAspectSorter();
@@ -74,7 +77,7 @@
}
}
- throw new IllegalStateException("No deployment aspect found with attribute
last='true'");
+ throw new IllegalStateException(BundleUtils.getMessage(bundle,
"NO_DEPLOYMENT_ASPECT_FOUND"));
}
private Graph createOrientedGraph(final List<DeploymentAspect> aspects)
@@ -171,7 +174,7 @@
if (this.vertices.size() > 0)
{
// if graph has edges then graph has at least one cycle
- throw new IllegalStateException("Cycle detected in subgraph: " +
this.vertices);
+ throw new IllegalStateException(BundleUtils.getMessage(bundle,
"CYCLE_DETECTED_IN_SUBGRAPH", this.vertices));
}
else
{
Added: common/trunk/src/main/java/org/jboss/ws/common/sort/Message.properties
===================================================================
--- common/trunk/src/main/java/org/jboss/ws/common/sort/Message.properties
(rev 0)
+++ common/trunk/src/main/java/org/jboss/ws/common/sort/Message.properties 2011-06-22
08:06:38 UTC (rev 14600)
@@ -0,0 +1,2 @@
+NO_DEPLOYMENT_ASPECT_FOUND=No deployment aspect found with attribute last='true'
+CYCLE_DETECTED_IN_SUBGRAPH=Cycle detected in subgraph: {0}
Modified: common/trunk/src/main/java/org/jboss/ws/common/spi/DefaultSPIProvider.java
===================================================================
--- common/trunk/src/main/java/org/jboss/ws/common/spi/DefaultSPIProvider.java 2011-06-22
06:46:21 UTC (rev 14599)
+++ common/trunk/src/main/java/org/jboss/ws/common/spi/DefaultSPIProvider.java 2011-06-22
08:06:38 UTC (rev 14600)
@@ -21,6 +21,9 @@
*/
package org.jboss.ws.common.spi;
+import java.util.ResourceBundle;
+
+import org.jboss.ws.api.util.BundleUtils;
import org.jboss.ws.api.util.ServiceLoader;
import org.jboss.ws.common.deployment.DefaultDeploymentModelFactory;
import org.jboss.ws.common.deployment.DefaultLifecycleHandlerFactory;
@@ -47,6 +50,7 @@
*/
class DefaultSPIProvider extends SPIProvider
{
+ private static final ResourceBundle bundle =
BundleUtils.getBundle(DefaultSPIProvider.class);
/**
* Gets the specified SPI, using the provided classloader
*/
@@ -95,7 +99,7 @@
}
if (returnType == null)
- throw new WSFException("Failed to provide SPI '" + spiType +
"'");
+ throw new WSFException(BundleUtils.getMessage(bundle,
"FAILED_TO_PROVIDE_SPI", spiType ));
return returnType;
}
Added: common/trunk/src/main/java/org/jboss/ws/common/spi/Message.properties
===================================================================
--- common/trunk/src/main/java/org/jboss/ws/common/spi/Message.properties
(rev 0)
+++ common/trunk/src/main/java/org/jboss/ws/common/spi/Message.properties 2011-06-22
08:06:38 UTC (rev 14600)
@@ -0,0 +1 @@
+FAILED_TO_PROVIDE_SPI=Failed to provide SPI:{0}
Modified:
common/trunk/src/main/java/org/jboss/ws/common/utils/AbstractWSDLFilePublisher.java
===================================================================
---
common/trunk/src/main/java/org/jboss/ws/common/utils/AbstractWSDLFilePublisher.java 2011-06-22
06:46:21 UTC (rev 14599)
+++
common/trunk/src/main/java/org/jboss/ws/common/utils/AbstractWSDLFilePublisher.java 2011-06-22
08:06:38 UTC (rev 14600)
@@ -29,12 +29,14 @@
import java.net.URL;
import java.util.Iterator;
import java.util.List;
+import java.util.ResourceBundle;
import javax.wsdl.Definition;
import javax.wsdl.Import;
import javax.wsdl.factory.WSDLFactory;
import org.jboss.logging.Logger;
+import org.jboss.ws.api.util.BundleUtils;
import org.jboss.ws.common.DOMUtils;
import org.jboss.ws.common.IOUtils;
import org.jboss.wsf.spi.SPIProvider;
@@ -53,6 +55,7 @@
*/
public abstract class AbstractWSDLFilePublisher
{
+ private static final ResourceBundle bundle =
BundleUtils.getBundle(AbstractWSDLFilePublisher.class);
private static final Logger log = Logger.getLogger(AbstractWSDLFilePublisher.class);
// The deployment info for the web service archive
@@ -182,7 +185,7 @@
// URL resourceURL = dep.getMetaDataFileURL(resourcePath);
InputStream is = new ResourceURL(resourceURL).openStream();
if (is == null)
- throw new IllegalArgumentException("Cannot find schema import
in deployment: " + resourcePath);
+ throw new IllegalArgumentException(BundleUtils.getMessage(bundle,
"CANNOT_FIND_SCHEMA_IMPORT_IN_DEPLOYMENT", resourcePath));
FileOutputStream fos = null;
try
@@ -238,7 +241,7 @@
else
{
if (file.delete() == false)
- log.warn("Cannot delete published wsdl document: " +
file.toURL());
+ log.warn(BundleUtils.getMessage(bundle,
"CANNOT_DELETE_PUBLISHED_WSDL_DOCUMENT", file.toURL()));
}
}
Modified: common/trunk/src/main/java/org/jboss/ws/common/utils/JBossWSEntityResolver.java
===================================================================
---
common/trunk/src/main/java/org/jboss/ws/common/utils/JBossWSEntityResolver.java 2011-06-22
06:46:21 UTC (rev 14599)
+++
common/trunk/src/main/java/org/jboss/ws/common/utils/JBossWSEntityResolver.java 2011-06-22
08:06:38 UTC (rev 14600)
@@ -31,11 +31,13 @@
import java.util.Enumeration;
import java.util.Map;
import java.util.Properties;
+import java.util.ResourceBundle;
import java.util.WeakHashMap;
import java.util.concurrent.ConcurrentHashMap;
import org.jboss.logging.Logger;
import org.jboss.util.xml.JBossEntityResolver;
+import org.jboss.ws.api.util.BundleUtils;
import org.jboss.wsf.spi.classloading.ClassLoaderProvider;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
@@ -48,6 +50,7 @@
*/
public class JBossWSEntityResolver extends JBossEntityResolver
{
+ private static final ResourceBundle bundle =
BundleUtils.getBundle(JBossWSEntityResolver.class);
/**
* A synchronized weak hash map that keeps entities' properties for each
classloader.
* Weak keys are used to remove entries when classloaders are garbage collected;
values are filenames -> properties.
@@ -83,7 +86,7 @@
// load entities
props = loadEntitiesMappingFromClasspath(entitiesResource, loader);
if (props.size() == 0)
- throw new IllegalArgumentException("No entities mapping defined in
resource file: " + entitiesResource);
+ throw new IllegalArgumentException(BundleUtils.getMessage(bundle,
"NO_ENTITIES_MAPPING_DEFINED_IN_RESOURCE_FILE", entitiesResource));
map.put(entitiesResource, props);
}
@@ -110,7 +113,7 @@
InputStream is = new DelegateClassLoader(intCl,
classLoader).getResourceAsStream(entitiesResource);
// get stream
if (is == null)
- throw new IllegalArgumentException("Resource " +
entitiesResource + " not found");
+ throw new IllegalArgumentException(BundleUtils.getMessage(bundle,
"RESOURCE_NOT_FOUND", entitiesResource ));
// load props
Properties props = new Properties();
@@ -120,7 +123,7 @@
}
catch (IOException ioe)
{
- log.error("Cannot read resource: " + entitiesResource, ioe);
+ log.error(BundleUtils.getMessage(bundle, "CANNOT_READ_RESOURCE",
entitiesResource), ioe);
}
finally
{
@@ -169,7 +172,7 @@
URL url = new URL(id);
if (url.getProtocol().equalsIgnoreCase("file") == false)
- log.warn("Trying to resolve id as a non-file URL: " + id);
+ log.warn(BundleUtils.getMessage(bundle,
"TRYING_TO_RESOLVE_ID_AS_A_NON-FILE_URL", id));
InputStream ins = new ResourceURL(url).openStream();
if (ins != null)
@@ -179,7 +182,7 @@
}
else
{
- log.warn("Cannot load id as URL: " + id);
+ log.warn(BundleUtils.getMessage(bundle, "CANNOT_LOAD_ID_AS_URL",
id));
}
if (trace)
Modified: common/trunk/src/main/java/org/jboss/ws/common/utils/JarUrlConnection.java
===================================================================
--- common/trunk/src/main/java/org/jboss/ws/common/utils/JarUrlConnection.java 2011-06-22
06:46:21 UTC (rev 14599)
+++ common/trunk/src/main/java/org/jboss/ws/common/utils/JarUrlConnection.java 2011-06-22
08:06:38 UTC (rev 14600)
@@ -29,17 +29,21 @@
import java.net.URLDecoder;
import java.util.ArrayList;
import java.util.List;
+import java.util.ResourceBundle;
import java.util.StringTokenizer;
import java.util.jar.JarEntry;
import java.util.jar.JarFile;
import java.util.jar.JarInputStream;
+import org.jboss.ws.api.util.BundleUtils;
+
/** <code>URLConnection</code> capable of handling multiply-nested jars.
*
* @author <a href="mailto:bob@eng.werken.com">bob mcwhirter</a>
*/
public class JarUrlConnection extends JarURLConnection
{
+ private static final ResourceBundle bundle =
BundleUtils.getBundle(JarUrlConnection.class);
// ----------------------------------------------------------------------
// Instance members
// ----------------------------------------------------------------------
@@ -89,7 +93,7 @@
}
else
{
- throw new MalformedURLException("No !/ in url: " +
url.toExternalForm());
+ throw new MalformedURLException(BundleUtils.getMessage(bundle,
"ERROR_IN_URL", url.toExternalForm()));
}
List segments = new ArrayList();
@@ -214,7 +218,7 @@
}
}
- throw new IOException("unable to locate segment: " + segment);
+ throw new IOException(BundleUtils.getMessage(bundle,
"UNABLE_TO_LOCATE_SEGMENT", segment));
}
/** @see java.net.URLConnection
Added: common/trunk/src/main/java/org/jboss/ws/common/utils/Message.properties
===================================================================
--- common/trunk/src/main/java/org/jboss/ws/common/utils/Message.properties
(rev 0)
+++ common/trunk/src/main/java/org/jboss/ws/common/utils/Message.properties 2011-06-22
08:06:38 UTC (rev 14600)
@@ -0,0 +1,13 @@
+NO_ENTITIES_MAPPING_DEFINED_IN_RESOURCE_FILE=No entities mapping defined in resource
file: {0}
+RESOURCE_NOT_FOUND=Resource {0} not found
+CANNOT_READ_RESOURCE=Cannot read resource: {0}
+TRYING_TO_RESOLVE_ID_AS_A_NON-FILE_URL=Trying to resolve id as a non-file URL: {0}
+CANNOT_LOAD_ID_AS_URL=Cannot load id as URL: {0}
+INVALID_CHARACTER_REFERENCE=Invalid character reference
+INVALID_ENTITY_REFERENCE=Invalid entity reference
+INVALID_ENTITY=Invalid entity: {0}
+CANNOT_FIND_SCHEMA_IMPORT_IN_DEPLOYMENT=Cannot find schema import in deployment: {0}
+CANNOT_DELETE_PUBLISHED_WSDL_DOCUMENT=Cannot delete published wsdl document: {0}
+ERROR_IN_URL=No ! in url: {0}
+UNABLE_TO_LOCATE_SEGMENT=unable to locate segment: {0}
+A_UUID_MUST_BE_16_BYTES=A UUID must be 16 bytes!
Modified: common/trunk/src/main/java/org/jboss/ws/common/utils/UUIDGenerator.java
===================================================================
--- common/trunk/src/main/java/org/jboss/ws/common/utils/UUIDGenerator.java 2011-06-22
06:46:21 UTC (rev 14599)
+++ common/trunk/src/main/java/org/jboss/ws/common/utils/UUIDGenerator.java 2011-06-22
08:06:38 UTC (rev 14600)
@@ -22,6 +22,8 @@
package org.jboss.ws.common.utils;
import java.security.SecureRandom;
+import java.util.ResourceBundle;
+import org.jboss.ws.api.util.BundleUtils;
/**
* Generates the string form of IETF variant UUIDs.
@@ -35,6 +37,7 @@
*/
public class UUIDGenerator
{
+ private static final ResourceBundle bundle =
BundleUtils.getBundle(UUIDGenerator.class);
private static SecureRandom rand;
private static String bytesToHex(byte[] buffer, int offset, int length)
@@ -108,7 +111,7 @@
public static String convertToString(byte[] uuid)
{
if (uuid.length != 16)
- throw new IllegalArgumentException("A UUID must be 16 bytes!");
+ throw new IllegalArgumentException(BundleUtils.getMessage(bundle,
"A_UUID_MUST_BE_16_BYTES"));
String string = bytesToHex(uuid, 0, 4) + "-"
+ bytesToHex(uuid, 4, 2) + "-"
Modified:
common/trunk/src/main/java/org/jboss/ws/common/utils/XMLPredefinedEntityReferenceResolver.java
===================================================================
---
common/trunk/src/main/java/org/jboss/ws/common/utils/XMLPredefinedEntityReferenceResolver.java 2011-06-22
06:46:21 UTC (rev 14599)
+++
common/trunk/src/main/java/org/jboss/ws/common/utils/XMLPredefinedEntityReferenceResolver.java 2011-06-22
08:06:38 UTC (rev 14600)
@@ -22,7 +22,10 @@
package org.jboss.ws.common.utils;
import java.util.HashMap;
+import java.util.ResourceBundle;
+import org.jboss.ws.api.util.BundleUtils;
+
/**
* Utility class for resolving predefined XML entity and character references.
*
@@ -30,6 +33,7 @@
*/
public class XMLPredefinedEntityReferenceResolver
{
+ private static final ResourceBundle bundle =
BundleUtils.getBundle(XMLPredefinedEntityReferenceResolver.class);
private static HashMap<String, Character> entities = new HashMap<String,
Character>();
static
@@ -52,7 +56,7 @@
int end = source.indexOf(';', pos);
if (end == -1)
- throw new IllegalArgumentException("Invalid character reference");
+ throw new IllegalArgumentException(BundleUtils.getMessage(bundle,
"INVALID_CHARACTER_REFERENCE"));
int c = Integer.parseInt(source.substring(pos, end), radix);
builder.append((char) c);
@@ -64,12 +68,12 @@
{
int end = source.indexOf(';', ++pos);
if (end == -1)
- throw new IllegalArgumentException("Invalid entity reference");
+ throw new IllegalArgumentException(BundleUtils.getMessage(bundle,
"INVALID_ENTITY_REFERENCE"));
String entity = source.substring(pos, end);
Character c = entities.get(entity);
if (c == null)
- throw new IllegalArgumentException("Invalid entity: " + entity);
+ throw new IllegalArgumentException(BundleUtils.getMessage(bundle,
"INVALID_ENTITY", entity));
builder.append(c.charValue());
@@ -100,7 +104,7 @@
int peek = pos + 1;
if (peek == end)
- throw new IllegalArgumentException("Invalid entity reference");
+ throw new IllegalArgumentException(BundleUtils.getMessage(bundle,
"INVALID_ENTITY_REFERENCE"));
if (normalized.charAt(peek) == '#')
pos = resolveCharRef(normalized, pos, builder);