|
Framework Professional Edition Package |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.mbs.services.cu.generator.ServiceObject
org.mbs.services.cu.generator.DefaultControlUnit
public class DefaultControlUnit
This is implementation of the the main interface of the Control Unit abstraction layer.
| Field Summary | |
|---|---|
static java.lang.String |
ACTION_PREFIX
|
static boolean |
CHECK_INPUT
|
protected java.lang.Object |
controller
the controller used by the ControlUnit to send commands to the control unit |
protected java.util.Dictionary |
controllerMethods
the cached controller methods |
protected ControlUnitModel |
model
the model holding the current state of the control unit |
| Fields inherited from interface org.mbs.services.cu.ControlConstants |
|---|
CONSTRUCTOR_PREFIX, DESTRUCTOR, EVENT_FILTER, EVENT_SYNC, EVENT_TYPE, FINDER_PREFIX, ID, PARENT_ID, PARENT_ROOT, PARENT_TYPE, STATE_VARIABLE_ID, SV_LIST_SV_ID, TYPE, VERSION |
| Constructor Summary | |
|---|---|
DefaultControlUnit(ControlUnitModel model,
java.lang.Object controller)
Instantiate the ControlUnit. |
|
| Method Summary | |
|---|---|
protected void |
checkActionInputArguments(java.lang.String actionId,
java.lang.Object args)
This method is invoked when invoking an action if CHECK_INPUT flag is set. |
protected void |
fillDefaultProperties(java.util.Dictionary props)
This method is invoked when service is registed. |
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 args)
Executes the specified action over this control unit. |
java.lang.Object |
queryStateVariable(java.lang.String svarId)
Returns the value of a specified state variable. |
void |
release()
Release the resources used by this ControlUnit |
void |
setControlUnitCallback(CUAdminCallback callback)
Supplies the Control Unit admin callback interface to the implementation of the ManagedControlUnit service. |
| Methods inherited from class org.mbs.services.cu.generator.ServiceObject |
|---|
registerService, unregisterService |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final boolean CHECK_INPUT
public static final java.lang.String ACTION_PREFIX
protected java.lang.Object controller
protected ControlUnitModel model
protected java.util.Dictionary controllerMethods
| Constructor Detail |
|---|
public DefaultControlUnit(ControlUnitModel model,
java.lang.Object controller)
model - model of the control unitcontroller - controller for the control unit| Method Detail |
|---|
public java.lang.String getType()
ControlUnit
getType in interface ControlUnitorg.msb.services.cu.ControlUnit#getType()public java.lang.String getId()
ControlUnit
getId in interface ControlUnitorg.msb.services.cu.ControlUnit#getId()protected void fillDefaultProperties(java.util.Dictionary props)
props dictionary.
For control units these default properties are type and id.
fillDefaultProperties in class ServiceObjectprops - dictionary where default properties are stored.public void release()
public java.lang.Object invokeAction(java.lang.String actionId,
java.lang.Object args)
throws java.lang.Exception
ControlUnit
invokeAction in interface ControlUnitactionId - the id of the actionargs - 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.
null if the action does not
return value.
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.org.msb.services.cu.ControlUnit#invokeAction(java.lang.String, java.lang.Object)
protected void checkActionInputArguments(java.lang.String actionId,
java.lang.Object args)
CHECK_INPUT flag is set.
By default, this method does nothing.
actionId - id of the control unit actionargs - action input arguments
java.lang.IllegalArgumentException - thrown if an argument is invalidpublic java.lang.Object queryStateVariable(java.lang.String svarId)
ControlUnit
queryStateVariable in interface ControlUnitsvarId - the id of the variable
org.msb.services.cu.ControlUnit#queryStateVariable(java.lang.String)public void setControlUnitCallback(CUAdminCallback callback)
ManagedControlUnitManagedControlUnit service.
null argument
after registration of the ManagedControlUnit service or after startup of
the Control Unit Admin for already registered control units.
null argument during unregistration
of the ManagedControlUnit service or when the Control Unit Admin is stopped.
setControlUnitCallback in interface ManagedControlUnitcallback - reference to the control unit callback interface or null
if previously set reference is not longer valid.org.msb.services.cu.spi.ManagedControlUnit#setControlUnitCallback(org.msb.services.cu.spi.CUAdminCallback)
|
Framework Professional Edition Package |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||