public class SQLStateManager<Z,D extends Database<Z>> extends Object implements StateManager, ConnectionFactory, SerializedDurabilityListener
CLEAR_LOCAL_STATE
Constructor and Description |
---|
SQLStateManager(DatabaseCluster<Z,D> cluster,
DriverDatabase database,
PoolFactory poolFactory) |
Modifier and Type | Method and Description |
---|---|
void |
activated(DatabaseEvent event)
Triggered after database is successfully activated.
|
void |
afterInvocation(byte[] transactionId,
byte phase) |
void |
afterInvocation(InvocationEvent event) |
void |
afterInvoker(byte[] transactionId,
byte phase,
String databaseId,
byte[] result) |
void |
afterInvoker(InvokerEvent event) |
void |
beforeInvocation(byte[] transactionId,
byte phase,
byte exceptionType) |
void |
beforeInvocation(InvocationEvent event) |
void |
beforeInvoker(byte[] transactionId,
byte phase,
String databaseId) |
void |
beforeInvoker(InvokerEvent event) |
void |
deactivated(DatabaseEvent event)
Triggered after database is successfully deactivated.
|
Set<String> |
getActiveDatabases() |
Connection |
getConnection() |
boolean |
isEnabled() |
Map<InvocationEvent,Map<String,InvokerEvent>> |
recover() |
void |
setActiveDatabases(Set<String> databases) |
void |
start()
Called upon database cluster start.
|
void |
stop()
Called when database cluster is stopped.
|
public SQLStateManager(DatabaseCluster<Z,D> cluster, DriverDatabase database, PoolFactory poolFactory)
public Set<String> getActiveDatabases()
getActiveDatabases
in interface StateManager
StateManager.getActiveDatabases()
public void setActiveDatabases(Set<String> databases)
setActiveDatabases
in interface StateManager
StateManager.setActiveDatabases(java.util.Set)
public void activated(DatabaseEvent event)
activated
in interface DatabaseClusterListener
event
- indicates the database that was activatedDatabaseClusterListener.activated(net.sf.hajdbc.state.DatabaseEvent)
public void deactivated(DatabaseEvent event)
deactivated
in interface DatabaseClusterListener
event
- indicates the database that was deactivatedDatabaseClusterListener.deactivated(net.sf.hajdbc.state.DatabaseEvent)
public void beforeInvocation(byte[] transactionId, byte phase, byte exceptionType)
beforeInvocation
in interface SerializedDurabilityListener
SerializedDurabilityListener.beforeInvocation(byte[], byte, byte)
public void afterInvocation(byte[] transactionId, byte phase)
afterInvocation
in interface SerializedDurabilityListener
SerializedDurabilityListener.afterInvocation(byte[], byte)
public void beforeInvoker(byte[] transactionId, byte phase, String databaseId)
beforeInvoker
in interface SerializedDurabilityListener
SerializedDurabilityListener.beforeInvoker(byte[], byte, java.lang.String)
public void afterInvoker(byte[] transactionId, byte phase, String databaseId, byte[] result)
afterInvoker
in interface SerializedDurabilityListener
SerializedDurabilityListener.afterInvoker(byte[], byte, java.lang.String, byte[])
public void beforeInvocation(InvocationEvent event)
beforeInvocation
in interface DurabilityListener
DurabilityListener.beforeInvocation(net.sf.hajdbc.durability.InvocationEvent)
public void afterInvocation(InvocationEvent event)
afterInvocation
in interface DurabilityListener
DurabilityListener.afterInvocation(net.sf.hajdbc.durability.InvocationEvent)
public Map<InvocationEvent,Map<String,InvokerEvent>> recover()
recover
in interface StateManager
StateManager.recover()
public void beforeInvoker(InvokerEvent event)
beforeInvoker
in interface DurabilityListener
DurabilityListener.beforeInvoker(net.sf.hajdbc.durability.InvokerEvent)
public void afterInvoker(InvokerEvent event)
afterInvoker
in interface DurabilityListener
DurabilityListener.afterInvoker(net.sf.hajdbc.durability.InvokerEvent)
public boolean isEnabled()
isEnabled
in interface StateManager
public void start() throws Exception
start
in interface Lifecycle
Exception
- if this service fails to start.Lifecycle.start()
public void stop()
stop
in interface Lifecycle
Lifecycle.stop()
public Connection getConnection() throws SQLException
getConnection
in interface ConnectionFactory
SQLException
ConnectionFactory.getConnection()
Copyright © 2004–2014 Paul Ferraro. All rights reserved.