다음을 통해 공유


FabricActorProxyFactory Class

  • java.lang.Object
    • ActorProxyFactory
      • microsoft.servicefabric.actors.remoting.client.FabricActorProxyFactory

public class FabricActorProxyFactory implements ActorProxyFactory

Factory class to create a proxy to the remote actor objects.

Constructor Summary

Constructor Description
FabricActorProxyFactory()

Initializes a new instance of the ActorProxyFactory class.

FabricActorProxyFactory(Function<ServiceRemotingCallbackClient, ServiceRemotingClientFactory> createServiceRemotingClientFactory, OperationRetrySettings retrySettings)

Initializes a new instance of the ActorProxyFactory class.

Method Summary

Modifier and Type Method and Description
<T extends Actor> T createActorProxy(Class<T> actorInterfaceType, ActorId actorId)

Creates a proxy to the actor object that implements an actor interface.

<T extends Actor> T createActorProxy(Class<T> actorInterfaceType, ActorId actorId, String applicationName, String serviceName, String listenerName)

Creates a proxy to the actor object that implements an actor interface.

<T extends Actor> T createActorProxy(Class<T> actorInterfaceType, URI serviceUri, ActorId actorId)

Creates a proxy to the actor object that implements an actor interface.

<T extends Actor> T createActorProxy(Class<T> actorInterfaceType, URI serviceUri, ActorId actorId, String listenerName)

Creates a proxy to the actor object that implements an actor interface.

<T extends Service> T createActorServiceProxy(Class<T> serviceInterfaceType, URI serviceUri, ActorId actorId)

Create a proxy to the actor service that is hosting the specified actor id and implementing specified type of the service interface.

<T extends Service> T createActorServiceProxy(Class<T> serviceInterfaceType, URI serviceUri, ActorId actorId, String listenerName)

Create a proxy to the actor service that is hosting the specified actor id and implementing specified type of the service interface.

<T extends Service> T createActorServiceProxy(Class<T> serviceInterfaceType, URI serviceUri, long partitionKey)

Create a proxy to the actor service that is hosting the specified actor id and implementing specified type of the service interface.

<T extends Service> T createActorServiceProxy(Class<T> serviceInterfaceType, URI serviceUri, long partitionKey, String listenerName)

Create a proxy to the actor service that is hosting the specified actor id and implementing specified type of the service interface.

ServiceRemotingClientFactory createServiceRemotingClientFactory(ServiceRemotingCallbackClient callbackClient)

Creates service remoting client factory.

Constructor Details

FabricActorProxyFactory

public FabricActorProxyFactory()

Initializes a new instance of the ActorProxyFactory class.

FabricActorProxyFactory

public FabricActorProxyFactory(Function createServiceRemotingClientFactory, OperationRetrySettings retrySettings)

Initializes a new instance of the ActorProxyFactory class.

Parameters:

createServiceRemotingClientFactory - Factory method to create remoting communication client factor.
retrySettings - Retry settings for the remote object calls made by proxy.

Method Details

createActorProxy

public T createActorProxy(Class actorInterfaceType, ActorId actorId)

Creates a proxy to the actor object that implements an actor interface.

Overrides:

FabricActorProxyFactory.createActorProxy(Class<T> actorInterfaceType, ActorId actorId)

Parameters:

actorInterfaceType - The actor interface implemented by the remote actor object. The returned proxy object will implement this interface.
actorId - Actor Id of the proxy actor object. Methods called on this proxy will result in requests being sent to the actor with this id.

Returns:

An actor proxy object that implements ActorProxy and Actor Interface.

createActorProxy

public T createActorProxy(Class actorInterfaceType, ActorId actorId, String applicationName, String serviceName, String listenerName)

Creates a proxy to the actor object that implements an actor interface.

Overrides:

FabricActorProxyFactory.createActorProxy(Class<T> actorInterfaceType, ActorId actorId, String applicationName, String serviceName, String listenerName)

Parameters:

actorInterfaceType - The actor interface implemented by the remote actor object. The returned proxy object will implement this interface.
actorId - Actor Id of the proxy actor object. Methods called on this proxy will result in requests being sent to the actor with this id.
applicationName - Name of the Service Fabric application that contains the actor service hosting the actor objects. This parameter can be null if the client is running as part of that same Service Fabric application. For more information, see Remarks.
serviceName - Name of the Service Fabric service as configured by ActorServiceAttribute on the actor implementation. By default, the name of the service is derived from the name of the actor interface. However ActorServiceAttribute is required when an actor implements more than one actor interfaces or an actor interface derives from another actor interface as the determination of the serviceName cannot be made automatically.
listenerName - By default an actor service has only one listener for clients to connect to and communicate with. However it is possible to configure an actor service with more than one listeners, the listenerName parameter specifies the name of the listener to connect to.

Returns:

An actor proxy object that implements ActorProxy and Actor Interface.

Throws:

URISyntaxException - Throws exception when invalid URI format is passed as applicationName

createActorProxy

public T createActorProxy(Class actorInterfaceType, URI serviceUri, ActorId actorId)

Creates a proxy to the actor object that implements an actor interface.

Overrides:

FabricActorProxyFactory.createActorProxy(Class<T> actorInterfaceType, URI serviceUri, ActorId actorId)

Parameters:

actorInterfaceType - The actor interface type implemented by the remote actor object. The returned proxy object will implement this interface.
serviceUri - Uri of the actor service.
actorId - Actor Id of the proxy actor object. Methods called on this proxy will result in requests being sent to the actor with this id.

Returns:

An actor proxy object that implements ActorProxy and Actor Interface.

createActorProxy

public T createActorProxy(Class actorInterfaceType, URI serviceUri, ActorId actorId, String listenerName)

Creates a proxy to the actor object that implements an actor interface.

Overrides:

FabricActorProxyFactory.createActorProxy(Class<T> actorInterfaceType, URI serviceUri, ActorId actorId, String listenerName)

Parameters:

actorInterfaceType - The actor interface type implemented by the remote actor object. The returned proxy object will implement this interface.
serviceUri - Uri of the actor service.
actorId - Actor Id of the proxy actor object. Methods called on this proxy will result in requests being sent to the actor with this id.
listenerName - By default an actor service has only one listener for clients to connect to and communicate with. However it is possible to configure an actor service with more than one listeners, the listenerName parameter specifies the name of the listener to connect to.

Returns:

An actor proxy object that implements ActorProxy and Actor Interface.

createActorServiceProxy

public T createActorServiceProxy(Class serviceInterfaceType, URI serviceUri, ActorId actorId)

Create a proxy to the actor service that is hosting the specified actor id and implementing specified type of the service interface.

Overrides:

FabricActorProxyFactory.createActorServiceProxy(Class<T> serviceInterfaceType, URI serviceUri, ActorId actorId)

Parameters:

serviceInterfaceType - The service interface type implemented by the actor service.
serviceUri - Uri of the actor service to connect to.
actorId - Id of the actor. The created proxy will be connected to the partition of the actor service hosting actor with this id.

Returns:

A service proxy object that implements ServiceProxyBase and T (Service Interface).

createActorServiceProxy

public T createActorServiceProxy(Class serviceInterfaceType, URI serviceUri, ActorId actorId, String listenerName)

Create a proxy to the actor service that is hosting the specified actor id and implementing specified type of the service interface.

Overrides:

FabricActorProxyFactory.createActorServiceProxy(Class<T> serviceInterfaceType, URI serviceUri, ActorId actorId, String listenerName)

Parameters:

serviceInterfaceType - The service interface type implemented by the actor service.
serviceUri - Uri of the actor service to connect to.
actorId - Id of the actor. The created proxy will be connected to the partition of the actor service hosting actor with this id.
listenerName - By default an actor service has only one listener for clients to connect to and communicate with. However it is possible to configure an actor service with more than one listeners, the listenerName parameter specifies the name of the listener to connect to.

Returns:

A service proxy object that implements ServiceProxyBase and T (Service Interface).

createActorServiceProxy

public T createActorServiceProxy(Class serviceInterfaceType, URI serviceUri, long partitionKey)

Create a proxy to the actor service that is hosting the specified actor id and implementing specified type of the service interface.

Overrides:

FabricActorProxyFactory.createActorServiceProxy(Class<T> serviceInterfaceType, URI serviceUri, long partitionKey)

Parameters:

serviceInterfaceType - The service interface type implemented by the actor service.
serviceUri - Uri of the actor service to connect to.
partitionKey - The key of the actor service partition to connect to.

Returns:

A service proxy object that implements ServiceProxyBase and T (Service Interface).

createActorServiceProxy

public T createActorServiceProxy(Class serviceInterfaceType, URI serviceUri, long partitionKey, String listenerName)

Create a proxy to the actor service that is hosting the specified actor id and implementing specified type of the service interface.

Overrides:

FabricActorProxyFactory.createActorServiceProxy(Class<T> serviceInterfaceType, URI serviceUri, long partitionKey, String listenerName)

Parameters:

serviceInterfaceType - The service interface type implemented by the actor service.
serviceUri - Uri of the actor service to connect to.
partitionKey - The key of the actor service partition to connect to.
listenerName - By default an actor service has only one listener for clients to connect to and communicate with. However it is possible to configure an actor service with more than one listeners, the listenerName parameter specifies the name of the listener to connect to.

Returns:

A service proxy object that implements ServiceProxyBase and T (Service Interface).

createServiceRemotingClientFactory

protected ServiceRemotingClientFactory createServiceRemotingClientFactory(ServiceRemotingCallbackClient callbackClient)

Creates service remoting client factory.

Parameters:

callbackClient - Callback from the remoting listener to the client.

Returns:

Created service remoting client factory as ServiceRemotingClientFactory.

Applies to