public class Configuration extends Object
| Constructor and Description |
|---|
Configuration() |
| Modifier and Type | Method and Description |
|---|---|
String |
getActionNs() |
String |
getApiNs() |
String |
getBaseRouterUrl() |
BatchedMethodsExecutionPolicy |
getBatchedMethodsExecutionPolicy() |
ExecutorService |
getBatchedMethodsExecutorService() |
Integer |
getBufferLimit() |
org.springframework.core.convert.ConversionService |
getConversionService() |
String |
getDefaultExceptionMessage() |
Object |
getEnableBuffer() |
Map<Class<?>,String> |
getExceptionToMessage() |
String |
getFrameDomain() |
String |
getFrameDomainScript() |
String |
getJsContentType() |
JsonHandler |
getJsonHandler() |
Integer |
getMaxRetries() |
String |
getMessage(Throwable exception)
Returns an error message for the supplied exception and based on this
configuration.
|
String |
getPollingUrlsVar() |
String |
getProviderType() |
String |
getRemotingApiVar() |
Integer |
getTimeout() |
boolean |
isAlwaysWrapStoreResponse() |
boolean |
isFullRouterUrl() |
boolean |
isSendExceptionMessage() |
boolean |
isSendStacktrace() |
boolean |
isStreamResponse() |
boolean |
isSynchronizeOnSession() |
String |
postProcessRequestUrl(javax.servlet.http.HttpServletRequest request,
String requestUrlString) |
void |
setActionNs(String actionNs)
Sets the name of the namespace in which the actions will reside.
|
void |
setAlwaysWrapStoreResponse(boolean alwaysWrapStoreResponse)
If alwaysWrapStoreResponse is true, responses of STORE_READ and STORE_MODIFY
methods are always wrapped in an
ExtDirectStoreResult object. |
void |
setApiNs(String apiNs)
Sets the name of the namespace in which the remotingApiVar variable will reside.
|
void |
setBaseRouterUrl(String baseRouterUrl)
If not null the
ApiController does not use the url of the request to
determine the router url instead he uses the value of this variable as the base and
adds /router and /poll.The fullRouterUrl setting is ignored when this variable is not null |
void |
setBatchedMethodsExecutionPolicy(BatchedMethodsExecutionPolicy batchedMethodsExecutionPolicy)
Specifies how batched methods sent from the client should be executed on the
server.
|
void |
setBatchedMethodsExecutorService(ExecutorService batchedMethodsExecutorService)
Sets the thread pool used for executing batched methods concurrently.
|
void |
setBufferLimit(Integer bufferLimit)
The maximum number of requests to batch together.
|
void |
setConversionService(org.springframework.core.convert.ConversionService conversionService) |
void |
setDefaultExceptionMessage(String defaultExceptionMessage)
Changes the default message when an exception occurred and there is no mapping
found in
getExceptionToMessage() and isSendExceptionMessage() is
false. |
void |
setEnableBuffer(Object enableBuffer)
true or false to enable or disable combining of method calls.
|
void |
setExceptionToMessage(Map<Class<?>,String> exceptionToMessage)
Sets the new exception-to-message map.
|
void |
setFrameDomain(String frameDomain)
Sets the passed domain to be included in the file upload's temporary frame.
|
void |
setFrameDomainScript(String frameDomainScript)
Updates the script that is used to set the domain values on the file upload frame.
|
void |
setFullRouterUrl(boolean fullRouterUrl)
Specifies if the router property should contain the full URL including protocol,
server name, port number, and server path (true) or only the server path (false)
|
void |
setJsContentType(String jsContentType)
Specifies the Content-Type for api.js and api-debug.js.
|
void |
setJsonHandler(JsonHandler jsonHandler) |
void |
setMaxRetries(Integer maxRetries)
Sets the number of times the client will try to send a message to the server before
throwing a failure.
|
void |
setPollingUrlsVar(String pollingUrlsVar)
Changes the name of the polling urls object variable
|
void |
setProviderType(String providerType)
Sets the type of the provider.
|
void |
setRemotingApiVar(String remotingApiVar)
Changes the name of the remoting api variable.
|
void |
setSendExceptionMessage(boolean sendExceptionMessage)
Changes the way
BaseResponse.setMessage(String) is called. |
void |
setSendStacktrace(boolean sendStacktrace)
If sendStacktrace is true, the library sends, in case of an exception, the full
stacktrace in
BaseResponse.setWhere(String) back to the client. |
void |
setStreamResponse(boolean streamResponse)
If streamResponse is true, the JSON response will be directly written into the
ServletResponse.getOutputStream() without setting the Content-Length
header. |
void |
setSynchronizeOnSession(boolean synchronizeOnSession)
If synchronizeOnSession is true, execution of all methods is synchronized on the
session object.
|
void |
setTimeout(Integer timeout)
Sets the timeout in milliseconds for remote calls.
|
public String getDefaultExceptionMessage()
public void setDefaultExceptionMessage(String defaultExceptionMessage)
getExceptionToMessage() and isSendExceptionMessage() is
false.
Default value is "Server Error".
This value is set into BaseResponse.setMessage(String) and sent to the
client.
defaultExceptionMessage - new default exception messagesetExceptionToMessage(Map),
setDefaultExceptionMessage(String)public boolean isSendExceptionMessage()
public void setSendExceptionMessage(boolean sendExceptionMessage)
BaseResponse.setMessage(String) is called.
If this flag is set to true and an exception occurred instead of
getDefaultExceptionMessage() Throwable.getMessage() is put into
the message field of the response. Only if there is no mapping found in
getExceptionToMessage().
Default value is false.
sendExceptionMessage - new flagsetExceptionToMessage(Map),
setDefaultExceptionMessage(String)public boolean isSendStacktrace()
public void setSendStacktrace(boolean sendStacktrace)
BaseResponse.setWhere(String) back to the client.
Should only set to true in development.
Default value is false
sendStacktrace - new flagpublic void setExceptionToMessage(Map<Class<?>,String> exceptionToMessage)
If there is a mapping for the exception in getExceptionToMessage() and the
value is not null put this value in BaseResponse.setMessage(String).
If there is a mapping for the exception in getExceptionToMessage() and the
value is null use Throwable.getMessage().
If there is no mapping and isSendExceptionMessage() is true use
Throwable.getMessage().
If there is no mapping and isSendExceptionMessage() is false use
getDefaultExceptionMessage().
exceptionToMessage - new mapping from exception to messagesetDefaultExceptionMessage(String),
setSendExceptionMessage(boolean)public boolean isAlwaysWrapStoreResponse()
public void setAlwaysWrapStoreResponse(boolean alwaysWrapStoreResponse)
ExtDirectStoreResult object.alwaysWrapStoreResponse - new flagpublic boolean isSynchronizeOnSession()
public void setSynchronizeOnSession(boolean synchronizeOnSession)
Instead of globally enable this it's possible to set the flag on a per method basis
with ExtDirectMethod.synchronizeOnSession().
synchronizeOnSession - new flagpublic Integer getTimeout()
public void setTimeout(Integer timeout)
timeout - new timeout valuepublic Integer getMaxRetries()
public void setMaxRetries(Integer maxRetries)
maxRetries - new number of max retriespublic Object getEnableBuffer()
public void setEnableBuffer(Object enableBuffer)
This parameter is part of the configuration object api.js sends to the client and configures the enableBuffer property of the RemotingProvider.
Defaults to: 10
enableBuffer - new enableBuffer valuepublic Integer getBufferLimit()
public void setBufferLimit(Integer bufferLimit)
enableBuffer timeout has not yet expired.
Note that this option does nothing if enableBuffer is set to `false`.
Defaults to: Number.MAX_VALUE
bufferLimit - new value for buffer limitpublic String getMessage(Throwable exception)
exception - the thrown exceptionsetDefaultExceptionMessage(String),
setSendExceptionMessage(boolean),
setExceptionToMessage(Map)public boolean isStreamResponse()
public void setStreamResponse(boolean streamResponse)
ServletResponse.getOutputStream() without setting the Content-Length
header. The old ExtDirectSpring 1.0.x behavior.
If false the RouterController writes the JSON into an internal buffer, sets
the Content-Length header in HttpServletResponse and writes the buffer into
ServletResponse.getOutputStream().
Instead of globally enable this it's possible to set the flag on a per method basis
with ExtDirectMethod.streamResponse().
Default value is false
streamResponse - new flagpublic void setJsContentType(String jsContentType)
Until version 1.2.1 extdirectspring sends "application/x-javascript". But according to RFC4329 the official mime type is 'application/javascript'.
Default value is "application/javascript"
jsContentType - new Content-typepublic String getJsContentType()
public BatchedMethodsExecutionPolicy getBatchedMethodsExecutionPolicy()
public void setBatchedMethodsExecutionPolicy(BatchedMethodsExecutionPolicy batchedMethodsExecutionPolicy)
BatchedMethodsExecutionPolicy.SEQUENTIAL executes methods one after
the other. BatchedMethodsExecutionPolicy.CONCURRENT executes methods
concurrently with the help of a thread pool.
Default value is BatchedMethodsExecutionPolicy.SEQUENTIAL
batchedMethodsExecutionPolicy - new policysetBatchedMethodsExecutorService(ExecutorService)public ExecutorService getBatchedMethodsExecutorService()
public void setBatchedMethodsExecutorService(ExecutorService batchedMethodsExecutorService)
If batchedMethodsExecutionPolicy is set to
BatchedMethodsExecutionPolicy.CONCURRENT but no
batchedMethodsExecutorService is specified the library creates a
Executors.newFixedThreadPool(int) with 5 threads.
batchedMethodsExecutorService - the new thread poolsetBatchedMethodsExecutionPolicy(BatchedMethodsExecutionPolicy)public String getProviderType()
public void setProviderType(String providerType)
Default value is "remoting" and it creates an Ext.direct.RemotingProvider on the client side.
providerType - new provider typepublic String getFrameDomain()
public void setFrameDomain(String frameDomain)
frameDomain - the new domain to set the frame topublic String getFrameDomainScript()
public void setFrameDomainScript(String frameDomainScript)
frameDomainScript - the javascript code used to set the frame domainpublic String getApiNs()
public void setApiNs(String apiNs)
Defaults to Ext.app
apiNs - new namespacepublic String getActionNs()
public void setActionNs(String actionNs)
Defaults to none
actionNs - new namespacepublic String getRemotingApiVar()
public void setRemotingApiVar(String remotingApiVar)
Defaults to REMOTING_API
remotingApiVar - new remoting api varaible namepublic String getPollingUrlsVar()
public void setPollingUrlsVar(String pollingUrlsVar)
Defaults to POLLING_URLS
pollingUrlsVar - new polling urls object variable namepublic boolean isFullRouterUrl()
public void setFullRouterUrl(boolean fullRouterUrl)
Defaults to false
fullRouterUrl - new flag valuepublic String getBaseRouterUrl()
public void setBaseRouterUrl(String baseRouterUrl)
ApiController does not use the url of the request to
determine the router url instead he uses the value of this variable as the base and
adds /router and /poll.Defaults to null.
baseRouterUrl - new base router urlpublic org.springframework.core.convert.ConversionService getConversionService()
public void setConversionService(org.springframework.core.convert.ConversionService conversionService)
public JsonHandler getJsonHandler()
public void setJsonHandler(JsonHandler jsonHandler)
Copyright © 2010–2018. All rights reserved.