com.evelopers.unimod.core.stateworks
Class ControlledObjectHandler

java.lang.Object
  extended bycom.evelopers.unimod.core.ModelElement
      extended bycom.evelopers.unimod.core.stateworks.ClassElement
          extended bycom.evelopers.unimod.core.stateworks.ControlledObjectHandler
All Implemented Interfaces:
java.io.Serializable

public class ControlledObjectHandler
extends ClassElement

Class ControlledObjectHandler is a container for Controlled Object implementation. During design phase it contain only reference to real implementation. During runtime getObject method instantiates implementation class and return it. Such approach let you do not bother about controlled object implementation during design.

Can have only incoming associations from state machine. On state chart diagram of state machine A controlled object is referenced by supplierRole of association between A and controlled object.

Underlining controlled object implementation must implement all input and output actions according with state machine structure. If some transition has label [o10.x4]/o10.z1, so controlled object implementation with supplier role o10 must implement input action x4 and output action z1 with a help of methods

 public boolean x4(StateMachineContext context) throws SomeException {...}
 public void z1(StateMachineContext context) throws SomeException {...}
 

See Also:
Serialized Form

Field Summary
static java.lang.String CONTROLLED_OBJECT_STEREOTYPE
           
 
Fields inherited from class com.evelopers.unimod.core.stateworks.ClassElement
IMPL_NAME_PROPERTY, implName, INCOMING_ASSOCIATIONS_PROPERTY, incomingAssociations, OUTGOING_ASSOCIATIONS_PROPERTY, outgoingAssociations
 
Fields inherited from class com.evelopers.unimod.core.ModelElement
listeners, name, NAME_PROPERTY, stereotype, STEREOTYPE_PROPERTY
 
Constructor Summary
protected ControlledObjectHandler(java.lang.String objectName, java.lang.String implementationClassName)
          Creates controlled object handler with given name and implementation class.
 
Method Summary
protected  void addIncomingAssociation(Association association)
          Prohibits to add incoming association from sources other then state machine.
protected  void addOutgoingAssociation(Association association)
          Prohibits to add any outgoing associations
 boolean equals(java.lang.Object o)
          Compare with another model element.
 void setImplName(java.lang.String implName)
          Just publishes protected method of base class.
 
Methods inherited from class com.evelopers.unimod.core.stateworks.ClassElement
getImplName, getIncomingAssociations, getOutgoingAssociations, hashCode, removeIncomingAssociation, removeOutgoingAssociation, toString
 
Methods inherited from class com.evelopers.unimod.core.ModelElement
accept, addPropertyChangeListener, firePropertyChange, getName, getStereotype, initListeners, removePropertyChangeListener, setName, setStereotype
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

CONTROLLED_OBJECT_STEREOTYPE

public static final java.lang.String CONTROLLED_OBJECT_STEREOTYPE
See Also:
Constant Field Values
Constructor Detail

ControlledObjectHandler

protected ControlledObjectHandler(java.lang.String objectName,
                                  java.lang.String implementationClassName)
Creates controlled object handler with given name and implementation class. Sets stereotype to CONTROLLED_OBJECT_STEREOTYPE.

Parameters:
objectName - object name (e.g. o1 or o10)
implementationClassName - implementation object class (e.g. "com.evelopers.co.Connection")
Method Detail

addOutgoingAssociation

protected void addOutgoingAssociation(Association association)
Prohibits to add any outgoing associations

Overrides:
addOutgoingAssociation in class ClassElement
Throws:
java.lang.UnsupportedOperationException - if called

addIncomingAssociation

protected void addIncomingAssociation(Association association)
Prohibits to add incoming association from sources other then state machine.

Overrides:
addIncomingAssociation in class ClassElement
Throws:
java.lang.IllegalArgumentException - if association source is not a state machine

setImplName

public void setImplName(java.lang.String implName)
Just publishes protected method of base class.

Overrides:
setImplName in class ClassElement

equals

public boolean equals(java.lang.Object o)
Description copied from class: ModelElement
Compare with another model element.

Overrides:
equals in class ClassElement