com.vii.brillien.kernel.axiom
Interface Progressor

All Known Subinterfaces:
CharacteristicFunction<P,C,R>, Commander<P,C,R>, Context<P,C,R>, EquivalenceRelation<P,C,R>, Flow<P,C,R>, OrderRelation<P,C,R>, Presence<C,R>, Presence<C,R>, PresenceManager<P,C>, Unit<P,C,R>

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.
<T extends State>
Collection<T>
getActualStates()
          Gets actual states; the list size is equal to locks' count and contains the "state" of the locks.
<T extends State>
Collection<T>
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

hasStateMachine

boolean hasStateMachine()
Returns:
Decides whether this component has states acting as a definite state machine

initStateMashine

void initStateMashine()
Initializes the state space of a Progressor


getPotentialStates

<T extends State> Collection<T> getPotentialStates()
Gets all potential states of a specific component


isInValidStates

boolean isInValidStates()
Tells whether this component's state space is convenient for a given scope or not


isInExitState

boolean isInExitState()
Tells whether the given component's state space contains only exit states or not


isInState

boolean isInState(State state)
Tells whether the given component's state space contains the given state or not


getActualStates

<T extends State> Collection<T> getActualStates()
Gets actual states; the list size is equal to locks' count and contains the "state" of the locks.


getStateDivision

StateDivision getStateDivision()
Gets the StateDivision object to check the validity of all state transitions


setStateDivision

void setStateDivision(StateDivision stateDivision)
Sets the StateDivision object to check the validity of all state transitions

Parameters:
stateDivision - StateDevision object

changeState

void changeState(State from,
                 State to)
                 throws BrillienException
Induces internal state change.

Parameters:
from - actual state to be changed
to - new state
Throws:
BrillienException - in any case of error

addState

void addState(State state)
              throws BrillienException
Adds a new State into the statemachine

Throws:
BrillienException - in any case of error

removeState

void removeState(State state)
                 throws BrillienException
Removes a State from the statemachine

Throws:
BrillienException - in any case of error

registerStateChangeNotification

void registerStateChangeNotification(State state,
                                     String recipient)
                                     throws BrillienException
Any Sensor object can register to a specific state modification

Parameters:
state - the state to be listened
recipient - the entity who need to notified when a notification would be sent induced by a state change
Throws:
BrillienException - in any error case LogicException is thrown

unregisterStateChangeNotification

void unregisterStateChangeNotification(State state,
                                       String recipient)
                                       throws BrillienException
Any Sensor object can unregister from a specific state altering takes place

Parameters:
state - the state to be listened
recipient - the entity who need to notified when a notification would be sent induced by a state change
Throws:
BrillienException - in any error case LogicException is thrown

panic

void panic(String message)
Makes this Progressor to panic. This adds ERROR-type State to its statespace.

Parameters:
message - cause of the panic


Copyright © 2012. All Rights Reserved.