FabricActorService Class
- java.
lang. Object - StatefulServiceBase
- microsoft.
servicefabric. actors. runtime. FabricActorService
- microsoft.
public class FabricActorService extends StatefulServiceBase implements ActorService
Represents the base class for Microsoft Service Fabric based reliable actors service.
Remarks:Derive from this class to implement your own custom actor service if you want to override any service level behavior for your actors.
Constructor Summary
Constructor | Description |
---|---|
FabricActorService(StatefulServiceContext context, ActorTypeInformation actorTypeInfo) |
Initializes a new instance of the ActorService class. |
FabricActorService(StatefulServiceContext context, ActorTypeInformation actorTypeInfo, BiFunction<FabricActorService, ActorId, ActorBase> actorFactory) |
Initializes a new instance of the ActorService class. |
FabricActorService(StatefulServiceContext context, ActorTypeInformation actorTypeInfo, BiFunction<FabricActorService, ActorId, ActorBase> actorFactory, BiFunction<ActorBase, ActorStateProvider, ActorStateManager> stateManagerFactory, ActorStateProvider stateProvider, ActorServiceSettings settings) |
Initializes a new instance of the ActorService class. |
Method Summary
Modifier and Type | Method and Description |
---|---|
List<Service |
createServiceReplicaListeners()
Creates Service Replica Listeners. |
CompletableFuture<?> |
deleteActorAsync(ActorId actorId, CancellationToken cancellationToken)
Deletes an Actor from the Actor service. An active actor, will be deactivated and its state will also be deleted from state provider. An in-active actor's state will be deleted from state provider. If this method is called for a non-existent actor id in the system, it will be a no-op. |
CompletableFuture<Paged |
getActorsAsync(ContinuationToken continuationToken, CancellationToken cancellationToken)
Gets the list of Actors by querying the actor service. |
Actor |
getActorTypeInformation()
Gets ActorTypeInformation for actor service. |
Actor |
getSettings()
Gets settings for the actor service. |
Actor |
getStateProvider()
Gets a ActorStateProvider that represents the state provider for the actor service. |
void |
onAbort()
Overrides onAbort() |
CompletableFuture<?> |
onChangeRoleAsync(ReplicaRole newRole, CancellationToken cancellationToken)
Overrides onChangeRoleAsync(ReplicaRole newRole, CancellationToken cancellationToken) |
CompletableFuture<?> | onCloseAsync(CancellationToken cancellationToken) |
CompletableFuture<?> |
onOpenAsync(ReplicaOpenMode openMode, CancellationToken cancellationToken)
This method is called as the final step of opening the service. Override this method to be notified that Open has completed for this replica's internal components. |
CompletableFuture<?> | runAsync(CancellationToken cancellationToken) |
Inherited Members
Constructor Details
FabricActorService
public FabricActorService(StatefulServiceContext context, ActorTypeInformation actorTypeInfo)
Initializes a new instance of the ActorService class.
Parameters:
FabricActorService
public FabricActorService(StatefulServiceContext context, ActorTypeInformation actorTypeInfo, BiFunction
Initializes a new instance of the ActorService class.
Parameters:
FabricActorService
public FabricActorService(StatefulServiceContext context, ActorTypeInformation actorTypeInfo, BiFunction
Initializes a new instance of the ActorService class.
Parameters:
Method Details
createServiceReplicaListeners
protected List
Creates Service Replica Listeners.
Returns:
deleteActorAsync
public CompletableFuture deleteActorAsync(ActorId actorId, CancellationToken cancellationToken)
Deletes an Actor from the Actor service.
An active actor, will be deactivated and its state will also be deleted from state provider. An in-active actor's state will be deleted from state provider. If this method is called for a non-existent actor id in the system, it will be a no-op.
Overrides:
FabricActorService.deleteActorAsync(ActorId actorId, CancellationToken cancellationToken)Parameters:
ActorId of the actor to be deleted.
CancellationToken object to indicate the cancellation status of the operation.
Returns:
getActorsAsync
public CompletableFuture
Gets the list of Actors by querying the actor service.
Overrides:
FabricActorService.getActorsAsync(ContinuationToken continuationToken, CancellationToken cancellationToken)Parameters:
CancellationToken object to indicate the cancellation status of the operation.
Returns:
getActorTypeInformation
public ActorTypeInformation getActorTypeInformation()
Gets ActorTypeInformation for actor service.
Returns:
ActorTypeInformation for the actor hosted by the service replica.
getSettings
public ActorServiceSettings getSettings()
Gets settings for the actor service.
Returns:
getStateProvider
public ActorStateProvider getStateProvider()
Gets a ActorStateProvider that represents the state provider for the actor service.
Returns:
ActorStateProvider representing the state provider for the actor service.
onAbort
protected void onAbort()
Overrides onAbort()
onChangeRoleAsync
protected CompletableFuture onChangeRoleAsync(ReplicaRole newRole, CancellationToken cancellationToken)
Overrides onChangeRoleAsync(ReplicaRole newRole, CancellationToken cancellationToken)
Parameters:
CancellationToken object to indicate the cancellation status of the operation.
Returns:
onCloseAsync
protected CompletableFuture onCloseAsync(CancellationToken cancellationToken)
Overrides onCloseAsync(CancellationToken cancellationToken)
Parameters:
Returns:
onOpenAsync
protected CompletableFuture onOpenAsync(ReplicaOpenMode openMode, CancellationToken cancellationToken)
This method is called as the final step of opening the service. Override this method to be notified that Open has completed for this replica's internal components.
Parameters:
CancellationToken object to indicate the cancellation status of the operation.
Returns:
runAsync
protected CompletableFuture runAsync(CancellationToken cancellationToken)
Overrides runAsync(CancellationToken cancellationToken)
Parameters:
CancellationToken object to indicate the cancellation status of the operation.
Returns:
Applies to
Azure SDK for Java