|
FreeHEP API Version current |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object hep.aida.ref.remote.basic.BasicTreeClient
This is Basic implementation of AidaTreeClient that support both "Duplex" and "non-Duplex" modes of communication with the AIDA Tree server. In "Duplex" mode AidaTreeServant call stateChanged() method to notify BasicTreeClient about updates/changes in the server-side AIDA tree. In "non-Duplex" mode BasicTreeClient runs as a separate thread and periodically calls updates() method of AidaTreeServant to get information about updates/changes in the server-side AIDA tree. BasicTreeClient also implements IMutableStore, so it can be used as a Store for any IDevTree.
Field Summary | |
protected String |
clientID
|
protected boolean |
duplex
|
protected boolean |
isConnected
|
protected boolean |
keepUpdating
|
protected UpdatableQueue |
queue
|
protected AidaTreeServant |
servant
|
protected AidaTreeServer |
server
|
protected IDevMutableStore |
store
|
protected long |
updateInterval
|
Constructor Summary | |
BasicTreeClient()
Creates a new instance of BasicTreeClient. |
|
BasicTreeClient(IDevMutableStore store)
|
|
BasicTreeClient(IDevMutableStore store,
boolean duplex)
|
Method Summary | |
boolean |
connect()
Make initial connection to the AidaTreeServer. |
protected void |
connectDuplex()
Retrieves Duplex AidaTreeServant from the AidaTreeServer. |
protected void |
connectNonDuplex()
Retrieves non-Duplex AidaTreeServant from the AidaTreeServer. |
boolean |
disconnect()
Disconnect from the AidaTreeServer and free all resources associated with it. |
Object |
find(String path)
Get the data for IManagedObject, at a given path in the ITree. |
protected AidaTreeServer |
getServer()
Retrieves reference to the AidaTreeServer. |
protected void |
init()
|
boolean |
isConnected()
Return true if AidaTreeClient is already connected to the AidaTreeServer |
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 |
setDuplex(boolean duplex)
Set duplex mode. |
void |
setUpdateTime(long updateInterval)
Set time interval (in milliseconds) for AidaTreeClient to check for updates. |
void |
stateChanged(UpdateEvent[] events)
In this implementation stateChanged(UpdateEvent[] events) method simply schedules updates in the UpdatableQueue. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected AidaTreeServer server
protected AidaTreeServant servant
protected IDevMutableStore store
protected UpdatableQueue queue
protected boolean duplex
protected boolean isConnected
protected long updateInterval
protected boolean keepUpdating
protected String clientID
Constructor Detail |
public BasicTreeClient()
public BasicTreeClient(IDevMutableStore store)
public BasicTreeClient(IDevMutableStore store, boolean duplex)
Method Detail |
protected void init()
protected AidaTreeServer getServer()
public void setUpdateTime(long updateInterval)
public void setDuplex(boolean duplex)
protected void connectDuplex() throws AidaConnectionException
AidaConnectionException
protected void connectNonDuplex() throws AidaConnectionException
AidaConnectionException
public String[] listObjectNames(String path) throws IllegalArgumentException
AidaTreeClient
listObjectNames
in interface AidaTreeClient
IllegalArgumentException
- if path does not exist.public String[] listObjectTypes(String path) throws IllegalArgumentException
AidaTreeClient
listObjectTypes
in interface AidaTreeClient
IllegalArgumentException
- if path does not exist.public Object find(String path) throws IllegalArgumentException
AidaTreeClient
find
in interface AidaTreeClient
IllegalArgumentException
- if path does not exist, or path does
not point to a directory.public void stateChanged(UpdateEvent[] events)
stateChanged
in interface AidaTreeClient
public boolean isConnected()
AidaTreeClient
isConnected
in interface AidaTreeClient
public boolean connect() throws AidaConnectionException
AidaTreeClient
connect
in interface AidaTreeClient
AidaConnectionException
public boolean disconnect()
AidaTreeClient
disconnect
in interface AidaTreeClient
public void run()
run
in interface Runnable
public static void main(String[] args)
|
FreeHEP API Version current |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |