org.universAAL.middleware.connectors.communication.jgroups
Class JGroupsCommunicationConnector

Package class diagram package JGroupsCommunicationConnector
java.lang.Object
  extended by org.universAAL.middleware.connectors.communication.jgroups.JGroupsCommunicationConnector
All Implemented Interfaces:
org.jgroups.blocks.RequestHandler, org.jgroups.MembershipListener, org.jgroups.MessageListener, org.jgroups.Receiver, CommunicationConnector, Connector

public class JGroupsCommunicationConnector
extends Object
implements CommunicationConnector, org.jgroups.Receiver, org.jgroups.blocks.RequestHandler, org.jgroups.MembershipListener

JGroup communication connector implementation

Version:
$LastChangedRevision$ ($LastChangedDate$)
Author:
Michele Girolami, Francesco Furfari, Filippo Palumbo, Stefano Lenzi, Giancarlo Riolo

Constructor Summary
JGroupsCommunicationConnector(ModuleContext context)
           
 
Method Summary
 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)
           
 String getName()
           
 String getProvider()
           
 void getState(OutputStream output)
           
 String getVersion()
           
 Object handle(org.jgroups.Message msg)
           
 boolean hasChannel(String channelName)
           
 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)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

JGroupsCommunicationConnector

public JGroupsCommunicationConnector(ModuleContext context)
                              throws Exception
Throws:
Exception
Method Detail

configureConnector

public void configureConnector(List<ChannelDescriptor> channels,
                               String peerName)
                        throws CommunicationConnectorException
Description copied from interface: CommunicationConnector
Configure the connector

Specified by:
configureConnector in interface CommunicationConnector
Throws:
CommunicationConnectorException

dispose

public void dispose(List<ChannelDescriptor> channels)
Description copied from interface: CommunicationConnector
Reset the CommunicationConnector

Specified by:
dispose in interface CommunicationConnector
Parameters:
channels - Channels to reset

dispose

public void dispose()
Specified by:
dispose in interface Connector

unicast

public void unicast(ChannelMessage message,
                    String receiver)
             throws CommunicationConnectorException
Description copied from interface: CommunicationConnector
Send unicast message to one recipient

Specified by:
unicast in interface CommunicationConnector
Throws:
CommunicationConnectorException

multicast

public void multicast(ChannelMessage message)
               throws CommunicationConnectorException
Description copied from interface: CommunicationConnector
Send multicast message to a group (Broadcast)

Specified by:
multicast in interface CommunicationConnector
Throws:
CommunicationConnectorException

multicast

public void multicast(ChannelMessage message,
                      List<PeerCard> receivers)
               throws CommunicationConnectorException
Description copied from interface: CommunicationConnector
Send multicast message to a list of recipients in the same group

Specified by:
multicast in interface CommunicationConnector
Throws:
CommunicationConnectorException

loadConfigurations

public void loadConfigurations(Dictionary configurations)
Description copied from interface: Connector
This method allows the connector to obtain all the required configurations

Specified by:
loadConfigurations in interface Connector

getName

public String getName()
Specified by:
getName in interface Connector

getVersion

public String getVersion()
Specified by:
getVersion in interface Connector

getDescription

public String getDescription()
Specified by:
getDescription in interface Connector

getProvider

public String getProvider()
Specified by:
getProvider in interface Connector

setName

public void setName(String name)

setVersion

public void setVersion(String version)

setDescription

public void setDescription(String description)

setProvider

public void setProvider(String provider)

receive

public void receive(org.jgroups.Message msg)
Specified by:
receive in interface org.jgroups.MessageListener

getState

public void getState(OutputStream output)
              throws Exception
Specified by:
getState in interface org.jgroups.MessageListener
Throws:
Exception

setState

public void setState(InputStream input)
              throws Exception
Specified by:
setState in interface org.jgroups.MessageListener
Throws:
Exception

block

public void block()
Specified by:
block in interface org.jgroups.MembershipListener

suspect

public void suspect(org.jgroups.Address suspectedMbr)
Specified by:
suspect in interface org.jgroups.MembershipListener

unblock

public void unblock()
Specified by:
unblock in interface org.jgroups.MembershipListener

viewAccepted

public void viewAccepted(org.jgroups.View newView)
Specified by:
viewAccepted in interface org.jgroups.MembershipListener

toString

public String toString()
Specified by:
toString in interface CommunicationConnector
Overrides:
toString in class Object

handle

public Object handle(org.jgroups.Message msg)
              throws Exception
Specified by:
handle in interface org.jgroups.blocks.RequestHandler
Throws:
Exception

init

public boolean init()
Specified by:
init in interface Connector

getGroupMembers

public List<String> getGroupMembers(String groupName)
Specified by:
getGroupMembers in interface CommunicationConnector

hasChannel

public boolean hasChannel(String channelName)
Specified by:
hasChannel in interface CommunicationConnector


Copyright © 2014 universAAL Consortium. All Rights Reserved.