org.objectweb.jonas.jtests.beans.message
Class SenderSF

org.objectweb.jonas.jtests.beans.message.SenderSF

public class SenderSF


Field Summary
protected static org.objectweb.util.monolog.api.Logger logger
           
 
Constructor Summary
SenderSF()
           
 
Method Summary
 int check(int val, int nb, int sec)
          Checking send methods
 void clean(int val)
          Clean all entity beans for this value
 void ejbActivate()
          A container invokes this method when the instance is taken out of the pool of available instances to become associated with a specific EJB object.
 void ejbCreate()
          The Session bean must define 1 or more ejbCreate methods.
 void ejbPassivate()
          A container invokes this method on an instance before the instance becomes disassociated with a specific EJB object.
 void ejbRemove()
          A container invokes this method before it ends the life of the session object.
 void sendOnQueue(java.lang.String dest, int val, int nb)
          send a message on queue
 void sendOnQueueTx(java.lang.String dest, int val, int nb)
          send messages on queue (transacted)
 void sendOnTopic(java.lang.String dest, int val, int nb)
          send a message on topic
 void sendOnTopicTx(java.lang.String dest, int val, int nb)
          send messages on topic (transacted)
 void setSessionContext(javax.ejb.SessionContext ctx)
          Set the associated session context.
 

Field Detail

logger

protected static org.objectweb.util.monolog.api.Logger logger
Constructor Detail

SenderSF

public SenderSF()
Method Detail

setSessionContext

public void setSessionContext(javax.ejb.SessionContext ctx)
Set the associated session context. The container calls 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.
Parameters:
sessionContext - A SessionContext interface for the instance.
Throws:
EJBException - Thrown by the method to indicate a failure caused by a system-level error.

ejbRemove

public void ejbRemove()
A container invokes this method before it ends the life of the session object. This happens as a result of a client's invoking a remove operation, or when a container decides to terminate the session object after a timeout. This method is called with no transaction context.
Throws:
EJBException - Thrown by the method to indicate a failure caused by a system-level error.

ejbCreate

public void ejbCreate()
               throws javax.ejb.CreateException
The Session bean must define 1 or more ejbCreate methods.
Throws:
CreateException - Failure to create a session EJB object.

ejbPassivate

public void ejbPassivate()
A container invokes this method on an instance before the instance becomes disassociated with a specific EJB object.

ejbActivate

public void ejbActivate()
A container invokes this method when the instance is taken out of the pool of available instances to become associated with a specific EJB object.

sendOnTopic

public void sendOnTopic(java.lang.String dest,
                        int val,
                        int nb)
send a message on topic
Parameters:
String - destination
int - value set in message
int - nb of messages sent

sendOnTopicTx

public void sendOnTopicTx(java.lang.String dest,
                          int val,
                          int nb)
send messages on topic (transacted)
Parameters:
String - destination
int - value set in message
int - nb of messages sent

sendOnQueue

public void sendOnQueue(java.lang.String dest,
                        int val,
                        int nb)
send a message on queue
Parameters:
String - destination
int - value set in message
int - nb of messages sent

sendOnQueueTx

public void sendOnQueueTx(java.lang.String dest,
                          int val,
                          int nb)
send messages on queue (transacted)
Parameters:
String - destination
int - value set in message
int - nb of messages sent

check

public int check(int val,
                 int nb,
                 int sec)
Checking send methods
Parameters:
int - value looked in messages received
int - nb of messages that could be received
int - nb of seconds max to wait for all messages
Returns:
actual nb of messages received

clean

public void clean(int val)
Clean all entity beans for this value