WebLogic Server 6.0 Code Examples, BEA Systems, Inc.

examples.time
Class ClientTimer

java.lang.Object
  |
  +--examples.time.ClientTimer
All Implemented Interfaces:
weblogic.time.common.Schedulable, weblogic.time.common.Triggerable

public class ClientTimer
extends java.lang.Object
implements weblogic.time.common.Schedulable, weblogic.time.common.Triggerable

This class illustrates use of client-side timers. By defining a "schedule" method and a "trigger" method, a scheduled recurring action can be established. Note that the "schedule" method is called for in each rescheduling operation, allowing arbitrarily complex scheduling semantics. In this example, the timer starts out at a 0 second delay, but with each event, the delay is increased by 1 second. When it reaches 10, the trigger is cancelled.

Assuming that the server is running on port 7001 of the local machine, you would run this example using the following command:

  java examples.time.ClientTimer t3://localhost:7001

Author:
Copyright (c) 1996-2000 by BEA Systems, Inc. All Rights Reserved.

Constructor Summary
ClientTimer(weblogic.common.T3ServicesDef services)
           
 
Method Summary
static void main(java.lang.String[] argv)
          This application connects to the WebLogic Server, and sets up a client-side scheduled trigger (a recurring action).
 long schedule(long t)
           
 void trigger(weblogic.time.common.Schedulable sched)
           
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClientTimer

public ClientTimer(weblogic.common.T3ServicesDef services)
Method Detail

main

public static void main(java.lang.String[] argv)
                 throws java.lang.Exception
This application connects to the WebLogic Server, and sets up a client-side scheduled trigger (a recurring action). The main thread waits until the timer is cancelled.

schedule

public long schedule(long t)
Specified by:
schedule in interface weblogic.time.common.Schedulable

trigger

public void trigger(weblogic.time.common.Schedulable sched)
Specified by:
trigger in interface weblogic.time.common.Triggerable

Documentation is available at
http://e-docs.bea.com/wls/docs60

Copyright © 2000 BEA Systems, Inc. All Rights Reserved.