Class ContextReferenceExecutor<C>

java.lang.Object
org.wildfly.clustering.context.ContextReferenceExecutor<C>
All Implemented Interfaces:
Executor, ContextualExecutor, Contextualizer

public class ContextReferenceExecutor<C> extends Object implements ContextualExecutor
Contextual executor based on a context reference.
Author:
Paul Ferraro
  • Constructor Details

    • ContextReferenceExecutor

      public ContextReferenceExecutor(C targetContext, ContextReference<C> reference)
  • Method Details

    • execute

      public void execute(Runnable runner)
      Specified by:
      execute in interface Executor
    • execute

      public <E extends Exception> void execute(org.wildfly.common.function.ExceptionRunnable<E> runner) throws E
      Description copied from interface: ContextualExecutor
      Executes the specified runner.
      Specified by:
      execute in interface ContextualExecutor
      Type Parameters:
      E - the exception type
      Parameters:
      runner - a runnable task
      Throws:
      E - if execution fails
    • execute

      public <T> T execute(Callable<T> caller) throws Exception
      Description copied from interface: ContextualExecutor
      Executes the specified caller with a given context.
      Specified by:
      execute in interface ContextualExecutor
      Type Parameters:
      T - the return type
      Parameters:
      caller - a callable task
      Returns:
      the result of the caller
      Throws:
      Exception - if execution fails
    • execute

      public <T> T execute(Supplier<T> supplier)
      Description copied from interface: ContextualExecutor
      Executes the specified supplier with a given context.
      Specified by:
      execute in interface ContextualExecutor
      Type Parameters:
      T - the return type
      Parameters:
      supplier - a supplier task
      Returns:
      the result of the supplier
    • execute

      public <T, E extends Exception> T execute(org.wildfly.common.function.ExceptionSupplier<T,E> supplier) throws E
      Description copied from interface: ContextualExecutor
      Executes the specified supplier with a given context.
      Specified by:
      execute in interface ContextualExecutor
      Type Parameters:
      T - the return type
      E - the exception type
      Parameters:
      supplier - a supplier task
      Returns:
      the result of the supplier
      Throws:
      E - if execution fails