net.sf.asyncobjects.util.callbacks
Class CallableAdapter<T>
java.lang.Object
net.sf.asyncobjects.util.callbacks.CallableAdapter<T>
- Type Parameters:
T
- a value type
- All Implemented Interfaces:
- ExplicitSharing
public abstract class CallableAdapter<T>
- extends Object
- implements ExplicitSharing
This is an adapter for callable actions that allows to create
ACallable
instances using anonymous inner classes.
- Author:
- const
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CallableAdapter
public CallableAdapter()
export
public final ACallable<T> export()
- Returns:
- export as callable asynchronous object
- See Also:
ACallable.call()
call
protected abstract Promise<? extends T> call()
throws Throwable
- Call the action
- Returns:
- a promise for value or null
- Throws:
Throwable
- if there is a problem with action execution
wrap
public static <V> ACallable<V> wrap(Callable<V> callable)
- Wrap
Callable
object into asynchronous object
- Type Parameters:
V
- a value type- Parameters:
callable
- a callable object
- Returns:
- async object that wraps it
Copyright © 2002-2007 Constantine Plotnikov. All Rights Reserved.