com.vii.brillien.kernel.axiom.atomic
Interface Flow<P extends Presence,C extends Communication,R>

All Superinterfaces:
Aspirer<C,R>, Callable<R>, Context<P,C,R>, Presence<C,R>, Progressor, Sensor<C>, Unit<P,C,R>
All Known Subinterfaces:
Commander<P,C,R>

public interface Flow<P extends Presence,C extends Communication,R>
extends Context<P,C,R>

Flow are the high-level component to provide flow-related functionality. Every component is mandatorly assigned to a flow componen. Flows shows tree structure, refining the overall processes of the given application. According to the specification of the Brillien, there are several services provided by a flow: - sharing - acknowledgement about the commmunication of their components - possible fault handling - etc.


Field Summary
 
Fields inherited from interface com.vii.brillien.kernel.axiom.atomic.Presence
CONSONANT, RESIDENT, SPARKLE
 
Method Summary
 void activate(C c, Long timeout)
          Activates the flow instance, making it started.
 C getActivationData()
          Gets the parameters gotten while the given flow has been activated with.
 String getFlowID()
          Gets the flow ID of the Presence.
<T> T
getFlowResult()
          Returns the result of the flow if it exists
 HashMap<String,Object> getStateSpace()
          This method retrieves the state space of the flow called when the flow will be suspended
 boolean isIndispensable()
          Tells whether this Flow represents an action which cannot fail, so cluster replication is needed.
 boolean isSuspended()
          Tells whether the flow has been suspended.
 void oppress(String message)
          Sets all state of a flow to "Error" state marking it to be terminated.
 void report(Presence reporter, String message)
          Report method to share any communication related information of the components with the container flow instance.
 void report(Presence reporter, String message, List<Object> params)
           
 void revivified()
          Notify the given flow instance about the occured revivfication process.
 Flow<P,C,R> setFlowID(String flowID)
          Setter method for the ID
 void setFlowResult(Object result)
          Sets the result of the flow
 void setIndispensable(boolean indispensable)
          Setter method for an indispensable flow
 void setStateSpace(HashMap<String,Object> stateSpace)
          This method sets the state space of the flow called when the flow will be reactivated
 void suspend()
          All Indispensable flows can be suspended and resumed.
 void terminate()
          Sets all state of a flow to "Exit" state marking it to be terminated.
 
Methods inherited from interface com.vii.brillien.kernel.axiom.atomic.Context
addExceptionLeveling, clearExceptionLeveling, getSharing, getShifter, hasSharing, levelException, registerSharing, removeExceptionLeveling, removeSharing
 
Methods inherited from interface com.vii.brillien.kernel.axiom.atomic.Unit
activateUnitAll, activateUnitCallable, activateUnitMessaging, addPresences, addSubUnits, classify, clearPresences, clearSubUnits, communicationUnitReceived, complement, getCharacteristicFunction, getPresences, getSubUnits, hasUnitActivity, intersect, isSubSet, isUnitInExitState, isUnitInValidStates, isUnitWaitingForResponse, order, passivateUnitAll, passivateUnitCallable, passivateUnitMessaging, printUnitErrorStates, removePresences, removeSubUnits, retrieveUnit, scrutinise, setCharacteristicFunction, subset, symmetricDifference, union
 
Methods inherited from interface com.vii.brillien.kernel.axiom.atomic.Presence
activateAll, addSuperUnits, clearSuperUnits, getApiKeyPresenceName, getFlow, getPresenceManager, getSharing, getSSOPresenceName, getSuperUnits, passivateAll, printErrorStates, removeSuperUnits, retrieve, setFlow, setPresenceManager
 
Methods inherited from interface com.vii.brillien.kernel.axiom.Presence
aspirationTimeIsUp, getAspirationTimeMeasure, getFullName, getMessageProcessorParameterNames, getMessageProcessorParameterTypes, getName, hasMessageProcessorReturnValue, isAspirationPeriodical, reset, setAspirationPeriodical, setAspirationTimeMeasure, setName
 
Methods inherited from interface com.vii.brillien.kernel.axiom.Aspirer
activateCallable, getResult, hasActivity, isWaitingForInputData, isWaitingForResponse, passivateCallable, plan, sendAGet, sendDelegatedSet, sendError, sendError, sendError, sendGet, sendGet, sendResponse, sendSet, sendUnitAGet, sendUnitDelegatedSet, sendUnitGet, sendUnitGet, sendUnitSet
 
Methods inherited from interface java.util.concurrent.Callable
call
 
Methods inherited from interface com.vii.brillien.kernel.axiom.Sensor
activateMessaging, communicationReceived, errorReceived, passivateMessaging, presenseChangedState
 
Methods inherited from interface com.vii.brillien.kernel.axiom.Progressor
addState, changeState, getActualStates, getPotentialStates, getStateDivision, hasStateMachine, initStateMashine, isInExitState, isInState, isInValidStates, panic, registerStateChangeNotification, removeState, setStateDivision, unregisterStateChangeNotification
 

Method Detail

getFlowID

String getFlowID()
Description copied from interface: Presence
Gets the flow ID of the Presence.

Returns:
the identifier of the flow instance

setFlowID

Flow<P,C,R> setFlowID(String flowID)
Setter method for the ID

Parameters:
flowID - identifier of the given flow
Returns:
the flow instance itself

isIndispensable

boolean isIndispensable()
Tells whether this Flow represents an action which cannot fail, so cluster replication is needed.


setIndispensable

void setIndispensable(boolean indispensable)
Setter method for an indispensable flow


report

void report(Presence reporter,
            String message)
Report method to share any communication related information of the components with the container flow instance.

Parameters:
reporter - reporter Presence reference
message - communication' message name

report

void report(Presence reporter,
            String message,
            List<Object> params)

getFlowResult

<T> T getFlowResult()
Returns the result of the flow if it exists


setFlowResult

void setFlowResult(Object result)
Sets the result of the flow


activate

void activate(C c,
              Long timeout)
              throws BrillienException
Activates the flow instance, making it started.

Throws:
BrillienException - in case of operation failure

getActivationData

C getActivationData()
Gets the parameters gotten while the given flow has been activated with.

Returns:

oppress

void oppress(String message)
             throws BrillienException
Sets all state of a flow to "Error" state marking it to be terminated.

Throws:
BrillienException - in case of operation failure

terminate

void terminate()
               throws BrillienException
Sets all state of a flow to "Exit" state marking it to be terminated.

Throws:
BrillienException - in case of operation failure

isSuspended

boolean isSuspended()
Tells whether the flow has been suspended.


suspend

void suspend()
             throws BrillienException
All Indispensable flows can be suspended and resumed. This method makes all the necessary infromation (id, current states) persisted about a given flow. Fot all non indispensable flow, an exception will be thrown.

Throws:
BrillienException - in case of suspend failure or the non-indispensable nature of the given flow instance

revivified

void revivified()
                throws BrillienException
Notify the given flow instance about the occured revivfication process.

Throws:
BrillienException

getStateSpace

HashMap<String,Object> getStateSpace()
This method retrieves the state space of the flow called when the flow will be suspended


setStateSpace

void setStateSpace(HashMap<String,Object> stateSpace)
                   throws BrillienException
This method sets the state space of the flow called when the flow will be reactivated

Throws:
BrillienException


Copyright © 2012. All Rights Reserved.