XMOJO 5 API Docs

javax.management.timer
Class Scheduler

java.lang.Object
  |
  +--java.lang.Thread
        |
        +--javax.management.timer.Scheduler
All Implemented Interfaces:
java.lang.Runnable

public class Scheduler
extends java.lang.Thread

A scheduler for running tasks in a Java VM. This class can be used to schedule a particular task at a specified time. This is basically to control effectively a number of tasks using a limited number of threads


Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Method Summary
 boolean cleanUp()
           
static Scheduler createScheduler(java.lang.String nam)
           
static Scheduler createScheduler(java.lang.String nam, int maxThreadNumber)
           
 void deregisterThisScheduler(java.lang.String nam)
           
static java.lang.String getConfFile()
           
static int getDefaultMaxThreads()
           
 int getMaxThreads()
           
static Scheduler getScheduler(java.lang.String nam)
           
static int getTotalThreads()
           
 void killScheduler()
           
 void removeTask(java.lang.Runnable task)
          This methood is used to remove a task from being scheduled.
 boolean resumeAll()
           
 void run()
          The main thread which kicks off the task execution
 void scheduleTask(java.lang.Runnable task, java.util.Date when)
          This methood schedules a one-time task at the specified time
static void setConfFile(java.lang.String s)
           
static void setDefaultMaxThreads(int i)
           
 boolean setMaxThreads(int i)
           
 void setStopTimeout(int timeout)
           
static boolean stopAll()
           
 boolean stopThis()
           
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

getMaxThreads

public int getMaxThreads()

getDefaultMaxThreads

public static int getDefaultMaxThreads()

setDefaultMaxThreads

public static void setDefaultMaxThreads(int i)

setMaxThreads

public boolean setMaxThreads(int i)

getTotalThreads

public static int getTotalThreads()

getConfFile

public static java.lang.String getConfFile()

setConfFile

public static void setConfFile(java.lang.String s)

createScheduler

public static Scheduler createScheduler(java.lang.String nam)

createScheduler

public static Scheduler createScheduler(java.lang.String nam,
                                        int maxThreadNumber)

getScheduler

public static Scheduler getScheduler(java.lang.String nam)

scheduleTask

public void scheduleTask(java.lang.Runnable task,
                         java.util.Date when)
This methood schedules a one-time task at the specified time

removeTask

public void removeTask(java.lang.Runnable task)
This methood is used to remove a task from being scheduled.

resumeAll

public boolean resumeAll()

killScheduler

public void killScheduler()

stopAll

public static boolean stopAll()

stopThis

public boolean stopThis()

cleanUp

public boolean cleanUp()

setStopTimeout

public void setStopTimeout(int timeout)

run

public void run()
The main thread which kicks off the task execution
Overrides:
run in class java.lang.Thread

deregisterThisScheduler

public void deregisterThisScheduler(java.lang.String nam)

XMOJO 5 API Docs

Copyright ©2003 XMOJO.org. All Rights Reserved.