|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Progressor
Brillien represents the probelms of real world as a free communications' flow. Components have 3 roles basically: start, receive communication and alter during communications This interface define all state management behaviors which belongs to altering part of its roles. Every components has a logical state codomain describing the possible being state. It' logical level, responsible to add an abstraction layer to the communication flow, like coloring in dataflow languages. Multiple states could be present simultaneously. The amount of multiple state is defined ridigly and in unchangeably way, so a specific component has allways n state independently the vitality of a state in a specific communication. The static state list means a list of locks technically, and the behavior of a component should be devided by these locks to ensure the maximum effectivity regarding its processes. So the lock are some kind of dusjunct variables and the states are the possible value range. * As the component uses several lock just the affected behaviors are locked, other behaviors could flow smoothly. By default, every Progressor define 3 built-in lock: CALLABLE_LOCK_INDEX, SERVICES_LOCK_INDEX, DEFAULT_LOCK. The CALLABLE_LOCK is responsible for the state collecting all Sensor behaviors, last lock in the list The SERVICES_LOCK is responsible for the state collecting all Aspirer behaviors, last lock in the list before the CALLABLE_LOCK The DEFAULT_LOCK is responsible for the state collecting all other behaviors, first lock in the list of locks Another feature: every state altering could indicate new communication flows via the built-in notification system. Every Progressor take registration regarding a specific state flow and make notifications to the registered listeners in case of that altering
Method Summary | ||
---|---|---|
void |
addState(State state)
Adds a new State into the statemachine |
|
void |
changeState(State from,
State to)
Induces internal state change. |
|
|
getActualStates()
Gets actual states; the list size is equal to locks' count and contains the "state" of the locks. |
|
|
getPotentialStates()
Gets all potential states of a specific component |
|
StateDivision |
getStateDivision()
Gets the StateDivision object to check the validity of all state transitions |
|
boolean |
hasStateMachine()
|
|
void |
initStateMashine()
Initializes the state space of a Progressor |
|
boolean |
isInExitState()
Tells whether the given component's state space contains only exit states or not |
|
boolean |
isInState(State state)
Tells whether the given component's state space contains the given state or not |
|
boolean |
isInValidStates()
Tells whether this component's state space is convenient for a given scope or not |
|
void |
panic(String message)
Makes this Progressor to panic. |
|
void |
registerStateChangeNotification(State state,
String recipient)
Any Sensor object can register to a specific state modification |
|
void |
removeState(State state)
Removes a State from the statemachine |
|
void |
setStateDivision(StateDivision stateDivision)
Sets the StateDivision object to check the validity of all state transitions |
|
void |
unregisterStateChangeNotification(State state,
String recipient)
Any Sensor object can unregister from a specific state altering takes place |
Method Detail |
---|
boolean hasStateMachine()
void initStateMashine()
<T extends State> Collection<T> getPotentialStates()
boolean isInValidStates()
boolean isInExitState()
boolean isInState(State state)
<T extends State> Collection<T> getActualStates()
StateDivision getStateDivision()
void setStateDivision(StateDivision stateDivision)
stateDivision
- StateDevision objectvoid changeState(State from, State to) throws BrillienException
from
- actual state to be changedto
- new state
BrillienException
- in any case of errorvoid addState(State state) throws BrillienException
BrillienException
- in any case of errorvoid removeState(State state) throws BrillienException
BrillienException
- in any case of errorvoid registerStateChangeNotification(State state, String recipient) throws BrillienException
state
- the state to be listenedrecipient
- the entity who need to notified when a notification would be sent induced by a state change
BrillienException
- in any error case LogicException is thrownvoid unregisterStateChangeNotification(State state, String recipient) throws BrillienException
state
- the state to be listenedrecipient
- the entity who need to notified when a notification would be sent induced by a state change
BrillienException
- in any error case LogicException is thrownvoid panic(String message)
message
- cause of the panic
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |