org.openeai.jms.producer
Class MessageProducer


java.lang.Object

  |

  +--org.openeai.OpenEaiObject

        |

        +--org.openeai.jms.producer.MessageProducer

Direct Known Subclasses:
PointToPointProducer, PubSubProducer

public class MessageProducer
extends OpenEaiObject

The ancestor class for PubSub and PointToPoint producers. These are the counterparts to OpenEAI MessageConsumer. These classes (PubSub and PointToPoint Producers) produce messages to and potentially handle responses from OpenEAI MessageConsumers (PointToPoint and PubSub Producers)

Version:
3.0 beta2 - 28 January 2003
Author:
Tod Jackson (tod@openeai.org), Steve Wheat (steve@openeai.org)
See Also:
ProducerConfig, MessageConsumer

Field Summary
protected  java.util.HashMap m_messages
           
protected static java.lang.String STARTED
           
protected static java.lang.String STOPPED
           
protected static java.lang.String STOPPING
           
 
Fields inherited from class org.openeai.OpenEaiObject
logger
 
Constructor Summary
MessageProducer()
           
 
Method Summary
 java.lang.String getAcknowledgementMode()
           
 java.lang.String getConnectionFactoryName()
          Returns the connection factory name (QueueConnectionFactory or TopicConnectionFactory) that this producer should retrieve and use to initialize its connection to the broker with.
 java.lang.String getDefaultCommandName()
           
 java.lang.String getDeliveryMode()
           
 java.lang.String getDestinationName()
          Returns the destination name (Queue or Topic) that this Producer should connect to and consume from.
protected  javax.naming.directory.DirContext getInitialContext()
          Establishes and returns an InitialContext to be used by the calling application to retrieve ConnectionFactories and Destination objects via JNDI.
 java.lang.String getInitialContextFactory()
          Returns the class name of the JNDI context factory that will be used to retrieve the JMS administered objects from a Directory Server or wherever the administered objects are stored.
 int getMessageSeq()
           
 java.lang.String getPassword()
          Sets the broker user password that should be used when establishing a connection with the broker.
 ProducerId getProducerId()
           
 java.lang.String getProducerIdUrl()
           
 java.lang.String getProducerName()
          Returns the name of this producers as specified in its configuration information.
 java.lang.String getProducerStatus()
           
 java.lang.String getProviderUrl()
          Returns the location where the administered objects can be retrieved from.
 java.lang.String getSecurityCredentials()
          Returns the LDAP security credentials (password) this producer should use when connecting to the directory server to retrieve JMS administered objects (ConnectionFactories and Destinations).
 java.lang.String getSecurityPrincipal()
          Returns the LDAP security principal this producer should use when connecting to the directory server to retrieve JMS administered objects (ConnectionFactories and Destinations).
 boolean getStartOnInitialization()
          Returns a boolean indicating whether or not this producer should be started (connected to the broker and ready to produce messages) when it is initialized.
 boolean getTransacted()
           
 java.lang.String getUserName()
          Returns the broker user name that should be used when establishing a connection with the broker.
 int incrementMessageSequence()
           
protected  void init(java.util.Properties props)
          Takes the Properties object contained within the ProducerConfig object passed to the constructor of this Producer and sets all the appropriate instance variables on this producer during initialization.
 boolean isStarted()
           
 void setAcknowledgementMode(java.lang.String mode)
           
 void setConnectionFactoryName(java.lang.String name)
          Sets the connection factory name (QueueConnectionFactory or TopicConnectionFactory) that this producer should retrieve and use to initialize its connection to the broker with.
 void setDefaultCommandName(java.lang.String defaultCommand)
           
 void setDeliveryMode(java.lang.String mode)
           
 void setDestinationName(java.lang.String name)
          Sets the destination name (Queue or Topic) that this Producer should connect to and consume from.
 void setInitialContextFactory(java.lang.String in)
          Sets the class name of the JNDI context factory that will be used to retrieve the JMS administered objects from a Directory Server or wherever the administered objects are stored.
 void setMessageSeq(int seq)
           
 void setPassword(java.lang.String in)
          Sets the broker user password that should be used when establishing a connection with the broker.
 void setProducerId(ProducerId producerId)
           
 void setProducerIdUrl(java.lang.String url)
           
 void setProducerName(java.lang.String name)
          Sets the name of this producers as specified in its configuration information.
 void setProducerStatus(java.lang.String status)
           
 void setProviderUrl(java.lang.String in)
          Sets the location where the administered objects can be retrieved from.
 void setSecurityCredentials(java.lang.String credentials)
          Sets the LDAP security credentials (password) this producer should use when connecting to the directory server to retrieve JMS administered objects (ConnectionFactories and Destinations).
 void setSecurityPrincipal(java.lang.String principal)
          Sets the LDAP security principal this producer should use when connecting to the directory server to retrieve JMS administered objects (ConnectionFactories and Destinations).
 void setStartOnInitialization(boolean start)
          Sets a boolean indicating whether or not this producer should be started (connected to the broker and ready to produce messages) when it is initialized.
 void setTransacted(boolean trans)
           
 void setUserName(java.lang.String in)
          Sets the broker user name that should be used when establishing a connection with the broker.
 
Methods inherited from class org.openeai.OpenEaiObject
addLog4jProperty, getAppName, getDebug, getFromAddr, getLog4jProperties, getMailHost, getMailService, getProperties, getToAddr, initializeLog4j, initializeLog4j, initializeLog4j, setAppName, setDebug, setFromAddr, setMailHost, setMailService, setProperties, setToAddr
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_messages


protected java.util.HashMap m_messages

STOPPED


protected static java.lang.String STOPPED

STOPPING


protected static java.lang.String STOPPING

STARTED


protected static java.lang.String STARTED
Constructor Detail

MessageProducer


public MessageProducer()
Method Detail

setProducerName


public final void setProducerName(java.lang.String name)
Sets the name of this producers as specified in its configuration information.


getProducerName


public final java.lang.String getProducerName()
Returns the name of this producers as specified in its configuration information.

Returns:
String name of the producer.

setAcknowledgementMode


public final void setAcknowledgementMode(java.lang.String mode)

getAcknowledgementMode


public final java.lang.String getAcknowledgementMode()

setDeliveryMode


public final void setDeliveryMode(java.lang.String mode)

getDeliveryMode


public final java.lang.String getDeliveryMode()

setTransacted


public final void setTransacted(boolean trans)

getTransacted


public final boolean getTransacted()

setDefaultCommandName


public final void setDefaultCommandName(java.lang.String defaultCommand)

getDefaultCommandName


public final java.lang.String getDefaultCommandName()

setSecurityPrincipal


public final void setSecurityPrincipal(java.lang.String principal)
Sets the LDAP security principal this producer should use when connecting to the directory server to retrieve JMS administered objects (ConnectionFactories and Destinations). This is specified in the Producers's configuration element (ProducerConfig).

See Also:
ProducerConfig

getSecurityPrincipal


public final java.lang.String getSecurityPrincipal()
Returns the LDAP security principal this producer should use when connecting to the directory server to retrieve JMS administered objects (ConnectionFactories and Destinations). This is specified in the Producers's configuration element (ProducerConfig).

See Also:
ProducerConfig

setSecurityCredentials


public final void setSecurityCredentials(java.lang.String credentials)
Sets the LDAP security credentials (password) this producer should use when connecting to the directory server to retrieve JMS administered objects (ConnectionFactories and Destinations). This is specified in the Producers's configuration element (ProducerConfig).

See Also:
ProducerConfig

getSecurityCredentials


public final java.lang.String getSecurityCredentials()
Returns the LDAP security credentials (password) this producer should use when connecting to the directory server to retrieve JMS administered objects (ConnectionFactories and Destinations). This is specified in the Producers's configuration element (ProducerConfig).

See Also:
ProducerConfig

getProducerId


public final ProducerId getProducerId()

setProducerId


public final void setProducerId(ProducerId producerId)

getStartOnInitialization


public final boolean getStartOnInitialization()
Returns a boolean indicating whether or not this producer should be started (connected to the broker and ready to produce messages) when it is initialized. This is specified in the ProducerConfig Element (startOnInitialization Attribute) of the deployment document for the application being started.

Returns:
boolean
See Also:
ProducerConfig

setStartOnInitialization


public final void setStartOnInitialization(boolean start)
Sets a boolean indicating whether or not this producer should be started (connected to the broker and ready to produce messages) when it is initialized. This is specified in the ProducerConfig Element (startOnInitialization Attribute) of the deployment document for the application being started.

Returns:
boolean
See Also:
ProducerConfig

getProducerIdUrl


public final java.lang.String getProducerIdUrl()

setProducerIdUrl


public final void setProducerIdUrl(java.lang.String url)

incrementMessageSequence


public final int incrementMessageSequence()

setMessageSeq


public final void setMessageSeq(int seq)

getMessageSeq


public final int getMessageSeq()

getProducerStatus


public final java.lang.String getProducerStatus()

setProducerStatus


public final void setProducerStatus(java.lang.String status)

isStarted


public final boolean isStarted()

getConnectionFactoryName


public final java.lang.String getConnectionFactoryName()
Returns the connection factory name (QueueConnectionFactory or TopicConnectionFactory) that this producer should retrieve and use to initialize its connection to the broker with.

See JMS Specification for a description of Connection Factories.

Returns:
String name of the Connection Factory.
See Also:
ProducerConfig

setConnectionFactoryName


public final void setConnectionFactoryName(java.lang.String name)
Sets the connection factory name (QueueConnectionFactory or TopicConnectionFactory) that this producer should retrieve and use to initialize its connection to the broker with.

See JMS Specification for a description of Connection Factories.

See Also:
ProducerConfig

getDestinationName


public final java.lang.String getDestinationName()
Returns the destination name (Queue or Topic) that this Producer should connect to and consume from.

See JMS Specification for a description of Destinations.

See Also:
ProducerConfig

setDestinationName


public final void setDestinationName(java.lang.String name)
Sets the destination name (Queue or Topic) that this Producer should connect to and consume from.

See JMS Specification for a description of Destinations.

See Also:
ProducerConfig

setUserName


public final void setUserName(java.lang.String in)
Sets the broker user name that should be used when establishing a connection with the broker. Typically, this is specified in the ConnectionFactory used by this Producers and it is not needed here. However, if you don't want to use the ConnectionFactory for this you can do it here by specifying it in the ProducerConfig Element in the deployment document.

See Also:
ProducerConfig

getUserName


public final java.lang.String getUserName()
Returns the broker user name that should be used when establishing a connection with the broker. Typically, this is specified in the ConnectionFactory used by this Producers and it is not needed here. However, if you don't want to use the ConnectionFactory for this you can do it here by specifying it in the ProducerConfig Element in the deployment document.

See Also:
ProducerConfig

setPassword


public final void setPassword(java.lang.String in)
Sets the broker user password that should be used when establishing a connection with the broker. Typically, this is specified in the ConnectionFactory used by this Producer and it is not needed here. However, if you don't want to use the ConnectionFactory for this you can do it here by specifying it in the ProducerConfig Element in the deployment document.

See Also:
ProducerConfig

getPassword


public final java.lang.String getPassword()
Sets the broker user password that should be used when establishing a connection with the broker. Typically, this is specified in the ConnectionFactory used by this Producer and it is not needed here. However, if you don't want to use the ConnectionFactory for this you can do it here by specifying it in the ProducerConfig Element in the deployment document.

See Also:
ProducerConfig

setProviderUrl


public final void setProviderUrl(java.lang.String in)
Sets the location where the administered objects can be retrieved from. To maintain broker independance, this should reference a location in a Directory server or some other JNDI resource.

See Also:
ProducerConfig

getProviderUrl


public final java.lang.String getProviderUrl()
Returns the location where the administered objects can be retrieved from. To maintain broker independance, this should reference a location in a Directory server or some other JNDI resource.

See Also:
ProducerConfig

setInitialContextFactory


public final void setInitialContextFactory(java.lang.String in)
Sets the class name of the JNDI context factory that will be used to retrieve the JMS administered objects from a Directory Server or wherever the administered objects are stored.

Typically, this is com.sun.jndi.ldap.LdapCtxFactory.

See Also:
ConsumerConfig

getInitialContextFactory


public final java.lang.String getInitialContextFactory()
Returns the class name of the JNDI context factory that will be used to retrieve the JMS administered objects from a Directory Server or wherever the administered objects are stored.

Typically, this is com.sun.jndi.ldap.LdapCtxFactory.

See Also:
ProducerConfig

getInitialContext


protected javax.naming.directory.DirContext getInitialContext()
                                                       throws javax.naming.NamingException
Establishes and returns an InitialContext to be used by the calling application to retrieve ConnectionFactories and Destination objects via JNDI.

Properties included:

Returns:
DirContext the InitialContext object established
javax.naming.NamingException

init


protected void init(java.util.Properties props)
             throws java.io.IOException
Takes the Properties object contained within the ProducerConfig object passed to the constructor of this Producer and sets all the appropriate instance variables on this producer during initialization.

Throws:
java.io.IOException - if errors occur populating the instance variables from the Properties object.


Copyright © 2002, OpenEAI Software Foundation