IBM WebSphere Application ServerTM
Release 7

com.ibm.websphere.webcontainer.async
Interface AsyncRequestDispatcherConfig


public interface AsyncRequestDispatcherConfig

AsyncRequestDispatcherConfig is used to pass custom config for a particular request dispatcher including error messages, timeouts, etc. If various encodings are not specified, the default encoding value of the top level response's getCharacterEncoding() method is used.


Method Summary
 void addThreadLocalToPropagate(java.lang.ThreadLocal threadLocals)
          Since the AsynchBeans executes the includes on a non-child thread, InheritableThreadLocals will not work so a mechanism is provided to propagate them
 java.lang.String getExecutionTimeoutEncoding()
          Return the encoding used for the message displayed if the maximum length of time for the execution of an include has been reached
 java.lang.String getExecutionTimeoutMessage()
          Return the message displayed if the maximum length of time for the execution of an include is reached.
 int getExecutionTimeoutOverride()
          Return the maximum length of time allowed for the execution of an include
 int getExpirationTimeoutOverride()
          Retrieve the maximum amount of time results can be in the results store where it is still retrievable by the client.
 java.lang.String getOutputRetrievalFailureEncoding()
          Return the encoding used for the message displayed for any error that causes the output to be unretrievable.
 java.lang.String getOutputRetrievalFailureMessage()
          Return the message displayed for any error that causes the output to be unretrievable.
 java.lang.String getRejectedEncoding()
          Returns the encoding used to display the message when work is rejected
 java.lang.String getRejectedMessage()
          Return the message displayed when an include is rejected by the work manager
 java.util.List<java.lang.ThreadLocal> getThreadLocalsToPropagate()
          Since the AsynchBeans executes the includes on a non-child thread, InheritableThreadLocals will not work.
 void initThreadLocals()
          Since the AsynchBeans executes the includes on a non-child thread, InheritableThreadLocals will not work.
 boolean isRetriable()
          If isRetriable is true, a rejected include will attempt to be executed again.
 boolean isTransferState()
          This must be set if the developer needs request attributes and internal headers returned to the top level request.
 boolean isUseDefaultJavascript()
          Returns true when ARD sends the javascript to aggregate the content on the client side.
 void setExecutionTimeoutMessage(java.lang.String message, java.lang.String encoding)
          Set the message displayed if the maximum length of time for the execution of an include is reached
 void setExecutionTimeoutOverride(int ms)
          Set the maximum length of time allowed for the execution of an include.
 void setExpirationTimeoutOverride(int includeTimeout)
          Maximum amount of time results can be in the results store where it is still retrievable by the client.
 void setOutputRetrievalFailureMessage(java.lang.String message, java.lang.String encoding)
          Set the message displayed for any error that causes the output to be unretrievable, such as the result expiring from the results store.
 void setRejectedMessage(java.lang.String rejectedMessage, java.lang.String rejectedEncoding)
          Set the message displayed when an include is rejected by the work manager
 void setRetriable(boolean retriable)
          Set whether or not we will retry the include if we've received a rejected work item.
 void setTransferState(boolean state)
          Set the value of transfer state.
 void setUseDefaultJavascript(boolean useDefaultJavascript)
          sets whether to allow ARD to insert javascript into customer code to retrieve results for client-side aggregation.
 

Method Detail

setExpirationTimeoutOverride

void setExpirationTimeoutOverride(int includeTimeout)
Maximum amount of time results can be in the results store where it is still retrievable by the client.

Parameters:
includeTimeout - timeout value in ms

getExpirationTimeoutOverride

int getExpirationTimeoutOverride()
Retrieve the maximum amount of time results can be in the results store where it is still retrievable by the client.

Returns:
timeout value in ms

setOutputRetrievalFailureMessage

void setOutputRetrievalFailureMessage(java.lang.String message,
                                      java.lang.String encoding)
Set the message displayed for any error that causes the output to be unretrievable, such as the result expiring from the results store.

Parameters:
message - custom failure message
encoding -

getOutputRetrievalFailureMessage

java.lang.String getOutputRetrievalFailureMessage()
Return the message displayed for any error that causes the output to be unretrievable. This include expiration of content.

Returns:
failure message

getOutputRetrievalFailureEncoding

java.lang.String getOutputRetrievalFailureEncoding()
Return the encoding used for the message displayed for any error that causes the output to be unretrievable.

Returns:
encoding

setExecutionTimeoutOverride

void setExecutionTimeoutOverride(int ms)
Set the maximum length of time allowed for the execution of an include. Does not apply to insertFragmentBlocking calls.

Parameters:
ms - timeout in ms

setExecutionTimeoutMessage

void setExecutionTimeoutMessage(java.lang.String message,
                                java.lang.String encoding)
Set the message displayed if the maximum length of time for the execution of an include is reached

Parameters:
message - custom timeout message
encoding -

getExecutionTimeoutMessage

java.lang.String getExecutionTimeoutMessage()
Return the message displayed if the maximum length of time for the execution of an include is reached. The default value is 60000 ms (or one minute). If this execution timeout is reached, but the actual include results are ready once the data can be flushed, preference is given to the actual results to be sent.

Returns:
timeout message

getExecutionTimeoutOverride

int getExecutionTimeoutOverride()
Return the maximum length of time allowed for the execution of an include

Returns:
timeout in ms

getExecutionTimeoutEncoding

java.lang.String getExecutionTimeoutEncoding()
Return the encoding used for the message displayed if the maximum length of time for the execution of an include has been reached

Returns:
encoding

setRejectedMessage

void setRejectedMessage(java.lang.String rejectedMessage,
                        java.lang.String rejectedEncoding)
Set the message displayed when an include is rejected by the work manager

Parameters:
rejectedMessage - custom error message
rejectedEncoding - encoding

getRejectedMessage

java.lang.String getRejectedMessage()
Return the message displayed when an include is rejected by the work manager

Returns:
error message

getRejectedEncoding

java.lang.String getRejectedEncoding()
Returns the encoding used to display the message when work is rejected

Returns:
encdoding

isRetriable

boolean isRetriable()
If isRetriable is true, a rejected include will attempt to be executed again. Default is false.

Returns:
true/false

setRetriable

void setRetriable(boolean retriable)
Set whether or not we will retry the include if we've received a rejected work item.

Parameters:
retriable -

isTransferState

boolean isTransferState()
This must be set if the developer needs request attributes and internal headers returned to the top level request. This only works for insertFragmentBlocking since that is the only insertion method that guarantees the top level request still exists.

Returns:
true/false

setTransferState

void setTransferState(boolean state)
Set the value of transfer state.

Parameters:
state -

isUseDefaultJavascript

boolean isUseDefaultJavascript()
Returns true when ARD sends the javascript to aggregate the content on the client side. Returns false when the customer must implement their own code to aggregate content on the client side. They should retrieve the request attribute "com.ibm.websphere.webcontainer.ard.endpointURI" to get this endpoint and then make XMLHttpRequests to retrieve the results

Returns:
true/false

setUseDefaultJavascript

void setUseDefaultJavascript(boolean useDefaultJavascript)
sets whether to allow ARD to insert javascript into customer code to retrieve results for client-side aggregation.

Parameters:
useDefaultJavascript -

addThreadLocalToPropagate

void addThreadLocalToPropagate(java.lang.ThreadLocal threadLocals)
Since the AsynchBeans executes the includes on a non-child thread, InheritableThreadLocals will not work so a mechanism is provided to propagate them

Parameters:
threadLocals -

getThreadLocalsToPropagate

java.util.List<java.lang.ThreadLocal> getThreadLocalsToPropagate()
Since the AsynchBeans executes the includes on a non-child thread, InheritableThreadLocals will not work. This method allows the retrieval of the current set that need to be propagated.


initThreadLocals

void initThreadLocals()
Since the AsynchBeans executes the includes on a non-child thread, InheritableThreadLocals will not work. This method clears the list of ThreadLocals to propagate if any were set on a previous request.


IBM WebSphere Application ServerTM
Release 7