Sun Adapter for TCP/IP HL7

com.stc.connector.tcpip.model.schedule
Class TimerTaskScheduler

java.lang.Object
  extended by com.stc.connector.tcpip.model.schedule.TimerTaskScheduler
All Implemented Interfaces:
Scheduler

public class TimerTaskScheduler
extends java.lang.Object
implements Scheduler

RA task scheduler (based on Timer Service) for exchange/communication.

Version:
cvs revision: $Revision: 1.5 $ Last Modified: $Date: 2008/03/03 15:36:00 $
Author:
Harry Liu

Field Summary
static java.lang.String version
           
 
Fields inherited from interface com.stc.connector.tcpip.model.schedule.Scheduler
TYPE_TIMER_SERVICE, TYPE_WORK_MANAGER
 
Constructor Summary
TimerTaskScheduler(java.util.Timer timer, Schedule schedule)
          Constructor for TimerTaskScheduler.
 
Method Summary
 void cancel()
           
 void schedule(Task task)
           
 void schedule(java.util.TimerTask timerTask)
          Method schedule.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

version

public static final java.lang.String version
See Also:
Constant Field Values
Constructor Detail

TimerTaskScheduler

public TimerTaskScheduler(java.util.Timer timer,
                          Schedule schedule)
                   throws java.lang.IllegalArgumentException
Constructor for TimerTaskScheduler. If the passed-in schedule is with a positive repeatedPeriod, the task will be treated as a repeatedSchedule, so the task will be executed repeatedly; If the passed-in schedule is with a non-positive repeatedPeriod, the task will be treated as an onetimeSchedule, so the task will be executed one time.

Parameters:
timer - Timer
schedule - Schedule
Throws:
java.lang.IllegalArgumentException - on error
Method Detail

schedule

public void schedule(java.util.TimerTask timerTask)
Method schedule.

Parameters:
timerTask - TimerTask

schedule

public void schedule(Task task)
Specified by:
schedule in interface Scheduler
Parameters:
task - task to schedule
See Also:
Scheduler.schedule(com.stc.connector.tcpip.model.schedule.Task)

cancel

public void cancel()
Specified by:
cancel in interface Scheduler
See Also:
Scheduler.cancel()

Sun Adapter for TCP/IP HL7