it.amattioli.workstate.core
Class ReferenceState

Show UML class diagram
java.lang.Object
  extended by it.amattioli.workstate.core.State
      extended by it.amattioli.workstate.core.RealState
          extended by it.amattioli.workstate.core.ReferenceState
All Implemented Interfaces:
AttributeHandler, AttributeReader, Receiver

public class ReferenceState
extends RealState

A ReferenceState is a state that represents a reference to another state machine.

Author:
a.mattioli

Constructor Summary
ReferenceState(MetaReferenceState metaState, CompositeState parent, Configuration refReader)
          Build a new reference state.
 
Method Summary
 boolean admitEvent(Event event)
           
 Event buildEvent(String name, Map<String,Object> stringParameters)
           
 void enter()
          Enter this state and activate it.
 void exit()
          Exit a state and de-activate it.
protected  StateMemento getMemento(StateMemento parent)
           
 boolean isComplete()
           
 void receive(Visitor visitor)
           
 void receiveEvent(Event event)
           
protected  void reEnter()
          Re-enter a state that was exited for exception handling purposes.
protected  void reExit()
          Re-exit a state that was entered for exception handling purposes.
 void restore(StateMemento memento)
           
 void terminate()
           
 
Methods inherited from class it.amattioli.workstate.core.RealState
addAllAttributes, equals, getAllAttributes, getAttribute, getLocalAttributes, getTag, hasAllowedAttribute, hasOwnAttribute, setAttribute, toString
 
Methods inherited from class it.amattioli.workstate.core.State
addAvailableEvents, checkActive, findAncestor, getAvailableEvents, getId, getMemento, getParent, getRootMachine, hasMetaState, isActive, isRegion
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ReferenceState

public ReferenceState(MetaReferenceState metaState,
                      CompositeState parent,
                      Configuration refReader)
Build a new reference state.

Parameters:
metaState - the MetaState
parent - the parent state
refReader - the configuration of the referenced machine
Method Detail

receiveEvent

public void receiveEvent(Event event)
                  throws WorkflowException
Specified by:
receiveEvent in class State
Throws:
WorkflowException

admitEvent

public boolean admitEvent(Event event)
Specified by:
admitEvent in class State

getMemento

protected StateMemento getMemento(StateMemento parent)
Specified by:
getMemento in class State

receive

public void receive(Visitor visitor)

enter

public void enter()
           throws WorkflowException
Description copied from class: State
Enter this state and activate it.

Overrides:
enter in class RealState
Throws:
WorkflowException

reEnter

protected void reEnter()
Description copied from class: State
Re-enter a state that was exited for exception handling purposes.

Overrides:
reEnter in class RealState

exit

public void exit()
          throws WorkflowException
Description copied from class: State
Exit a state and de-activate it.

Overrides:
exit in class RealState
Throws:
WorkflowException

reExit

protected void reExit()
Description copied from class: State
Re-exit a state that was entered for exception handling purposes.

Overrides:
reExit in class RealState

buildEvent

public Event buildEvent(String name,
                        Map<String,Object> stringParameters)
                 throws WorkflowException
Overrides:
buildEvent in class State
Throws:
WorkflowException

terminate

public void terminate()
               throws WorkflowException
Throws:
WorkflowException

isComplete

public boolean isComplete()

restore

public void restore(StateMemento memento)
             throws WorkflowException
Overrides:
restore in class RealState
Throws:
WorkflowException


Copyright © 2011. All Rights Reserved.