Q - type of ldap requestS - type of ldap responsepublic abstract class AbstractOperationWorker<Q extends Request,S> extends java.lang.Object implements OperationWorker<Q,S>
ExecutorService is provided a cached thread pool is used by default.| Modifier and Type | Field and Description |
|---|---|
protected org.slf4j.Logger |
logger
Logger for this class.
|
private Operation<Q,S> |
operation
operation to execute.
|
private java.util.concurrent.ExecutorService |
service
to submit operations to.
|
| Constructor and Description |
|---|
AbstractOperationWorker(Operation<Q,S> op)
Creates a new abstract operation worker.
|
AbstractOperationWorker(Operation<Q,S> op,
java.util.concurrent.ExecutorService es)
Creates a new abstract operation worker.
|
| Modifier and Type | Method and Description |
|---|---|
static <Q extends Request,S> |
createCallable(Operation<Q,S> operation,
Q request)
Returns a
Callable that executes the supplied request with the supplied operation. |
java.util.Collection<java.util.concurrent.Future<Response<S>>> |
execute(Q... requests)
Execute an ldap operation for each request on a separate thread.
|
java.util.concurrent.Future<Response<S>> |
execute(Q request)
Execute an ldap operation on a separate thread.
|
java.util.Collection<Response<S>> |
executeToCompletion(Q... requests)
Execute an ldap operation for each request on a separate thread and waits for all operations to complete.
|
protected void |
finalize() |
void |
shutdown()
Invokes
ExecutorService.shutdown() on the underlying executor service. |
protected final org.slf4j.Logger logger
private final java.util.concurrent.ExecutorService service
public AbstractOperationWorker(Operation<Q,S> op)
op - operationpublic java.util.concurrent.Future<Response<S>> execute(Q request)
execute in interface OperationWorker<Q extends Request,S>request - containing the data required by this operationpublic java.util.Collection<java.util.concurrent.Future<Response<S>>> execute(Q... requests)
execute in interface OperationWorker<Q extends Request,S>requests - containing the data required by this operationpublic java.util.Collection<Response<S>> executeToCompletion(Q... requests)
executeToCompletion in interface OperationWorker<Q extends Request,S>requests - containing the data required by this operationpublic static <Q extends Request,S> java.util.concurrent.Callable<Response<S>> createCallable(Operation<Q,S> operation, Q request)
Callable that executes the supplied request with the supplied operation.Q - type of ldap requestS - type of ldap responseoperation - to executerequest - to pass to the operationpublic void shutdown()
ExecutorService.shutdown() on the underlying executor service.protected void finalize()
throws java.lang.Throwable
finalize in class java.lang.Objectjava.lang.Throwable