Package com.arjuna.mw.wst

Examples of com.arjuna.mw.wst.UserBusinessActivity


    {
  boolean passed = false;
 
  try
  {
      UserBusinessActivity uba = UserBusinessActivity.getUserBusinessActivity();
      BusinessActivityManager bam = BusinessActivityManager.getBusinessActivityManager();
      com.arjuna.wst.BAParticipantManager bpm = null;
      DemoBusinessParticipant p = new DemoBusinessParticipant(DemoBusinessParticipant.EXIT, "1234");
     
      uba.begin();
     
      bpm = bam.enlistForBusinessAgreementWithParticipantCompletion(p, "1234");

      bpm.exit();
     
      uba.close();

      passed = p.passed();
  }
  catch (Exception ex)
  {
View Full Code Here


    {
  boolean passed = false;
 
  try
  {
      UserBusinessActivity uba = UserBusinessActivity.getUserBusinessActivity();
      BusinessActivityManager bam = BusinessActivityManager.getBusinessActivityManager();
      DemoBusinessParticipant p = new DemoBusinessParticipant(DemoBusinessParticipant.CANCEL, "1234");
      FailureBusinessParticipant fp = new FailureBusinessParticipant(FailureBusinessParticipant.FAIL_IN_CANCEL, "5678");
     
      uba.begin();
     
      bam.enlistForBusinessAgreementWithParticipantCompletion(p, "1234");
      bam.enlistForBusinessAgreementWithParticipantCompletion(fp, "5678");
     
      uba.close();

      passed = p.passed();
  }
  catch (Exception ex)
  {
View Full Code Here

     */
    private void testBusinessActivity(int restaurantSeats, int theatreSeats, int theatreArea, boolean bookTaxi) throws Exception
    {
        System.out.println("CLIENT: obtaining userBusinessActivity...");

        UserBusinessActivity uba = UserBusinessActivityFactory.userBusinessActivity();

        System.out.println("CLIENT: starting the transaction...");

        uba.begin();

        System.out.println("CLIENT: transaction ID= " + uba.toString());

        System.out.println("CLIENT: calling business Web Services...");

        boolean isOK = false ;
        try
        {
            if (restaurantBA.bookSeats(restaurantSeats) && theatreBA.bookSeats(theatreSeats, theatreArea))
            {
                isOK = !bookTaxi || taxiBA.bookTaxi() ;
            }
        }
        catch (final Throwable th)
        {
            System.out.println("CLIENT: caught exception processing bookings, cancelling (" + th.getMessage() + ")") ;
        }

        if (isOK)
        {
            System.out.println("CLIENT: all OK");
            System.out.println("CLIENT: calling close on the transaction...");
            uba.close();
        }
        else
        {
            System.out.println("CLIENT: one or more services failed, calling cancel.");
            uba.cancel();
        }

        System.out.println("CLIENT: done.");
        System.out.flush();
    }
View Full Code Here

     */
    private void testBusinessActivity(int restaurantSeats, int theatreSeats, int theatreArea, boolean bookTaxi) throws Exception
    {
        System.out.println("CLIENT: obtaining userBusinessActivity...");

        UserBusinessActivity uba = UserBusinessActivityFactory.userBusinessActivity();

        System.out.println("CLIENT: starting the transaction...");

        uba.begin();

        System.out.println("CLIENT: transaction ID= " + uba.toString());

        System.out.println("CLIENT: calling business Web Services...");

        boolean isOK = false ;
        try
        {
            if (restaurantBA.bookSeats(restaurantSeats) && theatreBA.bookSeats(theatreSeats, theatreArea))
            {
                isOK = !bookTaxi || taxiBA.bookTaxi() ;
            }
        }
        catch (final Throwable th)
        {
            System.out.println("CLIENT: caught exception processing bookings, cancelling (" + th.getMessage() + ")") ;
        }

        if (isOK)
        {
            System.out.println("CLIENT: all OK");
            System.out.println("CLIENT: calling close on the transaction...");
            uba.close();
        }
        else
        {
            System.out.println("CLIENT: one or more services failed, calling cancel.");
            uba.cancel();
        }

        System.out.println("CLIENT: done.");
        System.out.flush();
    }
View Full Code Here

    {
  boolean passed = false;
 
  try
  {
      UserBusinessActivity uba = UserBusinessActivity.getUserBusinessActivity();
      BusinessActivityManager bam = BusinessActivityManager.getBusinessActivityManager();
      DemoBusinessParticipant p = new DemoBusinessParticipant(DemoBusinessParticipant.CLOSE, "1234");
     
      uba.begin();
     
      bam.enlistForBusinessAgreementWithParticipantCompletion(p, null);
     
      uba.close();

      passed = p.passed();
  }
  catch (Exception ex)
  {
View Full Code Here

    {
  boolean passed = false;
 
  try
  {
      UserBusinessActivity uba = UserBusinessActivity.getUserBusinessActivity();
      BusinessActivityManager bam = BusinessActivityManager.getBusinessActivityManager();
      String participantId = "1234";
      DemoBusinessParticipant p = new DemoBusinessParticipant(DemoBusinessParticipant.CANCEL, participantId);
     
      uba.begin();
     
      bam.enlistForBusinessAgreementWithParticipantCompletion(p, participantId);

      uba.cancel();

      passed = p.passed();
  }
  catch (Exception ex)
  {
View Full Code Here

    {
  boolean passed = false;
 
  try
  {
      UserBusinessActivity uba = UserBusinessActivity.getUserBusinessActivity();
      BusinessActivityManager bam = BusinessActivityManager.getBusinessActivityManager();
      com.arjuna.wst.BAParticipantManager bpm1 = null;
      com.arjuna.wst.BAParticipantManager bpm2 = null;
      DemoBusinessParticipant p = new DemoBusinessParticipant(DemoBusinessParticipant.COMPENSATE, "1234");
      FailureBusinessParticipant fp = new FailureBusinessParticipant(FailureBusinessParticipant.FAIL_IN_COMPENSATE, "5678");
     
      uba.begin();
     
      bpm1 = bam.enlistForBusinessAgreementWithParticipantCompletion(p, "1234");
      bpm2 = bam.enlistForBusinessAgreementWithParticipantCompletion(fp, "5678");

      bpm1.completed();
      bpm2.completed();
     
      uba.cancel();

      passed = p.passed();
  }
  catch (Exception ex)
  {
View Full Code Here

    {
  boolean passed = false;
 
  try
  {
      UserBusinessActivity uba = UserBusinessActivity.getUserBusinessActivity();
      BusinessActivityManager bam = BusinessActivityManager.getBusinessActivityManager();
      com.arjuna.wst.BAParticipantManager bpm = null;
      String participantId = "1234";
      DemoBusinessParticipant p = new DemoBusinessParticipant(DemoBusinessParticipant.COMPENSATE, participantId);
     
      uba.begin();
     
      bpm = bam.enlistForBusinessAgreementWithParticipantCompletion(p, participantId);

      bpm.completed();
     
      uba.cancel();

      passed = p.passed();
  }
  catch (Exception ex)
  {
View Full Code Here

    {
  boolean passed = false;
 
  try
  {
      UserBusinessActivity uba = UserBusinessActivity.getUserBusinessActivity();
      BusinessActivityManager bam = BusinessActivityManager.getBusinessActivityManager();
      DemoBusinessParticipant p = new DemoBusinessParticipant(DemoBusinessParticipant.CLOSE, "1234");
      FailureBusinessParticipant fp = new FailureBusinessParticipant(FailureBusinessParticipant.FAIL_IN_CLOSE, "5678");
     
      uba.begin();
     
      bam.enlistForBusinessAgreementWithParticipantCompletion(p, null);
      bam.enlistForBusinessAgreementWithParticipantCompletion(fp, null);
     
      uba.close();

      passed = p.passed();
  }
  catch (Exception ex)
  {
View Full Code Here

    {
  boolean passed = false;
 
  try
  {
      UserBusinessActivity uba = UserBusinessActivity.getUserBusinessActivity();
      BusinessActivityManager bam = BusinessActivityManager.getBusinessActivityManager();
      DemoBusinessParticipantWithComplete p = new DemoBusinessParticipantWithComplete(DemoBusinessParticipantWithComplete.COMPLETE, "1234");
     
      uba.begin();
     
      bam.enlistForBusinessAgreementWithCoordinatorCompletion(p, "1234");

      uba.complete();
     
      uba.cancel();

      passed = p.passed();
  }
  catch (Exception ex)
  {
View Full Code Here

TOP

Related Classes of com.arjuna.mw.wst.UserBusinessActivity

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.