|
WebLogic Server 7.0 Code Examples, BEA Systems, Inc. | |||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||
java.lang.Object | +--examples.jms.messageformat.MessageTraderBean
This class reads the XML data from a JMS queue, parses it and and
calls the statefulSession.TraderBean EJB to actually
perform the stock trade transaction. The class then puts the output
of the trade on another JMS queue.
| Field Summary | |
static java.lang.StringBuffer |
buffer
|
static java.lang.String |
JMS_FACTORY
Defines the JMS connection factory for the queue. |
static java.lang.String |
JNDI_FACTORY
|
static java.lang.String |
QUEUE
Defines the queue. |
| Constructor Summary | |
MessageTraderBean()
|
|
| Method Summary | |
void |
close()
Closes all JMS objects. |
void |
ejbActivate()
This method is not used by this example. |
void |
ejbCreate()
This method is not used by this example. |
void |
ejbPassivate()
This method is not used by this example. |
void |
ejbRemove()
This method is not used by this example. |
void |
init(javax.naming.Context ctx,
java.lang.String queueName)
Creates all the necessary objects for sending messages to a JMS queue. |
void |
onMessage(javax.jms.Message msg)
Retrieves the XML data from the first JMS queue then parses the data using a SAX parser. |
(package private) static void |
p(java.lang.String s)
|
void |
send(java.lang.String message)
Sends a message in the form of XML data to a JMS queue. |
void |
setMessageDrivenContext(javax.ejb.MessageDrivenContext ctx)
Sets the session context. |
| Methods inherited from class java.lang.Object |
|
| Field Detail |
public static final java.lang.StringBuffer buffer
public static final java.lang.String JMS_FACTORY
public static final java.lang.String JNDI_FACTORY
public static final java.lang.String QUEUE
| Constructor Detail |
public MessageTraderBean()
| Method Detail |
public void close()
throws javax.jms.JMSException
javax.jms.JMSException - if JMS fails to close objects due to internal errorpublic void ejbActivate()
public void ejbCreate()
throws javax.ejb.CreateException
public void ejbPassivate()
public void ejbRemove()
ejbRemove in interface javax.ejb.MessageDrivenBean
public void init(javax.naming.Context ctx,
java.lang.String queueName)
throws javax.naming.NamingException,
javax.jms.JMSException
ctx - JNDI initial contextqueueName - name of queuejavax.naming.NamingException - if operation cannot be performedjavax.jms.JMSException - if JMS fails to initialize due to internal errorpublic void onMessage(javax.jms.Message msg)
Trader stateful Session EJB to perform the actual
trade on the data. Finally, this method creates a new XML
message which will be sent to a second JMS queue.onMessage in interface javax.jms.MessageListenermsg - the JMS messagestatic void p(java.lang.String s)
public void send(java.lang.String message)
throws javax.jms.JMSException
message - the String message to be sent to the JMS queuepublic void setMessageDrivenContext(javax.ejb.MessageDrivenContext ctx)
setMessageDrivenContext in interface javax.ejb.MessageDrivenBeanctx - MessageDrivenContext Context for session
|
Documentation is available at http://e-docs.bea.com/wls/docs70 |
|||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||