org.neo4j.kernel.ha.cluster
Class HighAvailabilityModeSwitcher

java.lang.Object
  extended by org.neo4j.kernel.ha.cluster.HighAvailabilityModeSwitcher
All Implemented Interfaces:
org.neo4j.cluster.BindingListener, HighAvailabilityMemberListener, org.neo4j.kernel.lifecycle.Lifecycle

public class HighAvailabilityModeSwitcher
extends Object
implements HighAvailabilityMemberListener, org.neo4j.cluster.BindingListener, org.neo4j.kernel.lifecycle.Lifecycle

Performs the internal switches from pending to slave/master, by listening for ClusterMemberChangeEvents. When finished it will invoke .ClusterMemberAvailability#memberIsAvailable(String, URI) to announce to the cluster it's new status.


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.neo4j.kernel.ha.cluster.HighAvailabilityMemberListener
HighAvailabilityMemberListener.Adapter
 
Field Summary
static String INADDR_ANY
           
static String MASTER
           
static String SLAVE
           
 
Constructor Summary
HighAvailabilityModeSwitcher(SwitchToSlave switchToSlave, SwitchToMaster switchToMaster, org.neo4j.cluster.protocol.election.Election election, org.neo4j.cluster.member.ClusterMemberAvailability clusterMemberAvailability, org.neo4j.kernel.impl.util.StringLogger msgLog)
           
 
Method Summary
static org.neo4j.cluster.InstanceId getServerId(URI haUri)
           
 void init()
           
 void instanceStops(HighAvailabilityMemberChangeEvent event)
           
 void listeningAt(URI myUri)
           
 void masterIsAvailable(HighAvailabilityMemberChangeEvent event)
           
 void masterIsElected(HighAvailabilityMemberChangeEvent event)
           
 void shutdown()
           
 void slaveIsAvailable(HighAvailabilityMemberChangeEvent event)
           
 void start()
           
 void stop()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MASTER

public static final String MASTER
See Also:
Constant Field Values

SLAVE

public static final String SLAVE
See Also:
Constant Field Values

INADDR_ANY

public static final String INADDR_ANY
See Also:
Constant Field Values
Constructor Detail

HighAvailabilityModeSwitcher

public HighAvailabilityModeSwitcher(SwitchToSlave switchToSlave,
                                    SwitchToMaster switchToMaster,
                                    org.neo4j.cluster.protocol.election.Election election,
                                    org.neo4j.cluster.member.ClusterMemberAvailability clusterMemberAvailability,
                                    org.neo4j.kernel.impl.util.StringLogger msgLog)
Method Detail

getServerId

public static org.neo4j.cluster.InstanceId getServerId(URI haUri)

listeningAt

public void listeningAt(URI myUri)
Specified by:
listeningAt in interface org.neo4j.cluster.BindingListener

init

public void init()
          throws Throwable
Specified by:
init in interface org.neo4j.kernel.lifecycle.Lifecycle
Throws:
Throwable

start

public void start()
           throws Throwable
Specified by:
start in interface org.neo4j.kernel.lifecycle.Lifecycle
Throws:
Throwable

stop

public void stop()
          throws Throwable
Specified by:
stop in interface org.neo4j.kernel.lifecycle.Lifecycle
Throws:
Throwable

shutdown

public void shutdown()
              throws Throwable
Specified by:
shutdown in interface org.neo4j.kernel.lifecycle.Lifecycle
Throws:
Throwable

masterIsElected

public void masterIsElected(HighAvailabilityMemberChangeEvent event)
Specified by:
masterIsElected in interface HighAvailabilityMemberListener

masterIsAvailable

public void masterIsAvailable(HighAvailabilityMemberChangeEvent event)
Specified by:
masterIsAvailable in interface HighAvailabilityMemberListener

slaveIsAvailable

public void slaveIsAvailable(HighAvailabilityMemberChangeEvent event)
Specified by:
slaveIsAvailable in interface HighAvailabilityMemberListener

instanceStops

public void instanceStops(HighAvailabilityMemberChangeEvent event)
Specified by:
instanceStops in interface HighAvailabilityMemberListener


Copyright © 2002-2014 The Neo4j Graph Database Project. All Rights Reserved.