ie.nuigalway.ecrg.jade.jmsmtp
Class MtpBoot

java.lang.Object
  |
  +--ie.nuigalway.ecrg.jade.jmsmtp.MtpBoot
All Implemented Interfaces:
jade.mtp.InChannel, jade.mtp.MTP, jade.mtp.OutChannel

public class MtpBoot
extends java.lang.Object
implements jade.mtp.MTP


Nested Class Summary
 
Nested classes inherited from class jade.mtp.InChannel
jade.mtp.InChannel.Dispatcher
 
Field Summary
private static JMSMTP mtp
           
 
Constructor Summary
MtpBoot()
           
 
Method Summary
 jade.mtp.TransportAddress activate(jade.mtp.InChannel.Dispatcher disp)
          Activate a default Address
 jade.mtp.TransportAddress activate(jade.mtp.InChannel.Dispatcher disp, jade.core.Profile p)
          Activate a default Address
 void activate(jade.mtp.InChannel.Dispatcher disp, jade.mtp.TransportAddress ta)
          Activate a specific TransportAddress
 void activate(jade.mtp.InChannel.Dispatcher disp, jade.mtp.TransportAddress ta, jade.core.Profile p)
          Activate a specific TransportAddress
 java.lang.String addrToStr(jade.mtp.TransportAddress ta)
          Given a TransportAddress convert it to a string
 void deactivate()
          Deactivate the MTP
 void deactivate(jade.mtp.TransportAddress ta)
          Deactivate a specific address
 void deliver(java.lang.String addr, jade.domain.FIPAAgentManagement.Envelope env, byte[] payload)
          Deliver a message to a jmsTA
private static java.net.URL[] getLibJars(java.lang.String lib)
          Reads a given directory and returns the contents as a URL []
 java.lang.String getName()
          Return the name of this MTP
 java.lang.String[] getSupportedProtocols()
          Get prtocols supported by this MTP
 jade.mtp.TransportAddress strToAddr(java.lang.String rep)
          Converts a string to a JMS Transport address
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

mtp

private static JMSMTP mtp
Constructor Detail

MtpBoot

public MtpBoot()
Method Detail

activate

public jade.mtp.TransportAddress activate(jade.mtp.InChannel.Dispatcher disp)
                                   throws jade.mtp.MTPException
Activate a default Address

Parameters:
disp - Passed messages to the platform
Returns:
Trnasport Address for the address activated
Throws:
jade.mtp.MTPException - Error during address activation

activate

public void activate(jade.mtp.InChannel.Dispatcher disp,
                     jade.mtp.TransportAddress ta)
              throws jade.mtp.MTPException
Activate a specific TransportAddress

Parameters:
disp - Used to pass messages to the platform
ta - Address to activate
Throws:
jade.mtp.MTPException - Error during address activation

activate

public jade.mtp.TransportAddress activate(jade.mtp.InChannel.Dispatcher disp,
                                          jade.core.Profile p)
                                   throws jade.mtp.MTPException
Activate a default Address

Specified by:
activate in interface jade.mtp.InChannel
Parameters:
disp - Passed messages to the platform
p - is the Profile from which the configuration parameters for this instance of JADE container can be retrieved
Returns:
Trnasport Address for the address activated
Throws:
jade.mtp.MTPException - Error during address activation

activate

public void activate(jade.mtp.InChannel.Dispatcher disp,
                     jade.mtp.TransportAddress ta,
                     jade.core.Profile p)
              throws jade.mtp.MTPException
Activate a specific TransportAddress

Specified by:
activate in interface jade.mtp.InChannel
Parameters:
disp - Used to pass messages to the platform
ta - Address to activate
p - is the Profile from which the configuration parameters for this instance of JADE container can be retrieved
Throws:
jade.mtp.MTPException - Error during address activation

deactivate

public void deactivate(jade.mtp.TransportAddress ta)
                throws jade.mtp.MTPException
Deactivate a specific address

Specified by:
deactivate in interface jade.mtp.InChannel
Parameters:
ta - Address to deactivate
Throws:
jade.mtp.MTPException - Error during address deactivation

deactivate

public void deactivate()
                throws jade.mtp.MTPException
Deactivate the MTP

Specified by:
deactivate in interface jade.mtp.InChannel
Throws:
jade.mtp.MTPException - Error with MTP deactivation

deliver

public void deliver(java.lang.String addr,
                    jade.domain.FIPAAgentManagement.Envelope env,
                    byte[] payload)
             throws jade.mtp.MTPException
Deliver a message to a jmsTA

Specified by:
deliver in interface jade.mtp.OutChannel
Parameters:
addr - Address to deliver too
env - Envelope of message
payload - Message payload
Throws:
jade.mtp.MTPException - Error during message send

strToAddr

public jade.mtp.TransportAddress strToAddr(java.lang.String rep)
                                    throws jade.mtp.MTPException
Converts a string to a JMS Transport address

Specified by:
strToAddr in interface jade.mtp.MTP
Parameters:
rep - Contains the address as a string
Returns:
TransportAddress The address as a JMS Transport Address
Throws:
jade.mtp.MTPException - Error During Address conversion

addrToStr

public java.lang.String addrToStr(jade.mtp.TransportAddress ta)
                           throws jade.mtp.MTPException
Given a TransportAddress convert it to a string

Specified by:
addrToStr in interface jade.mtp.MTP
Parameters:
ta - The Address as a TransportAddress object
Returns:
String Address as a string
Throws:
jade.mtp.MTPException - Error during Address conversion

getName

public java.lang.String getName()
Return the name of this MTP

Specified by:
getName in interface jade.mtp.MTP
Returns:
MTP Name

getSupportedProtocols

public java.lang.String[] getSupportedProtocols()
Get prtocols supported by this MTP

Specified by:
getSupportedProtocols in interface jade.mtp.MTP
Returns:
The Protocols supported by this MTP

getLibJars

private static java.net.URL[] getLibJars(java.lang.String lib)
                                  throws java.lang.Exception
Reads a given directory and returns the contents as a URL []

Parameters:
lib - JMS Provider Type to learn
Returns:
A URL [] of the contents of the directory
Throws:
java.lang.Exception - Error reading in Librarys