io.logspace.agent.shaded.quartz.impl.RemoteMBeanScheduler Maven / Gradle / Ivy
/*
* Copyright 2001-2009 Terracotta, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy
* of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
*/
package io.logspace.agent.shaded.quartz.impl;
import java.text.ParseException;
import java.util.Collections;
import java.util.Date;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import javax.management.Attribute;
import javax.management.AttributeList;
import javax.management.MalformedObjectNameException;
import javax.management.ObjectName;
import javax.management.openmbean.CompositeData;
import io.logspace.agent.shaded.quartz.Calendar;
import io.logspace.agent.shaded.quartz.JobDataMap;
import io.logspace.agent.shaded.quartz.JobDetail;
import io.logspace.agent.shaded.quartz.JobExecutionContext;
import io.logspace.agent.shaded.quartz.JobKey;
import io.logspace.agent.shaded.quartz.ListenerManager;
import io.logspace.agent.shaded.quartz.Scheduler;
import io.logspace.agent.shaded.quartz.SchedulerContext;
import io.logspace.agent.shaded.quartz.SchedulerException;
import io.logspace.agent.shaded.quartz.SchedulerMetaData;
import io.logspace.agent.shaded.quartz.Trigger;
import io.logspace.agent.shaded.quartz.TriggerKey;
import io.logspace.agent.shaded.quartz.UnableToInterruptJobException;
import io.logspace.agent.shaded.quartz.Trigger.TriggerState;
import io.logspace.agent.shaded.quartz.core.jmx.JobDetailSupport;
import io.logspace.agent.shaded.quartz.core.jmx.TriggerSupport;
import io.logspace.agent.shaded.quartz.impl.matchers.GroupMatcher;
import io.logspace.agent.shaded.quartz.impl.matchers.StringMatcher;
import io.logspace.agent.shaded.quartz.spi.JobFactory;
/**
*
* An implementation of the Scheduler
interface that remotely
* proxies all method calls to the equivalent call on a given QuartzScheduler
* instance, via JMX.
*
*
*
* A user must create a subclass to implement the actual connection to the remote
* MBeanServer using their application specific connector.
*
* @see io.logspace.agent.shaded.quartz.Scheduler
* @see io.logspace.agent.shaded.quartz.core.QuartzScheduler
*/
public abstract class RemoteMBeanScheduler implements Scheduler {
/*
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*
* Data members.
*
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/
private ObjectName schedulerObjectName;
/*
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*
* Constructors.
*
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/
public RemoteMBeanScheduler() {
}
/*
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*
* Properties.
*
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/
/**
* Get the name under which the Scheduler MBean is registered on the
* remote MBean server.
*/
protected ObjectName getSchedulerObjectName() {
return schedulerObjectName;
}
/**
* Set the name under which the Scheduler MBean is registered on the
* remote MBean server.
*/
public void setSchedulerObjectName(String schedulerObjectName) throws SchedulerException {
try {
this.schedulerObjectName = new ObjectName(schedulerObjectName);
} catch (MalformedObjectNameException e) {
throw new SchedulerException("Failed to parse Scheduler MBean name: " + schedulerObjectName, e);
}
}
/**
* Set the name under which the Scheduler MBean is registered on the
* remote MBean server.
*/
public void setSchedulerObjectName(ObjectName schedulerObjectName) throws SchedulerException {
this.schedulerObjectName = schedulerObjectName;
}
/*
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*
* Abstract methods.
*
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/
/**
* Initialize this RemoteMBeanScheduler instance, connecting to the
* remote MBean server.
*/
public abstract void initialize() throws SchedulerException;
/**
* Get the given attribute of the remote Scheduler MBean.
*/
protected abstract Object getAttribute(
String attribute) throws SchedulerException;
/**
* Get the given attributes of the remote Scheduler MBean.
*/
protected abstract AttributeList getAttributes(String[] attributes)
throws SchedulerException;
/**
* Invoke the given operation on the remote Scheduler MBean.
*/
protected abstract Object invoke(
String operationName,
Object[] params,
String[] signature) throws SchedulerException;
/*
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*
* Interface.
*
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/
/**
*
* Returns the name of the Scheduler
.
*
*/
public String getSchedulerName() throws SchedulerException {
return (String)getAttribute("SchedulerName");
}
/**
*
* Returns the instance Id of the Scheduler
.
*
*/
public String getSchedulerInstanceId() throws SchedulerException {
return (String)getAttribute("SchedulerInstanceId");
}
public SchedulerMetaData getMetaData() throws SchedulerException {
AttributeList attributeList =
getAttributes(
new String[] {
"SchedulerName",
"SchedulerInstanceId",
"StandbyMode",
"Shutdown",
"JobStoreClassName",
"ThreadPoolClassName",
"ThreadPoolSize",
"Version",
"PerformanceMetrics"
});
try {
return new SchedulerMetaData(
(String)getAttribute(attributeList, 0).getValue(),
(String)getAttribute(attributeList, 1).getValue(),
getClass(), true, false,
(Boolean)getAttribute(attributeList, 2).getValue(),
(Boolean)getAttribute(attributeList, 3).getValue(),
null,
Integer.parseInt(((Map)getAttribute(attributeList, 8).getValue()).get("JobsExecuted").toString()),
Class.forName((String)getAttribute(attributeList, 4).getValue()),
false,
false,
Class.forName((String)getAttribute(attributeList, 5).getValue()),
(Integer)getAttribute(attributeList, 6).getValue(),
(String)getAttribute(attributeList, 7).getValue());
} catch (ClassNotFoundException e) {
throw new SchedulerException(e);
}
}
private Attribute getAttribute(AttributeList attributeList, int index) {
return (Attribute)attributeList.get(index);
}
/**
*
* Returns the SchedulerContext
of the Scheduler
.
*
*/
public SchedulerContext getContext() throws SchedulerException {
throw new SchedulerException("Operation not supported for remote schedulers.");
}
///////////////////////////////////////////////////////////////////////////
///
/// Schedululer State Management Methods
///
///////////////////////////////////////////////////////////////////////////
/**
*
* Calls the equivalent method on the 'proxied' QuartzScheduler
.
*
*/
public void start() throws SchedulerException {
invoke("start", new Object[] {}, new String[] {});
}
/**
*
* Calls the equivalent method on the 'proxied' QuartzScheduler
.
*
*/
public void startDelayed(int seconds) throws SchedulerException {
invoke("startDelayed", new Object[] {seconds}, new String[] {int.class.getName()});
}
/**
*
* Calls the equivalent method on the 'proxied' QuartzScheduler
.
*
*/
public void standby() throws SchedulerException {
invoke("standby", new Object[] {}, new String[] {});
}
/**
* Whether the scheduler has been started.
*
*
* Note: This only reflects whether {@link #start()}
has ever
* been called on this Scheduler, so it will return true
even
* if the Scheduler
is currently in standby mode or has been
* since shutdown.
*
*
* @see #start()
* @see #isShutdown()
* @see #isInStandbyMode()
*/
public boolean isStarted() throws SchedulerException {
return (Boolean) getAttribute("Started");
}
/**
*
* Calls the equivalent method on the 'proxied' QuartzScheduler
.
*
*/
public boolean isInStandbyMode() throws SchedulerException {
return (Boolean)getAttribute("StandbyMode");
}
/**
*
* Calls the equivalent method on the 'proxied' QuartzScheduler
.
*
*/
public void shutdown() throws SchedulerException {
// Have to get the scheduler name before we actually call shutdown.
String schedulerName = getSchedulerName();
invoke("shutdown", new Object[] {}, new String[] {});
SchedulerRepository.getInstance().remove(schedulerName);
}
/**
*
* Calls the equivalent method on the 'proxied' QuartzScheduler
.
*
*/
public void shutdown(boolean waitForJobsToComplete) throws SchedulerException {
throw new SchedulerException("Operation not supported for remote schedulers.");
}
/**
*
* Calls the equivalent method on the 'proxied' QuartzScheduler
.
*
*/
public boolean isShutdown() throws SchedulerException {
throw new SchedulerException("Operation not supported for remote schedulers.");
}
/**
*
* Calls the equivalent method on the 'proxied' QuartzScheduler
.
*
*/
@SuppressWarnings("unchecked")
public List getCurrentlyExecutingJobs() throws SchedulerException {
throw new SchedulerException("Operation not supported for remote schedulers.");
}
///////////////////////////////////////////////////////////////////////////
///
/// Scheduling-related Methods
///
///////////////////////////////////////////////////////////////////////////
/**
*
* Calls the equivalent method on the 'proxied' QuartzScheduler
,
* passing the SchedulingContext
associated with this
* instance.
*
*/
public Date scheduleJob(JobDetail jobDetail, Trigger trigger)
throws SchedulerException {
throw new SchedulerException("Operation not supported for remote schedulers.");
}
/**
*
* Calls the equivalent method on the 'proxied' QuartzScheduler
,
* passing the SchedulingContext
associated with this
* instance.
*
*/
public Date scheduleJob(Trigger trigger) throws SchedulerException {
throw new SchedulerException("Operation not supported for remote schedulers.");
}
/**
*
* Calls the equivalent method on the 'proxied' QuartzScheduler
,
* passing the SchedulingContext
associated with this
* instance.
*
*/
public void addJob(JobDetail jobDetail, boolean replace)
throws SchedulerException {
invoke(
"addJob",
new Object[] { JobDetailSupport.toCompositeData(jobDetail), replace },
new String[] { CompositeData.class.getName(), boolean.class.getName() });
}
/**
*
* Calls the equivalent method on the 'proxied' QuartzScheduler
,
* passing the SchedulingContext
associated with this
* instance.
*
*/
public void addJob(JobDetail jobDetail, boolean replace, boolean storeNonDurableWhileAwaitingScheduling)
throws SchedulerException {
invoke(
"addJob",
new Object[] { JobDetailSupport.toCompositeData(jobDetail), replace , storeNonDurableWhileAwaitingScheduling},
new String[] { CompositeData.class.getName(), boolean.class.getName(), boolean.class.getName() });
}
/**
*
* Calls the equivalent method on the 'proxied' QuartzScheduler
,
* passing the SchedulingContext
associated with this
* instance.
*
*/
public boolean deleteJob(JobKey jobKey)
throws SchedulerException {
return (Boolean)invoke(
"deleteJob",
new Object[] { jobKey.getName(), jobKey.getGroup() },
new String[] { String.class.getName(), String.class.getName() });
}
/**
*
* Calls the equivalent method on the 'proxied' QuartzScheduler
,
* passing the SchedulingContext
associated with this
* instance.
*
*/
public boolean unscheduleJob(TriggerKey triggerKey)
throws SchedulerException {
return (Boolean)invoke(
"unscheduleJob",
new Object[] { triggerKey.getName(), triggerKey.getGroup() },
new String[] { String.class.getName(), String.class.getName() });
}
public boolean deleteJobs(List jobKeys) throws SchedulerException {
throw new SchedulerException("Operation not supported for remote schedulers.");
}
public void scheduleJobs(Map> triggersAndJobs, boolean replace) throws SchedulerException {
throw new SchedulerException("Operation not supported for remote schedulers.");
}
public void scheduleJob(JobDetail jobDetail, Set extends Trigger> triggersForJob, boolean replace) throws SchedulerException {
throw new SchedulerException("Operation not supported for remote schedulers.");
}
public boolean unscheduleJobs(List triggerKeys) throws SchedulerException {
throw new SchedulerException("Operation not supported for remote schedulers.");
}
/**
*
* Calls the equivalent method on the 'proxied' QuartzScheduler
,
* passing the SchedulingContext
associated with this
* instance.
*
*/
public Date rescheduleJob(TriggerKey triggerKey,
Trigger newTrigger) throws SchedulerException {
throw new SchedulerException("Operation not supported for remote schedulers.");
}
/**
*
* Calls the equivalent method on the 'proxied' QuartzScheduler
,
* passing the SchedulingContext
associated with this
* instance.
*
*/
public void triggerJob(JobKey jobKey) throws SchedulerException {
triggerJob(jobKey, null);
}
/**
*
* Calls the equivalent method on the 'proxied' QuartzScheduler
,
* passing the SchedulingContext
associated with this
* instance.
*
*/
public void triggerJob(JobKey jobKey, JobDataMap data) throws SchedulerException {
throw new SchedulerException("Operation not supported for remote schedulers.");
}
/**
*
* Calls the equivalent method on the 'proxied' QuartzScheduler
,
* passing the SchedulingContext
associated with this
* instance.
*
*/
public void pauseTrigger(TriggerKey triggerKey) throws SchedulerException {
invoke(
"pauseTrigger",
new Object[] { triggerKey.getName(), triggerKey.getGroup() },
new String[] { String.class.getName(), String.class.getName() });
}
/**
*
* Calls the equivalent method on the 'proxied' QuartzScheduler
,
* passing the SchedulingContext
associated with this
* instance.
*
*/
public void pauseTriggers(GroupMatcher matcher) throws SchedulerException {
String operation = null;
switch (matcher.getCompareWithOperator()) {
case EQUALS:
operation = "pauseTriggerGroup";
break;
case CONTAINS:
operation = "pauseTriggersContaining";
break;
case STARTS_WITH:
operation = "pauseTriggersStartingWith";
break;
case ENDS_WITH:
operation = "pauseTriggersEndingWith";
case ANYTHING:
operation = "pauseTriggersAll";
}
if (operation != null) {
invoke(
operation,
new Object[] { matcher.getCompareToValue() },
new String[] { String.class.getName() });
} else {
throw new SchedulerException("Unsupported GroupMatcher kind for pausing triggers: " + matcher.getCompareWithOperator());
}
}
/**
*
* Calls the equivalent method on the 'proxied' QuartzScheduler
,
* passing the SchedulingContext
associated with this
* instance.
*
*/
public void pauseJob(JobKey jobKey) throws SchedulerException {
invoke(
"pauseJob",
new Object[] { jobKey.getName(), jobKey.getGroup() },
new String[] { String.class.getName(), String.class.getName() });
}
/**
*
* Calls the equivalent method on the 'proxied' QuartzScheduler
,
* passing the SchedulingContext
associated with this
* instance.
*
*/
public void pauseJobs(GroupMatcher matcher) throws SchedulerException {
String operation = null;
switch (matcher.getCompareWithOperator()) {
case EQUALS:
operation = "pauseJobGroup";
break;
case STARTS_WITH:
operation = "pauseJobsStartingWith";
break;
case ENDS_WITH:
operation = "pauseJobsEndingWith";
break;
case CONTAINS:
operation = "pauseJobsContaining";
case ANYTHING:
operation = "pauseJobsAll";
}
invoke(
operation,
new Object[] { matcher.getCompareToValue() },
new String[] { String.class.getName() });
}
/**
*
* Calls the equivalent method on the 'proxied' QuartzScheduler
,
* passing the SchedulingContext
associated with this
* instance.
*
*/
public void resumeTrigger(TriggerKey triggerKey)
throws SchedulerException {
invoke(
"resumeTrigger",
new Object[] { triggerKey.getName(), triggerKey.getGroup() },
new String[] { String.class.getName(), String.class.getName() });
}
/**
*
* Calls the equivalent method on the 'proxied' QuartzScheduler
,
* passing the SchedulingContext
associated with this
* instance.
*
*/
public void resumeTriggers(GroupMatcher matcher) throws SchedulerException {
String operation = null;
switch (matcher.getCompareWithOperator()) {
case EQUALS:
operation = "resumeTriggerGroup";
break;
case CONTAINS:
operation = "resumeTriggersContaining";
break;
case STARTS_WITH:
operation = "resumeTriggersStartingWith";
break;
case ENDS_WITH:
operation = "resumeTriggersEndingWith";
case ANYTHING:
operation = "resumeTriggersAll";
}
if (operation != null) {
invoke(
operation,
new Object[] { matcher.getCompareToValue() },
new String[] { String.class.getName() });
} else {
throw new SchedulerException("Unsupported GroupMatcher kind for resuming triggers: " + matcher.getCompareWithOperator());
}
}
/**
*
* Calls the equivalent method on the 'proxied' QuartzScheduler
,
* passing the SchedulingContext
associated with this
* instance.
*
*/
public void resumeJob(JobKey jobKey)
throws SchedulerException {
invoke(
"resumeJob",
new Object[] { jobKey.getName(), jobKey.getGroup() },
new String[] { String.class.getName(), String.class.getName() });
}
/**
*
* Calls the equivalent method on the 'proxied' QuartzScheduler
,
* passing the SchedulingContext
associated with this
* instance.
*
*/
public void resumeJobs(GroupMatcher matcher) throws SchedulerException {
String operation = null;
switch (matcher.getCompareWithOperator()) {
case EQUALS:
operation = "resumeJobGroup";
break;
case STARTS_WITH:
operation = "resumeJobsStartingWith";
break;
case ENDS_WITH:
operation = "resumeJobsEndingWith";
break;
case CONTAINS:
operation = "resumeJobsContaining";
case ANYTHING:
operation = "resumeJobsAll";
}
invoke(
operation,
new Object[] { matcher.getCompareToValue() },
new String[] { String.class.getName() });
}
/**
*
* Calls the equivalent method on the 'proxied' QuartzScheduler
,
* passing the SchedulingContext
associated with this
* instance.
*
*/
public void pauseAll() throws SchedulerException {
invoke(
"pauseAllTriggers",
new Object[] { },
new String[] { });
}
/**
*
* Calls the equivalent method on the 'proxied' QuartzScheduler
,
* passing the SchedulingContext
associated with this
* instance.
*
*/
public void resumeAll() throws SchedulerException {
invoke(
"resumeAllTriggers",
new Object[] { },
new String[] { });
}
/**
*
* Calls the equivalent method on the 'proxied' QuartzScheduler
,
* passing the SchedulingContext
associated with this
* instance.
*
*/
@SuppressWarnings("unchecked")
public List getJobGroupNames() throws SchedulerException {
return (List)getAttribute("JobGroupNames");
}
/**
*
* Calls the equivalent method on the 'proxied' QuartzScheduler
,
* passing the SchedulingContext
associated with this
* instance.
*
*/
@SuppressWarnings("unchecked")
public Set getJobKeys(GroupMatcher matcher) throws SchedulerException {
if (matcher.getCompareWithOperator().equals(StringMatcher.StringOperatorName.EQUALS)) {
List keys = (List)invoke(
"getJobNames",
new Object[] { matcher.getCompareToValue() },
new String[] { String.class.getName() });
return new HashSet(keys);
} else {
throw new SchedulerException("Only equals matcher are supported for looking up JobKeys");
}
}
/**
*
* Calls the equivalent method on the 'proxied' QuartzScheduler
,
* passing the SchedulingContext
associated with this
* instance.
*
*/
@SuppressWarnings("unchecked")
public List getTriggersOfJob(JobKey jobKey) throws SchedulerException {
throw new SchedulerException("Operation not supported for remote schedulers.");
}
/**
*
* Calls the equivalent method on the 'proxied' QuartzScheduler
,
* passing the SchedulingContext
associated with this
* instance.
*
*/
@SuppressWarnings("unchecked")
public List getTriggerGroupNames() throws SchedulerException {
return (List)getAttribute("TriggerGroupNames");
}
/**
*
* Calls the equivalent method on the 'proxied' QuartzScheduler
,
* passing the SchedulingContext
associated with this
* instance.
*
*/
@SuppressWarnings("unchecked")
public Set getTriggerKeys(GroupMatcher matcher) throws SchedulerException {
throw new SchedulerException("Operation not supported for remote schedulers.");
}
/**
*
* Calls the equivalent method on the 'proxied' QuartzScheduler
,
* passing the SchedulingContext
associated with this
* instance.
*
*/
public JobDetail getJobDetail(JobKey jobKey) throws SchedulerException {
try {
return JobDetailSupport.newJobDetail((CompositeData)invoke(
"getJobDetail",
new Object[] { jobKey.getName(), jobKey.getGroup() },
new String[] { String.class.getName(), String.class.getName() }));
} catch (ClassNotFoundException e) {
throw new SchedulerException("Unable to resolve job class", e);
}
}
/**
*
* Calls the equivalent method on the 'proxied' QuartzScheduler
.
*
*/
public Trigger getTrigger(TriggerKey triggerKey) throws SchedulerException {
throw new SchedulerException("Operation not supported for remote schedulers.");
}
/**
*
* Calls the equivalent method on the 'proxied' QuartzScheduler
.
*
*/
public boolean checkExists(JobKey jobKey) throws SchedulerException {
throw new SchedulerException("Operation not supported for remote schedulers.");
}
/**
*
* Calls the equivalent method on the 'proxied' QuartzScheduler
.
*
*/
public boolean checkExists(TriggerKey triggerKey) throws SchedulerException {
return (Boolean)invoke(
"checkExists",
new Object[] { triggerKey },
new String[] { TriggerKey.class.getName() });
}
public void clear() throws SchedulerException {
invoke(
"clear",
new Object[] { },
new String[] { });
}
/**
*
* Calls the equivalent method on the 'proxied' QuartzScheduler
,
* passing the SchedulingContext
associated with this
* instance.
*
*/
public TriggerState getTriggerState(TriggerKey triggerKey)
throws SchedulerException {
return TriggerState.valueOf((String)invoke(
"getTriggerState",
new Object[] { triggerKey.getName(), triggerKey.getGroup() },
new String[] { String.class.getName(), String.class.getName() }));
}
/**
*
* Calls the equivalent method on the 'proxied' QuartzScheduler
,
* passing the SchedulingContext
associated with this
* instance.
*
*/
public void addCalendar(String calName, Calendar calendar, boolean replace, boolean updateTriggers)
throws SchedulerException {
invoke(
"addCalendar",
new Object[] { calName, calendar, replace, updateTriggers },
new String[] { String.class.getName(),
Calendar.class.getName(), boolean.class.getName(), boolean.class.getName() });
}
/**
*
* Calls the equivalent method on the 'proxied' QuartzScheduler
,
* passing the SchedulingContext
associated with this
* instance.
*
*/
public boolean deleteCalendar(String calName) throws SchedulerException {
invoke("deleteCalendar",
new Object[] { calName },
new String[] { String.class.getName() });
return true;
}
/**
*
* Calls th0e equivalent method on the 'proxied' QuartzScheduler
,
* passing the SchedulingContext
associated with this
* instance.
*
*/
public Calendar getCalendar(String calName) throws SchedulerException {
throw new SchedulerException("Operation not supported for remote schedulers.");
}
/**
*
* Calls the equivalent method on the 'proxied' QuartzScheduler
,
* passing the SchedulingContext
associated with this
* instance.
*
*/
@SuppressWarnings("unchecked")
public List getCalendarNames() throws SchedulerException {
return (List)getAttribute("CalendarNames");
}
/**
* @see io.logspace.agent.shaded.quartz.Scheduler#getPausedTriggerGroups()
*/
@SuppressWarnings("unchecked")
public Set getPausedTriggerGroups() throws SchedulerException {
return (Set)getAttribute("PausedTriggerGroups");
}
///////////////////////////////////////////////////////////////////////////
///
/// Other Methods
///
///////////////////////////////////////////////////////////////////////////
/**
*
* Calls the equivalent method on the 'proxied' QuartzScheduler
.
*
*/
public ListenerManager getListenerManager() throws SchedulerException {
throw new SchedulerException(
"Operation not supported for remote schedulers.");
}
/**
* @see io.logspace.agent.shaded.quartz.Scheduler#interrupt(JobKey)
*/
public boolean interrupt(JobKey jobKey) throws UnableToInterruptJobException {
try {
return (Boolean)invoke(
"interruptJob",
new Object[] { jobKey.getName(), jobKey.getGroup() },
new String[] { String.class.getName(), String.class.getName() });
} catch (SchedulerException se) {
throw new UnableToInterruptJobException(se);
}
}
public boolean interrupt(String fireInstanceId) throws UnableToInterruptJobException {
try {
return (Boolean)invoke(
"interruptJob",
new Object[] { fireInstanceId },
new String[] { String.class.getName() });
} catch (SchedulerException se) {
throw new UnableToInterruptJobException(se);
}
}
/**
* @see io.logspace.agent.shaded.quartz.Scheduler#setJobFactory(io.logspace.agent.shaded.quartz.spi.JobFactory)
*/
public void setJobFactory(JobFactory factory) throws SchedulerException {
throw new SchedulerException("Operation not supported for remote schedulers.");
}
}