Class LoggingSupport

java.lang.Object
org.jboss.resteasy.resteasy_jaxrs.i18n.LoggingSupport

public class LoggingSupport extends Object
A support utility for creating message loggers and message bundle types. This supports using JBoss Logging 3.5.x and 3.6.x.
Author:
James R. Perkins
  • Constructor Details

    • LoggingSupport

      public LoggingSupport()
  • Method Details

    • getMessageLogger

      public static <T> T getMessageLogger(MethodHandles.Lookup lookup, Class<T> loggerClass, String loggerName)
      Creates a message logger instance for the specified logger interface.

      If JBoss Logging 3.6.x or later is available, this method uses the Logger.getMessageLogger(MethodHandles.Lookup, Class, String) method. Otherwise, it falls back to the deprecated Logger.getMessageLogger(Class, String) method for compatibility with JBoss Logging 3.5.x.

      Type Parameters:
      T - the logger interface type
      Parameters:
      lookup - the lookup to use, if applicable, for the message logger
      loggerClass - the logger interface class
      loggerName - the logger category name
      Returns:
      a message logger instance
    • getBundle

      public static <T> T getBundle(MethodHandles.Lookup lookup, Class<T> bundleClass)
      Creates a message bundle instance for the specified bundle interface.

      If JBoss Logging 3.6.x or later is available, this method uses the Messages.getBundle(MethodHandles.Lookup, Class) method. Otherwise, it falls back to the deprecated Messages.getBundle(Class) method for compatibility with JBoss Logging 3.5.x.

      Type Parameters:
      T - the bundle interface type
      Parameters:
      lookup - the lookup to use, if applicable, for the message bundle
      bundleClass - the bundle interface class
      Returns:
      a message bundle instance