All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.zhengframework.rest.metrics.CountedInterceptor Maven / Gradle / Ivy

package com.github.zhengframework.rest.metrics;

import com.codahale.metrics.Counter;
import javax.ws.rs.container.ContainerRequestContext;
import javax.ws.rs.container.ContainerRequestFilter;

public class CountedInterceptor implements ContainerRequestFilter {

  private final Counter counter;

  public CountedInterceptor(Counter counter) {
    this.counter = counter;
  }

  @Override
  public void filter(ContainerRequestContext requestContext) {
    counter.inc();
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy