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
Modifier and TypeMethodDescriptionvoid
addThreadLocalToPropagate
(ThreadLocal threadLocals) Since the AsynchBeans executes the includes on a non-child thread, InheritableThreadLocals will not work so a mechanism is provided to propagate themReturn the encoding used for the message displayed if the maximum length of time for the execution of an include has been reachedReturn the message displayed if the maximum length of time for the execution of an include is reached.int
Return the maximum length of time allowed for the execution of an includeint
Retrieve the maximum amount of time results can be in the results store where it is still retrievable by the client.Return the encoding used for the message displayed for any error that causes the output to be unretrievable.Return the message displayed for any error that causes the output to be unretrievable.Returns the encoding used to display the message when work is rejectedReturn the message displayed when an include is rejected by the work managerSince the AsynchBeans executes the includes on a non-child thread, InheritableThreadLocals will not work.void
Since the AsynchBeans executes the includes on a non-child thread, InheritableThreadLocals will not work.boolean
If isRetriable is true, a rejected include will attempt to be executed again.boolean
This must be set if the developer needs request attributes and internal headers returned to the top level request.boolean
Returns true when ARD sends the javascript to aggregate the content on the client side.void
setExecutionTimeoutMessage
(String message, String encoding) Set the message displayed if the maximum length of time for the execution of an include is reachedvoid
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
(String message, 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
(String rejectedMessage, String rejectedEncoding) Set the message displayed when an include is rejected by the work managervoid
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 Details
-
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
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 messageencoding
-
-
getOutputRetrievalFailureMessage
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
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
Set the message displayed if the maximum length of time for the execution of an include is reached- Parameters:
message
- custom timeout messageencoding
-
-
getExecutionTimeoutMessage
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
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
Set the message displayed when an include is rejected by the work manager- Parameters:
rejectedMessage
- custom error messagerejectedEncoding
- encoding
-
getRejectedMessage
String getRejectedMessage()Return the message displayed when an include is rejected by the work manager- Returns:
- error message
-
getRejectedEncoding
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
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
List<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.- Parameters:
a
- list of ThreadLocals
-
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.
-