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

java.lang.Object
  extended by org.objectweb.joram.mom.dest.DestinationImpl
      extended by org.objectweb.joram.mom.dest.TopicImpl
          extended by org.objectweb.joram.mom.dest.jmsbridge.JMSBridgeTopicImpl
All Implemented Interfaces:
java.io.Serializable, DestinationImplMBean, TopicImplMBean

public class JMSBridgeTopicImpl
extends TopicImpl

The BridgeTopicImpl 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
private  long arrivalsCounter
          Counter for keeping the original delivery order.
private  JMSBridgeModule jmsModule
          The JMS module for accessing the foreign JMS destination.
private  java.util.Hashtable outTable
          Table persisting the outgoing messages until acknowledgement by the bridge module.
private static long serialVersionUID
          define serialVersionUID for interoperability
 
Fields inherited from class org.objectweb.joram.mom.dest.TopicImpl
alreadySentLocally, fatherId, friends, selectors, subscribers
 
Fields inherited from class org.objectweb.joram.mom.dest.DestinationImpl
_rights, agent, clients, creationDate, dmqId, freeReading, freeWriting, logger, nbMsgsDeliverSinceCreation, nbMsgsReceiveSinceCreation, nbMsgsSentToDMQSinceCreation, READ, READWRITE, WAKEUP_PERIOD, WRITE
 
Constructor Summary
JMSBridgeTopicImpl(AgentId adminId, java.util.Properties prop)
          Constructs a BridgeTopicImpl instance.
 
Method Summary
 void bridgeAckNot(JMSBridgeAckNot not)
          Reacts to BridgeAckNot notifications holding the identifier of a message successfuly delivered to the foreign JMS server.
 void bridgeDeliveryNot(AgentId from, JMSBridgeDeliveryNot not)
          Reacts to BridgeDeliveryNot notifications holding a message received from the foreign JMS server.
protected  void close()
           
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 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.TopicImpl
clusterAck, clusterNot, clusterTest, doClientMessages, doRightRequest, doUnknownAgent, forwardMessages, getNbMsgsReceiveSinceCreation, getNumberOfSubscribers, getSubscriberIds, handleAdminRequestNot, postUnsubscribe, preSubscribe, processMessages, setAlreadySentLocally, subscribeRequest, topicForwardNot, unsubscribeRequest, wakeUpNot
 
Methods inherited from class org.objectweb.joram.mom.dest.DestinationImpl
canBeDeleted, clientMessages, delete, deleteNot, forward, getCreationDate, getCreationTimeInMillis, getDestinationId, getDMQAgentId, getDMQId, getId, getJMXStatistics, getName, getNbMsgsDeliverSinceCreation, getNbMsgsSentToDMQSinceCreation, getPeriod, getRight, getRights, getRights, handleDeniedMessage, isAdministrator, isFreeReading, isFreeWriting, isLocal, isReader, isValidJMXAttribute, isWriter, postProcess, processSetRight, replyToTopic, requestGroupNot, setAgent, setFreeReading, setFreeWriting, setPeriod, setRight, specialAdminProcess, specialAdminRequest, unknownAgent
 
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.DestinationImplMBean
delete, getCreationDate, getCreationTimeInMillis, getDestinationId, getDMQId, getName, getNbMsgsDeliverSinceCreation, getNbMsgsSentToDMQSinceCreation, getPeriod, getRight, getRights, isFreeReading, isFreeWriting, setFreeReading, setFreeWriting, setPeriod
 

Field Detail

serialVersionUID

private static final long serialVersionUID
define serialVersionUID for interoperability

See Also:
Constant Field Values

jmsModule

private JMSBridgeModule jmsModule
The JMS module for accessing the foreign JMS destination.


arrivalsCounter

private long arrivalsCounter
Counter for keeping the original delivery order.


outTable

private java.util.Hashtable outTable
Table persisting the outgoing messages until acknowledgement by the bridge module.

Key: message identifier
Value: message

Constructor Detail

JMSBridgeTopicImpl

public JMSBridgeTopicImpl(AgentId adminId,
                          java.util.Properties prop)
Constructs a BridgeTopicImpl instance.

Parameters:
adminId - Identifier of the administrator of the topic.
prop - The initial set of properties.
Method Detail

initialize

public void initialize(boolean firstTime)
Initializes the destination.

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

toString

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

Specified by:
toString in interface DestinationImplMBean
Overrides:
toString in class TopicImpl

bridgeDeliveryNot

public void bridgeDeliveryNot(AgentId from,
                              JMSBridgeDeliveryNot not)
Reacts to BridgeDeliveryNot notifications holding a message received from the foreign JMS server.


bridgeAckNot

public void bridgeAckNot(JMSBridgeAckNot not)
Reacts to BridgeAckNot notifications holding the identifier of a message successfuly delivered to the foreign JMS server.


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 TopicImpl
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 TopicImpl

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.


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 DestinationImpl
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 TopicImpl

close

protected void close()


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