Package cartago

Examples of cartago.Op


//    @Requirements(
//        commitments = (Initiator.class, Participant.class, "propose", "accept OR reject")
//        )
    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

//    @Requirements(
//        commitments = (Initiator.class, Participant.class, "propose", "accept OR reject")
//        )
    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


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

   */
  @SuppressWarnings("unchecked")
  public static <T extends Role> T enact(String roleName, ArtifactId artifact, Behaviour offeredPlayerBehaviour, AID agent) {
    OpFeedbackParam<Role> r = new OpFeedbackParam<Role>();
    try {
      staticCtx.doAction(artifact, new Op(CommunicationArtifact.ENACT, roleName, offeredPlayerBehaviour, agent, r));
      staticLogger.debug("Enactment completed succesfully.");
      return (T)r.get();
    } catch (CartagoException e) {
      staticLogger.error("Error in enacting artifact "+artifact);
      e.printStackTrace();
View Full Code Here

    }
   
    public void send(CAMessage message) {
      try {
        logger.debug("Sending message: "+message);
        doAction(this.getArtifactId(), new Op("send", message));
      } catch (ActionFailedException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
      } catch (CartagoException e) {
        // TODO Auto-generated catch block
View Full Code Here

   
    // receive the first message sent to this role
    public CAMessage receive(int performative) {
      OpFeedbackParam<CAMessage> message = new OpFeedbackParam<CAMessage>();
      try
        doAction(this.getArtifactId(), new Op("receive", this.getRoleId(), performative, message));
      } catch (ActionFailedException e) {
        // TODO Auto-generated catch block
        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.