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

com.netflix.eureka.resources.EurekaServerContextBinder Maven / Gradle / Ivy

There is a newer version: 1.10.18
Show newest version
package com.netflix.eureka.resources;

import org.glassfish.hk2.api.Factory;
import org.glassfish.hk2.utilities.binding.AbstractBinder;

import com.netflix.eureka.EurekaServerContext;
import com.netflix.eureka.EurekaServerContextHolder;

/**
 * Jersey2 binder for the EurekaServerContext. Replaces the GuiceFilter in the server WAR web.xml
 * @author Matt Nelson
 */
public class EurekaServerContextBinder extends AbstractBinder {
    
    public class EurekaServerContextFactory implements Factory {
        @Override
        public EurekaServerContext provide() {
           return EurekaServerContextHolder.getInstance().getServerContext();
        }
     
        @Override
        public void dispose(EurekaServerContext t) {
        }
    }

    /**
     * {@inheritDoc}
     */
    @Override
    protected void configure() {
        bindFactory(new EurekaServerContextFactory()).to(EurekaServerContext.class);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy