public interface CorrelationService
| Modifier and Type | Field and Description |
|---|---|
static String |
PROTOCOL_HEADER
The recommended protocol header name used to transmit the correlation context over the network.
|
| Modifier and Type | Method and Description |
|---|---|
void |
attachContext(CorrelationContext context)
Sets the current attached correlation context.
|
CorrelationContext |
attachExternalizedContext(byte[] externalizedContext)
Attaches the externalized correlation context
|
CorrelationContext |
createContext()
Creates a new correlation context.
|
CorrelationContext |
detachContext()
Detaches the existing attached context if any.
|
byte[] |
detachExternalizedContext()
Detaches the existing attached correlation context and returns it in externalized form.
|
<T> T |
execute(CorrelationContext context,
Callable<T> callable)
Executes the callable within the provided correlation context.
|
CorrelationContext |
getContext()
Returns the current attached correlation context if any.
|
byte[] |
getExternalizedContext()
Returns externalized correlation context without detaching it from execution scope.
|
CorrelationContext |
readExternalizedContext(byte[] externalizedContext)
Restores correlation context from externalized form.
|
static final String PROTOCOL_HEADER
CorrelationContext createContext()
CorrelationContext getContext()
void attachContext(CorrelationContext context)
context - The correlation context to attach.CorrelationContext detachContext()
<T> T execute(CorrelationContext context, Callable<T> callable) throws Exception
T - Type of callablecontext - The correlation context to establish around the invocation of the callable. May not be null.callable - The callable to invoke after establishing the correlation context. May not be null.Exception - Thrown if thrown by the callable's call method.CorrelationContext attachExternalizedContext(byte[] externalizedContext)
externalizedContext - The externalized correlation contextbyte[] detachExternalizedContext()
CorrelationContext readExternalizedContext(byte[] externalizedContext)
externalizedContext - The externalized correlation context. May not be null.byte[] getExternalizedContext()
Copyright © 2022 The Apache Software Foundation. All rights reserved.