public class ChannelCommandDispatcherFactory extends Object implements CommandDispatcherFactory, org.jgroups.blocks.RequestHandler, AutoCloseable, Group, org.jgroups.MembershipListener
MessageDispatcher
based CommandDispatcherFactory
.
This factory can produce multiple CommandDispatcher
instances,
all of which will share the same MessageDispatcher
instance.Group.Listener
Constructor and Description |
---|
ChannelCommandDispatcherFactory(ChannelCommandDispatcherFactoryConfiguration config) |
Modifier and Type | Method and Description |
---|---|
void |
addListener(Group.Listener listener)
Registers a membership listener for the group.
|
void |
block() |
void |
close() |
<C> CommandDispatcher<C> |
createCommandDispatcher(Object id,
C context)
Creates a new command dispatcher using the specified identifier and context..
|
Node |
getCoordinatorNode()
Returns the group coordinator node.
|
Group |
getGroup()
Returns the group upon which the this command dispatcher operates.
|
Node |
getLocalNode()
Returns the local node.
|
String |
getName()
Returns the name of this group.
|
List<Node> |
getNodes()
Returns the list of nodes that are members of this group.
|
Object |
handle(org.jgroups.Message message) |
boolean |
isCoordinator()
Indicates whether or not we are the group coordinator.
|
void |
removeListener(Group.Listener listener)
Removes a registered listener from the group.
|
void |
suspect(org.jgroups.Address member) |
void |
unblock() |
void |
viewAccepted(org.jgroups.View view) |
public ChannelCommandDispatcherFactory(ChannelCommandDispatcherFactoryConfiguration config)
public void close()
close
in interface AutoCloseable
public Object handle(org.jgroups.Message message) throws Exception
handle
in interface org.jgroups.blocks.RequestHandler
Exception
public Group getGroup()
CommandDispatcherFactory
getGroup
in interface CommandDispatcherFactory
public <C> CommandDispatcher<C> createCommandDispatcher(Object id, C context)
CommandDispatcherFactory
CommandDispatcher
will communicate with those dispatchers within the group sharing the same identifier.createCommandDispatcher
in interface CommandDispatcherFactory
id
- a unique identifier for this dispatchercontext
- the context used for executing commandspublic void addListener(Group.Listener listener)
Group
addListener
in interface Group
listener
- listener to be addedpublic void removeListener(Group.Listener listener)
Group
removeListener
in interface Group
listener
- listener to be removedpublic String getName()
Group
public boolean isCoordinator()
Group
isCoordinator
in interface Group
public Node getLocalNode()
Group
getLocalNode
in interface Group
public Node getCoordinatorNode()
Group
getCoordinatorNode
in interface Group
public List<Node> getNodes()
Group
public void viewAccepted(org.jgroups.View view)
viewAccepted
in interface org.jgroups.MembershipListener
public void suspect(org.jgroups.Address member)
suspect
in interface org.jgroups.MembershipListener
public void block()
block
in interface org.jgroups.MembershipListener
public void unblock()
unblock
in interface org.jgroups.MembershipListener
Copyright © 2016 JBoss by Red Hat. All rights reserved.