Skip to content

ParticipantRoleExtensions Methods

Provides operations for inspecting and selecting transaction participants by protocol role.

IsManager(ParticipantId)

staticextension
View source
public static bool IsManager(this ParticipantId participant)
Determines whether a participant can coordinate transaction commit.

Parameters

participantParticipantId
The participant to inspect.

Returns

true when the participant supports the manager role; otherwise, false.

IsPriorityManager(ParticipantId)

staticextension
View source
public static bool IsPriorityManager(this ParticipantId participant)
Determines whether a participant is preferred when selecting the transaction manager.

Parameters

participantParticipantId
The participant to inspect.

Returns

true when the participant supports the priority-manager role; otherwise, false.

IsResource(ParticipantId)

staticextension
View source
public static bool IsResource(this ParticipantId participant)
Determines whether a participant stores transactional state.

Parameters

participantParticipantId
The participant to inspect.

Returns

true when the participant supports the resource role; otherwise, false.

SelectManagers(IEnumerable<KeyValuePair<ParticipantId, AccessCounter>>)

staticextension
View source
public static IEnumerable<KeyValuePair<ParticipantId, AccessCounter>> SelectManagers(this IEnumerable<KeyValuePair<ParticipantId, AccessCounter>> participants)
Selects participants which can coordinate transaction commit.

Parameters

participantsIEnumerable<KeyValuePair<ParticipantId, AccessCounter>>
The participants and their transaction access counts.

Returns

The participants which support the manager role, with their access counts.

SelectPriorityManagers(IEnumerable<ParticipantId>)

staticextension
View source
public static IEnumerable<ParticipantId> SelectPriorityManagers(this IEnumerable<ParticipantId> participants)
Selects participants which are preferred when choosing the transaction manager.

Parameters

participantsIEnumerable<ParticipantId>
The participants to filter.

Returns

The participants which support the priority-manager role.

SelectResources(IEnumerable<KeyValuePair<ParticipantId, AccessCounter>>)

staticextension
View source
public static IEnumerable<KeyValuePair<ParticipantId, AccessCounter>> SelectResources(this IEnumerable<KeyValuePair<ParticipantId, AccessCounter>> participants)
Selects participants which store transactional state.

Parameters

participantsIEnumerable<KeyValuePair<ParticipantId, AccessCounter>>
The participants and their transaction access counts.

Returns

The participants which support the resource role, with their access counts.

SupportsRoles(ParticipantId, Role)

staticextension
View source
public static bool SupportsRoles(this ParticipantId participant, Role role)
Determines whether a participant supports at least one of the specified roles.

Parameters

participantParticipantId
The participant to inspect.
roleRole
The role or roles to test.

Returns

true when the participant supports at least one specified role; otherwise, false.