Package com.arjuna.mw.wsas.activity

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


     * 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


     
      ua.start();

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

      ActivityHierarchy ctx = ua.currentActivity();
     
      System.out.println("\nHierarchy: "+ctx);

      if (ctx == null) {
            fail("current activity should not be null");
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) {
            fail("Current activity shoudl be null " + ua.currentActivity());
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) {
            fail("Current activity should be null " + ua.currentActivity());
View Full Code Here

    Object tx = _hierarchies.get(instanceIdentifier.getInstanceIdentifier());

    if (tx instanceof SubordinateCoordinator)
      return registerWithSubordinate((SubordinateCoordinator)tx, participantProtocolService, protocolIdentifier, isSecure);

    ActivityHierarchy hier = (ActivityHierarchy) tx;

    if (hier == null)
      throw new NoActivityException();

    try
View Full Code Here

  public final void associate () throws Exception
  {
    // TODO colocation won't do suspend

    String txIdentifier = _coordManager.identifier().toString();
    ActivityHierarchy hier = _coordManager.suspend();

    _hierarchies.put(txIdentifier, 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

    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

      final InstanceIdentifier instanceIdentifier,
            final boolean isSecure)
      throws AlreadyRegisteredException, InvalidProtocolException,
      InvalidStateException, NoActivityException
  {
    ActivityHierarchy hier = (ActivityHierarchy) _hierarchies
        .get(instanceIdentifier.getInstanceIdentifier());

    if (hier == null) throw new NoActivityException();

    try
View Full Code Here

  public final void associate () throws Exception
  {
    // TODO colocation won't do suspend

    String txIdentifier = _coordManager.identifier().toString();
    ActivityHierarchy hier = _coordManager.suspend();

    _hierarchies.put(txIdentifier, hier);
  }
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.