Interface ExecutionCtrl
-
- All Known Implementing Classes:
AbstractExecution,ExecutionImpl
public interface ExecutionCtrlAdditional interface toExecutionfor implementation.Application developers shall never access any of this methods.
- Author:
- tomyeh
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddOnActivate(Callback callback)Adds a callback method to be executed only once after the execution activated.voidaddOnDeactivate(Callback callback)Adds a callback method to be executed only once after the execution being deactivated (i.e. do the callback inonBeforeDeactivate().PagegetCurrentPage()Returns the current page.PageDefinitiongetCurrentPageDefinition()Returns the current page definition, which is pushed when evaluating a page (from a page definition).ExecutionInfogetExecutionInfo()Returns the information of the event being served, or null if the execution is not under serving an event.java.lang.ObjectgetExtraXelVariable(java.lang.String name)Returns the object, if any, defined in any variable resolver added byExecution.addVariableResolver(org.zkoss.xel.VariableResolver).java.lang.ObjectgetExtraXelVariable(org.zkoss.xel.XelContext ctx, java.lang.Object base, java.lang.Object name)Returns the object, if any, defined in any variable resolver added byExecution.addVariableResolver(org.zkoss.xel.VariableResolver).EventgetNextEvent()Returns the next event queued byExecution.postEvent(org.zkoss.zk.ui.event.Event), or null if no event queued.java.lang.StringgetRequestId()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.VisualizergetVisualizer()Returns theVisualizerfor this execution.booleanisActivated()Returns whether this execution is activated.booleanisRecovering()Returns whether this execution is in recovering.voidonActivate()Called when this execution is about to become the current executionExecutions.getCurrent().voidonBeforeDeactivate()Called when this execution is about to become a non-current execution.voidonDeactivate()Called when this execution is about to become a non-current execution.voidsetContentType(java.lang.String contentType)Sets the content type.voidsetCurrentPage(Page page)Sets the current page.voidsetCurrentPageDefinition(PageDefinition pgdef)Sets the current page definition.voidsetDesktop(Desktop desktop)Sets the desktop associated with this execution.voidsetExecutionInfo(ExecutionInfo evtinf)Sets the information of the event being served, or null if not under serving an event.voidsetRequestId(java.lang.String reqId)Sets the sequence ID of the current request.voidsetResponses(java.util.Collection<AuResponse> responses)Sets the collection of the AU responses (AuResponse) that shall be generated to the output.
-
-
-
Method Detail
-
getCurrentPage
Page getCurrentPage()
Returns the current page. Though an execution might process many pages, it processes update requests one-by-one and each update request is associated with a page.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).- See Also:
Desktop.getPage(java.lang.String)
-
setCurrentPage
void setCurrentPage(Page page)
Sets the current page. Though an execution might process many pages, it processes update requests one-by-one and each update request is associated with a page.
-
getCurrentPageDefinition
PageDefinition getCurrentPageDefinition()
Returns the current page definition, which is pushed when evaluating a page (from a page definition).
-
setCurrentPageDefinition
void setCurrentPageDefinition(PageDefinition pgdef)
Sets the current page definition.- Parameters:
pgdef- the page definition. If null, it means it is the same as getCurrentPage().getPageDefinition().
-
getNextEvent
Event getNextEvent()
Returns the next event queued byExecution.postEvent(org.zkoss.zk.ui.event.Event), or null if no event queued.Implementation Notes:
Execution.postEvent(int,Component,Event)proxies the event withProxyEventif the real target is different fromEvent.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).
-
isActivated
boolean isActivated()
Returns whether this execution is activated.
-
onActivate
void onActivate()
Called when this execution is about to become the current executionExecutions.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.
-
onDeactivate
void onDeactivate()
Called when this execution is about to become a non-current execution.It is used as callback notification.
Note: don't throw any exception in this method.
- See Also:
onActivate()
-
onBeforeDeactivate
void onBeforeDeactivate()
Called when this execution is about to become a non-current execution.It is used as callback notification.
Note: don't throw any exception in this method.
- Since:
- 7.0.5
- See Also:
onDeactivate()
-
addOnActivate
void addOnActivate(Callback callback)
Adds a callback method to be executed only once after the execution activated.- Parameters:
callback-- Since:
- 7.0.5
-
addOnDeactivate
void addOnDeactivate(Callback callback)
Adds a callback method to be executed only once after the execution being deactivated (i.e. do the callback inonBeforeDeactivate().- Parameters:
callback-- Since:
- 7.0.5
-
isRecovering
boolean isRecovering()
Returns whether this execution is in recovering. In other words, it is in the invocation ofFailoverManager.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.
-
getVisualizer
Visualizer getVisualizer()
Returns theVisualizerfor this execution. It is the same asDesktopCtrl.getVisualizer().
-
setContentType
void setContentType(java.lang.String contentType)
Sets the content type.- Since:
- 5.0.0
-
setDesktop
void setDesktop(Desktop desktop)
Sets the desktop associated with this execution. You rarely need to use this method, since the desktop is associated when this execution is created.Currently, it is used to communicate between WebManager.newDesktop and DesktopImpl's constructor.
- Throws:
java.lang.IllegalArgumentException- if desktop is nulljava.lang.IllegalStateException- if there is already a desktop is associated with it.- Since:
- 3.0.0
-
setRequestId
void setRequestId(java.lang.String reqId)
Sets the sequence ID of the current request.- Since:
- 3.0.5
-
getRequestId
java.lang.String getRequestId()
Returns the sequence ID of the current request, or null if not available. Not all clients support the request ID.- Since:
- 3.0.5
-
getResponses
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.- Since:
- 5.0.0
-
setResponses
void setResponses(java.util.Collection<AuResponse> responses)
Sets the collection of the AU responses (AuResponse) that shall be generated to the output.- Since:
- 5.0.0
-
getExecutionInfo
ExecutionInfo getExecutionInfo()
Returns the information of the event being served, or null if the execution is not under serving an event.Unlike most of other methods, this method could be accessed by another thread.
- Since:
- 5.0.6
-
setExecutionInfo
void setExecutionInfo(ExecutionInfo evtinf)
Sets the information of the event being served, or null if not under serving an event.- Since:
- 5.0.6
-
getExtraXelVariable
java.lang.Object getExtraXelVariable(java.lang.String name)
Returns the object, if any, defined in any variable resolver added byExecution.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 useExecution.getVariableResolver()instead.- Since:
- 6.0.0
-
getExtraXelVariable
java.lang.Object getExtraXelVariable(org.zkoss.xel.XelContext ctx, java.lang.Object base, java.lang.Object name)Returns the object, if any, defined in any variable resolver added byExecution.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 useExecution.getVariableResolver()instead.Unlike
getExtraXelVariable(String), this method can utilizeVariableResolverXif you'd like to retrieve a property of another object.- Parameters:
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.- Since:
- 6.0.0
- See Also:
getExtraXelVariable(String)
-
-