org.objectweb.joram.mom.dest

Class BridgeTopicImpl

Implemented Interfaces:
java.io.Serializable

public class BridgeTopicImpl
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

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

READ, READWRITE, WRITE, adminId, clients, destId, dmqId, freeReading, freeWriting

Constructor Summary

BridgeTopicImpl(AgentId destId, AgentId adminId)
Constructs a BridgeTopicImpl instance.

Method Summary

protected void
doProcess(DeleteNot not)
Method specifically processing a fr.dyade.aaa.agent.DeleteNot instance.
protected void
doProcess(ClientMessages not)
Method specializing the reaction to a ClientMessages instance.
protected void
doReact(AgentId from, org.objectweb.joram.mom.dest.TopicForwardNot not)
Method specializing the reaction to a TopicForwardNot instance, carrying messages forwarded by a cluster fellow or a hierarchical son.
protected void
doReact(AgentId from, SubscribeRequest not)
Method specializing the reaction to a SubscribeRequest instance.
protected void
doReact(AgentId from, UnsubscribeRequest not)
Method specializing the reaction to an UnsubscribeRequest instance.
protected void
doReact(BridgeAckNot not)
Reacts to BridgeAckNot notifications holding the identifier of a message successfuly delivered to the foreign JMS server.
protected void
doReact(BridgeDeliveryNot not)
Reacts to BridgeDeliveryNot notifications holding a message received from the foreign JMS server.
void
init(Properties prop)
Initiales the topic's JMS module.
void
react(AgentId from, Notification not)
Specializes this TopicImpl method for processing the specific bridge notifications.
String
toString()

Methods inherited from class org.objectweb.joram.mom.dest.TopicImpl

doProcess, doProcess, doProcess, doProcess, doReact, doReact, doReact, doReact, doReact, doReact, doReact, doReact, doReact, doReact, doReact, doReact, doReact, doReact, doReact, doReact, forwardMessages, processMessages, react, specialProcess, toString

Methods inherited from class org.objectweb.joram.mom.dest.DestinationImpl

canBeDeleted, doReact, doReact, doReact, doReact, doReact, doReact, doReact, doReact, doReact, doReact, isAdministrator, isReader, isWriter, processSetRight, react, sendToDMQ, specialAdminProcess, specialProcess

Constructor Details

BridgeTopicImpl

public BridgeTopicImpl(AgentId destId,
                       AgentId adminId)
Constructs a BridgeTopicImpl instance.

Parameters:
destId - Identifier of the agent hosting the topic.
adminId - Identifier of the administrator of the topic.

Method Details

doProcess

protected void doProcess(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:
doProcess in interface TopicImpl


doProcess

protected void doProcess(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:
doProcess in interface TopicImpl


doReact

protected void doReact(AgentId from,
                       org.objectweb.joram.mom.dest.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:
doReact in interface TopicImpl


doReact

protected void doReact(AgentId from,
                       SubscribeRequest not)
            throws AccessException
Method specializing the reaction to a SubscribeRequest instance.

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

Overrides:
doReact in interface TopicImpl

Throws:
AccessException - If the sender is not a READER.


doReact

protected void doReact(AgentId from,
                       UnsubscribeRequest not)
Method specializing the reaction to an UnsubscribeRequest instance.

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

Overrides:
doReact in interface TopicImpl


doReact

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


doReact

protected void doReact(BridgeDeliveryNot not)
Reacts to BridgeDeliveryNot notifications holding a message received from the foreign JMS server.


init

public void init(Properties prop)
Initiales the topic's JMS module.


react

public void react(AgentId from,
                  Notification not)
            throws UnknownNotificationException
Specializes this TopicImpl method for processing the specific bridge notifications.
Overrides:
react in interface TopicImpl


toString

public String toString()
Overrides:
toString in interface TopicImpl


Copyright B) 2004 Scalagent - All rights reserved