Package cartago

Examples of cartago.Op


   
    // receive the first message sent to this role
    public CAMessage receiveNoBlock(int performative) {
      OpFeedbackParam<CAMessage> message = new OpFeedbackParam<CAMessage>();
      try
        doAction(this.getArtifactId(), new Op("receiveNoBlockPerf", this.getRoleId(), performative, message));
      } catch (ActionFailedException e) {
        // TODO Auto-generated catch block
        logger.error("Errore: "+e.getMessage());
        e.printStackTrace();
      } catch (CartagoException e) {
View Full Code Here


     
      boolean noMoreMessages = false;
     
      while (!noMoreMessages) {
        try
          doAction(this.getArtifactId(), new Op("receiveNoBlock", this.getRoleId(), message));
          if (message.get() != null)
            arr.add(message.get());
          else
            noMoreMessages = true;
        } catch (ActionFailedException e) {
View Full Code Here

    // receive first messages sent to this role
    public CAMessage receive() {
      OpFeedbackParam<CAMessage> message = new OpFeedbackParam<CAMessage>();
     
      try
        doAction(this.getArtifactId(), new Op("receiveNoBlock", this.getRoleId(), message));
        if (message.get() != null)
          return message.get();
        else
          return null;
      } catch (ActionFailedException e) {
View Full Code Here

     
      boolean noMoreMessages = false;
     
      while (!noMoreMessages) {
        try
          doAction(this.getArtifactId(), new Op("receiveNoBlockPerf", this.getRoleId(), performative, message));
          logger.info("Richiesta la receiveNoBlock");
          if (message.get() != null)
            arr.add(message.get());
          else
            noMoreMessages = true;
View Full Code Here

    }


    public void cfp(Task task) {
      try {
        doAction(this.getArtifactId(), new Op("cfp", task, getRoleId()));
      } catch (ActionFailedException e) {
        logger.error("Action CFP failed: "+e.getFailureMsg());
        e.printStackTrace();
      } catch (CartagoException e) {
        // TODO Auto-generated catch block
View Full Code Here


    // accepting to particular role
    public void accept(Proposal proposal) {
      try {
        doAction(this.getArtifactId(), new Op("accept", proposal, getRoleId()));
      } catch (ActionFailedException e) {
        logger.error("Action ACCEPT failed: "+e.getFailureMsg());
        e.printStackTrace();
      } catch (CartagoException e) {
        // TODO Auto-generated catch block
View Full Code Here


   
    public void reject(Proposal proposal) {
      try {
        doAction(this.getArtifactId(), new Op("reject", proposal, getRoleId()));
      } catch (ActionFailedException e) {
        logger.error("Action REJECT failed: "+e.getFailureMsg());
        e.printStackTrace();
      } catch (CartagoException e) {
        // TODO Auto-generated catch block
View Full Code Here

    }


    public void propose(Proposal proposal, RoleId proposalSender) {
      try {
        doAction(this.getArtifactId(), new Op("propose", proposal, this.getRoleId(), proposalSender));
      } catch (ActionFailedException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
      } catch (CartagoException e) {
        // TODO Auto-generated catch block
View Full Code Here

     
    }
   
    public void refuse(Task task) {
      try {
        doAction(this.getArtifactId(), new Op("refuse", task, this.getRoleId()));
      } catch (ActionFailedException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
      } catch (CartagoException e) {
        // TODO Auto-generated catch block
View Full Code Here


   
    public void done(Task task, RoleId initiator) {
      try {
        doAction(this.getArtifactId(), new Op("done", task, getRoleId(), initiator));
      } catch (ActionFailedException e) {
        logger.error("Action DONE failed: "+e.getFailureMsg());
        e.printStackTrace();
      } catch (CartagoException e) {
        // TODO Auto-generated catch block
View Full Code Here

TOP

Related Classes of cartago.Op

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.