org.neo4j.kernel.ha.cluster
Class HighAvailabilityModeSwitcher

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

public class HighAvailabilityModeSwitcher
extends Object
implements HighAvailabilityMemberListener, 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 MASTER
           
static String SLAVE
           
 
Constructor Summary
HighAvailabilityModeSwitcher(DelegateInvocationHandler delegateHandler, org.neo4j.cluster.member.ClusterMemberAvailability clusterMemberAvailability, HighAvailabilityMemberStateMachine stateHandler, org.neo4j.kernel.GraphDatabaseAPI graphDb, HaIdGeneratorFactory idGeneratorFactory, org.neo4j.kernel.configuration.Config config, org.neo4j.kernel.logging.Logging logging, org.neo4j.kernel.impl.api.UpdateableSchemaState updateableSchemaState)
           
 
Method Summary
static int getServerId(URI haUri)
           
 void init()
           
 void instanceStops(HighAvailabilityMemberChangeEvent event)
           
 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
Constructor Detail

HighAvailabilityModeSwitcher

public HighAvailabilityModeSwitcher(DelegateInvocationHandler delegateHandler,
                                    org.neo4j.cluster.member.ClusterMemberAvailability clusterMemberAvailability,
                                    HighAvailabilityMemberStateMachine stateHandler,
                                    org.neo4j.kernel.GraphDatabaseAPI graphDb,
                                    HaIdGeneratorFactory idGeneratorFactory,
                                    org.neo4j.kernel.configuration.Config config,
                                    org.neo4j.kernel.logging.Logging logging,
                                    org.neo4j.kernel.impl.api.UpdateableSchemaState updateableSchemaState)
Method Detail

getServerId

public static int getServerId(URI haUri)

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-2013 The Neo4j Graph Database Project. All Rights Reserved.