org.zkoss.zk.ui.sys
Interface ExecutionCtrl

All Known Implementing Classes:
AbstractExecution, ExecutionImpl

public interface ExecutionCtrl

Additional interface to Execution for implementation.

Application developers shall never access any of this methods.

Author:
tomyeh

Method Summary
 void addDateHeader(java.lang.String name, long value)
          Deprecated. It is suggested to use Execution.getNativeResponse() instead
 void addHeader(java.lang.String name, java.lang.String value)
          Deprecated. As of release 3.6.3, replaced with Execution.addResponseHeader(java.lang.String, java.lang.String).
 Page getCurrentPage()
          Returns the current page.
 PageDefinition getCurrentPageDefinition()
          Returns the current page definition, which is pushed when evaluating a page (from a page definition).
 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 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 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 setDateHeader(java.lang.String name, long value)
          Deprecated. It is suggested to use Execution.getNativeResponse() instead.
 void setDesktop(Desktop desktop)
          Sets the desktop associated with this execution.
 void setHeader(java.lang.String name, java.lang.String value)
          Deprecated. As of release 3.6.3, replaced with Execution.setResponseHeader(java.lang.String, java.lang.String).
 void setRequestId(java.lang.String reqId)
          Sets the sequence ID of the current request.
 void setResponses(java.util.Collection 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 conccept 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 by Execution.postEvent(org.zkoss.zk.ui.event.Event), or null if no event queued.


isActivated

boolean isActivated()
Returns whether this execution is activated.


onActivate

void onActivate()
Called when this execution is about to become the current execution 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.


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()

isRecovering

boolean isRecovering()
Returns whether this execution is in recovering. In other words, it is in the invocation of 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.


getVisualizer

Visualizer getVisualizer()
Returns the Visualizer for this execution. It is the same as DesktopCtrl.getVisualizer().


setHeader

void setHeader(java.lang.String name,
               java.lang.String value)
Deprecated. As of release 3.6.3, replaced with Execution.setResponseHeader(java.lang.String, java.lang.String).

Sets a response header with the given name and value.

Since:
3.0.0

setDateHeader

void setDateHeader(java.lang.String name,
                   long value)
Deprecated. It is suggested to use Execution.getNativeResponse() instead.

Sets a response header with the given name and date-value. The date is specified in terms of milliseconds since the epoch. This method allows response headers to have multiple values.

Since:
3.0.0

addHeader

void addHeader(java.lang.String name,
               java.lang.String value)
Deprecated. As of release 3.6.3, replaced with Execution.addResponseHeader(java.lang.String, java.lang.String).

Adds a responseheader with the given name and value.

Since:
3.0.0

addDateHeader

void addDateHeader(java.lang.String name,
                   long value)
Deprecated. It is suggested to use Execution.getNativeResponse() instead

Adds a response header with the given name and date-value. The date is specified in terms of milliseconds since the epoch. This method allows response headers to have multiple values.

Since:
3.0.0

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 null
java.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 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 responses)
Sets the collection of the AU responses (AuResponse) that shall be generated to the output.

Since:
5.0.0


Copyright © 2005-2009 Potix Corporation. All Rights Reserved. SourceForge.net Logo