Package jade.mtp.iiop
Class MessageTransportProtocol
- java.lang.Object
-
- jade.mtp.iiop.MessageTransportProtocol
-
- All Implemented Interfaces:
InChannel,MTP,OutChannel
public class MessageTransportProtocol extends Object implements MTP
Implementation offipa.mts.mtp.iiop.stdspecification for delivering ACL messages over the OMG IIOP transport protocol.- Version:
- $Date$ $Revision$
- Author:
- Giovanni Rimassa - Universita' di Parma
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface jade.mtp.InChannel
InChannel.Dispatcher
-
-
Constructor Summary
Constructors Constructor Description MessageTransportProtocol()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TransportAddressactivate(InChannel.Dispatcher disp, Profile p)Activates an MTP handler for incoming messages on a default address.voidactivate(InChannel.Dispatcher disp, TransportAddress ta, Profile p)Activates an MTP handler for incoming messages on a specific address.StringaddrToStr(TransportAddress ta)Converts aTransportAddressobject into a string representation.voiddeactivate()Deactivates all the MTP handlers.voiddeactivate(TransportAddress ta)Deactivates the MTP handler listening at a given transport address.voiddeliver(String addr, Envelope env, byte[] payload)Delivers to the specified address an ACL message, encoded in some concrete message representation, using the given envelope as a transmission header.StringgetName()Reads the name of the message transport protocol managed by this MTP.String[]getSupportedProtocols()TransportAddressstrToAddr(String rep)Converts a string representing a valid address in this MTP to aTransportAddressobject.
-
-
-
Method Detail
-
activate
public TransportAddress activate(InChannel.Dispatcher disp, Profile p) throws MTPException
Description copied from interface:InChannelActivates an MTP handler for incoming messages on a default address.- Specified by:
activatein interfaceInChannel- Returns:
- A
TransportAddress, corresponding to the chosen default address. - Throws:
MTPException- Thrown if some MTP initialization error occurs.
-
activate
public void activate(InChannel.Dispatcher disp, TransportAddress ta, Profile p) throws MTPException
Description copied from interface:InChannelActivates an MTP handler for incoming messages on a specific address.- Specified by:
activatein interfaceInChannelta- ATransportAddressobject, representing the transport address to listen to.- Throws:
MTPException- Thrown if some MTP initialization error occurs.
-
deactivate
public void deactivate(TransportAddress ta) throws MTPException
Description copied from interface:InChannelDeactivates the MTP handler listening at a given transport address.- Specified by:
deactivatein interfaceInChannel- Parameters:
ta- TheTransportAddressobject the handle to close is listening to.- Throws:
MTPException- Thrown if some MTP cleanup error occurs.
-
deactivate
public void deactivate() throws MTPExceptionDescription copied from interface:InChannelDeactivates all the MTP handlers.- Specified by:
deactivatein interfaceInChannel- Throws:
MTPException- Thrown if some MTP cleanup error occurs.
-
deliver
public void deliver(String addr, Envelope env, byte[] payload) throws MTPException
Description copied from interface:OutChannelDelivers to the specified address an ACL message, encoded in some concrete message representation, using the given envelope as a transmission header.- Specified by:
deliverin interfaceOutChannelenv- The message envelope, containing various fields related to message recipients, encoding, and timestamping.- Throws:
MTPException- Thrown if some MTP delivery error occurs.
-
strToAddr
public TransportAddress strToAddr(String rep) throws MTPException
Description copied from interface:MTPConverts a string representing a valid address in this MTP to aTransportAddressobject.- Specified by:
strToAddrin interfaceMTP- Parameters:
rep- The string representation of the address.- Returns:
- A
TransportAddressobject, created from the given string. - Throws:
MTPException- If the given string is not a valid address according to this MTP.
-
addrToStr
public String addrToStr(TransportAddress ta) throws MTPException
Description copied from interface:MTPConverts aTransportAddressobject into a string representation.- Specified by:
addrToStrin interfaceMTP- Parameters:
ta- TheTransportAddressobject.- Returns:
- A string representing the given address.
- Throws:
MTPException- If the givenTransportAddressis not a valid address for this MTP.
-
getName
public String getName()
Description copied from interface:MTPReads the name of the message transport protocol managed by this MTP. The FIPA standard message transport protocols have a name starting with"fipa.mts.mtp".
-
getSupportedProtocols
public String[] getSupportedProtocols()
- Specified by:
getSupportedProtocolsin interfaceMTP
-
-