Author: jim.ma
Date: 2011-06-22 02:38:21 -0400 (Wed, 22 Jun 2011)
New Revision: 14598
Added:
spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/Message.properties
spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/config/Message.properties
spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/injection/Message.properties
spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/j2ee/serviceref/Message.properties
spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/webservices/Message.properties
spi/trunk/src/main/java/org/jboss/wsf/spi/util/Message.properties
Modified:
spi/trunk/pom.xml
spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/AbstractHandlerChainsMetaDataParser.java
spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/config/AbstractCommonConfig.java
spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/config/ConfigMetaDataParser.java
spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/injection/InjectionMetaData.java
spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/injection/InjectionsMetaData.java
spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/j2ee/serviceref/UnifiedHandlerChainsMetaDataParser.java
spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/j2ee/serviceref/UnifiedPortComponentRefMetaData.java
spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/j2ee/serviceref/UnifiedServiceRefMetaData.java
spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/webservices/PortComponentMetaData.java
spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/webservices/WebserviceDescriptionMetaData.java
spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/webservices/WebservicesFactory.java
spi/trunk/src/main/java/org/jboss/wsf/spi/util/StAXUtils.java
spi/trunk/src/main/java/org/jboss/wsf/spi/util/URLLoaderAdapter.java
Log:
[JBWS-3316]:i18n spi
Modified: spi/trunk/pom.xml
===================================================================
--- spi/trunk/pom.xml 2011-06-21 11:31:52 UTC (rev 14597)
+++ spi/trunk/pom.xml 2011-06-22 06:38:21 UTC (rev 14598)
@@ -73,6 +73,15 @@
<!-- Plugins -->
<build>
+ <resources>
+ <resource>
+ <directory>src/main/java</directory>
+ <includes>
+ <include>**/*.properties</include>
+ </includes>
+ </resource>
+ </resources>
+
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
Modified:
spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/AbstractHandlerChainsMetaDataParser.java
===================================================================
---
spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/AbstractHandlerChainsMetaDataParser.java 2011-06-21
11:31:52 UTC (rev 14597)
+++
spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/AbstractHandlerChainsMetaDataParser.java 2011-06-22
06:38:21 UTC (rev 14598)
@@ -21,18 +21,34 @@
*/
package org.jboss.wsf.spi.metadata;
-import static org.jboss.wsf.spi.metadata.ParserConstants.*;
+import static org.jboss.wsf.spi.metadata.ParserConstants.CHAIN_PORT_PATTERN;
+import static org.jboss.wsf.spi.metadata.ParserConstants.CHAIN_PROTOCOL_BINDING;
+import static org.jboss.wsf.spi.metadata.ParserConstants.CHAIN_SERVICE_PATTERN;
+import static org.jboss.wsf.spi.metadata.ParserConstants.HANDLER;
+import static org.jboss.wsf.spi.metadata.ParserConstants.HANDLER_CHAIN;
+import static org.jboss.wsf.spi.metadata.ParserConstants.HANDLER_CHAINS;
+import static org.jboss.wsf.spi.metadata.ParserConstants.HANDLER_CLASS;
+import static org.jboss.wsf.spi.metadata.ParserConstants.HANDLER_NAME;
+import static org.jboss.wsf.spi.metadata.ParserConstants.HANDLER_PARAM;
+import static org.jboss.wsf.spi.metadata.ParserConstants.HANDLER_PARAM_NAME;
+import static org.jboss.wsf.spi.metadata.ParserConstants.HANDLER_PARAM_VALUE;
+import static org.jboss.wsf.spi.metadata.ParserConstants.HANDLER_SOAP_HEADER;
+import static org.jboss.wsf.spi.metadata.ParserConstants.HANDLER_SOAP_ROLE;
import static org.jboss.wsf.spi.util.StAXUtils.elementAsQName;
import static org.jboss.wsf.spi.util.StAXUtils.elementAsString;
import static org.jboss.wsf.spi.util.StAXUtils.match;
+import java.util.ResourceBundle;
+
+import javax.xml.stream.XMLStreamConstants;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+
+import org.jboss.ws.api.util.BundleUtils;
import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedHandlerChainMetaData;
import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedHandlerChainsMetaData;
import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedHandlerMetaData;
import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedInitParamMetaData;
-import javax.xml.stream.XMLStreamConstants;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamReader;
/**
* Basic handler-chains parser
@@ -42,6 +58,7 @@
*/
public abstract class AbstractHandlerChainsMetaDataParser
{
+ private static final ResourceBundle bundle =
BundleUtils.getBundle(AbstractHandlerChainsMetaDataParser.class);
protected UnifiedHandlerChainsMetaData parseHandlerChains(XMLStreamReader reader,
String nsUri) throws XMLStreamException
{
return this.parseHandlerChains(reader, nsUri, nsUri, HANDLER_CHAINS);
@@ -62,7 +79,7 @@
}
else
{
- throw new IllegalStateException("Unexpected end tag: " +
reader.getLocalName());
+ throw new IllegalStateException(BundleUtils.getMessage(bundle,
"UNEXPECTED_END_TAG", reader.getLocalName()));
}
}
case XMLStreamConstants.START_ELEMENT : {
@@ -71,12 +88,12 @@
}
else
{
- throw new IllegalStateException("Unexpected element: " +
reader.getLocalName());
+ throw new IllegalStateException(BundleUtils.getMessage(bundle,
"UNEXPECTED_ELEMENT", reader.getLocalName()));
}
}
}
}
- throw new IllegalStateException("Reached end of xml document
unexpectedly");
+ throw new IllegalStateException(BundleUtils.getMessage(bundle,
"REACHED_END_OF_XML_DOCUMENT_UNEXPECTEDLY"));
}
private UnifiedHandlerChainMetaData parseHandlerChain(XMLStreamReader reader, String
nsUri, UnifiedHandlerChainsMetaData handlerChains) throws XMLStreamException
@@ -93,7 +110,7 @@
}
else
{
- throw new IllegalStateException("Unexpected end tag: " +
reader.getLocalName());
+ throw new IllegalStateException(BundleUtils.getMessage(bundle,
"UNEXPECTED_END_TAG", reader.getLocalName()));
}
}
case XMLStreamConstants.START_ELEMENT : {
@@ -114,12 +131,12 @@
}
else
{
- throw new IllegalStateException("Unexpected element: " +
reader.getLocalName());
+ throw new IllegalStateException(BundleUtils.getMessage(bundle,
"UNEXPECTED_ELEMENT", reader.getLocalName()));
}
}
}
}
- throw new IllegalStateException("Reached end of xml document
unexpectedly");
+ throw new IllegalStateException(BundleUtils.getMessage(bundle,
"REACHED_END_OF_XML_DOCUMENT_UNEXPECTEDLY"));
}
protected UnifiedHandlerMetaData parseHandler(XMLStreamReader reader, String nsUri)
throws XMLStreamException
@@ -141,7 +158,7 @@
}
else
{
- throw new IllegalStateException("Unexpected end tag: " +
reader.getLocalName());
+ throw new IllegalStateException(BundleUtils.getMessage(bundle,
"UNEXPECTED_END_TAG", reader.getLocalName()));
}
}
case XMLStreamConstants.START_ELEMENT : {
@@ -164,12 +181,12 @@
}
else
{
- throw new IllegalStateException("Unexpected element: " +
reader.getLocalName());
+ throw new IllegalStateException(BundleUtils.getMessage(bundle,
"UNEXPECTED_ELEMENT", reader.getLocalName()));
}
}
}
}
- throw new IllegalStateException("Reached end of xml document
unexpectedly");
+ throw new IllegalStateException(BundleUtils.getMessage(bundle,
"REACHED_END_OF_XML_DOCUMENT_UNEXPECTEDLY"));
}
private UnifiedInitParamMetaData parseInitParam(XMLStreamReader reader, String nsUri)
throws XMLStreamException
@@ -186,7 +203,7 @@
}
else
{
- throw new IllegalStateException("Unexpected end tag: " +
reader.getLocalName());
+ throw new IllegalStateException(BundleUtils.getMessage(bundle,
"UNEXPECTED_END_TAG", reader.getLocalName()));
}
}
case XMLStreamConstants.START_ELEMENT : {
@@ -200,11 +217,11 @@
}
else
{
- throw new IllegalStateException("Unexpected element: " +
reader.getLocalName());
+ throw new IllegalStateException(BundleUtils.getMessage(bundle,
"UNEXPECTED_ELEMENT", reader.getLocalName()));
}
}
}
}
- throw new IllegalStateException("Reached end of xml document
unexpectedly");
+ throw new IllegalStateException(BundleUtils.getMessage(bundle,
"REACHED_END_OF_XML_DOCUMENT_UNEXPECTEDLY"));
}
}
Added: spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/Message.properties
===================================================================
--- spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/Message.properties
(rev 0)
+++ spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/Message.properties 2011-06-22
06:38:21 UTC (rev 14598)
@@ -0,0 +1,3 @@
+UNEXPECTED_END_TAG=Unexpected end tag: {0}
+UNEXPECTED_ELEMENT=Unexpected element: {0}
+REACHED_END_OF_XML_DOCUMENT_UNEXPECTEDLY=Reached end of xml document unexpectedly
Modified:
spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/config/AbstractCommonConfig.java
===================================================================
---
spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/config/AbstractCommonConfig.java 2011-06-21
11:31:52 UTC (rev 14597)
+++
spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/config/AbstractCommonConfig.java 2011-06-22
06:38:21 UTC (rev 14598)
@@ -24,7 +24,9 @@
import java.util.HashMap;
import java.util.List;
import java.util.Map;
+import java.util.ResourceBundle;
+import org.jboss.ws.api.util.BundleUtils;
import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedHandlerChainMetaData;
import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedHandlerMetaData.HandlerType;
@@ -36,6 +38,7 @@
*/
public abstract class AbstractCommonConfig implements CommonConfig
{
+ private static final ResourceBundle bundle =
BundleUtils.getBundle(AbstractCommonConfig.class);
private String configName;
private Map<String, Feature> features = new HashMap<String, Feature>();
private Map<String, String> properties = new HashMap<String, String>();
@@ -69,7 +72,7 @@
handlerChains = getPreHandlerChains();
else if (type == HandlerType.POST)
handlerChains = getPostHandlerChains();
- else throw new IllegalArgumentException("Invalid handler type: " +
type);
+ else throw new IllegalArgumentException(BundleUtils.getMessage(bundle,
"INVALID_HANDLER_TYPE", type));
return handlerChains;
}
Modified:
spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/config/ConfigMetaDataParser.java
===================================================================
---
spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/config/ConfigMetaDataParser.java 2011-06-21
11:31:52 UTC (rev 14597)
+++
spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/config/ConfigMetaDataParser.java 2011-06-22
06:38:21 UTC (rev 14598)
@@ -23,23 +23,38 @@
import static javax.xml.stream.XMLStreamConstants.END_ELEMENT;
import static javax.xml.stream.XMLStreamConstants.START_ELEMENT;
-import static org.jboss.wsf.spi.metadata.ParserConstants.*;
+import static org.jboss.wsf.spi.metadata.ParserConstants.CLIENT_CONFIG;
+import static org.jboss.wsf.spi.metadata.ParserConstants.CONFIG_NAME;
+import static org.jboss.wsf.spi.metadata.ParserConstants.ENDPOINT_CONFIG;
+import static org.jboss.wsf.spi.metadata.ParserConstants.FEATURE;
+import static org.jboss.wsf.spi.metadata.ParserConstants.FEATURE_DATA;
+import static org.jboss.wsf.spi.metadata.ParserConstants.FEATURE_NAME;
+import static org.jboss.wsf.spi.metadata.ParserConstants.JAVAEE_NS;
+import static org.jboss.wsf.spi.metadata.ParserConstants.JAXWS_CONFIG;
+import static org.jboss.wsf.spi.metadata.ParserConstants.JBOSSWS_JAXWS_CONFIG_NS;
+import static org.jboss.wsf.spi.metadata.ParserConstants.POST_HANDLER_CHAINS;
+import static org.jboss.wsf.spi.metadata.ParserConstants.PRE_HANDLER_CHAINS;
+import static org.jboss.wsf.spi.metadata.ParserConstants.PROPERTY;
+import static org.jboss.wsf.spi.metadata.ParserConstants.PROPERTY_NAME;
+import static org.jboss.wsf.spi.metadata.ParserConstants.PROPERTY_VALUE;
import static org.jboss.wsf.spi.util.StAXUtils.elementAsString;
import static org.jboss.wsf.spi.util.StAXUtils.match;
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
+import java.util.ResourceBundle;
+import javax.xml.stream.XMLStreamConstants;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+
import org.jboss.logging.Logger;
+import org.jboss.ws.api.util.BundleUtils;
import org.jboss.wsf.spi.metadata.AbstractHandlerChainsMetaDataParser;
import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedHandlerChainsMetaData;
import org.jboss.wsf.spi.util.StAXUtils;
-import javax.xml.stream.XMLStreamConstants;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamReader;
-
/**
* The parser for the configuration metadata
*
@@ -48,6 +63,7 @@
*/
public class ConfigMetaDataParser extends AbstractHandlerChainsMetaDataParser
{
+ private static final ResourceBundle bundle =
BundleUtils.getBundle(ConfigMetaDataParser.class);
private ConfigMetaDataParser()
{
super();
@@ -112,7 +128,7 @@
}
else
{
- throw new IllegalStateException("Unexpected element: " +
reader.getLocalName());
+ throw new IllegalStateException(BundleUtils.getMessage(bundle,
"UNEXPECTED_ELEMENT", reader.getLocalName()));
}
}
}
@@ -133,7 +149,7 @@
}
else
{
- throw new IllegalStateException("Unexpected end tag: " +
reader.getLocalName());
+ throw new IllegalStateException(BundleUtils.getMessage(bundle,
"UNEXPECTED_END_TAG", reader.getLocalName()));
}
}
case XMLStreamConstants.START_ELEMENT : {
@@ -149,12 +165,12 @@
}
else
{
- throw new IllegalStateException("Unexpected element: " +
reader.getLocalName());
+ throw new IllegalStateException(BundleUtils.getMessage(bundle,
"UNEXPECTED_ELEMENT", reader.getLocalName()));
}
}
}
}
- throw new IllegalStateException("Reached end of xml document
unexpectedly");
+ throw new IllegalStateException(BundleUtils.getMessage(bundle,
"REACHED_END_OF_XML_DOCUMENT_UNEXPECTEDLY"));
}
private void parseConfig(XMLStreamReader reader, CommonConfig config, String
configElement) throws XMLStreamException
@@ -170,7 +186,7 @@
}
else
{
- throw new IllegalStateException("Unexpected end tag: " +
reader.getLocalName());
+ throw new IllegalStateException(BundleUtils.getMessage(bundle,
"UNEXPECTED_END_TAG", reader.getLocalName()));
}
}
case XMLStreamConstants.START_ELEMENT : {
@@ -193,12 +209,12 @@
}
else
{
- throw new IllegalStateException("Unexpected element: " +
reader.getLocalName());
+ throw new IllegalStateException(BundleUtils.getMessage(bundle,
"UNEXPECTED_ELEMENT", reader.getLocalName()));
}
}
}
}
- throw new IllegalStateException("Reached end of xml document
unexpectedly");
+ throw new IllegalStateException(BundleUtils.getMessage(bundle,
"REACHED_END_OF_XML_DOCUMENT_UNEXPECTEDLY"));
}
private void parseProperty(XMLStreamReader reader, CommonConfig config) throws
XMLStreamException
@@ -214,14 +230,14 @@
{
if (name == null)
{
- throw new IllegalStateException("Could not get property
name!");
+ throw new IllegalStateException(BundleUtils.getMessage(bundle,
"COULD_NOT_GET_PROPERTY_NAME"));
}
config.setProperty(name, value);
return;
}
else
{
- throw new IllegalStateException("Unexpected end tag: " +
reader.getLocalName());
+ throw new IllegalStateException(BundleUtils.getMessage(bundle,
"UNEXPECTED_END_TAG", reader.getLocalName()));
}
}
case XMLStreamConstants.START_ELEMENT : {
@@ -233,12 +249,12 @@
}
else
{
- throw new IllegalStateException("Unexpected element: " +
reader.getLocalName());
+ throw new IllegalStateException(BundleUtils.getMessage(bundle,
"UNEXPECTED_ELEMENT", reader.getLocalName()));
}
}
}
}
- throw new IllegalStateException("Reached end of xml document
unexpectedly");
+ throw new IllegalStateException(BundleUtils.getMessage(bundle,
"REACHED_END_OF_XML_DOCUMENT_UNEXPECTEDLY"));
}
private Feature parseFeature(XMLStreamReader reader) throws XMLStreamException
@@ -253,13 +269,13 @@
{
if (feature == null)
{
- throw new IllegalStateException("Could not read feature
name!");
+ throw new IllegalStateException(BundleUtils.getMessage(bundle,
"COULD_NOT_READ_FEATURE_NAME"));
}
return feature;
}
else
{
- throw new IllegalStateException("Unexpected end tag: " +
reader.getLocalName());
+ throw new IllegalStateException(BundleUtils.getMessage(bundle,
"UNEXPECTED_END_TAG", reader.getLocalName()));
}
}
case XMLStreamConstants.START_ELEMENT : {
@@ -268,7 +284,7 @@
}
else if (match(reader, JBOSSWS_JAXWS_CONFIG_NS, FEATURE_DATA)) {
//not implemented yet
- Logger.getLogger(this.getClass()).warn("Feature data not supported
yet!");
+ Logger.getLogger(this.getClass()).warn(BundleUtils.getMessage(bundle,
"FEATURE_DATA_NOT_SUPPORTED_YET"));
while (reader.hasNext()) {
reader.next();
if (reader.isEndElement() && match(reader,
JBOSSWS_JAXWS_CONFIG_NS, FEATURE_DATA))
@@ -279,11 +295,11 @@
}
else
{
- throw new IllegalStateException("Unexpected element: " +
reader.getLocalName());
+ throw new IllegalStateException(BundleUtils.getMessage(bundle,
"UNEXPECTED_ELEMENT", reader.getLocalName()));
}
}
}
}
- throw new IllegalStateException("Reached end of xml document
unexpectedly");
+ throw new IllegalStateException(BundleUtils.getMessage(bundle,
"REACHED_END_OF_XML_DOCUMENT_UNEXPECTEDLY"));
}
}
Added: spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/config/Message.properties
===================================================================
--- spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/config/Message.properties
(rev 0)
+++
spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/config/Message.properties 2011-06-22
06:38:21 UTC (rev 14598)
@@ -0,0 +1,7 @@
+INVALID_HANDLER_TYPE=Invalid handler type: {0}
+UNEXPECTED_ELEMENT=Unexpected element: {0}
+UNEXPECTED_END_TAG=Unexpected end tag: {0}
+REACHED_END_OF_XML_DOCUMENT_UNEXPECTEDLY=Reached end of xml document unexpectedly
+COULD_NOT_GET_PROPERTY_NAME=Could not get property name!
+COULD_NOT_READ_FEATURE_NAME=Could not read feature name!
+FEATURE_DATA_NOT_SUPPORTED_YET=Feature data not supported yet!
Modified:
spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/injection/InjectionMetaData.java
===================================================================
---
spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/injection/InjectionMetaData.java 2011-06-21
11:31:52 UTC (rev 14597)
+++
spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/injection/InjectionMetaData.java 2011-06-22
06:38:21 UTC (rev 14598)
@@ -21,6 +21,10 @@
*/
package org.jboss.wsf.spi.metadata.injection;
+import java.util.ResourceBundle;
+
+import org.jboss.ws.api.util.BundleUtils;
+
/**
* An injection target specifies a class and a name within
* that class into which a resource should be injected.
@@ -30,6 +34,7 @@
*/
public final class InjectionMetaData
{
+ private static final ResourceBundle bundle =
BundleUtils.getBundle(InjectionMetaData.class);
/**
* Target class to do injection on.
@@ -70,11 +75,11 @@
super();
if (targetClass == null)
- throw new IllegalArgumentException("targetClass not specified");
+ throw new IllegalArgumentException(BundleUtils.getMessage(bundle,
"TARGETCLASS_NOT_SPECIFIED"));
if (targetName == null)
- throw new IllegalArgumentException("targetName not specified");
+ throw new IllegalArgumentException(BundleUtils.getMessage(bundle,
"TARGETNAME_NOT_SPECIFIED"));
if (envEntryName == null)
- throw new IllegalArgumentException("envEntryName not specified");
+ throw new IllegalArgumentException(BundleUtils.getMessage(bundle,
"ENVENTRYNAME_NOT_SPECIFIED"));
this.targetClass = targetClass;
this.targetName = targetName;
@@ -113,7 +118,7 @@
if (Double.class.getName().equals(s))
return Double.class;
- throw new IllegalArgumentException("Unsupported env entry type: " + s);
+ throw new IllegalArgumentException(BundleUtils.getMessage(bundle,
"UNSUPPORTED_ENV_ENTRY_TYPE", s));
}
/**
Modified:
spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/injection/InjectionsMetaData.java
===================================================================
---
spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/injection/InjectionsMetaData.java 2011-06-21
11:31:52 UTC (rev 14597)
+++
spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/injection/InjectionsMetaData.java 2011-06-22
06:38:21 UTC (rev 14598)
@@ -22,6 +22,8 @@
package org.jboss.wsf.spi.metadata.injection;
import java.lang.annotation.Annotation;
+import java.util.ResourceBundle;
+import org.jboss.ws.api.util.BundleUtils;
import java.util.Collections;
import java.util.Collection;
import java.util.LinkedList;
@@ -36,6 +38,7 @@
*/
public final class InjectionsMetaData
{
+ private static final ResourceBundle bundle =
BundleUtils.getBundle(InjectionsMetaData.class);
/**
* Empty list constant.
@@ -63,9 +66,9 @@
super();
if (injections == null)
- throw new IllegalArgumentException("injections metadata list cannot be
null");
+ throw new IllegalArgumentException(BundleUtils.getMessage(bundle,
"INJECTIONS_METADATA_LIST_CANNOT_BE_NULL"));
if ((resolvers == null) || (resolvers.size() == 0))
- throw new IllegalArgumentException("reference resolvers list cannot be null
or empty collection");
+ throw new IllegalArgumentException(BundleUtils.getMessage(bundle,
"REFERENCE_RESOLVERS_LIST_CANNOT_BE_NULL"));
this.injections = injections;
this.referenceResolvers = resolvers;
@@ -80,7 +83,7 @@
public Collection<InjectionMetaData> getInjectionsMetaData(Class<?>
clazz)
{
if (clazz == null)
- throw new IllegalArgumentException("class cannot be null");
+ throw new IllegalArgumentException(BundleUtils.getMessage(bundle,
"CLASS_CANNOT_BE_NULL"));
if (this.injections.size() == 0)
return EMPTY_LIST;
@@ -117,7 +120,7 @@
final ReferenceResolver resolver = this.referenceResolvers.get(annotation);
if (resolver == null)
{
- throw new IllegalArgumentException("No registered reference resolver for:
" + annotation);
+ throw new IllegalArgumentException(BundleUtils.getMessage(bundle,
"NO_REGISTERED_REFERENCE_RESOLVER_FOR", annotation));
}
return resolver;
Added: spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/injection/Message.properties
===================================================================
--- spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/injection/Message.properties
(rev 0)
+++
spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/injection/Message.properties 2011-06-22
06:38:21 UTC (rev 14598)
@@ -0,0 +1,8 @@
+TARGETCLASS_NOT_SPECIFIED=targetClass not specified
+TARGETNAME_NOT_SPECIFIED=targetName not specified
+ENVENTRYNAME_NOT_SPECIFIED=envEntryName not specified
+UNSUPPORTED_ENV_ENTRY_TYPE=Unsupported env entry type: {0}
+INJECTIONS_METADATA_LIST_CANNOT_BE_NULL=injections metadata list cannot be null
+REFERENCE_RESOLVERS_LIST_CANNOT_BE_NULL=reference resolvers list cannot be null or empty
collection
+CLASS_CANNOT_BE_NULL=class cannot be null
+NO_REGISTERED_REFERENCE_RESOLVER_FOR=No registered reference resolver for: {0}
Added:
spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/j2ee/serviceref/Message.properties
===================================================================
--- spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/j2ee/serviceref/Message.properties
(rev 0)
+++
spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/j2ee/serviceref/Message.properties 2011-06-22
06:38:21 UTC (rev 14598)
@@ -0,0 +1,7 @@
+ONLY_ALL_ANONYMOUS_OR_NON_ANONYMOUS_ALLOWED=Only ALL, ANONYMOUS or NON_ANONYMOUS strings
are allowed
+CANNOT_FIND_JAXRCP-MAPPING-FILE=Cannot find jaxrcp-mapping-file: {0}
+MULTIPLE_MATCHING_PORT_COMPONENT_REF=Multiple matching port component ref: sei={0}
port={1}
+CANNOT_FIND_WSDL-OVERRIDE=Cannot find wsdl-override: {0}
+CANNOT_FIND_WSDL-FILE=Cannot find wsdl-file: {0}
+UNEXPECTED_ELEMENT=Unexpected element: {0}
+CANNOT_MATCH=Cannot match against seiName=null && portName=null.
Modified:
spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/j2ee/serviceref/UnifiedHandlerChainsMetaDataParser.java
===================================================================
---
spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/j2ee/serviceref/UnifiedHandlerChainsMetaDataParser.java 2011-06-21
11:31:52 UTC (rev 14597)
+++
spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/j2ee/serviceref/UnifiedHandlerChainsMetaDataParser.java 2011-06-22
06:38:21 UTC (rev 14598)
@@ -23,17 +23,22 @@
import static javax.xml.stream.XMLStreamConstants.END_ELEMENT;
import static javax.xml.stream.XMLStreamConstants.START_ELEMENT;
-import static org.jboss.wsf.spi.metadata.ParserConstants.*;
+import static org.jboss.wsf.spi.metadata.ParserConstants.HANDLER_CHAINS;
+import static org.jboss.wsf.spi.metadata.ParserConstants.J2EE_NS;
+import static org.jboss.wsf.spi.metadata.ParserConstants.JAVAEE_NS;
import static org.jboss.wsf.spi.util.StAXUtils.match;
import java.io.IOException;
import java.io.InputStream;
+import java.util.ResourceBundle;
-import org.jboss.wsf.spi.metadata.AbstractHandlerChainsMetaDataParser;
-import org.jboss.wsf.spi.util.StAXUtils;
import javax.xml.stream.XMLStreamException;
import javax.xml.stream.XMLStreamReader;
+import org.jboss.ws.api.util.BundleUtils;
+import org.jboss.wsf.spi.metadata.AbstractHandlerChainsMetaDataParser;
+import org.jboss.wsf.spi.util.StAXUtils;
+
/**
* The parser for the unified metadata handler chains element
*
@@ -42,6 +47,7 @@
*/
public class UnifiedHandlerChainsMetaDataParser extends
AbstractHandlerChainsMetaDataParser
{
+ private static final ResourceBundle bundle =
BundleUtils.getBundle(UnifiedHandlerChainsMetaDataParser.class);
private UnifiedHandlerChainsMetaDataParser()
{
super();
@@ -89,7 +95,7 @@
}
else
{
- throw new IllegalStateException("Unexpected element: " +
reader.getLocalName());
+ throw new IllegalStateException(BundleUtils.getMessage(bundle,
"UNEXPECTED_ELEMENT", reader.getLocalName()));
}
}
}
Modified:
spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/j2ee/serviceref/UnifiedPortComponentRefMetaData.java
===================================================================
---
spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/j2ee/serviceref/UnifiedPortComponentRefMetaData.java 2011-06-21
11:31:52 UTC (rev 14597)
+++
spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/j2ee/serviceref/UnifiedPortComponentRefMetaData.java 2011-06-22
06:38:21 UTC (rev 14598)
@@ -23,9 +23,11 @@
import java.util.ArrayList;
import java.util.List;
+import java.util.ResourceBundle;
import javax.xml.namespace.QName;
+import org.jboss.ws.api.util.BundleUtils;
import org.jboss.wsf.spi.serviceref.ServiceRefElement;
/** The metdata data from service-ref/port-component-ref element in web.xml, ejb-jar.xml,
and application-client.xml.
@@ -34,6 +36,7 @@
*/
public class UnifiedPortComponentRefMetaData extends ServiceRefElement
{
+ private static final ResourceBundle bundle =
BundleUtils.getBundle(UnifiedPortComponentRefMetaData.class);
private static final long serialVersionUID = 8622309745808960649L;
// The parent service-ref
@@ -93,7 +96,7 @@
public void setAddressingResponses(final String responsesTypes)
{
if (!"ANONYMOUS".equals(responsesTypes) &&
!"NON_ANONYMOUS".equals(responsesTypes) &&
!"ALL".equals(responsesTypes))
- throw new IllegalArgumentException("Only ALL, ANONYMOUS or NON_ANONYMOUS
strings are allowed");
+ throw new IllegalArgumentException(BundleUtils.getMessage(bundle,
"ONLY_ALL_ANONYMOUS_OR_NON_ANONYMOUS_ALLOWED"));
this.addressingResponses = responsesTypes;
}
@@ -221,7 +224,7 @@
public boolean matches(String seiName, QName portName)
{
if (seiName == null && portName == null)
- throw new IllegalArgumentException("Cannot match against seiName=null
&& portName=null.");
+ throw new IllegalArgumentException(BundleUtils.getMessage(bundle,
"CANNOT_MATCH"));
boolean match = false;
Modified:
spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/j2ee/serviceref/UnifiedServiceRefMetaData.java
===================================================================
---
spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/j2ee/serviceref/UnifiedServiceRefMetaData.java 2011-06-21
11:31:52 UTC (rev 14597)
+++
spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/j2ee/serviceref/UnifiedServiceRefMetaData.java 2011-06-22
06:38:21 UTC (rev 14598)
@@ -35,11 +35,13 @@
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
+import java.util.ResourceBundle;
import javax.xml.namespace.QName;
import javax.xml.ws.WebServiceException;
import org.jboss.logging.Logger;
+import org.jboss.ws.api.util.BundleUtils;
import org.jboss.wsf.spi.deployment.UnifiedVirtualFile;
import org.jboss.wsf.spi.deployment.WritableUnifiedVirtualFile;
import org.jboss.wsf.spi.serviceref.ServiceRefElement;
@@ -56,6 +58,7 @@
*/
public final class UnifiedServiceRefMetaData extends ServiceRefElement
{
+ private static final ResourceBundle bundle =
BundleUtils.getBundle(UnifiedServiceRefMetaData.class);
private static final long serialVersionUID = -926464174132493955L;
// provide logging
@@ -147,7 +150,7 @@
public void setAddressingResponses(final String responsesTypes)
{
if (!"ANONYMOUS".equals(responsesTypes) &&
!"NON_ANONYMOUS".equals(responsesTypes) &&
!"ALL".equals(responsesTypes))
- throw new IllegalArgumentException("Only ALL, ANONYMOUS or NON_ANONYMOUS
strings are allowed");
+ throw new IllegalArgumentException(BundleUtils.getMessage(bundle,
"ONLY_ALL,ONLY_ALL_ANONYMOUS_OR_NON_ANONYMOUS_ALLOWED"));
this.addressingResponses = responsesTypes;
}
@@ -248,7 +251,7 @@
}
catch (Exception e)
{
- throw new WebServiceException("Cannot find jaxrcp-mapping-file: " +
mappingFile, e);
+ throw new WebServiceException(BundleUtils.getMessage(bundle,
"CANNOT_FIND_JAXRCP-MAPPING-FILE", mappingFile), e);
}
}
return mappingURL;
@@ -267,7 +270,7 @@
if (ref.matches(seiName, portName))
{
if (matchingRef != null)
- log.warn("Multiple matching port component ref: [sei=" + seiName
+ ",port=" + portName + "]");
+ log.warn(BundleUtils.getMessage(bundle,
"MULTIPLE_MATCHING_PORT_COMPONENT_REF", new Object[]{ seiName , portName }));
matchingRef = ref;
}
@@ -357,7 +360,7 @@
}
catch (Exception e)
{
- throw new WebServiceException("Cannot find wsdl-override: " +
wsdlOverride, e);
+ throw new WebServiceException(BundleUtils.getMessage(bundle,
"CANNOT_FIND_WSDL-OVERRIDE", wsdlOverride), e);
}
}
}
@@ -376,7 +379,7 @@
}
catch (Exception e)
{
- throw new WebServiceException("Cannot find wsdl-file: " +
wsdlFile, e);
+ throw new WebServiceException(BundleUtils.getMessage(bundle,
"CANNOT_FIND_WSDL-FILE", wsdlFile), e);
}
}
}
Added: spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/webservices/Message.properties
===================================================================
--- spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/webservices/Message.properties
(rev 0)
+++
spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/webservices/Message.properties 2011-06-22
06:38:21 UTC (rev 14598)
@@ -0,0 +1,7 @@
+CANNOT_GET_PORT_COMPONENT_NAME=Cannot get port component name {0}, we have: {1}
+FAILED_TO_UNMARSHALL=Failed to unmarshall:{0}
+UNEXPECTED_ELEMENT=Unexpected element: {0}
+UNEXPECTED_END_TAG=Unexpected end tag: {0}
+REACHED_END_OF_XML_DOCUMENT_UNEXPECTEDLY=Reached end of xml document unexpectedly
+ELEMENT_IN_WEBSERVICES.XML_NOT_NAMESPACE_QUALIFIED=<wsdl-port> element in
webservices.xml not namespace qualified: {0}
+ONLY_ALL_ANONYMOUS_OR_NON_ANONYMOUS_STRINGS_ARE_ALLOWED=Only ALL, ANONYMOUS or
NON_ANONYMOUS strings are allowed
Modified:
spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/webservices/PortComponentMetaData.java
===================================================================
---
spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/webservices/PortComponentMetaData.java 2011-06-21
11:31:52 UTC (rev 14597)
+++
spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/webservices/PortComponentMetaData.java 2011-06-22
06:38:21 UTC (rev 14598)
@@ -23,10 +23,12 @@
import java.util.ArrayList;
import java.util.List;
+import java.util.ResourceBundle;
import javax.xml.namespace.QName;
import org.jboss.logging.Logger;
+import org.jboss.ws.api.util.BundleUtils;
import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedHandlerChainsMetaData;
import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedHandlerMetaData;
@@ -43,6 +45,7 @@
*/
public class PortComponentMetaData
{
+ private static final ResourceBundle bundle =
BundleUtils.getBundle(PortComponentMetaData.class);
/**
* The index of the webservice-description in webservices.xml
*/
@@ -122,7 +125,7 @@
public void setWsdlPort(QName wsdlPort)
{
if (wsdlPort.getNamespaceURI().length() == 0)
- log.warn("<wsdl-port> element in webservices.xml not namespace
qualified: " + wsdlPort);
+ log.warn(BundleUtils.getMessage(bundle,
"ELEMENT_IN_WEBSERVICES.XML_NOT_NAMESPACE_QUALIFIED", wsdlPort));
this.wsdlPort = wsdlPort;
}
@@ -208,7 +211,7 @@
public void setAddressingResponses(final String responsesTypes)
{
if (!"ANONYMOUS".equals(responsesTypes) &&
!"NON_ANONYMOUS".equals(responsesTypes) &&
!"ALL".equals(responsesTypes))
- throw new IllegalArgumentException("Only ALL, ANONYMOUS or NON_ANONYMOUS
strings are allowed");
+ throw new IllegalArgumentException(BundleUtils.getMessage(bundle,
"ONLY_ALL,_ANONYMOUS_OR_NON_ANONYMOUS_STRINGS_ARE_ALLOWED"));
this.addressingResponses = responsesTypes;
}
Modified:
spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/webservices/WebserviceDescriptionMetaData.java
===================================================================
---
spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/webservices/WebserviceDescriptionMetaData.java 2011-06-21
11:31:52 UTC (rev 14597)
+++
spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/webservices/WebserviceDescriptionMetaData.java 2011-06-22
06:38:21 UTC (rev 14598)
@@ -22,6 +22,8 @@
package org.jboss.wsf.spi.metadata.webservices;
import java.util.ArrayList;
+import java.util.ResourceBundle;
+import org.jboss.ws.api.util.BundleUtils;
import java.util.Collection;
import java.util.HashMap;
import java.util.Map;
@@ -38,6 +40,7 @@
*/
public class WebserviceDescriptionMetaData
{
+ private static final ResourceBundle bundle =
BundleUtils.getBundle(WebserviceDescriptionMetaData.class);
// provide logging
private static final Logger log =
Logger.getLogger(WebserviceDescriptionMetaData.class);
@@ -113,7 +116,7 @@
pcNames.add(wsdlPortName);
}
- log.error("Cannot get port component name '" + name + "', we
have: " + pcNames);
+ log.error(BundleUtils.getMessage(bundle,
"CANNOT_GET_PORT_COMPONENT_NAME", new Object[]{ name , pcNames}));
return null;
}
Modified:
spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/webservices/WebservicesFactory.java
===================================================================
---
spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/webservices/WebservicesFactory.java 2011-06-21
11:31:52 UTC (rev 14597)
+++
spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/webservices/WebservicesFactory.java 2011-06-22
06:38:21 UTC (rev 14598)
@@ -57,13 +57,14 @@
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
+import java.util.ResourceBundle;
import javax.xml.stream.XMLStreamConstants;
import javax.xml.stream.XMLStreamException;
import javax.xml.stream.XMLStreamReader;
import javax.xml.ws.WebServiceException;
-import org.jboss.logging.Logger;
+import org.jboss.ws.api.util.BundleUtils;
import org.jboss.wsf.spi.deployment.UnifiedVirtualFile;
import org.jboss.wsf.spi.metadata.AbstractHandlerChainsMetaDataParser;
import org.jboss.wsf.spi.util.StAXUtils;
@@ -76,6 +77,7 @@
*/
public class WebservicesFactory extends AbstractHandlerChainsMetaDataParser
{
+ private static final ResourceBundle bundle =
BundleUtils.getBundle(WebservicesFactory.class);
// The URL to the webservices.xml descriptor
private URL descriptorURL;
@@ -138,7 +140,7 @@
}
catch (Exception e)
{
- throw new WebServiceException("Failed to unmarshall " + wsddUrl +
":" + e.getMessage(), e);
+ throw new WebServiceException(BundleUtils.getMessage(bundle,
"FAILED_TO_UNMARSHALL", wsddUrl), e);
}
finally
{
@@ -202,7 +204,7 @@
}
else
{
- throw new IllegalStateException("Unexpected element: " +
reader.getLocalName());
+ throw new IllegalStateException(BundleUtils.getMessage(bundle,
"UNEXPECTED_ELEMENT", reader.getLocalName()));
}
}
}
@@ -223,7 +225,7 @@
}
else
{
- throw new IllegalStateException("Unexpected end tag: " +
reader.getLocalName());
+ throw new IllegalStateException(BundleUtils.getMessage(bundle,
"UNEXPECTED_END_TAG", reader.getLocalName()));
}
}
case XMLStreamConstants.START_ELEMENT : {
@@ -232,12 +234,12 @@
}
else
{
- throw new IllegalStateException("Unexpected element: " +
reader.getLocalName());
+ throw new IllegalStateException(BundleUtils.getMessage(bundle,
"UNEXPECTED_ELEMENT", reader.getLocalName()));
}
}
}
}
- throw new IllegalStateException("Reached end of xml document
unexpectedly");
+ throw new IllegalStateException(BundleUtils.getMessage(bundle,
"REACHED_END_OF_XML_DOCUMENT_UNEXPECTEDLY"));
}
private WebserviceDescriptionMetaData parseWebserviceDescription(XMLStreamReader
reader, String nsUri, WebservicesMetaData wsMetaData) throws XMLStreamException
@@ -254,7 +256,7 @@
}
else
{
- throw new IllegalStateException("Unexpected end tag: " +
reader.getLocalName());
+ throw new IllegalStateException(BundleUtils.getMessage(bundle,
"UNEXPECTED_END_TAG", reader.getLocalName()));
}
}
case XMLStreamConstants.START_ELEMENT : {
@@ -272,12 +274,12 @@
}
else
{
- throw new IllegalStateException("Unexpected element: " +
reader.getLocalName());
+ throw new IllegalStateException(BundleUtils.getMessage(bundle,
"UNEXPECTED_ELEMENT", reader.getLocalName()));
}
}
}
}
- throw new IllegalStateException("Reached end of xml document
unexpectedly");
+ throw new IllegalStateException(BundleUtils.getMessage(bundle,
"REACHED_END_OF_XML_DOCUMENT_UNEXPECTEDLY"));
}
private PortComponentMetaData parsePortComponent(XMLStreamReader reader, String nsUri,
WebserviceDescriptionMetaData desc) throws XMLStreamException
@@ -294,7 +296,7 @@
}
else
{
- throw new IllegalStateException("Unexpected end tag: " +
reader.getLocalName());
+ throw new IllegalStateException(BundleUtils.getMessage(bundle,
"UNEXPECTED_END_TAG", reader.getLocalName()));
}
}
case XMLStreamConstants.START_ELEMENT : {
@@ -336,12 +338,12 @@
}
else
{
- throw new IllegalStateException("Unexpected element: " +
reader.getLocalName());
+ throw new IllegalStateException(BundleUtils.getMessage(bundle,
"UNEXPECTED_ELEMENT", reader.getLocalName()));
}
}
}
}
- throw new IllegalStateException("Reached end of xml document
unexpectedly");
+ throw new IllegalStateException(BundleUtils.getMessage(bundle,
"REACHED_END_OF_XML_DOCUMENT_UNEXPECTEDLY"));
}
private void parseAddressing(XMLStreamReader reader, String nsUri,
PortComponentMetaData pc) throws XMLStreamException
@@ -357,7 +359,7 @@
}
else
{
- throw new IllegalStateException("Unexpected end tag: " +
reader.getLocalName());
+ throw new IllegalStateException(BundleUtils.getMessage(bundle,
"UNEXPECTED_END_TAG", reader.getLocalName()));
}
}
case XMLStreamConstants.START_ELEMENT : {
@@ -372,12 +374,12 @@
}
else
{
- throw new IllegalStateException("Unexpected element: " +
reader.getLocalName());
+ throw new IllegalStateException(BundleUtils.getMessage(bundle,
"UNEXPECTED_ELEMENT", reader.getLocalName()));
}
}
}
}
- throw new IllegalStateException("Reached end of xml document
unexpectedly");
+ throw new IllegalStateException(BundleUtils.getMessage(bundle,
"REACHED_END_OF_XML_DOCUMENT_UNEXPECTEDLY"));
}
private void parseRespectBinding(XMLStreamReader reader, String nsUri,
PortComponentMetaData pc) throws XMLStreamException
@@ -393,7 +395,7 @@
}
else
{
- throw new IllegalStateException("Unexpected end tag: " +
reader.getLocalName());
+ throw new IllegalStateException(BundleUtils.getMessage(bundle,
"UNEXPECTED_END_TAG", reader.getLocalName()));
}
}
case XMLStreamConstants.START_ELEMENT : {
@@ -402,12 +404,12 @@
}
else
{
- throw new IllegalStateException("Unexpected element: " +
reader.getLocalName());
+ throw new IllegalStateException(BundleUtils.getMessage(bundle,
"UNEXPECTED_ELEMENT", reader.getLocalName()));
}
}
}
}
- throw new IllegalStateException("Reached end of xml document
unexpectedly");
+ throw new IllegalStateException(BundleUtils.getMessage(bundle,
"REACHED_END_OF_XML_DOCUMENT_UNEXPECTEDLY"));
}
private void parseServiceImplBean(XMLStreamReader reader, String nsUri,
PortComponentMetaData pc) throws XMLStreamException
@@ -423,7 +425,7 @@
}
else
{
- throw new IllegalStateException("Unexpected end tag: " +
reader.getLocalName());
+ throw new IllegalStateException(BundleUtils.getMessage(bundle,
"UNEXPECTED_END_TAG", reader.getLocalName()));
}
}
case XMLStreamConstants.START_ELEMENT : {
@@ -435,12 +437,12 @@
}
else
{
- throw new IllegalStateException("Unexpected element: " +
reader.getLocalName());
+ throw new IllegalStateException(BundleUtils.getMessage(bundle,
"UNEXPECTED_ELEMENT", reader.getLocalName()));
}
}
}
}
- throw new IllegalStateException("Reached end of xml document
unexpectedly");
+ throw new IllegalStateException(BundleUtils.getMessage(bundle,
"REACHED_END_OF_XML_DOCUMENT_UNEXPECTEDLY"));
}
public URL getDescriptorURL()
Added: spi/trunk/src/main/java/org/jboss/wsf/spi/util/Message.properties
===================================================================
--- spi/trunk/src/main/java/org/jboss/wsf/spi/util/Message.properties
(rev 0)
+++ spi/trunk/src/main/java/org/jboss/wsf/spi/util/Message.properties 2011-06-22 06:38:21
UTC (rev 14598)
@@ -0,0 +1,5 @@
+CANNOT_GET_URL_FOR=Cannot get URL for: {0}
+CANNOT_GET_CHILDREN_FOR_RESOURCE=Cannot get children for resource: {0}
+CANNOT_GET_NAME_FOR_RESOURCE=Cannot get name for resource: {0}
+READING_EXTERNAL_ENTITIES_IS_DISABLED=Reading external entities is disabled
+COULDN'T_PARSE_STREAM=Couldn't parse stream
Modified: spi/trunk/src/main/java/org/jboss/wsf/spi/util/StAXUtils.java
===================================================================
--- spi/trunk/src/main/java/org/jboss/wsf/spi/util/StAXUtils.java 2011-06-21 11:31:52 UTC
(rev 14597)
+++ spi/trunk/src/main/java/org/jboss/wsf/spi/util/StAXUtils.java 2011-06-22 06:38:21 UTC
(rev 14598)
@@ -22,6 +22,7 @@
package org.jboss.wsf.spi.util;
import java.io.InputStream;
+import java.util.ResourceBundle;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.LinkedBlockingQueue;
@@ -31,6 +32,8 @@
import javax.xml.stream.XMLStreamException;
import javax.xml.stream.XMLStreamReader;
+import org.jboss.ws.api.util.BundleUtils;
+
/**
* StAX utils
*
@@ -39,6 +42,7 @@
*/
public class StAXUtils
{
+ private static final ResourceBundle bundle = BundleUtils.getBundle(StAXUtils.class);
private static final BlockingQueue<XMLInputFactory> INPUT_FACTORY_POOL;
static
@@ -77,7 +81,7 @@
public Object resolveEntity(String publicID, String systemID, String baseURI,
String namespace)
throws XMLStreamException
{
- throw new XMLStreamException("Reading external entities is
disabled");
+ throw new XMLStreamException(BundleUtils.getMessage(bundle,
"READING_EXTERNAL_ENTITIES_IS_DISABLED"));
}
});
return factory;
@@ -107,7 +111,7 @@
}
catch (XMLStreamException e)
{
- throw new RuntimeException("Couldn't parse stream.", e);
+ throw new RuntimeException(BundleUtils.getMessage(bundle,
"COULDN'T_PARSE_STREAM"), e);
}
finally
{
@@ -184,7 +188,7 @@
}
catch (XMLStreamException e)
{
- throw new RuntimeException("Couldn't parse stream.", e);
+ throw new RuntimeException(BundleUtils.getMessage(bundle,
"COULDN'T_PARSE_STREAM"), e);
}
}
}
Modified: spi/trunk/src/main/java/org/jboss/wsf/spi/util/URLLoaderAdapter.java
===================================================================
--- spi/trunk/src/main/java/org/jboss/wsf/spi/util/URLLoaderAdapter.java 2011-06-21
11:31:52 UTC (rev 14597)
+++ spi/trunk/src/main/java/org/jboss/wsf/spi/util/URLLoaderAdapter.java 2011-06-22
06:38:21 UTC (rev 14598)
@@ -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;
}