|
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.DefaultControlUnitFactory
public class DefaultControlUnitFactory
This is the default implementation of
ControlUnitFactory interface.
| Field Summary | |
|---|---|
protected CUAdminCallback |
callback
|
protected java.lang.String |
type
|
| Constructor Summary | |
|---|---|
DefaultControlUnitFactory(java.lang.String type)
|
|
| Method Summary | |
|---|---|
protected void |
addControlUnit(ControlUnit controlUnit)
This method should be called if a new control unit should be provided by the factory. |
java.lang.String |
createControlUnit(java.lang.String constructorId,
java.lang.Object arguments)
Always returns null. |
void |
destroyControlUnit(java.lang.String controlUnitId)
Does nothing. |
protected void |
fillDefaultProperties(java.util.Dictionary props)
This method is invoked when service is registed. |
protected ControlUnit |
findControlUnit(java.lang.String controlUnitId)
Returns the control unit object with the given id. |
java.lang.String[] |
findControlUnits(java.lang.String finderId,
java.lang.Object arguments)
Returns always null. |
ControlUnit |
getControlUnit(java.lang.String controlUnitId)
Returns the ControlUnit object, identified by the given id. |
java.lang.String[] |
getControlUnits(java.lang.String parentType,
java.lang.String parentId)
Returns ids of the control unit instances which are children of a control unit with a given type and id. |
java.lang.String[] |
getParents(java.lang.String childId,
java.lang.String parentType)
Returns the ids of the parents of a given control unit specified by its id. |
java.lang.String[] |
getParentTypes(java.lang.String childId)
|
java.lang.String |
getType()
|
java.lang.Object |
invokeAction(java.lang.String controlUnitId,
java.lang.String actionId,
java.lang.Object arguments)
Executes the specified action over a control unit with specified id. |
java.lang.String[] |
listControlUnits()
Returns the ids of all control units currently exported by this factory. |
java.lang.Object |
queryStateVariable(java.lang.String controlUnitId,
java.lang.String varId)
Queries a control unit with a specified id for the value of the specified state variable. |
protected void |
removeControlUnit(ControlUnit controlUnit)
This method should be called if a control unit should be provided no more by the factory. |
protected void |
removeControlUnit(java.lang.String controlUnitId)
This method should be called if a control unit should be provided no more by the factory. |
void |
setControlUnitCallback(CUAdminCallback callback)
Supplies the Control Unit admin callback interface to the implementation of the ControlUnitFactory 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 |
|---|
protected java.lang.String type
protected CUAdminCallback callback
| Constructor Detail |
|---|
public DefaultControlUnitFactory(java.lang.String type)
| Method Detail |
|---|
public void setControlUnitCallback(CUAdminCallback callback)
ControlUnitFactoryControlUnitFactory service.
null argument
after registration of the ControlUnitFactory service or after startup of
the Control Unit Admin for already registered factories.
null argument during unregistration
of the ControlUnitFactory service or when the Control Unit Admin is stopped.
setControlUnitCallback in interface ControlUnitFactorycallback - reference to the control unit callback interface or null
if previously set reference is not longer valid.org.msb.services.cu.spi.ControlUnitFactory#setControlUnitCallback(org.msb.services.cu.spi.CUAdminFactoryCallback)public java.lang.String getType()
org.msb.services.cu.spi.ControlUnitFactory#getType()public ControlUnit getControlUnit(java.lang.String controlUnitId)
ControlUnitFactoryControlUnit object, identified by the given id.
If there is no such control unit maintained by this factory,
null is returned.
getControlUnit in interface ControlUnitFactorycontrolUnitId - the id of the requested control unit
ControlUnit object with the given id.ControlUnitFactory.getControlUnit(java.lang.String)
public java.lang.String[] getControlUnits(java.lang.String parentType,
java.lang.String parentId)
ControlUnitFactory
getControlUnits in interface ControlUnitFactoryparentType - type of the parent control unitparentId - id of the parent control unit
org.msb.services.cu.spi.ControlUnitFactory#getControlUnits(java.lang.String, java.lang.String)
public java.lang.Object queryStateVariable(java.lang.String controlUnitId,
java.lang.String varId)
ControlUnitFactory
queryStateVariable in interface ControlUnitFactorycontrolUnitId - the id of the control unit provided by this factoryvarId - the id of the variable
org.msb.services.cu.spi.ControlUnitFactory#queryStateVariable(java.lang.String, java.lang.String)
public java.lang.Object invokeAction(java.lang.String controlUnitId,
java.lang.String actionId,
java.lang.Object arguments)
throws java.lang.Exception
ControlUnitFactory
invokeAction in interface ControlUnitFactorycontrolUnitId - the id of the control unitactionId - the id of the actionarguments - 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 occures while executing action.
java.lang.IllegalArgumentException - if this factory does not have action
with the supplied Id or the arguments number and/or types do not match the
action arguments.ControlUnitFactory.invokeAction(java.lang.String, java.lang.String, java.lang.Object)
public java.lang.String createControlUnit(java.lang.String constructorId,
java.lang.Object arguments)
createControlUnit in interface ControlUnitFactoryconstructorId - the id of the constructors. Must start with "$create.".arguments - - the 'constructors' 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 id of the newly created control unit.
- See Also:
ControlUnitFactory.createControlUnit(java.lang.String, java.lang.Object)public void destroyControlUnit(java.lang.String controlUnitId)
destroyControlUnit in interface ControlUnitFactorycontrolUnitId - control unit id.ControlUnitFactory.destroyControlUnit(java.lang.String)
public java.lang.String[] findControlUnits(java.lang.String finderId,
java.lang.Object arguments)
findControlUnits in interface ControlUnitFactoryfinderId - the id of the finder method. Must start with "$find.".arguments - the finder 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 sub-control units of the specified control unit.
- See Also:
org.msb.services.cu.spi.ControlUnitFactory#findControlUnits(java.lang.String, java.lang.Object)protected ControlUnit findControlUnit(java.lang.String controlUnitId)
null is not possible return value.
protected void addControlUnit(ControlUnit controlUnit)
controlUnit - control unit to be registered to factoryprotected void removeControlUnit(ControlUnit controlUnit)
controlUnit - control unit to be removedIllegalArgumentException - thrown if given control unit
is not provided by the factoryprotected void removeControlUnit(java.lang.String controlUnitId)
controlUnitId - id of the control unit to be removedIllegalArgumentException - thrown if given control unit
is not provided by the factoryprotected void fillDefaultProperties(java.util.Dictionary props)
ServiceObjectprops dictionary.
For control units these default properties are type and id.
fillDefaultProperties in class ServiceObjectprops - dictionary where default properties are stored.ServiceObject.fillDefaultProperties(java.util.Dictionary)public java.lang.String[] listControlUnits()
ControlUnitFactory
listControlUnits in interface ControlUnitFactoryControlUnitFactory.listControlUnits()public java.lang.String[] getParentTypes(java.lang.String childId)
org.mbs.services.cu.spi.ControlUnitFactory#getParentTypes(java.lang.String)
public java.lang.String[] getParents(java.lang.String childId,
java.lang.String parentType)
ControlUnitFactory
getParents in interface ControlUnitFactorychildId - id of the child unitparentType - type of the returned parent units
ControlUnitFactory.getParents(java.lang.String, java.lang.String)
|
Framework Professional Edition Package |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||