AsynchronousTaskImplpublic final class AsynchronousTaskImpl extends Object implements org.jboss.aspects.asynchronous.AsynchronousConstants, org.jboss.aspects.asynchronous.concurrent.AsynchronousTask
Fields Summary |
---|
private long | _timeout | private org.jboss.aspects.asynchronous.AsynchronousParameters | _inputParametersImpl | private org.jboss.aspects.asynchronous.AsynchronousUserTask | _oneInstance | private EDU.oswego.cs.dl.util.concurrent.FutureResult | _futureResult | private EDU.oswego.cs.dl.util.concurrent.Callable | _callable | private String | _id |
Methods Summary |
---|
public java.lang.Runnable | add()
try
{
if (_timeout == 0)
_callable =
new AdapterTask(getId(),
_inputParametersImpl,
_oneInstance);
else
_callable =
new TimedCallableImpl(new AdapterTask(getId(),
_inputParametersImpl,
_oneInstance),
_timeout);
return _futureResult.setter(_callable);
}
catch (Exception e)
{
throw e;
}
| public long | getEndingTime()
return ((ProcessingTime) _callable).getEndingTime();
| public java.lang.String | getId()
return _id;
| public org.jboss.aspects.asynchronous.AsynchronousParameters | getInputParameters()
return _inputParametersImpl;
| public org.jboss.aspects.asynchronous.ThreadManagerResponse | getResponse()
try
{
if (isDone())
return (ThreadManagerResponse) _futureResult.get();
else
{
Object value = _futureResult.get();
if (value != null)
return (ThreadManagerResponse) value;
else
return new ThreadManagerResponseImpl(getId(),
NOVALUE,
null,
null);
}
}
catch (TimeoutException e)
{
return new ThreadManagerResponseImpl(getId(),
TIMEOUT,
e.getMessage(),
e,
getStartingTime(),
getEndingTime());
}
catch (InterruptedException e)
{
return new ThreadManagerResponseImpl(getId(),
INTERRUPTED,
e.getMessage(),
e,
getStartingTime(),
getEndingTime());
}
catch (InvocationTargetException e)
{
int errorCode = INVOCATION;
if (e.getTargetException()
instanceof EDU.oswego.cs.dl.util.concurrent.TimeoutException)
errorCode = TIMEOUT;
return new ThreadManagerResponseImpl(getId(),
errorCode,
e.getTargetException().getMessage(),
e.getTargetException(),
getStartingTime(),
getEndingTime());
}
| public long | getStartingTime()
return ((ProcessingTime) _callable).getStartingTime();
| public org.jboss.aspects.asynchronous.AsynchronousUserTask | getTask()
return _oneInstance;
| public long | getTimeout()
return _timeout;
| public boolean | isDone()
return _futureResult.isReady();
|
|