|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jboss.soa.esb.notification.NotificationTarget org.jboss.soa.esb.notification.NotifyJMS
public abstract class NotifyJMS
Abstract class that defines the behaviour of NotifyQueues and NotifyTopics (and in fact any other javax.jms.Destination object), and provides common methods to derived classes
Description:
Author: Heuristica - Buenos Aires - Argentina
Nested Class Summary | |
---|---|
static class |
NotifyJMS.NativeMessage
|
Field Summary | |
---|---|
static java.lang.String |
ATT_DEST_NAME
Attribute name mnemonic for the att that will hold the JNDI name of the destination javax.jms.Destination object |
static java.lang.String |
ATT_PROP_NAME
Attribute name mnemonic for the name of the message property to fill with contents of the "value" aattribute |
static java.lang.String |
ATT_PROP_VALUE
Attribute name mnemonic for the value to assign to the corresponding message property |
static java.lang.String |
CHILD_MSG_PROP
Element name mnemonic to search for child elements in the ConfigTree at constructor time, that will hold a "name" "value" pair to be included in the JMS message header |
static java.lang.String |
CONNECTION_FACTORY
Connection Factory JNDI name. |
protected org.jboss.internal.soa.esb.rosetta.pooling.JmsConnectionPool[] |
connectionPools
The javax.jms.Connection instance used to talk to JMS |
protected int[] |
deliveryModes
Delivery mode for JMS Messages, either DeliveryMode.PERSISTENT or DeliveryMode.NON_PERSISTENT |
protected org.apache.log4j.Logger |
log
|
static java.lang.String |
PERSISTENT_ATTR
Constant used in configuration |
protected int[] |
priorities
Priorities for JMS Messages seen by this notifier |
static java.lang.String |
PRIORITY_ATTR
Constant used in configuration |
protected javax.jms.MessageProducer[] |
producers
Array with an instance of javax.jms.MessageProducer on each entry that will be used to send the notification at sendNotification() time |
protected javax.jms.Session[] |
sessions
The javax.jms.Session instance used to talk to JMS |
static java.lang.String |
TIME_TO_LIVE_ATTR
Constant used in configuration |
protected long[] |
timeToLives
Time-to-lives for JMS Messages sen by this notifier |
Fields inherited from class org.jboss.soa.esb.notification.NotificationTarget |
---|
m_oParms, PRM_NOTIF_CLASS |
Constructor Summary | |
---|---|
protected |
NotifyJMS(ConfigTree p_oP)
Constructor that will be called by child classes to perform initialization tasks that are common to all derived classes |
Method Summary | |
---|---|
protected abstract javax.jms.MessageProducer |
createProducer(org.jboss.internal.soa.esb.rosetta.pooling.JmsConnectionPool pool,
java.lang.String destinationName,
javax.jms.Session session,
java.util.Properties environment)
Creates a message producer specific to the subclasses implementation i.e QueueSender or TopicPublisher. |
protected abstract void |
send(javax.jms.Message p_oMsg,
javax.jms.MessageProducer msgProducer)
Abstract method - All classes that extend NotifyJMS must implement it according to their own javax.jms.Destination needs (Queue/Topic) |
void |
sendNotification(Message esbMessage)
Send a JMS message using p_o to fill in the message content and the list of message properties that will be added to the JMS message header fields |
protected void |
sendToAll(javax.jms.Message p_oMsg)
Template method for sending JMS messages to destinations. |
protected void |
setJMSProperties(Message fromESBMessage,
javax.jms.Message toJMSMessage)
This method will set appropriate JMSProperties on the outgoing JMSMessage object. |
void |
setJmsPropertiesStrategy(JMSPropertiesSetter jmsPropertiesStrategy)
Sets the strategy for handling the setting of properties on an outgoing JMS Message. |
protected void |
setUpProducers(ConfigTree[] configTrees)
Will setup/create JMS connections, sessions, producers. |
Methods inherited from class org.jboss.soa.esb.notification.NotificationTarget |
---|
fromParams |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected org.apache.log4j.Logger log
public static final java.lang.String CONNECTION_FACTORY
public static final java.lang.String CHILD_MSG_PROP
public static final java.lang.String ATT_PROP_NAME
public static final java.lang.String ATT_PROP_VALUE
public static final java.lang.String ATT_DEST_NAME
public static final java.lang.String PERSISTENT_ATTR
public static final java.lang.String PRIORITY_ATTR
public static final java.lang.String TIME_TO_LIVE_ATTR
protected org.jboss.internal.soa.esb.rosetta.pooling.JmsConnectionPool[] connectionPools
protected javax.jms.Session[] sessions
protected javax.jms.MessageProducer[] producers
protected int[] deliveryModes
protected int[] priorities
protected long[] timeToLives
Constructor Detail |
---|
protected NotifyJMS(ConfigTree p_oP) throws ConfigurationException
p_oP
- ConfigTree
Will contain a variable number of "messageProp" child elements that will be added to messages sent to
ConfigurationException
Method Detail |
---|
protected abstract void send(javax.jms.Message p_oMsg, javax.jms.MessageProducer msgProducer) throws javax.jms.JMSException
p_oMsg
- the JMS Message to sendmsgProducer
- the JMS Message Producer which will perform the sending
javax.jms.JMSException
- if the send was not sucessfulprotected abstract javax.jms.MessageProducer createProducer(org.jboss.internal.soa.esb.rosetta.pooling.JmsConnectionPool pool, java.lang.String destinationName, javax.jms.Session session, java.util.Properties environment) throws javax.naming.NamingException, javax.jms.JMSException, org.jboss.internal.soa.esb.rosetta.pooling.ConnectionException
pool
- sAtt
- session
- environment
-
javax.naming.NamingException
javax.jms.JMSException
org.jboss.internal.soa.esb.rosetta.pooling.ConnectionException
public void sendNotification(Message esbMessage) throws NotificationException
sendNotification
in class NotificationTarget
esbMessage
- Object - This object or thie object's toString() method will
supply contents of JMS message
NotificationException
- -
invoke Exception.getMessage() at runtime for this objectCHILD_MSG_PROP
protected void setJMSProperties(Message fromESBMessage, javax.jms.Message toJMSMessage) throws javax.jms.JMSException
setJmsPropertiesStrategy(JMSPropertiesSetter)
.
See JMSPropertiesSetter
for more info.
javax.jms.JMSException
protected void sendToAll(javax.jms.Message p_oMsg) throws javax.jms.JMSException
p_oMsg
- the JMS Message to send.
javax.jms.JMSException
- if any of the sends fail a JMSException will be
thrown. The exception will contain an error
message and stacktrace for every failed send.protected void setUpProducers(ConfigTree[] configTrees) throws ConfigurationException, javax.jms.JMSException, org.jboss.internal.soa.esb.rosetta.pooling.ConnectionException
configTrees
-
ConfigurationException
javax.jms.JMSException
org.jboss.internal.soa.esb.rosetta.pooling.ConnectionException
public void setJmsPropertiesStrategy(JMSPropertiesSetter jmsPropertiesStrategy)
jmsPropertiesStrategy
- the strategy to use.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |