Class MetadataParameterResolver
java.lang.Object
io.fluxzero.sdk.tracking.handling.MetadataParameterResolver
Resolves handler method parameters of type
Metadata.
This resolver can inject metadata into handler methods in two ways:
- If the message being handled implements
HasMetadata, its metadata is directly returned. - Otherwise, the metadata is extracted from the current
DeserializingMessage(if available).
Example handler:
@HandleCommand
public void handle(MyCommand command, Metadata metadata) {
String user = metadata.get("userId");
}
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondefault booleangetInputCacheKey(Parameter parameter, Annotation methodAnnotation, io.fluxzero.common.handling.HandlerInput<Object> representative) booleanisNoMatchPayloadClassKey(Parameter parameter, Annotation methodAnnotation, io.fluxzero.common.handling.HandlerInput<Object> representative) booleanisPayloadClassKey(Parameter parameter, Annotation methodAnnotation, io.fluxzero.common.handling.HandlerInput<Object> representative) default booleanmatches(Parameter arg0, Annotation arg1, Object arg2) booleanmatches(Parameter arg0, Annotation arg1, Object arg2) default booleanmayApply(Executable arg0, Class<?> arg1) booleanmayApply(Executable arg0, Class<?> arg1) prepare(Parameter parameter, Annotation methodAnnotation) io.fluxzero.common.handling.HandlerInputResolver.Resolution<Object> prepareInput(Parameter parameter, Annotation methodAnnotation, io.fluxzero.common.handling.HandlerInput<Object> representative) resolve(Parameter p, Annotation methodAnnotation) default intdefault boolean
-
Constructor Details
-
MetadataParameterResolver
public MetadataParameterResolver()
-
-
Method Details
-
resolve
-
prepare
-
getInputCacheKey
public Object getInputCacheKey(Parameter parameter, Annotation methodAnnotation, io.fluxzero.common.handling.HandlerInput<Object> representative) -
isPayloadClassKey
public boolean isPayloadClassKey(Parameter parameter, Annotation methodAnnotation, io.fluxzero.common.handling.HandlerInput<Object> representative) -
isNoMatchPayloadClassKey
public boolean isNoMatchPayloadClassKey(Parameter parameter, Annotation methodAnnotation, io.fluxzero.common.handling.HandlerInput<Object> representative) -
prepareInput
public io.fluxzero.common.handling.HandlerInputResolver.Resolution<Object> prepareInput(Parameter parameter, Annotation methodAnnotation, io.fluxzero.common.handling.HandlerInput<Object> representative) -
matches
-
determinesSpecificity
default boolean determinesSpecificity() -
specificityPriority
default int specificityPriority() -
test
-
mayApply
-
matches
-
mayApply
-