public interface ExecutionCtrl
Execution
for implementation.
Application developers shall never access any of this methods.
Modifier and Type | Method and Description |
---|---|
void |
addOnActivate(Callback callback)
Adds a callback method to be executed only once after the execution
activated.
|
void |
addOnDeactivate(Callback callback)
Adds a callback method to be executed only once after the execution
being deactivated (i.e. do the callback in
onBeforeDeactivate() . |
Page |
getCurrentPage()
Returns the current page.
|
PageDefinition |
getCurrentPageDefinition()
Returns the current page definition, which is pushed when
evaluating a page (from a page definition).
|
ExecutionInfo |
getExecutionInfo()
Returns the information of the event being served, or null
if the execution is not under serving an event.
|
java.lang.Object |
getExtraXelVariable(java.lang.String name)
Returns the object, if any, defined in any variable resolver
added by
Execution.addVariableResolver(org.zkoss.xel.VariableResolver) . |
java.lang.Object |
getExtraXelVariable(XelContext ctx,
java.lang.Object base,
java.lang.Object name)
Returns the object, if any, defined in any variable resolver
added by
Execution.addVariableResolver(org.zkoss.xel.VariableResolver) . |
Event |
getNextEvent()
Returns the next event queued by
Execution.postEvent(org.zkoss.zk.ui.event.Event) , or null if no event queued. |
java.lang.String |
getRequestId()
Returns the sequence ID of the current request, or null if not
available.
|
java.util.Collection<AuResponse> |
getResponses()
Returns the collection of the AU responses (
AuResponse )
that shall be generated to the output, or null if not available. |
Visualizer |
getVisualizer()
Returns the
Visualizer for this execution. |
boolean |
isActivated()
Returns whether this execution is activated.
|
boolean |
isRecovering()
Returns whether this execution is in recovering.
|
void |
onActivate()
Called when this execution is about to become the current execution
Executions.getCurrent() . |
void |
onBeforeDeactivate()
Called when this execution is about to become a non-current execution.
|
void |
onDeactivate()
Called when this execution is about to become a non-current execution.
|
void |
setContentType(java.lang.String contentType)
Sets the content type.
|
void |
setCurrentPage(Page page)
Sets the current page.
|
void |
setCurrentPageDefinition(PageDefinition pgdef)
Sets the current page definition.
|
void |
setDesktop(Desktop desktop)
Sets the desktop associated with this execution.
|
void |
setExecutionInfo(ExecutionInfo evtinf)
Sets the information of the event being served, or null if not under
serving an event.
|
void |
setRequestId(java.lang.String reqId)
Sets the sequence ID of the current request.
|
void |
setResponses(java.util.Collection<AuResponse> responses)
Sets the collection of the AU responses (
AuResponse )
that shall be generated to the output. |
Page getCurrentPage()
Design decision: we put it here because user need not to know about the concept of the current page.
Since 3.6.0, this method returns the first page if
setCurrentPage(org.zkoss.zk.ui.Page)
was not called (such as Server Push).
Desktop.getPage(java.lang.String)
void setCurrentPage(Page page)
PageDefinition getCurrentPageDefinition()
void setCurrentPageDefinition(PageDefinition pgdef)
pgdef
- the page definition. If null, it means it is the same
as getCurrentPage().getPageDefinition().Event getNextEvent()
Execution.postEvent(org.zkoss.zk.ui.event.Event)
, or null if no event queued.
Implementation Notes:
Execution.postEvent(int,Component,Event)
proxies the event with ProxyEvent
if the real target is different from Event.getTarget()
.
Of course, it is transparent to the event listeners since the real
event will be passed to the listener (rather than the proxy event).
boolean isActivated()
void onActivate()
Executions.getCurrent()
.
Note: an execution might spread over several threads, so this method might be called several times to activate the states in each thread. Also, an execution might be activated before another is deactivate. For example, when a component includes another page, the second exec is activated to render the included page.
It is used as callback notification.
Note: don't throw any exception in this method.
void onDeactivate()
It is used as callback notification.
Note: don't throw any exception in this method.
onActivate()
void onBeforeDeactivate()
It is used as callback notification.
Note: don't throw any exception in this method.
onDeactivate()
void addOnActivate(Callback callback)
callback
- void addOnDeactivate(Callback callback)
onBeforeDeactivate()
.callback
- boolean isRecovering()
FailoverManager.recover(org.zkoss.zk.ui.Session, org.zkoss.zk.ui.Execution, org.zkoss.zk.ui.Desktop)
.
If in recovering, no response is sent to the client.
It assumes the server is recovering the desktop and all it contains
to match the client's status.Visualizer getVisualizer()
Visualizer
for this execution.
It is the same as DesktopCtrl.getVisualizer()
.void setContentType(java.lang.String contentType)
void setDesktop(Desktop desktop)
Currently, it is used to communicate between WebManager.newDesktop and DesktopImpl's constructor.
java.lang.IllegalArgumentException
- if desktop is nulljava.lang.IllegalStateException
- if there is already a desktop
is associated with it.void setRequestId(java.lang.String reqId)
java.lang.String getRequestId()
java.util.Collection<AuResponse> getResponses()
AuResponse
)
that shall be generated to the output, or null if not available.void setResponses(java.util.Collection<AuResponse> responses)
AuResponse
)
that shall be generated to the output.ExecutionInfo getExecutionInfo()
Unlike most of other methods, this method could be accessed by another thread.
void setExecutionInfo(ExecutionInfo evtinf)
java.lang.Object getExtraXelVariable(java.lang.String name)
Execution.addVariableResolver(org.zkoss.xel.VariableResolver)
.
Notice that it looks only for the variables defined
in Execution.addVariableResolver(org.zkoss.xel.VariableResolver)
. To get a variable an EL expression
can reference, please use Execution.getVariableResolver()
instead.
java.lang.Object getExtraXelVariable(XelContext ctx, java.lang.Object base, java.lang.Object name)
Execution.addVariableResolver(org.zkoss.xel.VariableResolver)
.
Notice that it looks only for the variables defined
in Execution.addVariableResolver(org.zkoss.xel.VariableResolver)
. To get a variable an EL expression
can reference, please use Execution.getVariableResolver()
instead.
Unlike getExtraXelVariable(String)
, this method
can utilize VariableResolverX
if you'd like
to retrieve a property of another object.
ctx
- the XEL contextbase
- the base object. If null, it looks for a top-level variable.
If not null, it looks for a member of the base object (such as getter).name
- the property to retrieve.getExtraXelVariable(String)
Copyright © 2005-2021 Potix Corporation. All Rights Reserved.