Package org.axonframework.messaging.core
Class Context.ResourceKey<T>
java.lang.Object
org.axonframework.messaging.core.Context.ResourceKey<T>
- Type Parameters:
T- The type of resource registered under this key.
- Enclosing interface:
Context
Object that is used as a key to retrieve and register resources of a given type in a
Context.
Instance of a ResourceKey can be created using the withLabel(String) method. Regardless of the
given label, a unique key will be constructed at all times, ensuring user-defined keys do not clash with
system keys. Thus, if a Context specific resource should be shared, the constructed ResourceKey
should be shared.
- Since:
- 5.0.0
- Author:
- Allard Buijze, Mitchell Herrijgers, Steven van Beelen
-
Method Summary
-
Method Details
-
withLabel
Create a newResourceKeyfor a resource of typeT. The givenlabelis part of thetoString()(if notnullor empty) of the created key instance and may be used for debugging purposes.- Type Parameters:
T- The type of resource of this key.- Parameters:
label- AStringto recognize this key during debugging.- Returns:
- A new
ResourceKeyused to register and retrieve resources.
-
label
-
toString
-