Class DummyVCacheRequestContextOperations
- java.lang.Object
-
- com.atlassian.confluence.impl.vcache.DummyVCacheRequestContextOperations
-
- All Implemented Interfaces:
VCacheRequestContextOperations
public class DummyVCacheRequestContextOperations extends Object implements VCacheRequestContextOperations
Trivial implementation of the interface which just invoked the action directly. Mostly useful for tests.- Since:
- 5.10
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.atlassian.confluence.vcache.VCacheRequestContextOperations
VCacheRequestContextOperations.Action<T,X extends Throwable>
-
-
Constructor Summary
Constructors Constructor Description DummyVCacheRequestContextOperations()
-
Method Summary
All Methods Instance Methods Concrete 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.<T,X extends Throwable>
TdoInRequestContext(String partitionIdentifier, VCacheRequestContextOperations.Action<T,X> action)
Executes the supplied action callback within a VCacheRequestContext
.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.atlassian.confluence.vcache.VCacheRequestContextOperations
doInRequestContext, withRequestContext, withRequestContext
-
-
-
-
Method Detail
-
doInRequestContext
public <T,X extends Throwable> T doInRequestContext(VCacheRequestContextOperations.Action<T,X> action) throws X extends Throwable
Description copied from interface:VCacheRequestContextOperations
Executes the supplied action callback within a VCacheRequestContext
, using the system default partition identifier.- Specified by:
doInRequestContext
in interfaceVCacheRequestContextOperations
- 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 callbackX extends Throwable
-
doInRequestContext
public <T,X extends Throwable> T doInRequestContext(String partitionIdentifier, VCacheRequestContextOperations.Action<T,X> action) throws X extends Throwable
Description copied from interface:VCacheRequestContextOperations
Executes 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.- Specified by:
doInRequestContext
in interfaceVCacheRequestContextOperations
- 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 callbackX extends Throwable
-
-