[jbossws-commits] JBossWS SVN: r14607 - in stack/cxf/trunk: modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration and 4 other directories.

jbossws-commits at lists.jboss.org jbossws-commits at lists.jboss.org
Wed Jun 22 23:27:08 EDT 2011


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>



More information about the jbossws-commits mailing list