|
jBPM distribution 6.0.0.Beta1 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jbpm.bpmn2.handler.AbstractExceptionHandlingTaskHandler
org.jbpm.bpmn2.handler.LoggingTaskHandlerWrapper
public class LoggingTaskHandlerWrapper
This class is a WorkItemHandler
implementation that is meant to wrap
other WorkItemHandler
implementations.
WorkItemHandler
instance, it's added to a list of LoggingTaskHandlerWrapper.WorkItemExceptionInfo
instances
that contain as much information as possible about the exception, the
WorkItem
that caused the exception and the ProcessInstance
id
of the process in which the exception was thrown.
LoggingTaskHandlerWrapper.WorkItemExceptionInfo
class for more information.LoggingTaskHandlerWrapper.WorkItemExceptionInfo
classes is available via the
getWorkItemExceptionInfoList()
method.Logger.warn(String)
. The message
logged is configurable: see
setLoggedMessageFormat(String)
for more
information.
This class is thread-safe, although it does not take any responsibility
for the WorkItemHandler
that it wraps. If you are using this with
multiple threads, please make sure the the WorkItemHandler
instance
wrapped is also thread-safe.
Nested Class Summary | |
---|---|
static class |
LoggingTaskHandlerWrapper.InputParameter
Type of input parameter that will be used in the MessageFormat string set in
setLoggedMessageFormat(String) . |
class |
LoggingTaskHandlerWrapper.WorkItemExceptionInfo
|
Constructor Summary | |
---|---|
LoggingTaskHandlerWrapper(Class<? extends WorkItemHandler> originalTaskHandlerClass)
Constructs an LoggingTaskHandlerWrapper instance that wraps a
created instance of the WorkItemHandler class given. |
|
LoggingTaskHandlerWrapper(Class<? extends WorkItemHandler> originalTaskHandlerClass,
int logLimit)
Constructs an LoggingTaskHandlerWrapper instance that wraps a
created instance of the WorkItemHandler class given. |
|
LoggingTaskHandlerWrapper(WorkItemHandler originalTaskHandler)
Constructs a LoggingTaskHandlerWrapper instance that wraps the
given WorkItemHandler instance. |
Method Summary | |
---|---|
List<LoggingTaskHandlerWrapper.WorkItemExceptionInfo> |
getWorkItemExceptionInfoList()
|
void |
handleAbortException(Throwable cause,
WorkItem workItem,
WorkItemManager manager)
|
void |
handleExecuteException(Throwable cause,
WorkItem workItem,
WorkItemManager manager)
|
void |
setLoggedExceptionInfoListSize(int loggedExceptionInfoListSize)
|
void |
setLoggedMessageFormat(String logMessageFormat)
Sets the MessageFormat string to be used to format the log
messages. |
void |
setLoggedMessageInput(List<LoggingTaskHandlerWrapper.InputParameter> inputParameterList)
Sets the list of parameter types used for the log message format that is set in setLoggedMessageFormat(String) . |
void |
setPrintStackTrace(boolean printStackTrace)
|
Methods inherited from class org.jbpm.bpmn2.handler.AbstractExceptionHandlingTaskHandler |
---|
abortWorkItem, executeWorkItem, getOriginalTaskHandler |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public LoggingTaskHandlerWrapper(Class<? extends WorkItemHandler> originalTaskHandlerClass, int logLimit)
LoggingTaskHandlerWrapper
instance that wraps a
created instance of the WorkItemHandler
class given. This
instance will only keep the given number of LoggingTaskHandlerWrapper.WorkItemExceptionInfo
instances instead of the default 100.
originalTaskHandlerClass
- logLimit
- public LoggingTaskHandlerWrapper(Class<? extends WorkItemHandler> originalTaskHandlerClass)
LoggingTaskHandlerWrapper
instance that wraps a
created instance of the WorkItemHandler
class given. Only
information about the last 100 exceptions will be held in the list
available from
getWorkItemExceptionInfoList()
;
originalTaskHandlerClass
- public LoggingTaskHandlerWrapper(WorkItemHandler originalTaskHandler)
LoggingTaskHandlerWrapper
instance that wraps the
given WorkItemHandler
instance. This instance will only keep a
refere
originalTaskHandler
- Method Detail |
---|
public void setLoggedMessageFormat(String logMessageFormat)
MessageFormat
string to be used to format the log
messages. If this method is used, it's a good idea to also use the
setLoggedMessageInput(List)
method.
The default MessageFormat
string used is one of the
following:
If the WorkItemHandler
is a ServiceTaskHandler
(that
is used with <serviceTask>
nodes), then the format is:
{0}.{1} threw {2} when {3}ing work item {4} in process instance {5}.
WorkItemHandler
implementations, the format is:
{0} thrown when work item {1} ({2}) was {3}ed in process instance {4}.
logMessageFormat
- The format to use for logged messages.public void setLoggedMessageInput(List<LoggingTaskHandlerWrapper.InputParameter> inputParameterList)
setLoggedMessageFormat(String)
.
The order of the LoggingTaskHandlerWrapper.InputParameter
value in the list corresponds to the MessageFormat
number
used in the String given to setLoggedMessageFormat(String)
.
See LoggingTaskHandlerWrapper.InputParameter
for more information.
inputParameterList
- public void setLoggedExceptionInfoListSize(int loggedExceptionInfoListSize)
public void setPrintStackTrace(boolean printStackTrace)
public List<LoggingTaskHandlerWrapper.WorkItemExceptionInfo> getWorkItemExceptionInfoList()
public void handleExecuteException(Throwable cause, WorkItem workItem, WorkItemManager manager)
handleExecuteException
in class AbstractExceptionHandlingTaskHandler
public void handleAbortException(Throwable cause, WorkItem workItem, WorkItemManager manager)
handleAbortException
in class AbstractExceptionHandlingTaskHandler
|
jBPM distribution 6.0.0.Beta1 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |