FabricActor Class

  • java.lang.Object
    • ActorBase
      • microsoft.servicefabric.actors.runtime.FabricActor

public class FabricActor extends ActorBase

Represents a actor that can have multiple reliable 'named' states associated with it. ActorBase

Remarks:The state is preserved across actor garbage collections and fail-overs. The storage and retrieval of the state is provided by the actor state provider ActorStateProvider.

Constructor Summary

Constructor Description
FabricActor(FabricActorService actorService, ActorId actorId)

Initializes a new instance of FabricActor

Method Summary

Modifier and Type Method and Description
ActorStateManager getStateManager()

Gets the state manager for FabricActor which can be used to get/add/update/remove named states.

CompletableFuture<?> saveStateAsync()

Saves all the state changes (add/update/remove) that were made since last call to saveStateAsync(), to the actor state provider associated with the actor.

ActorStateManager stateManager()

Gets the state manager for FabricActor which can be used to get/add/update/remove named states.

Inherited Members

Constructor Details

FabricActor

protected FabricActor(FabricActorService actorService, ActorId actorId)

Initializes a new instance of FabricActor

Parameters:

actorService - The FabricActorService will host this actor instance.
actorId - The ActorId for this actor instance.

Method Details

getStateManager

public ActorStateManager getStateManager()

Gets the state manager for FabricActor which can be used to get/add/update/remove named states.

Returns:

An ActorStateManager which can be used to manage actor state.

saveStateAsync

protected CompletableFuture saveStateAsync()

Saves all the state changes (add/update/remove) that were made since last call to saveStateAsync(), to the actor state provider associated with the actor.

Returns:

A task that represents the asynchronous save operation.

stateManager

public ActorStateManager stateManager()

Gets the state manager for FabricActor which can be used to get/add/update/remove named states.

Returns:

An ActorStateManager which can be used to manage actor state.

Applies to