eneter.messaging.endpoints.rpc
Interface IRpcFactory

All Known Implementing Classes:
RpcFactory

public interface IRpcFactory

Creates services and clients that can communicate using Remote Procedure Calls.


Method Summary
<TServiceInterface>
IRpcClient<TServiceInterface>
createClient(java.lang.Class<TServiceInterface> clazz)
          Creates RPC client for the given interface.
<TServiceInterface>
IRpcService<TServiceInterface>
createPerClientInstanceService(IFunction<TServiceInterface> serviceFactoryMethod, java.lang.Class<TServiceInterface> clazz)
          Creates per-client-instance RPC service for the given interface.
<TServiceInterface>
IRpcService<TServiceInterface>
createSingleInstanceService(TServiceInterface service, java.lang.Class<TServiceInterface> clazz)
          Creates single-instance RPC service for the given interface.
 

Method Detail

createClient

<TServiceInterface> IRpcClient<TServiceInterface> createClient(java.lang.Class<TServiceInterface> clazz)
Creates RPC client for the given interface.

Parameters:
clazz - service interface type.
Returns:
RpcClient instance

createSingleInstanceService

<TServiceInterface> IRpcService<TServiceInterface> createSingleInstanceService(TServiceInterface service,
                                                                               java.lang.Class<TServiceInterface> clazz)
Creates single-instance RPC service for the given interface. Single-instance means that there is one instance of the service shared by all clients.

Parameters:
service - instance implementing the given service interface.
clazz - service interface type.
Returns:
RpcService instance.

createPerClientInstanceService

<TServiceInterface> IRpcService<TServiceInterface> createPerClientInstanceService(IFunction<TServiceInterface> serviceFactoryMethod,
                                                                                  java.lang.Class<TServiceInterface> clazz)
Creates per-client-instance RPC service for the given interface. Per-client-instance means that for each connected client is created a separate instace of the service.

Parameters:
serviceFactoryMethod - factory method used to create the service instance when the client is connected
clazz - service interface type
Returns:
RpcService instance