edu.rice.rubis.beans
Class MDB_BuyNow

java.lang.Object
  |
  +--edu.rice.rubis.beans.MDB_BuyNow
All Implemented Interfaces:
javax.ejb.EnterpriseBean, javax.ejb.MessageDrivenBean, javax.jms.MessageListener, java.io.Serializable

public class MDB_BuyNow
extends java.lang.Object
implements javax.ejb.MessageDrivenBean, javax.jms.MessageListener

This is a stateless session bean used to build the html form to buy an item.

Version:
1.1
Author:
Emmanuel Cecchet and Julie Marguerite
See Also:
Serialized Form

Constructor Summary
MDB_BuyNow()
           
 
Method Summary
 void ejbCreate()
          The Message driven bean must define an ejbCreate methods with no args.
 void ejbRemove()
          A container invokes this method before it ends the life of the message-driven object.
 java.lang.String getBuyNowForm(int itemId, java.lang.String username, java.lang.String password)
          Authenticate the user and get the information to build the html form.
 void onMessage(javax.jms.Message message)
           
 java.lang.String printItemDescriptionToBuyNow(int itemId, java.lang.String itemName, java.lang.String description, float buyNow, int quantity, int sellerId, java.lang.String sellerName, java.lang.String startDate, java.lang.String endDate, int userId)
          Display item information for the Buy Now servlet
 void setMessageDrivenContext(javax.ejb.MessageDrivenContext ctx)
          Set the associated context.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MDB_BuyNow

public MDB_BuyNow()
Method Detail

onMessage

public void onMessage(javax.jms.Message message)
Specified by:
onMessage in interface javax.jms.MessageListener

getBuyNowForm

public java.lang.String getBuyNowForm(int itemId,
                                      java.lang.String username,
                                      java.lang.String password)
                               throws java.rmi.RemoteException
Authenticate the user and get the information to build the html form.
Returns:
a string in html format
Since:
1.1

printItemDescriptionToBuyNow

public java.lang.String printItemDescriptionToBuyNow(int itemId,
                                                     java.lang.String itemName,
                                                     java.lang.String description,
                                                     float buyNow,
                                                     int quantity,
                                                     int sellerId,
                                                     java.lang.String sellerName,
                                                     java.lang.String startDate,
                                                     java.lang.String endDate,
                                                     int userId)
                                              throws java.rmi.RemoteException
Display item information for the Buy Now servlet
Returns:
a String containing HTML code
Throws:
java.rmi.RemoteException - if an error occurs
Since:
1.0

setMessageDrivenContext

public void setMessageDrivenContext(javax.ejb.MessageDrivenContext ctx)
Set the associated context. The container call this method after the instance creation. The enterprise Bean instance should store the reference to the context object in an instance variable. This method is called with no transaction context.
Specified by:
setMessageDrivenContext in interface javax.ejb.MessageDrivenBean
Parameters:
MessageDrivenContext - A MessageDrivenContext interface for the instance.
Throws:
javax.ejb.EJBException - Thrown by the method to indicate a failure caused by a system-level error.

ejbCreate

public void ejbCreate()
The Message driven bean must define an ejbCreate methods with no args.

ejbRemove

public void ejbRemove()
A container invokes this method before it ends the life of the message-driven object. This happens when a container decides to terminate the message-driven object. This method is called with no transaction context.
Specified by:
ejbRemove in interface javax.ejb.MessageDrivenBean
Throws:
javax.ejb.EJBException - Thrown by the method to indicate a failure caused by a system-level error.


Copyright © 2003 - ObjectWeb Consortium - All Rights Reserved.