FreeHEP API
Version v1.2.2

hep.aida.ref.remote
Class RemoteServerQueue

java.lang.Object
  |
  +--hep.aida.ref.remote.RemoteServerQueue
All Implemented Interfaces:
Runnable

public class RemoteServerQueue
extends Object
implements Runnable

This is thread-safe queue for UpdateEvents. Events can be accumulated in the queue and then retrieved in one chunk. Mainly used on the server side. If client != null new thread will be started with this queue to send updates to the client.

Author:
serbo

Field Summary
protected  AidaTreeClient client
           
protected  boolean keepRunning
           
protected  List queue
           
 
Constructor Summary
RemoteServerQueue()
          Creates a new instance of UpdatableQueue
RemoteServerQueue(AidaTreeClient client)
           
 
Method Summary
protected  void addToQueue(AidaUpdateEvent event)
          This method adds event to the queue and does some cleanup, like remove multiple update events for the same path, etc.
 void close()
          Once the RemoteServerQueue is closed, it can not be restarted again.
 AidaUpdateEvent[] getEvents()
          Returns the array of events that are currently in the queue.
 void run()
          In Duplex mode sends updates to AidaTreeClient
 void schedule(AidaUpdateEvent event)
          Add events to the queue.
 int size()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

client

protected AidaTreeClient client

queue

protected List queue

keepRunning

protected boolean keepRunning
Constructor Detail

RemoteServerQueue

public RemoteServerQueue()
Creates a new instance of UpdatableQueue


RemoteServerQueue

public RemoteServerQueue(AidaTreeClient client)
Method Detail

close

public void close()
Once the RemoteServerQueue is closed, it can not be restarted again.


size

public int size()

schedule

public void schedule(AidaUpdateEvent event)
Add events to the queue.


getEvents

public AidaUpdateEvent[] getEvents()
Returns the array of events that are currently in the queue. Also deletes those events from the queue. Never returns null.


addToQueue

protected void addToQueue(AidaUpdateEvent event)
This method adds event to the queue and does some cleanup, like remove multiple update events for the same path, etc.


run

public void run()
In Duplex mode sends updates to AidaTreeClient

Specified by:
run in interface Runnable

FreeHEP API
Version v1.2.2

Copyright © 2000-2003 FreeHEP, All Rights Reserved.