FreeHEP API
Version current

hep.aida.ref.remote
Class RemoteServant

java.lang.Object
  extended byhep.aida.ref.remote.RemoteServant
All Implemented Interfaces:
AIDAListener, AidaTreeServant

public class RemoteServant
extends Object
implements AidaTreeServant, AIDAListener

This is implementation of the AidaTreeServant. It mainly deals with the Tree and Tree Objects - change in Tree structure, updates of Tree Objects' Data, etc. This class does not have any remote transport layer (RMI, CORBA, etc.), so special adapter classes, like RmiRemoteServant, are used to provide such functionality. The default for useValidation = true;

Author:
serbo
Source Code:
RemoteServant.java

Field Summary
protected  boolean blocking
           
protected  Logger remoteLogger
           
protected  boolean useValidation
           
 
Constructor Summary
RemoteServant(IDevTree tree, AidaTreeClient client)
           
RemoteServant(IDevTree tree, String clientID)
          Creates a new instance of RemoteServant
 
Method Summary
 void close()
          Close all connections and release all allocated resources.
 Object find(String path)
          Just return an IManagedObject itself.
 boolean getAppendAxisType()
           
protected  void init()
           
 boolean isBlocking()
           
 String[] listObjectNames(String path, boolean recursive)
          Get the list of names of the IManagedObjects under a given path, including directories (but not "." and "..").
 String[] listObjectTypes(String path, boolean recursive)
          Get the list of types of the IManagedObjects under a given path.
 void setAppendAxisType(boolean a)
           
 void setBlocking(boolean b)
           
 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 path)
           
 void setValid(String[] path)
          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)
          Mainly this method translates Tree, DataPointSet, Histogram, etc.
 AidaUpdateEvent[] updates()
          This method can be called by AidaTreeClient to get list of current updates.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

blocking

protected boolean blocking

useValidation

protected boolean useValidation

remoteLogger

protected Logger remoteLogger
Constructor Detail

RemoteServant

public RemoteServant(IDevTree tree,
                     String clientID)
Creates a new instance of RemoteServant


RemoteServant

public RemoteServant(IDevTree tree,
                     AidaTreeClient client)
Method Detail

setAppendAxisType

public void setAppendAxisType(boolean a)

getAppendAxisType

public boolean getAppendAxisType()

setBlocking

public void setBlocking(boolean b)

isBlocking

public boolean isBlocking()

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()
Close all connections and release all allocated resources.


setValid

public void setValid(String path)

find

public Object find(String path)
Just return an IManagedObject itself. Later the transport layer class (like RmiRemoteServant) will have to extract the data from the IManagedObject and send the data over the network.

Specified by:
find in interface AidaTreeServant

listObjectNames

public String[] listObjectNames(String path,
                                boolean recursive)
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,
                                boolean recursive)
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[] path)
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 AidaUpdateEvent[] updates()
Description copied from interface: AidaTreeServant
This method can be called by AidaTreeClient to get list of current updates.

Specified by:
updates in interface AidaTreeServant

stateChanged

public void stateChanged(EventObject ev)
Mainly this method translates Tree, DataPointSet, Histogram, etc. event into AidaUpdateEvent. Also add event to the queue.

Specified by:
stateChanged in interface AIDAListener

FreeHEP API
Version current

Copyright © 2000-2004 FreeHEP, All Rights Reserved.