public class OntologyServer extends CyclicBehaviour
public void serveCcccPppp(Cccc c, ACLMessage msg) throws Exception
action
, done
and result
are
automatically managed so that for instance if an incoming REQUEST message is received carrying a content of
type
public void serveSellRequest(Sell s, ACLMessage msg) throws Exception
Constructor and Description |
---|
OntologyServer(Agent a,
Ontology onto,
int performative) |
OntologyServer(Agent a,
Ontology onto,
int[] performatives) |
OntologyServer(Agent a,
Ontology onto,
int[] performatives,
java.lang.Object serverDelegate) |
OntologyServer(Agent a,
Ontology onto,
int performative,
java.lang.Object serverDelegate) |
Modifier and Type | Method and Description |
---|---|
void |
action()
Runs the behaviour.
|
void |
addPerformativeRequiringReply(int performative)
If an unexpected error occurs in one of the serving methods or if a suitable serving method
is not found for an incoming message, the OntologyServer automatically sends back a FAILURE
or REFUSE message if the incoming performative was one of REQUEST, CFP, PROPOSE, QUERY, SUBSCRIBE,
PROXY and PROPAGATE.
|
void |
conversationFinished(java.lang.String convId)
Notifies this OntologyServer that a given conversation is finished and therefore
it must no longer ignore messages belonging to it.
|
protected java.lang.Object |
extractKeyContentElement(ContentElement ce) |
ConversationList |
getIgnoredConversations() |
ContentElement |
getReceivedContentElement()
Allows subclasses to retrieve the actually received content element e.g.
|
protected void |
handleMessage(ACLMessage msg) |
protected void |
handleNotUnderstood(ContentException ce,
ACLMessage msg) |
protected void |
handleServingFailure(java.lang.Throwable t,
java.lang.Object cel,
ACLMessage msg) |
protected void |
handleUnsupported(java.lang.Object keyCel,
ACLMessage msg) |
void |
ignoreConversation(java.lang.String convId)
Makes this OntologyServer ignore all incoming messages belonging to a
given conversation i.e. marked with the indicated conversation-id
|
void |
onStart()
This method is just an empty placeholders for subclasses.
|
void |
removePerformativeRequiringReply(int performative) |
void |
setIgnoredConversations(ConversationList l)
Set the
ConversationList used by this OntologyServer
to determine which conversations to ignore (if any). |
void |
setLanguage(Codec codec) |
void |
setMessageTemplate(MessageTemplate template) |
void |
setPrintFullUnexpectedMessages(boolean printFullUnexpectedMessages) |
done
reset
block, block, getAgent, getBehaviourName, getDataStore, getParent, isRunnable, onEnd, restart, root, setAgent, setBehaviourName, setDataStore
protected Logger myLogger
public OntologyServer(Agent a, Ontology onto, int performative, java.lang.Object serverDelegate)
public void setLanguage(Codec codec)
public void setMessageTemplate(MessageTemplate template)
public void setIgnoredConversations(ConversationList l)
ConversationList
used by this OntologyServer
to determine which conversations to ignore (if any).
Note: calling this method after the behaviour started has no effectignoreConversation(String)
public ConversationList getIgnoredConversations()
public void addPerformativeRequiringReply(int performative)
addPerformativeRequiringReply(int) one.
performative
- The performative to be addedpublic void removePerformativeRequiringReply(int performative)
performative
- The performative to be removedaddPerformativeRequiringReply(int)
public void setPrintFullUnexpectedMessages(boolean printFullUnexpectedMessages)
public void onStart()
Behaviour
Behaviour
.public final void action()
Behaviour
Behaviour
subclasses to perform ordinary behaviour
duty. An agent schedules its behaviours calling their
action()
method; since all the behaviours belonging
to the same agent are scheduled cooperatively, this method
must not enter in an endless loop and should return as
soon as possible to preserve agent responsiveness. To split a
long and slow task into smaller section, recursive behaviour
aggregation may be used.action
in class Behaviour
CompositeBehaviour
protected void handleMessage(ACLMessage msg)
public final ContentElement getReceivedContentElement()
protected java.lang.Object extractKeyContentElement(ContentElement ce)
protected void handleUnsupported(java.lang.Object keyCel, ACLMessage msg)
protected void handleServingFailure(java.lang.Throwable t, java.lang.Object cel, ACLMessage msg)
protected void handleNotUnderstood(ContentException ce, ACLMessage msg)
public void ignoreConversation(java.lang.String convId)
public void conversationFinished(java.lang.String convId)
ignoreConversation(String)