edu.rice.rubis.beans
Class MDB_BrowseCategories

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

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

This is a message driven bean used to get the list of categories from database and return the information to the BrowseCategories servlet.

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

Constructor Summary
MDB_BrowseCategories()
           
 
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 getCategories(java.lang.String regionName, java.lang.String username, java.lang.String password)
          List all the categories in the database
 void onMessage(javax.jms.Message message)
           
 java.lang.String printCategory(java.lang.String name, int id)
          Display category information for the BrowseCategories servlet
 java.lang.String printCategoryByRegion(java.lang.String name, int id, int regionId)
          Display category information for the BrowseCategories servlet
 java.lang.String printCategoryToSellItem(java.lang.String name, int id, int userId)
          Display category information for the BrowseCategories 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_BrowseCategories

public MDB_BrowseCategories()
Method Detail

onMessage

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

getCategories

public java.lang.String getCategories(java.lang.String regionName,
                                      java.lang.String username,
                                      java.lang.String password)
                               throws java.rmi.RemoteException
List all the categories in the database

printCategory

public java.lang.String printCategory(java.lang.String name,
                                      int id)
Display category information for the BrowseCategories servlet
Returns:
a String containing HTML code
Since:
1.0

printCategoryByRegion

public java.lang.String printCategoryByRegion(java.lang.String name,
                                              int id,
                                              int regionId)
Display category information for the BrowseCategories servlet
Returns:
a String containing HTML code
Since:
1.0

printCategoryToSellItem

public java.lang.String printCategoryToSellItem(java.lang.String name,
                                                int id,
                                                int userId)
Display category information for the BrowseCategories servlet
Returns:
a String containing HTML code
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.