@Retention(value=RUNTIME) @Target(value=METHOD) public @interface AppStatContainersAccessor
AppStat containers.
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 @AppStatContainersAccessor
is useful in cases where finer grained control of which objects in application should
be scanned for @AppStat 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
@AppStatContainersAccessor
public void getStatsProviders(final Set<Object> statsProviders) {
statsProviders.addAll(cancelHandler);
}
@AppEventHandlerContainersAccessor
public void getEventHandlers(final Set<Object> eventHandlers) {
eventHandlers.add(newOrderHandler);
eventHandlers.add(cancelHandler);
}
}AppStat,
AppIntrospectionPointsCopyright © 2019 Neeve Research, LLC. All Rights Reserved.