ie.nuigalway.ecrg.jade.jmsmtp.providersupport
Class ProviderManager

java.lang.Object
  |
  +--ie.nuigalway.ecrg.jade.jmsmtp.providersupport.ProviderManager
All Implemented Interfaces:
JmsProviderManager

public class ProviderManager
extends java.lang.Object
implements JmsProviderManager


Field Summary
private  java.util.HashMap brokerConnections
           
private static org.apache.log4j.Category log
           
private  MapMessageUtil mapUtil
           
 ProviderAdmin providerAdmin
          Description of the Field
private  QLManager qlManager
           
private  FipaXMLUtil xmlUtil
           
 
Constructor Summary
ProviderManager()
          Creates a new ProviderManager object.
 
Method Summary
 void activate(jade.mtp.InChannel.Dispatcher disp, JMSAddress jmsTA)
          Activate a specific TransportAddress
private  void closeBrokerConnections()
          Close all connections in the hashmap
 void deactivate()
          Deactivate the MTP
 void deactivate(JMSAddress jmsTA)
          Deactivate a specific address
 void deliver(JMSAddress jmsTA, jade.domain.FIPAAgentManagement.Envelope env, byte[] payload)
          Deliver a message to a jmsTA
 javax.jms.QueueConnection getBrokerConnection(JMSAddress jmsTA)
          Used to create a new broker connection or to retrive one from the hashmap
 ProviderAdmin getProviderAdmin(java.lang.String providerType)
          Get the Admin interface for a specific JMS provider
private  void setupBrokerConnection(JMSAddress jmsTA)
          Create a QueueConnection to a specified broker and place it in the hashmap
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

private static org.apache.log4j.Category log

qlManager

private QLManager qlManager

xmlUtil

private FipaXMLUtil xmlUtil

mapUtil

private MapMessageUtil mapUtil

providerAdmin

public ProviderAdmin providerAdmin
Description of the Field


brokerConnections

private java.util.HashMap brokerConnections
Constructor Detail

ProviderManager

public ProviderManager()
Creates a new ProviderManager object.

Method Detail

activate

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

Specified by:
activate in interface JmsProviderManager
Parameters:
disp - Used to pass messages to the platform
jmsTA - Address to activate
Throws:
jade.mtp.MTPException - Error during address activation

deactivate

public void deactivate(JMSAddress jmsTA)
                throws jade.mtp.MTPException
Deactivate a specific address

Specified by:
deactivate in interface JmsProviderManager
Parameters:
jmsTA - 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 JmsProviderManager
Throws:
jade.mtp.MTPException - Error with MTP deactivation

deliver

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

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

getBrokerConnection

public javax.jms.QueueConnection getBrokerConnection(JMSAddress jmsTA)
                                              throws jade.mtp.MTPException
Used to create a new broker connection or to retrive one from the hashmap

Specified by:
getBrokerConnection in interface JmsProviderManager
Parameters:
jmsTA - Address of the Broker
Returns:
QueueConnection A QueueConnection object for the broker in jmsTA
Throws:
jade.mtp.MTPException - Description of the Exception
java.lang.Exception - Error During Connection Activation

setupBrokerConnection

private void setupBrokerConnection(JMSAddress jmsTA)
                            throws jade.mtp.MTPException
Create a QueueConnection to a specified broker and place it in the hashmap

Parameters:
jmsTA - Contains details of the broker
Throws:
jade.mtp.MTPException - Description of the Exception
java.lang.Exception - Error during connection setup

closeBrokerConnections

private void closeBrokerConnections()
Close all connections in the hashmap


getProviderAdmin

public ProviderAdmin getProviderAdmin(java.lang.String providerType)
                               throws jade.mtp.MTPException
Get the Admin interface for a specific JMS provider

Specified by:
getProviderAdmin in interface JmsProviderManager
Parameters:
providerType - Providers interface to return
Returns:
JMS providers admin interface
Throws:
jade.mtp.MTPException - Description of the Exception
java.lang.Exception - Error in creating the provider interface