Class GroupManagementServiceImpl
- java.lang.Object
-
- com.sun.enterprise.ee.cms.impl.common.GroupManagementServiceImpl
-
- All Implemented Interfaces:
com.sun.enterprise.ee.cms.core.GroupManagementService,java.lang.Runnable
public class GroupManagementServiceImpl extends java.lang.Object implements com.sun.enterprise.ee.cms.core.GroupManagementService, java.lang.Runnable
-
-
Constructor Summary
Constructors Constructor Description GroupManagementServiceImpl()GroupManagementServiceImpl(java.lang.String serverToken, java.lang.String groupName, com.sun.enterprise.ee.cms.core.GroupManagementService.MemberType membertype, java.util.Properties properties)Creates a GMSContext instance with the given paramters.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidaddActionFactory(com.sun.enterprise.ee.cms.core.FailureNotificationActionFactory failureNotificationActionFactory)Registers a FailureNotificationActionFactory instance.voidaddActionFactory(com.sun.enterprise.ee.cms.core.FailureSuspectedActionFactory failureSuspectedActionFactory)voidaddActionFactory(com.sun.enterprise.ee.cms.core.GroupLeadershipNotificationActionFactory groupLeadershipNotificationActionFactory)voidaddActionFactory(com.sun.enterprise.ee.cms.core.JoinedAndReadyNotificationActionFactory joinedAndReadyNotificationActionFactory)Registers a JoinedAndReadyNotificationActionFactory instance.voidaddActionFactory(com.sun.enterprise.ee.cms.core.JoinNotificationActionFactory joinNotificationActionFactory)Registers a JoinNotificationActionFactory instance.voidaddActionFactory(com.sun.enterprise.ee.cms.core.MessageActionFactory messageActionFactory, java.lang.String componentName)Registers a MessageActionFactory instance for the specified component name.voidaddActionFactory(com.sun.enterprise.ee.cms.core.PlannedShutdownActionFactory plannedShutdownActionFactory)Registers a PlannedShuttdownActionFactory instance.voidaddActionFactory(java.lang.String componentName, com.sun.enterprise.ee.cms.core.FailureRecoveryActionFactory failureRecoveryActionFactory)Registers a FailureRecoveryActionFactory instance.voidannounceGroupShutdown(java.lang.String groupName, com.sun.enterprise.ee.cms.core.GMSConstants.shutdownState shutdownState)This method is used to announce that the group is about to be shutdown.voidannounceGroupStartup(java.lang.String groupName, com.sun.enterprise.ee.cms.core.GMSConstants.groupStartupState startupState, java.util.List<java.lang.String> memberTokens)voidannounceWatchdogObservedFailure(java.lang.String serverToken)java.util.Map<java.io.Serializable,java.io.Serializable>getAllMemberDetails(java.io.Serializable key)com.sun.enterprise.ee.cms.core.GroupHandlegetGroupHandle()Returns an implementation of GroupHandlejava.lang.StringgetGroupName()java.lang.StringgetInstanceName()java.util.Map<java.io.Serializable,java.io.Serializable>getMemberDetails(java.lang.String memberToken)returns the details pertaining to the given member.com.sun.enterprise.ee.cms.core.GroupManagementService.MemberTypegetMemberType()voidinitialize(java.lang.String serverToken, java.lang.String groupName, com.sun.enterprise.ee.cms.core.GroupManagementService.MemberType membertype, java.util.Properties properties)booleanisGroupBeingShutdown()booleanisGroupBeingShutdown(java.lang.String groupName)Deprecated.voidjoin()intoutstandingNotifications()voidremoveActionFactory(com.sun.enterprise.ee.cms.core.FailureNotificationActionFactory failureNotificationActionFactory)Removes a FailureNotificationActionFactory instance To remove a MessageActionFactory for a specific component, use the method: removeActionFactory(String componentName);voidremoveActionFactory(com.sun.enterprise.ee.cms.core.GroupLeadershipNotificationActionFactory groupLeadershipNotificationActionFactory)voidremoveActionFactory(com.sun.enterprise.ee.cms.core.JoinedAndReadyNotificationActionFactory joinedAndReadyNotificationActionFactory)Removes a JoinedAndReadyNotificationActionFactory instance To remove a MessageActionFactory for a specific component, use the method: removeActionFactory(String componentName);voidremoveActionFactory(com.sun.enterprise.ee.cms.core.JoinNotificationActionFactory joinNotificationActionFactory)Removes a JoinNotificationActionFactory instance To remove a MessageActionFactory for a specific component, use the method: removeActionFactory(String componentName);voidremoveActionFactory(com.sun.enterprise.ee.cms.core.PlannedShutdownActionFactory plannedShutdownActionFactory)Removes a PlannedShutdownActionFactory instance To remove a MessageActionFactory for a specific component, use the method: removeActionFactory(String componentName);voidremoveFailureRecoveryActionFactory(java.lang.String componentName)Removes a FailureRecoveryActionFactory instance To remove a MessageActionFactory for a specific component, use the method: removeActionFactory(String componentName);voidremoveFailureSuspectedActionFactory(com.sun.enterprise.ee.cms.core.FailureSuspectedActionFactory failureSuspectedActionFactory)voidremoveMessageActionFactory(java.lang.String componentName)Removes a MessageActionFactory instance belonging to the specified componentvoidreportJoinedAndReadyState()This API is provided for the parent application to report to the group its joined and ready state to begin processing its operations.voidreportJoinedAndReadyState(java.lang.String groupName)Deprecated.use reportJoinedAndReadyState()voidrun()voidsetMemberDetails(java.lang.String serverToken, java.util.Map<? extends java.lang.Object,? extends java.lang.Object> keyValuePairs)for this serverToken, use the map to derive key value pairs that constitute data pertaining to this member's detailsvoidshutdown(com.sun.enterprise.ee.cms.core.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 operationvoidupdateMemberDetails(java.lang.String memberToken, java.io.Serializable key, java.io.Serializable value)
-
-
-
Constructor Detail
-
GroupManagementServiceImpl
public GroupManagementServiceImpl(java.lang.String serverToken, java.lang.String groupName, com.sun.enterprise.ee.cms.core.GroupManagementService.MemberType membertype, java.util.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 processgroupName- name of the groupmembertype- Type of member as specified in GroupManagementService.MemberTypeproperties- Configuration Properties
-
GroupManagementServiceImpl
public GroupManagementServiceImpl()
-
-
Method Detail
-
initialize
public void initialize(java.lang.String serverToken, java.lang.String groupName, com.sun.enterprise.ee.cms.core.GroupManagementService.MemberType membertype, java.util.Properties properties)- Specified by:
initializein interfacecom.sun.enterprise.ee.cms.core.GroupManagementService
-
run
public void run()
- Specified by:
runin interfacejava.lang.Runnable
-
addActionFactory
public void addActionFactory(com.sun.enterprise.ee.cms.core.FailureNotificationActionFactory failureNotificationActionFactory)
Registers a FailureNotificationActionFactory instance. To add MessageActionFactory instance, use the method addActionFactory(MessageActionFactory maf, String componentName);- Specified by:
addActionFactoryin interfacecom.sun.enterprise.ee.cms.core.GroupManagementService- Parameters:
failureNotificationActionFactory- implementation of this interface
-
addActionFactory
public void addActionFactory(java.lang.String componentName, com.sun.enterprise.ee.cms.core.FailureRecoveryActionFactory failureRecoveryActionFactory)Registers a FailureRecoveryActionFactory instance. To add MessageActionFactory instance, use the method addActionFactory(MessageActionFactory maf, String componentName);- Specified by:
addActionFactoryin interfacecom.sun.enterprise.ee.cms.core.GroupManagementService- Parameters:
componentName- name of componentfailureRecoveryActionFactory- implmentation of this interface
-
addActionFactory
public void addActionFactory(com.sun.enterprise.ee.cms.core.JoinedAndReadyNotificationActionFactory joinedAndReadyNotificationActionFactory)
Registers a JoinedAndReadyNotificationActionFactory instance.- Specified by:
addActionFactoryin interfacecom.sun.enterprise.ee.cms.core.GroupManagementService- Parameters:
joinedAndReadyNotificationActionFactory- Implementation of this interface produces a JoinedAndReadyNotificationAction instance which consumes the member joined and ready notification signal.
-
addActionFactory
public void addActionFactory(com.sun.enterprise.ee.cms.core.JoinNotificationActionFactory joinNotificationActionFactory)
Registers a JoinNotificationActionFactory instance.- Specified by:
addActionFactoryin interfacecom.sun.enterprise.ee.cms.core.GroupManagementService- Parameters:
joinNotificationActionFactory- implementation of this interface
-
addActionFactory
public void addActionFactory(com.sun.enterprise.ee.cms.core.PlannedShutdownActionFactory plannedShutdownActionFactory)
Registers a PlannedShuttdownActionFactory instance. To add MessageActionFactory instance, use the method addActionFactory(MessageActionFactory maf, String componentName);- Specified by:
addActionFactoryin interfacecom.sun.enterprise.ee.cms.core.GroupManagementService- Parameters:
plannedShutdownActionFactory- implementation of this interface
-
addActionFactory
public void addActionFactory(com.sun.enterprise.ee.cms.core.MessageActionFactory messageActionFactory, java.lang.String componentName)Registers a MessageActionFactory instance for the specified component name.- Specified by:
addActionFactoryin interfacecom.sun.enterprise.ee.cms.core.GroupManagementService- Parameters:
messageActionFactory- implementation of this interfacecomponentName- name of component to identify target component for message delivery
-
addActionFactory
public void addActionFactory(com.sun.enterprise.ee.cms.core.FailureSuspectedActionFactory failureSuspectedActionFactory)
- Specified by:
addActionFactoryin interfacecom.sun.enterprise.ee.cms.core.GroupManagementService
-
addActionFactory
public void addActionFactory(com.sun.enterprise.ee.cms.core.GroupLeadershipNotificationActionFactory groupLeadershipNotificationActionFactory)
- Specified by:
addActionFactoryin interfacecom.sun.enterprise.ee.cms.core.GroupManagementService
-
removeActionFactory
public void removeActionFactory(com.sun.enterprise.ee.cms.core.FailureNotificationActionFactory failureNotificationActionFactory)
Removes a FailureNotificationActionFactory instance To remove a MessageActionFactory for a specific component, use the method: removeActionFactory(String componentName);- Specified by:
removeActionFactoryin interfacecom.sun.enterprise.ee.cms.core.GroupManagementService- Parameters:
failureNotificationActionFactory- implementation of this interface
-
removeFailureRecoveryActionFactory
public void removeFailureRecoveryActionFactory(java.lang.String componentName)
Removes a FailureRecoveryActionFactory instance To remove a MessageActionFactory for a specific component, use the method: removeActionFactory(String componentName);- Specified by:
removeFailureRecoveryActionFactoryin interfacecom.sun.enterprise.ee.cms.core.GroupManagementService- Parameters:
componentName- name of component
-
removeFailureSuspectedActionFactory
public void removeFailureSuspectedActionFactory(com.sun.enterprise.ee.cms.core.FailureSuspectedActionFactory failureSuspectedActionFactory)
- Specified by:
removeFailureSuspectedActionFactoryin interfacecom.sun.enterprise.ee.cms.core.GroupManagementService
-
removeActionFactory
public void removeActionFactory(com.sun.enterprise.ee.cms.core.JoinNotificationActionFactory joinNotificationActionFactory)
Removes a JoinNotificationActionFactory instance To remove a MessageActionFactory for a specific component, use the method: removeActionFactory(String componentName);- Specified by:
removeActionFactoryin interfacecom.sun.enterprise.ee.cms.core.GroupManagementService- Parameters:
joinNotificationActionFactory- implementation of this interface
-
removeActionFactory
public void removeActionFactory(com.sun.enterprise.ee.cms.core.JoinedAndReadyNotificationActionFactory joinedAndReadyNotificationActionFactory)
Removes a JoinedAndReadyNotificationActionFactory instance To remove a MessageActionFactory for a specific component, use the method: removeActionFactory(String componentName);- Specified by:
removeActionFactoryin interfacecom.sun.enterprise.ee.cms.core.GroupManagementService- Parameters:
joinedAndReadyNotificationActionFactory- implementation of this interface
-
removeActionFactory
public void removeActionFactory(com.sun.enterprise.ee.cms.core.PlannedShutdownActionFactory plannedShutdownActionFactory)
Removes a PlannedShutdownActionFactory instance To remove a MessageActionFactory for a specific component, use the method: removeActionFactory(String componentName);- Specified by:
removeActionFactoryin interfacecom.sun.enterprise.ee.cms.core.GroupManagementService- Parameters:
plannedShutdownActionFactory- implementation of this interface
-
removeMessageActionFactory
public void removeMessageActionFactory(java.lang.String componentName)
Removes a MessageActionFactory instance belonging to the specified component- Specified by:
removeMessageActionFactoryin interfacecom.sun.enterprise.ee.cms.core.GroupManagementService- Parameters:
componentName- name of component
-
removeActionFactory
public void removeActionFactory(com.sun.enterprise.ee.cms.core.GroupLeadershipNotificationActionFactory groupLeadershipNotificationActionFactory)
- Specified by:
removeActionFactoryin interfacecom.sun.enterprise.ee.cms.core.GroupManagementService
-
getGroupHandle
public com.sun.enterprise.ee.cms.core.GroupHandle getGroupHandle()
Returns an implementation of GroupHandle- Specified by:
getGroupHandlein interfacecom.sun.enterprise.ee.cms.core.GroupManagementService- Returns:
- com.sun.enterprise.ee.cms.GroupHandle
-
shutdown
public void shutdown(com.sun.enterprise.ee.cms.core.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:
shutdownin interfacecom.sun.enterprise.ee.cms.core.GroupManagementService
-
updateMemberDetails
public void updateMemberDetails(java.lang.String memberToken, java.io.Serializable key, java.io.Serializable value) throws com.sun.enterprise.ee.cms.core.GMSException- Specified by:
updateMemberDetailsin interfacecom.sun.enterprise.ee.cms.core.GroupManagementService- Throws:
com.sun.enterprise.ee.cms.core.GMSException
-
getMemberDetails
public java.util.Map<java.io.Serializable,java.io.Serializable> getMemberDetails(java.lang.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:
getMemberDetailsin interfacecom.sun.enterprise.ee.cms.core.GroupManagementService- Parameters:
memberToken- identity token of the member process- Returns:
- Map <Serializable, Serializable>
-
getAllMemberDetails
public java.util.Map<java.io.Serializable,java.io.Serializable> getAllMemberDetails(java.io.Serializable key)
- Specified by:
getAllMemberDetailsin interfacecom.sun.enterprise.ee.cms.core.GroupManagementService
-
getGroupName
public java.lang.String getGroupName()
- Specified by:
getGroupNamein interfacecom.sun.enterprise.ee.cms.core.GroupManagementService
-
getMemberType
public com.sun.enterprise.ee.cms.core.GroupManagementService.MemberType getMemberType()
- Specified by:
getMemberTypein interfacecom.sun.enterprise.ee.cms.core.GroupManagementService
-
getInstanceName
public java.lang.String getInstanceName()
- Specified by:
getInstanceNamein interfacecom.sun.enterprise.ee.cms.core.GroupManagementService
-
setMemberDetails
public void setMemberDetails(java.lang.String serverToken, java.util.Map<? extends java.lang.Object,? extends java.lang.Object> keyValuePairs) throws com.sun.enterprise.ee.cms.core.GMSExceptionfor 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:
com.sun.enterprise.ee.cms.core.GMSException- wraps underlying exception that caused adding of member details to fail.
-
join
public void join() throws com.sun.enterprise.ee.cms.core.GMSException- Specified by:
joinin interfacecom.sun.enterprise.ee.cms.core.GroupManagementService- Throws:
com.sun.enterprise.ee.cms.core.GMSException
-
announceGroupShutdown
public void announceGroupShutdown(java.lang.String groupName, com.sun.enterprise.ee.cms.core.GMSConstants.shutdownState shutdownState)This method is used to announce that the group is about to be shutdown.- Specified by:
announceGroupShutdownin interfacecom.sun.enterprise.ee.cms.core.GroupManagementService- Parameters:
groupName- name of group being shutdown.
-
announceGroupStartup
public void announceGroupStartup(java.lang.String groupName, com.sun.enterprise.ee.cms.core.GMSConstants.groupStartupState startupState, java.util.List<java.lang.String> memberTokens)- Specified by:
announceGroupStartupin interfacecom.sun.enterprise.ee.cms.core.GroupManagementService
-
reportJoinedAndReadyState
public void reportJoinedAndReadyState(java.lang.String groupName)
Deprecated.use reportJoinedAndReadyState()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:
reportJoinedAndReadyStatein interfacecom.sun.enterprise.ee.cms.core.GroupManagementService- Parameters:
groupName- name of the group
-
reportJoinedAndReadyState
public void reportJoinedAndReadyState()
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:
reportJoinedAndReadyStatein interfacecom.sun.enterprise.ee.cms.core.GroupManagementService
-
isGroupBeingShutdown
public boolean isGroupBeingShutdown(java.lang.String groupName)
Deprecated.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:
isGroupBeingShutdownin interfacecom.sun.enterprise.ee.cms.core.GroupManagementService- Parameters:
groupName- the group name- Returns:
- boolean
-
isGroupBeingShutdown
public boolean isGroupBeingShutdown()
- Specified by:
isGroupBeingShutdownin interfacecom.sun.enterprise.ee.cms.core.GroupManagementService
-
announceWatchdogObservedFailure
public void announceWatchdogObservedFailure(java.lang.String serverToken) throws com.sun.enterprise.ee.cms.core.GMSException- Specified by:
announceWatchdogObservedFailurein interfacecom.sun.enterprise.ee.cms.core.GroupManagementService- Throws:
com.sun.enterprise.ee.cms.core.GMSException
-
outstandingNotifications
public int outstandingNotifications()
-
-