FileDocCategorySizeDatePackage
AdapterTask.javaAPI DocJBoss 4.2.13528Fri Jul 13 21:02:30 BST 2007org.jboss.aspects.asynchronous.concurrent

AdapterTask

public final class AdapterTask extends Object implements org.jboss.aspects.asynchronous.ProcessingTime, org.jboss.aspects.asynchronous.AsynchronousConstants, EDU.oswego.cs.dl.util.concurrent.Callable
author
{Claude Hussenet Independent Consultant}.
version
$Revision: 57186 $

Fields Summary
private org.jboss.aspects.asynchronous.AsynchronousParameters
_inputParametersImpl
private org.jboss.aspects.asynchronous.AsynchronousUserTask
_taskImpl
private String
id
private long
startingTime
private long
endingTime
Constructors Summary
AdapterTask(String id, org.jboss.aspects.asynchronous.AsynchronousParameters inputParametersImpl, org.jboss.aspects.asynchronous.AsynchronousUserTask taskImpl)


    

                

                
   

      _inputParametersImpl = inputParametersImpl;

      _taskImpl = taskImpl;

      this.id = id;

   
Methods Summary
public java.lang.Objectcall()


      try
      {

         startingTime = System.currentTimeMillis();

         AsynchronousResponse taskResult =

         _taskImpl.process(_inputParametersImpl);

         endingTime = System.currentTimeMillis();

         ThreadManagerResponse myResult =

         new ThreadManagerResponseImpl(getId(),

         OK,

         null,

         taskResult,

         startingTime,

         endingTime);

         return myResult;

      }
      catch (Exception e)
      {

         try
         {

            endingTime = System.currentTimeMillis();

            return new ThreadManagerResponseImpl(getId(),

            UNKNOWN,

            e.getMessage(),

            e);

         }
         catch (Exception ee)
         {

            endingTime = System.currentTimeMillis();

            return new ThreadManagerResponseImpl(getId(),

            UNKNOWN,

            e.getMessage(),

            ee);

         }

      }

   
public voidcleanup()


      _taskImpl.cleanup(_inputParametersImpl);

   
public longgetEndingTime()


      return endingTime;

   
public java.lang.StringgetId()


      return id;

   
public longgetStartingTime()


      return startingTime;