nl.justobjects.pushlet.core
Class EventPullSource

java.lang.Object
  extended by nl.justobjects.pushlet.core.EventPullSource
All Implemented Interfaces:
java.lang.Runnable, EventSource
Direct Known Subclasses:
TestEventPullSources.AEXStocksEventPullSource, TestEventPullSources.PingEventPullSource, TestEventPullSources.PushletStatusEventPullSource, TestEventPullSources.SystemStatusEventPullSource, TestEventPullSources.TemperatureEventPullSource, TestEventPullSources.TestEventPullSource, TestEventPullSources.WebPresentationEventPullSource

public abstract class EventPullSource
extends java.lang.Object
implements EventSource, java.lang.Runnable

ABC for specifc EventPullSources.


Field Summary
private  boolean active
           
private  boolean alive
           
private  java.lang.Thread thread
           
private static int threadNum
           
 
Constructor Summary
EventPullSource()
           
 
Method Summary
 void activate()
          Activate the event generator thread.
protected abstract  long getSleepTime()
           
 boolean isAlive()
           
 void passivate()
          Deactivate the event generator thread.
protected abstract  Event pullEvent()
           
 void run()
          Main loop: sleep, generate event and publish.
 void start()
           
 void stop()
          Stop the event generator thread.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

alive

private volatile boolean alive

active

private volatile boolean active

threadNum

private static int threadNum

thread

private java.lang.Thread thread
Constructor Detail

EventPullSource

public EventPullSource()
Method Detail

getSleepTime

protected abstract long getSleepTime()

pullEvent

protected abstract Event pullEvent()

start

public void start()

isAlive

public boolean isAlive()

stop

public void stop()
Stop the event generator thread.

Specified by:
stop in interface EventSource

activate

public void activate()
Activate the event generator thread.

Specified by:
activate in interface EventSource

passivate

public void passivate()
Deactivate the event generator thread.

Specified by:
passivate in interface EventSource

run

public void run()
Main loop: sleep, generate event and publish.

Specified by:
run in interface java.lang.Runnable


Copyright 2000-2003 - Just Objects B.V.