code: public boolean matches(String resourcePath) {
      if (!valid) {
        return false;
      }
      if (resourcePath == null) {
        return acceptsContextPathEmpty;
      }
      if (contextPathRegex != null && !contextPathRegex.matcher(resourcePath).matches()) {
        return false;
      }
      if (contextPathBlacklistRegex != null && contextPathBlacklistRegex.matcher(resourcePath).matches()) {
        return false;
      }
      return true;
    }
docs: Checks if this service implementation accepts the given resource path.
  @param resourcePath Resource path
  @return true if the implementation matches and the configuration is not invalid.