com.ibm.websphere.samples.asynchbeans.wstrader.pricegen
Class PriceHeartBeatAlarm

java.lang.Object
  extended by com.ibm.websphere.samples.asynchbeans.wstrader.pricegen.PriceHeartBeatAlarm
All Implemented Interfaces:
com.ibm.websphere.asynchbeans.AlarmListener

public class PriceHeartBeatAlarm
extends java.lang.Object
implements com.ibm.websphere.asynchbeans.AlarmListener

An asynchronous Alarm that fires at a given interval and posts a Ping message on a queue


Constructor Summary
PriceHeartBeatAlarm(int interval_ms, javax.jms.Topic topic)
          Create a PricePublisherAlarm.
 
Method Summary
 void fired(com.ibm.websphere.asynchbeans.Alarm alarm)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PriceHeartBeatAlarm

public PriceHeartBeatAlarm(int interval_ms,
                           javax.jms.Topic topic)
                    throws java.rmi.RemoteException,
                           javax.jms.JMSException
Create a PricePublisherAlarm. The alarm will fire, publishing ticker information to a JMS Topic. The information and instructions on the ticker symbol, price information and how the price changes is included in the data parameter. The topic connection is reestablished each time the alarm is fired instead of storing it when this alarm is constructed. This must be done because the topic connection would be associated with the container that created the alarm and not with the alarm itself.

Parameters:
interval_ms - the number of milliseconds to wait between ticks.
topic - the JMS Topic to publish the ping messages on
Throws:
java.rmi.RemoteException
javax.jms.JMSException
Method Detail

fired

public void fired(com.ibm.websphere.asynchbeans.Alarm alarm)
Specified by:
fired in interface com.ibm.websphere.asynchbeans.AlarmListener
See Also:
AlarmListener.fired(Alarm)