Package com.arjuna.ats.internal.jta.transaction.arjunacore.subordinate.jca

Examples of com.arjuna.ats.internal.jta.transaction.arjunacore.subordinate.jca.TransactionImple


   
    /*
     * Check to see if we haven't already imported this thing.
     */
   
    TransactionImple imported = getImportedTransaction(xid);
   
    if (imported == null)
    { 
      imported = new TransactionImple(timeout, xid);
     
      _transactions.put(new XidImple(xid), imported);
    }
   
    return imported;
View Full Code Here


  public static TransactionImple recoverTransaction (Uid actId) throws XAException
  {
    if (actId == null)
      throw new IllegalArgumentException();
   
    TransactionImple recovered = new TransactionImple(actId);

    /*
     * Is the transaction already in the list? This may be the case
     * because we scan the object store periodically and may get Uids to
     * recover for transactions that are progressing normally, i.e., do
     * not need recovery. In which case, we need to ignore them.
     */
   
    TransactionImple tx = (TransactionImple) _transactions.get(recovered.baseXid());
   
    if (tx == null)
    {
      _transactions.put(recovered.baseXid(), recovered);
   
View Full Code Here

    {
      /*
       * We expect the timeout to be in seconds, but it's milliseconds!
       */
     
      TransactionImple tx = TxImporter.importTransaction(xid, (int) timeout/1000);

      switch (tx.getStatus())
      {
      case Status.STATUS_NO_TRANSACTION:
      case Status.STATUS_UNKNOWN:
        throw new WorkCompletedException(
            jbossatxLogger.logMesg.getString("com.arjuna.ats.jbossatx.jta.jca.inactive"),
            WorkException.TX_RECREATE_FAILED);
      case Status.STATUS_ACTIVE:
        break;
      default:
        throw new WorkCompletedException(
            jbossatxLogger.logMesg.getString("com.arjuna.ats.jbossatx.jta.jca.completing"),
            WorkException.TX_CONCURRENT_WORK_DISALLOWED);
      }

      TxWorkManager.addWork(work, tx);

      /*
       * TODO currently means one synchronization per work item and that
       * instance isn't removed when/if the work item is cancelled and
       * another work item is later added.
       *
       * Synchronizations are pretty lightweight and this add/remove/add
       * scenario will hopefully not happen that much. So, we don't
       * optimise for it at the moment. Re-evaluate if it does become an
       * overhead.
       */

      tx.registerSynchronization(new WorkSynchronization(tx));
    }
    catch (WorkCompletedException ex)
    {
      throw ex;
    }
View Full Code Here

 
  public void startWork (Work work, Xid xid) throws WorkCompletedException
  {
    try
    {
      TransactionImple tx = TxImporter.importTransaction(xid);

      // JBoss doesn't seem to use the work parameter!

      if (!TxWorkManager.getWork(tx).equals(work))
      {
View Full Code Here

 
  public void endWork (Work work, Xid xid)
  {
    try
    {
      TransactionImple tx = TxImporter.importTransaction(xid);

      TransactionManager.transactionManager().suspend();

      TxWorkManager.removeWork(work, tx);
    }
View Full Code Here

 
  public void cancelWork (Work work, Xid xid)
  {
    try
    {
      TransactionImple tx = TxImporter.importTransaction(xid);

      TxWorkManager.removeWork(work, tx);
    }
    catch (Exception ex)
    {
View Full Code Here

  public void registerWork (Work work, Xid xid, long timeout)
      throws WorkCompletedException
  {
    try
    {
      TransactionImple tx = TxImporter.importTransaction(xid, (int) timeout);

      switch (tx.getStatus())
      {
      case Status.STATUS_NO_TRANSACTION:
      case Status.STATUS_UNKNOWN:
        throw new WorkCompletedException(
            jbossatxLogger.logMesg.getString("com.arjuna.ats.jbossatx.jta.jca.inactive"),
            WorkException.TX_RECREATE_FAILED);
      case Status.STATUS_ACTIVE:
        break;
      default:
        throw new WorkCompletedException(
            jbossatxLogger.logMesg.getString("com.arjuna.ats.jbossatx.jta.jca.completing"),
            WorkException.TX_CONCURRENT_WORK_DISALLOWED);
      }

      TxWorkManager.addWork(work, tx);

      /*
       * TODO currently means one synchronization per work item and that
       * instance isn't removed when/if the work item is cancelled and
       * another work item is later added.
       *
       * Synchronizations are pretty lightweight and this add/remove/add
       * scenario will hopefully not happen that much. So, we don't
       * optimise for it at the moment. Re-evaluate if it does become an
       * overhead.
       */

      tx.registerSynchronization(new WorkSynchronization(tx));
    }
    catch (WorkCompletedException ex)
    {
      throw ex;
    }
View Full Code Here

 
  public void startWork (Work work, Xid xid) throws WorkCompletedException
  {
    try
    {
      TransactionImple tx = TxImporter.importTransaction(xid);

      // JBoss doesn't seem to use the work parameter!

      if (!TxWorkManager.getWork(tx).equals(work))
      {
View Full Code Here

 
  public void endWork (Work work, Xid xid)
  {
    try
    {
      TransactionImple tx = TxImporter.importTransaction(xid);

      TransactionManager.transactionManager().suspend();

      TxWorkManager.removeWork(work, tx);
    }
View Full Code Here

 
  public void cancelWork (Work work, Xid xid)
  {
    try
    {
      TransactionImple tx = TxImporter.importTransaction(xid);

      TxWorkManager.removeWork(work, tx);
    }
    catch (Exception ex)
    {
View Full Code Here

TOP

Related Classes of com.arjuna.ats.internal.jta.transaction.arjunacore.subordinate.jca.TransactionImple

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.