Q
- type of ldap requestS
- type of ldap responsepublic abstract class AbstractOperationWorker<Q extends Request,S> extends Object implements OperationWorker<Q,S>
ExecutorService
is provided a cached thread pool is used by default.Modifier and Type | Field and Description |
---|---|
protected Logger |
logger
Logger for this class.
|
private Operation<Q,S> |
operation
operation to execute.
|
private 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,
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. |
Collection<Future<Response<S>>> |
execute(Q... requests)
Execute an ldap operation for each request on a separate thread.
|
Future<Response<S>> |
execute(Q request)
Execute an ldap operation on a separate thread.
|
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 Logger logger
private final ExecutorService service
public AbstractOperationWorker(Operation<Q,S> op)
op
- operationpublic AbstractOperationWorker(Operation<Q,S> op, ExecutorService es)
op
- operationes
- executor servicepublic Future<Response<S>> execute(Q request)
execute
in interface OperationWorker<Q extends Request,S>
request
- containing the data required by this operationpublic Collection<Future<Response<S>>> execute(Q... requests)
execute
in interface OperationWorker<Q extends Request,S>
requests
- containing the data required by this operationpublic 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> 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.Copyright © 2003-2019 Virginia Tech. All Rights Reserved.