ibspan.tss.agents.sha.mvc
Class Controller
java.lang.Object
jade.core.behaviours.Behaviour
jade.core.behaviours.CompositeBehaviour
jade.core.behaviours.SerialBehaviour
jade.core.behaviours.FSMBehaviour
ibspan.tss.agents.sha.mvc.Controller
- All Implemented Interfaces:
- Serializable
public class Controller
- extends FSMBehaviour
This behaviour plays the role of controller in Model-View-Controller
architecture.
Invokes ModelConstructor
which constructs
DataModel
object according to the user
request and then calles ViewConstructor
, which transforms this model
into ibspan.tss.messaging.ontology.ViewModel
object. If any of this
action failed, then message with InternalSystemError
concept will be put as
result notification; otherwise the constructed DataView
is put
as a result.
The developer is provided with methods for registering both:
ModelConstructor
and ViewConstructor
.
Registration provides also both constructors with keys to access the
following data in local DataStore: action
and
actionName
(extracted from request by
ActionDispatcherWithSessionTracking
)
and the key (CONSTRUCTED_RESULT_KEY
) for exchanging model and view
among constructors and controller, too.
- Author:
- Maciej Gawinecki
- See Also:
- Serialized Form
Methods inherited from class jade.core.behaviours.FSMBehaviour |
checkTermination, deregisterState, forceTransitionTo, getChildren, getCurrent, getLastExitValue, getName, getPrevious, getState, handleInconsistentFSM, handleStateEntered, onEnd, registerDefaultTransition, registerDefaultTransition, registerFirstState, registerLastState, registerState, registerTransition, registerTransition, reset, resetStates, scheduleFirst, scheduleNext |
Methods inherited from class jade.core.behaviours.Behaviour |
actionWrapper, block, getBehaviourName, getDataStore, getExecutionState, getParent, isRunnable, onStart, root, setBehaviourName, setDataStore, setExecutionState |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CONSTRUCTED_RESULT_KEY
public final String CONSTRUCTED_RESULT_KEY
SUCCESS_OF_CONSTRUCT
public static final int SUCCESS_OF_CONSTRUCT
- See Also:
- Constant Field Values
FAILURE_OF_CONSTRUCT
public static final int FAILURE_OF_CONSTRUCT
- See Also:
- Constant Field Values
Controller
public Controller(Agent a,
DataStore ds,
Object requestKey,
Object notificationKey,
Object actKey,
Object actionNameKey)
- Constructs Controller.
- Parameters:
a
- is the agent this behaviour belongs to.ds
- data storeactKey
- key for accessing action of user request from local DataStoreactionNameKey
- key for accessing action name of user request from local
DataStorerequestKey
- key for accessing user request ACL message from local
DataStorenotificationKey
- key in local Data Store, where result of Controller behaviour
should be put at
registerModelConstructor
public void registerModelConstructor(ModelConstructor mc)
- Registers the given Model Constructor in this Controller.
It also provided the constructor with access keys to exchange data via
local DataStore.
- Parameters:
mc
- model constructor
registerViewConstructor
public void registerViewConstructor(ViewConstructor vc)
- Registers the given View Constructor in this Controller.
It also provided the constructor with access keys to exchange data via
local DataStore.
- Parameters:
vc
- view constructor