Package io.jmix.flowui.sys.event
Class UiEventListenerMethodAdapter
java.lang.Object
io.jmix.flowui.sys.event.UiEventListenerMethodAdapter
- All Implemented Interfaces:
- EventListener,- org.springframework.context.ApplicationListener<org.springframework.context.ApplicationEvent>,- org.springframework.context.event.GenericApplicationListener,- org.springframework.context.event.SmartApplicationListener,- org.springframework.core.Ordered
public class UiEventListenerMethodAdapter
extends Object
implements org.springframework.context.event.GenericApplicationListener
- 
Field SummaryFields inherited from interface org.springframework.core.OrderedHIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
- 
Constructor SummaryConstructorsConstructorDescriptionUiEventListenerMethodAdapter(Object instance, Class<?> targetClass, Method method, org.springframework.context.ApplicationEventPublisher applicationEventPublisher) 
- 
Method SummaryModifier and TypeMethodDescriptionprotected voidassertTargetBean(Method method, Object targetBean, Object[] args) Assert that the target bean class is an instance of the class where the given method is declared.protected ObjectInvoke the event listener method with the given argument values.protected StringReturn the condition to use.protected StringgetDetailedErrorMessage(Object bean, String message) Add additional details such as the bean type and method signature to the given error message.protected StringgetInvocationErrorMessage(Object bean, String message, Object[] resolvedArgs) intgetOrder()protected org.springframework.core.ResolvableTypegetResolvableType(org.springframework.context.ApplicationEvent event) protected voidhandleResult(Object instance, Object result) voidonApplicationEvent(org.springframework.context.ApplicationEvent event) voidprocessEvent(Object instance, org.springframework.context.ApplicationEvent event) Process the specifiedApplicationEvent, checking if the condition match and handling non-null result, if any.protected voidpublishEvent(Object instance, Object event) protected Object[]resolveArguments(org.springframework.context.ApplicationEvent event) Resolve the method arguments to use for the specifiedApplicationEvent.protected List<org.springframework.core.ResolvableType>resolveDeclaredEventTypes(Method method, org.springframework.context.event.EventListener ann) protected intresolveOrder(Method method) protected booleanshouldHandle(org.springframework.context.ApplicationEvent event, Object[] args) booleansupportsEventType(org.springframework.core.ResolvableType eventType) booleansupportsSourceType(Class<?> sourceType) Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.context.event.GenericApplicationListenersupportsEventTypeMethods inherited from interface org.springframework.context.event.SmartApplicationListenergetListenerId
- 
Constructor Details- 
UiEventListenerMethodAdapter
 
- 
- 
Method Details- 
supportsEventTypepublic boolean supportsEventType(@Nonnull org.springframework.core.ResolvableType eventType) - Specified by:
- supportsEventTypein interface- org.springframework.context.event.GenericApplicationListener
 
- 
supportsSourceType- Specified by:
- supportsSourceTypein interface- org.springframework.context.event.SmartApplicationListener
 
- 
onApplicationEventpublic void onApplicationEvent(@Nonnull org.springframework.context.ApplicationEvent event) - Specified by:
- onApplicationEventin interface- org.springframework.context.ApplicationListener<org.springframework.context.ApplicationEvent>
 
- 
getOrderpublic int getOrder()- Specified by:
- getOrderin interface- org.springframework.core.Ordered
- Specified by:
- getOrderin interface- org.springframework.context.event.SmartApplicationListener
 
- 
resolveDeclaredEventTypes
- 
resolveOrder
- 
processEventProcess the specifiedApplicationEvent, checking if the condition match and handling non-null result, if any.
- 
resolveArgumentsResolve the method arguments to use for the specifiedApplicationEvent.These arguments will be used to invoke the method handled by this instance. Can return nullto indicate that no suitable arguments could be resolved and therefore the method should not be invoked at all for the specified event.
- 
handleResult
- 
publishEvent
- 
shouldHandleprotected boolean shouldHandle(org.springframework.context.ApplicationEvent event, @Nullable Object[] args) 
- 
doInvokeInvoke the event listener method with the given argument values.
- 
getConditionReturn the condition to use.Matches the conditionattribute of theEventListenerannotation or any matching attribute on a composed annotation that is meta-annotated with@EventListener.
- 
getDetailedErrorMessageAdd additional details such as the bean type and method signature to the given error message.- Parameters:
- message- error message to append the HandlerMethod details to
 
- 
assertTargetBeanAssert that the target bean class is an instance of the class where the given method is declared. In some cases the actual bean instance at event- processing time may be a JDK dynamic proxy (lazy initialization, prototype beans, and others). Event listener beans that require proxying should prefer class-based proxy mechanisms.
- 
getInvocationErrorMessage
- 
getResolvableType@Nullable protected org.springframework.core.ResolvableType getResolvableType(org.springframework.context.ApplicationEvent event) 
 
-