use of net.runelite.client.task.ScheduledMethod in project runelite by runelite.
the class PluginManager method unschedule.
private void unschedule(Plugin plugin) {
List<ScheduledMethod> methods = new ArrayList<>(scheduler.getScheduledMethods());
for (ScheduledMethod method : methods) {
if (method.getObject() != plugin) {
continue;
}
log.debug("Removing scheduled task {}", method);
scheduler.removeScheduledMethod(method);
}
}
use of net.runelite.client.task.ScheduledMethod in project runelite by runelite.
the class PluginManager method schedule.
private void schedule(Plugin plugin) {
for (Method method : plugin.getClass().getMethods()) {
Schedule schedule = method.getAnnotation(Schedule.class);
if (schedule == null) {
continue;
}
ScheduledMethod scheduledMethod = new ScheduledMethod(schedule, method, plugin);
log.debug("Scheduled task {}", scheduledMethod);
scheduler.addScheduledMethod(scheduledMethod);
}
}
Aggregations