FreeHEP API
Version current

hep.aida.ref.remote
Class RemoteServerQueue

java.lang.Object
  extended byhep.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
Source Code:
RemoteServerQueue.java

Field Summary
protected  boolean blocking
           
protected  Object blockingLock
           
protected  AidaTreeClient client
           
protected  boolean hold
           
protected  List holdQueue
           
protected  boolean keepRunning
           
protected  List queue
           
protected  Logger remoteLogger
           
 
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 can do some cleanup, like remove multiple update events for the same path (not implemented yet), 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.
 boolean isBlocking()
           
 void run()
          In Duplex mode sends updates to AidaTreeClient
 void schedule(AidaUpdateEvent event)
          Add events to the queue.
 void setBlocking(boolean b)
           
 void setHold(boolean h)
           
 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

holdQueue

protected List holdQueue

keepRunning

protected boolean keepRunning

blocking

protected boolean blocking

blockingLock

protected Object blockingLock

hold

protected boolean hold

remoteLogger

protected Logger remoteLogger
Constructor Detail

RemoteServerQueue

public RemoteServerQueue()
Creates a new instance of UpdatableQueue


RemoteServerQueue

public RemoteServerQueue(AidaTreeClient client)
Method Detail

setBlocking

public void setBlocking(boolean b)

isBlocking

public boolean isBlocking()

close

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


setHold

public void setHold(boolean h)

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 can do some cleanup, like remove multiple update events for the same path (not implemented yet), etc.


run

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

Specified by:
run in interface Runnable

FreeHEP API
Version current

Copyright © 2000-2004 FreeHEP, All Rights Reserved.