|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.lang.Thread | +--objectdraw.ActiveObject
ActiveObject is a flexible version of Java's native Thread. It allows the programmer to specify the behavior of Threads more easily and safely. ActiveObject provides a superset of Java's native Thread functionality, which means it only adds to the native functionality, and does not change it. Thus ActiveObject can be used in any context Java's native Thread is used to the exact same effect.
Fields inherited from class java.lang.Thread |
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Constructor Summary | |
ActiveObject()
Same as corresponding Thread constructor. |
|
ActiveObject(java.lang.Runnable target)
Same as corresponding Thread constructor. |
|
ActiveObject(java.lang.Runnable target,
java.lang.String name)
Same as corresponding Thread constructor. |
|
ActiveObject(java.lang.String name)
Same as corresponding Thread constructor. |
|
ActiveObject(java.lang.ThreadGroup group,
java.lang.Runnable target)
Same as corresponding Thread constructor. |
|
ActiveObject(java.lang.ThreadGroup group,
java.lang.Runnable target,
java.lang.String name)
Same as corresponding Thread constructor. |
|
ActiveObject(java.lang.ThreadGroup group,
java.lang.String name)
Same as corresponding Thread constructor. |
Method Summary | |
static void |
defer()
Same as native yield except introspect is called automatically. |
static double |
getTime()
Returns the current time in milliseconds |
static void |
initializeEventList()
Initializes the event list that handles threads |
static void |
introspect()
The ActiveObject calling introspect calls the execute methods of the ActiveObjectEventInterface events it has been scheduled to call by calls to scheduleEvent and scheduleClassEvent. |
static void |
pause(double millis)
Same as native sleep except a) introspect is called automatically, b) the paused ActiveObject unblocks when interrupted without throwing an InterruptedException, and c) the parameter is a double |
static void |
pause(long millis)
Same as native sleep except introspect is called automatically and the paused ActiveObject unblocks when interrupted without throwing an InterruptedException. |
static void |
pause(long millis,
int nano)
Same as native sleep except introspect is called automatically and the paused ActiveObject unblocks when interrupted without throwing an InterruptedException. |
static void |
scheduleClassEvent(ActiveObjectEventInterface event)
Schedules event's execute method to be called once by all ActiveObjects not yet dead, including those yet to be created. |
void |
scheduleEvent(ActiveObjectEventInterface event)
Schedules event's execute method to be called once by this ActiveObject. |
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, run, 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 |
Constructor Detail |
public ActiveObject()
public ActiveObject(java.lang.Runnable target)
target
- the object whose run method is called.public ActiveObject(java.lang.Runnable target, java.lang.String name)
target
- the object whose run method is called.name
- the name of the new ActiveObject.public ActiveObject(java.lang.String name)
name
- the name of the new ActiveObject.public ActiveObject(java.lang.ThreadGroup group, java.lang.Runnable target)
group
- the thread group.target
- the object whose run method is called.public ActiveObject(java.lang.ThreadGroup group, java.lang.Runnable target, java.lang.String name)
group
- the thread group.target
- the object whose run method is called.name
- the name of the new ActiveObject.public ActiveObject(java.lang.ThreadGroup group, java.lang.String name)
group
- the thread group.name
- the name of the new ActiveObject.Method Detail |
public void scheduleEvent(ActiveObjectEventInterface event)
event
- event scheduled to be executed once by this ActiveObject.public static void introspect()
public static void defer()
public static void pause(long millis)
millis
- number of milliseconds to pause.public static void pause(double millis)
millis
- number of milliseconds to pause.public static void pause(long millis, int nano)
millis
- number of milliseconds to pause.nano
- number of nanoseconds to pause.public static double getTime()
public static void scheduleClassEvent(ActiveObjectEventInterface event)
event
- event scheduled to be executed once by this ActiveObject.public static void initializeEventList()
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |