org.objectweb.joram.mom.dest.jmsbridge
Class JMSBridgeTopic

java.lang.Object
  extended by fr.dyade.aaa.agent.Agent
      extended by org.objectweb.joram.mom.dest.Destination
          extended by org.objectweb.joram.mom.dest.Topic
              extended by org.objectweb.joram.mom.dest.jmsbridge.JMSBridgeTopic
All Implemented Interfaces:
AgentMBean, java.io.Serializable, ClusterDestinationMBean, DestinationMBean, TopicMBean

public class JMSBridgeTopic
extends Topic

The BridgeTopic class implements a specific topic which forwards the messages it receives to a foreign JMS destination, and gets the messages it is requested to deliver from the same foreign destination.

This topic is in fact a bridge linking JORAM and a foreign JMS server, and which is accessible through the Pub/Sub communication mode.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.objectweb.joram.mom.dest.Topic
alreadySentLocally, fatherId, friends, logger, selectors, subscribers
 
Fields inherited from class org.objectweb.joram.mom.dest.Destination
_rights, clients, creationDate, dmqId, freeReading, freeWriting, nbMsgsDeliverSinceCreation, nbMsgsReceiveSinceCreation, nbMsgsSentToDMQSinceCreation, READ, READWRITE, task, WAKEUP_PERIOD, WRITE
 
Fields inherited from class fr.dyade.aaa.agent.Agent
emptyString, fixed, logmon
 
Constructor Summary
JMSBridgeTopic()
           
 
Method Summary
 void agentFinalize(boolean lastTime)
          Finalizes the agent before it is garbaged.
protected  void doDeleteNot(DeleteNot not)
          Method specifically processing a fr.dyade.aaa.agent.DeleteNot instance.
 void initialize(boolean firstTime)
          Initializes the destination.
 void postSubscribe()
          Method specializing the reaction to a SubscribeRequest instance.
 ClientMessages preProcess(AgentId from, ClientMessages not)
          Method specializing the reaction to a ClientMessages instance.
 void preUnsubscribe()
          Method specializing the reaction to an UnsubscribeRequest instance.
 void react(AgentId from, Notification not)
          Specializes this Topic method for processing the specific bridge notifications.
 void setProperties(java.util.Properties prop)
          Configures a BridgeTopic instance.
 void topicForwardNot(AgentId from, TopicForwardNot not)
          Method specializing the reaction to a TopicForwardNot instance, carrying messages forwarded by a cluster fellow or a hierarchical son.
 java.lang.String toString()
          Returns a string representation of this destination.
 
Methods inherited from class org.objectweb.joram.mom.dest.Topic
clusterJoin, clusterJoinAck, doClientMessages, doRightRequest, doUnknownAgent, forwardMessages, getClusterElements, getNbMsgsReceiveSinceCreation, getNumberOfSubscribers, getSubscriberIds, getType, handleAdminRequestNot, postUnsubscribe, preSubscribe, processMessages, sendToCluster, setAlreadySentLocally, subscribeRequest, unsubscribeRequest, wakeUpNot
 
Methods inherited from class org.objectweb.joram.mom.dest.Destination
agentInitialize, clientMessages, delete, deleteNot, forward, getCreationDate, getCreationTimeInMillis, getDestinationId, getDMQAgentId, getDMQId, getJMXStatistics, getMBeanName, getNbMsgsDeliverSinceCreation, getNbMsgsSentToDMQSinceCreation, getPeriod, getRight, getRights, getRights, handleDeniedMessage, interceptorsAvailable, isAdministrator, isFreeReading, isFreeWriting, isLocal, isReader, isValidJMXAttribute, isWriter, postProcess, processAdminCommand, processInterceptors, processSetRight, processStartHandler, processStopHandler, replyToTopic, requestGroupNot, setAdminId, setFreeReading, setFreeWriting, setPeriod, setRight, unknownAgent, updateProperties
 
Methods inherited from class fr.dyade.aaa.agent.Agent
delete, delete, deploy, deploy, getAgentId, getCommitTime, getId, getLogTopic, getName, getReactNb, getReactTime, isDeployed, isFixed, needToBeCommited, save, sendTo, sendTo, sendTo, setName, setNoSave, setSave
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.objectweb.joram.mom.dest.DestinationMBean
delete, getCreationDate, getCreationTimeInMillis, getDestinationId, getDMQId, getName, getNbMsgsDeliverSinceCreation, getNbMsgsSentToDMQSinceCreation, getPeriod, getRight, getRights, isFreeReading, isFreeWriting, setFreeReading, setFreeWriting, setPeriod
 
Methods inherited from interface fr.dyade.aaa.agent.AgentMBean
getAgentId, getCommitTime, getReactNb, getReactTime, isFixed
 

Constructor Detail

JMSBridgeTopic

public JMSBridgeTopic()
Method Detail

setProperties

public void setProperties(java.util.Properties prop)
                   throws RequestException
Configures a BridgeTopic instance.

Overrides:
setProperties in class Destination
Parameters:
prop - The initial set of properties.
Throws:
RequestException

initialize

public void initialize(boolean firstTime)
Initializes the destination.

Overrides:
initialize in class Topic
Parameters:
firstTime - true when first called by the factory

react

public void react(AgentId from,
                  Notification not)
           throws java.lang.Exception
Specializes this Topic method for processing the specific bridge notifications.

Overrides:
react in class Topic
Parameters:
from - agent sending notification
not - notification to react to
Throws:
java.lang.Exception

agentFinalize

public void agentFinalize(boolean lastTime)
Description copied from class: Destination
Finalizes the agent before it is garbaged.

Overrides:
agentFinalize in class Destination
Parameters:
lastTime - true when last called by the factory on agent deletion.

toString

public java.lang.String toString()
Description copied from class: Topic
Returns a string representation of this destination.

Specified by:
toString in interface AgentMBean
Specified by:
toString in interface DestinationMBean
Overrides:
toString in class Topic
Returns:
A string representation of this agent.

postSubscribe

public void postSubscribe()
Method specializing the reaction to a SubscribeRequest instance.

This method sets, if needed, a JMS listener on the foreign JMS consumer.

Overrides:
postSubscribe in class Topic
Throws:
AccessException - If the sender is not a READER.

preUnsubscribe

public void preUnsubscribe()
Method specializing the reaction to an UnsubscribeRequest instance.

This method unsets, if needed, the JMS listener on the foreign JMS consumer.

Overrides:
preUnsubscribe in class Topic

topicForwardNot

public void topicForwardNot(AgentId from,
                            TopicForwardNot not)
Method specializing the reaction to a TopicForwardNot instance, carrying messages forwarded by a cluster fellow or a hierarchical son.

This method forwards the messages, if needed, to the hierarchical father, and to the foreign JMS destination.

Overrides:
topicForwardNot in class Topic

preProcess

public ClientMessages preProcess(AgentId from,
                                 ClientMessages not)
Method specializing the reaction to a ClientMessages instance.

This method may forward the messages to the topic father if any, or to the cluster fellows if any, and to the foreign JMS destination.

Overrides:
preProcess in class Destination
Parameters:
from - The sender of the message
not - The incoming messages.
Returns:
The incoming messages after processing.

doDeleteNot

protected void doDeleteNot(DeleteNot not)
Method specifically processing a fr.dyade.aaa.agent.DeleteNot instance.

This method closes the JMS resources used for connecting to the foreign JMS server.

Overrides:
doDeleteNot in class Topic


Copyright © 2011 ScalAgent D.T.. All Rights Reserved.