JBossWS SVN: r14609 - stack/cxf/trunk/modules/testsuite.
by jbossws-commits@lists.jboss.org
Author: richard.opalka(a)jboss.com
Date: 2011-06-23 03:48:13 -0400 (Thu, 23 Jun 2011)
New Revision: 14609
Modified:
stack/cxf/trunk/modules/testsuite/pom.xml
Log:
[JBWS-3321] enabling test
Modified: stack/cxf/trunk/modules/testsuite/pom.xml
===================================================================
--- stack/cxf/trunk/modules/testsuite/pom.xml 2011-06-23 04:47:54 UTC (rev 14608)
+++ stack/cxf/trunk/modules/testsuite/pom.xml 2011-06-23 07:48:13 UTC (rev 14609)
@@ -1072,9 +1072,6 @@
<!-- # [JBWS-3306] No XPathFactory implementation found by a JAXWS client on AS7 -->
<exclude>org/jboss/test/ws/jaxws/samples/exception/ExceptionServletTestCase*</exclude>
- <!-- # [JBWS-3321] Enhance ModelDA to generate compatible PathElements -->
- <exclude>org/jboss/test/ws/jaxws/cxf/descriptor/DescriptorJSETestCase*</exclude>
-
<!-- JAXR not available -->
<exclude>org/jboss/test/ws/jaxws/samples/jaxr/**</exclude>
13 years, 6 months
JBossWS SVN: r14608 - in stack/cxf/trunk/modules/server: src/main/java/org/jboss/wsf/stack/cxf and 9 other directories.
by jbossws-commits@lists.jboss.org
Author: jim.ma
Date: 2011-06-23 00:47:54 -0400 (Thu, 23 Jun 2011)
New Revision: 14608
Added:
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/Message.properties
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/config/Message.properties
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/Message.properties
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/Message.properties
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/aspect/Message.properties
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/metadata/Message.properties
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/resolver/Message.properties
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/security/authentication/Message.properties
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/spring/handler/Message.properties
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/transport/Message.properties
Modified:
stack/cxf/trunk/modules/server/pom.xml
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/RequestHandlerImpl.java
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/config/CXFInitializer.java
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/NonSpringBusHolder.java
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/ServerBeanCustomizer.java
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/SpringBusHolder.java
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/EndpointImpl.java
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/WSDLFilePublisher.java
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/aspect/DescriptorDeploymentAspect.java
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/metadata/MetadataBuilder.java
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/resolver/JBossWSResourceResolver.java
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/security/authentication/SubjectCreator.java
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/spring/handler/NamespaceHandlerResolver.java
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/transport/ServletHelper.java
Log:
[JBWS-3316]:i18n logging and message
Modified: stack/cxf/trunk/modules/server/pom.xml
===================================================================
--- stack/cxf/trunk/modules/server/pom.xml 2011-06-23 03:27:08 UTC (rev 14607)
+++ stack/cxf/trunk/modules/server/pom.xml 2011-06-23 04:47:54 UTC (rev 14608)
@@ -262,6 +262,12 @@
<targetPath>.</targetPath>
<directory>src/main/resources/jbossws-cxf-server.jar</directory>
</resource>
+ <resource>
+ <directory>src/main/java</directory>
+ <includes>
+ <include>**/*.properties</include>
+ </includes>
+ </resource>
</resources>
<plugins>
<plugin>
Added: stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/Message.properties
===================================================================
--- stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/Message.properties (rev 0)
+++ stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/Message.properties 2011-06-23 04:47:54 UTC (rev 14608)
@@ -0,0 +1,3 @@
+CANNOT_OBTAIN_REGISTRY=Cannot obtain DestinationRegistry!
+CANNOT_OBTAIN_DESTINATION=Cannot obtain destination for: {0}
+CANNOT_GET_DESTINATIONFACTORY=Cannot get DestinationFactory for http transport!
Modified: stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/RequestHandlerImpl.java
===================================================================
--- stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/RequestHandlerImpl.java 2011-06-23 03:27:08 UTC (rev 14607)
+++ stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/RequestHandlerImpl.java 2011-06-23 04:47:54 UTC (rev 14608)
@@ -27,6 +27,7 @@
import java.net.MalformedURLException;
import java.net.URL;
import java.util.Collection;
+import java.util.ResourceBundle;
import javax.servlet.ServletConfig;
import javax.servlet.ServletContext;
@@ -46,6 +47,7 @@
import org.apache.cxf.transports.http.QueryHandler;
import org.apache.cxf.transports.http.QueryHandlerRegistry;
import org.jboss.util.NotImplementedException;
+import org.jboss.ws.api.util.BundleUtils;
import org.jboss.wsf.spi.SPIProvider;
import org.jboss.wsf.spi.SPIProviderResolver;
import org.jboss.wsf.spi.deployment.Endpoint;
@@ -64,6 +66,7 @@
*/
public class RequestHandlerImpl implements RequestHandler
{
+ private static final ResourceBundle bundle = BundleUtils.getBundle(RequestHandlerImpl.class);
private ServerConfig serverConfig;
RequestHandlerImpl()
@@ -125,7 +128,7 @@
DestinationRegistry destRegistry = getDestinationRegistryFromBus(bus);
if (destRegistry == null)
{
- throw new ServletException("Cannot obtain DestinationRegistry!");
+ throw new ServletException(BundleUtils.getMessage(bundle, "CANNOT_OBTAIN_REGISTRY"));
}
Collection<AbstractHTTPDestination> destinations = destRegistry.getDestinations();
AbstractHTTPDestination returnValue = null;
@@ -158,7 +161,7 @@
}
if (returnValue == null)
- throw new ServletException("Cannot obtain destination for: " + requestURI);
+ throw new ServletException(BundleUtils.getMessage(bundle, "CANNOT_OBTAIN_DESTINATION", requestURI));
return returnValue;
}
@@ -173,7 +176,7 @@
return transportFactory.getRegistry();
}
} catch (BusException e) {
- throw new ServletException("Cannot get DestinationFactory for http transport!");
+ throw new ServletException(BundleUtils.getMessage(bundle, "CANNOT_GET_DESTINATIONFACTORY"));
}
return null;
}
Modified: stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/config/CXFInitializer.java
===================================================================
--- stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/config/CXFInitializer.java 2011-06-23 03:27:08 UTC (rev 14607)
+++ stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/config/CXFInitializer.java 2011-06-23 04:47:54 UTC (rev 14608)
@@ -21,10 +21,12 @@
*/
package org.jboss.wsf.stack.cxf.config;
+import java.util.ResourceBundle;
import java.util.concurrent.CountDownLatch;
import org.apache.cxf.BusFactory;
import org.jboss.logging.Logger;
+import org.jboss.ws.api.util.BundleUtils;
/**
@@ -36,6 +38,7 @@
*/
public class CXFInitializer
{
+ private static final ResourceBundle bundle = BundleUtils.getBundle(CXFInitializer.class);
private static Logger logger = Logger.getLogger(CXFInitializer.class);
private static CountDownLatch defaultBusCDL = new CountDownLatch(1);
@@ -64,7 +67,7 @@
}
catch (InterruptedException e)
{
- logger.error("Interrupted while waiting for default bus to be set!");
+ logger.error(BundleUtils.getMessage(bundle, "INTERRUPTED"));
throw new RuntimeException(e);
}
}
@@ -98,4 +101,4 @@
}
}
-}
\ No newline at end of file
+}
Added: stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/config/Message.properties
===================================================================
--- stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/config/Message.properties (rev 0)
+++ stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/config/Message.properties 2011-06-23 04:47:54 UTC (rev 14608)
@@ -0,0 +1 @@
+INTERRUPTED=Interrupted while waiting for default bus to be set
Added: stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/Message.properties
===================================================================
--- stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/Message.properties (rev 0)
+++ stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/Message.properties 2011-06-23 04:47:54 UTC (rev 14608)
@@ -0,0 +1,6 @@
+BUS_IS_ALREADY_CONFIGURED=Underlying bus is already configured for JBossWS use
+UNABLE_TO_LOAD_CONFIGURATION=Unable to load configuration from {0}
+COULD_NOT_INITIALIZE_SECURITY_ENGINE=Could not early initialize security engine!
+CANNOT_LOAD_ADDITIONAL_CONFIG=Cannot load additional config from null location!
+COULD_NOT_READ=Could not read from config file: {0}
+UNDERLYING_BUS_IS_ALREADY_CONFIGURED_FOR_JBOSSWS_USE=Underlying bus is already configured for JBossWS use!
Modified: stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/NonSpringBusHolder.java
===================================================================
--- stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/NonSpringBusHolder.java 2011-06-23 03:27:08 UTC (rev 14607)
+++ stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/NonSpringBusHolder.java 2011-06-23 04:47:54 UTC (rev 14608)
@@ -25,6 +25,7 @@
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
+import java.util.ResourceBundle;
import javax.xml.ws.handler.Handler;
import javax.xml.ws.soap.SOAPBinding;
@@ -38,6 +39,7 @@
import org.apache.cxf.ws.addressing.WSAddressingFeature;
import org.apache.cxf.ws.rm.RMManager;
import org.jboss.ws.api.binding.BindingCustomization;
+import org.jboss.ws.api.util.BundleUtils;
import org.jboss.wsf.spi.deployment.Endpoint;
import org.jboss.wsf.spi.deployment.UnifiedVirtualFile;
import org.jboss.wsf.stack.cxf.client.configuration.JBossWSNonSpringBusFactory;
@@ -57,6 +59,7 @@
*/
public class NonSpringBusHolder extends BusHolder
{
+ private static final ResourceBundle bundle = BundleUtils.getBundle(NonSpringBusHolder.class);
private boolean configured = false;
protected DDBeans metadata;
@@ -84,7 +87,7 @@
{
if (configured)
{
- throw new IllegalStateException("Underlying bus is already configured for JBossWS use!");
+ throw new IllegalStateException(BundleUtils.getMessage(bundle, "BUS_IS_ALREADY_CONFIGURED"));
}
super.configure(soapTransportFactory, resolver, configurer);
Modified: stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/ServerBeanCustomizer.java
===================================================================
--- stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/ServerBeanCustomizer.java 2011-06-23 03:27:08 UTC (rev 14607)
+++ stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/ServerBeanCustomizer.java 2011-06-23 04:47:54 UTC (rev 14608)
@@ -23,9 +23,11 @@
import java.io.IOException;
import java.util.List;
+import java.util.ResourceBundle;
import org.apache.cxf.frontend.ServerFactoryBean;
import org.jboss.ws.api.annotation.EndpointConfig;
+import org.jboss.ws.api.util.BundleUtils;
import org.jboss.wsf.spi.SPIProvider;
import org.jboss.wsf.spi.SPIProviderResolver;
import org.jboss.wsf.spi.classloading.ClassLoaderProvider;
@@ -47,6 +49,7 @@
*/
public class ServerBeanCustomizer extends BeanCustomizer
{
+ private static final ResourceBundle bundle = BundleUtils.getBundle(ServerBeanCustomizer.class);
private static ServerConfig serverConfig;
private WSDLFilePublisher wsdlPublisher;
@@ -143,7 +146,7 @@
}
catch (IOException e)
{
- throw new RuntimeException("Could not read from config file: " + configFile);
+ throw new RuntimeException(BundleUtils.getMessage(bundle, "COULD_NOT_READ", configFile));
}
}
}
Modified: stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/SpringBusHolder.java
===================================================================
--- stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/SpringBusHolder.java 2011-06-23 03:27:08 UTC (rev 14607)
+++ stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/SpringBusHolder.java 2011-06-23 04:47:54 UTC (rev 14608)
@@ -26,6 +26,7 @@
import java.net.URL;
import java.util.LinkedList;
import java.util.List;
+import java.util.ResourceBundle;
import org.apache.cxf.Bus;
import org.apache.cxf.binding.soap.SoapTransportFactory;
@@ -37,6 +38,7 @@
import org.apache.ws.security.WSSConfig;
import org.jboss.logging.Logger;
import org.jboss.ws.api.binding.BindingCustomization;
+import org.jboss.ws.api.util.BundleUtils;
import org.jboss.wsf.spi.deployment.Endpoint;
import org.jboss.wsf.spi.deployment.UnifiedVirtualFile;
import org.jboss.wsf.stack.cxf.client.configuration.JBossWSSpringBusFactory;
@@ -57,6 +59,7 @@
*/
public class SpringBusHolder extends BusHolder
{
+ private static final ResourceBundle bundle = BundleUtils.getBundle(SpringBusHolder.class);
private static final Logger log = Logger.getLogger(BusHolder.class);
private boolean configured = false;
@@ -115,7 +118,7 @@
{
if (configured)
{
- throw new IllegalStateException("Underlying bus is already configured for JBossWS use!");
+ throw new IllegalStateException(BundleUtils.getMessage(bundle, "BUS_IS_ALREADY_CONFIGURED"));
}
super.configure(soapTransportFactory, resolver, configurer);
if (additionalLocations != null)
@@ -128,7 +131,7 @@
}
catch (IOException e)
{
- throw new RuntimeException("Unable to load configuration from " + jbossCxfXml, e);
+ throw new RuntimeException(BundleUtils.getMessage(bundle, "UNABLE_TO_LOAD_CONFIGURATION", jbossCxfXml), e);
}
}
}
@@ -140,7 +143,7 @@
}
catch (Exception e)
{
- log.warn("Could not early initialize security engine!");
+ log.warn(BundleUtils.getMessage(bundle, "COULD_NOT_INITIALIZE_SECURITY_ENGINE"));
if (log.isTraceEnabled())
{
log.trace("Error while getting default WSSConfig: ", e);
@@ -170,7 +173,7 @@
throws IOException
{
if (locationUrl == null)
- throw new IllegalArgumentException("Cannot load additional config from null location!");
+ throw new IllegalArgumentException(BundleUtils.getMessage(bundle, "CANNOT_LOAD_ADDITIONAL_CONFIG"));
InputStream is = locationUrl.openStream();
GenericApplicationContext childCtx = new GenericApplicationContext(ctx);
XmlBeanDefinitionReader reader = new XmlBeanDefinitionReader(childCtx);
Modified: stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/EndpointImpl.java
===================================================================
--- stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/EndpointImpl.java 2011-06-23 03:27:08 UTC (rev 14607)
+++ stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/EndpointImpl.java 2011-06-23 04:47:54 UTC (rev 14608)
@@ -26,6 +26,7 @@
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
+import java.util.ResourceBundle;
import javax.xml.namespace.QName;
import javax.xml.ws.handler.Handler;
@@ -37,6 +38,7 @@
import org.apache.cxf.jaxws.support.JaxWsImplementorInfo;
import org.apache.cxf.service.Service;
import org.jboss.logging.Logger;
+import org.jboss.ws.api.util.BundleUtils;
import org.jboss.ws.common.utils.DelegateClassLoader;
import org.jboss.wsf.spi.classloading.ClassLoaderProvider;
import org.jboss.wsf.spi.metadata.config.CommonConfig;
@@ -53,6 +55,7 @@
*/
public class EndpointImpl extends org.apache.cxf.jaxws22.EndpointImpl
{
+ private static final ResourceBundle bundle = BundleUtils.getBundle(EndpointImpl.class);
private WSDLFilePublisher wsdlPublisher;
private CommonConfig config;
@@ -128,13 +131,13 @@
if (handlerChain.getPortNamePattern() != null || handlerChain.getProtocolBindings() != null
|| handlerChain.getServiceNamePattern() != null)
{
- Logger.getLogger(this.getClass()).warn("PortNamePattern, ServiceNamePattern and ProtocolBindings filters not supported; adding handlers anyway.");
+ Logger.getLogger(this.getClass()).warn(BundleUtils.getMessage(bundle, "FILTERS_NOT_SUPPORTED"));
}
for (UnifiedHandlerMetaData uhmd : handlerChain.getHandlers())
{
if (uhmd.getInitParams() != null && !uhmd.getInitParams().isEmpty())
{
- Logger.getLogger(this.getClass()).warn("Init params not supported.");
+ Logger.getLogger(this.getClass()).warn(BundleUtils.getMessage(bundle, "INIT_PARAMS_NOT_SUPPORTED"));
}
Object h = newInstance(uhmd.getHandlerClass());
if (h != null)
@@ -145,7 +148,7 @@
}
else
{
- throw new RuntimeException(h + " is not a JAX-WS Handler instance!");
+ throw new RuntimeException(BundleUtils.getMessage(bundle, "NOT_HANDLER_INSTANCE", h));
}
}
}
@@ -165,7 +168,7 @@
}
catch (Exception e)
{
- Logger.getLogger(EndpointImpl.class).warnf(e, "Could not add handler '%s' as part of endpoint configuration", className);
+ Logger.getLogger(EndpointImpl.class).warnf(e, BundleUtils.getMessage(bundle, "CAN_NOT_ADD_HANDLER" , className));
return null;
}
}
@@ -234,12 +237,12 @@
}
catch (IOException ioe)
{
- throw new RuntimeException("Error while publishing wsdl for service " + service.getName(), ioe);
+ throw new RuntimeException(BundleUtils.getMessage(bundle, "PUBLISHING_WSDL_ERROR", service.getName()), ioe);
}
}
else
{
- Logger.getLogger(this.getClass()).warn("WSDLPublisher not configured, unable to publish contract!");
+ Logger.getLogger(this.getClass()).warn(BundleUtils.getMessage(bundle, "UNABLE_TO_PUBLISH_CONTRACT"));
}
}
Added: stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/Message.properties
===================================================================
--- stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/Message.properties (rev 0)
+++ stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/Message.properties 2011-06-23 04:47:54 UTC (rev 14608)
@@ -0,0 +1,9 @@
+FILTERS_NOT_SUPPORTED=PortNamePattern, ServiceNamePattern and ProtocolBindings filters not supported; adding handlers anyway.
+INIT_PARAMS_NOT_SUPPORTED=Init params not supported.
+PUBLISHING_WSDL_ERROR=Error while publishing wsdl for service {0}
+UNABLE_TO_PUBLISH_CONTRACT=WSDLPublisher not configured, unable to publish contract
+WSDL20_NOT_SUPPORTED=WSDL-2.0 imports
+CANNOT_PUBLISH_WSDL=Cannot publish wsdl to: {0}
+CANNOT_GET_PUBLISH_LOCATION=Cannot get wsdl publish location for null wsdl location and serviceName
+NOT_HANDLER_INSTANCE={0} is not a JAX-WS Handler instance
+CAN_NOT_ADD_HANDLER=Could not add handler {0} as part of endpoint configuration"
Modified: stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/WSDLFilePublisher.java
===================================================================
--- stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/WSDLFilePublisher.java 2011-06-23 03:27:08 UTC (rev 14607)
+++ stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/WSDLFilePublisher.java 2011-06-23 04:47:54 UTC (rev 14608)
@@ -27,6 +27,7 @@
import java.net.URL;
import java.util.LinkedList;
import java.util.List;
+import java.util.ResourceBundle;
import javax.wsdl.Definition;
import javax.wsdl.WSDLException;
@@ -42,6 +43,7 @@
import org.apache.cxf.wsdl11.ServiceWSDLBuilder;
import org.jboss.logging.Logger;
import org.jboss.util.NotImplementedException;
+import org.jboss.ws.api.util.BundleUtils;
import org.jboss.ws.common.utils.AbstractWSDLFilePublisher;
import org.jboss.wsf.spi.deployment.ArchiveDeployment;
import org.w3c.dom.Document;
@@ -55,6 +57,7 @@
*/
public class WSDLFilePublisher extends AbstractWSDLFilePublisher
{
+ private static final ResourceBundle bundle = BundleUtils.getBundle(WSDLFilePublisher.class);
private static final Logger log = Logger.getLogger(WSDLFilePublisher.class);
public WSDLFilePublisher(ArchiveDeployment dep)
@@ -92,7 +95,7 @@
}
else
{
- throw new NotImplementedException("WSDL-2.0 imports");
+ throw new NotImplementedException(BundleUtils.getMessage(bundle, "WSDL20_NOT_SUPPORTED"));
}
}
catch (RuntimeException rte)
@@ -101,7 +104,7 @@
}
catch (Exception e)
{
- throw new RuntimeException("Cannot publish wsdl to: " + wsdlFile, e);
+ throw new RuntimeException(BundleUtils.getMessage(bundle, "CANNOT_PUBLISH_WSDL", wsdlFile), e);
}
}
@@ -147,7 +150,7 @@
{
if (wsdlLocation == null && serviceName == null)
{
- log.warn("Cannot get wsdl publish location for null wsdl location and serviceName!");
+ log.warn(BundleUtils.getMessage(bundle, "CANNOT_GET_PUBLISH_LOCATION"));
return null;
}
Modified: stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/aspect/DescriptorDeploymentAspect.java
===================================================================
--- stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/aspect/DescriptorDeploymentAspect.java 2011-06-23 03:27:08 UTC (rev 14607)
+++ stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/aspect/DescriptorDeploymentAspect.java 2011-06-23 04:47:54 UTC (rev 14608)
@@ -25,8 +25,10 @@
import java.net.URL;
import java.util.HashMap;
import java.util.Map;
+import java.util.ResourceBundle;
import org.jboss.logging.Logger;
+import org.jboss.ws.api.util.BundleUtils;
import org.jboss.ws.common.integration.AbstractDeploymentAspect;
import org.jboss.ws.common.integration.WSConstants;
import org.jboss.wsf.spi.deployment.ArchiveDeployment;
@@ -45,6 +47,7 @@
*/
public class DescriptorDeploymentAspect extends AbstractDeploymentAspect
{
+ private static final ResourceBundle bundle = BundleUtils.getBundle(DescriptorDeploymentAspect.class);
// provide logging
private static final Logger log = Logger.getLogger(DescriptorDeploymentAspect.class);
@@ -105,7 +108,7 @@
else
{
// only POJO and EJB3 deployments are supported
- throw new IllegalStateException("Unsupported deployment type: " + depType);
+ throw new IllegalStateException(BundleUtils.getMessage(bundle, "UNSUPPORTED_DEPLOYMENT_TYPE", depType));
}
URL cxfURL = null;
Added: stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/aspect/Message.properties
===================================================================
--- stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/aspect/Message.properties (rev 0)
+++ stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/aspect/Message.properties 2011-06-23 04:47:54 UTC (rev 14608)
@@ -0,0 +1 @@
+UNSUPPORTED_DEPLOYMENT_TYPE=Unsupported deployment type: {0}
Added: stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/metadata/Message.properties
===================================================================
--- stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/metadata/Message.properties (rev 0)
+++ stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/metadata/Message.properties 2011-06-23 04:47:54 UTC (rev 14608)
@@ -0,0 +1,6 @@
+FILTERS_NOT_SUPPORTED=PortNamePattern, ServiceNamePattern and ProtocolBindings filters not supported; adding handlers anyway.
+INIT_PARAMS_NOT_SUPPORTED=Init params not supported.
+RUNTIME_LOADER_CANNOT_BE_NULL=Runtime loader cannot be null
+CANNOT_LOAD_SEI_CLASS=Cannot load service endpoint interface class
+WEBSERVICE_ANNOTATION_NOT_FOUND=Interface does not have a @WebService annotation: {0}
+ATTRIBUTES_NOT_FOUND=@WebService cannot have attribute 'portName', 'serviceName', 'endpointInterface' on: {0}
Modified: stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/metadata/MetadataBuilder.java
===================================================================
--- stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/metadata/MetadataBuilder.java 2011-06-23 03:27:08 UTC (rev 14607)
+++ stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/metadata/MetadataBuilder.java 2011-06-23 04:47:54 UTC (rev 14608)
@@ -23,6 +23,7 @@
import java.util.LinkedList;
import java.util.List;
+import java.util.ResourceBundle;
import java.util.Stack;
import java.util.StringTokenizer;
@@ -34,10 +35,10 @@
import javax.xml.ws.soap.SOAPBinding;
import org.jboss.logging.Logger;
+import org.jboss.ws.api.util.BundleUtils;
import org.jboss.ws.common.JavaUtils;
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.metadata.j2ee.serviceref.UnifiedHandlerChainMetaData;
@@ -60,6 +61,7 @@
*/
public class MetadataBuilder
{
+ private static final ResourceBundle bundle = BundleUtils.getBundle(MetadataBuilder.class);
private static final Logger log = Logger.getLogger(MetadataBuilder.class);
public MetadataBuilder()
@@ -189,7 +191,7 @@
if (handlerChain.getPortNamePattern() != null || handlerChain.getProtocolBindings() != null
|| handlerChain.getServiceNamePattern() != null)
{
- log.warn("PortNamePattern, ServiceNamePattern and ProtocolBindings filters not supported; adding handlers anyway.");
+ log.warn(BundleUtils.getMessage(bundle, "FILTERS_NOT_SUPPORTED"));
}
for (UnifiedHandlerMetaData uhmd : handlerChain.getHandlers())
{
@@ -197,7 +199,7 @@
log.debug("Contribute handler from webservices.xml: " + uhmd.getHandlerName());
if (uhmd.getInitParams() != null && !uhmd.getInitParams().isEmpty())
{
- log.warn("Init params not supported.");
+ log.warn(BundleUtils.getMessage(bundle, "INIT_PARAMS_NOT_SUPPORTED"));
}
handlers.add(uhmd.getHandlerClass());
}
@@ -235,7 +237,7 @@
seiName = anWebService.endpointInterface();
ClassLoader runtimeClassLoader = dep.getRuntimeClassLoader();
if(null == runtimeClassLoader)
- throw new IllegalArgumentException("Runtime loader cannot be null");
+ throw new IllegalArgumentException(BundleUtils.getMessage(bundle, "RUNTIME_LOADER_CANNOT_BE_NULL"));
try
{
@@ -243,15 +245,15 @@
}
catch (ClassNotFoundException cnfe)
{
- throw new RuntimeException("Cannot load service endpoint interface class!", cnfe);
+ throw new RuntimeException(BundleUtils.getMessage(bundle, "CANNOT_LOAD_SEI_CLASS"), cnfe);
}
WebService seiAnnotation = seiClass.getAnnotation(WebService.class);
if (seiAnnotation == null)
- throw new RuntimeException("Interface does not have a @WebService annotation: " + seiName);
+ throw new RuntimeException(BundleUtils.getMessage(bundle, "WEBSERVICE_ANNOTATION_NOT_FOUND", seiName));
if (seiAnnotation.portName().length() > 0 || seiAnnotation.serviceName().length() > 0 || seiAnnotation.endpointInterface().length() > 0)
- throw new RuntimeException("@WebService cannot have attribute 'portName', 'serviceName', 'endpointInterface' on: " + seiName);
+ throw new RuntimeException(BundleUtils.getMessage(bundle, "ATTRIBUTES_NOT_FOUND", seiName));
}
Modified: stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/resolver/JBossWSResourceResolver.java
===================================================================
--- stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/resolver/JBossWSResourceResolver.java 2011-06-23 03:27:08 UTC (rev 14607)
+++ stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/resolver/JBossWSResourceResolver.java 2011-06-23 04:47:54 UTC (rev 14608)
@@ -24,9 +24,11 @@
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
+import java.util.ResourceBundle;
import org.apache.cxf.resource.ResourceResolver;
import org.jboss.logging.Logger;
+import org.jboss.ws.api.util.BundleUtils;
/**
* A CXF resource resolver that uses the JBossWS spi resource resolver,
@@ -39,6 +41,7 @@
*/
public class JBossWSResourceResolver implements ResourceResolver
{
+ private static final ResourceBundle bundle = BundleUtils.getBundle(JBossWSResourceResolver.class);
private static Logger log = Logger.getLogger(JBossWSResourceResolver.class);
private org.jboss.wsf.spi.deployment.ResourceResolver resolver;
@@ -58,7 +61,7 @@
}
catch (IOException ioe)
{
- log.warn("Cannot open stream for resource: " + resourcePath);
+ log.warn(BundleUtils.getMessage(bundle, "CANNOT_OPEN_STREAM_FOR_RESOURCE", resourcePath));
}
}
return null;
@@ -73,7 +76,7 @@
}
catch (IOException ioe)
{
- log.warn("Cannot resolve resource: " + resourcePath);
+ log.warn(BundleUtils.getMessage(bundle, "CANNOT_RESOLVE_RESOURCE", resourcePath));
}
if (url != null && resourceType.isInstance(url))
{
Added: stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/resolver/Message.properties
===================================================================
--- stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/resolver/Message.properties (rev 0)
+++ stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/resolver/Message.properties 2011-06-23 04:47:54 UTC (rev 14608)
@@ -0,0 +1,2 @@
+CANNOT_OPEN_STREAM_FOR_RESOURCE=Cannot open stream for resource: {0}
+CANNOT_RESOLVE_RESOURCE=Cannot resolve resource: {0}
Added: stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/security/authentication/Message.properties
===================================================================
--- stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/security/authentication/Message.properties (rev 0)
+++ stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/security/authentication/Message.properties 2011-06-23 04:47:54 UTC (rev 14608)
@@ -0,0 +1,7 @@
+AUTHENTICATION_FAILED=Authentication failed, principal= {0}
+REQUEST_REJECTED_TIMESTAMP=Request rejected since a stale timestamp has been provided: {0}
+REQUEST_REJECTED_SAME_NONCE=Request rejected since a message with the same nonce has been recently received; nonce = {0}
+INVALID_DATE_VALUE_FORMAT=Date value does not follow the format '-'? yyyy '-' mm '-' dd: {0}
+TIME_VALUE_DOES_NOT_FOLLOW_THE_FORMAT_'HH:MM:SS.[S+]'=Time value does not follow the format 'hh:mm:ss.[s+]': {0}
+INVALID_TIME_VALUE_FORMAT=Timezone value does not follow the format ([+/-]HH:MM):
+INVALID_DATATIME_FORMAT=DateTime value does not follow the format '[-]yyyy-mm-ddThh:mm:ss[.s+][timezone]': expected 'T' but got {0}
Modified: stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/security/authentication/SubjectCreator.java
===================================================================
--- stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/security/authentication/SubjectCreator.java 2011-06-23 03:27:08 UTC (rev 14607)
+++ stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/security/authentication/SubjectCreator.java 2011-06-23 04:47:54 UTC (rev 14608)
@@ -23,6 +23,7 @@
import java.security.Principal;
import java.util.Calendar;
+import java.util.ResourceBundle;
import java.util.TimeZone;
import javax.security.auth.Subject;
@@ -31,6 +32,7 @@
import org.apache.cxf.common.security.SimplePrincipal;
import org.jboss.logging.Logger;
import org.jboss.security.auth.callback.CallbackHandlerPolicyContextHandler;
+import org.jboss.ws.api.util.BundleUtils;
import org.jboss.ws.common.utils.DelegateClassLoader;
import org.jboss.wsf.spi.classloading.ClassLoaderProvider;
import org.jboss.wsf.spi.security.SecurityDomainContext;
@@ -47,6 +49,7 @@
*/
public class SubjectCreator
{
+ private static final ResourceBundle bundle = BundleUtils.getBundle(SubjectCreator.class);
private static final Logger log = Logger.getLogger(SubjectCreator.class);
private static final int TIMESTAMP_FRESHNESS_THRESHOLD = 300;
@@ -93,7 +96,7 @@
{
if (ctx.isValid(principal, password, subject) == false)
{
- String msg = "Authentication failed, principal=" + principal.getName();
+ String msg = BundleUtils.getMessage(bundle, "AUTHENTICATION_FAILED", principal.getName());
log.error(msg);
throw new SecurityException(msg);
}
@@ -133,14 +136,13 @@
Calendar ref = Calendar.getInstance();
ref.add(Calendar.SECOND, -timestampThreshold);
if (ref.after(cal))
- throw new SecurityException("Request rejected since a stale timestamp has been provided: " + created);
+ throw new SecurityException(BundleUtils.getMessage(bundle, "REQUEST_REJECTED", created));
}
if (nonce != null && nonceStore != null)
{
if (nonceStore.hasNonce(nonce))
- throw new SecurityException(
- "Request rejected since a message with the same nonce has been recently received; nonce = " + nonce);
+ throw new SecurityException(BundleUtils.getMessage(bundle, "REQUEST_REJECTED_SAME_NONCE", nonce));
nonceStore.putNonce(nonce);
}
}
@@ -173,9 +175,7 @@
int timeInd = parseDate(value, 0, cal);
if (value.charAt(timeInd) != 'T')
{
- throw new IllegalArgumentException(
- "DateTime value does not follow the format '[-]yyyy-mm-ddThh:mm:ss[.s+][timezone]': expected 'T' but got "
- + value.charAt(timeInd));
+ throw new IllegalArgumentException(BundleUtils.getMessage(bundle, "INVALID_DATATIME_FORMAT", value.charAt(timeInd)));
}
int tzStart = parseTime(value, timeInd + 1, cal);
@@ -203,13 +203,13 @@
if (!Character.isDigit(value.charAt(start)))
{
- throw new IllegalArgumentException("Date value does not follow the format '-'? yyyy '-' mm '-' dd: " + value);
+ throw new IllegalArgumentException(BundleUtils.getMessage(bundle, "INVALID_DATE_VALUE_FORMAT", value));
}
int nextToken = value.indexOf('-', start);
if (nextToken == -1 || nextToken - start < 4)
{
- throw new IllegalArgumentException("Date value does not follow the format '-'? yyyy '-' mm '-' dd: " + value);
+ throw new IllegalArgumentException(BundleUtils.getMessage(bundle, "INVALID_DATE_VALUE_FORMAT", value));
}
int year = Integer.parseInt(value.substring(start, nextToken));
@@ -218,7 +218,7 @@
nextToken = value.indexOf('-', start);
if (nextToken == -1 || nextToken - start < 2)
{
- throw new IllegalArgumentException("Date value does not follow the format '-'? yyyy '-' mm '-' dd: " + value);
+ throw new IllegalArgumentException(BundleUtils.getMessage(bundle, "INVALID_DATE_VALUE_FORMAT", value));
}
int month = Integer.parseInt(value.substring(start, nextToken));
@@ -238,7 +238,7 @@
{
if (value.charAt(start + 2) != ':' || value.charAt(start + 5) != ':')
{
- throw new IllegalArgumentException("Time value does not follow the format 'hh:mm:ss.[s+]': " + value);
+ throw new IllegalArgumentException(BundleUtils.getMessage(bundle, "INVALID_TIME_VALUE_FORMAT", value));
}
int hh = Integer.parseInt(value.substring(start, start + 2));
@@ -292,8 +292,7 @@
}
else
{
- throw new NumberFormatException("Timezone value does not follow the format ([+/-]HH:MM): "
- + value.substring(start));
+ throw new NumberFormatException(BundleUtils.getMessage(bundle, "INVALID_TIME_VALUE_FORMAT", value.substring(start)));
}
}
else if (value.charAt(start) == 'Z')
@@ -302,8 +301,7 @@
}
else
{
- throw new NumberFormatException("Timezone value does not follow the format ([+/-]HH:MM): "
- + value.substring(start));
+ throw new NumberFormatException(BundleUtils.getMessage(bundle, "INVALID_TIME_VALUE_FORMAT", value.substring(start)));
}
return tz;
}
Added: stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/spring/handler/Message.properties
===================================================================
--- stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/spring/handler/Message.properties (rev 0)
+++ stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/spring/handler/Message.properties 2011-06-23 04:47:54 UTC (rev 14608)
@@ -0,0 +1,3 @@
+INVALID_NAMESPACEHANDLER_CLASS=Invalid NamespaceHandler class {0} for namespace {1} : problem with handler class file or dependent class
+NOT_IMPLEMENT_NSHANDLER_INTERFACE=Class {0} for namespace {1} does not implement the {2} interface
+NSHANDLER_CLASS_NOT_FOUND=NamespaceHandler class {0} for namespace {1} not found
Modified: stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/spring/handler/NamespaceHandlerResolver.java
===================================================================
--- stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/spring/handler/NamespaceHandlerResolver.java 2011-06-23 03:27:08 UTC (rev 14607)
+++ stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/spring/handler/NamespaceHandlerResolver.java 2011-06-23 04:47:54 UTC (rev 14608)
@@ -25,8 +25,10 @@
import java.util.HashMap;
import java.util.Map;
import java.util.Properties;
+import java.util.ResourceBundle;
import org.jboss.logging.Logger;
+import org.jboss.ws.api.util.BundleUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.FatalBeanException;
import org.springframework.beans.factory.xml.DefaultNamespaceHandlerResolver;
@@ -46,6 +48,7 @@
*/
public class NamespaceHandlerResolver extends DefaultNamespaceHandlerResolver
{
+ private static final ResourceBundle bundle = BundleUtils.getBundle(NamespaceHandlerResolver.class);
public static final String JBOSSWS_HANDLER_MAPPINGS_LOCATION = "META-INF/jbossws.spring.handlers";
private static final Logger logger = Logger.getLogger(NamespaceHandlerResolver.class);
@@ -107,8 +110,8 @@
Class<?> handlerClass = ClassUtils.forName(className, this.loader);
if (!NamespaceHandler.class.isAssignableFrom(handlerClass))
{
- throw new FatalBeanException("Class [" + className + "] for namespace [" + namespaceUri
- + "] does not implement the [" + NamespaceHandler.class.getName() + "] interface");
+ throw new FatalBeanException(BundleUtils.getMessage(bundle, "NOT_IMPLEMENT_NSHANDLER_INTERFACE",
+ new Object[]{className, namespaceUri, NamespaceHandler.class.getName()}));
}
NamespaceHandler namespaceHandler = (NamespaceHandler) BeanUtils.instantiateClass(handlerClass);
namespaceHandler.init();
@@ -117,13 +120,13 @@
}
catch (ClassNotFoundException ex)
{
- throw new FatalBeanException("NamespaceHandler class [" + className + "] for namespace [" + namespaceUri
- + "] not found", ex);
+ throw new FatalBeanException(BundleUtils.getMessage(bundle, "NSHANDLER_CLASS_NOT_FOUND",
+ new Object[]{className, namespaceUri}), ex);
}
catch (LinkageError err)
{
- throw new FatalBeanException("Invalid NamespaceHandler class [" + className + "] for namespace ["
- + namespaceUri + "]: problem with handler class file or dependent class", err);
+ throw new FatalBeanException(BundleUtils.getMessage(bundle, "INVALID_NAMESPACEHANDLER_CLASS",
+ new Object[]{className, namespaceUri} ), err);
}
}
}
Added: stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/transport/Message.properties
===================================================================
--- stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/transport/Message.properties (rev 0)
+++ stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/transport/Message.properties 2011-06-23 04:47:54 UTC (rev 14608)
@@ -0,0 +1 @@
+CANNOT_OBTAIN_ENDPOINT=Cannot obtain endpoint for: {0}
Modified: stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/transport/ServletHelper.java
===================================================================
--- stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/transport/ServletHelper.java 2011-06-23 03:27:08 UTC (rev 14607)
+++ stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/transport/ServletHelper.java 2011-06-23 04:47:54 UTC (rev 14608)
@@ -24,6 +24,7 @@
import java.io.IOException;
import java.lang.reflect.Method;
import java.util.List;
+import java.util.ResourceBundle;
import javax.management.ObjectName;
import javax.naming.Context;
@@ -41,13 +42,14 @@
import org.apache.cxf.jaxws.support.JaxWsEndpointImpl;
import org.apache.cxf.management.InstrumentationManager;
import org.apache.cxf.management.counters.CounterRepository;
+import org.jboss.ws.api.util.BundleUtils;
import org.jboss.ws.common.ObjectNameFactory;
import org.jboss.ws.common.injection.InjectionHelper;
import org.jboss.wsf.spi.SPIProvider;
import org.jboss.wsf.spi.SPIProviderResolver;
import org.jboss.wsf.spi.classloading.ClassLoaderProvider;
+import org.jboss.wsf.spi.deployment.Deployment.DeploymentType;
import org.jboss.wsf.spi.deployment.Endpoint;
-import org.jboss.wsf.spi.deployment.Deployment.DeploymentType;
import org.jboss.wsf.spi.invocation.EndpointAssociation;
import org.jboss.wsf.spi.invocation.RequestHandler;
import org.jboss.wsf.spi.management.EndpointRegistry;
@@ -63,6 +65,7 @@
*/
public class ServletHelper
{
+ private static final ResourceBundle bundle = BundleUtils.getBundle(ServletHelper.class);
public static final String ENABLE_CXF_MANAGEMENT = "enable.cxf.management";
public static Endpoint initEndpoint(ServletConfig servletConfig, String servletName)
@@ -100,7 +103,7 @@
{
ObjectName oname = ObjectNameFactory.create(Endpoint.SEPID_DOMAIN + ":" + 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", oname));
}
//Inject the EJB and JNDI resources if possible
13 years, 6 months
JBossWS SVN: r14607 - in stack/cxf/trunk: modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration and 4 other directories.
by jbossws-commits@lists.jboss.org
Author: jim.ma
Date: 2011-06-22 23:27:08 -0400 (Wed, 22 Jun 2011)
New Revision: 14607
Added:
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/Message.properties
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/serviceref/Message.properties
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/extensions/addressing/map/Message.properties
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/saaj/Message.properties
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/tools/Message.properties
Modified:
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/JBossWSSpringConfigurer.java
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/serviceref/CXFHandlerResolverImpl.java
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/serviceref/CXFServiceRefBinderJAXRPC.java
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/serviceref/CXFServiceRefStubPropertyConfigurer.java
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/extensions/addressing/map/CXFMAP.java
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/saaj/SOAPConnectionImpl.java
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/tools/CXFConsumerImpl.java
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/tools/CXFProviderImpl.java
stack/cxf/trunk/pom.xml
Log:
[JBWS-3316]:i18n logging and message
Modified: stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/JBossWSSpringConfigurer.java
===================================================================
--- stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/JBossWSSpringConfigurer.java 2011-06-23 02:56:41 UTC (rev 14606)
+++ stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/JBossWSSpringConfigurer.java 2011-06-23 03:27:08 UTC (rev 14607)
@@ -21,9 +21,12 @@
*/
package org.jboss.wsf.stack.cxf.client.configuration;
+import java.util.ResourceBundle;
+
import org.apache.cxf.configuration.Configurer;
import org.apache.cxf.configuration.spring.ConfigurerImpl;
import org.apache.cxf.extension.BusExtension;
+import org.jboss.ws.api.util.BundleUtils;
import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
@@ -37,6 +40,7 @@
*/
public class JBossWSSpringConfigurer implements JBossWSConfigurer, ApplicationContextAware, BusExtension
{
+ private static final ResourceBundle bundle = BundleUtils.getBundle(JBossWSSpringConfigurer.class);
private BeanCustomizer customizer;
private Configurer delegate;
@@ -92,7 +96,7 @@
{
return ((BusExtension)delegate).getRegistrationType();
}
- throw new RuntimeException("Delegate is not a BusExtension instance: " + delegate);
+ throw new RuntimeException(BundleUtils.getMessage(bundle, "NOT_A_BUSEXTENSION_INSTANCE", delegate));
}
@Override
Added: stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/Message.properties
===================================================================
--- stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/Message.properties (rev 0)
+++ stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/Message.properties 2011-06-23 03:27:08 UTC (rev 14607)
@@ -0,0 +1 @@
+NOT_A_BUSEXTENSION_INSTANCE=Delegate {0} is not a BusExtension instance
Modified: stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/serviceref/CXFHandlerResolverImpl.java
===================================================================
--- stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/serviceref/CXFHandlerResolverImpl.java 2011-06-23 02:56:41 UTC (rev 14606)
+++ stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/serviceref/CXFHandlerResolverImpl.java 2011-06-23 03:27:08 UTC (rev 14607)
@@ -41,6 +41,8 @@
package org.jboss.wsf.stack.cxf.client.serviceref;
import java.io.File;
+import java.util.ResourceBundle;
+import org.jboss.ws.api.util.BundleUtils;
import java.io.IOException;
import java.io.InputStream;
import java.net.MalformedURLException;
@@ -79,6 +81,7 @@
*/
final class CXFHandlerResolverImpl extends HandlerChainBuilder implements HandlerResolver
{
+ private static final ResourceBundle bundle = BundleUtils.getBundle(CXFHandlerResolverImpl.class);
private static final Logger log = Logger.getLogger(CXFHandlerResolverImpl.class);
@SuppressWarnings("rawtypes")
@@ -147,7 +150,7 @@
try {
if (is == null) {
- throw new WebServiceException("Handler config file not found: " + handlerFile);
+ throw new WebServiceException(BundleUtils.getMessage(bundle, "HANDLER_CONFIG_FILE_NOT_FOUND", handlerFile));
}
Document doc = XMLUtils.parse(is);
@@ -155,7 +158,7 @@
if (!"http://java.sun.com/xml/ns/javaee".equals(el.getNamespaceURI())
|| !"handler-chains".equals(el.getLocalName())) {
- throw new WebServiceException("{http://java.sun.com/xml/ns/javaee}handler-chains element expected");
+ throw new WebServiceException(BundleUtils.getMessage(bundle, "HANDLER_CHAINS_ELEMENT_EXPECTED"));
}
chain = new ArrayList<Handler>();
Node node = el.getFirstChild();
@@ -165,7 +168,7 @@
if (!el.getNamespaceURI().equals("http://java.sun.com/xml/ns/javaee")
|| !el.getLocalName().equals("handler-chain")) {
- throw new WebServiceException("{http://java.sun.com/xml/ns/javaee}handler-chain element expected");
+ throw new WebServiceException(BundleUtils.getMessage(bundle, "HANDLER_CHAINS_ELEMENT_EXPECTED"));
}
processHandlerChainElement(el, chain, portQName, serviceQName, bindingID);
}
@@ -174,7 +177,7 @@
} catch (WebServiceException e) {
throw e;
} catch (Exception e) {
- throw new WebServiceException("No handler chain found", e);
+ throw new WebServiceException(BundleUtils.getMessage(bundle, "NO_HANDLER_CHAIN_FOUND"), e);
}
finally
{
@@ -197,7 +200,7 @@
el = (Element)cur;
if (!el.getNamespaceURI().equals("http://java.sun.com/xml/ns/javaee")) {
String xml = XMLUtils.toString(el);
- throw new WebServiceException("Invalid element in handler: " + xml);
+ throw new WebServiceException(BundleUtils.getMessage(bundle, "INVALID_ELEMENT_IN_HANDLER", xml));
}
String name = el.getLocalName();
if ("port-name-pattern".equals(name)) {
@@ -249,7 +252,7 @@
return true;
}
if (!namePattern.contains(":")) {
- throw new WebServiceException("Not a qname pattern: " + namePattern);
+ throw new WebServiceException(BundleUtils.getMessage(bundle, "NOT_A_QNAME_PATTERN", namePattern));
}
String localPart = namePattern.substring(namePattern.indexOf(':') + 1,
namePattern.length());
@@ -348,7 +351,7 @@
}
if (fileURL == null)
- throw new WebServiceException("Cannot resolve handler file '" + filename + "' on " + wsClass.getName());
+ throw new WebServiceException(BundleUtils.getMessage(bundle, "CANNOT_RESOLVE_HANDLER_FILE", new Object[]{ filename, wsClass.getName()}));
try
{
Modified: stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/serviceref/CXFServiceRefBinderJAXRPC.java
===================================================================
--- stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/serviceref/CXFServiceRefBinderJAXRPC.java 2011-06-23 02:56:41 UTC (rev 14606)
+++ stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/serviceref/CXFServiceRefBinderJAXRPC.java 2011-06-23 03:27:08 UTC (rev 14607)
@@ -21,8 +21,11 @@
*/
package org.jboss.wsf.stack.cxf.client.serviceref;
+import java.util.ResourceBundle;
+
import javax.naming.Referenceable;
+import org.jboss.ws.api.util.BundleUtils;
import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedServiceRefMetaData;
import org.jboss.wsf.spi.serviceref.ServiceRefBinder;
@@ -33,9 +36,10 @@
*/
final class CXFServiceRefBinderJAXRPC implements ServiceRefBinder
{
+ private static final ResourceBundle bundle = BundleUtils.getBundle(CXFServiceRefBinderJAXRPC.class);
@Override
public Referenceable createReferenceable(final UnifiedServiceRefMetaData serviceRefUMDM)
{
- throw new UnsupportedOperationException("CXF does not support JAX-RPC");
+ throw new UnsupportedOperationException(BundleUtils.getMessage(bundle, "DOES_NOT_SUPPORT_JAX_RPC"));
}
}
Modified: stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/serviceref/CXFServiceRefStubPropertyConfigurer.java
===================================================================
--- stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/serviceref/CXFServiceRefStubPropertyConfigurer.java 2011-06-23 02:56:41 UTC (rev 14606)
+++ stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/serviceref/CXFServiceRefStubPropertyConfigurer.java 2011-06-23 03:27:08 UTC (rev 14607)
@@ -25,6 +25,7 @@
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
+import java.util.ResourceBundle;
import javax.xml.namespace.QName;
import javax.xml.ws.WebServiceFeature;
@@ -35,6 +36,7 @@
import org.apache.cxf.jaxws.JaxWsProxyFactoryBean;
import org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean;
import org.jboss.logging.Logger;
+import org.jboss.ws.api.util.BundleUtils;
import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedPortComponentRefMetaData;
import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedServiceRefMetaData;
import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedStubPropertyMetaData;
@@ -47,6 +49,7 @@
*/
final class CXFServiceRefStubPropertyConfigurer implements Configurer
{
+ private static final ResourceBundle bundle = BundleUtils.getBundle(CXFServiceRefStubPropertyConfigurer.class);
private UnifiedServiceRefMetaData serviceRefMD;
private Configurer delegate;
@@ -75,8 +78,8 @@
portQName = QName.valueOf(portName);
}
catch (Exception e)
- {
- Logger.getLogger(this.getClass()).warn("Unable to retrieve port QName from '" + name + "', trying matching port using endpoint interface name only.");
+ {
+ Logger.getLogger(this.getClass()).warn(BundleUtils.getMessage(bundle, "UNABLE_TO_RETRIEVE_PORT_QNAME", name));
}
configureJaxWsProxyFactoryBean(portQName, (JaxWsProxyFactoryBean)beanInstance);
}
Added: stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/serviceref/Message.properties
===================================================================
--- stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/serviceref/Message.properties (rev 0)
+++ stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/serviceref/Message.properties 2011-06-23 03:27:08 UTC (rev 14607)
@@ -0,0 +1,8 @@
+UNABLE_TO_RETRIEVE_PORT_QNAME=Unable to retrieve port QName from {0}, trying matching port using endpoint interface name only.
+DOES_NOT_SUPPORT_JAX_RPC=CXF does not support JAX-RPC
+HANDLER_CONFIG_FILE_NOT_FOUND=Handler config file not found: {0}
+HANDLER_CHAINS_ELEMENT_EXPECTED={http://java.sun.com/xml/ns/javaee}handler-chain element expected
+NO_HANDLER_CHAIN_FOUND=No handler chain found
+INVALID_ELEMENT_IN_HANDLER=Invalid element in handler: {0}
+NOT_A_QNAME_PATTERN=Not a qname pattern: {0}
+CANNOT_RESOLVE_HANDLER_FILE=Cannot resolve handler file {0} on {1}
Modified: stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/extensions/addressing/map/CXFMAP.java
===================================================================
--- stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/extensions/addressing/map/CXFMAP.java 2011-06-23 02:56:41 UTC (rev 14606)
+++ stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/extensions/addressing/map/CXFMAP.java 2011-06-23 03:27:08 UTC (rev 14607)
@@ -24,6 +24,7 @@
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
+import java.util.ResourceBundle;
import javax.xml.namespace.QName;
@@ -36,6 +37,7 @@
import org.jboss.ws.api.addressing.MAPBuilder;
import org.jboss.ws.api.addressing.MAPEndpoint;
import org.jboss.ws.api.addressing.MAPRelatesTo;
+import org.jboss.ws.api.util.BundleUtils;
import org.w3c.dom.Element;
/**
@@ -50,6 +52,7 @@
*/
public class CXFMAP implements MAP
{
+ private static final ResourceBundle bundle = BundleUtils.getBundle(CXFMAP.class);
/**
* the wrapped instance which this class delegates to
*/
@@ -153,7 +156,7 @@
}
else
{
- throw new IllegalArgumentException("Unsupported MAPEndpoint: " + epref);
+ throw new IllegalArgumentException(BundleUtils.getMessage(bundle, "UNSUPPORTED_MAPENDPOINT", epref));
}
}
else
@@ -200,7 +203,7 @@
}
else
{
- throw new IllegalArgumentException("Unsupported MAPEndpoint: " + epref);
+ throw new IllegalArgumentException(BundleUtils.getMessage(bundle, "UNSUPPORTED_MAPENDPOINT", epref));
}
}
else
@@ -219,7 +222,7 @@
}
else
{
- throw new IllegalArgumentException("Unsupported MAPEndpoint: " + epref);
+ throw new IllegalArgumentException(BundleUtils.getMessage(bundle, "UNSUPPORTED_MAPENDPOINT", epref));
}
}
else
@@ -259,7 +262,7 @@
public void initializeAsDestination(MAPEndpoint epref)
{
if (epref == null)
- throw new IllegalArgumentException("Invalid null endpoint reference");
+ throw new IllegalArgumentException(BundleUtils.getMessage(bundle, "INVALID_NULL_ENDPOINT_REFERENCE"));
if (epref instanceof CXFMAPEndpoint)
{
@@ -267,7 +270,7 @@
}
else
{
- throw new IllegalArgumentException("Unsupported MAPEndpoint: " + epref);
+ throw new IllegalArgumentException(BundleUtils.getMessage(bundle, "UNSUPPORTED_MAPENDPOINT", epref));
}
}
@@ -290,7 +293,7 @@
{
if (!(map instanceof CXFMAP))
{
- throw new IllegalArgumentException("Unsupported MAP: " + map);
+ throw new IllegalArgumentException(BundleUtils.getMessage(bundle, "UNSUPPORTED_MAP", map));
}
AddressingProperties addressingProperties = ((CXFMAP)map).implementation;
@@ -302,7 +305,7 @@
{
if (!(map instanceof CXFMAP))
{
- throw new IllegalArgumentException("Unsupported MAP: " + map);
+ throw new IllegalArgumentException(BundleUtils.getMessage(bundle, "UNSUPPORTED_MAP", map));
}
AddressingProperties addressingProperties = ((CXFMAP)map).implementation;
Added: stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/extensions/addressing/map/Message.properties
===================================================================
--- stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/extensions/addressing/map/Message.properties (rev 0)
+++ stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/extensions/addressing/map/Message.properties 2011-06-23 03:27:08 UTC (rev 14607)
@@ -0,0 +1,3 @@
+INVALID_NULL_ENDPOINT_REFERENCE=Invalid null endpoint reference
+UNSUPPORTED_MAPENDPOINT=Unsupported MAPEndpoint: {0}
+UNSUPPORTED_MAP=Unsupported MAP: {0}
Added: stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/saaj/Message.properties
===================================================================
--- stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/saaj/Message.properties (rev 0)
+++ stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/saaj/Message.properties 2011-06-23 03:27:08 UTC (rev 14607)
@@ -0,0 +1,6 @@
+SOAPMESSAGE_CAN_NOT_BE_SENT=SOAPMessage can not be sent
+GET_REQUEST_CAN_NOT_BE_SENT=GET request can not be sent
+CONNECTION_ALREADY_CLOSED=Connection already closed!
+ADDRESS_TYPE_NOT_SUPPORTED=Address object of type {0} is not supported
+NO_CONDUITINITIATOR_IS_AVAILABLE_FOR=No ConduitInitiator is available for {0}
+CANNOT_SENT_WITH_CLOSED_CONNECTION=Cannot send messages using a previously closed connection
Modified: stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/saaj/SOAPConnectionImpl.java
===================================================================
--- stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/saaj/SOAPConnectionImpl.java 2011-06-23 02:56:41 UTC (rev 14606)
+++ stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/saaj/SOAPConnectionImpl.java 2011-06-23 03:27:08 UTC (rev 14607)
@@ -30,6 +30,7 @@
import java.util.Iterator;
import java.util.List;
import java.util.Map;
+import java.util.ResourceBundle;
import javax.xml.soap.MessageFactory;
import javax.xml.soap.MimeHeader;
@@ -53,9 +54,11 @@
import org.apache.cxf.transport.ConduitInitiatorManager;
import org.apache.cxf.transport.MessageObserver;
import org.apache.cxf.transport.http.HTTPConduit;
+import org.jboss.ws.api.util.BundleUtils;
public class SOAPConnectionImpl extends SOAPConnection
{
+ private static final ResourceBundle bundle = BundleUtils.getBundle(SOAPConnectionImpl.class);
private boolean closed = false;
@Override
@@ -119,7 +122,7 @@
}
catch (Exception ex)
{
- throw new SOAPException("SOAPMessage can not be sent", ex);
+ throw new SOAPException(BundleUtils.getMessage(bundle, "SOAPMESSAGE_CAN_NOT_BE_SENT"), ex);
}
// read SOAPMessage
@@ -161,7 +164,7 @@
}
catch (Exception ex)
{
- throw new SOAPException("GET request can not be sent", ex);
+ throw new SOAPException(BundleUtils.getMessage(bundle, "GET_REQUEST_CAN_NOT_BE_SENT"), ex);
}
// read SOAPMessage
@@ -173,7 +176,7 @@
{
if (this.closed)
{
- throw new SOAPException("Connection already closed!");
+ throw new SOAPException(BundleUtils.getMessage(bundle, "CONNECTION_ALREADY_CLOSED"));
}
this.closed = true;
}
@@ -184,8 +187,7 @@
{
return addressObject.toString();
}
- throw new SOAPException("Address object of type " + addressObject.getClass().getName()
- + " is not supported");
+ throw new SOAPException(BundleUtils.getMessage(bundle, "ADDRESS_TYPE_NOT_SUPPORTED", addressObject.getClass()));
}
private ConduitInitiator getConduitInitiator(String address) throws SOAPException
@@ -213,12 +215,12 @@
}
catch (Exception ex)
{
- throw new SOAPException("No ConduitInitiator is available for " + address, ex);
+ throw new SOAPException(BundleUtils.getMessage(bundle, "NO_CONDUITINITIATOR_IS_AVAILABLE", address), ex);
}
if (ci == null)
{
- throw new SOAPException("No ConduitInitiator is available for " + address);
+ throw new SOAPException(BundleUtils.getMessage(bundle, "NO_CONDUITINITIATOR_IS_AVAILABLE", address));
}
return ci;
}
@@ -297,14 +299,14 @@
}
catch (Exception ex)
{
- throw new SOAPException("SOAPMessage can not be read", ex);
+ throw new SOAPException(BundleUtils.getMessage(bundle, "SOAPMESSAGE_CAN_NOT_BE_READ"), ex);
}
}
private void checkClosed() throws SOAPException
{
if (closed) {
- throw new SOAPException("Cannot send messages using a previously closed connection!");
+ throw new SOAPException(BundleUtils.getMessage(bundle, "CANNOT_SENT_WITH_CLOSED_CONNECTION"));
}
}
Modified: stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/tools/CXFConsumerImpl.java
===================================================================
--- stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/tools/CXFConsumerImpl.java 2011-06-23 02:56:41 UTC (rev 14606)
+++ stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/tools/CXFConsumerImpl.java 2011-06-23 03:27:08 UTC (rev 14607)
@@ -26,10 +26,12 @@
import java.net.URL;
import java.util.ArrayList;
import java.util.List;
+import java.util.ResourceBundle;
import org.apache.cxf.tools.common.ToolContext;
import org.apache.cxf.tools.wsdlto.WSDLToJava;
import org.jboss.ws.api.tools.WSContractConsumer;
+import org.jboss.ws.api.util.BundleUtils;
import org.jboss.ws.common.utils.NullPrintStream;
/**
@@ -40,6 +42,7 @@
*/
public class CXFConsumerImpl extends WSContractConsumer
{
+ private static final ResourceBundle bundle = BundleUtils.getBundle(CXFConsumerImpl.class);
private List<File> bindingFiles = null;
private File catalog = null;
private boolean extension;
@@ -168,7 +171,7 @@
if (sourceDir != null && generateSource)
{
if (!sourceDir.exists() && !sourceDir.mkdirs())
- throw new IllegalStateException("Could not make directory: " + sourceDir.getName());
+ throw new IllegalStateException(BundleUtils.getMessage(bundle, "COULD_NOT_MAKE_DIRECTORY", sourceDir.getName()));
args.add("-d");
args.add(sourceDir.getAbsolutePath());
@@ -202,7 +205,7 @@
}
if (!outputDir.exists() && !outputDir.mkdirs())
- throw new IllegalStateException("Could not make directory: " + outputDir.getName());
+ throw new IllegalStateException(BundleUtils.getMessage(bundle, "COULD_NOT_MAKE_DIRECTORY", outputDir.getName()));
// Always add the output directory and the wsdl location
if (!nocompile)
Modified: stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/tools/CXFProviderImpl.java
===================================================================
--- stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/tools/CXFProviderImpl.java 2011-06-23 02:56:41 UTC (rev 14606)
+++ stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/tools/CXFProviderImpl.java 2011-06-23 03:27:08 UTC (rev 14607)
@@ -27,9 +27,11 @@
import java.net.URLClassLoader;
import java.util.ArrayList;
import java.util.List;
+import java.util.ResourceBundle;
import org.apache.cxf.tools.java2ws.JavaToWS;
import org.jboss.ws.api.tools.WSContractProvider;
+import org.jboss.ws.api.util.BundleUtils;
import org.jboss.ws.common.utils.NullPrintStream;
/**
@@ -40,6 +42,7 @@
*/
public class CXFProviderImpl extends WSContractProvider
{
+ private static final ResourceBundle bundle = BundleUtils.getBundle(CXFProviderImpl.class);
private ClassLoader loader;
private boolean generateWsdl;
private boolean extension;
@@ -101,7 +104,7 @@
}
catch (ClassNotFoundException e)
{
- throw new IllegalArgumentException("Class not found: " + endpointClass);
+ throw new IllegalArgumentException(BundleUtils.getMessage(bundle, "CLASS_NOT_FOUND", endpointClass));
}
}
@@ -130,14 +133,14 @@
if (sourceDir != null)
{
if (!sourceDir.exists() && !sourceDir.mkdirs())
- throw new IllegalStateException("Could not make directory: " + sourceDir.getName());
+ throw new IllegalStateException(BundleUtils.getMessage(bundle, "COULD_NOT_MAKE_DIRECTORY", sourceDir.getName()));
args.add("-s");
args.add(sourceDir.getAbsolutePath());
}
if (!outputDir.exists() && !outputDir.mkdirs())
- throw new IllegalStateException("Could not make directory: " + outputDir.getName());
+ throw new IllegalStateException(BundleUtils.getMessage(bundle, "COULD_NOT_MAKE_DIRECTORY", outputDir.getName()));
args.add("-classdir");
args.add(outputDir.getAbsolutePath());
@@ -145,7 +148,7 @@
if (resourceDir != null)
{
if (!resourceDir.exists() && !resourceDir.mkdirs())
- throw new IllegalStateException("Could not make directory: " + resourceDir.getName());
+ throw new IllegalStateException(BundleUtils.getMessage(bundle, "COULD_NOT_MAKE_DIRECTORY", resourceDir.getName()));
args.add("-d");
args.add(resourceDir.getAbsolutePath());
}
Added: stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/tools/Message.properties
===================================================================
--- stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/tools/Message.properties (rev 0)
+++ stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/tools/Message.properties 2011-06-23 03:27:08 UTC (rev 14607)
@@ -0,0 +1,2 @@
+CLASS_NOT_FOUND=Class not found: {0}
+COULD_NOT_MAKE_DIRECTORY=Could not make directory: {0}
\ No newline at end of file
Modified: stack/cxf/trunk/pom.xml
===================================================================
--- stack/cxf/trunk/pom.xml 2011-06-23 02:56:41 UTC (rev 14606)
+++ stack/cxf/trunk/pom.xml 2011-06-23 03:27:08 UTC (rev 14607)
@@ -1177,6 +1177,15 @@
<!-- Plugins -->
<build>
+
+ <resources>
+ <resource>
+ <directory>src/main/java</directory>
+ <includes>
+ <include>**/*.properties</include>
+ </includes>
+ </resource>
+ </resources>
<!-- PluginMangament-->
<pluginManagement>
13 years, 6 months
JBossWS SVN: r14606 - in container/jboss60/branches/jbossws-jboss600: src/main/java/org/jboss/webservices/integration/config and 9 other directories.
by jbossws-commits@lists.jboss.org
Author: jim.ma
Date: 2011-06-22 22:56:41 -0400 (Wed, 22 Jun 2011)
New Revision: 14606
Added:
container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/config/Message.properties
container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/deployers/Message.properties
container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/deployers/deployment/Message.properties
container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/endpoint/Message.properties
container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/injection/Message.properties
container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/invocation/Message.properties
container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/security/Message.properties
container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/tomcat/Message.properties
container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/util/Message.properties
container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/weld/Message.properties
Modified:
container/jboss60/branches/jbossws-jboss600/pom.xml
container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/config/ServerConfigImpl.java
container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/deployers/AbstractDescriptorDeployer.java
container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/deployers/JAXRPCIntegrationClassPathDeployer.java
container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/deployers/WSEJBAdapterDeployer.java
container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/deployers/deployment/AbstractDeploymentModelBuilder.java
container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/endpoint/HornetQJMSResolver.java
container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/injection/EJBBeanReferenceResolver.java
container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/injection/InjectionMetaDataDeploymentAspect.java
container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/injection/ServiceRefResourceProvider.java
container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/injection/VirtualFileAdaptor.java
container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerEJB21.java
container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerEJB3.java
container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerFactoryImpl.java
container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/invocation/ServiceEndpointInterceptorEJB21.java
container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/security/JACCPermissionsDeploymentAspect.java
container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/security/JaasSecurityDomainAdaptorResolverImpl.java
container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/security/SecurityDomainContextAdaptor.java
container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/tomcat/WebMetaDataModifier.java
container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/util/ASHelper.java
container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/weld/WeldInvocationHandler.java
Log:
[JBWS-3316]:i18n the message and logging
Modified: container/jboss60/branches/jbossws-jboss600/pom.xml
===================================================================
--- container/jboss60/branches/jbossws-jboss600/pom.xml 2011-06-22 22:47:15 UTC (rev 14605)
+++ container/jboss60/branches/jbossws-jboss600/pom.xml 2011-06-23 02:56:41 UTC (rev 14606)
@@ -252,6 +252,12 @@
<resource>
<directory>src/main/resources/jbossws-jboss.jar</directory>
</resource>
+ <resource>
+ <directory>src/main/java</directory>
+ <includes>
+ <include>**/*.properties</include>
+ </includes>
+ </resource>
</resources>
<plugins>
<plugin>
Added: container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/config/Message.properties
===================================================================
--- container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/config/Message.properties (rev 0)
+++ container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/config/Message.properties 2011-06-23 02:56:41 UTC (rev 14606)
@@ -0,0 +1,2 @@
+COULD_NOT_OBTAIN_ATTRIBUTE_FROM=Could not obtain attribute {0} from {1}
+COULD_NOT_DESIRED_DIRECTORY_FROM_URL=Could not desired directory from URL: {0}
Modified: container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/config/ServerConfigImpl.java
===================================================================
--- container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/config/ServerConfigImpl.java 2011-06-22 22:47:15 UTC (rev 14605)
+++ container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/config/ServerConfigImpl.java 2011-06-23 02:56:41 UTC (rev 14606)
@@ -24,10 +24,12 @@
import java.io.File;
import java.net.URISyntaxException;
import java.net.URL;
+import java.util.ResourceBundle;
import javax.management.JMException;
import javax.management.ObjectName;
+import org.jboss.ws.api.util.BundleUtils;
import org.jboss.ws.common.management.AbstractServerConfig;
import org.jboss.ws.common.management.AbstractServerConfigMBean;
@@ -40,6 +42,7 @@
*/
public final class ServerConfigImpl extends AbstractServerConfig implements AbstractServerConfigMBean
{
+ private static final ResourceBundle bundle = BundleUtils.getBundle(ServerConfigImpl.class);
/**
* Constructor.
*/
@@ -97,7 +100,7 @@
}
catch (final JMException e)
{
- throw new RuntimeException("Could not obtain attribute " + attributeName + " from " + on, e);
+ throw new RuntimeException(BundleUtils.getMessage(bundle, "COULD_NOT_OBTAIN_ATTRIBUTE_FROM", new Object[]{ attributeName , on}), e);
}
// Represent as a File
@@ -108,7 +111,7 @@
}
catch (final URISyntaxException urise)
{
- throw new RuntimeException("Could not desired directory from URL: " + location, urise);
+ throw new RuntimeException(BundleUtils.getMessage(bundle, "COULD_NOT_DESIRED_DIRECTORY_FROM_URL", location), urise);
}
return dir;
Modified: container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/deployers/AbstractDescriptorDeployer.java
===================================================================
--- container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/deployers/AbstractDescriptorDeployer.java 2011-06-22 22:47:15 UTC (rev 14605)
+++ container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/deployers/AbstractDescriptorDeployer.java 2011-06-23 02:56:41 UTC (rev 14606)
@@ -21,9 +21,12 @@
*/
package org.jboss.webservices.integration.deployers;
+import java.util.ResourceBundle;
+
import org.jboss.deployers.vfs.spi.deployer.AbstractVFSParsingDeployer;
import org.jboss.deployers.vfs.spi.structure.VFSDeploymentUnit;
import org.jboss.vfs.VirtualFile;
+import org.jboss.ws.api.util.BundleUtils;
import org.jboss.wsf.spi.metadata.DescriptorParser;
/**
@@ -33,6 +36,7 @@
*/
abstract class AbstractDescriptorDeployer<P extends DescriptorParser<T>, T> extends AbstractVFSParsingDeployer<T>
{
+ private static final ResourceBundle bundle = BundleUtils.getBundle(AbstractDescriptorDeployer.class);
private P ddParser;
AbstractDescriptorDeployer(Class<T> output)
@@ -59,7 +63,7 @@
protected void setParser(final P ddParser)
{
if (this.ddParser != null)
- throw new IllegalStateException("Only one " + this.ddParser.getClass() + " instance can be installed in MC");
+ throw new IllegalStateException(BundleUtils.getMessage(bundle, "ONLY_ONE_INSTANCE_CAN_BE_INSTALLED_IN_MC", this.ddParser.getClass() ));
this.ddParser = ddParser;
this.setName(this.ddParser.getDescriptorName());
Modified: container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/deployers/JAXRPCIntegrationClassPathDeployer.java
===================================================================
--- container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/deployers/JAXRPCIntegrationClassPathDeployer.java 2011-06-22 22:47:15 UTC (rev 14605)
+++ container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/deployers/JAXRPCIntegrationClassPathDeployer.java 2011-06-23 02:56:41 UTC (rev 14606)
@@ -23,6 +23,7 @@
import java.net.URL;
import java.util.HashSet;
+import java.util.ResourceBundle;
import java.util.Set;
import org.jboss.deployers.vfs.plugins.classloader.UrlIntegrationDeployer;
@@ -30,6 +31,7 @@
import org.jboss.util.StringPropertyReplacer;
import org.jboss.vfs.VFS;
import org.jboss.vfs.VirtualFile;
+import org.jboss.ws.api.util.BundleUtils;
import org.jboss.wsf.spi.management.ServerConfig;
/**
@@ -42,6 +44,7 @@
*/
public abstract class JAXRPCIntegrationClassPathDeployer<T> extends UrlIntegrationDeployer<T>
{
+ private static final ResourceBundle bundle = BundleUtils.getBundle(JAXRPCIntegrationClassPathDeployer.class);
private Set<String> libs;
private boolean integrationLibsFound = false;
private ServerConfig wsServerConfig;
@@ -90,7 +93,7 @@
}
catch (Exception e)
{
- throw new IllegalArgumentException("Unexpected error: " + e);
+ throw new IllegalArgumentException(BundleUtils.getMessage(bundle, "UNEXPECTED_ERROR", e));
}
return result;
}
Added: container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/deployers/Message.properties
===================================================================
--- container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/deployers/Message.properties (rev 0)
+++ container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/deployers/Message.properties 2011-06-23 02:56:41 UTC (rev 14606)
@@ -0,0 +1,4 @@
+ONLY_ONE_INSTANCE_CAN_BE_INSTALLED_IN_MC=Only one {0} instance can be installed in MC
+INGORING_EJB_DEPLOYMENT_WITH_NULL_CLASSNAME=Ingoring EJB deployment with null classname: {0}
+FAILED_TO_LOAD_COMPONENT_CLASS=Failed to load component class {0} from {1}
+UNEXPECTED_ERROR=Unexpected error: {0}
Modified: container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/deployers/WSEJBAdapterDeployer.java
===================================================================
--- container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/deployers/WSEJBAdapterDeployer.java 2011-06-22 22:47:15 UTC (rev 14605)
+++ container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/deployers/WSEJBAdapterDeployer.java 2011-06-23 02:56:41 UTC (rev 14606)
@@ -24,6 +24,7 @@
import java.lang.annotation.Annotation;
import java.util.ArrayList;
import java.util.List;
+import java.util.ResourceBundle;
import javax.management.MalformedObjectNameException;
import javax.management.ObjectName;
@@ -38,6 +39,7 @@
import org.jboss.metadata.ejb.jboss.JBossEnterpriseBeanMetaData;
import org.jboss.metadata.ejb.jboss.JBossMetaData;
import org.jboss.webservices.integration.util.ASHelper;
+import org.jboss.ws.api.util.BundleUtils;
import org.jboss.wsf.spi.deployment.integration.WebServiceDeclaration;
import org.jboss.wsf.spi.deployment.integration.WebServiceDeployment;
import org.jboss.wsf.spi.metadata.webservices.WebservicesMetaData;
@@ -49,6 +51,7 @@
*/
public final class WSEJBAdapterDeployer extends AbstractRealDeployer
{
+ private static final ResourceBundle bundle = BundleUtils.getBundle(WSEJBAdapterDeployer.class);
/**
* Constructor.
*/
@@ -96,7 +99,7 @@
}
else
{
- this.log.warn("Ingoring EJB deployment with null classname: " + ejbName);
+ this.log.warn(BundleUtils.getMessage(bundle, "INGORING_EJB_DEPLOYMENT_WITH_NULL_CLASSNAME", ejbName));
}
}
@@ -229,8 +232,7 @@
}
catch (ClassNotFoundException cnfe)
{
- throw new RuntimeException("Failed to load component class: " + this.getComponentClassName()
- + " from loader: " + this.loader);
+ throw new RuntimeException(BundleUtils.getMessage(bundle, "FAILED_TO_LOAD_COMPONENT_CLASS", new Object[]{this.getComponentClassName(), this.loader}));
}
}
}
Modified: container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/deployers/deployment/AbstractDeploymentModelBuilder.java
===================================================================
--- container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/deployers/deployment/AbstractDeploymentModelBuilder.java 2011-06-22 22:47:15 UTC (rev 14605)
+++ container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/deployers/deployment/AbstractDeploymentModelBuilder.java 2011-06-23 02:56:41 UTC (rev 14606)
@@ -24,6 +24,7 @@
import java.util.HashSet;
import java.util.LinkedList;
import java.util.List;
+import java.util.ResourceBundle;
import java.util.Set;
import org.jboss.deployers.structure.spi.DeploymentUnit;
@@ -32,6 +33,7 @@
import org.jboss.vfs.VirtualFile;
import org.jboss.webservices.integration.injection.VirtualFileAdaptor;
import org.jboss.webservices.integration.util.ASHelper;
+import org.jboss.ws.api.util.BundleUtils;
import org.jboss.ws.common.ResourceLoaderAdapter;
import org.jboss.wsf.spi.SPIProvider;
import org.jboss.wsf.spi.SPIProviderResolver;
@@ -49,6 +51,7 @@
*/
abstract class AbstractDeploymentModelBuilder implements DeploymentModelBuilder
{
+ private static final ResourceBundle bundle = BundleUtils.getBundle(AbstractDeploymentModelBuilder.class);
/** WSDL, XSD and XML files filter. */
private static final WSVirtualFileFilter WS_FILE_FILTER = new WSVirtualFileFilter();
@@ -105,12 +108,12 @@
{
if (endpointName == null)
{
- throw new NullPointerException("Null endpoint name");
+ throw new NullPointerException(BundleUtils.getMessage(bundle, "NULL_ENDPOINT_NAME"));
}
if (endpointClass == null)
{
- throw new NullPointerException("Null endpoint class");
+ throw new NullPointerException(BundleUtils.getMessage(bundle, "NULL_ENDPOINT_CLASS"));
}
final Endpoint endpoint = this.deploymentModelFactory.newHttpEndpoint(endpointClass);
@@ -132,12 +135,12 @@
{
if (endpointName == null)
{
- throw new NullPointerException("Null endpoint name");
+ throw new NullPointerException(BundleUtils.getMessage(bundle, "NULL_ENDPOINT_NAME"));
}
if (endpointClass == null)
{
- throw new NullPointerException("Null endpoint class");
+ throw new NullPointerException(BundleUtils.getMessage(bundle, "NULL_ENDPOINT_CLASS"));
}
final Endpoint endpoint = this.deploymentModelFactory.newJMSEndpoint(endpointClass);
@@ -230,6 +233,6 @@
return attachmentValue;
}
- throw new IllegalStateException("Deployment unit does not contain " + attachment);
+ throw new IllegalStateException(BundleUtils.getMessage(bundle, "DEPLOYMENT_UNIT_DOES_NOT_CONTAIN", attachment));
}
}
Added: container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/deployers/deployment/Message.properties
===================================================================
--- container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/deployers/deployment/Message.properties (rev 0)
+++ container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/deployers/deployment/Message.properties 2011-06-23 02:56:41 UTC (rev 14606)
@@ -0,0 +1,3 @@
+NULL_ENDPOINT_NAME=Null endpoint name
+NULL_ENDPOINT_CLASS=Null endpoint class
+DEPLOYMENT_UNIT_DOES_NOT_CONTAIN=Deployment unit does not contain {0}
Modified: container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/endpoint/HornetQJMSResolver.java
===================================================================
--- container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/endpoint/HornetQJMSResolver.java 2011-06-22 22:47:15 UTC (rev 14605)
+++ container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/endpoint/HornetQJMSResolver.java 2011-06-23 02:56:41 UTC (rev 14606)
@@ -21,10 +21,13 @@
*/
package org.jboss.webservices.integration.endpoint;
+import java.util.ResourceBundle;
+
import javax.jms.Destination;
import org.apache.log4j.Logger;
import org.hornetq.jms.client.HornetQDestination;
+import org.jboss.ws.api.util.BundleUtils;
import org.jboss.ws.common.management.DefaultJMSEndpointResolver;
/**
@@ -34,14 +37,14 @@
*/
public class HornetQJMSResolver extends DefaultJMSEndpointResolver
{
+ private static final ResourceBundle bundle = BundleUtils.getBundle(HornetQJMSResolver.class);
public void setDestination(Destination destination)
{
if (destination instanceof HornetQDestination)
setFromName(destination, ((HornetQDestination)destination).isQueue());
else
{
- Logger.getLogger(HornetQJMSResolver.class).warn(
- "Destination '" + destination + "' is not a org.hornetq.jms.client.HornetQDestination instance, falling back to default JMS endpoint resolution");
+ Logger.getLogger(HornetQJMSResolver.class).warn(BundleUtils.getMessage(bundle, "DESTINATION_IS_NOT_HQDES", destination));
super.setDestination(destination);
}
}
Added: container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/endpoint/Message.properties
===================================================================
--- container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/endpoint/Message.properties (rev 0)
+++ container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/endpoint/Message.properties 2011-06-23 02:56:41 UTC (rev 14606)
@@ -0,0 +1 @@
+DESTINATION_IS_NOT_HQDES=Destination {0}is not a org.hornetq.jms.client.HornetQDestination instance, falling back to default JMS endpoint resolution=
Modified: container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/injection/EJBBeanReferenceResolver.java
===================================================================
--- container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/injection/EJBBeanReferenceResolver.java 2011-06-22 22:47:15 UTC (rev 14605)
+++ container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/injection/EJBBeanReferenceResolver.java 2011-06-23 02:56:41 UTC (rev 14606)
@@ -23,12 +23,14 @@
import java.lang.reflect.Field;
import java.lang.reflect.Method;
+import java.util.ResourceBundle;
import javax.ejb.EJB;
import org.jboss.deployers.structure.spi.DeploymentUnit;
import org.jboss.ejb3.ejbref.resolver.spi.EjbReference;
import org.jboss.ejb3.ejbref.resolver.spi.EjbReferenceResolver;
+import org.jboss.ws.api.util.BundleUtils;
import org.jboss.ws.common.injection.resolvers.AbstractReferenceResolver;
/**
@@ -38,6 +40,7 @@
*/
final class EJBBeanReferenceResolver extends AbstractReferenceResolver<EJB>
{
+ private static final ResourceBundle bundle = BundleUtils.getBundle(EJBBeanReferenceResolver.class);
/**
* Deployment unit used for resolving process.
*/
@@ -60,11 +63,11 @@
if (unit == null)
{
- throw new IllegalArgumentException("Deployment unit cannot be null");
+ throw new IllegalArgumentException(BundleUtils.getMessage(bundle, "DEPLOYMENT_UNIT_CANNOT_BE_NULL"));
}
if (delegate == null)
{
- throw new IllegalArgumentException("Ejb reference resolver cannot be null");
+ throw new IllegalArgumentException(BundleUtils.getMessage(bundle, "EJB_REFERENCE_RESOLVER_CANNOT_BE_NULL"));
}
this.unit = unit;
Modified: container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/injection/InjectionMetaDataDeploymentAspect.java
===================================================================
--- container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/injection/InjectionMetaDataDeploymentAspect.java 2011-06-22 22:47:15 UTC (rev 14605)
+++ container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/injection/InjectionMetaDataDeploymentAspect.java 2011-06-23 02:56:41 UTC (rev 14606)
@@ -27,6 +27,7 @@
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
+import java.util.ResourceBundle;
import java.util.Set;
import javax.annotation.Resource;
@@ -41,7 +42,9 @@
import org.jboss.metadata.javaee.spec.ResourceInjectionTargetMetaData;
import org.jboss.metadata.web.jboss.JBossWebMetaData;
import org.jboss.webservices.integration.util.ASHelper;
+import org.jboss.ws.api.util.BundleUtils;
import org.jboss.ws.common.injection.resolvers.ResourceReferenceResolver;
+import org.jboss.ws.common.integration.AbstractDeploymentAspect;
import org.jboss.ws.common.integration.WSHelper;
import org.jboss.wsf.spi.deployment.Deployment;
import org.jboss.wsf.spi.deployment.Endpoint;
@@ -51,7 +54,6 @@
import org.jboss.wsf.spi.metadata.injection.InjectionMetaData;
import org.jboss.wsf.spi.metadata.injection.InjectionsMetaData;
import org.jboss.wsf.spi.metadata.injection.ReferenceResolver;
-import org.jboss.ws.common.integration.AbstractDeploymentAspect;
/**
* Deployment aspect that builds injection meta data.
@@ -60,6 +62,7 @@
*/
public final class InjectionMetaDataDeploymentAspect extends AbstractDeploymentAspect
{
+ private static final ResourceBundle bundle = BundleUtils.getBundle(InjectionMetaDataDeploymentAspect.class);
/** Resolver handling @Resource injections. */
private static final ReferenceResolver RESOURCE_RESOLVER = new ResourceReferenceResolver();
@@ -94,7 +97,7 @@
{
if (this.ejbReferenceResolver == null)
{
- throw new IllegalStateException("No EjbReferenceResolver set by MC");
+ throw new IllegalStateException(BundleUtils.getMessage(bundle, "NO_EJBREFERENCERESOLVER_SET_BY_MC"));
}
return this.ejbReferenceResolver;
Added: container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/injection/Message.properties
===================================================================
--- container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/injection/Message.properties (rev 0)
+++ container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/injection/Message.properties 2011-06-23 02:56:41 UTC (rev 14606)
@@ -0,0 +1,13 @@
+NO_EJBREFERENCERESOLVER_SET_BY_MC=No EjbReferenceResolver set by MC
+CAN_ONLY_HANDLE_REAL_VFS_DEPLOYMENTS=Can only handle real VFS deployments: {0}
+IGNORING_PORT_REF=Ignoring <port-component-ref> without <service-endpoint-interface> and <port-qname>: {0}
+INJECTION_TARGET_CLASS_NOT_FOUND=<injection-target> class: {0} was not found in deployment
+INJECTION_TARGET_NOT_FOUND=<injection-target> could not be found: {0}.
+DEPLOYMENT_UNIT_CANNOT_BE_NULL=Deployment unit cannot be null
+EJB_REFERENCE_RESOLVER_CANNOT_BE_NULL=Ejb reference resolver cannot be null
+NULL_ROOT_URL=Null root url
+NULL_PATH=Null path
+UNABLE_TO_GET_VIRTUALFILE_FROM_URL=Unable to get Virtualfile from URL: {0}
+VIRTUALFILE_DOES_NOT_EXIST=VirtualFile {0} does not exist
+VIRTUALFILE_IS_NOT_MOUNTED=VirtualFile {0} is not mounted
+CHILD_NOT_FOUND=Child {0} not found for VirtualFile {1}
\ No newline at end of file
Modified: container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/injection/ServiceRefResourceProvider.java
===================================================================
--- container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/injection/ServiceRefResourceProvider.java 2011-06-22 22:47:15 UTC (rev 14605)
+++ container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/injection/ServiceRefResourceProvider.java 2011-06-23 02:56:41 UTC (rev 14606)
@@ -32,6 +32,7 @@
import java.util.Collection;
import java.util.List;
import java.util.Map;
+import java.util.ResourceBundle;
import javax.naming.Referenceable;
import javax.xml.namespace.QName;
@@ -53,6 +54,7 @@
import org.jboss.switchboard.javaee.jboss.environment.JBossServiceRefType;
import org.jboss.switchboard.mc.spi.MCBasedResourceProvider;
import org.jboss.switchboard.spi.Resource;
+import org.jboss.ws.api.util.BundleUtils;
import org.jboss.wsf.spi.SPIProvider;
import org.jboss.wsf.spi.SPIProviderResolver;
import org.jboss.wsf.spi.deployment.UnifiedVirtualFile;
@@ -65,8 +67,8 @@
import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedServiceRefMetaData;
import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedStubPropertyMetaData;
import org.jboss.wsf.spi.serviceref.ServiceRefHandler;
+import org.jboss.wsf.spi.serviceref.ServiceRefHandler.Type;
import org.jboss.wsf.spi.serviceref.ServiceRefHandlerFactory;
-import org.jboss.wsf.spi.serviceref.ServiceRefHandler.Type;
/**
* Service reference resource provider.
@@ -82,6 +84,7 @@
*/
public final class ServiceRefResourceProvider implements MCBasedResourceProvider<ServiceRefType>
{
+ private static final ResourceBundle bundle = BundleUtils.getBundle(ServiceRefResourceProvider.class);
private static final Logger log = Logger.getLogger(ServiceRefResourceProvider.class);
@@ -151,7 +154,7 @@
}
else
{
- throw new IllegalArgumentException("Can only handle real VFS deployments: " + tempDeploymentUnit);
+ throw new IllegalArgumentException(BundleUtils.getMessage(bundle, "CAN_ONLY_HANDLE_REAL_VFS_DEPLOYMENTS", tempDeploymentUnit));
}
}
@@ -219,8 +222,7 @@
}
else
{
- log.warn("Ignoring <port-component-ref> without <service-endpoint-interface> and <port-qname>: "
- + portComponentUMDM);
+ log.warn(BundleUtils.getMessage(bundle, "IGNORING_PORT_REF", portComponentUMDM));
}
}
}
@@ -677,8 +679,7 @@
}
catch (ClassNotFoundException e)
{
- throw new RuntimeException("<injection-target> class: " + target.getTargetClass()
- + " was not found in deployment");
+ throw new RuntimeException(BundleUtils.getMessage(bundle, "INJECTION_TARGET_CLASS_NOT_FOUND", target.getTargetClass()));
}
for (Field field : clazz.getDeclaredFields())
@@ -693,8 +694,7 @@
return method;
}
- throw new RuntimeException("<injection-target> could not be found: " + target.getTargetClass() + "."
- + target.getTargetName());
+ throw new RuntimeException(BundleUtils.getMessage(bundle, "INJECTION_TARGET_NOT_FOUND", target.getTargetClass()+ "." +target.getTargetName()));
}
}
Modified: container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/injection/VirtualFileAdaptor.java
===================================================================
--- container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/injection/VirtualFileAdaptor.java 2011-06-22 22:47:15 UTC (rev 14605)
+++ container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/injection/VirtualFileAdaptor.java 2011-06-23 02:56:41 UTC (rev 14606)
@@ -31,6 +31,7 @@
import java.net.URL;
import java.util.LinkedList;
import java.util.List;
+import java.util.ResourceBundle;
import java.util.jar.JarEntry;
import java.util.jar.JarInputStream;
import java.util.jar.JarOutputStream;
@@ -38,6 +39,7 @@
import org.jboss.vfs.VFS;
import org.jboss.vfs.VFSUtils;
import org.jboss.vfs.VirtualFile;
+import org.jboss.ws.api.util.BundleUtils;
import org.jboss.wsf.spi.deployment.UnifiedVirtualFile;
import org.jboss.wsf.spi.deployment.WritableUnifiedVirtualFile;
@@ -50,6 +52,7 @@
*/
public final class VirtualFileAdaptor implements WritableUnifiedVirtualFile
{
+ private static final ResourceBundle bundle = BundleUtils.getBundle(VirtualFileAdaptor.class);
private static final long serialVersionUID = -4509594124653184348L;
private static final ObjectStreamField[] serialPersistentFields =
@@ -79,9 +82,9 @@
protected VirtualFileAdaptor(URL rootUrl, String path, boolean requiresMount)
{
if (rootUrl == null)
- throw new IllegalArgumentException("Null root url");
+ throw new IllegalArgumentException(BundleUtils.getMessage(bundle, "NULL_ROOT_URL"));
if (path == null)
- throw new IllegalArgumentException("Null path");
+ throw new IllegalArgumentException(BundleUtils.getMessage(bundle, "NULL_PATH"));
this.rootUrl = rootUrl;
this.path = path;
@@ -106,17 +109,17 @@
}
catch (URISyntaxException e)
{
- throw new IOException("Unable to get Virtualfile from URL: " + rootUrl, e);
+ throw new IOException(BundleUtils.getMessage(bundle, "UNABLE_TO_GET_VIRTUALFILE_FROM_URL", rootUrl), e);
}
file = root.getChild(path);
if (!file.exists())
{
- throw new IOException("VirtualFile " + file + " does not exist");
+ throw new IOException(BundleUtils.getMessage(bundle, "VIRTUALFILE_DOES_NOT_EXIST", file ));
}
else if (requiresMount && !isMounted(root, file))
{
- throw new IOException("VirtualFile " + file + " is not mounted");
+ throw new IOException(BundleUtils.getMessage(bundle, "VIRTUALFILE_IS_NOT_MOUNTED", file ));
}
}
return file;
@@ -132,7 +135,7 @@
final VirtualFile virtualFile = getFile();
final VirtualFile childFile = file.getChild(child);
if(!childFile.exists())
- throw new IOException("Child '" + child + "' not found for VirtualFile " + virtualFile);
+ throw new IOException(BundleUtils.getMessage(bundle, "CHILD_NOT_FOUND", new Object[]{ child , virtualFile}));
return new VirtualFileAdaptor(childFile);
}
Modified: container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerEJB21.java
===================================================================
--- container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerEJB21.java 2011-06-22 22:47:15 UTC (rev 14605)
+++ container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerEJB21.java 2011-06-23 02:56:41 UTC (rev 14606)
@@ -23,6 +23,7 @@
import java.lang.reflect.Method;
import java.security.Principal;
+import java.util.ResourceBundle;
import javax.management.MBeanServer;
import javax.management.ObjectName;
@@ -37,6 +38,7 @@
import org.jboss.invocation.InvocationType;
import org.jboss.invocation.PayloadKey;
import org.jboss.mx.util.MBeanServerLocator;
+import org.jboss.ws.api.util.BundleUtils;
import org.jboss.ws.common.ObjectNameFactory;
import org.jboss.ws.common.integration.WSHelper;
import org.jboss.ws.common.invocation.AbstractInvocationHandler;
@@ -59,6 +61,7 @@
*/
final class InvocationHandlerEJB21 extends AbstractInvocationHandler
{
+ private static final ResourceBundle bundle = BundleUtils.getBundle(InvocationHandlerEJB21.class);
/** EJB21 JNDI name. */
private String jndiName;
@@ -90,7 +93,7 @@
if (ejbMD == null)
{
- throw new WebServiceException("Cannot obtain ejb meta data for: " + ejbName);
+ throw new WebServiceException(BundleUtils.getMessage(bundle, "CANNOT_OBTAIN_EJB_META_DATA", ejbName));
}
// get the bean's JNDI name
@@ -98,7 +101,7 @@
if (this.jndiName == null)
{
- throw new WebServiceException("Cannot obtain JNDI name for: " + ejbName);
+ throw new WebServiceException(BundleUtils.getMessage(bundle, "CANNOT_OBTAIN_JNDI_NAME", ejbName));
}
}
@@ -118,7 +121,7 @@
final boolean ejb21NotRegistered = !this.server.isRegistered(this.ejb21ContainerName);
if (ejb21NotRegistered)
{
- throw new IllegalArgumentException("Cannot find service endpoint target: " + this.ejb21ContainerName);
+ throw new IllegalArgumentException(BundleUtils.getMessage(bundle, "CANNOT_FIND_SERVICE_ENDPOINT_TARGET", this.ejb21ContainerName));
}
// Inject the Service endpoint interceptor
@@ -154,7 +157,7 @@
}
catch (Exception e)
{
- this.log.error("Method invocation failed with exception: " + e.getMessage(), e);
+ this.log.error(BundleUtils.getMessage(bundle, "METHOD_INVOCATION_FAILED", e.getMessage()), e);
this.handleInvocationException(e);
}
}
@@ -171,13 +174,13 @@
final MessageContext msgContext = wsInvocation.getInvocationContext().getAttachment(MessageContext.class);
if (msgContext == null)
{
- throw new IllegalStateException("Cannot obtain MessageContext");
+ throw new IllegalStateException(BundleUtils.getMessage(bundle, "CANNOT_OBTAIN_MESSAGECONTEXT"));
}
final HandlerCallback callback = wsInvocation.getInvocationContext().getAttachment(HandlerCallback.class);
if (callback == null)
{
- throw new IllegalStateException("Cannot obtain HandlerCallback");
+ throw new IllegalStateException(BundleUtils.getMessage(bundle, "CANNOT_OBTAIN_HANDLERCALLBACK"));
}
// prepare security data
@@ -234,11 +237,11 @@
currentInterceptor = nextInterceptor;
}
- this.log.warn("Cannot find EJB 21 service endpoint interceptor insert point");
+ this.log.warn(BundleUtils.getMessage(bundle, "CANNOT_FIND_EJB21_INSERT_POINT"));
}
catch (Exception ex)
{
- this.log.warn("Cannot register EJB 21 service endpoint interceptor: ", ex);
+ this.log.warn(BundleUtils.getMessage(bundle, "CANNOT_REGISTER_EJB21_INTERCEPTOR"), ex);
}
}
}
Modified: container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerEJB3.java
===================================================================
--- container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerEJB3.java 2011-06-22 22:47:15 UTC (rev 14605)
+++ container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerEJB3.java 2011-06-23 02:56:41 UTC (rev 14606)
@@ -22,6 +22,7 @@
package org.jboss.webservices.integration.invocation;
import java.lang.reflect.Method;
+import java.util.ResourceBundle;
import javax.naming.Context;
import javax.naming.NamingException;
@@ -30,6 +31,7 @@
import org.jboss.ejb3.EJBContainer;
import org.jboss.webservices.integration.util.ASHelper;
+import org.jboss.ws.api.util.BundleUtils;
import org.jboss.ws.common.injection.ThreadLocalAwareWebServiceContext;
import org.jboss.ws.common.invocation.AbstractInvocationHandler;
import org.jboss.wsf.spi.SPIProvider;
@@ -50,6 +52,7 @@
*/
final class InvocationHandlerEJB3 extends AbstractInvocationHandler
{
+ private static final ResourceBundle bundle = BundleUtils.getBundle(InvocationHandlerEJB3.class);
/** EJB3 JNDI context. */
private static final String EJB3_JNDI_PREFIX = "java:env/";
@@ -83,7 +86,7 @@
if (this.containerName == null)
{
- throw new IllegalArgumentException("Container name cannot be null");
+ throw new IllegalArgumentException(BundleUtils.getMessage(bundle, "CONTAINER_NAME_CANNOT_BE_NULL"));
}
}
@@ -101,7 +104,7 @@
this.serviceEndpointContainer = this.iocContainer.getBean(this.containerName, ServiceEndpointContainer.class);
if (this.serviceEndpointContainer == null)
{
- throw new WebServiceException("Cannot find service endpoint target: " + this.containerName);
+ throw new WebServiceException(BundleUtils.getMessage(bundle, "CANNOT_FIND_SERVICE_ENDPOINT_TARGET", this.containerName));
}
}
@@ -134,7 +137,7 @@
}
catch (Throwable t)
{
- this.log.error("Method invocation failed with exception: " + t.getMessage(), t);
+ this.log.error(BundleUtils.getMessage(bundle, "METHOD_INVOCATION_FAILED", t.getMessage()), t);
this.handleInvocationException(t);
}
finally
Modified: container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerFactoryImpl.java
===================================================================
--- container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerFactoryImpl.java 2011-06-22 22:47:15 UTC (rev 14605)
+++ container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerFactoryImpl.java 2011-06-23 02:56:41 UTC (rev 14606)
@@ -21,6 +21,9 @@
*/
package org.jboss.webservices.integration.invocation;
+import java.util.ResourceBundle;
+
+import org.jboss.ws.api.util.BundleUtils;
import org.jboss.ws.common.invocation.InvocationHandlerJAXRPC;
import org.jboss.ws.common.invocation.InvocationHandlerJAXWS;
import org.jboss.wsf.spi.invocation.InvocationHandler;
@@ -35,6 +38,7 @@
*/
public final class InvocationHandlerFactoryImpl extends InvocationHandlerFactory
{
+ private static final ResourceBundle bundle = BundleUtils.getBundle(InvocationHandlerFactoryImpl.class);
/**
* Constructor.
*/
@@ -74,7 +78,7 @@
handler = new InvocationHandlerMDB3();
break;
default :
- throw new IllegalArgumentException("Unable to resolve spi.invocation.InvocationHandler for type " + type);
+ throw new IllegalArgumentException(BundleUtils.getMessage(bundle, "UNABLE_TO_RESOLVE", type));
}
return handler;
Added: container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/invocation/Message.properties
===================================================================
--- container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/invocation/Message.properties (rev 0)
+++ container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/invocation/Message.properties 2011-06-23 02:56:41 UTC (rev 14606)
@@ -0,0 +1,14 @@
+CONTAINER_NAME_CANNOT_BE_NULL=Container name cannot be null
+CANNOT_FIND_SERVICE_ENDPOINT_TARGET=Cannot find service endpoint target: {0}
+METHOD_INVOCATION_FAILED_WITH_EXCEPTION=Method invocation failed with exception: {0}
+HANDLER_CALLBACK_NOT_AVAILABLE=Handler callback not available
+CANNOT_PROCESS_HANDLEFAULT=Cannot process handlerChain.handleFault:
+CANNOT_OBTAIN_EJB_META_DATA=Cannot obtain ejb meta data for: {0}
+CANNOT_OBTAIN_JNDI_NAME=Cannot obtain JNDI name for: {0}
+CANNOT_FIND_SERVICE_ENDPOINT_TARGET=Cannot find service endpoint target: {0}
+METHOD_INVOCATION_FAILED=Method invocation failed with exception: {0}
+CANNOT_OBTAIN_MESSAGECONTEXT=Cannot obtain MessageContext
+CANNOT_OBTAIN_HANDLERCALLBACK=Cannot obtain HandlerCallback
+CANNOT_FIND_EJB21_INSERT_POINT=Cannot find EJB 21 service endpoint interceptor insert point
+CANNOT_REGISTER_EJB21_INTERCEPTOR=Cannot register EJB 21 service endpoint interceptor:
+UNABLE_TO_RESOLVE=Unable to resolve spi.invocation.InvocationHandler for type {0}
Modified: container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/invocation/ServiceEndpointInterceptorEJB21.java
===================================================================
--- container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/invocation/ServiceEndpointInterceptorEJB21.java 2011-06-22 22:47:15 UTC (rev 14605)
+++ container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/invocation/ServiceEndpointInterceptorEJB21.java 2011-06-23 02:56:41 UTC (rev 14606)
@@ -21,10 +21,13 @@
*/
package org.jboss.webservices.integration.invocation;
+import java.util.ResourceBundle;
+
import javax.xml.rpc.handler.soap.SOAPMessageContext;
import org.jboss.ejb.plugins.AbstractInterceptor;
import org.jboss.invocation.InvocationKey;
+import org.jboss.ws.api.util.BundleUtils;
import org.jboss.wsf.spi.invocation.HandlerCallback;
import org.jboss.wsf.spi.invocation.Invocation;
import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedHandlerMetaData.HandlerType;
@@ -40,6 +43,7 @@
*/
final class ServiceEndpointInterceptorEJB21 extends AbstractInterceptor
{
+ private static final ResourceBundle bundle = BundleUtils.getBundle(ServiceEndpointInterceptorEJB21.class);
/**
* Constructor.
*/
@@ -71,7 +75,7 @@
if (callback == null || wsInvocation == null)
{
- log.warn("Handler callback not available");
+ log.warn(BundleUtils.getMessage(bundle, "HANDLER_CALLBACK_NOT_AVAILABLE"));
return this.getNext().invoke(jbossInvocation);
}
@@ -114,7 +118,7 @@
}
catch (Exception e)
{
- log.warn("Cannot process handlerChain.handleFault, ignoring: ", e);
+ log.warn(BundleUtils.getMessage(bundle, "CANNOT_PROCESS_HANDLEFAULT"), e);
}
throw ex;
}
Modified: container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/security/JACCPermissionsDeploymentAspect.java
===================================================================
--- container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/security/JACCPermissionsDeploymentAspect.java 2011-06-22 22:47:15 UTC (rev 14605)
+++ container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/security/JACCPermissionsDeploymentAspect.java 2011-06-23 02:56:41 UTC (rev 14606)
@@ -21,14 +21,17 @@
*/
package org.jboss.webservices.integration.security;
+import java.util.ResourceBundle;
+
import javax.security.jacc.PolicyConfiguration;
import javax.security.jacc.PolicyConfigurationFactory;
import org.jboss.metadata.web.jboss.JBossWebMetaData;
import org.jboss.web.WebPermissionMapping;
+import org.jboss.ws.api.util.BundleUtils;
+import org.jboss.ws.common.integration.AbstractDeploymentAspect;
import org.jboss.ws.common.integration.WSHelper;
import org.jboss.wsf.spi.deployment.Deployment;
-import org.jboss.ws.common.integration.AbstractDeploymentAspect;
/**
* Generates JACC permissions. (This is temporary and really hacky solution).
@@ -41,6 +44,7 @@
*/
public final class JACCPermissionsDeploymentAspect extends AbstractDeploymentAspect
{
+ private static final ResourceBundle bundle = BundleUtils.getBundle(JACCPermissionsDeploymentAspect.class);
/**
* Constructor.
*/
@@ -74,7 +78,7 @@
}
catch (Exception e)
{
- throw new RuntimeException("Exception generating JACC perms: ", e);
+ throw new RuntimeException(BundleUtils.getMessage(bundle, "EXCEPTION_GENERATING_JACC_PERMS"), e);
}
}
}
Modified: container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/security/JaasSecurityDomainAdaptorResolverImpl.java
===================================================================
--- container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/security/JaasSecurityDomainAdaptorResolverImpl.java 2011-06-22 22:47:15 UTC (rev 14605)
+++ container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/security/JaasSecurityDomainAdaptorResolverImpl.java 2011-06-23 02:56:41 UTC (rev 14606)
@@ -21,11 +21,14 @@
*/
package org.jboss.webservices.integration.security;
+import java.util.ResourceBundle;
+
import javax.naming.InitialContext;
import javax.naming.NamingException;
import org.jboss.logging.Logger;
import org.jboss.security.plugins.JaasSecurityDomain;
+import org.jboss.ws.api.util.BundleUtils;
import org.jboss.wsf.spi.security.JAASSecurityDomainAdaptor;
import org.jboss.wsf.spi.security.JAASSecurityDomainAdaptorResolver;
@@ -37,6 +40,7 @@
*/
public class JaasSecurityDomainAdaptorResolverImpl implements JAASSecurityDomainAdaptorResolver
{
+ private static final ResourceBundle bundle = BundleUtils.getBundle(JaasSecurityDomainAdaptorResolverImpl.class);
public JAASSecurityDomainAdaptor lookup(String jndi) throws Exception
{
InitialContext ic = null;
@@ -46,13 +50,13 @@
Object o = ic.lookup(jndi);
if (!(o instanceof JaasSecurityDomain))
{
- throw new Exception(jndi + " not bound to a JaasSecurityDomain but to a " + o.getClass().getName() + " instance");
+ throw new Exception(BundleUtils.getMessage(bundle, "NOT_BUNDTO_JAASSECURITYDOMAIN", new Object[] {jndi,o.getClass().getName()}));
}
return new JaasSecurityDomainAdaptorImpl((JaasSecurityDomain)o);
}
catch (NamingException e)
{
- throw new Exception("JNDI failure handling " + jndi, e);
+ throw new Exception(BundleUtils.getMessage(bundle, "JNDI_FAILURE_HANDLING", jndi), e);
}
finally
{
@@ -64,7 +68,7 @@
}
catch (NamingException e)
{
- Logger.getLogger(JaasSecurityDomainAdaptorImpl.class).warn(this + " failed to close InitialContext", e);
+ Logger.getLogger(JaasSecurityDomainAdaptorImpl.class).warn(BundleUtils.getMessage(bundle, "FAILED_TO_CLOSE_INITIALCONTEXT", this), e);
}
}
}
Added: container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/security/Message.properties
===================================================================
--- container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/security/Message.properties (rev 0)
+++ container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/security/Message.properties 2011-06-23 02:56:41 UTC (rev 14606)
@@ -0,0 +1,6 @@
+UNABLE_TO_LOOKUP_AUTHENTICATIONMANAGER=Unable to lookup AuthenticationManager
+SECURITY_CONTEXT_IS_NULL=Security Context is null
+JNDI_FAILURE_HANDLING=JNDI failure handling {0}
+FAILED_TO_CLOSE_INITIALCONTEXT= {0} failed to close InitialContext
+EXCEPTION_GENERATING_JACC_PERMS=Exception generating JACC perms:
+NOT_BUNDTO_JAASSECURITYDOMAIN={0} not bound to a JaasSecurityDomain but to a {1} instance
\ No newline at end of file
Modified: container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/security/SecurityDomainContextAdaptor.java
===================================================================
--- container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/security/SecurityDomainContextAdaptor.java 2011-06-22 22:47:15 UTC (rev 14605)
+++ container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/security/SecurityDomainContextAdaptor.java 2011-06-23 02:56:41 UTC (rev 14606)
@@ -24,6 +24,7 @@
import java.security.AccessController;
import java.security.Principal;
import java.security.PrivilegedAction;
+import java.util.ResourceBundle;
import java.util.Set;
import javax.naming.Context;
@@ -35,6 +36,7 @@
import org.jboss.security.RealmMapping;
import org.jboss.security.SecurityContext;
import org.jboss.security.SecurityContextAssociation;
+import org.jboss.ws.api.util.BundleUtils;
/**
* org.jboss.wsf.spi.security.SecurityDomainContext implementation relying on AuthenticationManager
@@ -43,6 +45,7 @@
* @since 18-May-2011
*/
public final class SecurityDomainContextAdaptor implements org.jboss.wsf.spi.security.SecurityDomainContext {
+ private static final ResourceBundle bundle = BundleUtils.getBundle(SecurityDomainContextAdaptor.class);
private AuthenticationManager authenticationManager;
private RealmMapping realmMapping;
@@ -63,7 +66,7 @@
}
catch (NamingException ne)
{
- throw new RuntimeException("Unable to lookup AuthenticationManager", ne);
+ throw new RuntimeException(BundleUtils.getMessage(bundle, "UNABLE_TO_LOOKUP_AUTHENTICATIONMANAGER"), ne);
}
}
}
@@ -98,7 +101,7 @@
public Void run() {
SecurityContext securityContext = SecurityContextAssociation.getSecurityContext();
if (securityContext == null) {
- throw new IllegalStateException("Security Context is null");
+ throw new IllegalStateException(BundleUtils.getMessage(bundle, "SECURITY_CONTEXT_IS_NULL"));
}
securityContext.getUtil().createSubjectInfo(principal, credential, subject);
return null;
Added: container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/tomcat/Message.properties
===================================================================
--- container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/tomcat/Message.properties (rev 0)
+++ container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/tomcat/Message.properties 2011-06-23 02:56:41 UTC (rev 14606)
@@ -0,0 +1 @@
+CANNOT_OBTAIN_DEPLOYMENT_PROPERTY=Cannot obtain deployment property : {0}
Modified: container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/tomcat/WebMetaDataModifier.java
===================================================================
--- container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/tomcat/WebMetaDataModifier.java 2011-06-22 22:47:15 UTC (rev 14605)
+++ container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/tomcat/WebMetaDataModifier.java 2011-06-23 02:56:41 UTC (rev 14606)
@@ -22,6 +22,7 @@
package org.jboss.webservices.integration.tomcat;
import java.util.List;
+import java.util.ResourceBundle;
import org.jboss.logging.Logger;
import org.jboss.metadata.javaee.spec.ParamValueMetaData;
@@ -29,6 +30,7 @@
import org.jboss.metadata.web.spec.ServletMetaData;
import org.jboss.webservices.integration.util.ASHelper;
import org.jboss.webservices.integration.util.WebMetaDataHelper;
+import org.jboss.ws.api.util.BundleUtils;
import org.jboss.ws.common.integration.WSConstants;
import org.jboss.ws.common.integration.WSHelper;
import org.jboss.wsf.spi.deployment.Deployment;
@@ -44,6 +46,7 @@
*/
final class WebMetaDataModifier
{
+ private static final ResourceBundle bundle = BundleUtils.getBundle(WebMetaDataModifier.class);
/** Logger. */
private final Logger log = Logger.getLogger(WebMetaDataModifier.class);
@@ -124,7 +127,7 @@
if (transportClassName == null)
{
- throw new IllegalStateException("Cannot obtain deployment property : " + WSConstants.STACK_TRANSPORT_CLASS);
+ throw new IllegalStateException(BundleUtils.getMessage(bundle, "CANNOT_OBTAIN_DEPLOYMENT_PROPERTY", WSConstants.STACK_TRANSPORT_CLASS));
}
return transportClassName;
Modified: container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/util/ASHelper.java
===================================================================
--- container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/util/ASHelper.java 2011-06-22 22:47:15 UTC (rev 14605)
+++ container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/util/ASHelper.java 2011-06-23 02:56:41 UTC (rev 14606)
@@ -24,6 +24,7 @@
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
+import java.util.ResourceBundle;
import javax.jws.WebService;
import javax.servlet.Servlet;
@@ -36,6 +37,7 @@
import org.jboss.metadata.web.jboss.JBossServletMetaData;
import org.jboss.metadata.web.jboss.JBossWebMetaData;
import org.jboss.metadata.web.spec.ServletMetaData;
+import org.jboss.ws.api.util.BundleUtils;
import org.jboss.wsf.spi.deployment.Deployment.DeploymentType;
import org.jboss.wsf.spi.deployment.integration.WebServiceDeclaration;
import org.jboss.wsf.spi.deployment.integration.WebServiceDeployment;
@@ -47,6 +49,7 @@
*/
public final class ASHelper
{
+ private static final ResourceBundle bundle = BundleUtils.getBundle(ASHelper.class);
/**
* EJB invocation property.
*/
@@ -272,7 +275,7 @@
}
}
- throw new IllegalStateException("Cannot find servlet for link: " + servletName);
+ throw new IllegalStateException(BundleUtils.getMessage(bundle, "CANNOT_FIND_SERVLET_FOR_LINK", servletName));
}
/**
@@ -301,7 +304,7 @@
}
catch (ClassNotFoundException cnfe)
{
- ASHelper.LOGGER.warn("Cannot load servlet class: " + endpointClassName, cnfe);
+ ASHelper.LOGGER.warn(BundleUtils.getMessage(bundle, "CANNOT_LOAD_SERVLET_CLASS", endpointClassName), cnfe);
}
}
@@ -322,7 +325,7 @@
final A value = unit.getAttachment(key);
if (value == null)
{
- ASHelper.LOGGER.error("Cannot find attachment in deployment unit: " + key);
+ ASHelper.LOGGER.error(BundleUtils.getMessage(bundle, "CANNOT_FIND_ATTACHMENT_IN_DEPLOYMENT_UNIT", key));
throw new IllegalStateException();
}
@@ -367,7 +370,7 @@
{
if (wsDescriptionsMD.size() > 1)
{
- ASHelper.LOGGER.warn("Multiple <webservice-description> elements not supported");
+ ASHelper.LOGGER.warn(BundleUtils.getMessage(bundle, "MULTIPLE_WS_DESP_ELEMENTS_NOT_SUPPORTED"));
}
if (wsDescriptionsMD.size() > 0)
Added: container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/util/Message.properties
===================================================================
--- container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/util/Message.properties (rev 0)
+++ container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/util/Message.properties 2011-06-23 02:56:41 UTC (rev 14606)
@@ -0,0 +1,4 @@
+CANNOT_FIND_SERVLET_FOR_LINK=Cannot find servlet for link: {0}
+CANNOT_LOAD_SERVLET_CLASS=Cannot load servlet class: {0}
+CANNOT_FIND_ATTACHMENT_IN_DEPLOYMENT_UNIT=Cannot find attachment in deployment unit: {0}
+MULTIPLE_WS_DESP_ELEMENTS_NOT_SUPPORTED=Multiple <webservice-description> elements not supported
Added: container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/weld/Message.properties
===================================================================
--- container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/weld/Message.properties (rev 0)
+++ container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/weld/Message.properties 2011-06-23 02:56:41 UTC (rev 14606)
@@ -0,0 +1 @@
+UNABLE_TO_LOCATE_BEANMANAGER=Unable to locate BeanManager
Modified: container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/weld/WeldInvocationHandler.java
===================================================================
--- container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/weld/WeldInvocationHandler.java 2011-06-22 22:47:15 UTC (rev 14605)
+++ container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/weld/WeldInvocationHandler.java 2011-06-23 02:56:41 UTC (rev 14606)
@@ -21,11 +21,14 @@
*/
package org.jboss.webservices.integration.weld;
+import java.util.ResourceBundle;
+
import javax.naming.InitialContext;
import javax.naming.NamingException;
import org.jboss.weld.integration.injection.NonContextualObjectInjectionHelper;
import org.jboss.weld.manager.api.WeldManager;
+import org.jboss.ws.api.util.BundleUtils;
import org.jboss.ws.common.invocation.AbstractInvocationHandlerJSE;
import org.jboss.wsf.spi.deployment.Endpoint;
import org.jboss.wsf.spi.invocation.Invocation;
@@ -39,6 +42,7 @@
*/
public final class WeldInvocationHandler extends AbstractInvocationHandlerJSE
{
+ private static final ResourceBundle bundle = BundleUtils.getBundle(WeldInvocationHandler.class);
private static final String BEAN_MANAGER_JNDI_NAME = "java:comp/BeanManager";
@@ -81,7 +85,7 @@
WeldManager beanManager = (WeldManager) new InitialContext().lookup(BEAN_MANAGER_JNDI_NAME);
NonContextualObjectInjectionHelper.injectNonContextualInstance(instance, beanManager);
} catch (NamingException e) {
- throw new IllegalStateException("Unable to locate BeanManager");
+ throw new IllegalStateException(BundleUtils.getMessage(bundle, "UNABLE_TO_LOCATE_BEANMANAGER"));
}
}
13 years, 6 months
JBossWS SVN: r14605 - stack/cxf/trunk/modules/testsuite/cxf-tests/scripts.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2011-06-22 18:47:15 -0400 (Wed, 22 Jun 2011)
New Revision: 14605
Modified:
stack/cxf/trunk/modules/testsuite/cxf-tests/scripts/cxf-jars-jaxws.xml
Log:
Make sure @InInterceptor is being considered
Modified: stack/cxf/trunk/modules/testsuite/cxf-tests/scripts/cxf-jars-jaxws.xml
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/scripts/cxf-jars-jaxws.xml 2011-06-22 22:40:39 UTC (rev 14604)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/scripts/cxf-jars-jaxws.xml 2011-06-22 22:47:15 UTC (rev 14605)
@@ -215,6 +215,9 @@
<zipfileset
dir="${tests.output.dir}/test-resources/jaxws/samples/wsrm/WEB-INF/wsdl"
prefix="WEB-INF/wsdl"/>
+ <manifest>
+ <attribute name="Dependencies" value="org.apache.cxf"/>
+ </manifest>
</war>
<!-- jaxws-samples-wsse-policy-sign -->
13 years, 6 months
JBossWS SVN: r14604 - in stack/cxf/trunk/modules/testsuite: cxf-spring-tests/src/test/resources/jaxws/cxf/descriptor/WEB-INF and 1 other directory.
by jbossws-commits@lists.jboss.org
Author: richard.opalka(a)jboss.com
Date: 2011-06-22 18:40:39 -0400 (Wed, 22 Jun 2011)
New Revision: 14604
Modified:
stack/cxf/trunk/modules/testsuite/cxf-spring-tests/src/test/resources/jaxws/cxf/descriptor/WEB-INF/web.xml
stack/cxf/trunk/modules/testsuite/pom.xml
Log:
[JBWS-3321] excluding test
Modified: stack/cxf/trunk/modules/testsuite/cxf-spring-tests/src/test/resources/jaxws/cxf/descriptor/WEB-INF/web.xml
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-spring-tests/src/test/resources/jaxws/cxf/descriptor/WEB-INF/web.xml 2011-06-22 22:22:34 UTC (rev 14603)
+++ stack/cxf/trunk/modules/testsuite/cxf-spring-tests/src/test/resources/jaxws/cxf/descriptor/WEB-INF/web.xml 2011-06-22 22:40:39 UTC (rev 14604)
@@ -6,12 +6,12 @@
version="2.4">
<servlet>
- <servlet-name>Test_Service_Servlet</servlet-name>
+ <servlet-name>Test Service Servlet</servlet-name>
<servlet-class>org.jboss.test.ws.jaxws.cxf.descriptor.DescriptorEndpointImpl</servlet-class>
</servlet>
<servlet-mapping>
- <servlet-name>Test_Service_Servlet</servlet-name>
+ <servlet-name>Test Service Servlet</servlet-name>
<url-pattern>/*</url-pattern>
</servlet-mapping>
Modified: stack/cxf/trunk/modules/testsuite/pom.xml
===================================================================
--- stack/cxf/trunk/modules/testsuite/pom.xml 2011-06-22 22:22:34 UTC (rev 14603)
+++ stack/cxf/trunk/modules/testsuite/pom.xml 2011-06-22 22:40:39 UTC (rev 14604)
@@ -1072,6 +1072,9 @@
<!-- # [JBWS-3306] No XPathFactory implementation found by a JAXWS client on AS7 -->
<exclude>org/jboss/test/ws/jaxws/samples/exception/ExceptionServletTestCase*</exclude>
+ <!-- # [JBWS-3321] Enhance ModelDA to generate compatible PathElements -->
+ <exclude>org/jboss/test/ws/jaxws/cxf/descriptor/DescriptorJSETestCase*</exclude>
+
<!-- JAXR not available -->
<exclude>org/jboss/test/ws/jaxws/samples/jaxr/**</exclude>
13 years, 6 months
JBossWS SVN: r14603 - stack/native/trunk/modules/testsuite.
by jbossws-commits@lists.jboss.org
Author: richard.opalka(a)jboss.com
Date: 2011-06-22 18:22:34 -0400 (Wed, 22 Jun 2011)
New Revision: 14603
Modified:
stack/native/trunk/modules/testsuite/pom.xml
Log:
[AS7-1093] excluding test
Modified: stack/native/trunk/modules/testsuite/pom.xml
===================================================================
--- stack/native/trunk/modules/testsuite/pom.xml 2011-06-22 20:41:20 UTC (rev 14602)
+++ stack/native/trunk/modules/testsuite/pom.xml 2011-06-22 22:22:34 UTC (rev 14603)
@@ -821,6 +821,9 @@
<exclude>org/jboss/test/ws/jaxws/samples/serviceref/**</exclude>
<exclude>org/jboss/test/ws/jaxws/wsaddressing/replyto/**</exclude>
+ <!-- [AS7-1093] failing deployments succesfully deployed -->
+ <exclude>org/jboss/test/ws/jaxws/jbws1582/JBWS1582TestCase*</exclude>
+
<!-- JAXR not available -->
<exclude>org/jboss/test/ws/jaxws/samples/jaxr/**</exclude>
13 years, 6 months
JBossWS SVN: r14602 - stack/cxf/trunk/modules/testsuite/cxf-spring-tests/src/test/resources/jaxws/cxf/descriptor/WEB-INF.
by jbossws-commits@lists.jboss.org
Author: richard.opalka(a)jboss.com
Date: 2011-06-22 16:41:20 -0400 (Wed, 22 Jun 2011)
New Revision: 14602
Modified:
stack/cxf/trunk/modules/testsuite/cxf-spring-tests/src/test/resources/jaxws/cxf/descriptor/WEB-INF/web.xml
Log:
don't use spaces in servlet name - prevent PathElement to throw java.lang.IllegalArgumentException
Modified: stack/cxf/trunk/modules/testsuite/cxf-spring-tests/src/test/resources/jaxws/cxf/descriptor/WEB-INF/web.xml
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-spring-tests/src/test/resources/jaxws/cxf/descriptor/WEB-INF/web.xml 2011-06-22 08:58:49 UTC (rev 14601)
+++ stack/cxf/trunk/modules/testsuite/cxf-spring-tests/src/test/resources/jaxws/cxf/descriptor/WEB-INF/web.xml 2011-06-22 20:41:20 UTC (rev 14602)
@@ -6,12 +6,12 @@
version="2.4">
<servlet>
- <servlet-name>Test Service Servlet</servlet-name>
+ <servlet-name>Test_Service_Servlet</servlet-name>
<servlet-class>org.jboss.test.ws.jaxws.cxf.descriptor.DescriptorEndpointImpl</servlet-class>
</servlet>
<servlet-mapping>
- <servlet-name>Test Service Servlet</servlet-name>
+ <servlet-name>Test_Service_Servlet</servlet-name>
<url-pattern>/*</url-pattern>
</servlet-mapping>
13 years, 6 months
JBossWS SVN: r14601 - in api/trunk/src/main/java/org/jboss/ws/api: handler and 2 other directories.
by jbossws-commits@lists.jboss.org
Author: jim.ma
Date: 2011-06-22 04:58:49 -0400 (Wed, 22 Jun 2011)
New Revision: 14601
Added:
api/trunk/src/main/java/org/jboss/ws/api/handler/Message.properties
api/trunk/src/main/java/org/jboss/ws/api/tools/Message.properties
Modified:
api/trunk/src/main/java/org/jboss/ws/api/annotation/Message.properties
api/trunk/src/main/java/org/jboss/ws/api/annotation/TransportGuarantee.java
api/trunk/src/main/java/org/jboss/ws/api/handler/GenericHandler.java
api/trunk/src/main/java/org/jboss/ws/api/tools/SecurityActions.java
api/trunk/src/main/java/org/jboss/ws/api/util/DOMUtils.java
api/trunk/src/main/java/org/jboss/ws/api/util/Message.properties
api/trunk/src/main/java/org/jboss/ws/api/util/ServiceLoader.java
Log:
[JBWS-3316]:i18n execption message
Modified: api/trunk/src/main/java/org/jboss/ws/api/annotation/Message.properties
===================================================================
--- api/trunk/src/main/java/org/jboss/ws/api/annotation/Message.properties 2011-06-22 08:06:38 UTC (rev 14600)
+++ api/trunk/src/main/java/org/jboss/ws/api/annotation/Message.properties 2011-06-22 08:58:49 UTC (rev 14601)
@@ -1,2 +1,3 @@
+ILLEGAL_TRANSPORT_GUARANTEE=Illegal transport guarantee value: {0}
NON_STANDARD_METHOD=Non-standard auth method value : {0}
-ILLEGAL_AUTH_METHOD= Illegal auth method : {0}
\ No newline at end of file
+ILLEGAL_AUTH_METHOD= Illegal auth method : {0}
Modified: api/trunk/src/main/java/org/jboss/ws/api/annotation/TransportGuarantee.java
===================================================================
--- api/trunk/src/main/java/org/jboss/ws/api/annotation/TransportGuarantee.java 2011-06-22 08:06:38 UTC (rev 14600)
+++ api/trunk/src/main/java/org/jboss/ws/api/annotation/TransportGuarantee.java 2011-06-22 08:58:49 UTC (rev 14601)
@@ -21,6 +21,10 @@
*/
package org.jboss.ws.api.annotation;
+import java.util.ResourceBundle;
+
+import org.jboss.ws.api.util.BundleUtils;
+
/**
* The transportGuarantee specifies that the communication
* between client and server should be NONE, INTEGRAL, or
@@ -37,6 +41,7 @@
*/
public final class TransportGuarantee
{
+ private static final ResourceBundle bundle = BundleUtils.getBundle(TransportGuarantee.class);
/**
* Application does not require any transport guarantees.
@@ -89,7 +94,7 @@
}
}
- throw new IllegalArgumentException("Illegal transport guarantee value: " + s);
+ throw new IllegalArgumentException(BundleUtils.getMessage(bundle, "ILLEGAL_TRANSPORT_GUARANTEE", s));
}
}
Modified: api/trunk/src/main/java/org/jboss/ws/api/handler/GenericHandler.java
===================================================================
--- api/trunk/src/main/java/org/jboss/ws/api/handler/GenericHandler.java 2011-06-22 08:06:38 UTC (rev 14600)
+++ api/trunk/src/main/java/org/jboss/ws/api/handler/GenericHandler.java 2011-06-22 08:58:49 UTC (rev 14601)
@@ -21,9 +21,13 @@
*/
package org.jboss.ws.api.handler;
+import java.util.ResourceBundle;
+
import javax.xml.ws.handler.Handler;
import javax.xml.ws.handler.MessageContext;
+import org.jboss.ws.api.util.BundleUtils;
+
/**
* A generic JAX-WS handler
*
@@ -32,6 +36,7 @@
*/
public abstract class GenericHandler implements Handler
{
+ private static final ResourceBundle bundle = BundleUtils.getBundle(GenericHandler.class);
private String handlerName;
public String getHandlerName()
@@ -48,7 +53,7 @@
{
Boolean outbound = (Boolean)msgContext.get(MessageContext.MESSAGE_OUTBOUND_PROPERTY);
if (outbound == null)
- throw new IllegalStateException("Cannot obtain required property: " + MessageContext.MESSAGE_OUTBOUND_PROPERTY);
+ throw new IllegalStateException(BundleUtils.getMessage(bundle, "CANNOT_OBTAIN_REQUIRED_PROPERTY", MessageContext.MESSAGE_OUTBOUND_PROPERTY));
return outbound ? handleOutbound(msgContext) : handleInbound(msgContext);
}
Added: api/trunk/src/main/java/org/jboss/ws/api/handler/Message.properties
===================================================================
--- api/trunk/src/main/java/org/jboss/ws/api/handler/Message.properties (rev 0)
+++ api/trunk/src/main/java/org/jboss/ws/api/handler/Message.properties 2011-06-22 08:58:49 UTC (rev 14601)
@@ -0,0 +1 @@
+CANNOT_OBTAIN_REQUIRED_PROPERTY=Cannot obtain required property: {0}
Added: api/trunk/src/main/java/org/jboss/ws/api/tools/Message.properties
===================================================================
--- api/trunk/src/main/java/org/jboss/ws/api/tools/Message.properties (rev 0)
+++ api/trunk/src/main/java/org/jboss/ws/api/tools/Message.properties 2011-06-22 08:58:49 UTC (rev 14601)
@@ -0,0 +1,2 @@
+ERROR_SETTING_CONTEXT_CLASSLOADER=Error setting context classloader
+ERROR_RUNNING_PRIVILEGED_ACTION=Error running privileged action
Modified: api/trunk/src/main/java/org/jboss/ws/api/tools/SecurityActions.java
===================================================================
--- api/trunk/src/main/java/org/jboss/ws/api/tools/SecurityActions.java 2011-06-22 08:06:38 UTC (rev 14600)
+++ api/trunk/src/main/java/org/jboss/ws/api/tools/SecurityActions.java 2011-06-22 08:58:49 UTC (rev 14601)
@@ -25,7 +25,10 @@
import java.security.PrivilegedAction;
import java.security.PrivilegedActionException;
import java.security.PrivilegedExceptionAction;
+import java.util.ResourceBundle;
+import org.jboss.ws.api.util.BundleUtils;
+
/**
* Security actions for this package
*
@@ -35,6 +38,7 @@
*/
class SecurityActions
{
+ private static final ResourceBundle bundle = BundleUtils.getBundle(SecurityActions.class);
/**
* Get context classloader.
*
@@ -98,14 +102,14 @@
}
catch (Throwable e)
{
- throw new RuntimeException("Error setting context classloader", e);
+ throw new RuntimeException(BundleUtils.getMessage(bundle, "ERROR_SETTING_CONTEXT_CLASSLOADER"), e);
}
}
});
}
catch (PrivilegedActionException e)
{
- throw new RuntimeException("Error running privileged action", e.getCause());
+ throw new RuntimeException(BundleUtils.getMessage(bundle, "ERROR_RUNNING_PRIVILEGED_ACTION"), e.getCause());
}
}
}
Modified: api/trunk/src/main/java/org/jboss/ws/api/util/DOMUtils.java
===================================================================
--- api/trunk/src/main/java/org/jboss/ws/api/util/DOMUtils.java 2011-06-22 08:06:38 UTC (rev 14600)
+++ api/trunk/src/main/java/org/jboss/ws/api/util/DOMUtils.java 2011-06-22 08:58:49 UTC (rev 14601)
@@ -111,7 +111,7 @@
}
if (namespaceURI.equals(""))
- throw new IllegalArgumentException("Cannot find namespace uri for: " + qualifiedName);
+ throw new IllegalArgumentException(BundleUtils.getMessage(bundle, "CANNOT_FIND_NAMESPACE_URI_FOR", qualifiedName));
}
else
{
@@ -553,7 +553,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: api/trunk/src/main/java/org/jboss/ws/api/util/Message.properties
===================================================================
--- api/trunk/src/main/java/org/jboss/ws/api/util/Message.properties 2011-06-22 08:06:38 UTC (rev 14600)
+++ api/trunk/src/main/java/org/jboss/ws/api/util/Message.properties 2011-06-22 08:58:49 UTC (rev 14601)
@@ -1 +1,5 @@
-CAN_NOT_PARSE = Cannot parse: {0}
\ No newline at end of file
+CANNOT_FIND_NAMESPACE_URI_FOR=Cannot find namespace uri for: {0}
+SOURCE_TYPE_NOT_IMPLEMENTED=Source type not implemented: {0}
+FAILED_TO_LOAD=Failed to load {0}: {1}
+CANNOT_LOAD_PROPERTIES=Cannot load properties: {0}
+CAN_NOT_PARSE = Cannot parse: {0}
Modified: api/trunk/src/main/java/org/jboss/ws/api/util/ServiceLoader.java
===================================================================
--- api/trunk/src/main/java/org/jboss/ws/api/util/ServiceLoader.java 2011-06-22 08:06:38 UTC (rev 14600)
+++ api/trunk/src/main/java/org/jboss/ws/api/util/ServiceLoader.java 2011-06-22 08:58:49 UTC (rev 14601)
@@ -32,6 +32,7 @@
import java.util.Collections;
import java.util.Map;
import java.util.Properties;
+import java.util.ResourceBundle;
import java.util.WeakHashMap;
import java.util.concurrent.ConcurrentHashMap;
@@ -57,6 +58,7 @@
*/
public final class ServiceLoader
{
+ private static final ResourceBundle bundle = BundleUtils.getBundle(ServiceLoader.class);
/**
* A synchronized weak hash map that keeps factory names retrieved using Service API (META-INF/services/*) for each classloader.
* Weak keys are used to remove entries when classloaders are garbage collected; values are service-property-name -> factory name maps.
@@ -155,7 +157,7 @@
}
catch (Throwable t)
{
- throw new IllegalStateException("Failed to load " + propertyName + ": " + factoryName, t);
+ throw new IllegalStateException(BundleUtils.getMessage(bundle, "FAILED_TO_LOAD", new Object[]{ propertyName, factoryName}), t);
}
return factory;
@@ -205,7 +207,7 @@
}
catch (Throwable t)
{
- throw new IllegalStateException("Failed to load " + propertyName + ": " + factoryName, t);
+ throw new IllegalStateException(BundleUtils.getMessage(bundle, "FAILED_TO_LOAD", new Object[]{ propertyName , factoryName}), t);
}
}
@@ -248,7 +250,7 @@
}
catch (Throwable t)
{
- throw new IllegalStateException("Failed to load " + propertyName + ": " + factoryName, t);
+ throw new IllegalStateException(BundleUtils.getMessage(bundle, "FAILED_TO_LOAD", new Object[]{ propertyName , factoryName}), t);
}
}
@@ -269,7 +271,7 @@
}
catch (Throwable t)
{
- throw new IllegalStateException("Failed to load: " + defaultFactory, t);
+ throw new IllegalStateException(BundleUtils.getMessage(bundle, "FAILED_TO_LOAD", defaultFactory), t);
}
}
@@ -312,7 +314,7 @@
}
catch (IOException ex)
{
- throw new SecurityException("Cannot load properties: " + filename, ex);
+ throw new SecurityException(BundleUtils.getMessage(bundle, "CANNOT_LOAD_PROPERTIES", filename), ex);
}
finally
{
13 years, 6 months
JBossWS SVN: r14600 - in common/trunk: src/main/java/org/jboss/ws/common and 15 other directories.
by jbossws-commits@lists.jboss.org
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);
13 years, 6 months