ibspan.tss.agents.vta.handlers
Class ViewTransformer
java.lang.Object
jade.core.behaviours.Behaviour
jade.core.behaviours.SimpleBehaviour
jade.core.behaviours.OneShotBehaviour
ibspan.tss.messaging.RequestHandler
ibspan.tss.agents.vta.handlers.ViewTransformer
- All Implemented Interfaces:
- Serializable
- Direct Known Subclasses:
- RaccoonTransformer
public abstract class ViewTransformer
- extends RequestHandler
This behaviour is responsible for transforming DataModel
object given in request message into responding DataView
object and prepare reply containing this result. This is done by invoking
transform() method.
The behaviour is expected to preserve given UserContext during
system-user interaction, usually in such a way each hyperlink a user can go
along and each form a user can post were accompanied by information about
this context.
- Author:
- Maciej Gawinecki
- See Also:
DataModel,
DataView,
UserContext,
Serialized Form
| Methods inherited from class jade.core.behaviours.Behaviour |
actionWrapper, block, block, getBehaviourName, getDataStore, getExecutionState, getParent, handle, isRunnable, onEnd, onStart, restart, root, setAgent, setBehaviourName, setDataStore, setExecutionState |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
myAgent
protected ViewTransformingAgent myAgent
ViewTransformer
public ViewTransformer(Agent a,
DataStore ds,
Object requestKey,
Object actKey,
Object resultNotificationKey)
- Constructs
ViewTransformer object.
- Parameters:
a - is the agent owning this behaviour.ds - is the DataStore for this constructor.requestKey - actKey - is the key in the DataStore where the Action concept
extracted from current request can be found.resultNotificationKey - is the key in the DataStore where the result message is to be
put at.
prepareResponse
protected final ACLMessage prepareResponse(ACLMessage request,
Action act)
throws FailureException,
NotUnderstoodException
- Description copied from class:
RequestHandler
- Returns response to the request. Programmers should implenets this method
in order process given request.
- Specified by:
prepareResponse in class RequestHandler
- Parameters:
request - is message.act - is Action concept extracted previously from
request object.
- Returns:
- response;
null means failure.
- Throws:
FailureException
NotUnderstoodException
transform
protected abstract DataView transform(DataModel model,
UserContext context)
throws ViewTransformingException
- Transforms pure data into browser-readable form.
- Parameters:
model - are pure data be formattedcontext - is context of user request, such type of media, session-id
etc.
- Returns:
- browser-readable form of data
- Throws:
ViewTransformingException - when transforming process failed for some reason.