WebLogic Server 6.0 Code Examples, BEA Systems, Inc.

examples.jms.trader
Class TraderServlet

java.lang.Object
  |
  +--javax.servlet.GenericServlet
        |
        +--javax.servlet.http.HttpServlet
              |
              +--examples.jms.trader.TraderServlet
All Implemented Interfaces:
java.io.Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig

public class TraderServlet
extends javax.servlet.http.HttpServlet

Sends a buy or sell message to a topic. The TraderReceive client receives the messages and invokes an EJBean to process the messages.

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

Field Summary
static java.lang.String JMS_FACTORY
          Defines JMS connection factory.
static java.lang.String TOPIC
          Defines JMS topic.
 
Constructor Summary
TraderServlet()
           
 
Method Summary
 void printForm(java.io.PrintWriter pw)
          Prints form.
 void sendTopicMessage(java.lang.String customerName, java.lang.String tradeType, java.lang.String symbol, int shares)
          Sends topic message.
 void service(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res)
          service() method.
 
Methods inherited from class javax.servlet.http.HttpServlet
, doDelete, doGet, doOptions, doPost, doPut, doTrace, getLastModified, service
 
Methods inherited from class javax.servlet.GenericServlet
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, init, log, log
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

JMS_FACTORY

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

TOPIC

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

TraderServlet

public TraderServlet()
Method Detail

printForm

public void printForm(java.io.PrintWriter pw)
               throws java.lang.Exception
Prints form.
Parameters:
pw - print writer
Throws:
java.lang.Exception - if problem occurs

sendTopicMessage

public void sendTopicMessage(java.lang.String customerName,
                             java.lang.String tradeType,
                             java.lang.String symbol,
                             int shares)
                      throws javax.naming.NamingException,
                             javax.jms.JMSException
Sends topic message.
Parameters:
customerName - customer name
tradeType - trade type
symbol - symbol
shares - shares
Throws:
javax.naming.NamingException - if problem occurs with JNDI context interface
javax.jms.JMSException - if JMS fails to send topic message due to internal error

service

public void service(javax.servlet.http.HttpServletRequest req,
                    javax.servlet.http.HttpServletResponse res)
             throws java.io.IOException,
                    javax.servlet.ServletException
service() method.
Overrides:
service in class javax.servlet.http.HttpServlet
Parameters:
req - HTTP servlet request
res - HTTP servlet response
Throws:
java.io.IOException - if problem occurs with an I/O operation
javax.servlet.ServletException - if problem occurs with servlet operation

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

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