public class DistributedStateManager<Z,D extends Database<Z>> extends Object implements StateManager, StateCommandContext<Z,D>, MembershipListener, Stateful
CLEAR_LOCAL_STATE| Constructor and Description |
|---|
DistributedStateManager(DatabaseCluster<Z,D> cluster,
CommandDispatcherFactory dispatcherFactory) |
| Modifier and Type | Method and Description |
|---|---|
void |
activated(DatabaseEvent event)
Triggered after database is successfully activated.
|
void |
added(Member member)
Indicates that the specified member was added to the group.
|
void |
afterInvocation(InvocationEvent event) |
void |
afterInvoker(InvokerEvent event) |
void |
beforeInvocation(InvocationEvent event) |
void |
beforeInvoker(InvokerEvent event) |
void |
deactivated(DatabaseEvent event)
Triggered after database is successfully deactivated.
|
Set<String> |
getActiveDatabases() |
DatabaseCluster<Z,D> |
getDatabaseCluster() |
StateManager |
getLocalStateManager() |
Map<InvocationEvent,Map<String,InvokerEvent>> |
getRemoteInvokers(Remote remote) |
boolean |
isEnabled() |
void |
readState(ObjectInput input)
Returns the state of this object.
|
Map<InvocationEvent,Map<String,InvokerEvent>> |
recover() |
void |
removed(Member member)
Indicates the the specified member was removed from the group.
|
void |
setActiveDatabases(Set<String> databases) |
void |
start()
Called upon database cluster start.
|
void |
stop()
Called when database cluster is stopped.
|
void |
writeState(ObjectOutput output)
Sets the state of this object.
|
public DistributedStateManager(DatabaseCluster<Z,D> cluster, CommandDispatcherFactory dispatcherFactory) throws Exception
Exceptionpublic Set<String> getActiveDatabases()
getActiveDatabases in interface StateManagerStateManager.getActiveDatabases()public void setActiveDatabases(Set<String> databases)
setActiveDatabases in interface StateManagerStateManager.setActiveDatabases(java.util.Set)public void activated(DatabaseEvent event)
activated in interface DatabaseClusterListenerevent - indicates the database that was activatedDatabaseClusterListener.activated(net.sf.hajdbc.state.DatabaseEvent)public void deactivated(DatabaseEvent event)
deactivated in interface DatabaseClusterListenerevent - indicates the database that was deactivatedDatabaseClusterListener.deactivated(net.sf.hajdbc.state.DatabaseEvent)public void afterInvocation(InvocationEvent event)
afterInvocation in interface DurabilityListenerDurabilityListener.afterInvocation(net.sf.hajdbc.durability.InvocationEvent)public void afterInvoker(InvokerEvent event)
afterInvoker in interface DurabilityListenerDurabilityListener.afterInvoker(net.sf.hajdbc.durability.InvokerEvent)public void beforeInvocation(InvocationEvent event)
beforeInvocation in interface DurabilityListenerDurabilityListener.beforeInvocation(net.sf.hajdbc.durability.InvocationEvent)public void beforeInvoker(InvokerEvent event)
beforeInvoker in interface DurabilityListenerDurabilityListener.beforeInvoker(net.sf.hajdbc.durability.InvokerEvent)public void start() throws Exception
start in interface LifecycleException - if this service fails to start.Lifecycle.start()public void stop()
stop in interface LifecycleLifecycle.stop()public boolean isEnabled()
isEnabled in interface StateManagerpublic DatabaseCluster<Z,D> getDatabaseCluster()
getDatabaseCluster in interface StateCommandContext<Z,D extends Database<Z>>StateCommandContext.getDatabaseCluster()public StateManager getLocalStateManager()
getLocalStateManager in interface StateCommandContext<Z,D extends Database<Z>>StateCommandContext.getLocalStateManager()public Map<InvocationEvent,Map<String,InvokerEvent>> getRemoteInvokers(Remote remote)
getRemoteInvokers in interface StateCommandContext<Z,D extends Database<Z>>StateCommandContext.getRemoteInvokers(net.sf.hajdbc.distributed.Remote)public void readState(ObjectInput input) throws IOException
readState in interface StatefulIOExceptionStateful.readState(java.io.ObjectInput)public void writeState(ObjectOutput output) throws IOException
writeState in interface StatefulIOExceptionStateful.writeState(java.io.ObjectOutput)public void added(Member member)
added in interface MembershipListenermember - the added memberMembershipListener.added(net.sf.hajdbc.distributed.Member)public void removed(Member member)
removed in interface MembershipListenermember - the removed memberMembershipListener.removed(net.sf.hajdbc.distributed.Member)public Map<InvocationEvent,Map<String,InvokerEvent>> recover()
recover in interface StateManagerStateManager.recover()Copyright © 2004–2014 Paul Ferraro. All rights reserved.