public class JGroupsCommunicationConnector extends Object implements CommunicationConnector, org.jgroups.Receiver, org.jgroups.blocks.RequestHandler, org.jgroups.MembershipListener
Constructor and Description |
---|
JGroupsCommunicationConnector(ModuleContext context) |
Modifier and Type | Method and Description |
---|---|
void |
block() |
void |
configureConnector(List<ChannelDescriptor> channels,
String peerName)
Configure the connector
|
void |
dispose() |
void |
dispose(List<ChannelDescriptor> channels)
Reset the CommunicationConnector
|
String |
getDescription() |
List<String> |
getGroupMembers(String groupName)
Remember that group is the name of the broker, but the name of the
channel is X+Y where: X :brokerName Y: SpaceID
|
String |
getName() |
String |
getProvider() |
void |
getState(OutputStream output) |
String |
getVersion() |
Object |
handle(org.jgroups.Message msg) |
boolean |
hasChannel(String channelName)
This method checks if the communication connector provides a channel with
the name specified.
|
boolean |
init() |
void |
loadConfigurations(Dictionary configurations)
This method allows the connector to obtain all the required
configurations
|
void |
multicast(ChannelMessage message)
Send multicast message to a group (Broadcast)
|
void |
multicast(ChannelMessage message,
List<PeerCard> receivers)
Send multicast message to a list of recipients in the same group
|
void |
receive(org.jgroups.Message msg) |
void |
setDescription(String description) |
void |
setName(String name) |
void |
setProvider(String provider) |
void |
setState(InputStream input) |
void |
setVersion(String version) |
void |
suspect(org.jgroups.Address suspectedMbr) |
String |
toString() |
void |
unblock() |
void |
unicast(ChannelMessage message,
String receiver)
Send unicast message to one recipient
|
void |
viewAccepted(org.jgroups.View newView) |
public JGroupsCommunicationConnector(ModuleContext context) throws Exception
Exception
public void configureConnector(List<ChannelDescriptor> channels, String peerName) throws CommunicationConnectorException
CommunicationConnector
configureConnector
in interface CommunicationConnector
CommunicationConnectorException
public void dispose(List<ChannelDescriptor> channels)
CommunicationConnector
dispose
in interface CommunicationConnector
channels
- Channels to resetpublic void unicast(ChannelMessage message, String receiver) throws CommunicationConnectorException
CommunicationConnector
unicast
in interface CommunicationConnector
CommunicationConnectorException
public void multicast(ChannelMessage message) throws CommunicationConnectorException
CommunicationConnector
multicast
in interface CommunicationConnector
CommunicationConnectorException
public void multicast(ChannelMessage message, List<PeerCard> receivers) throws CommunicationConnectorException
CommunicationConnector
multicast
in interface CommunicationConnector
CommunicationConnectorException
public void loadConfigurations(Dictionary configurations)
Connector
loadConfigurations
in interface Connector
public String getVersion()
getVersion
in interface Connector
public String getDescription()
getDescription
in interface Connector
public String getProvider()
getProvider
in interface Connector
public void setName(String name)
public void setVersion(String version)
public void setDescription(String description)
public void setProvider(String provider)
public void receive(org.jgroups.Message msg)
receive
in interface org.jgroups.MessageListener
public void getState(OutputStream output) throws Exception
getState
in interface org.jgroups.MessageListener
Exception
public void setState(InputStream input) throws Exception
setState
in interface org.jgroups.MessageListener
Exception
public void block()
block
in interface org.jgroups.MembershipListener
public void suspect(org.jgroups.Address suspectedMbr)
suspect
in interface org.jgroups.MembershipListener
public void unblock()
unblock
in interface org.jgroups.MembershipListener
public void viewAccepted(org.jgroups.View newView)
viewAccepted
in interface org.jgroups.MembershipListener
public String toString()
toString
in interface CommunicationConnector
toString
in class Object
public Object handle(org.jgroups.Message msg) throws Exception
handle
in interface org.jgroups.blocks.RequestHandler
Exception
public List<String> getGroupMembers(String groupName)
getGroupMembers
in interface CommunicationConnector
public boolean hasChannel(String channelName)
CommunicationConnector
hasChannel
in interface CommunicationConnector
Copyright © 2018 universAAL Consortium. All rights reserved.