org.jboss.test.timer.ejb
Class OnCreateTimerMessageBean

java.lang.Object
  extended byorg.jboss.test.timer.ejb.OnCreateTimerMessageBean
All Implemented Interfaces:
EnterpriseBean (src) , MessageDrivenBean (src) , MessageListener (src) , java.io.Serializable, TimedObject (src)

public class OnCreateTimerMessageBean
extends java.lang.Object
implements MessageDrivenBean (src) , MessageListener (src) , TimedObject (src)

An MDB that obtains the TimerService during the ejbCreate callback. A timer is created in onMessage using this TimerService. It delays for 1 seconds and continues once a second for 10 seconds.

See Also:
Serialized Form

Constructor Summary
OnCreateTimerMessageBean()
           
 
Method Summary
 void ejbCreate()
           
 void ejbRemove()
          A container invokes this method before it ends the life of the message-driven object.
 void ejbTimeout(Timer (src)  timer)
          Invoked by the EJB container upon timer expiration.
 void initTimer(int msgID, Queue (src)  replyTo)
           
 void onMessage(Message (src)  message)
          Passes a message to the listener.
 void setMessageDrivenContext(MessageDrivenContext (src)  ctx)
          Set the associated message-driven context.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OnCreateTimerMessageBean

public OnCreateTimerMessageBean()
Method Detail

setMessageDrivenContext

public void setMessageDrivenContext(MessageDrivenContext (src)  ctx)
                             throws EJBException (src) 
Description copied from interface: MessageDrivenBean (src)

Set the associated message-driven 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.

Specified by:
setMessageDrivenContext in interface MessageDrivenBean (src)
Parameters:
ctx - - A MessageDrivenContext interface for the instance.
Throws:
EJBException (src) - - Thrown by the method to indicate a failure caused by a system-level error.

ejbCreate

public void ejbCreate()

ejbTimeout

public void ejbTimeout(Timer (src)  timer)
Description copied from interface: TimedObject (src)
Invoked by the EJB container upon timer expiration.

Specified by:
ejbTimeout in interface TimedObject (src)
Parameters:
timer - Timer whose expiration caused this notification

ejbRemove

public void ejbRemove()
               throws EJBException (src) 
Description copied from interface: MessageDrivenBean (src)

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 MessageDrivenBean (src)
Throws:
EJBException (src) - - Thrown by the method to indicate a failure caused by a system-level error.

onMessage

public void onMessage(Message (src)  message)
Description copied from interface: MessageListener (src)
Passes a message to the listener.

Specified by:
onMessage in interface MessageListener (src)
Parameters:
message - the message passed to the listener

initTimer

public void initTimer(int msgID,
                      Queue (src)  replyTo)