|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.malai.instrument.Link<A,I,N>
A
- The type of the action that will produce this link.I
- The type of the interaction that will use this link.N
- The type of the instrument that will contain this link.public abstract class Link<A extends Action,I extends Interaction,N extends Instrument>
In the Malai interaction model, an instrument links interactions to actions.
Thus, an instrument is composed of Link definitions: each Link links an interaction
to an action. A Link manages the life cycle of an action following the life cycle
of the interaction (started, aborted, etc.).
This file is part of Malai.
Copyright (c) 2009-2012 Arnaud BLOUIN
Malai is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
Foundation; either version 2 of the License, or (at your option) any later version.
Malai is distributed without any warranty; without even the implied
warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
05/10/2010
Field Summary | |
---|---|
protected A |
action
The target action. |
protected java.lang.Class<A> |
clazzAction
|
protected boolean |
execute
Specifies if the action must be execute or update on each evolution of the interaction. |
protected N |
instrument
The instrument that contains the link. |
protected I |
interaction
The source interaction. |
Constructor Summary | |
---|---|
Link(N ins,
boolean exec,
java.lang.Class<A> clazzAction,
java.lang.Class<I> clazzInteraction)
Creates a link. |
Method Summary | |
---|---|
void |
addEventable(Eventable eventable)
Binds the interaction of the link to a Eventable object that produces events used by the interaction. |
void |
clearEvents()
Stops the interaction and clears all its events waiting for a process. |
protected void |
createAction()
Initialises the action of the link. |
A |
getAction()
|
N |
getInstrument()
|
I |
getInteraction()
|
abstract void |
initAction()
After being created by method createAction, the action must be initialised by this method. |
void |
interactionAborts(Interaction inter)
Happens when the interaction goes to an aborting state. |
void |
interactionStarts(Interaction inter)
Happens when the interaction quits its initial state. |
void |
interactionStops(Interaction inter)
Happens when the interaction goes to a terminal state. |
void |
interactionUpdates(Interaction inter)
Happens when the interaction goes to standard state. |
void |
interimFeedback()
Defines the interim feedback of the link. |
boolean |
isActivated()
|
abstract boolean |
isConditionRespected()
|
boolean |
isExecute()
|
boolean |
isInteractionMustBeAborted()
Sometimes the interaction of two different links can overlap themselves. |
boolean |
isRunnable()
Indicates if the link can be run. |
boolean |
isRunning()
|
void |
setActivated(boolean activated)
Activates the link. |
void |
updateAction()
Updates the current action. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected I extends Interaction interaction
protected A extends Action action
protected N extends Instrument instrument
protected boolean execute
protected java.lang.Class<A extends Action> clazzAction
Constructor Detail |
---|
public Link(N ins, boolean exec, java.lang.Class<A> clazzAction, java.lang.Class<I> clazzInteraction) throws java.lang.InstantiationException, java.lang.IllegalAccessException
ins
- The instrument that contains the link.exec
- Specifies if the action must be execute or update on each evolution of the interaction.clazzAction
- The type of the action that will be created. Used to instantiate the action by reflexivity.clazzInteraction
- The type of the interaction that will be created. Used to instantiate the interaction by reflexivity.
java.lang.IllegalAccessException
- If no free-parameter constructor is available.
java.lang.InstantiationException
- If an error occurs during instantiation of the interaction/action.
java.lang.IllegalArgumentException
- If the given interaction or instrument is null.Method Detail |
---|
public void addEventable(Eventable eventable)
eventable
- The eventable object that gathers event used by the interaction.public void clearEvents()
protected void createAction()
public abstract void initAction()
public void updateAction()
public abstract boolean isConditionRespected()
public I getInteraction()
public A getAction()
public boolean isActivated()
public boolean isRunnable()
public boolean isRunning()
public boolean isInteractionMustBeAborted()
public void interactionAborts(Interaction inter)
InteractionHandler
interactionAborts
in interface InteractionHandler
inter
- The concerned interaction.public void interactionStarts(Interaction inter) throws MustAbortStateMachineException
InteractionHandler
interactionStarts
in interface InteractionHandler
inter
- The concerned interaction.
MustAbortStateMachineException
- If the interaction must be aborted.public void interactionStops(Interaction inter)
InteractionHandler
interactionStops
in interface InteractionHandler
inter
- The concerned interaction.public void interactionUpdates(Interaction inter)
InteractionHandler
interactionUpdates
in interface InteractionHandler
inter
- The concerned interaction.public boolean isExecute()
public void interimFeedback()
public void setActivated(boolean activated)
activated
- True: the link is activated. Otherwise, it is desactivated.public N getInstrument()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |