You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wink.apache.org by ro...@apache.org on 2010/02/25 21:49:16 UTC

svn commit: r916445 - in /incubator/wink/trunk: wink-client/src/main/java/org/apache/wink/client/ wink-client/src/main/java/org/apache/wink/client/internal/handlers/ wink-common/src/main/resources/org/apache/wink/common/internal/i18n/

Author: rott
Date: Thu Feb 25 20:49:16 2010
New Revision: 916445

URL: http://svn.apache.org/viewvc?rev=916445&view=rev
Log:
externalize strings for logging

Modified:
    incubator/wink/trunk/wink-client/src/main/java/org/apache/wink/client/ClientConfig.java
    incubator/wink/trunk/wink-client/src/main/java/org/apache/wink/client/EntityType.java
    incubator/wink/trunk/wink-client/src/main/java/org/apache/wink/client/internal/handlers/AbstractConnectionHandler.java
    incubator/wink/trunk/wink-client/src/main/java/org/apache/wink/client/internal/handlers/ClientResponseImpl.java
    incubator/wink/trunk/wink-common/src/main/resources/org/apache/wink/common/internal/i18n/resource.properties

Modified: incubator/wink/trunk/wink-client/src/main/java/org/apache/wink/client/ClientConfig.java
URL: http://svn.apache.org/viewvc/incubator/wink/trunk/wink-client/src/main/java/org/apache/wink/client/ClientConfig.java?rev=916445&r1=916444&r2=916445&view=diff
==============================================================================
--- incubator/wink/trunk/wink-client/src/main/java/org/apache/wink/client/ClientConfig.java (original)
+++ incubator/wink/trunk/wink-client/src/main/java/org/apache/wink/client/ClientConfig.java Thu Feb 25 20:49:16 2010
@@ -34,6 +34,7 @@
 import org.apache.wink.client.internal.handlers.HttpURLConnectionHandler;
 import org.apache.wink.common.WinkApplication;
 import org.apache.wink.common.internal.application.ApplicationFileLoader;
+import org.apache.wink.common.internal.i18n.Messages;
 
 /**
  * Provides client configuration. The ClientConfig is implemented using the
@@ -143,7 +144,7 @@
      */
     public final ClientConfig proxyPort(int proxyPort) {
         if (!modifiable) {
-            throw new ClientConfigException("configuration is unmodifiable");
+            throw new ClientConfigException(Messages.getMessage("clientConfigurationUnmodifiable"));
         }
         if (proxyPort <= 0) {
             proxyPort = 80;
@@ -170,7 +171,7 @@
      */
     public final ClientConfig connectTimeout(int connectTimeout) {
         if (!modifiable) {
-            throw new ClientConfigException("configuration is unmodifiable");
+            throw new ClientConfigException(Messages.getMessage("clientConfigurationUnmodifiable"));
         }
         this.connectTimeout = connectTimeout;
         return this;
@@ -194,7 +195,7 @@
      */
     public final ClientConfig readTimeout(int readTimeout) {
         if (!modifiable) {
-            throw new ClientConfigException("configuration is unmodifiable");
+            throw new ClientConfigException(Messages.getMessage("clientConfigurationUnmodifiable"));
         }
         this.readTimeout = readTimeout;
         return this;
@@ -220,7 +221,7 @@
      */
     public final ClientConfig followRedirects(boolean followRedirects) {
         if (!modifiable) {
-            throw new ClientConfigException("configuration is unmodifiable");
+            throw new ClientConfigException(Messages.getMessage("clientConfigurationUnmodifiable"));
         }
         this.followRedirects = followRedirects;
         return this;
@@ -247,7 +248,7 @@
      */
     public final ClientConfig acceptHeaderAutoSet(boolean isAcceptHeaderAutoSet) {
         if (!modifiable) {
-            throw new ClientConfigException("configuration is unmodifiable");
+            throw new ClientConfigException(Messages.getMessage("clientConfigurationUnmodifiable"));
         }
         this.isAcceptHeaderAutoSet = isAcceptHeaderAutoSet;
         return this;
@@ -271,7 +272,7 @@
      */
     public final ClientConfig handlers(ClientHandler... handlers) {
         if (!modifiable) {
-            throw new ClientConfigException("configuration is unmodifiable");
+            throw new ClientConfigException(Messages.getMessage("clientConfigurationUnmodifiable"));
         }
         for (ClientHandler handler : handlers) {
             this.handlers.add(handler);
@@ -323,7 +324,7 @@
      */
     public final ClientConfig applications(Application... applications) {
         if (!modifiable) {
-            throw new ClientConfigException("configuration is unmodifiable");
+            throw new ClientConfigException(Messages.getMessage("clientConfigurationUnmodifiable"));
         }
         if (this.applications == null) {
             initDefaultApplication();

Modified: incubator/wink/trunk/wink-client/src/main/java/org/apache/wink/client/EntityType.java
URL: http://svn.apache.org/viewvc/incubator/wink/trunk/wink-client/src/main/java/org/apache/wink/client/EntityType.java?rev=916445&r1=916444&r2=916445&view=diff
==============================================================================
--- incubator/wink/trunk/wink-client/src/main/java/org/apache/wink/client/EntityType.java (original)
+++ incubator/wink/trunk/wink-client/src/main/java/org/apache/wink/client/EntityType.java Thu Feb 25 20:49:16 2010
@@ -23,6 +23,7 @@
 import java.lang.reflect.ParameterizedType;
 import java.lang.reflect.Type;
 
+import org.apache.wink.common.internal.i18n.Messages;
 import org.apache.wink.common.internal.utils.GenericsUtils;
 
 /**
@@ -57,7 +58,7 @@
     protected EntityType() {
         Type superclass = this.getClass().getGenericSuperclass();
         if (!(superclass instanceof ParameterizedType)) {
-            throw new ClientRuntimeException("EntityType must be parameterized");
+            throw new ClientRuntimeException(Messages.getMessage("entityTypeMustBeParameterized"));
         }
         this.type = ((ParameterizedType)superclass).getActualTypeArguments()[0];
         this.cls = (Class<T>)GenericsUtils.getClassType(type);

Modified: incubator/wink/trunk/wink-client/src/main/java/org/apache/wink/client/internal/handlers/AbstractConnectionHandler.java
URL: http://svn.apache.org/viewvc/incubator/wink/trunk/wink-client/src/main/java/org/apache/wink/client/internal/handlers/AbstractConnectionHandler.java?rev=916445&r1=916444&r2=916445&view=diff
==============================================================================
--- incubator/wink/trunk/wink-client/src/main/java/org/apache/wink/client/internal/handlers/AbstractConnectionHandler.java (original)
+++ incubator/wink/trunk/wink-client/src/main/java/org/apache/wink/client/internal/handlers/AbstractConnectionHandler.java Thu Feb 25 20:49:16 2010
@@ -39,6 +39,7 @@
 import org.apache.wink.client.handlers.OutputStreamAdapter;
 import org.apache.wink.client.internal.ClientRuntimeContext;
 import org.apache.wink.common.RuntimeContext;
+import org.apache.wink.common.internal.i18n.Messages;
 import org.apache.wink.common.internal.registry.ProvidersRegistry;
 import org.apache.wink.common.internal.runtime.RuntimeContextTLS;
 
@@ -97,7 +98,7 @@
                                                        contentMediaType,
                                                        runtimeContext);
             if (writer == null) {
-                throw new RuntimeException(String.format("No writer for type %s and media type %s",
+                throw new RuntimeException(String.format(Messages.getMessage("clientNoWriterForTypeAndMediaType"),
                                                          String.valueOf(type),
                                                          contentType));
             }

Modified: incubator/wink/trunk/wink-client/src/main/java/org/apache/wink/client/internal/handlers/ClientResponseImpl.java
URL: http://svn.apache.org/viewvc/incubator/wink/trunk/wink-client/src/main/java/org/apache/wink/client/internal/handlers/ClientResponseImpl.java?rev=916445&r1=916444&r2=916445&view=diff
==============================================================================
--- incubator/wink/trunk/wink-client/src/main/java/org/apache/wink/client/internal/handlers/ClientResponseImpl.java (original)
+++ incubator/wink/trunk/wink-client/src/main/java/org/apache/wink/client/internal/handlers/ClientResponseImpl.java Thu Feb 25 20:49:16 2010
@@ -34,6 +34,7 @@
 import org.apache.wink.client.EntityType;
 import org.apache.wink.client.internal.ClientRuntimeContext;
 import org.apache.wink.common.RuntimeContext;
+import org.apache.wink.common.internal.i18n.Messages;
 import org.apache.wink.common.internal.registry.ProvidersRegistry;
 import org.apache.wink.common.internal.runtime.RuntimeContextTLS;
 
@@ -66,7 +67,7 @@
             return null;
         }
         throw new ClassCastException(String
-            .format("entity of type %s cannot be retrieved as type %s",
+            .format(Messages.getMessage("clientCannotConvertEntity"),
                     entity.getClass().getName(),
                     type.getName()));
     }
@@ -116,7 +117,7 @@
                                                        contentMediaType,
                                                        runtimeContext);
             if (reader == null) {
-                throw new RuntimeException(String.format("No reader for type %s and media type %s",
+                throw new RuntimeException(String.format(Messages.getMessage("clientNoReaderForTypeAndMediaType"),
                                                          String.valueOf(type),
                                                          contentType));
             }

Modified: incubator/wink/trunk/wink-common/src/main/resources/org/apache/wink/common/internal/i18n/resource.properties
URL: http://svn.apache.org/viewvc/incubator/wink/trunk/wink-common/src/main/resources/org/apache/wink/common/internal/i18n/resource.properties?rev=916445&r1=916444&r2=916445&view=diff
==============================================================================
--- incubator/wink/trunk/wink-common/src/main/resources/org/apache/wink/common/internal/i18n/resource.properties (original)
+++ incubator/wink/trunk/wink-common/src/main/resources/org/apache/wink/common/internal/i18n/resource.properties Thu Feb 25 20:49:16 2010
@@ -105,13 +105,13 @@
 mediaTypeWrongFormat=%1$s is an invalid MediaType format.  Verify that the format is like "type/subtype".
 methodDoesNotHandleType=Method doesn't handle {}
 unhandledExceptionToContainer=Unhandled exception
-exceptionOccurredDuringInvocation=%s occured during the handlers chain invocation
+exceptionOccurredDuringInvocation=%s occurred during the handlers chain invocation
 
 # Contexts
 uriBadBaseURI=bad base URI: 
 
 # Error Flow
-exceptionOccurredDuringExceptionMapper=Exception occured while executing toResponse of the ExceptionMapper
+exceptionOccurredDuringExceptionMapper=Exception occurred while executing toResponse of the ExceptionMapper
 
 # WebDAV
 webDAVNoEditOrSelfLink=The resource {} has set no edit or self link
@@ -124,10 +124,15 @@
 clientIssueRequest=Issuing client {} method request to URI at {} with {} entity class and {} headers
 clientAcceptHeaderHandlerSetAccept=Accept header automatically set to: {}
 clientResponseIsErrorCode=Client response is an error code: {}
+clientConfigurationUnmodifiable=Client configuration is unmodifiable because it is in-use by a client.  Please construct a new client configuration.
+entityTypeMustBeParameterized=EntityType must be parameterized.
+clientNoWriterForTypeAndMediaType=No javax.ws.rs.ext.MessageBodyWriter found for type %s and media type %s .  Verify that all entity providers are correctly registered.
+clientCannotConvertEntity=Entity of type %s cannot be cast as type %s
+clientNoReaderForTypeAndMediaType=No javax.ws.rs.ext.MessageBodyReader found for type %s and media type %s .  Verify that all entity providers are correctly registered.
 
 # Server Handlers
 checkLocationHeaderHandlerIllegalArg=Mandatory 'Location' header was not set for status code %1$s
-populateResponseMediaTypeHandlerFromCompatibleMessageBodyWriters=Content-Type not specified via Response object or via @Produces annotation so automatically setting via generic-type compatible MessageBodyWriter providers
+populateResponseMediaTypeHandlerFromCompatibleMessageBodyWriters=Content-Type not specified via Response object or via @javax.ws.rs.Produces annotation so automatically setting via generic-type compatible javax.ws.rs.ext.MessageBodyWriter providers
 populateResponseMediaTypeHandlerNoAcceptableResponse=No acceptable concrete Content-Types, so sending a 406 Not Acceptable response to the client.
 
 # Servlet/Filter Messages