public class QuartzSchedulerMBeanImpl extends StandardMBean implements NotificationEmitter, QuartzSchedulerMBean, JobListener, SchedulerListener
Modifier and Type | Field and Description |
---|---|
protected org.quartz.core.QuartzSchedulerMBeanImpl.Emitter |
emitter
emitter
|
protected AtomicLong |
sequenceNumber
sequenceNumber
|
JOB_ADDED, JOB_DELETED, JOB_EXECUTION_VETOED, JOB_SCHEDULED, JOB_TO_BE_EXECUTED, JOB_UNSCHEDULED, JOB_WAS_EXECUTED, JOBS_PAUSED, JOBS_RESUMED, SAMPLED_STATISTICS_ENABLED, SAMPLED_STATISTICS_RESET, SCHEDULER_ERROR, SCHEDULER_PAUSED, SCHEDULER_SHUTDOWN, SCHEDULER_STARTED, TRIGGER_FINALIZED, TRIGGERS_PAUSED, TRIGGERS_RESUMED
Modifier | Constructor and Description |
---|---|
protected |
QuartzSchedulerMBeanImpl(QuartzScheduler scheduler)
QuartzSchedulerMBeanImpl
|
Modifier and Type | Method and Description |
---|---|
void |
addJob(String instanceId,
CompositeData jobDetail,
boolean replace) |
void |
addNotificationListener(NotificationListener notif,
NotificationFilter filter,
Object callBack) |
void |
deleteCalendar(String instanceId,
String name) |
boolean |
deleteJob(String instanceId,
String jobName,
String jobGroupName) |
TabularData |
getAllJobDetails(String instanceId) |
TabularData |
getAllTriggers(String instanceId) |
String[] |
getCalendarNames(String instanceId) |
TabularData |
getCurrentlyExecutingJobs() |
CompositeData |
getJobDetail(String instanceId,
String jobName,
String jobGroupName) |
String[] |
getJobGroupNames(String instanceId) |
String[] |
getJobNames(String instanceId,
String groupName) |
long |
getJobsCompletedMostRecentSample() |
long |
getJobsExecutedMostRecentSample() |
long |
getJobsScheduledMostRecentSample() |
String |
getJobStoreClassName() |
String |
getName()
Get the name of the
JobListener . |
MBeanNotificationInfo[] |
getNotificationInfo() |
Set<String> |
getPausedTriggerGroups(String instanceId) |
Map<String,Long> |
getPerformanceMetrics() |
String |
getSchedulerInstanceId() |
String |
getSchedulerName() |
String |
getThreadPoolClassName() |
int |
getThreadPoolSize() |
CompositeData |
getTrigger(String instanceId,
String triggerName,
String triggerGroupName) |
String[] |
getTriggerGroupNames(String instanceId) |
String[] |
getTriggerNames(String instanceId,
String triggerGroupName) |
TabularData |
getTriggersOfJob(String instanceId,
String jobName,
String jobGroupName) |
int |
getTriggerState(String instanceId,
String triggerName,
String triggerGroupName) |
String |
getVersion() |
boolean |
interruptJob(String instanceId,
String jobName,
String jobGroupName) |
boolean |
isSampledStatisticsEnabled() |
boolean |
isShutdown() |
boolean |
isStandbyMode() |
boolean |
isStarted() |
void |
jobAdded(JobDetail jobDetail)
|
void |
jobDeleted(String jobName,
String groupName)
|
void |
jobExecutionVetoed(JobExecutionContext context)
Called by the
when a
was about to be executed (an associated
has occurred), but a vetoed it's
execution. |
void |
jobScheduled(Trigger trigger)
|
void |
jobsPaused(String jobName,
String jobGroup)
|
void |
jobsResumed(String jobName,
String jobGroup)
|
void |
jobToBeExecuted(JobExecutionContext context)
|
void |
jobUnscheduled(String triggerName,
String triggerGroup)
|
void |
jobWasExecuted(JobExecutionContext context,
JobExecutionException jobException)
|
void |
pauseAllTriggers(String instanceId) |
void |
pauseJob(String instanceId,
String jobName,
String groupName) |
void |
pauseJobGroup(String instanceId,
String jobGroupName) |
void |
pauseTrigger(String instanceId,
String triggerName,
String triggerGroup) |
void |
pauseTriggerGroup(String instanceId,
String groupName) |
void |
removeNotificationListener(NotificationListener listener) |
void |
removeNotificationListener(NotificationListener notif,
NotificationFilter filter,
Object callBack) |
void |
resumeAllTriggers(String instanceId) |
void |
resumeJob(String instanceId,
String jobName,
String jobGroupName) |
void |
resumeJobGroup(String instanceId,
String jobGroupName) |
void |
resumeTrigger(String instanceId,
String triggerName,
String triggerGroupName) |
void |
resumeTriggerGroup(String instanceId,
String groupName) |
Date |
scheduleJob(String instanceId,
String jobName,
String jobGroup,
String triggerName,
String triggerGroup) |
void |
schedulerError(String msg,
SchedulerException cause)
Called by the
when a serious error has
occurred within the scheduler - such as repeated failures in the JobStore ,
or the inability to instantiate a Job instance when its
Trigger has fired. |
void |
schedulerInStandbyMode()
Called by the
to inform the listener
that it has move to standby mode. |
void |
schedulerShutdown()
Called by the
to inform the listener
that it has shutdown. |
void |
schedulerShuttingdown()
Called by the
to inform the listener
that it has begun the shutdown process. |
void |
schedulerStarted()
Called by the
to inform the listener
that it has started. |
void |
sendNotification(String eventType)
sendNotification
|
void |
sendNotification(String eventType,
Object data)
sendNotification
|
void |
sendNotification(String eventType,
Object data,
String msg)
sendNotification
|
void |
setSampledStatisticsEnabled(boolean enabled) |
void |
shutdown() |
void |
standby() |
void |
start() |
void |
triggerFinalized(Trigger trigger)
|
void |
triggerJob(String instanceId,
String jobName,
String jobGroupName,
Map<String,String> jobDataMap) |
void |
triggerJobWithVolatileTrigger(String instanceId,
String jobName,
String jobGroupName,
Map<String,String> jobDataMap) |
void |
triggersPaused(String triggerName,
String triggerGroup)
|
void |
triggersResumed(String triggerName,
String triggerGroup)
|
boolean |
unscheduleJob(String instanceId,
String triggerName,
String triggerGroup) |
cacheMBeanInfo, getAttribute, getAttributes, getCachedMBeanInfo, getClassName, getConstructors, getDescription, getDescription, getDescription, getDescription, getDescription, getDescription, getDescription, getImpact, getImplementation, getImplementationClass, getMBeanInfo, getMBeanInterface, getParameterName, getParameterName, invoke, postDeregister, postRegister, preDeregister, preRegister, setAttribute, setAttributes, setImplementation
protected final org.quartz.core.QuartzSchedulerMBeanImpl.Emitter emitter
protected final AtomicLong sequenceNumber
protected QuartzSchedulerMBeanImpl(QuartzScheduler scheduler) throws NotCompliantMBeanException
NotCompliantMBeanException
public TabularData getCurrentlyExecutingJobs() throws SchedulerException
getCurrentlyExecutingJobs
in interface QuartzSchedulerMBean
SchedulerException
public TabularData getAllJobDetails(String instanceId) throws SchedulerException
getAllJobDetails
in interface QuartzSchedulerMBean
SchedulerException
JobDetailSupport
public TabularData getAllTriggers(String instanceId) throws SchedulerException
getAllTriggers
in interface QuartzSchedulerMBean
SchedulerException
TriggerSupport
public void addJob(String instanceId, CompositeData jobDetail, boolean replace) throws SchedulerException
addJob
in interface QuartzSchedulerMBean
SchedulerException
public void deleteCalendar(String instanceId, String name) throws SchedulerException
deleteCalendar
in interface QuartzSchedulerMBean
SchedulerException
public boolean deleteJob(String instanceId, String jobName, String jobGroupName) throws SchedulerException
deleteJob
in interface QuartzSchedulerMBean
SchedulerException
public String[] getCalendarNames(String instanceId) throws SchedulerException
getCalendarNames
in interface QuartzSchedulerMBean
SchedulerException
public CompositeData getJobDetail(String instanceId, String jobName, String jobGroupName) throws SchedulerException
getJobDetail
in interface QuartzSchedulerMBean
SchedulerException
JobDetailSupport
public String[] getJobGroupNames(String instanceId) throws SchedulerException
getJobGroupNames
in interface QuartzSchedulerMBean
SchedulerException
public String[] getJobNames(String instanceId, String groupName) throws SchedulerException
getJobNames
in interface QuartzSchedulerMBean
SchedulerException
public String getJobStoreClassName()
getJobStoreClassName
in interface QuartzSchedulerMBean
public Set<String> getPausedTriggerGroups(String instanceId) throws SchedulerException
getPausedTriggerGroups
in interface QuartzSchedulerMBean
SchedulerException
public CompositeData getTrigger(String instanceId, String triggerName, String triggerGroupName) throws SchedulerException
getTrigger
in interface QuartzSchedulerMBean
SchedulerException
public String[] getTriggerGroupNames(String instanceId) throws SchedulerException
getTriggerGroupNames
in interface QuartzSchedulerMBean
SchedulerException
public String[] getTriggerNames(String instanceId, String triggerGroupName) throws SchedulerException
getTriggerNames
in interface QuartzSchedulerMBean
SchedulerException
public int getTriggerState(String instanceId, String triggerName, String triggerGroupName) throws SchedulerException
getTriggerState
in interface QuartzSchedulerMBean
SchedulerException
public TabularData getTriggersOfJob(String instanceId, String jobName, String jobGroupName) throws SchedulerException
getTriggersOfJob
in interface QuartzSchedulerMBean
SchedulerException
public boolean interruptJob(String instanceId, String jobName, String jobGroupName) throws UnableToInterruptJobException
interruptJob
in interface QuartzSchedulerMBean
UnableToInterruptJobException
public Date scheduleJob(String instanceId, String jobName, String jobGroup, String triggerName, String triggerGroup) throws SchedulerException
scheduleJob
in interface QuartzSchedulerMBean
SchedulerException
public boolean unscheduleJob(String instanceId, String triggerName, String triggerGroup) throws SchedulerException
unscheduleJob
in interface QuartzSchedulerMBean
SchedulerException
public String getVersion()
getVersion
in interface QuartzSchedulerMBean
public boolean isShutdown()
isShutdown
in interface QuartzSchedulerMBean
public boolean isStarted()
isStarted
in interface QuartzSchedulerMBean
public void start() throws SchedulerException
start
in interface QuartzSchedulerMBean
SchedulerException
public void shutdown()
shutdown
in interface QuartzSchedulerMBean
public void standby()
standby
in interface QuartzSchedulerMBean
public boolean isStandbyMode()
isStandbyMode
in interface QuartzSchedulerMBean
public String getSchedulerName()
getSchedulerName
in interface QuartzSchedulerMBean
public String getSchedulerInstanceId()
getSchedulerInstanceId
in interface QuartzSchedulerMBean
public String getThreadPoolClassName()
getThreadPoolClassName
in interface QuartzSchedulerMBean
public int getThreadPoolSize()
getThreadPoolSize
in interface QuartzSchedulerMBean
public void pauseJob(String instanceId, String jobName, String groupName) throws SchedulerException
pauseJob
in interface QuartzSchedulerMBean
SchedulerException
public void pauseJobGroup(String instanceId, String jobGroupName) throws SchedulerException
pauseJobGroup
in interface QuartzSchedulerMBean
SchedulerException
public void pauseAllTriggers(String instanceId) throws SchedulerException
pauseAllTriggers
in interface QuartzSchedulerMBean
SchedulerException
public void pauseTriggerGroup(String instanceId, String groupName) throws SchedulerException
pauseTriggerGroup
in interface QuartzSchedulerMBean
SchedulerException
public void pauseTrigger(String instanceId, String triggerName, String triggerGroup) throws SchedulerException
pauseTrigger
in interface QuartzSchedulerMBean
SchedulerException
public void resumeAllTriggers(String instanceId) throws SchedulerException
resumeAllTriggers
in interface QuartzSchedulerMBean
SchedulerException
public void resumeJob(String instanceId, String jobName, String jobGroupName) throws SchedulerException
resumeJob
in interface QuartzSchedulerMBean
SchedulerException
public void resumeJobGroup(String instanceId, String jobGroupName) throws SchedulerException
resumeJobGroup
in interface QuartzSchedulerMBean
SchedulerException
public void resumeTrigger(String instanceId, String triggerName, String triggerGroupName) throws SchedulerException
resumeTrigger
in interface QuartzSchedulerMBean
SchedulerException
public void resumeTriggerGroup(String instanceId, String groupName) throws SchedulerException
resumeTriggerGroup
in interface QuartzSchedulerMBean
SchedulerException
public void triggerJobWithVolatileTrigger(String instanceId, String jobName, String jobGroupName, Map<String,String> jobDataMap) throws SchedulerException
triggerJobWithVolatileTrigger
in interface QuartzSchedulerMBean
SchedulerException
public void triggerJob(String instanceId, String jobName, String jobGroupName, Map<String,String> jobDataMap) throws SchedulerException
triggerJob
in interface QuartzSchedulerMBean
SchedulerException
public void jobAdded(JobDetail jobDetail)
SchedulerListener
jobAdded
in interface SchedulerListener
public void jobDeleted(String jobName, String groupName)
SchedulerListener
jobDeleted
in interface SchedulerListener
public void jobScheduled(Trigger trigger)
SchedulerListener
jobScheduled
in interface SchedulerListener
public void jobUnscheduled(String triggerName, String triggerGroup)
SchedulerListener
jobUnscheduled
in interface SchedulerListener
public void jobsPaused(String jobName, String jobGroup)
SchedulerListener
Called by the
when a Scheduler
or group of JobDetail
has been
paused.
JobDetail
s
If a group was paused, then the jobName
parameter will be
null. If all jobs were paused, then both parameters will be null.
jobsPaused
in interface SchedulerListener
public void jobsResumed(String jobName, String jobGroup)
SchedulerListener
Called by the
when a Scheduler
or group of JobDetail
has been
un-paused.
JobDetail
s
If a group was resumed, then the jobName
parameter will
be null. If all jobs were paused, then both parameters will be null.
jobsResumed
in interface SchedulerListener
public void schedulerError(String msg, SchedulerException cause)
SchedulerListener
Called by the
when a serious error has
occurred within the scheduler - such as repeated failures in the Scheduler
JobStore
,
or the inability to instantiate a Job
instance when its
Trigger
has fired.
The getErrorCode()
method of the given SchedulerException
can be used to determine more specific information about the type of
error that was encountered.
schedulerError
in interface SchedulerListener
public void schedulerStarted()
SchedulerListener
Called by the
to inform the listener
that it has started.
Scheduler
schedulerStarted
in interface SchedulerListener
public void schedulerInStandbyMode()
SchedulerListener
Called by the
to inform the listener
that it has move to standby mode.
Scheduler
schedulerInStandbyMode
in interface SchedulerListener
public void schedulerShutdown()
SchedulerListener
Called by the
to inform the listener
that it has shutdown.
Scheduler
schedulerShutdown
in interface SchedulerListener
public void schedulerShuttingdown()
SchedulerListener
Called by the
to inform the listener
that it has begun the shutdown process.
Scheduler
schedulerShuttingdown
in interface SchedulerListener
public void triggerFinalized(Trigger trigger)
SchedulerListener
triggerFinalized
in interface SchedulerListener
public void triggersPaused(String triggerName, String triggerGroup)
SchedulerListener
Called by the
when a Scheduler
or group of Trigger
has been paused.
Trigger
s
If a group was paused, then the triggerName
parameter
will be null.
triggersPaused
in interface SchedulerListener
public void triggersResumed(String triggerName, String triggerGroup)
SchedulerListener
Called by the
when a Scheduler
or group of Trigger
has been un-paused.
Trigger
s
If a group was resumed, then the triggerName
parameter
will be null.
triggersResumed
in interface SchedulerListener
public String getName()
JobListener
Get the name of the JobListener
.
getName
in interface JobListener
public void jobExecutionVetoed(JobExecutionContext context)
JobListener
Called by the
when a Scheduler
was about to be executed (an associated JobDetail
has occurred), but a Trigger
vetoed it's
execution.
TriggerListener
jobExecutionVetoed
in interface JobListener
JobListener.jobToBeExecuted(JobExecutionContext)
public void jobToBeExecuted(JobExecutionContext context)
JobListener
Called by the
when a Scheduler
is about to be executed (an associated JobDetail
has occurred).
Trigger
This method will not be invoked if the execution of the Job was vetoed
by a
.
TriggerListener
jobToBeExecuted
in interface JobListener
JobListener.jobExecutionVetoed(JobExecutionContext)
public void jobWasExecuted(JobExecutionContext context, JobExecutionException jobException)
JobListener
Called by the
after a Scheduler
has been executed, and be for the associated JobDetail
Trigger
's
triggered(xx)
method has been called.
jobWasExecuted
in interface JobListener
public void sendNotification(String eventType)
eventType
- public void sendNotification(String eventType, Object data)
eventType
- data
- public void sendNotification(String eventType, Object data, String msg)
eventType
- data
- msg
- public void addNotificationListener(NotificationListener notif, NotificationFilter filter, Object callBack)
public MBeanNotificationInfo[] getNotificationInfo()
getNotificationInfo
in interface NotificationBroadcaster
NotificationBroadcaster.getNotificationInfo()
public void removeNotificationListener(NotificationListener listener) throws ListenerNotFoundException
removeNotificationListener
in interface NotificationBroadcaster
ListenerNotFoundException
NotificationBroadcaster.removeNotificationListener(javax.management.NotificationListener)
public void removeNotificationListener(NotificationListener notif, NotificationFilter filter, Object callBack) throws ListenerNotFoundException
public boolean isSampledStatisticsEnabled()
isSampledStatisticsEnabled
in interface QuartzSchedulerMBean
public void setSampledStatisticsEnabled(boolean enabled)
setSampledStatisticsEnabled
in interface QuartzSchedulerMBean
public long getJobsCompletedMostRecentSample()
getJobsCompletedMostRecentSample
in interface QuartzSchedulerMBean
public long getJobsExecutedMostRecentSample()
getJobsExecutedMostRecentSample
in interface QuartzSchedulerMBean
public long getJobsScheduledMostRecentSample()
getJobsScheduledMostRecentSample
in interface QuartzSchedulerMBean
public Map<String,Long> getPerformanceMetrics()
getPerformanceMetrics
in interface QuartzSchedulerMBean
Copyright © 2017. All rights reserved.