FreeHEP API
Version current

hep.aida.ref.remote.basic
Class BasicTreeServant

java.lang.Object
  extended byjava.lang.Thread
      extended byhep.aida.ref.remote.basic.BasicTreeServant
All Implemented Interfaces:
AIDAListener, AidaTreeServant, Runnable

public class BasicTreeServant
extends Thread
implements AidaTreeServant, AIDAListener

Basic implementation of the AidaTreeServant, no remote stuff.

Author:
serbo
Source Code:
BasicTreeServant.java

Field Summary
protected  AidaTreeClient client
           
protected  String clientID
           
protected  boolean duplex
           
protected  boolean keepRunning
           
protected  ServerQueue queue
           
protected  Vector sources
           
protected  hep.aida.ITree tree
           
protected  boolean useValidation
           
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
BasicTreeServant(hep.aida.ITree tree, AidaTreeClient client)
           
BasicTreeServant(hep.aida.ITree tree, String clientID)
          Creates a new instance of BasicTreeServant
 
Method Summary
 void close()
           
 Object find(String path)
          Get the IManagedObject, at a given path in the ITree.
protected  void init()
           
 String[] listObjectNames(String path)
          Get the list of names of the IManagedObjects under a given path, including directories (but not "." and "..").
 String[] listObjectTypes(String path)
          Get the list of types of the IManagedObjects under a given path.
static void main(String[] args)
           
 void run()
           
 void setUseValidation(boolean state)
          If useValidation = true, client has to call "setValid" method after receiving update from the ManagedObject in order to reseive next update.
 void setValid(String[] paths)
          This method can be called by AidaTreeClient to tell AidaTreeServant that it is ready to receive information about changes/updates of particular set of IManagedObjects.
 void stateChanged(EventObject ev)
          Create new UpdateEvent from the EventObject and put it in the queue of current updates.
 UpdateEvent[] updates()
          This method can be used only in non-Duplex mode.
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

tree

protected hep.aida.ITree tree

client

protected AidaTreeClient client

clientID

protected String clientID

duplex

protected boolean duplex

keepRunning

protected boolean keepRunning

sources

protected Vector sources

queue

protected ServerQueue queue

useValidation

protected boolean useValidation
Constructor Detail

BasicTreeServant

public BasicTreeServant(hep.aida.ITree tree,
                        String clientID)
Creates a new instance of BasicTreeServant


BasicTreeServant

public BasicTreeServant(hep.aida.ITree tree,
                        AidaTreeClient client)
Method Detail

init

protected void init()

setUseValidation

public void setUseValidation(boolean state)
If useValidation = true, client has to call "setValid" method after receiving update from the ManagedObject in order to reseive next update. If useValidation = false, client receives all updates.


close

public void close()

find

public Object find(String path)
Description copied from interface: AidaTreeServant
Get the IManagedObject, at a given path in the ITree. The path is an absolute path from the ITree root.

Specified by:
find in interface AidaTreeServant

listObjectNames

public String[] listObjectNames(String path)
Description copied from interface: AidaTreeServant
Get the list of names of the IManagedObjects under a given path, including directories (but not "." and ".."). Directories end with "/". The returned names are appended to the given path unless the latter is "." The path is an absolute path from the ITree root.

Specified by:
listObjectNames in interface AidaTreeServant

listObjectTypes

public String[] listObjectTypes(String path)
Description copied from interface: AidaTreeServant
Get the list of types of the IManagedObjects under a given path. The types are the leaf class of the Interface, e.g. "IHistogram1D", "ITuple", etc. Directories are marked with "dir". The order of the types is the same as the order for the listObjectNames() method to achieve a one-to-one correspondance between object names and types. The path is an absolute path from the ITree root.

Specified by:
listObjectTypes in interface AidaTreeServant

setValid

public void setValid(String[] paths)
Description copied from interface: AidaTreeServant
This method can be called by AidaTreeClient to tell AidaTreeServant that it is ready to receive information about changes/updates of particular set of IManagedObjects.

Specified by:
setValid in interface AidaTreeServant

updates

public UpdateEvent[] updates()
This method can be used only in non-Duplex mode. Never returns null.

Specified by:
updates in interface AidaTreeServant

stateChanged

public void stateChanged(EventObject ev)
Create new UpdateEvent from the EventObject and put it in the queue of current updates. This method is called by "IsObservable" sources to report their change of state.

Specified by:
stateChanged in interface AIDAListener

run

public void run()
Specified by:
run in interface Runnable

main

public static void main(String[] args)

FreeHEP API
Version current

Copyright © 2000-2004 FreeHEP, All Rights Reserved.