public class UiEventListenerMethodAdapter
extends java.lang.Object
implements org.springframework.context.event.GenericApplicationListener
Constructor and Description |
---|
UiEventListenerMethodAdapter(java.lang.Object instance,
java.lang.Class<?> targetClass,
java.lang.reflect.Method method,
Events events) |
Modifier and Type | Method and Description |
---|---|
protected void |
assertTargetBean(java.lang.reflect.Method method,
java.lang.Object targetBean,
java.lang.Object[] args)
Assert that the target bean class is an instance of the class where the given
method is declared.
|
protected java.lang.Object |
doInvoke(java.lang.Object instance,
java.lang.Object... args)
Invoke the event listener method with the given argument values.
|
protected java.lang.String |
getCondition()
Return the condition to use.
|
protected java.lang.String |
getDetailedErrorMessage(java.lang.Object bean,
java.lang.String message)
Add additional details such as the bean type and method signature to
the given error message.
|
protected java.lang.String |
getInvocationErrorMessage(java.lang.Object bean,
java.lang.String message,
java.lang.Object[] resolvedArgs) |
int |
getOrder() |
protected org.springframework.core.ResolvableType |
getResolvableType(org.springframework.context.ApplicationEvent event) |
protected void |
handleResult(java.lang.Object instance,
java.lang.Object result) |
void |
onApplicationEvent(org.springframework.context.ApplicationEvent event) |
void |
processEvent(java.lang.Object instance,
org.springframework.context.ApplicationEvent event)
Process the specified
ApplicationEvent , checking if the condition match and handling non-null result, if any. |
protected void |
publishEvent(java.lang.Object instance,
java.lang.Object event) |
protected java.lang.Object[] |
resolveArguments(org.springframework.context.ApplicationEvent event)
Resolve the method arguments to use for the specified
ApplicationEvent . |
protected java.util.List<org.springframework.core.ResolvableType> |
resolveDeclaredEventTypes(java.lang.reflect.Method method,
org.springframework.context.event.EventListener ann) |
protected int |
resolveOrder(java.lang.reflect.Method method) |
protected boolean |
shouldHandle(org.springframework.context.ApplicationEvent event,
java.lang.Object[] args) |
boolean |
supportsEventType(org.springframework.core.ResolvableType eventType) |
boolean |
supportsSourceType(java.lang.Class<?> sourceType) |
public UiEventListenerMethodAdapter(java.lang.Object instance, java.lang.Class<?> targetClass, java.lang.reflect.Method method, Events events)
public boolean supportsEventType(@Nonnull org.springframework.core.ResolvableType eventType)
supportsEventType
in interface org.springframework.context.event.GenericApplicationListener
public boolean supportsSourceType(java.lang.Class<?> sourceType)
supportsSourceType
in interface org.springframework.context.event.GenericApplicationListener
public void onApplicationEvent(@Nonnull org.springframework.context.ApplicationEvent event)
onApplicationEvent
in interface org.springframework.context.ApplicationListener<org.springframework.context.ApplicationEvent>
public int getOrder()
getOrder
in interface org.springframework.context.event.GenericApplicationListener
getOrder
in interface org.springframework.core.Ordered
protected java.util.List<org.springframework.core.ResolvableType> resolveDeclaredEventTypes(java.lang.reflect.Method method, org.springframework.context.event.EventListener ann)
protected int resolveOrder(java.lang.reflect.Method method)
public void processEvent(java.lang.Object instance, org.springframework.context.ApplicationEvent event)
ApplicationEvent
, checking if the condition match and handling non-null result, if any.protected java.lang.Object[] resolveArguments(org.springframework.context.ApplicationEvent event)
ApplicationEvent
.
These arguments will be used to invoke the method handled by this instance. Can
return null
to indicate that no suitable arguments could be resolved and
therefore the method should not be invoked at all for the specified event.
protected void handleResult(java.lang.Object instance, java.lang.Object result)
protected void publishEvent(java.lang.Object instance, java.lang.Object event)
protected boolean shouldHandle(org.springframework.context.ApplicationEvent event, java.lang.Object[] args)
protected java.lang.Object doInvoke(java.lang.Object instance, java.lang.Object... args)
protected java.lang.String getCondition()
Matches the condition
attribute of the EventListener
annotation or any matching attribute on a composed annotation that
is meta-annotated with @EventListener
.
protected java.lang.String getDetailedErrorMessage(java.lang.Object bean, java.lang.String message)
message
- error message to append the HandlerMethod details toprotected void assertTargetBean(java.lang.reflect.Method method, java.lang.Object targetBean, java.lang.Object[] args)
protected java.lang.String getInvocationErrorMessage(java.lang.Object bean, java.lang.String message, java.lang.Object[] resolvedArgs)
protected org.springframework.core.ResolvableType getResolvableType(org.springframework.context.ApplicationEvent event)