org.neo4j.kernel
Class AvailabilityGuard
java.lang.Object
org.neo4j.kernel.AvailabilityGuard
public class AvailabilityGuard
- extends Object
The availability guard is what ensures that the database will only take calls when it is in an ok state. It allows
query handling to easily determine if it is ok to call the database by calling isAvailable(long)
.
The implementation uses an atomic integer that is initialized to the nr of conditions that must be met for the
database to be available. Each such condition will then call grant/deny accordingly,
and if the integer becomes 0 access is granted.
DESCRIPTION
public static final Function<AvailabilityGuard.AvailabilityRequirement,String> DESCRIPTION
AvailabilityGuard
public AvailabilityGuard(Clock clock,
int conditionCount)
deny
public void deny(AvailabilityGuard.AvailabilityRequirement requirementNotMet)
grant
public void grant(AvailabilityGuard.AvailabilityRequirement requirementNowMet)
shutdown
public void shutdown()
isAvailable
public boolean isAvailable(long millis)
- Determines if the database is available for transactions to use.
- Parameters:
millis
- to wait if not yet available.
- Returns:
- true if it is available, otherwise false. Returns false immediately if shutdown.
addListener
public void addListener(AvailabilityGuard.AvailabilityListener listener)
removeListener
public void removeListener(AvailabilityGuard.AvailabilityListener listener)
describeWhoIsBlocking
public String describeWhoIsBlocking()
- Provide a textual description of what components, if any, are blocking access.
Copyright © 2002-2014 The Neo4j Graph Database Project. All Rights Reserved.