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 task, but only if the service was not already closed.
|
<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)
Executes the specified task, but only if the service was not already closed.
|
<R> Optional<R> |
execute(Supplier<R> executeTask)
Executes the specified task, but only if the service was not already closed.
|
public void execute(Runnable executeTask)
ServiceExecutor
execute
in interface ServiceExecutor
executeTask
- a task to executepublic <E extends Exception> void execute(org.wildfly.common.function.ExceptionRunnable<E> executeTask) throws E extends Exception
ServiceExecutor
execute
in interface ServiceExecutor
executeTask
- a task to executeE
- if the task execution failedE extends Exception
public <R> Optional<R> execute(Supplier<R> executeTask)
ServiceExecutor
execute
in interface ServiceExecutor
executeTask
- a task to executepublic <R,E extends Exception> Optional<R> execute(org.wildfly.common.function.ExceptionSupplier<R,E> executeTask) throws E extends Exception
ServiceExecutor
execute
in interface ServiceExecutor
executeTask
- a task to executeE
- if the task execution failedE extends Exception
public void close(Runnable closeTask)
ServiceExecutor
ServiceExecutor.close(Runnable)
invocations.close
in interface ServiceExecutor
closeTask
- a task which closes the serviceCopyright © 2019 JBoss by Red Hat. All rights reserved.