Class CompositeAction
- java.lang.Object
-
- org.apache.logging.log4j.core.appender.rolling.action.AbstractAction
-
- org.apache.logging.log4j.core.appender.rolling.action.CompositeAction
-
- All Implemented Interfaces:
java.lang.Runnable,Action
public class CompositeAction extends AbstractAction
A group of Actions to be executed in sequence.
-
-
Field Summary
Fields Modifier and Type Field Description private Action[]actionsActions to perform.private booleanstopOnErrorStop on error.-
Fields inherited from class org.apache.logging.log4j.core.appender.rolling.action.AbstractAction
LOGGER
-
-
Constructor Summary
Constructors Constructor Description CompositeAction(java.util.List<Action> actions, boolean stopOnError)Construct a new composite action.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanexecute()Execute sequence of actions.Action[]getActions()booleanisStopOnError()voidrun()java.lang.StringtoString()-
Methods inherited from class org.apache.logging.log4j.core.appender.rolling.action.AbstractAction
close, isComplete, isInterrupted, reportException
-
-
-
-
Field Detail
-
actions
private final Action[] actions
Actions to perform.
-
stopOnError
private final boolean stopOnError
Stop on error.
-
-
Constructor Detail
-
CompositeAction
public CompositeAction(java.util.List<Action> actions, boolean stopOnError)
Construct a new composite action.- Parameters:
actions- list of actions, may not be null.stopOnError- if true, stop on the first false return value or exception.
-
-
Method Detail
-
run
public void run()
- Specified by:
runin interfacejava.lang.Runnable- Overrides:
runin classAbstractAction
-
execute
public boolean execute() throws java.io.IOExceptionExecute sequence of actions.- Specified by:
executein interfaceAction- Specified by:
executein classAbstractAction- Returns:
- true if all actions were successful.
- Throws:
java.io.IOException- on IO error.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
getActions
public Action[] getActions()
-
isStopOnError
public boolean isStopOnError()
-
-