Package org.apache.sandesha2.client

Examples of org.apache.sandesha2.client.SequenceReport


   
    ping = new Ping ();
    ping.setText("ping3");
    stub.Ping(ping);
   
    SequenceReport sequenceReport = null;   
    boolean complete = false;
    while (!complete) {
      sequenceReport = SandeshaClient.getOutgoingSequenceReport(stubServiceClient);
      if (sequenceReport!=null && sequenceReport.getCompletedMessages().size()==3)
        complete = true;
      else {
        try {
          Thread.sleep(1000);
        } catch (InterruptedException e1) {
View Full Code Here


   
  }
 
  private void terminateSequence (ServiceClient serviceClient) throws Exception {
   
      SequenceReport sequenceReport = null;   
    boolean complete = false;
    while (!complete) {
      sequenceReport = SandeshaClient.getOutgoingSequenceReport(serviceClient);
      if (sequenceReport!=null && sequenceReport.getCompletedMessages().size()==3)
        complete = true;
      else {
        try {
          Thread.sleep(1000);
        } catch (InterruptedException e1) {
View Full Code Here

    ServiceClient serviceClient = new ServiceClient (configurationContext,null);   
    serviceClient.setOptions(clientOptions);

    SandeshaClient.createSequence(serviceClient, false);
   
    SequenceReport sequenceReport = null;
    boolean established = false;
    while (!established) {
      sequenceReport = SandeshaClient.getOutgoingSequenceReport(serviceClient);
      if (sequenceReport!=null && sequenceReport.getSequenceStatus()>=SequenceReport.SEQUENCE_STATUS_ESTABLISHED)
        established = true;
      else {
        try {
          Thread.sleep(100);
        } catch (InterruptedException e1) {
          e1.printStackTrace();
        }
      }
    }
   
    SandeshaClient.sendAckRequest(serviceClient);
   
    SandeshaClient.terminateSequence(serviceClient);
   
    boolean terminated = false;
    while (!terminated) {
      sequenceReport = SandeshaClient.getOutgoingSequenceReport(serviceClient);
      if (sequenceReport!=null && sequenceReport.getSequenceStatus()==SequenceReport.SEQUENCE_STATUS_TERMINATED)
        terminated = true;
      else {
        try {
          Thread.sleep(1000);
        } catch (InterruptedException e1) {
View Full Code Here

   
    setUpOptions(clientOptions);
   
    SandeshaClient.createSequence(stubServiceClient, false);
   
    SequenceReport sequenceReport = null;
    boolean established = false;
    while (!established) {
      sequenceReport = SandeshaClient.getOutgoingSequenceReport(stubServiceClient);
      if (sequenceReport!=null && sequenceReport.getSequenceStatus()>=SequenceReport.SEQUENCE_STATUS_ESTABLISHED)
        established = true;
      else {
        try {
          Thread.sleep(100);
        } catch (InterruptedException e1) {
          e1.printStackTrace();
        }
      }
    }
   
    SandeshaClient.sendAckRequest(stubServiceClient);
   
    SandeshaClient.terminateSequence(stubServiceClient);
   
    boolean terminated = false;
    while (!terminated) {
      sequenceReport = SandeshaClient.getOutgoingSequenceReport(stubServiceClient);
      if (sequenceReport!=null && sequenceReport.getSequenceStatus()==SequenceReport.SEQUENCE_STATUS_TERMINATED)
        terminated = true;
      else {
        try {
          Thread.sleep(1000);
        } catch (InterruptedException e1) {
View Full Code Here

   
    serviceClient.fireAndForget(getPingOMBlock("ping1"));
    serviceClient.fireAndForget(getPingOMBlock("ping2"));
    serviceClient.fireAndForget(getPingOMBlock("ping3"));
   
    SequenceReport sequenceReport = null;   
    boolean complete = false;
    while (!complete) {
      sequenceReport = SandeshaClient.getOutgoingSequenceReport(serviceClient);
      if (sequenceReport!=null && sequenceReport.getCompletedMessages().size()==1)
        complete = true;
      else {
        try {
          Thread.sleep(1000);
        } catch (InterruptedException e1) {
View Full Code Here

    ping = new Ping ();
    ping.setText("ping3");
    stub.Ping (ping);
   
   
    SequenceReport sequenceReport = null;   
    boolean complete = false;
    while (!complete) {
      sequenceReport = SandeshaClient.getOutgoingSequenceReport(stubServiceClient);
      if (sequenceReport!=null && sequenceReport.getCompletedMessages().size()==3)
        complete = true;
      else {
        try {
          Thread.sleep(1000);
        } catch (InterruptedException e1) {
View Full Code Here

    serviceClient.setOptions(clientOptions);
   
    String sequenceKey = SandeshaClient.createSequence(serviceClient,false);
    clientOptions.setProperty(SandeshaClientConstants.SEQUENCE_KEY, sequenceKey);
   
    SequenceReport sequenceReport = null;
    for(int i = 0; i < 15; i++) {
      Thread.sleep(1000);
      sequenceReport = SandeshaClient.getOutgoingSequenceReport(serviceClient);
      if(sequenceReport.getSequenceID() != null) break;
    }
    assertTrue(sequenceReport.isSecureSequence());
   
    configContext.getListenerManager().stop();
    serviceClient.cleanup();
  }
View Full Code Here

       
        serviceClient.fireAndForget(getPingOMBlock("ping1"));
        serviceClient.fireAndForget(getPingOMBlock("ping2"));
        serviceClient.fireAndForget(getPingOMBlock("ping3"));
       
    SequenceReport sequenceReport = null;   
    boolean complete = false;
    while (!complete) {
      sequenceReport = SandeshaClient.getOutgoingSequenceReport(serviceClient);
      if (sequenceReport!=null && sequenceReport.getCompletedMessages().size()==3)
        complete = true;
      else {
        try {
          Thread.sleep(1000);
        } catch (InterruptedException e1) {
View Full Code Here

       
       
    }
   
    private void terminateSequence (ServiceClient serviceClient) throws SandeshaException {
        SequenceReport sequenceReport = null;      
        boolean complete = false;
        while (!complete) {
            sequenceReport = SandeshaClient.getOutgoingSequenceReport(serviceClient);
            if (sequenceReport!=null && sequenceReport.getCompletedMessages().size()==3)
                complete = true;
            else {
                try {
                    Thread.sleep(1000);
                } catch (InterruptedException e1) {
View Full Code Here

       
        Thread.sleep(15000);
   
        //assertions for the out sequence.
        //assertions for the out sequence.
    SequenceReport outgoingSequenceReport = SandeshaClient.getOutgoingSequenceReport(serviceClient);
    assertEquals (outgoingSequenceReport.getCompletedMessages().size(),3);
    assertTrue(outgoingSequenceReport.getCompletedMessages().contains(new Long(1)));
    assertTrue(outgoingSequenceReport.getCompletedMessages().contains(new Long(2)));
    assertTrue(outgoingSequenceReport.getCompletedMessages().contains(new Long(3)));
    assertEquals(outgoingSequenceReport.getSequenceStatus(),SequenceReport.SEQUENCE_STATUS_TERMINATED);
    assertEquals(outgoingSequenceReport.getSequenceDirection(),SequenceReport.SEQUENCE_DIRECTION_OUT);
   
    SequenceReport incomingSequenceReport = SandeshaClient.getIncomingSequenceReport(offeredSequeiceId,configContext);
    assertEquals (incomingSequenceReport.getCompletedMessages().size(),3);
    assertTrue(incomingSequenceReport.getCompletedMessages().contains(new Long(1)));
    assertTrue(incomingSequenceReport.getCompletedMessages().contains(new Long(2)));
    assertTrue(incomingSequenceReport.getCompletedMessages().contains(new Long(3)));
    assertEquals(incomingSequenceReport.getSequenceStatus(),SequenceReport.SEQUENCE_STATUS_TERMINATED);
    assertEquals(incomingSequenceReport.getSequenceDirection(),SequenceReport.SEQUENCE_DIRECTION_IN);
   
    assertTrue(callback1.isComplete());
    assertNotNull (callback1.getResult(),"echo1");
   
    assertTrue(callback2.isComplete());
View Full Code Here

TOP

Related Classes of org.apache.sandesha2.client.SequenceReport

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.