@Plugin(name="CronTriggeringPolicy", category="Core", printObject=true) @Scheduled public final class CronTriggeringPolicy extends AbstractTriggeringPolicy
LifeCycle.State
DEFAULT_STOP_TIMEOUT, DEFAULT_STOP_TIMEUNIT, LOGGER
Modifier and Type | Method and Description |
---|---|
static CronTriggeringPolicy |
createPolicy(Configuration configuration,
String evaluateOnStartup,
String schedule)
Creates a ScheduledTriggeringPolicy.
|
CronExpression |
getCronExpression() |
void |
initialize(RollingFileManager aManager)
Initializes the policy.
|
boolean |
isTriggeringEvent(LogEvent event)
Determines whether a rollover should occur.
|
boolean |
stop(long timeout,
TimeUnit timeUnit)
Blocks until all tasks have completed execution after a shutdown request, or the timeout occurs, or the current
thread is interrupted, whichever happens first.
|
String |
toString() |
equalsImpl, getState, getStatusLogger, hashCodeImpl, initialize, isInitialized, isStarted, isStarting, isStopped, isStopping, setStarted, setStarting, setState, setStopped, setStopping, start, stop, stop
public void initialize(RollingFileManager aManager)
aManager
- The RollingFileManager.public boolean isTriggeringEvent(LogEvent event)
event
- A reference to the currently event.public CronExpression getCronExpression()
@PluginFactory public static CronTriggeringPolicy createPolicy(@PluginConfiguration Configuration configuration, @PluginAttribute(value="evaluateOnStartup") String evaluateOnStartup, @PluginAttribute(value="schedule") String schedule)
configuration
- the Configuration.evaluateOnStartup
- check if the file should be rolled over immediately.schedule
- the cron expression.public boolean stop(long timeout, TimeUnit timeUnit)
LifeCycle2
stop
in interface LifeCycle2
stop
in class AbstractLifeCycle
timeout
- the maximum time to waittimeUnit
- the time unit of the timeout argumentCopyright © 1999-2020 The Apache Software Foundation. All Rights Reserved.
Apache Logging, Apache Log4j, Log4j, Apache, the Apache feather logo, the Apache Logging project logo, and the Apache Log4j logo are trademarks of The Apache Software Foundation.