Package com.arjuna.mw.wsas.activity

Examples of com.arjuna.mw.wsas.activity.ActivityHierarchy


  private final ACCoordinator parentCoordinator () throws SystemException
  {
    try
    {
      ActivityHierarchy hier = UserActivityFactory.userActivity().currentActivity();
      ActivityHandleImple parentActivity = null;
      ACCoordinator parentCoordinator = null;

      if (hier.size() > 1)
      {
        parentActivity = (ActivityHandleImple) hier.activity(hier.size() - 2);

        parentCoordinator = (ACCoordinator) _coordinators.get(parentActivity);
      }

      return parentCoordinator;
View Full Code Here


    private final ActivityHandleImple currentActivity () throws SystemException
    {
  try
  {
      ActivityHierarchy hier = UserActivityFactory.userActivity().currentActivity();
 
      if (hier.size() > 0)
    return (ActivityHandleImple) hier.activity(hier.size() -1);
      else
    return null;
  }
  catch (Exception ex)
  {
View Full Code Here

 
    private final ACCoordinator parentCoordinator () throws SystemException
    {
  try
  {
      ActivityHierarchy hier = UserActivityFactory.userActivity().currentActivity();
      ActivityHandleImple parentActivity = null;
      ACCoordinator parentCoordinator = null;

      if (hier.size() > 1)
      {
    parentActivity = (ActivityHandleImple) hier.activity(hier.size() -2);

    parentCoordinator = (ACCoordinator) _coordinators.get(parentActivity);
      }

      return parentCoordinator;
View Full Code Here

    public Transaction suspend () throws javax.transaction.SystemException
    {
  try
  {
      ActivityHierarchy hier = UserActivityFactory.userActivity().suspend();
      Transaction tx = _coordControl.transaction(hier);

      _transactions.put(tx, hier);

      return tx;
View Full Code Here

    public void resume (Transaction which) throws InvalidTransactionException, java.lang.IllegalStateException, javax.transaction.SystemException
    {
  try
  {
      ActivityHierarchy hier = (ActivityHierarchy) _transactions.get(which);

      if ((which != null) && (hier == null))
    throw new InvalidTransactionException();
     
      UserActivityFactory.userActivity().resume(hier);
View Full Code Here

    {
        try
        {
            ACCoordinator currentCoordinator = (ACCoordinator) param;

            ActivityHierarchy hier = null;
           
            try
            {
                hier = UserActivityFactory.userActivity().currentActivity();
            }
            catch (SystemException ex)
            {
                ex.printStackTrace();
            }

            if ((currentCoordinator != null) && (hier != null))
            {
                /*
                 * Do the manditory stuff first.
                 */

                ActionHierarchy txHier = currentCoordinator.getHierarchy();
                final int depth = txHier.depth() ;
                _identifierValues = new String[depth] ;
                _expiresValues = new int[depth] ;
               
                _identifierValues[0] = txHier.getDeepestActionUid().stringForm() ;
                _expiresValues[0] = hier.activity(hier.size()-1).getTimeout() ;
               
                /*
                 * Now let's do the optional stuff.
                 */

                for(int count = 1, index = 0 ; count < depth ; count++, index++)
                {
                    _identifierValues[count] = txHier.getActionUid(index).stringForm() ;
                    _expiresValues[count] = hier.activity(index).getTimeout() ;
                }
            }
        }
        catch (ClassCastException ex)
        {
View Full Code Here

  {
    try
    {
      ACCoordinator currentCoordinator = (ACCoordinator) param;
           
      ActivityHierarchy hier = null;

      try
      {
        hier = UserActivityFactory.userActivity().currentActivity();
      }
      catch (SystemException ex)
      {
        ex.printStackTrace();
      }

      if ((currentCoordinator != null) && (hier != null))
      {
        /*
         * Do the manditory stuff first.
         */

        ActionHierarchy txHier = currentCoordinator.getHierarchy();
                final int depth = txHier.depth() ;
                _identifierValues = new String[depth] ;
                _expiresValues = new int[depth] ;
               
                _identifierValues[0] = txHier.getDeepestActionUid().stringForm() ;
                _expiresValues[0] = hier.activity(hier.size()-1).getTimeout() ;
               
        /*
         * Now let's do the optional stuff.
         */
                for(int count = 1, index = 0 ; count < depth ; count++, index++)
                {
                    _identifierValues[count] = txHier.getActionUid(index).stringForm() ;
                    _expiresValues[count] = hier.activity(index).getTimeout() ;
                }
      }
    }
    catch (ClassCastException ex)
    {
View Full Code Here

     * otherwise.
     */

    private final boolean addBasicContext (org.w3c.dom.Element root)
    {
      ActivityHierarchy hier = null;
      boolean added = false;
     
      try
      {
          hier = UserActivityFactory.userActivity().currentActivity();
      }
      catch (SystemException ex)
      {
          ex.printStackTrace();
      }

      if (hier != null)
      {
          added = true;
         
          for (int i = 0; i < hier.size(); i++)
          {
            org.w3c.dom.Element element = _doc.createElement(_contextElement);
            org.w3c.dom.Element timeout = _doc.createElement("timeout");
       
            timeout.appendChild(_doc.createTextNode(""+hier.activity(i).getTimeout()));
            element.appendChild(timeout);
       
            org.w3c.dom.Element type = _doc.createElement("type");
            type.appendChild(_doc.createTextNode(_typeName));
            element.appendChild(type);
       
            org.w3c.dom.Element ctxId = _doc.createElement("ctxId");
            ctxId.appendChild(_doc.createTextNode("urn:"+hier.activity(i).toString()));
            element.appendChild(ctxId);
       
            root.appendChild(element);
          }
      }
View Full Code Here

     
      ac2 = ua.activityId();

      System.out.println("\nStarted: "+ac2);
     
      ActivityHierarchy ctx = ua.suspend();
     
      System.out.println("\nSuspended: "+ctx);
     
      if (ua.currentActivity() == null)
      {
View Full Code Here

 
      ua.start();
     
      System.out.println("Started: "+ua.activityName());
     
      ActivityHierarchy ctx = ua.suspend();
     
      System.out.println("\nSuspended: "+ctx);
     
      if (ua.currentActivity() == null)
    passed = true;
View Full Code Here

TOP

Related Classes of com.arjuna.mw.wsas.activity.ActivityHierarchy

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.