Package jade.content

Examples of jade.content.ContentManager


  public IntrospectionServer(Agent a) {
    super(a);
  }
 
  public void onStart() {
    ContentManager cm = myAgent.getContentManager();
   
    onto = IntrospectionOntology.getInstance();
    cm.registerOntology(onto);
   
    codec = cm.lookupLanguage(FIPANames.ContentLanguage.FIPA_SL);
    if (codec == null) {
      codec = cm.lookupLanguage(FIPANames.ContentLanguage.FIPA_SL2);
      if (codec == null) {
        codec = cm.lookupLanguage(FIPANames.ContentLanguage.FIPA_SL1);
        if (codec == null) {
          codec = cm.lookupLanguage(FIPANames.ContentLanguage.FIPA_SL0);
        }
      }
    }
    if (codec == null) {
      codec = new SLCodec();
      cm.registerLanguage(codec);
    }
   
    template = MessageTemplate.and(
        MessageTemplate.MatchOntology(onto.getName()),
        MessageTemplate.MatchPerformative(jade.lang.acl.ACLMessage.REQUEST) );
View Full Code Here


 
  public void action() {
    jade.lang.acl.ACLMessage request = myAgent.receive(template);
    if (request != null) {
      try {
        ContentManager cm = myAgent.getContentManager();
        Action actionExpr = (Action) cm.extractContent(request);
        Object act = actionExpr.getAction();
        if (act instanceof GetKeys) {
          serveGetKeys(request, actionExpr, (GetKeys) act);
        }
        else if (act instanceof GetValue) {
View Full Code Here

    }
    // Whatever template is used we avoid intercepting messages belonging to external conversations
    template  = MessageTemplate.and(template, ignoredConversations.getMessageTemplate());
 
    // Register Ontology and Language
    ContentManager cm = myAgent.getContentManager();
    if (cm.lookupOntology(onto.getName()) == null) {
      cm.registerOntology(onto);
    }
    this.codec = (codec != null ? codec : new SLCodec());
    if (cm.lookupLanguage(codec.getName()) == null) {
      cm.registerLanguage(codec);
    }
  }
View Full Code Here

TOP

Related Classes of jade.content.ContentManager

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.