org.iids.aos.gui.services
Class ServiceWrapper

java.lang.Object
  extended by org.iids.aos.gui.services.ServiceWrapper
Direct Known Subclasses:
AgentServerWrapper, AgentWrapper, HostManagerWrapper, KernelWrapper, LocationManagerWrapper, LookupWrapper

public abstract class ServiceWrapper
extends java.lang.Object

Author:
rjtimmer

Constructor Summary
protected ServiceWrapper()
           
 
Method Summary
 java.util.List<ServiceWrapper> getChildren()
          Obtain all children of this service using Struct tree.
 ServiceWrapper getParent()
          Obtain parent service wrapper.
 Struct getStruct()
          Obtains the struct that this service references to.
 boolean isLocal()
           
protected  void setLocal(boolean local)
           
 void setStruct(Struct s)
          Connect this service to a struct.
abstract  void shutdown()
           
 void unbindStruct()
          Unbinds the Struct corresponding to this service.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ServiceWrapper

protected ServiceWrapper()
Method Detail

setStruct

public void setStruct(Struct s)
Connect this service to a struct. When a service is connected to a struct, it means that it has a place in the tree hierarchy, and thus can have a parent/children.

After the struct was set, the service is also registered with the struct (for a two-way reference). This goes by means of the function Struct.setService(org.iids.aos.gui.services.ServiceWrapper). Beware of recursion when calling this function from a struct, as a struct may attempt to update the service again at the same time recursively (it does).

If a struct was already set, this function does nothing.


unbindStruct

public void unbindStruct()
Unbinds the Struct corresponding to this service.


getStruct

public Struct getStruct()
Obtains the struct that this service references to.

Returns:
null if not bound to a Struct.

getChildren

public java.util.List<ServiceWrapper> getChildren()
Obtain all children of this service using Struct tree.


getParent

public ServiceWrapper getParent()
Obtain parent service wrapper. Uses Struct tree to find parent.

Returns:
The parent of this service, or null if none.

setLocal

protected void setLocal(boolean local)

isLocal

public boolean isLocal()

shutdown

public abstract void shutdown()


Copyright © 2003, 2004 IIDS Group. All Rights Reserved.