StatefulService Class

  • java.lang.Object

public class StatefulService extends StatefulServiceBase

Represents the base class for Microsoft Service Fabric based stateful reliable service which provides an ReliableStateManager to manager service's state Derive from this class to implement a Microsoft Service Fabric based stateful reliable service.

Constructor Summary

Constructor Description
StatefulService(StatefulServiceContext serviceContext)

Creates a new stateful service with default ReliableStateManager

StatefulService(StatefulServiceContext serviceContext, ReliableStateManagerReplica stateManagerReplica)

Creates a new stateful service with non-default ReliableStateManager

Method Summary

Modifier and Type Method and Description
ReliableStateManager getReliableStateManager()

Gets the replica's ReliableStateManager

Inherited Members

Constructor Details

StatefulService

protected StatefulService(StatefulServiceContext serviceContext)

Creates a new stateful service with default ReliableStateManager

Parameters:

serviceContext - Describes the stateful service context, which provides information like replica ID, partition ID, service name.

StatefulService

protected StatefulService(StatefulServiceContext serviceContext, ReliableStateManagerReplica stateManagerReplica)

Creates a new stateful service with non-default ReliableStateManager

Parameters:

serviceContext - Describes the stateful service context, which provides information like replica ID, partition ID, service name.
stateManagerReplica - Represents a reliable state provider replica.

Method Details

getReliableStateManager

public ReliableStateManager getReliableStateManager()

Gets the replica's ReliableStateManager

Returns:

The ReliableStateManager of the replica

Applies to