Package com.arjuna.mw.wscf

Examples of com.arjuna.mw.wscf.UserCoordinator


    {
  boolean passed = false;
 
  try
  {
      UserCoordinator ua = UserCoordinatorFactory.userCoordinator();
      DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
      DocumentBuilder builder = factory.newDocumentBuilder();
      org.w3c.dom.Document doc = builder.newDocument();
      org.w3c.dom.Element root = doc.createElement("Nested1-test");
 
      ua.start();

      System.out.println("Started: "+ua.activityName()+"\n");

      DeploymentContext manager = DeploymentContextFactory.deploymentContext();
      Context theContext = manager.context();

        ((SOAPContext)theContext).serialiseToElement(root) ;
      doc.appendChild(root);

      System.out.println(com.arjuna.mw.wscf.utils.DomUtil.nodeAsString(doc));

      ua.start();

      System.out.println("Started: "+ua.activityName()+"\n");
     
      theContext = manager.context();

      doc = builder.newDocument();
     
      root = doc.createElement("Nested1-test");
        ((SOAPContext)theContext).serialiseToElement(root) ;
     
      doc.appendChild(root);

      System.out.println(com.arjuna.mw.wscf.utils.DomUtil.nodeAsString(doc));

      CoordinatorManager cm = CoordinatorManagerFactory.coordinatorManager();
     
      cm.addParticipant(new DemoParticipant(), Priorities.PARTICIPANT, null);
     
      Outcome res = ua.end();

      if (res instanceof CoordinationOutcome)
      {
    CoordinationOutcome out = (CoordinationOutcome) res;
   
    if (out.result() == TwoPhaseResult.CANCELLED)
        passed = true;
    else
        System.out.println("Result is: "+TwoPhaseResult.stringForm(out.result()));
      }
      else
    System.out.println("Outcome is: "+res);

      res = ua.end();

      if (res instanceof CoordinationOutcome)
      {
    CoordinationOutcome out = (CoordinationOutcome) res;
   
View Full Code Here


      System.exit(0);
  }
 
  try
  {
      UserCoordinator ua = UserCoordinatorFactory.userCoordinator(implementationDoc);
      DocumentBuilder builder = DomUtil.getDocumentBuilder();
      org.w3c.dom.Document doc = builder.newDocument();
      org.w3c.dom.Element root = doc.createElement("TopLevel2-test");
 
      ua.start();

      System.out.println("Started: "+ua.activityName()+"\n");

      DeploymentContext manager = DeploymentContextFactory.deploymentContext();
      Context theContext = manager.context();
     
        ((SOAPContext)theContext).serialiseToElement(root) ;
      doc.appendChild(root);

      System.out.println(DomUtil.nodeAsString(doc));

      CoordinatorManager cm = CoordinatorManagerFactory.coordinatorManager(implementationDoc);
     
      //      cm.addParticipant(new DemoXAParticipant(), Priorities.PARTICIPANT, null);
      cm.addParticipant(new DemoXAParticipant(), 0, null);

      System.out.println("\nEnding coordination.");
     
      ua.setCompletionStatus(Success.instance());
     
      Outcome res = ua.end();

      if (res instanceof XAOutcome)
      {
    XAOutcome out = (XAOutcome) res;
   
View Full Code Here

    {
  boolean passed = false;
 
  try
  {
      UserCoordinator ua = UserCoordinatorFactory.userCoordinator();
 
      ua.start();

      System.out.println("Started: "+ua.activityName());
     
      ua.setCompletionStatus(Success.instance());

      ua.start();

      System.out.println("Started: "+ua.activityName());
     
      ua.setCompletionStatus(Success.instance());
     
      ContextManager manager = new ContextManager();
      com.arjuna.mw.wsas.context.Context[] contexts = manager.contexts();

      if (contexts != null)
      {
    for (int i = 0; i < contexts.length; i++)
        System.out.println(contexts[i]);
      }

      CoordinatorManager cm = CoordinatorManagerFactory.coordinatorManager();
     
      cm.addParticipant(new DemoParticipant(false), Priorities.PARTICIPANT, null);

      Outcome res = ua.end();

      if (res instanceof CoordinationOutcome)
      {
    CoordinationOutcome out = (CoordinationOutcome) res;
   
    if (out.result() == TwoPhaseResult.CONFIRMED)
        passed = true;
    else
        System.out.println("Result is: "+TwoPhaseResult.stringForm(out.result()));
      }
      else
    System.out.println("Outcome is: "+res);     

      res = ua.end();

      if (res instanceof CoordinationOutcome)
      {
    CoordinationOutcome out = (CoordinationOutcome) res;
   
View Full Code Here

        implementationDoc = pl.getProtocol();

  try
  {
      UserCoordinator ua = UserCoordinatorFactory.userCoordinator(implementationDoc);
      DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
      DocumentBuilder builder = factory.newDocumentBuilder();
      org.w3c.dom.Document doc = builder.newDocument();
      org.w3c.dom.Element root = doc.createElement("TopLevel1-test");
 
      ua.start();

      System.out.println("Started: "+ua.activityName()+"\n");

      DeploymentContext manager = DeploymentContextFactory.deploymentContext();
      Context theContext = manager.context();
       
        ((SOAPContext)theContext).serialiseToElement(root) ;
     
      doc.appendChild(root);

      System.out.println(DomUtil.nodeAsString(doc));

      CoordinatorManager cm = CoordinatorManagerFactory.coordinatorManager(implementationDoc);
     
      //      cm.addParticipant(new DemoXAParticipant(), Priorities.PARTICIPANT, null);
      cm.addParticipant(new DemoXAParticipant(), 0, null);

      System.out.println("\nEnding coordination.");
     
      Outcome res = ua.end();

      if (res instanceof XAOutcome)
      {
            XAOutcome out = (XAOutcome) res;
   
View Full Code Here

        Class clazz = this.getClass().getClassLoader().loadClass(className);
      ProtocolLocator pl = new ProtocolLocator(clazz);

      implementationDoc = pl.getProtocol();

      UserCoordinator ua = UserCoordinatorFactory.userCoordinator(implementationDoc);

    try
    {
      ua.start();

      System.out.println("Started: "+ua.activityName()+"\n");

      Outcome res = ua.end();

      if (res instanceof CoordinationOutcome)
      {
    CoordinationOutcome co = (CoordinationOutcome) res;
        int result = co.result();
View Full Code Here

    {
  boolean passed = false;
 
  try
  {
      UserCoordinator ua = UserCoordinatorFactory.userCoordinator();
 
      ua.start();
     
      ua.end();

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

    {
  boolean passed = false;
 
  try
  {
      UserCoordinator ua = UserCoordinatorFactory.userCoordinator();
 
      ua.start();

      System.out.println("Started: "+ua.activityName());
     
      ua.setCompletionStatus(Success.instance());

      ua.start();

      System.out.println("Started: "+ua.activityName());
     
      ua.setCompletionStatus(Success.instance());
     
      ContextManager manager = new ContextManager();
      com.arjuna.mw.wsas.context.Context[] contexts = manager.contexts();

      if (contexts != null)
      {
    for (int i = 0; i < contexts.length; i++)
        System.out.println(contexts[i]);
      }

      CoordinatorManager cm = CoordinatorManagerFactory.coordinatorManager();
     
      cm.addParticipant(new DemoParticipant(false), Priorities.PARTICIPANT, null);
      cm.addParticipant(new DemoParticipant(false), Priorities.PARTICIPANT, null);

      Outcome res = ua.end();

      if (res instanceof CoordinationOutcome)
      {
    CoordinationOutcome out = (CoordinationOutcome) res;
   
    if (out.result() == TwoPhaseResult.CONFIRMED)
        passed = true;
    else
        System.out.println("Result is: "+TwoPhaseResult.stringForm(out.result()));
      }
      else
    System.out.println("Outcome is: "+res);     

      res = ua.end();

      if (res instanceof CoordinationOutcome)
      {
    CoordinationOutcome out = (CoordinationOutcome) res;
   
View Full Code Here

    {
  boolean passed = false;
 
  try
  {
      UserCoordinator ua = UserCoordinatorFactory.userCoordinator();
 
      ua.start();

      System.out.println("Started: "+ua.activityName());
     
      ua.setCompletionStatus(Success.instance());
     
      ContextManager manager = new ContextManager();
      com.arjuna.mw.wsas.context.Context[] contexts = manager.contexts();

      if (contexts != null)
      {
    for (int i = 0; i < contexts.length; i++)
        System.out.println(contexts[i]);
      }

      CoordinatorManager cm = CoordinatorManagerFactory.coordinatorManager();
     
      cm.addParticipant(new DemoParticipant(true), Priorities.PARTICIPANT, null);
      cm.addParticipant(new DemoParticipant(false), Priorities.PARTICIPANT, null);

      Outcome res = ua.end();

      if (res instanceof CoordinationOutcome)
      {
    CoordinationOutcome out = (CoordinationOutcome) res;
   
View Full Code Here

    {
  boolean passed = false;
 
  try
  {
      UserCoordinator ua = UserCoordinatorFactory.userCoordinator();
 
      ua.start();

      System.out.println("Started: "+ua.activityName());
     
      ua.setCompletionStatus(Success.instance());
     
      ContextManager manager = new ContextManager();
      com.arjuna.mw.wsas.context.Context[] contexts = manager.contexts();

      if (contexts != null)
      {
    for (int i = 0; i < contexts.length; i++)
        System.out.println(contexts[i]);
      }

      CoordinatorManager cm = CoordinatorManagerFactory.coordinatorManager();
     
      cm.addParticipant(new DemoParticipant(false), Priorities.PARTICIPANT, null);

      Outcome res = ua.end();

      if (res instanceof CoordinationOutcome)
      {
    CoordinationOutcome out = (CoordinationOutcome) res;
   
View Full Code Here

    {
  boolean passed = false;
 
  try
  {
      UserCoordinator ua = UserCoordinatorFactory.userCoordinator();
 
      ua.start();

      System.out.println("Started: "+ua.activityName());
     
      ua.setCompletionStatus(Success.instance());

      CoordinatorManager cm = CoordinatorManagerFactory.coordinatorManager();
     
      cm.addParticipant(new DemoParticipant(true), Priorities.PARTICIPANT, null);

      ua.start();

      System.out.println("Started: "+ua.activityName());
     
      ua.setCompletionStatus(Success.instance());
     
      ContextManager manager = new ContextManager();
      com.arjuna.mw.wsas.context.Context[] contexts = manager.contexts();

      if (contexts != null)
      {
    for (int i = 0; i < contexts.length; i++)
        System.out.println(contexts[i]);
      }

      cm.addParticipant(new FailureParticipant(false, FailureParticipant.NESTED_PREPARE), Priorities.PARTICIPANT, null);

      Outcome res = ua.end();

      if (res instanceof CoordinationOutcome)
      {
    CoordinationOutcome out = (CoordinationOutcome) res;
   
    if (out.result() == TwoPhaseResult.CANCELLED)
        passed = true;
    else
        System.out.println("Result is: "+TwoPhaseResult.stringForm(out.result()));
      }
      else
    System.out.println("Outcome is: "+res);

      res = ua.end();

      if (res instanceof CoordinationOutcome)
      {
    CoordinationOutcome out = (CoordinationOutcome) res;
   
View Full Code Here

TOP

Related Classes of com.arjuna.mw.wscf.UserCoordinator

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.