edu.rice.rubis.beans
Class MDB_StoreComment

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

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

This is a stateless session bean used to create e new comment for a user.

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

Constructor Summary
MDB_StoreComment()
           
 
Method Summary
 void createComment(int fromId, int toId, int itemId, int rating, java.lang.String comment)
          Create a new comment and update the rating of the user.
 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.
 void onMessage(javax.jms.Message message)
           
 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_StoreComment

public MDB_StoreComment()
Method Detail

onMessage

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

createComment

public void createComment(int fromId,
                          int toId,
                          int itemId,
                          int rating,
                          java.lang.String comment)
                   throws java.rmi.RemoteException
Create a new comment and update the rating of the user.
Parameters:
fromId - id of the user posting the comment
toId - id of the user who is the subject of the comment
itemId - id of the item related to the comment
rating - value of the rating for the user
comment - text of the comment
Since:
1.1

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.