public class PluginCallContext
extends java.lang.Object
The context is scoped to the PluginServiceImpl instance, which has the same
lifecycle as the wrapper connection. It is automatically cleared before each call begins.
Upstream plugins (e.g., SQL parsing) can populate attributes that downstream plugins
(e.g., encryption, caching) consume.
Access the context from any plugin via PluginService.getCallContext().
| Constructor and Description |
|---|
PluginCallContext() |
| Modifier and Type | Method and Description |
|---|---|
<T> T |
getAttribute(java.lang.String key,
java.lang.Class<T> type)
Gets an attribute from the context.
|
boolean |
hasAttribute(java.lang.String key)
Checks if an attribute exists.
|
void |
reset()
Clears all attributes from the context.
|
void |
setAttribute(java.lang.String key,
java.lang.Object value)
Sets an attribute in the context.
|
public void reset()
public void setAttribute(java.lang.String key,
java.lang.Object value)
key - the attribute keyvalue - the attribute valuepublic <T> T getAttribute(java.lang.String key,
java.lang.Class<T> type)
T - the expected typekey - the attribute keytype - the expected typejava.lang.ClassCastException - if the value is not of the expected typepublic boolean hasAttribute(java.lang.String key)
key - the attribute key