public class StampedLockServiceExecutor extends Object implements ServiceExecutor
ServiceExecutor implemented via a StampedLock.| Constructor and Description |
|---|
StampedLockServiceExecutor() |
| Modifier and Type | Method and Description |
|---|---|
void |
close(Runnable closeTask)
Closes the service, executing the specified task, first waiting for any concurrent executions to complete.
|
<E extends Exception> |
execute(org.wildfly.common.function.ExceptionRunnable<E> executeTask)
Executes the specified runner.
|
<R,E extends Exception> |
execute(org.wildfly.common.function.ExceptionSupplier<R,E> executeTask)
Executes the specified task, but only if the service was not already closed.
|
void |
execute(Runnable executeTask) |
<R> Optional<R> |
execute(Supplier<R> executeTask)
Executes the specified task, but only if the service was not already closed.
|
public <E extends Exception> void execute(org.wildfly.common.function.ExceptionRunnable<E> executeTask) throws E extends Exception
ExecutorE - the exception typeexecuteTask - a runnable taskE - if execution failsE extends Exceptionpublic <R> Optional<R> execute(Supplier<R> executeTask)
ServiceExecutorexecute in interface ServiceExecutorexecuteTask - a task to executepublic <R,E extends Exception> Optional<R> execute(org.wildfly.common.function.ExceptionSupplier<R,E> executeTask) throws E extends Exception
ServiceExecutorexecute in interface ServiceExecutorexecuteTask - a task to executeE - if the task execution failedE extends Exceptionpublic void close(Runnable closeTask)
ServiceExecutorServiceExecutor.close(Runnable) invocations.close in interface ServiceExecutorcloseTask - a task which closes the serviceCopyright © 2021 JBoss by Red Hat. All rights reserved.