radtools.services
Class AbstractRADService

java.lang.Object
  extended by rcf.core.framework.component.DynamicComponent.Abstract
      extended by radtools.services.AbstractRADService
All Implemented Interfaces:
RADService, DynamicBound, DynamicComponent, ReflectedBindable<DynamicComponent>, ReflectedComponent, rcf.core.util.accessor.GUIAccessible
Direct Known Subclasses:
AbstractLinuxHostedRADService, AbstractNetworkTunnel, AbstractRemoteRADService, ComposedRADService, LinuxSession, RADTools

@Revision(value="$Revision: 1.15 $",
          date="$Date: 2006/12/16 05:18:20 $",
          tag="$Name:  $")
public abstract class AbstractRADService
extends DynamicComponent.Abstract
implements RADService

TODO: Javadoc

TODO: Unit tests, Code review, Javadoc review, Seal/Finalize TODO: equals, hashCode, toString

Version:
$Revision: 1.15 $
Author:
Greg Gibeling

Nested Class Summary
 class AbstractRADService.AbstractRADServiceState
          TODO: Javadoc
 class AbstractRADService.RefreshTask
          TODO: Javadoc
protected  class AbstractRADService.StateProxy
          TODO: Javadoc
 class AbstractRADService.UpdateTask
          TODO: Javadoc
 
Nested classes/interfaces inherited from interface radtools.services.RADService
RADService.State
 
Nested classes/interfaces inherited from interface rcf.core.framework.component.DynamicComponent
DynamicComponent.Abstract, DynamicComponent.Default
 
Nested classes/interfaces inherited from interface rcf.core.framework.component.DynamicBound
DynamicBound.GUIType
 
Field Summary
protected  rcf.core.util.tree.Node<RADService,?,?,?,?,?> composition
          TODO: Javadoc
protected  rcf.core.util.tree.Node<RADService,?,?,?,?,?> dependency
          TODO: Javadoc
protected  rcf.core.util.tree.Node<RADService,?,?,?,?,?> management
          TODO: Javadoc
protected  StrongReference<EventSink<? super DynamicPropertyEvent>> proxy
          TODO: Javadoc
protected  AbstractRADService.AbstractRADServiceState state
          TODO: Javadoc
protected  JFrame window
          TODO: Javadoc
 
Fields inherited from class rcf.core.framework.component.DynamicComponent.Abstract
component, operations, properties
 
Constructor Summary
protected AbstractRADService(RADService _management, RADService _dependency, RADService _composition)
          TODO: Javadoc
 
Method Summary
 void check()
          TODO: Javadoc Check on the state of the actual service this object represents, and update the state of this object to match.
 rcf.core.util.graph.Vertex<RADService,?,?,?,?,?> communication()
          Get the vertex containing this RADService, in the comminications graph.
 rcf.core.util.tree.Node<RADService,?,?,?,?,?> composition()
          Get the tree node containing this RADService, whose parent is the RADService which is built out of this one.
 rcf.core.util.tree.Node<RADService,?,?,?,?,?> dependency()
          Get the tree node containing this RADService, whose parent is the RADService which must be RADService.State.Running in order for this service to be running.
 Icon icon()
           
 rcf.core.util.tree.Node<RADService,?,?,?,?,?> management()
          Get the tree node containing this RADService, whose parent is the RADService which must be RADService.State.Running in order to manage this service at all.
 RADTools radTools()
          TODO: Javadoc
 void refresh()
          Schedule an update of the state of this object, from the state of the actual service it represents.
 void update(boolean schedule, RADService.State _state)
          Update the actual service to match the state held by this object.
 void window()
          Popup the automatically generated window containing controls for the various DynamicComponent.properties() and DynamicComponent.operations() supported by not only this interface, but by any other component interfaces implemented by any specific RADService object.
 
Methods inherited from class rcf.core.framework.component.DynamicComponent.Abstract
bind, component, gui, interfaces, isInstance, o, operations, popupMenu, properties
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface radtools.services.RADService
isConcrete, radServiceState
 
Methods inherited from interface rcf.core.framework.component.DynamicComponent
component, operations, properties
 
Methods inherited from interface rcf.core.framework.component.DynamicBound
gui
 
Methods inherited from interface rcf.core.util.accessor.GUIAccessible
popupMenu
 
