WebLogic Server 6.0 Code Examples, BEA Systems, Inc.

examples.jms.trader
Class TraderReceive

java.lang.Object
  |
  +--examples.jms.trader.TraderReceive

public class TraderReceive
extends java.lang.Object

Receives messages and invokes an EJBean to process them.

Author:
Copyright (c) 1999-2000 by BEA Systems, Inc. All Rights Reserved.

Field Summary
static java.lang.String EJB_HOME
          Defines EJB stateless session.
static java.lang.String JMS_FACTORY
          Defines JMS connection factory.
static java.lang.String JNDI_FACTORY
          Defines JNDI context factory.
static java.lang.String TOPIC
          Defines JMS topic.
static java.lang.String TX
          Defines JTA user transaction.
 
Constructor Summary
TraderReceive()
           
 
Method Summary
 void close()
          Closes JMS objects.
 void init(javax.naming.Context ctx, java.lang.String topicName)
          Creates all the necessary objects for receiving messages from a JMS topic.
static void main(java.lang.String[] args)
          main() method.
 void processMessages()
          Message listener interface.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EJB_HOME

public static final java.lang.String EJB_HOME
Defines EJB stateless session.

JMS_FACTORY

public static final java.lang.String JMS_FACTORY
Defines JMS connection factory.

JNDI_FACTORY

public static final java.lang.String JNDI_FACTORY
Defines JNDI context factory.

TOPIC

public static final java.lang.String TOPIC
Defines JMS topic.

TX

public static final java.lang.String TX
Defines JTA user transaction.
Constructor Detail

TraderReceive

public TraderReceive()
Method Detail

close

public void close()
           throws javax.jms.JMSException
Closes JMS objects.
Throws:
javax.jms.JMSException - if JMS fails to close objects due to internal error

init

public void init(javax.naming.Context ctx,
                 java.lang.String topicName)
          throws javax.naming.NamingException,
                 javax.jms.JMSException,
                 java.rmi.RemoteException,
                 javax.ejb.CreateException
Creates all the necessary objects for receiving messages from a JMS topic. The session is transacted so that calling the EJB occurs in the same transaction as dequeueing the message.
Parameters:
ctx - JNDI initial context
topicName - name of topic
Throws:
javax.naming.NamingException - if problem with JNDI context interface
javax.jms.JMSException - if JMS fails during initialization due to an internal error
java.rmi.RemoteException - if problem occurs during remote operation
javax.ejb.CreateException - if problem occurs during creation

main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception
main() method.
Parameters:
args - WebLogic URL
Throws:
java.lang.Exception - if problem occurs

processMessages

public void processMessages()
Message listener interface.

Documentation is available at
http://e-docs.bea.com/wls/docs60

Copyright © 2000 BEA Systems, Inc. All Rights Reserved.