solar.test
Class ClockSource

java.lang.Object
  |
  +--solar.service.dan.GraphNode
        |
        +--solar.service.dan.Source
              |
              +--solar.test.ClockSource
All Implemented Interfaces:
DanConstants, Identifiable

public class ClockSource
extends Source

A source periodically publishes events containing current timestamp.

Version:
$Id: ClockSource.java,v 1.12 2003/09/26 19:47:18 glchen Exp $
Author:
Guanling Chen

Field Summary
protected  int _sleep
           
 
Fields inherited from class solar.service.dan.GraphNode
_gid
 
Fields inherited from interface solar.service.dan.DanConstants
DAN_INPORT, DAN_OUTPORT
 
Constructor Summary
ClockSource(int sleep)
           
 
Method Summary
 java.lang.Object handleQuery(Request query)
          Handle the query being actively pulled by downstream operators.
static void main(java.lang.String[] args)
          Start the clock source and advertise a name for it.
 void run()
          The execution body of this source.
 
Methods inherited from class solar.service.dan.Source
getInputPorts, handleEvent
 
Methods inherited from class solar.service.dan.GraphNode
getId, getOutputPorts, handleEvent, handleQuery, init, init, publish, publish, setId
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_sleep

protected int _sleep
Constructor Detail

ClockSource

public ClockSource(int sleep)
Method Detail

run

public void run()
         throws java.lang.Exception
Description copied from class: Source
The execution body of this source.

Specified by:
run in class Source
java.lang.Exception

handleQuery

public java.lang.Object handleQuery(Request query)
                             throws java.lang.Exception
Description copied from class: GraphNode
Handle the query being actively pulled by downstream operators.

Specified by:
handleQuery in class GraphNode
java.lang.Exception

main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception
Start the clock source and advertise a name for it. Command line usage:

-host tahoe -port 5470 -name "[source=clock]"

java.lang.Exception