@Retention(value=RUNTIME) @Target(value=METHOD) public @interface AppCommandHandlerContainersAccessor
The annotated method must take a Set
as its sole method parameter and
populate it with containers containing AppStat
annotations.
Note: Consider using @AppIntrospectionPoints
annotation as an alternative to this annotation. The @AppCommandHandlerContainersAccessor
is useful in cases where finer grained control of which objects in application should
be scanned for @Command
annotations. For large application this
can improve load time, but for smaller applications using @AppIntrospectionPoints
results in less boilerplate code.
@AppHAPolicy(HAPolicy.EventSourcing) public class OrderProcessingApp { private NewOrderHandler newOrderHandler = new NewOrderHandler(); //contains event handlers private OrderCancelHandler cancelHandler = new OrderCancelHandler(); //contains stats and event handlers @AppCommandHandlerContainersAccessor public void getStatsProviders(final Set<Object> commandHandlers) { commandHandlers.addAll(cancelHandler); } @AppEventHandlerContainersAccessor public void getEventHandlers(final Set<Object> eventHandlers) { eventHandlers.add(newOrderHandler); eventHandlers.add(cancelHandler); } }
AppStat
,
AppIntrospectionPoints
Copyright © 2019 Neeve Research, LLC. All Rights Reserved.