void addCSRFFilter(ServletContextHandler ctxHandler, Configuration conf) {
    restCSRFEnabled = conf.getBoolean(REST_CSRF_ENABLED_KEY, REST_CSRF_ENABLED_DEFAULT);
    if (restCSRFEnabled) {
      Map<String, String> restCsrfParams =
        RestCsrfPreventionFilter.getFilterParams(conf, "hbase.rest-csrf.");
      FilterHolder holder = new FilterHolder();
      holder.setName("csrf");
      holder.setClassName(RestCsrfPreventionFilter.class.getName());
      holder.setInitParameters(restCsrfParams);
      ctxHandler.addFilter(holder, PATH_SPEC_ANY, EnumSet.allOf(DispatcherType.class));
    }
  }
Main class for launching REST gateway as a servlet hosted by Jetty.
<p>
The following options are supported:
<ul>
<li>-p --port : service port</li>
<li>-ro --readonly : server mode</li>
</ul>
hbase-rest/src/main/java/org/apache/hadoop/hbase/rest/RESTServer.java