org.glassfish.gms
Class GMSAdapterImpl

java.lang.Object
  extended by org.glassfish.gms.GMSAdapterImpl
All Implemented Interfaces:
com.sun.enterprise.ee.cms.core.CallBack, GMSAdapter, org.jvnet.hk2.component.PostConstruct

@Scoped(value=org.jvnet.hk2.component.PerLookup.class)
@Service
public class GMSAdapterImpl
extends java.lang.Object
implements GMSAdapter, org.jvnet.hk2.component.PostConstruct, com.sun.enterprise.ee.cms.core.CallBack

Author:
Sheetal.Vartak@Sun.COM

Constructor Summary
GMSAdapterImpl()
           
 
Method Summary
 void complete()
           
 java.lang.String getClusterName()
           
 com.sun.enterprise.ee.cms.core.GroupManagementService getGMS(java.lang.String groupName)
           
 HealthHistory getHealthHistory()
           
 Startup.Lifecycle getLifecycle()
           
 com.sun.enterprise.ee.cms.core.GroupManagementService getModule()
           
protected  java.util.Properties getProperties(java.io.File propFile)
           
 boolean initialize(java.lang.String clusterName)
           
 void postConstruct()
           
 void processNotification(com.sun.enterprise.ee.cms.core.Signal signal)
           
 void registerFailureNotificationListener(com.sun.enterprise.ee.cms.core.CallBack callback)
          Registers a FailureNotification Listener.
 void registerFailureRecoveryListener(java.lang.String componentName, com.sun.enterprise.ee.cms.core.CallBack callback)
          Registers a FailureRecovery Listener.
 void registerFailureSuspectedListener(com.sun.enterprise.ee.cms.core.CallBack callback)
          Registers a FailureSuspected Listener.
 void registerGroupLeadershipNotificationListener(com.sun.enterprise.ee.cms.core.CallBack callback)
          Registers a GroupLeadershipNotification Listener.
 void registerJoinedAndReadyNotificationListener(com.sun.enterprise.ee.cms.core.CallBack callback)
          Registers a JoinAndReadyNotification Listener.
 void registerJoinNotificationListener(com.sun.enterprise.ee.cms.core.CallBack callback)
          Registers a JoinNotification Listener.
 void registerMemberLeavingListener(com.sun.enterprise.ee.cms.core.CallBack callback)
          Register a listener for all events that represent a member has left the group.
 void registerMessageListener(java.lang.String componentName, com.sun.enterprise.ee.cms.core.CallBack messageListener)
          Registers a Message Listener.
 void registerPlannedShutdownListener(com.sun.enterprise.ee.cms.core.CallBack callback)
          Registers a PlannedShutdown Listener.
 void removeFailureNotificationListener(com.sun.enterprise.ee.cms.core.CallBack callback)
           
 void removeFailureRecoveryListener(java.lang.String componentName)
           
 void removeFailureSuspectedListener(com.sun.enterprise.ee.cms.core.CallBack callback)
           
 void removeGroupLeadershipLNotificationistener(com.sun.enterprise.ee.cms.core.CallBack callback)
           
 void removeJoinedAndReadyNotificationListener(com.sun.enterprise.ee.cms.core.CallBack callback)
           
 void removeJoinNotificationListener(com.sun.enterprise.ee.cms.core.CallBack callback)
           
 void removeMemberLeavingListener(com.sun.enterprise.ee.cms.core.CallBack callback)
           
 void removeMessageListener(java.lang.String componentName)
           
 void removePlannedShutdownListener(com.sun.enterprise.ee.cms.core.CallBack callback)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GMSAdapterImpl

public GMSAdapterImpl()
Method Detail

postConstruct

public void postConstruct()
Specified by:
postConstruct in interface org.jvnet.hk2.component.PostConstruct

getClusterName

public java.lang.String getClusterName()
Specified by:
getClusterName in interface GMSAdapter

initialize

public boolean initialize(java.lang.String clusterName)
Specified by:
initialize in interface GMSAdapter

complete

public void complete()
Specified by:
complete in interface GMSAdapter

getHealthHistory

public HealthHistory getHealthHistory()
Specified by:
getHealthHistory in interface GMSAdapter

getProperties

protected final java.util.Properties getProperties(java.io.File propFile)
                                            throws java.io.IOException
Throws:
java.io.IOException

getLifecycle

public Startup.Lifecycle getLifecycle()

getModule

public com.sun.enterprise.ee.cms.core.GroupManagementService getModule()
Specified by:
getModule in interface GMSAdapter

getGMS

public com.sun.enterprise.ee.cms.core.GroupManagementService getGMS(java.lang.String groupName)

processNotification

public void processNotification(com.sun.enterprise.ee.cms.core.Signal signal)
Specified by:
processNotification in interface com.sun.enterprise.ee.cms.core.CallBack

registerJoinNotificationListener

public void registerJoinNotificationListener(com.sun.enterprise.ee.cms.core.CallBack callback)
Registers a JoinNotification Listener.

