Package org.glassfish.grizzly
Interface GrizzlyFuture<R>
-
- Type Parameters:
R
- the result type
- All Known Subinterfaces:
FutureImpl<R>
- All Known Implementing Classes:
ReadyFutureImpl
,SafeFutureImpl
,UnsafeFutureImpl
public interface GrizzlyFuture<R> extends Future<R>, Cacheable
GrizzlyFuture
implementation. Users can register additionalCompletionHandler
s usingaddCompletionHandler(org.glassfish.grizzly.CompletionHandler)
to be notified once the asynchronous computation, represented by this Future, is complete. A GrizzlyFuture instance can be recycled and reused.- Author:
- Alexey Stashok
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description void
addCompletionHandler(CompletionHandler<R> completionHandler)
Adds aCompletionHandler
, which will be notified once the asynchronous computation, represented by this Future, is complete.void
markForRecycle(boolean recycleResult)
Deprecated.void
recycle(boolean recycleResult)
Recycle GrizzlyFuture now.
-
-
-
Method Detail
-
addCompletionHandler
void addCompletionHandler(CompletionHandler<R> completionHandler)
Adds aCompletionHandler
, which will be notified once the asynchronous computation, represented by this Future, is complete.- Parameters:
completionHandler
-CompletionHandler
- Since:
- 2.3.4
-
markForRecycle
@Deprecated void markForRecycle(boolean recycleResult)
Deprecated.Mark GrizzlyFuture as recyclable, so once result will come - GrizzlyFuture object will be recycled and returned to a thread local object pool. You can consider to use this method, if you're not interested in using this GrizzlyFuture object.- Parameters:
recycleResult
- if true - the GrizzlyFuture result, if it support recyclable mechanism, will be also recycled together with this GrizzlyFuture object.
-
recycle
void recycle(boolean recycleResult)
Recycle GrizzlyFuture now. This method could be used, if you're not interested in using this GrizzlyFuture object, and you're sure this object is not used by any other application part.- Parameters:
recycleResult
- if true - the GrizzlyFuture result, if it support recyclable mechanism, will be also recycled together with this GrizzlyFuture object.
-
-