Package org.glassfish.pfl.basic.logex
Class WrapperGenerator.ExtensionBase
- java.lang.Object
-
- org.glassfish.pfl.basic.logex.WrapperGenerator.ExtensionBase
-
- All Implemented Interfaces:
WrapperGenerator.Extension
- Enclosing class:
- WrapperGenerator
public abstract static class WrapperGenerator.ExtensionBase extends java.lang.Object implements WrapperGenerator.Extension
Convenience base class for implementations of Extension that don't need to override every method.
-
-
Constructor Summary
Constructors Constructor Description ExtensionBase()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getLoggerName(java.lang.Class<?> cls)
Modify the default logger name if needed.java.lang.String
getLogId(java.lang.reflect.Method method)
Get a message id for this log.java.lang.Throwable
makeException(java.lang.String msg, java.lang.reflect.Method method)
Construct an exception from the message and the exception type.
-
-
-
Method Detail
-
getLogId
public java.lang.String getLogId(java.lang.reflect.Method method)
Description copied from interface:WrapperGenerator.Extension
Get a message id for this log.- Specified by:
getLogId
in interfaceWrapperGenerator.Extension
- Parameters:
method
- The method defining this log.- Returns:
- The message id.
-
makeException
public java.lang.Throwable makeException(java.lang.String msg, java.lang.reflect.Method method)
Description copied from interface:WrapperGenerator.Extension
Construct an exception from the message and the exception type. The method provides access to any additional annotations that may be needed.- Specified by:
makeException
in interfaceWrapperGenerator.Extension
- Parameters:
msg
- The message to use in the exception.method
- The method creating the exception.
-
getLoggerName
public java.lang.String getLoggerName(java.lang.Class<?> cls)
Description copied from interface:WrapperGenerator.Extension
Modify the default logger name if needed.- Specified by:
getLoggerName
in interfaceWrapperGenerator.Extension
- Parameters:
cls
- The standard logger name- Returns:
- A possibly updated logger name
-
-