Methods inherited from interface rcf.core.framework.component.ReflectedComponent
interfaces, isInstance
 
Methods inherited from interface rcf.core.framework.component.ReflectedBindable
bind
 

Field Detail

composition

protected final rcf.core.util.tree.Node<RADService,?,?,?,?,?> composition
TODO: Javadoc


dependency

protected final rcf.core.util.tree.Node<RADService,?,?,?,?,?> dependency
TODO: Javadoc


management

protected final rcf.core.util.tree.Node<RADService,?,?,?,?,?> management
TODO: Javadoc


proxy

protected StrongReference<EventSink<? super DynamicPropertyEvent>> proxy
TODO: Javadoc


state

protected AbstractRADService.AbstractRADServiceState state
TODO: Javadoc


window

protected volatile JFrame window
TODO: Javadoc

Constructor Detail

AbstractRADService

protected AbstractRADService(RADService _management,
                             RADService _dependency,
                             RADService _composition)
TODO: Javadoc

Parameters:
_management -
_dependency -
Method Detail

check

public void check()
TODO: Javadoc Check on the state of the actual service this object represents, and update the state of this object to match. This method should rarely be called directly.


communication

public rcf.core.util.graph.Vertex<RADService,?,?,?,?,?> communication()
Description copied from interface: RADService
Get the vertex containing this RADService, in the comminications graph. Edges in this graph represent communications, and can be tagged with the type: e.g. RPC versus dataflow. This graph is not currently implemented but would provide significant benefits especially in conjunction with path based analysis or, for example, StarTrace.

TODO: Javadoc

Specified by:
communication in interface RADService
Returns:
The communications graph vertex containing this RADService.

composition

public rcf.core.util.tree.Node<RADService,?,?,?,?,?> composition()
Description copied from interface: RADService
Get the tree node containing this RADService, whose parent is the RADService which is built out of this one. The composition tree is meant to capture e.g. that a website is built out of a webserver, some application logic and a database.

Specified by:
composition in interface RADService
Returns:
The composition tree node containing this RADService.
See Also:
radtools

dependency

public rcf.core.util.tree.Node<RADService,?,?,?,?,?> dependency()
Description copied from interface: RADService
Get the tree node containing this RADService, whose parent is the RADService which must be RADService.State.Running in order for this service to be running. The dependency tree is meant to capture e.g. that a virtual machine cannot be running if the physical machine it is hosted by is not running, or that the physical machine depends on a UPS or power strip.

Dependencies for information should be modelled through the communication graph, and composition of services through the composition tree.

Specified by:
dependency in interface RADService
Returns:
The dependency tree node containing this RADService.
See Also:
radtools

icon

public Icon icon()
Specified by:
icon in interface rcf.core.util.accessor.GUIAccessible
Overrides:
icon in class DynamicComponent.Abstract

management

public final rcf.core.util.tree.Node<RADService,?,?,?,?,?> management()
Description copied from interface: RADService
Get the tree node containing this RADService, whose parent is the RADService which must be RADService.State.Running in order to manage this service at all. The management tree is meant to capture e.g. that the management of a machine depends on an SSH session, which might itself depend on an SSH tunnel.

Specified by:
management in interface RADService
Returns:
The management tree node containing this RADService.
See Also:
radtools

radTools

public RADTools radTools()
TODO: Javadoc

Returns:

refresh

public void refresh()
Description copied from interface: RADService
Schedule an update of the state of this object, from the state of the actual service it represents. In objects which inherit from AbstractRADService, this will schedule a call to check() using RADTools.schedule(rcf.core.concurrent.schedule.TimerTask).

Specified by:
refresh in interface RADService

update

public void update(boolean schedule,
                   RADService.State _state)
Description copied from interface: RADService
Update the actual service to match the state held by this object. This method can either schedule an update or perform one immediately. This is necessary to avoid running a comparatively expensive update operation as part of the simple event handler for GUI events.

Specified by:
update in interface RADService
Parameters:
schedule - Should the update be scheduled, or performed immediately?
_state - The new state to update this RADService to.

window

public void window()
Description copied from interface: RADService
Popup the automatically generated window containing controls for the various DynamicComponent.properties() and DynamicComponent.operations() supported by not only this interface, but by any other component interfaces implemented by any specific RADService object.

Two calls to this method, will display the same window, rather than generating a new one.

Specified by:
window in interface RADService