public abstract class AbstractRemoteInvocationServiceCaller extends AbstractRemoteInvocationCaller<RemoteInvocationServiceQueue,GenericRemoteInvocationRpcCall,GenericRemoteInvocationRpcTransactionalCalls,GenericRemoteInvocationRpcRequest> implements RemoteInvocationServiceCaller
RemoteInvocationServiceCaller
.Modifier and Type | Class and Description |
---|---|
protected class |
AbstractRemoteInvocationServiceCaller.RemoteInvocationServiceQueueImpl
This inner class is the implementation of
RemoteInvocationServiceQueue . |
protected static class |
AbstractRemoteInvocationServiceCaller.ServiceCallData<RESULT>
This inner class is a simple container for the data of an invocation of a
RemoteInvocationService
method. |
AbstractRemoteInvocationCaller.AbstractRemoteInvocationQueue, AbstractRemoteInvocationCaller.RequestBuilder, AbstractRemoteInvocationCaller.TransactionalCallBuilder
CDI_NAME
Constructor and Description |
---|
AbstractRemoteInvocationServiceCaller()
The constructor.
|
Modifier and Type | Method and Description |
---|---|
protected void |
addCall(GenericRemoteInvocationRpcCall call,
Class<?> returnType)
This method is called from the service-client stub to add a
GenericRemoteInvocationRpcCall . |
protected RemoteInvocationServiceQueue |
createQueue(RemoteInvocationQueueSettings settings,
AbstractRemoteInvocationCaller.AbstractRemoteInvocationQueue parentQueue) |
protected GenericRemoteInvocationRpcTransactionalCalls |
createRemoteInvocationTransactionalCalls(List<GenericRemoteInvocationRpcCall> calls) |
protected GenericRemoteInvocationRpcRequest |
createRequest(int requestId,
CsrfToken token,
List<GenericRemoteInvocationRpcTransactionalCalls> transactionalCalls)
Creates a new
GenericRemoteInvocationRequest instance. |
protected abstract <SERVICE extends RemoteInvocationService> |
getServiceClient(Class<SERVICE> serviceInterface) |
<SERVICE extends RemoteInvocationService,RESULT> |
getServiceClient(Class<SERVICE> serviceInterface,
Class<RESULT> returnType,
Consumer<? extends RESULT> successCallback)
|
<SERVICE extends RemoteInvocationService,RESULT> |
getServiceClient(Class<SERVICE> serviceInterface,
Class<RESULT> returnType,
Consumer<? extends RESULT> successCallback,
Consumer<Throwable> failureCallback)
This method gets a client-stub for calling exactly one single method on a
RemoteInvocationService . |
createQueue, getCurrentQueue, getDefaultFailureCallback, getTransactionMode, getXsrfToken, handleFailure, handleResponse, newQueue, newQueue, newQueue, newQueueForAutoCommit, nextRequestId, performRequest, performRequest, requireCurrentQueue, setDefaultFailureCallback, setTransactionMode
createLogger, doInitialize, getLogger
doInitialized, getInitializationState, initialize
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getCurrentQueue, newQueue, newQueue, newQueue
public AbstractRemoteInvocationServiceCaller()
protected RemoteInvocationServiceQueue createQueue(RemoteInvocationQueueSettings settings, AbstractRemoteInvocationCaller.AbstractRemoteInvocationQueue parentQueue)
createQueue
in class AbstractRemoteInvocationCaller<RemoteInvocationServiceQueue,GenericRemoteInvocationRpcCall,GenericRemoteInvocationRpcTransactionalCalls,GenericRemoteInvocationRpcRequest>
settings
- are the RemoteInvocationQueueSettings
.parentQueue
- is the parent queue.AbstractRemoteInvocationCaller.createQueue(RemoteInvocationQueueSettings)
protected GenericRemoteInvocationRpcTransactionalCalls createRemoteInvocationTransactionalCalls(List<GenericRemoteInvocationRpcCall> calls)
createRemoteInvocationTransactionalCalls
in class AbstractRemoteInvocationCaller<RemoteInvocationServiceQueue,GenericRemoteInvocationRpcCall,GenericRemoteInvocationRpcTransactionalCalls,GenericRemoteInvocationRpcRequest>
calls
- is the List
with the <CALL>s.calls
.protected GenericRemoteInvocationRpcRequest createRequest(int requestId, CsrfToken token, List<GenericRemoteInvocationRpcTransactionalCalls> transactionalCalls)
GenericRemoteInvocationRequest
instance.createRequest
in class AbstractRemoteInvocationCaller<RemoteInvocationServiceQueue,GenericRemoteInvocationRpcCall,GenericRemoteInvocationRpcTransactionalCalls,GenericRemoteInvocationRpcRequest>
requestId
- - see GenericRemoteInvocationRequest.getRequestId()
.token
- - see GenericRemoteInvocationRequest.getXsrfToken()
.transactionalCalls
- - see GenericRemoteInvocationRequest.getTransactionalCalls()
.protected void addCall(GenericRemoteInvocationRpcCall call, Class<?> returnType)
GenericRemoteInvocationRpcCall
.call
- is the GenericRemoteInvocationRpcCall
to add.returnType
- is the return type
of the invoked
Method
.public <SERVICE extends RemoteInvocationService,RESULT> SERVICE getServiceClient(Class<SERVICE> serviceInterface, Class<RESULT> returnType, Consumer<? extends RESULT> successCallback)
AbstractRemoteInvocationServiceCaller.getServiceClient(Class, Class, Consumer, Consumer)
but using the
default
failure callback
.getServiceClient
in interface AbstractRemoteInvocationServiceCaller
SERVICE
- is the generic type of serviceInterface
.RESULT
- is the generic type of returnType
.serviceInterface
- is the interface of the RemoteInvocationService
.returnType
- is the return type
of the
Method
to invoke.successCallback
- is the Consumer
that is asynchronously invoked
on success with when the result of the invoked service Method
has been received. The generic type may extend result if it is generic itself. E.g. your service
might return List<String>
but you can only supply List.class
as
return type.RemoteInvocationService
.public <SERVICE extends RemoteInvocationService,RESULT> SERVICE getServiceClient(Class<SERVICE> serviceInterface, Class<RESULT> returnType, Consumer<? extends RESULT> successCallback, Consumer<Throwable> failureCallback)
RemoteInvocationService
. After this method has been called, the intended method (with the given
returnType
) has to be invoked on the resulting client-stub exactly once. This records the
desired method invocation and returns a dummy result (typically null
) that shall be ignored.
queue
that gets committed
automatically after a service method has been called on the returned client-stub.getServiceClient
in interface AbstractRemoteInvocationServiceCaller
getServiceClient
in interface RemoteInvocationServiceCaller
SERVICE
- is the generic type of serviceInterface
.RESULT
- is the generic type of returnType
.serviceInterface
- is the interface of the RemoteInvocationService
.returnType
- is the return type
of the
Method
to invoke.successCallback
- is the Consumer
that is asynchronously invoked
on success with when the result of the invoked service Method
has been received. The generic type may extend result if it is generic itself. E.g. your service
might return List<String>
but you can only supply List.class
as
return type.failureCallback
- is the Consumer
that is asynchronously invoked
on failure with the Throwable
that occurred when calling the invoked service
Method
.RemoteInvocationService
.protected abstract <SERVICE extends RemoteInvocationService> SERVICE getServiceClient(Class<SERVICE> serviceInterface)
SERVICE
- is the generic type of serviceInterface
.serviceInterface
- is the interface of the RemoteInvocationService
.RemoteInvocationServiceQueue.getServiceClient(Class, Class,
Consumer, Consumer)
Copyright © 2001–2016 mmm-Team. All rights reserved.