Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.sun.enterprise.ee.cms.impl.common
Class GroupManagementServiceImpl

    java.lang.Object
      com.sun.enterprise.ee.cms.impl.common.GroupManagementServiceImpl

All Implemented Interfaces:
  GroupManagementService, Runnable

    public class GroupManagementServiceImpl

extends Object
implements GroupManagementService, Runnable

Nested Class Summary

Nested classes/interfaces inherited from interface com.sun.enterprise.ee.cms.core.GroupManagementService
`GroupManagementService.MemberType, GroupManagementService.RECOVERY_STATE`

Constructor Summary
`GroupManagementServiceImpl(String serverToken, String groupName, GroupManagementService.MemberType membertype, Properties properties)` Creates a GMSContext instance with the given paramters.

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 PlannedShuttdownActionFactory instance.
`void` | `addActionFactory(String componentName, FailureRecoveryActionFactory failureRecoveryActionFactory)` Registers a FailureRecoveryActionFactory instance.
`void` | `announceGroupShutdown(String groupName, GMSConstants.shutdownState shutdownState)` This method is used to announce that the group is about to be shutdown.
`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 To remove a MessageActionFactory for a specific component, use the method: removeActionFactory(String componentName);
`void` | `removeActionFactory(GroupLeadershipNotificationActionFactory groupLeadershipNotificationActionFactory)` Removes a GroupLeadershipNotificationActionFactory instance
`void` | `removeActionFactory(JoinedAndReadyNotificationActionFactory joinedAndReadyNotificationActionFactory)` Removes a JoinedAndReadyNotificationActionFactory instance To remove a MessageActionFactory for a specific component, use the method: removeActionFactory(String componentName);
`void` | `removeActionFactory(JoinNotificationActionFactory joinNotificationActionFactory)` Removes a JoinNotificationActionFactory instance To remove a MessageActionFactory for a specific component, use the method: removeActionFactory(String componentName);
`void` | `removeActionFactory(PlannedShutdownActionFactory plannedShutdownActionFactory)` Removes a PlannedShutdownActionFactory instance To remove a MessageActionFactory for a specific component, use the method: removeActionFactory(String componentName);
`void` | `removeFailureRecoveryActionFactory(String componentName)` Removes a FailureRecoveryActionFactory instance To remove a MessageActionFactory for a specific component, use the method: removeActionFactory(String componentName);
`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` | `run()`
`void` | `setMemberDetails(String serverToken, Map<? extends Object,? extends Object> keyValuePairs)` for this serverToken, use the map to derive key value pairs that constitute data pertaining to this member's details
`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
`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.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### GroupManagementServiceImpl

    public GroupManagementServiceImpl(String serverToken,
                                      String groupName,
                                      GroupManagementService.MemberType membertype,
                                      Properties properties)

  Creates a GMSContext instance with the given paramters. GMSContext calls the underlying Group Communication Provider to initialize it with these parameters.

  Parameters:
    `serverToken` - identity token of this member process
    `groupName` - name of the group
    `membertype` - Type of member as specified in GroupManagementService.MemberType
    `properties` - Configuration Properties

Method Detail

### run

    public void run()

  Specified by:
    `run` in interface `Runnable`

### addActionFactory

    public void addActionFactory(FailureNotificationActionFactory failureNotificationActionFactory)

  Registers a FailureNotificationActionFactory instance. To add MessageActionFactory instance, use the method addActionFactory(MessageActionFactory maf, String componentName);

  Specified by:
    `addActionFactory` in interface `GroupManagementService`
  Parameters:
    `failureNotificationActionFactory` - implementation of this interface

### addActionFactory

    public void addActionFactory(String componentName,
                                 FailureRecoveryActionFactory failureRecoveryActionFactory)

  Registers a FailureRecoveryActionFactory instance. To add MessageActionFactory instance, use the method addActionFactory(MessageActionFactory maf, String componentName);

  Specified by:
    `addActionFactory` in interface `GroupManagementService`
  Parameters:
    `componentName` - name of component
    `failureRecoveryActionFactory` - implmentation of this interface

### addActionFactory

    public void addActionFactory(JoinedAndReadyNotificationActionFactory joinedAndReadyNotificationActionFactory)

  Registers a JoinedAndReadyNotificationActionFactory instance.

  Specified by:
    `addActionFactory` in interface `GroupManagementService`
  Parameters:
    `joinedAndReadyNotificationActionFactory` - Implementation of this interface produces a JoinedAndReadyNotificationAction instance which consumes the member joined and ready notification signal.

### addActionFactory

    public void addActionFactory(JoinNotificationActionFactory joinNotificationActionFactory)

  Registers a JoinNotificationActionFactory instance.

  Specified by:
    `addActionFactory` in interface `GroupManagementService`
  Parameters:
    `joinNotificationActionFactory` - implementation of this interface

### addActionFactory

    public void addActionFactory(PlannedShutdownActionFactory plannedShutdownActionFactory)

  Registers a PlannedShuttdownActionFactory instance. To add MessageActionFactory instance, use the method addActionFactory(MessageActionFactory maf, String componentName);

  Specified by:
    `addActionFactory` in interface `GroupManagementService`
  Parameters:
    `plannedShutdownActionFactory` - implementation of this interface

### addActionFactory

    public void addActionFactory(MessageActionFactory messageActionFactory,
                                 String componentName)

  Registers a MessageActionFactory instance for the specified component name.

  Specified by:
    `addActionFactory` in interface `GroupManagementService`
  Parameters:
    `messageActionFactory` - implementation of this interface
    `componentName` - name of component to identify target component for message delivery

### addActionFactory

    public void addActionFactory(FailureSuspectedActionFactory failureSuspectedActionFactory)

  Description copied from interface: `GroupManagementService`
  Registers a FailureSuspectedActionFactory Instance.

  Specified by:
    `addActionFactory` in interface `GroupManagementService`
  Parameters:
    `failureSuspectedActionFactory` - Implementation of this interface produces a Failure Suspected Action instance that would consume the FailureSuspectedSignal

### addActionFactory

    public void addActionFactory(GroupLeadershipNotificationActionFactory groupLeadershipNotificationActionFactory)

  Description copied from interface: `GroupManagementService`
  Registers a GroupLeadershipNotificationActionFactory instance.

  Specified by:
    `addActionFactory` in interface `GroupManagementService`
  Parameters:
    `groupLeadershipNotificationActionFactory` - Implementation of this interface produces a GroupLeadershipNotificationAction instance which consumes the GroupLeadershipNotificationSignal

### removeActionFactory

    public void removeActionFactory(FailureNotificationActionFactory failureNotificationActionFactory)

  Removes a FailureNotificationActionFactory instance To remove a MessageActionFactory for a specific component, use the method: removeActionFactory(String componentName);

  Specified by:
    `removeActionFactory` in interface `GroupManagementService`
  Parameters:
    `failureNotificationActionFactory` - implementation of this interface

### removeFailureRecoveryActionFactory

    public void removeFailureRecoveryActionFactory(String componentName)

  Removes a FailureRecoveryActionFactory instance To remove a MessageActionFactory for a specific component, use the method: removeActionFactory(String componentName);

  Specified by:
    `removeFailureRecoveryActionFactory` in interface `GroupManagementService`
  Parameters:
    `componentName` - name of component

### removeFailureSuspectedActionFactory

    public void removeFailureSuspectedActionFactory(FailureSuspectedActionFactory failureSuspectedActionFactory)

  Description copied from interface: `GroupManagementService`
  Removes a FailureSuspectedActionFactory instance

  Specified by:
    `removeFailureSuspectedActionFactory` in interface `GroupManagementService`
  Parameters:
    `failureSuspectedActionFactory` - the factory to remove

### removeActionFactory

    public void removeActionFactory(JoinNotificationActionFactory joinNotificationActionFactory)

  Removes a JoinNotificationActionFactory instance To remove a MessageActionFactory for a specific component, use the method: removeActionFactory(String componentName);

  Specified by:
    `removeActionFactory` in interface `GroupManagementService`
  Parameters:
    `joinNotificationActionFactory` - implementation of this interface

### removeActionFactory

    public void removeActionFactory(JoinedAndReadyNotificationActionFactory joinedAndReadyNotificationActionFactory)

  Removes a JoinedAndReadyNotificationActionFactory instance To remove a MessageActionFactory for a specific component, use the method: removeActionFactory(String componentName);

  Specified by:
    `removeActionFactory` in interface `GroupManagementService`
  Parameters:
    `joinedAndReadyNotificationActionFactory` - implementation of this interface

### removeActionFactory

    public void removeActionFactory(PlannedShutdownActionFactory plannedShutdownActionFactory)

  Removes a PlannedShutdownActionFactory instance To remove a MessageActionFactory for a specific component, use the method: removeActionFactory(String componentName);

  Specified by:
    `removeActionFactory` in interface `GroupManagementService`
  Parameters:
    `plannedShutdownActionFactory` - implementation of this interface

### removeMessageActionFactory

    public void removeMessageActionFactory(String componentName)

  Removes a MessageActionFactory instance belonging to the specified component

  Specified by:
    `removeMessageActionFactory` in interface `GroupManagementService`
  Parameters:
    `componentName` - name of component

### removeActionFactory

    public void removeActionFactory(GroupLeadershipNotificationActionFactory groupLeadershipNotificationActionFactory)

  Description copied from interface: `GroupManagementService`
  Removes a GroupLeadershipNotificationActionFactory instance

  Specified by:
    `removeActionFactory` in interface `GroupManagementService`

### getGroupHandle

    public GroupHandle getGroupHandle()

  Returns an implementation of GroupHandle

  Specified by:
    `getGroupHandle` in interface `GroupManagementService`
  Returns:
    com.sun.enterprise.ee.cms.GroupHandle

### shutdown

    public 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

  Specified by:
    `shutdown` in interface `GroupManagementService`
  Parameters:
    `shutdownType` - the shutdown type

### updateMemberDetails

    public void updateMemberDetails(String memberToken,
                                    Serializable key,
                                    Serializable value)
                             throws GMSException

  Description copied from interface: `GroupManagementService`
  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.

  Specified by:
    `updateMemberDetails` in interface `GroupManagementService`
  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

    public Map<Serializable,Serializable> getMemberDetails(String memberToken)

  returns the details pertaining to the given member. At times, details pertaining to all members may be stored in the Cache but keyed by the given member token. 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

  Specified by:
    `getMemberDetails` in interface `GroupManagementService`
  Parameters:
    `memberToken` - identity token of the member process
  Returns:
    Map

### getAllMemberDetails

    public Map<Serializable,Serializable> getAllMemberDetails(Serializable key)

  Description copied from interface: `GroupManagementService`
  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.

  Specified by:
    `getAllMemberDetails` in interface `GroupManagementService`
  Parameters:
    `key` - the map key
  Returns:
    Map

### getGroupName

    public String getGroupName()

  Description copied from interface: `GroupManagementService`
  Returns the group name for this context

  Specified by:
    `getGroupName` in interface `GroupManagementService`
  Returns:
    the group name for this context

### getMemberType

    public GroupManagementService.MemberType getMemberType()

  Description copied from interface: `GroupManagementService`
  Returns the MemberType for this context

  Specified by:
    `getMemberType` in interface `GroupManagementService`
  Returns:
    the MemberType for this context

### getInstanceName

    public String getInstanceName()

  Description copied from interface: `GroupManagementService`
  Returns the Instance name for this context

  Specified by:
    `getInstanceName` in interface `GroupManagementService`
  Returns:
    the Instance name for this context

### setMemberDetails

    public void setMemberDetails(String serverToken,
                                 Map<? extends Object,? extends Object> keyValuePairs)
                          throws GMSException

  for this serverToken, use the map to derive key value pairs that constitute data pertaining to this member's details

  Parameters:
    `serverToken` - - member token id for this member.
    `keyValuePairs` - - a Map containing key-value pairs
  Throws:
    `GMSException` - wraps underlying exception that caused adding of member details to fail.

### join

    public void join()
              throws GMSException

  Description copied from interface: `GroupManagementService`
  Invokes the underlying group communication library's group creation and joining operations.

  Specified by:
    `join` in interface `GroupManagementService`
  Throws:
    `GMSException` - wraps any underlying exception that causes join to not occur

### announceGroupShutdown

    public void announceGroupShutdown(String groupName,
                                      GMSConstants.shutdownState shutdownState)

  This method is used to announce that the group is about to be shutdown.

  Specified by:
    `announceGroupShutdown` in interface `GroupManagementService`
  Parameters:
    `groupName` - name of group being shutdown.
    `shutdownState` - from GMSConstants.shutdownState - one of Initiated or Completed

### announceGroupStartup

    public void announceGroupStartup(String groupName,
                                     GMSConstants.groupStartupState startupState,
                                     List<String> memberTokens)

  Description copied from interface: `GroupManagementService`
  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.

  Specified by:
    `announceGroupStartup` in interface `GroupManagementService`
  Parameters:
    `groupName` - the group name
    `startupState` - demarcate initiation of groupStartup and completion of group startup
    `memberTokens` - list of memberTokens.

### reportJoinedAndReadyState

    public 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 notified of this JoinedAndReadyNotificationSignal.

  This api should be called only after group join operation has completed.

  Specified by:
    `reportJoinedAndReadyState` in interface `GroupManagementService`
  Parameters:
    `groupName` - name of the group

### isGroupBeingShutdown

    public 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.

  Also returns true when called after the gms context has left the group during a group shutdown.

  Specified by:
    `isGroupBeingShutdown` in interface `GroupManagementService`
  Parameters:
    `groupName` - the group name
  Returns:
    boolean

### announceWatchdogObservedFailure

    public void announceWatchdogObservedFailure(String serverToken)
                                         throws GMSException

  Description copied from interface: `GroupManagementService`
  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.

  Specified by:
    `announceWatchdogObservedFailure` in interface `GroupManagementService`
  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.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

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