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.10 $
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(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.
 Map<Serializable,Serializable> getAllMemberDetails(Serializable key)
          returns the member details pertaining to the given key.
 GroupHandle getGroupHandle()
          Returns an implementation of GroupHandle
 Map<Serializable,Serializable> getMemberDetails(String memberToken)
          returns the details pertaining to the given member.
 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(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

removeActionFactory

void removeActionFactory(FailureNotificationActionFactory failureNotificationActionFactory)
Removes a FailureNotificationActionFactory instance

Parameters:
failureNotificationActionFactory -

removeFailureRecoveryActionFactory

void removeFailureRecoveryActionFactory(String componentName)
Removes a FailureRecoveryActionFactory instance

Parameters:
componentName -

removeFailureSuspectedActionFactory

void removeFailureSuspectedActionFactory(FailureSuspectedActionFactory failureSuspectedActionFactory)
Removes a FailureSuspectedActionFactory instance

Parameters:
failureSuspectedActionFactory -

removeActionFactory

void removeActionFactory(JoinNotificationActionFactory joinNotificationActionFactory)
Removes a JoinNotificationActionFactory instance

Parameters:
joinNotificationActionFactory -

removeActionFactory

void removeActionFactory(JoinedAndReadyNotificationActionFactory joinedAndReadyNotificationActionFactory)
Removes a JoinedAndReadyNotificationActionFactory instance

Parameters:
joinedAndReadyNotificationActionFactory -

removeActionFactory

void removeActionFactory(PlannedShutdownActionFactory plannedShutdownActionFactory)
Removes a PlannedShutdownActionFactory instance

Parameters:
plannedShutdownActionFactory -

removeMessageActionFactory

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

Parameters:
componentName -

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


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

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 -
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 -
Returns:
Map

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 -
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 -
Returns:
boolean


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