A C D E G H I M N O P R S T U V W
All Classes All Packages
All Classes All Packages
All Classes All Packages
A
- AbstractThreadLocalContext<T> - Class in nl.talsmasoftware.context.threadlocal
-
Abstract base class maintaining a shared, static
ThreadLocalinstance for each concrete subclass. - AbstractThreadLocalContext(Class<? extends ContextManager<? super T>>, T) - Constructor for class nl.talsmasoftware.context.threadlocal.AbstractThreadLocalContext
-
Instantiates a new context with the specified value.
- AbstractThreadLocalContext(T) - Constructor for class nl.talsmasoftware.context.threadlocal.AbstractThreadLocalContext
-
Deprecated.Using this constructor makes it impossible to register a
ContextObserver! - awaitTermination(long, TimeUnit) - Method in class nl.talsmasoftware.context.delegation.DelegatingExecutorService
C
- CallMappingExecutorService - Class in nl.talsmasoftware.context.delegation
-
Abstract base-class that makes it a little easier to schedule tasks (
RunnableorCallableobjects) using an existingExecutorServicewhile providing a custommappingfor all tasks before they get scheduled. - CallMappingExecutorService(ExecutorService) - Constructor for class nl.talsmasoftware.context.delegation.CallMappingExecutorService
-
Constructor to create a new wrapper around the specified
service delegate. - cancel(boolean) - Method in class nl.talsmasoftware.context.delegation.DelegatingFuture
- clear() - Method in interface nl.talsmasoftware.context.clearable.Clearable
-
Clears the current context and any potential parent contexts that may be stacked.
- Clearable - Interface in nl.talsmasoftware.context.clearable
-
Interface that marks an to be 'clearable'.
- ClearableContextManager<T> - Interface in nl.talsmasoftware.context.clearable
-
Convenience interface to mark a Clearable
ContextManager. - clearActiveContexts() - Static method in class nl.talsmasoftware.context.ContextManagers
-
Clears all active contexts from the current thread.
- close() - Method in interface nl.talsmasoftware.context.Context
-
Closes this context.
- close() - Method in class nl.talsmasoftware.context.threadlocal.AbstractThreadLocalContext
-
Closes this context and in case this context is the active context, restores the active context to the (unclosed) parent context.
If no unclosed parent context exists, the 'active context' is cleared. - Context<T> - Interface in nl.talsmasoftware.context
-
A context can be anything that needs to be maintained on the 'current thread' level.
- ContextAwareExecutorService - Class in nl.talsmasoftware.context.executors
-
Executor service that wraps another executor service, making sure background tasks operates 'within' a context snapshot taken from the submitting thread.
- ContextAwareExecutorService(ExecutorService) - Constructor for class nl.talsmasoftware.context.executors.ContextAwareExecutorService
- ContextManager<T> - Interface in nl.talsmasoftware.context
-
The contract for a ContextManager Service.
- ContextManagers - Class in nl.talsmasoftware.context
-
Utility class to allow concurrent systems to
take snapshots of all contextsfrom knownContextManagerimplementations. - ContextObserver<T> - Interface in nl.talsmasoftware.context.observer
-
Observe context updates for a particular class of ContextManager.
- ContextObservers - Class in nl.talsmasoftware.context.observer
-
Deprecated.The (static) utility methods from this class were moved to the
ContextManagersclass. - ContextSnapshot - Interface in nl.talsmasoftware.context
-
Interface for a 'snapshot' that can capture the (then-) 'active context' from all known registered
ContextManagerimplementations.
Obtain a new snapshot by callingContextManagers.createContextSnapshot()which will include a snapshot for all supportedContexttypes through their respectivemanagers. - ContextSnapshotSupplier - Interface in nl.talsmasoftware.context.delegation
-
Interface for a
SupplierofContextSnapshot. - ContextTimer - Interface in nl.talsmasoftware.context.timing
-
Minimal Service Provider Interface for services that wish to get informed of context switching metrics.
- createContextSnapshot() - Static method in class nl.talsmasoftware.context.ContextManagers
-
This method is able to create a 'snapshot' from the current
active contextfrom all knownContextManagerimplementations. - current(Class<? extends CTX>) - Static method in class nl.talsmasoftware.context.threadlocal.AbstractThreadLocalContext
D
- delegate() - Method in class nl.talsmasoftware.context.delegation.Wrapper
-
Delegate method that can be overridden in case the delegate is not yet available at construction time or when there some strategy applicable that determines the delegate at runtime.
- DelegatingExecutorService - Class in nl.talsmasoftware.context.delegation
-
Abstract baseclass that makes it a little easier to wrap existing
ExecutorServiceimplementations by forwarding all methods to adelegateexecutor service.
The class also provides overridablewrappermethods for all complex input (e.g. - DelegatingExecutorService(ExecutorService) - Constructor for class nl.talsmasoftware.context.delegation.DelegatingExecutorService
-
Creates a new executor service that delegates all methods to the specified
delegate. - DelegatingFuture<V> - Class in nl.talsmasoftware.context.delegation
-
Abstract baseclass that simplifies wrapping an existing
Futureby forwarding all required methods to adelegate futureobject.
The class also provides overridable wrapper methods forresultandexceptionoutcomes. - DelegatingFuture(Future<V>) - Constructor for class nl.talsmasoftware.context.delegation.DelegatingFuture
E
- equals(Object) - Method in class nl.talsmasoftware.context.delegation.DelegatingExecutorService
- equals(Object) - Method in class nl.talsmasoftware.context.delegation.Wrapper
- equals(Object) - Method in class nl.talsmasoftware.context.delegation.WrapperWithContext
- execute(Runnable) - Method in class nl.talsmasoftware.context.delegation.DelegatingExecutorService
G
- get() - Method in interface nl.talsmasoftware.context.delegation.ContextSnapshotSupplier
-
Supply a snapshot.
- get() - Method in class nl.talsmasoftware.context.delegation.DelegatingFuture
- get(long, TimeUnit) - Method in class nl.talsmasoftware.context.delegation.DelegatingFuture
- getActiveContext() - Method in interface nl.talsmasoftware.context.ContextManager
-
The currently active context, or
nullif no context is active. - getObservedContextManager() - Method in interface nl.talsmasoftware.context.observer.ContextObserver
-
The observed context manager(s).
- getValue() - Method in interface nl.talsmasoftware.context.Context
-
Returns the value associated with this context.
- getValue() - Method in class nl.talsmasoftware.context.threadlocal.AbstractThreadLocalContext
-
Returns the value of this context instance, or
nullif it was already closed.
H
- hashCode() - Method in class nl.talsmasoftware.context.delegation.DelegatingExecutorService
- hashCode() - Method in class nl.talsmasoftware.context.delegation.Wrapper
- hashCode() - Method in class nl.talsmasoftware.context.delegation.WrapperWithContext
I
- initializeNewContext(T) - Method in interface nl.talsmasoftware.context.ContextManager
-
Initialize a new context containing the specified
value. - invokeAll(Collection<? extends Callable<T>>) - Method in class nl.talsmasoftware.context.delegation.DelegatingExecutorService
- invokeAll(Collection<? extends Callable<T>>, long, TimeUnit) - Method in class nl.talsmasoftware.context.delegation.DelegatingExecutorService
- invokeAny(Collection<? extends Callable<T>>) - Method in class nl.talsmasoftware.context.delegation.DelegatingExecutorService
- invokeAny(Collection<? extends Callable<T>>, long, TimeUnit) - Method in class nl.talsmasoftware.context.delegation.DelegatingExecutorService
- isCancelled() - Method in class nl.talsmasoftware.context.delegation.DelegatingFuture
- isClosed() - Method in class nl.talsmasoftware.context.threadlocal.AbstractThreadLocalContext
-
Returns whether this context is closed or not.
- isDone() - Method in class nl.talsmasoftware.context.delegation.DelegatingFuture
- isShutdown() - Method in class nl.talsmasoftware.context.delegation.DelegatingExecutorService
- isTerminated() - Method in class nl.talsmasoftware.context.delegation.DelegatingExecutorService
M
- map(Callable<V>) - Method in class nl.talsmasoftware.context.delegation.CallMappingExecutorService
-
The call mapping that needs to be implemented: map the given callable object into a desired variant before scheduling.
- map(Callable<V>) - Method in class nl.talsmasoftware.context.executors.ContextAwareExecutorService
-
This method maps any callable (before scheduling it) by taking a snapshot of the context in the scheduling thread and propagating this context into the executed callable by snapshot reactivation.
N
- nl.talsmasoftware.context - package nl.talsmasoftware.context
-
Main package defining the core
context-propagationconcepts in this library - nl.talsmasoftware.context.clearable - package nl.talsmasoftware.context.clearable
-
The
Clearableinterface and aClearableContextManagerin particular. - nl.talsmasoftware.context.delegation - package nl.talsmasoftware.context.delegation
-
Layered code for delegation such as
CallMappingExecutorService. - nl.talsmasoftware.context.executors - package nl.talsmasoftware.context.executors
-
Package for context aware executors.
- nl.talsmasoftware.context.observer - package nl.talsmasoftware.context.observer
-
Observe context changes
- nl.talsmasoftware.context.threadlocal - package nl.talsmasoftware.context.threadlocal
-
Package for
ThreadLocalspecific classes. - nl.talsmasoftware.context.timing - package nl.talsmasoftware.context.timing
-
Package containing an api for obtaining timing information about propagated contexts.
- nonNullDelegate() - Method in class nl.talsmasoftware.context.delegation.Wrapper
-
Acessor to provide a guaranteed non-
nulldelegate instance for use within delegation method implementations.
O
- onActivate(Class<? extends ContextManager<? super T>>, T, T) - Static method in class nl.talsmasoftware.context.ContextManagers
-
Notifies all context observers for the specified
contextManagerabout the activated context value. - onActivate(Class<? extends ContextManager<? super T>>, T, T) - Static method in class nl.talsmasoftware.context.observer.ContextObservers
-
Deprecated.This method was moved to the
ContextManagersutility class. - onActivate(T, T) - Method in interface nl.talsmasoftware.context.observer.ContextObserver
-
Indicates that a context was just activated.
- onDeactivate(Class<? extends ContextManager<? super T>>, T, T) - Static method in class nl.talsmasoftware.context.ContextManagers
-
Notifies all context observers for the specified
contextManagerabout the deactivated context value. - onDeactivate(Class<? extends ContextManager<? super T>>, T, T) - Static method in class nl.talsmasoftware.context.observer.ContextObservers
-
Deprecated.This method was moved to the
ContextManagersutility class. - onDeactivate(T, T) - Method in interface nl.talsmasoftware.context.observer.ContextObserver
-
Indicates that a context was just deactivated.
P
- parentContext - Variable in class nl.talsmasoftware.context.threadlocal.AbstractThreadLocalContext
-
The parent context that was active at the time this context was created (if any) or
nullin case there was no active context when this context was created.
R
- reactivate() - Method in interface nl.talsmasoftware.context.ContextSnapshot
-
This method activates all contained values by the snapshot in their respective
Contextimplementations.
S
- shutdown() - Method in class nl.talsmasoftware.context.delegation.DelegatingExecutorService
- shutdownNow() - Method in class nl.talsmasoftware.context.delegation.DelegatingExecutorService
- snapshot() - Method in class nl.talsmasoftware.context.delegation.WrapperWithContext
-
Calls the supplier for the context snapshot, making sure it is called only once for this wrapper instance.
- submit(Runnable) - Method in class nl.talsmasoftware.context.delegation.DelegatingExecutorService
- submit(Runnable, T) - Method in class nl.talsmasoftware.context.delegation.DelegatingExecutorService
- submit(Callable<T>) - Method in class nl.talsmasoftware.context.delegation.DelegatingExecutorService
T
- threadLocalInstanceOf(Class<? extends CTX>) - Static method in class nl.talsmasoftware.context.threadlocal.AbstractThreadLocalContext
-
Returns the shared, static
ThreadLocalinstance for the specified context type. - toString() - Method in class nl.talsmasoftware.context.delegation.DelegatingExecutorService
- toString() - Method in class nl.talsmasoftware.context.delegation.Wrapper
- toString() - Method in class nl.talsmasoftware.context.delegation.WrapperWithContext
- toString() - Method in class nl.talsmasoftware.context.threadlocal.AbstractThreadLocalContext
-
Returns the classname of this context followed by
"{closed}"if it has been closed already; otherwise the containedvalueby this context will be added.
U
- update(Class<?>, String, long, TimeUnit) - Method in interface nl.talsmasoftware.context.timing.ContextTimer
-
Provides a new update for the context timer.
- useClassLoader(ClassLoader) - Static method in class nl.talsmasoftware.context.ContextManagers
-
Override the ClassLoader used to lookup contextmanagers.
V
- value - Variable in class nl.talsmasoftware.context.threadlocal.AbstractThreadLocalContext
-
The actual value, so subclasses can still access it after the context has been closed, because the default
AbstractThreadLocalContext.getValue()implementation will returnnullin that case.
Please be careful accessing the value after the context was closed: There is no pre-defined meaningful way to handle this situation, as this depends heavily on the desired features of the particular implementation.
W
- wrap(Runnable) - Method in class nl.talsmasoftware.context.delegation.CallMappingExecutorService
- wrap(Runnable) - Method in class nl.talsmasoftware.context.delegation.DelegatingExecutorService
- wrap(Callable<T>) - Method in class nl.talsmasoftware.context.delegation.DelegatingExecutorService
- wrap(Callable<V>) - Method in class nl.talsmasoftware.context.delegation.CallMappingExecutorService
-
Wrapping a callable object is delegated to the abstract
CallMappingExecutorService.map(Callable)method. - wrap(Future<T>) - Method in class nl.talsmasoftware.context.delegation.DelegatingExecutorService
- wrapException(ExecutionException) - Method in class nl.talsmasoftware.context.delegation.DelegatingFuture
-
Overridable method to wrap the
ExecutionExceptionafter it has been thrown from the delegate future. - wrapFutures(Collection<? extends Future<T>>) - Method in class nl.talsmasoftware.context.delegation.DelegatingExecutorService
-
Default way of mapping a
CollectionofFutureobjects: Create a new list and add eachindividually wrappedobject into it. - Wrapper<T> - Class in nl.talsmasoftware.context.delegation
-
Base wrapper class offering a
non-null delegatemethod. - Wrapper(T) - Constructor for class nl.talsmasoftware.context.delegation.Wrapper
-
Constructor providing a delegate wrapped object.
- WrapperWithContext<T> - Class in nl.talsmasoftware.context.delegation
-
Wrapper that also contains a fixed context snapshot.
- WrapperWithContext(ContextSnapshot, T) - Constructor for class nl.talsmasoftware.context.delegation.WrapperWithContext
-
Creates a new Wrapper with the specified context snapshot.
- WrapperWithContext(ContextSnapshotSupplier, T) - Constructor for class nl.talsmasoftware.context.delegation.WrapperWithContext
-
Wraps the delegate and provides a context snapshot.
- wrapResult(V) - Method in class nl.talsmasoftware.context.delegation.DelegatingFuture
-
Overridable method to wrap the result after it has been obtained from the delegate future.
- wrapTasks(Collection<? extends Callable<T>>) - Method in class nl.talsmasoftware.context.delegation.DelegatingExecutorService
-
Default way of mapping a
CollectionofCallableobjects: Create a new collection and add eachindividually wrappedobject into it.
All Classes All Packages