|
" 2013 FRC Java API " |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sun.squawk.CallbackManager
public final class CallbackManager
Class that manages callbacks for occasional events, which might be notified by isolate's other than the one that regsistered the callback objects. This class manages executing callbacks in the context of the isolate that registered the callback.
Constructor Summary | |
---|---|
CallbackManager(boolean runOnce)
Creates a new instance of CallbackManager |
Method Summary | |
---|---|
void |
add(Isolate iso,
Runnable hook)
Add a hook to run in isolate iso . |
void |
add(Runnable hook)
Add a hook to run in the current isolate's context. |
boolean |
containsOtherIsolates()
If this CallbackManager contains any callbacks to be run in a context other than the current context, return true. |
boolean |
isRunOnce()
Should only be run once, like for a shutdown hook. |
boolean |
remove(Isolate iso)
Remove all hooks previously-registered for the given isolate. |
boolean |
remove(Isolate iso,
Runnable hook)
Remove a hook previously-registered for the isolate |
boolean |
remove(Runnable hook)
Remove a hook previously-registered for the current isolate. |
void |
removeAll()
Remove all hooks. |
void |
runHooks()
|
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CallbackManager(boolean runOnce)
runOnce
- if true clean up agressively while executing run()Method Detail |
---|
public boolean isRunOnce()
public void add(Isolate iso, Runnable hook)
iso
.
iso
- the isolate context in which to run hookhook
- the Runnable to run
IllegalArgumentException
- if the hook is already registered to run in this isolate.public void add(Runnable hook)
hook
-
IllegalArgumentException
- if the hook is already registered to run in this isolate.public boolean remove(Isolate iso, Runnable hook)
iso
- the isolate context to searchhook
- the hook to search for
public boolean remove(Runnable hook)
hook
- the hook to search for
public boolean remove(Isolate iso)
iso
- the isolate context to search
public void removeAll()
public void runHooks()
public boolean containsOtherIsolates()
|
" 2013 FRC Java API " |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |