de.jiac.micro.agent.handle
Interface ICommunicationHandle

All Superinterfaces:
IHandle

public interface ICommunicationHandle
extends IHandle

This interface exposes all features of the agents or nodes communication system. There are several different implementations available that map communication on agent level as well as on node level (like an agent communication channel).

Author:
Marcel Patzlaff
See Also:
IContainer.getHandle(Class)

Method Summary
 IMessage createMessage()
          Creates a new and empty message.
 IAddress getAddressForString(String addressStr)
           
 IUnicastAddress[] getLocalAddresses()
          Returns the IMulticastAddress addresses that are associated with application
 IMulticastAddress getMulticastAddressForName(String groupName)
          Returns a multicast address for a group name
 void joinGroup(IMulticastAddress address)
          Registers the current agent to the given group.
 void leaveGroup(IMulticastAddress address)
          Unregisters the current agent from the given group.
 void sendMessage(IAddress address, IMessage message)
          Sends a message to the specified target (1:1) and (1:n)
 

Method Detail

joinGroup

void joinGroup(IMulticastAddress address)
               throws IOException
Registers the current agent to the given group.

Parameters:
address - the IMulticastAddress identifier for the group to join
Throws:
IllegalArgumentException - if the group name is not valid
SecurityException - if the current agent has no permissions
IOException

leaveGroup

void leaveGroup(IMulticastAddress address)
                throws IOException
Unregisters the current agent from the given group.

Parameters:
group - the IMulticastAddress identifier for the group to leave
Throws:
IllegalArgumentException - if the group name is not valid
IOException

sendMessage

void sendMessage(IAddress address,
                 IMessage message)
                 throws IOException
Sends a message to the specified target (1:1) and (1:n)

Parameters:
address - the address of the target IAddress
message - the message to send
Throws:
SecurityException - if the agent has no permissions
IOException

getLocalAddresses

IUnicastAddress[] getLocalAddresses()
Returns the IMulticastAddress addresses that are associated with application

Returns:
addresses that are associated with application

createMessage

IMessage createMessage()
Creates a new and empty message.

Returns:
a new empty message

getMulticastAddressForName

IMulticastAddress getMulticastAddressForName(String groupName)
Returns a multicast address for a group name

Parameters:
groupName - the string identifier for a group name
Returns:
the multicast address for a group name

getAddressForString

IAddress getAddressForString(String addressStr)


Copyright © 2008-2011 DAI-Labor. All Rights Reserved.