Package com.atlassian.confluence.vcache
Interface VCacheRequestContextOperations
-
- All Known Implementing Classes:
DummyVCacheRequestContextOperations,VCacheRequestContextManager
public interface VCacheRequestContextOperations- Since:
- 5.10
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interfaceVCacheRequestContextOperations.Action<T,X extends Throwable>
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description <T,X extends Throwable>
TdoInRequestContext(VCacheRequestContextOperations.Action<T,X> action)Executes the supplied action callback within a VCacheRequestContext, using the system default partition identifier.default voiddoInRequestContext(Runnable action)A simplified form ofdoInRequestContext(VCacheRequestContextManager.Action)that takes aRunnablecallback.<T,X extends Throwable>
TdoInRequestContext(String partitionIdentifier, VCacheRequestContextOperations.Action<T,X> action)Deprecated.since 6.0.default RunnablewithRequestContext(Runnable task)Wraps the suppliedRunnablein a request contextdefault <T> Callable<T>withRequestContext(Callable<T> task)Wraps the suppliedCallablein a request context
-
-
-
Method Detail
-
doInRequestContext
<T,X extends Throwable> T doInRequestContext(VCacheRequestContextOperations.Action<T,X> action) throws X extends Throwable
Executes the supplied action callback within a VCacheRequestContext, using the system default partition identifier.- Type Parameters:
T- the return type of the callbackX- the exception type thrown by the callback- Parameters:
action- the callback to be executed within the request context- Returns:
- the value returned by the callback
- Throws:
X- the exception thrown by the callbackIllegalArgumentException- if the partition identifier is not the same as that provided by previous callsX extends Throwable
-
doInRequestContext
@Deprecated <T,X extends Throwable> T doInRequestContext(String partitionIdentifier, VCacheRequestContextOperations.Action<T,X> action) throws X extends Throwable
Deprecated.since 6.0. Partitions are not supported in Confluence ServerExecutes the supplied action callback within a VCacheRequestContext. If no request context is bound to the current thread, then one will be set up with the supplied partition identifier. Calls to this method may be nested. Nested calls will re-use the existing context bound by the first call. Nested calls must supply the same partition identifier as the first call.- Type Parameters:
T- the return type of the callbackX- the exception type thrown by the callback- Parameters:
partitionIdentifier- the partition identifier that will be used to create new request context, if necessaryaction- the callback to be executed within the request context- Returns:
- the value returned by the callback
- Throws:
X- the exception thrown by the callbackIllegalArgumentException- if the partition identifier is not the same as that provided by previous callsX extends Throwable
-
doInRequestContext
default void doInRequestContext(Runnable action)
A simplified form ofdoInRequestContext(VCacheRequestContextManager.Action)that takes aRunnablecallback.
-
withRequestContext
default <T> Callable<T> withRequestContext(Callable<T> task)
Wraps the suppliedCallablein a request context
-
-