Class RemoteHttpCacheDispatcher
java.lang.Object
org.apache.commons.jcs3.auxiliary.remote.http.client.AbstractHttpClient
org.apache.commons.jcs3.auxiliary.remote.http.client.RemoteHttpCacheDispatcher
- All Implemented Interfaces:
IRemoteCacheDispatcher
Calls the service.
-
Constructor Summary
ConstructorsConstructorDescriptionRemoteHttpCacheDispatcher(RemoteHttpCacheAttributes remoteHttpCacheAttributes) -
Method Summary
Modifier and TypeMethodDescription<K,V, T> RemoteCacheResponse<T> dispatchRequest(RemoteCacheRequest<K, V> remoteCacheRequest) All requests will go through this method.protected voidpostProcessWebserviceCall(org.apache.http.client.methods.HttpUriRequest request, org.apache.http.HttpResponse httpState) Called after the execute call on the client.protected voidpreProcessWebserviceCall(org.apache.http.client.methods.RequestBuilder requestBuilder) Called before the execute call on the client.protected <K,V> byte[] processRequest(byte[] requestAsByteArray, RemoteCacheRequest<K, V> remoteCacheRequest, String url) Process single requestMethods inherited from class org.apache.commons.jcs3.auxiliary.remote.http.client.AbstractHttpClient
configureClient, doWebserviceCall, getRemoteHttpCacheAttributes
-
Constructor Details
-
RemoteHttpCacheDispatcher
- Parameters:
remoteHttpCacheAttributes-
-
-
Method Details
-
dispatchRequest
public <K,V, RemoteCacheResponse<T> dispatchRequestT> (RemoteCacheRequest<K, V> remoteCacheRequest) throws IOExceptionAll requests will go through this method.TODO consider taking in a URL instead of using the one in the configuration.
- Specified by:
dispatchRequestin interfaceIRemoteCacheDispatcher- Parameters:
remoteCacheRequest-- Returns:
- RemoteCacheResponse
- Throws:
IOException
-
processRequest
protected <K,V> byte[] processRequest(byte[] requestAsByteArray, RemoteCacheRequest<K, V> remoteCacheRequest, String url) throws IOException, org.apache.http.HttpExceptionProcess single request- Parameters:
requestAsByteArray- request bodyremoteCacheRequest- the cache requesturl- target url- Returns:
- byte[] - the response
- Throws:
IOExceptionorg.apache.http.HttpException
-
preProcessWebserviceCall
protected void preProcessWebserviceCall(org.apache.http.client.methods.RequestBuilder requestBuilder) throws IOException Called before the execute call on the client.- Specified by:
preProcessWebserviceCallin classAbstractHttpClient- Parameters:
requestBuilder- http method request builder- Throws:
IOException
-
postProcessWebserviceCall
protected void postProcessWebserviceCall(org.apache.http.client.methods.HttpUriRequest request, org.apache.http.HttpResponse httpState) throws IOException Called after the execute call on the client.- Specified by:
postProcessWebserviceCallin classAbstractHttpClient- Parameters:
request- http requesthttpState- result of execution- Throws:
IOException
-