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