|
WebObjects 5.2.3 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.webobjects.foundation.NSDelayedCallbackCenter
An NSDelayedCallbackCenter object (also called a delayed callback center) provides a way to guarantee that particular methods are invoked after an event has ended. It allows you to postpone or schedule the execution of certain tasks for a point in time, for example because they can't be performed earlier, or because then they will have to be performed only once (combined effect). Selectors are registered with the delayed callback center in an internal list. The center, in turn, invokes them when the event ends. In WebObjects, this happens at the end of the current request-response cycle.
When a selector is registered, a priority is specified, which determines
the order in which it is invoked relative to the other selectors. The
selectors are invoked in order of ascending priority. To register a selector
with the delayed callback center, use performSelector
. To cancel it before
the event ends, use cancelPerformSelector
.
The event loop invokes eventEnded
to indicate that the current event has
ended. The eventEnded
method invokes the queued selectors.
Each task has a default delayed callback center that you access with the
defaultCenter
static method.
performSelector(NSSelector,Object,Object,int)
,
cancelPerformSelector(NSSelector,Object,Object)
,
eventEnded()
,
defaultCenter()
Constructor Summary | |
NSDelayedCallbackCenter()
|
Method Summary | |
void |
cancelPerformSelector(NSSelector selector,
Object target,
Object argument)
Removes the specified selector for the specified target object
and argument from the list of registered selectors. |
static NSDelayedCallbackCenter |
defaultCenter()
Returns the current default center for the current request-response cycle. |
void |
eventEnded()
Invokes the registered selectors in order of ascending priority. |
void |
performSelector(NSSelector selector,
Object target,
Object argument,
int order)
Registers selector to be invoked on target with the specified
argument and order (priority). |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public NSDelayedCallbackCenter()
Method Detail |
public void cancelPerformSelector(NSSelector selector, Object target, Object argument)
selector
for the specified target
object
and argument
from the list of registered selectors. Only
this specific combination of selector
, target
and argument
will be removed.
selector
- The selector to be cancelled (to be removed)target
- The target object for which the selector was registeredargument
- The argument object for which the selector was registeredpublic static NSDelayedCallbackCenter defaultCenter()
public void eventEnded()
public void performSelector(NSSelector selector, Object target, Object argument, int order)
selector
to be invoked on target
with the specified
argument
and order
(priority).
When the current event ends, the registered selectors are invoked
in order of ascending priority.
selector
- The selector to be registeredtarget
- The target object on which the selector will be calledargument
- The argument with which the selector will be called on the target objectorder
- The priority (order) of the invocation
|
Last updated Thu Oct 21 15:04:16 PDT 2004. | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |