Skip to content

Commit

Permalink
[HWKMETRICS-199] add some docs
Browse files Browse the repository at this point in the history
  • Loading branch information
John Sanda committed Aug 11, 2015
1 parent b6b29c2 commit 7a2446a
Showing 1 changed file with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,18 @@ public HawkularMetricsRestApp() {
logger.info("Hawkular Metrics starting ..");
}

/**
* The default implementation returns an empty set, which means the JAX-RS runtime will scan the classpath for
* resources, providers, and filters. When this method is overridden, you have to explicitly include each class.
* There is no way to simply exclude classes, which is unfortunate because it would make things much easier. We
* override the method to provide support for testing with a virtual clock through the REST API. The virtual clock
* endpoint is included and enabled when the hawkular.metrics.use-virtual-clock system property is set to true.
*/
@Override
public Set<Class<?>> getClasses() {
Set<Class<?>> classes = new HashSet<>();

// Add endpoint handlers
classes.add(MetricHandler.class);
classes.add(AvailabilityHandler.class);
classes.add(InfluxSeriesHandler.class);
Expand All @@ -89,18 +98,21 @@ public Set<Class<?>> getClasses() {
logger.info("Virtual clock is disabled");
}

// Add exception mapper providers
classes.add(BadRequestExceptionMapper.class);
classes.add(NotAcceptableExceptionMapper.class);
classes.add(NotAllowedExceptionMapper.class);
classes.add(NotFoundExceptionMapper.class);
classes.add(ReaderExceptionMapper.class);
classes.add(NotSupportedExceptionMapper.class);

// Add filters
classes.add(EmptyPayloadFilter.class);
classes.add(TenantFilter.class);
classes.add(MetricsServiceStateFilter.class);
classes.add(CorsFilter.class);

// Add interceptors and other miscellaneous providers
classes.add(EmptyPayloadInterceptor.class);
classes.add(ConvertersProvider.class);
classes.add(JacksonConfig.class);
Expand Down

0 comments on commit 7a2446a

Please sign in to comment.