Specified by:
registerJoinNotificationListener in interface GMSAdapter
Parameters:
callback - processes GMS notification JoinNotificationSignal

registerJoinedAndReadyNotificationListener

public void registerJoinedAndReadyNotificationListener(com.sun.enterprise.ee.cms.core.CallBack callback)
Registers a JoinAndReadyNotification Listener.

Specified by:
registerJoinedAndReadyNotificationListener in interface GMSAdapter
Parameters:
callback - processes GMS notification JoinAndReadyNotificationSignal

registerMemberLeavingListener

public void registerMemberLeavingListener(com.sun.enterprise.ee.cms.core.CallBack callback)
Register a listener for all events that represent a member has left the group.

Specified by:
registerMemberLeavingListener in interface GMSAdapter
Parameters:
callback - Signal can be either PlannedShutdownSignal, FailureNotificationSignal or JoinNotificationSignal(subevent Rejoin).

registerPlannedShutdownListener

public void registerPlannedShutdownListener(com.sun.enterprise.ee.cms.core.CallBack callback)
Registers a PlannedShutdown Listener.

Specified by:
registerPlannedShutdownListener in interface GMSAdapter
Parameters:
callback - processes GMS notification PlannedShutdownSignal

registerFailureSuspectedListener

public void registerFailureSuspectedListener(com.sun.enterprise.ee.cms.core.CallBack callback)
Registers a FailureSuspected Listener.

Specified by:
registerFailureSuspectedListener in interface GMSAdapter
Parameters:
callback - processes GMS notification FailureSuspectedSignal

registerFailureNotificationListener

public void registerFailureNotificationListener(com.sun.enterprise.ee.cms.core.CallBack callback)
Registers a FailureNotification Listener.

Specified by:
registerFailureNotificationListener in interface GMSAdapter
Parameters:
callback - processes GMS notification FailureNotificationSignal

registerFailureRecoveryListener

public void registerFailureRecoveryListener(java.lang.String componentName,
                                            com.sun.enterprise.ee.cms.core.CallBack callback)
Registers a FailureRecovery Listener.

Specified by:
registerFailureRecoveryListener in interface GMSAdapter
Parameters:
callback - processes GMS notification FailureRecoverySignal
componentName - The name of the parent application's component that should be notified of 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.

registerMessageListener

public void registerMessageListener(java.lang.String componentName,
                                    com.sun.enterprise.ee.cms.core.CallBack messageListener)
Registers a Message Listener.

Specified by:
registerMessageListener in interface GMSAdapter
Parameters:
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.
messageListener - processes GMS MessageSignal

registerGroupLeadershipNotificationListener

public void registerGroupLeadershipNotificationListener(com.sun.enterprise.ee.cms.core.CallBack callback)
Registers a GroupLeadershipNotification Listener.

Specified by:
registerGroupLeadershipNotificationListener in interface GMSAdapter
Parameters:
callback - processes GMS notification GroupLeadershipNotificationSignal. This event occurs when the GMS masters leaves the Group and another member of the group takes over leadership. The signal indicates the new leader.

removeFailureRecoveryListener

public void removeFailureRecoveryListener(java.lang.String componentName)
Specified by:
removeFailureRecoveryListener in interface GMSAdapter

removeMessageListener

public void removeMessageListener(java.lang.String componentName)
Specified by:
removeMessageListener in interface GMSAdapter

removeFailureNotificationListener

public void removeFailureNotificationListener(com.sun.enterprise.ee.cms.core.CallBack callback)
Specified by:
removeFailureNotificationListener in interface GMSAdapter

removeFailureSuspectedListener

public void removeFailureSuspectedListener(com.sun.enterprise.ee.cms.core.CallBack callback)
Specified by:
removeFailureSuspectedListener in interface GMSAdapter

removeJoinNotificationListener

public void removeJoinNotificationListener(com.sun.enterprise.ee.cms.core.CallBack callback)
Specified by:
removeJoinNotificationListener in interface GMSAdapter

removeJoinedAndReadyNotificationListener

public void removeJoinedAndReadyNotificationListener(com.sun.enterprise.ee.cms.core.CallBack callback)
Specified by:
removeJoinedAndReadyNotificationListener in interface GMSAdapter

removePlannedShutdownListener

public void removePlannedShutdownListener(com.sun.enterprise.ee.cms.core.CallBack callback)
Specified by:
removePlannedShutdownListener in interface GMSAdapter

removeGroupLeadershipLNotificationistener

public void removeGroupLeadershipLNotificationistener(com.sun.enterprise.ee.cms.core.CallBack callback)
Specified by:
removeGroupLeadershipLNotificationistener in interface GMSAdapter

removeMemberLeavingListener

public void removeMemberLeavingListener(com.sun.enterprise.ee.cms.core.CallBack callback)
Specified by:
removeMemberLeavingListener in interface GMSAdapter


Copyright © 2012 GlassFish Community. All Rights Reserved.