com.sun.enterprise.ee.cms.core
Interface GroupManagementService

All Known Implementing Classes:
GroupManagementServiceImpl

public interface GroupManagementService

Provides API for joining, and leaving the group and to register Action Factories of specific types for specific Group Event Signals.

Version:
$Revision: 1.17 $
Author:
Shreedhar Ganapathy Date: June 10, 2006

Nested Class Summary
static class GroupManagementService.MemberType
          Members joining the group should be one of the following types.
static class GroupManagementService.RECOVERY_STATE
          These are possible recovery states used by GMS's recovery selection and failure fencing functions
 
Method Summary
 void addActionFactory(FailureNotificationActionFactory failureNotificationActionFactory)
          Registers a FailureNotificationActionFactory instance.
 void addActionFactory(FailureSuspectedActionFactory failureSuspectedActionFactory)
          Registers a FailureSuspectedActionFactory Instance.
 void addActionFactory(GroupLeadershipNotificationActionFactory groupLeadershipNotificationActionFactory)
          Registers a GroupLeadershipNotificationActionFactory instance.
 void addActionFactory(JoinedAndReadyNotificationActionFactory joinedAndReadyNotificationActionFactory)
          Registers a JoinedAndReadyNotificationActionFactory instance.
 void addActionFactory(JoinNotificationActionFactory joinNotificationActionFactory)
          Registers a JoinNotificationActionFactory instance.
 void addActionFactory(MessageActionFactory messageActionFactory, String componentName)
          Registers a MessageActionFactory instance for the specified component name.
 void addActionFactory(PlannedShutdownActionFactory plannedShutdownActionFactory)
          Registers a PlannedShutdownActionFactory instance.
 void addActionFactory(String componentName, FailureRecoveryActionFactory failureRecoveryActionFactory)
          Registers a FailureRecoveryActionFactory instance.
 void announceGroupShutdown(String groupName, GMSConstants.shutdownState shutdownState)
          This method can be used by parent application to notify all group members that the parent application is "initiating" or has "completed" shutdown of this group.
 void announceGroupStartup(String groupName, GMSConstants.groupStartupState startupState, List<String> memberTokens)
          This method can be used by a controlling parent application that has a static preconfiguration of all members of the group to announce that the parent application is "initiating" and then that it has "completed" startup of all preconfigured members of this group.
 void announceWatchdogObservedFailure(String serverToken)
          GMS WATCHDOG member reports serverToken has been observed to have failed to this GMS group.
 Map<Serializable,Serializable> getAllMemberDetails(Serializable key)
          returns the member details pertaining to the given key.
 GroupHandle getGroupHandle()
          Returns an implementation of GroupHandle
 String getGroupName()
          Returns the group name for this context
 String getInstanceName()
          Returns the Instance name for this context
 Map<Serializable,Serializable> getMemberDetails(String memberToken)
          returns the details pertaining to the given member.
 GroupManagementService.MemberType getMemberType()
          Returns the MemberType for this context
 boolean isGroupBeingShutdown(String groupName)
          This API allows applications to query GMS to see if the group is shutting down.
 void join()
          Invokes the underlying group communication library's group creation and joining operations.
 void removeActionFactory(FailureNotificationActionFactory failureNotificationActionFactory)
          Removes a FailureNotificationActionFactory instance
 void removeActionFactory(GroupLeadershipNotificationActionFactory groupLeadershipNotificationActionFactory)
          Removes a GroupLeadershipNotificationActionFactory instance
 void removeActionFactory(JoinedAndReadyNotificationActionFactory joinedAndReadyNotificationActionFactory)
          Removes a JoinedAndReadyNotificationActionFactory instance
 void removeActionFactory(JoinNotificationActionFactory joinNotificationActionFactory)
          Removes a JoinNotificationActionFactory instance
 void removeActionFactory(PlannedShutdownActionFactory plannedShutdownActionFactory)
          Removes a PlannedShutdownActionFactory instance
 void removeFailureRecoveryActionFactory(String componentName)
          Removes a FailureRecoveryActionFactory instance
 void removeFailureSuspectedActionFactory(FailureSuspectedActionFactory failureSuspectedActionFactory)
          Removes a FailureSuspectedActionFactory instance
 void removeMessageActionFactory(String componentName)
          Removes a MessageActionFactory instance belonging to the specified component
 void reportJoinedAndReadyState(String groupName)
          This API is provided for the parent application to report to the group its joined and ready state to begin processing its operations.
 void shutdown(GMSConstants.shutdownType shutdownType)
          Sends a shutdown command to the GMS indicating that the parent thread is about to be shutdown as part of a planned shutdown operation for the given shutdown type.
 void updateMemberDetails(String memberToken, Serializable key, Serializable value)
          Enables the client to update the Member Details shared datastructure The implementation of this api updates an existing datastructure that is keyed to MEMBER_DETAILS in the DistributedStateCache which stores other shared information.
 

Method Detail

addActionFactory

void addActionFactory(FailureNotificationActionFactory failureNotificationActionFactory)
Registers a FailureNotificationActionFactory instance.

Parameters:
failureNotificationActionFactory - Implementation of this interface produces a FailureNotificationAction instance which consumes the failure notification Signal

addActionFactory

void addActionFactory(String componentName,
                      FailureRecoveryActionFactory failureRecoveryActionFactory)
Registers a FailureRecoveryActionFactory instance.

Parameters:
componentName - The name of the parent application's component that should be notified of being selected for performing recovery operations. One or more components in the parent application may want to be notified of such selection for their respective recovery operations
failureRecoveryActionFactory - Implementation of this interface produces a FailureRecoveryAction instance which consumes the failure recovery selection notification Signal

addActionFactory

void addActionFactory(JoinNotificationActionFactory joinNotificationActionFactory)
Registers a JoinNotificationActionFactory instance.

Parameters:
joinNotificationActionFactory - Implementation of this interface produces a JoinNotificationAction instance which consumes the member join notification signal.

addActionFactory

void addActionFactory(JoinedAndReadyNotificationActionFactory joinedAndReadyNotificationActionFactory)
Registers a JoinedAndReadyNotificationActionFactory instance.

Parameters:
joinedAndReadyNotificationActionFactory - Implementation of this interface produces a JoinedAndReadyNotificationAction instance which consumes the member joined and ready notification signal.

addActionFactory

void addActionFactory(PlannedShutdownActionFactory plannedShutdownActionFactory)
Registers a PlannedShutdownActionFactory instance.

Parameters:
plannedShutdownActionFactory - Implementation of this interface produces a PlannedShutdownAction instance which consumes the planned shutdown notification Signal

addActionFactory

void addActionFactory(MessageActionFactory messageActionFactory,
                      String componentName)
Registers a MessageActionFactory instance for the specified component name.

Parameters:
messageActionFactory - Implementation of this interface produces a MessageAction instance that consumes a MessageSignal.
componentName - Name of the component that would like to consume Messages. One or more components in the parent application would want to be notified when messages arrive addressed to them. This registration allows GMS to deliver messages to specific components.

addActionFactory

void addActionFactory(FailureSuspectedActionFactory failureSuspectedActionFactory)
Registers a FailureSuspectedActionFactory Instance.

Parameters:
failureSuspectedActionFactory - Implementation of this interface produces a Failure Suspected Action instance that would consume the FailureSuspectedSignal

addActionFactory

void addActionFactory(GroupLeadershipNotificationActionFactory groupLeadershipNotificationActionFactory)
Registers a GroupLeadershipNotificationActionFactory instance.

Parameters:
groupLeadershipNotificationActionFactory - Implementation of this interface produces a GroupLeadershipNotificationAction instance which consumes the GroupLeadershipNotificationSignal

removeActionFactory

void removeActionFactory(FailureNotificationActionFactory failureNotificationActionFactory)
Removes a FailureNotificationActionFactory instance

Parameters:
failureNotificationActionFactory - the factory to remove

removeFailureRecoveryActionFactory

void removeFailureRecoveryActionFactory(String componentName)
Removes a FailureRecoveryActionFactory instance

Parameters:
componentName - the component name to remove

removeFailureSuspectedActionFactory

void removeFailureSuspectedActionFactory(FailureSuspectedActionFactory failureSuspectedActionFactory)
Removes a FailureSuspectedActionFactory instance

Parameters:
failureSuspectedActionFactory - the factory to remove

removeActionFactory

void removeActionFactory(JoinNotificationActionFactory joinNotificationActionFactory)
Removes a JoinNotificationActionFactory instance

Parameters:
joinNotificationActionFactory - the factory to remove

removeActionFactory

void removeActionFactory(JoinedAndReadyNotificationActionFactory joinedAndReadyNotificationActionFactory)
Removes a JoinedAndReadyNotificationActionFactory instance

Parameters:
joinedAndReadyNotificationActionFactory - the factory to remove

removeActionFactory

void removeActionFactory(PlannedShutdownActionFactory plannedShutdownActionFactory)
Removes a PlannedShutdownActionFactory instance

Parameters:
plannedShutdownActionFactory - the factory to remove

removeMessageActionFactory

void removeMessageActionFactory(String componentName)
Removes a MessageActionFactory instance belonging to the specified component

Parameters:
componentName - the component name

removeActionFactory

void removeActionFactory(GroupLeadershipNotificationActionFactory groupLeadershipNotificationActionFactory)
Removes a GroupLeadershipNotificationActionFactory instance

Parameters:
groupLeadershipNotificationActionFactory -

getGroupHandle

GroupHandle getGroupHandle()
Returns an implementation of GroupHandle

Returns:
com.sun.enterprise.ee.cms.core.GroupHandle

join

void join()
          throws GMSException
Invokes the underlying group communication library's group creation and joining operations.

Throws:
GMSException - wraps any underlying exception that causes join to not occur

shutdown

void shutdown(GMSConstants.shutdownType shutdownType)
Sends a shutdown command to the GMS indicating that the parent thread is about to be shutdown as part of a planned shutdown operation for the given shutdown type. The given shutdown type is specified by GMSConstants

Parameters:
shutdownType - the shutdown type

updateMemberDetails

void updateMemberDetails(String memberToken,
                         Serializable key,
                         Serializable value)
                         throws GMSException
Enables the client to update the Member Details shared datastructure The implementation of this api updates an existing datastructure that is keyed to MEMBER_DETAILS in the DistributedStateCache which stores other shared information. The dedicated Member Details datastructure allows for caching configuration type information about a member in the shared cache so that on occurence of join, failure or shutdown details related to the particular member would be readily available. There is nothing preventing other state information from being stored here but this is intended as a lightweight mechanism in terms of messaging overhead.

Parameters:
memberToken - - identifier token of this member
key - - Serializable object that uniquely identifies this cachable state
value - - Serializable object that is to be stored in the shared cache
Throws:
GMSException - if a group membership service error occurs

getMemberDetails

Map<Serializable,Serializable> getMemberDetails(String memberToken)
returns the details pertaining to the given member. returns a Map containing key-value pairs constituting data pertaining to the member's details

Parameters:
memberToken - the member
Returns:
Map

getAllMemberDetails

Map<Serializable,Serializable> getAllMemberDetails(Serializable key)
returns the member details pertaining to the given key. This is particularly useful when the details pertain to all members and not just one member and such details are keyed by a common key. Through this route, details of all members could be obtained. returns a Map containing key-value pairs constituting data pertaining to the member's details for the given key.

Parameters:
key - the map key
Returns:
Map

announceGroupStartup

void announceGroupStartup(String groupName,
                          GMSConstants.groupStartupState startupState,
                          List<String> memberTokens)
This method can be used by a controlling parent application that has a static preconfiguration of all members of the group to announce that the parent application is "initiating" and then that it has "completed" startup of all preconfigured members of this group.

Group members in parameter members is interpreted differently based on startupState. All preconfigured members of group are passed in members when GMSConstants.groupStartupState.INITIATED or GMSConstants.groupStartupState.COMPLETED_SUCCESS. When startupState is GMSConstants.groupStartupState.COMPLETED_FAILED, members is a list of the members that failed to start.

Parameters:
groupName - the group name
startupState - demarcate initiation of groupStartup and completion of group startup
memberTokens - list of memberTokens.

announceGroupShutdown

void announceGroupShutdown(String groupName,
                           GMSConstants.shutdownState shutdownState)
This method can be used by parent application to notify all group members that the parent application is "initiating" or has "completed" shutdown of this group.

Parameters:
groupName - the group name
shutdownState - from GMSConstants.shutdownState - one of Initiated or Completed

reportJoinedAndReadyState

void reportJoinedAndReadyState(String groupName)

This API is provided for the parent application to report to the group its joined and ready state to begin processing its operations. The group member that this parent application represents is now ready to process its operations at the time of this announcement to the group. GMS clients in all other group members that are interested in knowing when another member is ready to start processing operations, can subscribe to the event JoinedAndReadyEvent and be given this JoinedAndReadyNotificationSignal. Currently this API can only be used by cluster members which are of the type CORE and not the SPECTATOR members. Shoal makes the assumption that only the CORE members will act as servers for serving the client requests and not the SPECTATOR members.

The behavioral semantics of this feature is that as each member reports its joined and ready state, the corresponding JoinedAndReadyNotificationSignal will be delivered to other cluster members who have already joined the group and have components who have registered for this event to be delivered. There may be members who may not have joined the group at the time a particular member reported its JoinedAndReady state. For these cases, those members have to rely on the JoinNotificationSignal of this particular member and call the getMemberState() api. The implementation currently does not require the joined and ready notification to be sent out to members joining the group after a member reported its joined and ready state.

Parameters:
groupName - name of the group

isGroupBeingShutdown

boolean isGroupBeingShutdown(String groupName)

This API allows applications to query GMS to see if the group is shutting down. This helps with any pre-shutdown processing that may be required to be done on the application's side.

Parameters:
groupName - The group name
Returns:
boolean true if it is being shutdown

announceWatchdogObservedFailure

void announceWatchdogObservedFailure(String serverToken)
                                     throws GMSException
GMS WATCHDOG member reports serverToken has been observed to have failed to this GMS group.

This is merely a hint and the GMS system validates that the GMS member has truely failed using the same verification algorithm used when GMS heartbeat reports a member is INDOUBT and SUSPECTED of failure.

Allows for enhanced GMS failure detection by external control entities (one example is NodeAgent of Glassfish Application Server.) Only a GMS MemberType of WATCHDOG is allowed to broadcast to all members of a group that this serverToken has likely failed.

Parameters:
serverToken - failed member
Throws:
GMSException - if called by a member that is not a WATCHDOG member or if serverToken is not currently running in group.

getGroupName

String getGroupName()
Returns the group name for this context

Returns:
the group name for this context

getMemberType

GroupManagementService.MemberType getMemberType()
Returns the MemberType for this context

Returns:
the MemberType for this context

getInstanceName

String getInstanceName()
Returns the Instance name for this context

Returns:
the Instance name for this context


Copyright © 2003 Copyright 2004 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.