Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #612 from ronsigal/Branch_2_3_new

  • Loading branch information...
commit 29afdd775d68029f645be20af0342182d85bf90d 2 parents 7bcf45d + 7cf49d1
@liweinan liweinan authored
Showing with 393 additions and 59 deletions.
  1. +4 −0 docbook/reference/en/en-US/modules/I18N.xml
  2. +18 −0 ...bernatevalidator-provider/src/main/java/org/jboss/resteasy/plugins/hibernatevalidator/i18n/LogMessages.java
  3. +13 −1 ...dator-provider/src/main/java/org/jboss/resteasy/plugins/validation/hibernate/HibernateValidatorAdapter.java
  4. +17 −9 resteasy-jaxrs/src/main/java/org/jboss/resteasy/resteasy_jaxrs/i18n/LogMessages.java
  5. +2 −2 resteasy-jaxrs/src/main/java/org/jboss/resteasy/spi/ResteasyDeployment.java
  6. +7 −5 resteasy-jaxrs/src/test/java/org/jboss/resteasy/test/resteasy_jaxrs/i18n/TestLogMessages_Abstract.java
  7. +1 −1  .../org/jboss/resteasy/test/resteasy_jaxrs/i18n/{TestLogMessages_us_EN.java → TestLogMessages_en_US.java}
  8. +1 −0  resteasy-jaxrs/src/test/java/org/jboss/resteasy/test/resteasy_jaxrs/i18n/TestMessagesParent.java
  9. +18 −8 resteasy-jaxrs/src/test/resources/i18n/LogMessages.i18n_en.properties
  10. +18 −8 resteasy-jaxrs/src/test/resources/i18n/LogMessages.i18n_en_US.properties
  11. +18 −8 resteasy-jaxrs/src/test/resources/i18n/LogMessages.i18n_xx.properties
  12. +18 −8 resteasy-jaxrs/src/test/resources/i18n/LogMessages.i18n_xx_YY.properties
  13. +87 −0 resteasy-spring-jetty/pom.xml
  14. +18 −0 resteasy-spring-jetty/src/main/java/org/jboss/resteasy/spring/jetty/i18n/LogMessages.java
  15. +33 −0 resteasy-spring-jetty/src/main/java/org/jboss/resteasy/spring/jetty/i18n/Messages.java
  16. +8 −9 resteasy-spring-jetty/src/main/java/org/jboss/resteasy/springmvc/JettyLifecycleManager.java
  17. +44 −0 resteasy-spring-jetty/src/test/java/org/jboss/resteasy/test/i18n/TestMessagesAbstract.java
  18. +19 −0 resteasy-spring-jetty/src/test/java/org/jboss/resteasy/test/i18n/TestMessages_en.java
  19. +19 −0 resteasy-spring-jetty/src/test/java/org/jboss/resteasy/test/i18n/TestMessages_xx.java
  20. +15 −0 resteasy-spring-jetty/src/test/resources/i18n/Messages.i18n_en.properties
  21. +15 −0 resteasy-spring-jetty/src/test/resources/i18n/Messages.i18n_xx.properties
View
4 docbook/reference/en/en-US/modules/I18N.xml
@@ -119,6 +119,10 @@
<entry align="left">11000-11499</entry>
<entry align="left">resteasy-spring</entry>
</row>
+ <row>
+ <entry align="left">11500-11999</entry>
+ <entry align="left">resteasy-spring-jetty</entry>
+ </row>
</tbody>
</tgroup>
</table>
View
18 ...natevalidator-provider/src/main/java/org/jboss/resteasy/plugins/hibernatevalidator/i18n/LogMessages.java
@@ -0,0 +1,18 @@
+package org.jboss.resteasy.plugins.hibernatevalidator.i18n;
+
+import org.jboss.logging.BasicLogger;
+import org.jboss.logging.Logger;
+import org.jboss.logging.annotations.MessageLogger;
+
+/**
+ *
+ * @author <a href="ron.sigal@jboss.com">Ron Sigal</a>
+ * @version $Revision: 1.1 $
+ *
+ * Copyright Nov 18, 2014
+ */
+@MessageLogger(projectCode = "RESTEASY")
+public interface LogMessages extends BasicLogger
+{
+ LogMessages LOGGER = Logger.getMessageLogger(LogMessages.class, LogMessages.class.getPackage().getName());
+}
View
14 ...or-provider/src/main/java/org/jboss/resteasy/plugins/validation/hibernate/HibernateValidatorAdapter.java
@@ -20,6 +20,7 @@
import org.hibernate.validator.method.MethodConstraintViolation;
import org.hibernate.validator.method.MethodConstraintViolationException;
import org.hibernate.validator.method.MethodValidator;
+import org.jboss.resteasy.plugins.hibernatevalidator.i18n.LogMessages;
import org.jboss.resteasy.plugins.hibernatevalidator.i18n.Messages;
import org.jboss.resteasy.spi.validation.DoNotValidateRequest;
import org.jboss.resteasy.spi.validation.ValidateRequest;
@@ -69,13 +70,24 @@ public void applyValidation(Object resource, Method invokedMethod,
}
}
+ LogMessages.LOGGER.trace("invokedMethod.getDeclaringClass(): " + invokedMethod.getDeclaringClass());
+ LogMessages.LOGGER.trace("resource.getClass(): " + resource.getClass());
+
if( resourceValidateRequest != null ) {
if (isSessionBean(invokedMethod.getDeclaringClass()) || isSessionBean(resource.getClass()))
{
if (!isWeldProxy(resource.getClass()))
{
- Class<?>[] interfaces = getInterfaces(invokedMethod.getDeclaringClass());
+ Class<?>[] interfaces = null;
+ if (isSessionBean(invokedMethod.getDeclaringClass()))
+ {
+ interfaces = getInterfaces(invokedMethod.getDeclaringClass());
+ }
+ else
+ {
+ interfaces = getInterfaces(resource.getClass());
+ }
if (interfaces.length > 0)
{
resource = getProxy(resource.getClass(), interfaces, resource);
View
26 resteasy-jaxrs/src/main/java/org/jboss/resteasy/resteasy_jaxrs/i18n/LogMessages.java
@@ -70,39 +70,47 @@
void ambiguousConstructorsFound(Class<?> clazz);
@LogMessage(level = Level.WARN)
- @Message(id = BASE + 210, value = "ClassNotFoundException: Unable to load builtin provider: %s")
+ @Message(id = BASE + 210, value = "Application.getClasses() returned unknown class type: %s")
+ void applicationGetClassesUnknownClassType(String className);
+
+ @LogMessage(level = Level.WARN)
+ @Message(id = BASE + 215, value = "Application.getSingletons() returned unknown class type: %s")
+ void applicationGetSingletonsUnknownClassType(String className);
+
+ @LogMessage(level = Level.WARN)
+ @Message(id = BASE + 220, value = "ClassNotFoundException: Unable to load builtin provider: %s")
void classNotFoundException(String line);
@LogMessage(level = Level.WARN)
- @Message(id = BASE + 215, value = "Could not delete file '%s' for request: ")
+ @Message(id = BASE + 225, value = "Could not delete file '%s' for request: ")
void couldNotDeleteFile(String path, @Cause Throwable cause);
@LogMessage(level = Level.WARN)
- @Message(id = BASE + 220, value = "Failed to parse request.")
+ @Message(id = BASE + 230, value = "Failed to parse request.")
void failedToParseRequest(@Cause Throwable cause);
@LogMessage(level = Level.WARN)
- @Message(id = BASE + 225, value = "Field {0} of subresource {1} will not be injected according to spec", format=Format.MESSAGE_FORMAT)
+ @Message(id = BASE + 235, value = "Field {0} of subresource {1} will not be injected according to spec", format=Format.MESSAGE_FORMAT)
void fieldOfSubesourceWillNotBeInjected(String field, String subresource);
@LogMessage(level = Level.WARN)
- @Message(id = BASE + 230, value = "Ignoring unsupported locale: %s")
+ @Message(id = BASE + 240, value = "Ignoring unsupported locale: %s")
void ignoringUnsupportedLocale(String locale);
@LogMessage(level = Level.WARN)
- @Message(id = BASE + 235, value = "JAX-RS annotations found at non-public method: {0}.{1}(); Only public methods may be exposed as resource methods.", format=Format.MESSAGE_FORMAT)
+ @Message(id = BASE + 245, value = "JAX-RS annotations found at non-public method: {0}.{1}(); Only public methods may be exposed as resource methods.", format=Format.MESSAGE_FORMAT)
void JAXRSAnnotationsFoundAtNonPublicMethod(String className, String method);
@LogMessage(level = Level.WARN)
- @Message(id = BASE + 240, value = "No valueOf() method available for %s, trying constructor...")
+ @Message(id = BASE + 250, value = "No valueOf() method available for %s, trying constructor...")
void noValueOfMethodAvailable(String className);
@LogMessage(level = Level.WARN)
- @Message(id = BASE + 245, value = "A reader for {0} was not found. This provider is currently configured to handle only {1}", format=Format.MESSAGE_FORMAT)
+ @Message(id = BASE + 255, value = "A reader for {0} was not found. This provider is currently configured to handle only {1}", format=Format.MESSAGE_FORMAT)
void readerNotFound(MediaType mediaType, String[] availableTypes);
@LogMessage(level = Level.WARN)
- @Message(id = BASE + 250, value = "The use of %s is deprecated, please use javax.ws.rs.Application as a context-param instead")
+ @Message(id = BASE + 260, value = "The use of %s is deprecated, please use javax.ws.rs.Application as a context-param instead")
void useOfApplicationClass(String className);
View
4 resteasy-jaxrs/src/main/java/org/jboss/resteasy/spi/ResteasyDeployment.java
@@ -473,7 +473,7 @@ else if (clazz.isAnnotationPresent(Provider.class))
else
{
// required by spec to warn and not abort
- LogMessages.LOGGER.warn("Application.getClasses() returned unknown class type: " + clazz.getName());
+ LogMessages.LOGGER.applicationGetClassesUnknownClassType(clazz.getName());
}
}
}
@@ -495,7 +495,7 @@ else if (obj.getClass().isAnnotationPresent(Provider.class))
else
{
// required by spec to warn and not abort
- LogMessages.LOGGER.warn("Application.getSingletons() returned unknown class type: " + obj.getClass().getName());
+ LogMessages.LOGGER.applicationGetSingletonsUnknownClassType(obj.getClass().getName());
}
}
}
View
12 resteasy-jaxrs/src/test/java/org/jboss/resteasy/test/resteasy_jaxrs/i18n/TestLogMessages_Abstract.java
@@ -59,7 +59,8 @@ public void before(Level level, Locale locale, String filename) throws Exception
public void testLocale() throws Exception
{
String filename = "org/jboss/resteasy/resteasy_jaxrs/i18n/LogMessages.i18n_" + getLocale().toString() + ".properties";
- if (!before(Locale.getDefault(), filename))
+// if (!before(Locale.getDefault(), filename))
+ if (!(before(getLocale(), filename)))
{
System.out.println(getClass() + ": " + filename + " not found.");
return;
@@ -117,7 +118,7 @@ protected void doTestWarn(Locale locale, String filename) throws Exception
// WARN
LogMessages.LOGGER.couldNotDeleteFile("file", new Exception("Sluggo says"));
- expected = getExpected(BASE + "215", "couldNotDeleteFile", "file");
+ expected = getExpected(BASE + "225", "couldNotDeleteFile", "file");
Assert.assertTrue(baos.toString().contains(expected));
Assert.assertTrue(baos.toString().contains("java.lang.Exception"));
Assert.assertTrue(baos.toString().contains("Sluggo says"));
@@ -142,7 +143,7 @@ protected void doTestInfo(Locale locale, String filename) throws Exception
// WARN
LogMessages.LOGGER.couldNotDeleteFile("file", new Exception("Sluggo says"));
- expected = getExpected(BASE + "215", "couldNotDeleteFile", "file");
+ expected = getExpected(BASE + "225", "couldNotDeleteFile", "file");
Assert.assertTrue(baos.toString().contains(expected));
Assert.assertTrue(baos.toString().contains("java.lang.Exception"));
Assert.assertTrue(baos.toString().contains("Sluggo says"));
@@ -173,7 +174,7 @@ protected void doTestDebug(Locale locale, String filename) throws Exception
// WARN
LogMessages.LOGGER.couldNotDeleteFile("file", new Exception("Sluggo says"));
- expected = getExpected(BASE + "215", "couldNotDeleteFile", "file");
+ expected = getExpected(BASE + "225", "couldNotDeleteFile", "file");
Assert.assertTrue(baos.toString().contains(expected));
Assert.assertTrue(baos.toString().contains("java.lang.Exception"));
Assert.assertTrue(baos.toString().contains("Sluggo says"));
@@ -205,7 +206,7 @@ protected void doTestTrace(Locale locale, String filename) throws Exception
// WARN
LogMessages.LOGGER.couldNotDeleteFile("file", new Exception("Sluggo says"));
- expected = getExpected(BASE + "215", "couldNotDeleteFile", "file");
+ expected = getExpected(BASE + "225", "couldNotDeleteFile", "file");
Assert.assertTrue(baos.toString().contains(expected));
Assert.assertTrue(baos.toString().contains("java.lang.Exception"));
Assert.assertTrue(baos.toString().contains("Sluggo says"));
@@ -226,6 +227,7 @@ protected void doTestTrace(Locale locale, String filename) throws Exception
@Override
protected int getExpectedNumberOfMethods()
{
+ System.out.println("expected number of methods: " +LogMessages.class.getDeclaredMethods().length);
return LogMessages.class.getDeclaredMethods().length;
}
View
2  ...st/resteasy_jaxrs/i18n/TestLogMessages_us_EN.java → ...st/resteasy_jaxrs/i18n/TestLogMessages_en_US.java
@@ -9,7 +9,7 @@
*
* Copyright Sep 26, 2014
*/
-public class TestLogMessages_us_EN extends TestLogMessages_Abstract
+public class TestLogMessages_en_US extends TestLogMessages_Abstract
{
@Override
protected Locale getLocale()
View
1  resteasy-jaxrs/src/test/java/org/jboss/resteasy/test/resteasy_jaxrs/i18n/TestMessagesParent.java
@@ -44,6 +44,7 @@ public boolean before(Locale locale, String filename) throws Exception
return false;
}
properties.load(is);
+ System.out.println("properties.size(): " + properties.size());
return getExpectedNumberOfMethods() == properties.size();
}
View
26 resteasy-jaxrs/src/test/resources/i18n/LogMessages.i18n_en.properties
@@ -34,47 +34,57 @@ acceptExtensionsNotSupported=Accept extensions not supported.
ambiguousConstructorsFound=Ambiguity constructors are found in %s. More details please refer to http://jsr311.java.net/nonav/releases/1.1/spec/spec.html
# Id: 210
# Level: org.jboss.logging.Logger.Level.WARN
+# Message: Application.getClasses() returned unknown class type: %s
+# @param 1: className -
+applicationGetClassesUnknownClassType=Application.getClasses() returned unknown class type: %s
+# Id: 215
+# Level: org.jboss.logging.Logger.Level.WARN
+# Message: Application.getSingletons() returned unknown class type: %s
+# @param 1: className -
+applicationGetSingletonsUnknownClassType=Application.getSingletons() returned unknown class type: %s
+# Id: 220
+# Level: org.jboss.logging.Logger.Level.WARN
# Message: ClassNotFoundException: Unable to load builtin provider: %s
# @param 1: line -
classNotFoundException=ClassNotFoundException: Unable to load builtin provider: %s
-# Id: 215
+# Id: 225
# Level: org.jboss.logging.Logger.Level.WARN
# Message: Could not delete file '%s' for request:
# @param 1: path -
couldNotDeleteFile=Could not delete file '%s' for request:
-# Id: 220
+# Id: 230
# Level: org.jboss.logging.Logger.Level.WARN
# Message: Failed to parse request.
failedToParseRequest=Failed to parse request.
-# Id: 225
+# Id: 235
# Level: org.jboss.logging.Logger.Level.WARN
# Message: Field {0} of subresource {1} will not be injected according to spec
# @param 1: field -
# @param 2: subresource -
fieldOfSubesourceWillNotBeInjected=Field {0} of subresource {1} will not be injected according to spec
-# Id: 230
+# Id: 240
# Level: org.jboss.logging.Logger.Level.WARN
# Message: Ignoring unsupported locale: %s
# @param 1: locale -
ignoringUnsupportedLocale=Ignoring unsupported locale: %s
-# Id: 235
+# Id: 245
# Level: org.jboss.logging.Logger.Level.WARN
# Message: JAX-RS annotations found at non-public method: {0}.{1}(); Only public methods may be exposed as resource methods.
# @param 1: className -
# @param 2: method -
JAXRSAnnotationsFoundAtNonPublicMethod=JAX-RS annotations found at non-public method: {0}.{1}(); Only public methods may be exposed as resource methods.
-# Id: 240
+# Id: 250
# Level: org.jboss.logging.Logger.Level.WARN
# Message: No valueOf() method available for %s, trying constructor...
# @param 1: className -
noValueOfMethodAvailable=No valueOf() method available for %s, trying constructor...
-# Id: 245
+# Id: 255
# Level: org.jboss.logging.Logger.Level.WARN
# Message: A reader for {0} was not found. This provider is currently configured to handle only {1}
# @param 1: mediaType -
# @param 2: availableTypes -
readerNotFound=A reader for {0} was not found. This provider is currently configured to handle only {1}
-# Id: 250
+# Id: 260
# Level: org.jboss.logging.Logger.Level.WARN
# Message: The use of %s is deprecated, please use javax.ws.rs.Application as a context-param instead
# @param 1: className -
View
26 resteasy-jaxrs/src/test/resources/i18n/LogMessages.i18n_en_US.properties
@@ -34,47 +34,57 @@ acceptExtensionsNotSupported=Accept extensions not supported.
ambiguousConstructorsFound=Ambiguity constructors are found in %s. More details please refer to http://jsr311.java.net/nonav/releases/1.1/spec/spec.html
# Id: 210
# Level: org.jboss.logging.Logger.Level.WARN
+# Message: Application.getClasses() returned unknown class type: %s
+# @param 1: className -
+applicationGetClassesUnknownClassType=Application.getClasses() returned unknown class type: %s
+# Id: 215
+# Level: org.jboss.logging.Logger.Level.WARN
+# Message: Application.getSingletons() returned unknown class type: %s
+# @param 1: className -
+applicationGetSingletonsUnknownClassType=Application.getSingletons() returned unknown class type: %s
+# Id: 220
+# Level: org.jboss.logging.Logger.Level.WARN
# Message: ClassNotFoundException: Unable to load builtin provider: %s
# @param 1: line -
classNotFoundException=ClassNotFoundException: Unable to load builtin provider: %s
-# Id: 215
+# Id: 225
# Level: org.jboss.logging.Logger.Level.WARN
# Message: Could not delete file '%s' for request:
# @param 1: path -
couldNotDeleteFile=Could not delete file '%s' for request:
-# Id: 220
+# Id: 230
# Level: org.jboss.logging.Logger.Level.WARN
# Message: Failed to parse request.
failedToParseRequest=Failed to parse request.
-# Id: 225
+# Id: 235
# Level: org.jboss.logging.Logger.Level.WARN
# Message: Field {0} of subresource {1} will not be injected according to spec
# @param 1: field -
# @param 2: subresource -
fieldOfSubesourceWillNotBeInjected=Field {0} of subresource {1} will not be injected according to spec
-# Id: 230
+# Id: 240
# Level: org.jboss.logging.Logger.Level.WARN
# Message: Ignoring unsupported locale: %s
# @param 1: locale -
ignoringUnsupportedLocale=Ignoring unsupported locale: %s
-# Id: 235
+# Id: 245
# Level: org.jboss.logging.Logger.Level.WARN
# Message: JAX-RS annotations found at non-public method: {0}.{1}(); Only public methods may be exposed as resource methods.
# @param 1: className -
# @param 2: method -
JAXRSAnnotationsFoundAtNonPublicMethod=JAX-RS annotations found at non-public method: {0}.{1}(); Only public methods may be exposed as resource methods.
-# Id: 240
+# Id: 250
# Level: org.jboss.logging.Logger.Level.WARN
# Message: No valueOf() method available for %s, trying constructor...
# @param 1: className -
noValueOfMethodAvailable=No valueOf() method available for %s, trying constructor...
-# Id: 245
+# Id: 255
# Level: org.jboss.logging.Logger.Level.WARN
# Message: A reader for {0} was not found. This provider is currently configured to handle only {1}
# @param 1: mediaType -
# @param 2: availableTypes -
readerNotFound=A reader for {0} was not found. This provider is currently configured to handle only {1}
-# Id: 250
+# Id: 260
# Level: org.jboss.logging.Logger.Level.WARN
# Message: The use of %s is deprecated, please use javax.ws.rs.Application as a context-param instead
# @param 1: className -
View
26 resteasy-jaxrs/src/test/resources/i18n/LogMessages.i18n_xx.properties
@@ -34,47 +34,57 @@ acceptExtensionsNotSupported=Accept extensions not supported.
ambiguousConstructorsFound=Ambiguity constructors are found in %s. More details please refer to http://jsr311.java.net/nonav/releases/1.1/spec/spec.html
# Id: 210
# Level: org.jboss.logging.Logger.Level.WARN
+# Message: Application.getClasses() returned unknown class type: %s
+# @param 1: className -
+applicationGetClassesUnknownClassType=Application.getClasses() returned unknown class type: %s
+# Id: 215
+# Level: org.jboss.logging.Logger.Level.WARN
+# Message: Application.getSingletons() returned unknown class type: %s
+# @param 1: className -
+applicationGetSingletonsUnknownClassType=Application.getSingletons() returned unknown class type: %s
+# Id: 220
+# Level: org.jboss.logging.Logger.Level.WARN
# Message: ClassNotFoundException: Unable to load builtin provider: %s
# @param 1: line -
classNotFoundException=ClassNotFoundException: Unable to load builtin provider: %s
-# Id: 215
+# Id: 225
# Level: org.jboss.logging.Logger.Level.WARN
# Message: Could not delete file '%s' for request:
# @param 1: path -
couldNotDeleteFile=ccc'%s' for ddd:
-# Id: 220
+# Id: 230
# Level: org.jboss.logging.Logger.Level.WARN
# Message: Failed to parse request.
failedToParseRequest=Failed to parse request.
-# Id: 225
+# Id: 235
# Level: org.jboss.logging.Logger.Level.WARN
# Message: Field {0} of subresource {1} will not be injected according to spec
# @param 1: field -
# @param 2: subresource -
fieldOfSubesourceWillNotBeInjected=Field {0} of subresource {1} will not be injected according to spec
-# Id: 230
+# Id: 240
# Level: org.jboss.logging.Logger.Level.WARN
# Message: Ignoring unsupported locale: %s
# @param 1: locale -
ignoringUnsupportedLocale=Ignoring unsupported locale: %s
-# Id: 235
+# Id: 245
# Level: org.jboss.logging.Logger.Level.WARN
# Message: JAX-RS annotations found at non-public method: {0}.{1}(); Only public methods may be exposed as resource methods.
# @param 1: className -
# @param 2: method -
JAXRSAnnotationsFoundAtNonPublicMethod=JAX-RS annotations found at non-public method: {0}.{1}(); Only public methods may be exposed as resource methods.
-# Id: 240
+# Id: 250
# Level: org.jboss.logging.Logger.Level.WARN
# Message: No valueOf() method available for %s, trying constructor...
# @param 1: className -
noValueOfMethodAvailable=No valueOf() method available for %s, trying constructor...
-# Id: 245
+# Id: 255
# Level: org.jboss.logging.Logger.Level.WARN
# Message: A reader for {0} was not found. This provider is currently configured to handle only {1}
# @param 1: mediaType -
# @param 2: availableTypes -
readerNotFound=A reader for {0} was not found. This provider is currently configured to handle only {1}
-# Id: 250
+# Id: 260
# Level: org.jboss.logging.Logger.Level.WARN
# Message: The use of %s is deprecated, please use javax.ws.rs.Application as a context-param instead
# @param 1: className -
View
26 resteasy-jaxrs/src/test/resources/i18n/LogMessages.i18n_xx_YY.properties
@@ -34,47 +34,57 @@ acceptExtensionsNotSupported=Accept extensions not supported.
ambiguousConstructorsFound=Ambiguity constructors are found in %s. More details please refer to http://jsr311.java.net/nonav/releases/1.1/spec/spec.html
# Id: 210
# Level: org.jboss.logging.Logger.Level.WARN
+# Message: Application.getClasses() returned unknown class type: %s
+# @param 1: className -
+applicationGetClassesUnknownClassType=Application.getClasses() returned unknown class type: %s
+# Id: 215
+# Level: org.jboss.logging.Logger.Level.WARN
+# Message: Application.getSingletons() returned unknown class type: %s
+# @param 1: className -
+applicationGetSingletonsUnknownClassType=Application.getSingletons() returned unknown class type: %s
+# Id: 220
+# Level: org.jboss.logging.Logger.Level.WARN
# Message: ClassNotFoundException: Unable to load builtin provider: %s
# @param 1: line -
classNotFoundException=ClassNotFoundException: Unable to load builtin provider: %s
-# Id: 215
+# Id: 225
# Level: org.jboss.logging.Logger.Level.WARN
# Message: Could not delete file '%s' for request:
# @param 1: path -
couldNotDeleteFile=ccc'%s' for ddd:
-# Id: 220
+# Id: 230
# Level: org.jboss.logging.Logger.Level.WARN
# Message: Failed to parse request.
failedToParseRequest=Failed to parse request.
-# Id: 225
+# Id: 235
# Level: org.jboss.logging.Logger.Level.WARN
# Message: Field {0} of subresource {1} will not be injected according to spec
# @param 1: field -
# @param 2: subresource -
fieldOfSubesourceWillNotBeInjected=Field {0} of subresource {1} will not be injected according to spec
-# Id: 230
+# Id: 240
# Level: org.jboss.logging.Logger.Level.WARN
# Message: Ignoring unsupported locale: %s
# @param 1: locale -
ignoringUnsupportedLocale=Ignoring unsupported locale: %s
-# Id: 235
+# Id: 245
# Level: org.jboss.logging.Logger.Level.WARN
# Message: JAX-RS annotations found at non-public method: {0}.{1}(); Only public methods may be exposed as resource methods.
# @param 1: className -
# @param 2: method -
JAXRSAnnotationsFoundAtNonPublicMethod=JAX-RS annotations found at non-public method: {0}.{1}(); Only public methods may be exposed as resource methods.
-# Id: 240
+# Id: 250
# Level: org.jboss.logging.Logger.Level.WARN
# Message: No valueOf() method available for %s, trying constructor...
# @param 1: className -
noValueOfMethodAvailable=No valueOf() method available for %s, trying constructor...
-# Id: 245
+# Id: 255
# Level: org.jboss.logging.Logger.Level.WARN
# Message: A reader for {0} was not found. This provider is currently configured to handle only {1}
# @param 1: mediaType -
# @param 2: availableTypes -
readerNotFound=A reader for {0} was not found. This provider is currently configured to handle only {1}
-# Id: 250
+# Id: 260
# Level: org.jboss.logging.Logger.Level.WARN
# Message: The use of %s is deprecated, please use javax.ws.rs.Application as a context-param instead
# @param 1: className -
View
87 resteasy-spring-jetty/pom.xml
@@ -28,6 +28,93 @@
<version>6.1.15</version>
<scope>provided</scope>
</dependency>
+
+ <dependency>
+ <groupId>org.jboss.logging</groupId>
+ <artifactId>jboss-logging</artifactId>
+ <version>3.1.4.GA</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.logging</groupId>
+ <artifactId>jboss-logging-annotations</artifactId>
+ <version>1.2.0.Final</version>
+ <!-- This is a compile-time dependency of this project, but is not needed at compile or runtime by other
+ projects that depend on this project.-->
+ <scope>provided</scope>
+ <optional>true</optional>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.logging</groupId>
+ <artifactId>jboss-logging-processor</artifactId>
+ <version>1.2.0.Final</version>
+ <!-- This is a compile-time dependency of this project, but is not needed at compile or runtime by other
+ projects that depend on this project.-->
+ <scope>provided</scope>
+ <optional>true</optional>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.resteasy</groupId>
+ <artifactId>resteasy-jaxrs-test</artifactId>
+ <version>${project.version}</version>
+ <scope>test</scope>
+ </dependency>
</dependencies>
+ <profiles>
+ <profile>
+ <id>i18n</id>
+ <activation>
+ <property>
+ <name>i18n</name>
+ </property>
+ </activation>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-resources-plugin</artifactId>
+ <version>2.6</version>
+ <executions>
+ <execution>
+ <id>copy-resources</id>
+ <phase>initialize</phase>
+ <goals>
+ <goal>copy-resources</goal>
+ </goals>
+ <configuration>
+ <outputDirectory>${basedir}/src/main/resources/org/jboss/resteasy/spring/jetty/i18n</outputDirectory>
+ <resources>
+ <resource>
+ <directory>${basedir}/src/test/resources/i18n</directory>
+ <includes>
+ <include>*</include>
+ </includes>
+ </resource>
+ </resources>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <version>2.3.2</version>
+ <configuration>
+ <compilerArgument>
+ -AgeneratedTranslationFilesPath=${project.basedir}/target/generated-translation-files
+ </compilerArgument>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <version>2.17</version>
+ <configuration>
+ <reuseForks>false</reuseForks>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
</project>
View
18 resteasy-spring-jetty/src/main/java/org/jboss/resteasy/spring/jetty/i18n/LogMessages.java
@@ -0,0 +1,18 @@
+package org.jboss.resteasy.spring.jetty.i18n;
+
+import org.jboss.logging.BasicLogger;
+import org.jboss.logging.Logger;
+import org.jboss.logging.annotations.MessageLogger;
+
+/**
+ *
+ * @author <a href="ron.sigal@jboss.com">Ron Sigal</a>
+ * @version $Revision: 1.1 $
+ *
+ * Copyright Dec 09, 2014
+ */
+@MessageLogger(projectCode = "RESTEASY")
+public interface LogMessages extends BasicLogger
+{
+ LogMessages LOGGER = Logger.getMessageLogger(LogMessages.class, LogMessages.class.getPackage().getName());
+}
View
33 resteasy-spring-jetty/src/main/java/org/jboss/resteasy/spring/jetty/i18n/Messages.java
@@ -0,0 +1,33 @@
+package org.jboss.resteasy.spring.jetty.i18n;
+
+import org.jboss.logging.annotations.Message;
+import org.jboss.logging.annotations.MessageBundle;
+
+/**
+ *
+ * @author <a href="ron.sigal@jboss.com">Ron Sigal</a>
+ * @version $Revision: 1.1 $
+ *
+ * Copyright Dec 08, 2014
+ */
+@MessageBundle(projectCode = "RESTEASY")
+public interface Messages
+{
+ Messages MESSAGES = org.jboss.logging.Messages.getBundle(Messages.class);
+ int BASE = 11500;
+
+ @Message(id = BASE + 0, value = "Exception while shutting down Jetty")
+ String exceptionWhileShuttingDownJetty();
+
+ @Message(id = BASE + 5, value = "Exception while starting up Jetty")
+ String exceptionWhileStartingJetty();
+
+ @Message(id = BASE + 10, value = "Interrupted while starting up Jetty")
+ String interruptedWhileStartingJetty();
+
+ @Message(id = BASE + 15, value = "Shutting down Jetty")
+ String shuttingDownJetty();
+
+ @Message(id = BASE + 20, value = "Starting up Jetty")
+ String startingJetty();
+}
View
17 resteasy-spring-jetty/src/main/java/org/jboss/resteasy/springmvc/JettyLifecycleManager.java
@@ -1,6 +1,7 @@
package org.jboss.resteasy.springmvc;
-import org.jboss.resteasy.logging.Logger;
+import org.jboss.resteasy.spring.jetty.i18n.LogMessages;
+import org.jboss.resteasy.spring.jetty.i18n.Messages;
import org.mortbay.jetty.Server;
import org.springframework.beans.factory.DisposableBean;
import org.springframework.beans.factory.InitializingBean;
@@ -13,9 +14,6 @@
public class JettyLifecycleManager implements InitializingBean, DisposableBean
{
- private final static Logger logger = Logger
- .getLogger(JettyLifecycleManager.class);
-
private Server servletContainer;
public Server getServletContainer()
@@ -30,7 +28,8 @@ public void setServletContainer(Server servletContainer)
public void afterPropertiesSet() throws Exception
{
- logger.info("Starting up Jetty");
+ LogMessages.LOGGER.info(Messages.MESSAGES.startingJetty());
+
try
{
servletContainer.start();
@@ -42,11 +41,11 @@ public void afterPropertiesSet() throws Exception
}
catch (InterruptedException e)
{
- logger.error("Interrupted while starting up Jetty", e);
+ LogMessages.LOGGER.error(Messages.MESSAGES.interruptedWhileStartingJetty(), e);
}
catch (Exception e)
{
- logger.error("Exception while starting up Jetty", e);
+ LogMessages.LOGGER.error(Messages.MESSAGES.exceptionWhileStartingJetty(), e);
}
/*
@@ -59,14 +58,14 @@ public void afterPropertiesSet() throws Exception
public void destroy() throws Exception
{
- logger.info("Shutting down Jetty");
+ LogMessages.LOGGER.info(Messages.MESSAGES.shuttingDownJetty());
try
{
servletContainer.stop();
}
catch (Exception e)
{
- logger.info("Exception while shutting down Jetty", e);
+ LogMessages.LOGGER.info(Messages.MESSAGES.exceptionWhileShuttingDownJetty(), e);
}
}
View
44 resteasy-spring-jetty/src/test/java/org/jboss/resteasy/test/i18n/TestMessagesAbstract.java
@@ -0,0 +1,44 @@
+package org.jboss.resteasy.test.i18n;
+
+import java.util.Locale;
+
+import junit.framework.Assert;
+
+import org.jboss.resteasy.spring.jetty.i18n.Messages;
+import org.jboss.resteasy.test.resteasy_jaxrs.i18n.TestMessagesParent;
+import org.junit.Test;
+
+/**
+ *
+ * @author <a href="ron.sigal@jboss.com">Ron Sigal</a>
+ * @version $Revision: 1.1 $
+ *
+ * Copyright Dec 09, 2014
+ */
+abstract public class TestMessagesAbstract extends TestMessagesParent
+{
+ protected static final String BASE = String.format("0%5s", Messages.BASE).substring(0, 4);
+
+ @Test
+ public void testLocale() throws Exception
+ {
+ Locale locale = getLocale();
+ String filename = "org/jboss/resteasy/spring/jetty/i18n/Messages.i18n_" + locale.toString() + ".properties";
+ if (!before(locale, filename))
+ {
+ System.out.println(getClass() + ": " + filename + " not found.");
+ return;
+ }
+
+ Assert.assertEquals(getExpected(BASE + "00", "exceptionWhileShuttingDownJetty"), Messages.MESSAGES.exceptionWhileShuttingDownJetty());
+ Assert.assertEquals(getExpected(BASE + "20", "startingJetty"), Messages.MESSAGES.startingJetty());
+ }
+
+ @Override
+ protected int getExpectedNumberOfMethods()
+ {
+ return Messages.class.getDeclaredMethods().length;
+ }
+
+ abstract protected Locale getLocale();
+}
View
19 resteasy-spring-jetty/src/test/java/org/jboss/resteasy/test/i18n/TestMessages_en.java
@@ -0,0 +1,19 @@
+package org.jboss.resteasy.test.i18n;
+
+import java.util.Locale;
+
+/**
+ *
+ * @author <a href="ron.sigal@jboss.com">Ron Sigal</a>
+ * @version $Revision: 1.1 $
+ *
+ * Copyright Sep 27, 2014
+ */
+public class TestMessages_en extends TestMessagesAbstract
+{
+ @Override
+ protected Locale getLocale()
+ {
+ return new Locale("en");
+ }
+}
View
19 resteasy-spring-jetty/src/test/java/org/jboss/resteasy/test/i18n/TestMessages_xx.java
@@ -0,0 +1,19 @@
+package org.jboss.resteasy.test.i18n;
+
+import java.util.Locale;
+
+/**
+ *
+ * @author <a href="ron.sigal@jboss.com">Ron Sigal</a>
+ * @version $Revision: 1.1 $
+ *
+ * Copyright Sep 27, 2014
+ */
+public class TestMessages_xx extends TestMessagesAbstract
+{
+ @Override
+ protected Locale getLocale()
+ {
+ return new Locale("xx");
+ }
+}
View
15 resteasy-spring-jetty/src/test/resources/i18n/Messages.i18n_en.properties
@@ -0,0 +1,15 @@
+# Id: 11500
+# Message: Exception while shutting down Jetty
+exceptionWhileShuttingDownJetty=Exception while shutting down Jetty
+# Id: 11505
+# Message: Exception while starting up Jetty
+exceptionWhileStartingJetty=Exception while starting up Jetty
+# Id: 11510
+# Message: Interrupted while starting up Jetty
+interruptedWhileStartingJetty=Interrupted while starting up Jetty
+# Id: 11515
+# Message: Shutting down Jetty
+shuttingDownJetty=Shutting down Jetty
+# Id: 11520
+# Message: Starting up Jetty
+startingJetty=Starting up Jetty
View
15 resteasy-spring-jetty/src/test/resources/i18n/Messages.i18n_xx.properties
@@ -0,0 +1,15 @@
+# Id: 11500
+# Message: Exception while shutting down Jetty
+exceptionWhileShuttingDownJetty=aaa
+# Id: 11505
+# Message: Exception while starting up Jetty
+exceptionWhileStartingJetty=Exception while starting up Jetty
+# Id: 11510
+# Message: Interrupted while starting up Jetty
+interruptedWhileStartingJetty=Interrupted while starting up Jetty
+# Id: 11515
+# Message: Shutting down Jetty
+shuttingDownJetty=Shutting down Jetty
+# Id: 11520
+# Message: Starting up Jetty
+startingJetty=bbb
Please sign in to comment.
Something went wrong with that request. Please try again.