Java Code Examples for

The following examples show how to use These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: heimdall   Source File:    License: Apache License 2.0 6 votes vote down vote up
 * Removes a {@link Interceptor} file.
 * @param interceptor {@link InterceptorFileDTO}
public void removeFileInterceptor(InterceptorFileDTO interceptor) {

    File interceptorFile = new File(interceptor.getPath());

    if (interceptorFile.exists() && interceptorFile.isFile()) {
        String filter = interceptorFile.getAbsolutePath() + interceptorFile.getName();
        if (interceptorFile.delete()) {
  "File - Removing File Filter: {}", interceptorFile.getAbsolutePath());
            log.debug("FilterRegistry - Removing File Filter {}", filter);
        } else {
            log.warn("Not possible to remove File: {} with Interceptor ID: {}", interceptorFile.getAbsolutePath(), interceptor.getId());
Example 2
Source Project: zuul   Source File:    License: Apache License 2.0 5 votes vote down vote up
protected void configure() {
    try {
    } catch (Exception ex) {
      throw new RuntimeException("Error loading configuration: " + ex.getMessage(), ex);


    install(new EurekaModule());

    // sample specific bindings

    // use provided basic netty origin manager

    // zuul filter loading
    install(new ZuulFiltersModule());

    // general server bindings
    bind(ServerStatusManager.class); // health/discovery status
    bind(SessionContextDecorator.class).to(ZuulSessionContextDecorator.class); // decorate new sessions when requests come in
    bind(Registry.class).to(DefaultRegistry.class); // atlas metrics registry
    bind(RequestCompleteHandler.class).to(BasicRequestCompleteHandler.class); // metrics post-request completion
    bind(RequestMetricsPublisher.class).to(BasicRequestMetricsPublisher.class); // timings publisher

    // access logger, including request ID generator
    bind(AccessLogPublisher.class).toInstance(new AccessLogPublisher("ACCESS",
            (channel, httpRequest) -> ClientRequestReceiver.getRequestFromChannel(channel).getContext().getUUID()));
Example 3
Source Project: zuul   Source File:    License: Apache License 2.0 5 votes vote down vote up
public DynamicFilterLoader(
        FilterRegistry filterRegistry,
        DynamicCodeCompiler compiler,
        FilterFactory filterFactory) {
    this.filterRegistry = filterRegistry;
    this.compiler = compiler;
    this.filterFactory = filterFactory;
Example 4
Source Project: Sentinel   Source File:    License: Apache License 2.0 4 votes vote down vote up
public FiltersRegisteringService(FilterRegistry filterRegistry, Set<ZuulFilter> filters) {
    this.filters = new ArrayList<>(filters);
    this.filterRegistry = filterRegistry;