Framework Professional Edition Package


org.mbs.services.cu
Interface ControlUnit

All Known Subinterfaces:
ManagedControlUnit
All Known Implementing Classes:
DefaultControlUnit, DeviceControlUnit, TokenControlUnit, TokenDeviceControlUnit

public interface ControlUnit

Control Unit is a object which provides formal representation of a certain resource (device, software or hardware components, etc.) so it can be managed in a uniform way by different applications.
The public interface of the Control Unit is represented by a set of valued attributes called state variables and set of operations called actions.
A Control Unit instance is characterized by its type and id. The type of a Control Unit defines its allowed set of state variables and actions. The id of the Control Unit instance identifies it uniquely in the scope of its type.
A Control Unit instance can be exported (made available) to the management applications either by registering ManagedControlUnit, which represents single control unit instance or by registering a ControlUnitFactory service, which maintains a set of Control Unit instances of the same type.
Control Units may be arranged hierarchically - every control unit instance may have one or more sub control units and one or more parent control units. The implementors of the Control Units must avoid cycles in the Control Unit hierarchy. Organizing Control Units may be convenient for logical grouping of Control Units, but is especially useful for representing more complex resources - devices, hardware and software systems, which may be decomposed to a hierarchy of sub-components, achieving arbitrary level of granularity.

Author:
Valentin Valchev , Stoyan Zoubev

Method Summary
 java.lang.String getId()
          Returns id of the control unit which uniquely identifies it in the scope of its parent.
 java.lang.String getType()
          Returns type of the control unit.
 java.lang.Object invokeAction(java.lang.String actionID, java.lang.Object arguments)
          Executes the specified action over this control unit.
 java.lang.Object queryStateVariable(java.lang.String stateVariableID)
          Returns the value of a specified state variable.
 

Method Detail

getId

java.lang.String getId()
Returns id of the control unit which uniquely identifies it in the scope of its parent.

Returns:
the id of the control unit

getType

java.lang.String getType()
Returns type of the control unit.

Returns:
the type of the control unit

queryStateVariable

java.lang.Object queryStateVariable(java.lang.String stateVariableID)
Returns the value of a specified state variable. State variables supported by a control unit and their types are defined by the metadata of the control unit.

Parameters:
stateVariableID - the id of the variable
Returns:
value of the variable
Throws:
java.lang.IllegalArgumentException - if this control unit does not have a state variable with the given id

invokeAction

java.lang.Object invokeAction(java.lang.String actionID,
                              java.lang.Object arguments)
                              throws java.lang.Exception
Executes the specified action over this control unit. Actions supported by a control unit and the number and types of the input and output arguments of each action are defined by the metadata of the control unit.

Parameters:
actionID - the id of the action
arguments - the input argument(s). If the argument is only one this is the argument itself. If the arguments are more then one, the value must be a Object[] and arguments are retrieved from that array.
Returns:
the output argument(s) or null if the action does not return value.
Throws:
java.lang.Exception - if an error occurs while executing action.
java.lang.IllegalArgumentException - if this control unit does not have action with the supplied Id or the arguments number and/or types do not match the action arguments.

Framework Professional Edition Package


Copyright © 1999-2007 ProSyst Software GmbH. All Rights Reserved