Package javax.resource.spi.work

Examples of javax.resource.spi.work.ExecutionContext


   public void basicTest() throws Exception
   {
      XATerminator xt = adapter.ctx.getXATerminator();
      WorkManager wm = adapter.ctx.getWorkManager();
      TestWork work = new TestWork();
      ExecutionContext ec = new ExecutionContext();
      Xid xid = new MyXid(1);
      ec.setXid(xid);

      wm.doWork(work, 0l, ec, null);
      if (work.complete == false)
         throw new Exception("Work was not done");
      if (work.e != null)
View Full Code Here


         long started = System.currentTimeMillis();

         if (execContext == null)
         {
            execContext = new ExecutionContext()
         }

         final CountDownLatch startedLatch = new CountDownLatch(1);

         wrapper = new WorkWrapper(this, work, execContext, workListener, startedLatch, null);
View Full Code Here

         if (startTimeout < 0)
            throw new WorkRejectedException("StartTimeout is negative: " + startTimeout);

         if (execContext == null)
         {
            execContext = new ExecutionContext()
         }

         wrapper = new WorkWrapper(this, work, execContext, workListener, null, null);

         if (workListener != null)
View Full Code Here

      if (trace)
      {
         log.trace("Starting work " + this)
      }

      ExecutionContext ctx = getExecutionContext();
     
      if (ctx != null)
      {
         Xid xid = ctx.getXid();
         if (xid != null)
         {
            //JBAS-4002 base value is in seconds as per the API, here we convert to millis
            long timeout = (ctx.getTransactionTimeout() * 1000);
            workManager.getXATerminator().registerWork(work, xid, timeout);
         }
      }
     
      if (ctx != null)
      {
         Xid xid = ctx.getXid();
         if (xid != null)
         {
            workManager.getXATerminator().startWork(work, xid);
         }
      }
View Full Code Here

      if (trace)
      {
         log.trace("Ending work " + this)
      }

      ExecutionContext ctx = getExecutionContext();

      if (ctx != null)
      {
         Xid xid = ctx.getXid();
         if (xid != null)
         {
            workManager.getXATerminator().endWork(work, xid);
         }
      }
View Full Code Here

   protected void cancel()
   {
      if (trace)
         log.trace("Cancel work " + this)

      ExecutionContext ctx = getExecutionContext();

      if (ctx != null)
      {
         Xid xid = ctx.getXid();
         if (xid != null)
         {
            workManager.getXATerminator().cancelWork(work, xid);
         }
      }
View Full Code Here

         if (startTimeout < 0)
            throw new WorkRejectedException("StartTimeout is negative: " + startTimeout);

         if (execContext == null)
         {
            execContext = new ExecutionContext()
         }

         final CountDownLatch completedLatch = new CountDownLatch(1);

         wrapper = new WorkWrapper(this, work, execContext, workListener, null, completedLatch);
View Full Code Here

            workListener.workAccepted(event);
         }

         if (execContext == null)
         {
            execContext = new ExecutionContext()
         }

         final CountDownLatch completedLatch = new CountDownLatch(1);

         wrapper = new WorkWrapper(this, work, execContext, workListener, null, completedLatch,
View Full Code Here

            workListener.workAccepted(event);
         }

         if (execContext == null)
         {
            execContext = new ExecutionContext()
         }

         final CountDownLatch startedLatch = new CountDownLatch(1);

         wrapper = new WorkWrapper(this, work, execContext, workListener, startedLatch, null,
View Full Code Here

            workListener.workAccepted(event);
         }

         if (execContext == null)
         {
            execContext = new ExecutionContext()
         }

         wrapper = new WorkWrapper(this, work, execContext, workListener, null, null,
                                   System.currentTimeMillis());
View Full Code Here

TOP

Related Classes of javax.resource.spi.work.ExecutionContext

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.