com.netflix.appinfo.CloudInstanceConfig Java Examples

The following examples show how to use com.netflix.appinfo.CloudInstanceConfig. 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 File: EurekaHandlerTest.java    From riposte with Apache License 2.0 6 votes vote down vote up
@Before
public void beforeMethod() {
    eurekaIsDisabledPropertySupplierMock = mock(Supplier.class);
    datacenterTypePropertySupplierMock = mock(Supplier.class);
    cloudInstanceConfigMock = mock(CloudInstanceConfig.class);

    doReturn(false).when(eurekaIsDisabledPropertySupplierMock).get();
    doReturn(MyOwn.name()).when(datacenterTypePropertySupplierMock).get();

    handlerSpy = spy(new EurekaHandler(eurekaIsDisabledPropertySupplierMock, datacenterTypePropertySupplierMock));

    doNothing().when(handlerSpy).initDiscoveryManager(any(EurekaInstanceConfig.class),
                                                      any(EurekaClientConfig.class));
    doNothing().when(handlerSpy).shutdownDiscoveryManager();
    doNothing().when(handlerSpy).setEurekaInstanceStatus(any(InstanceStatus.class));
    doReturn(cloudInstanceConfigMock).when(handlerSpy).createCloudInstanceConfig(anyString());
}
 
Example #2
Source File: EurekaModule.java    From staash with Apache License 2.0 6 votes vote down vote up
@Override
protected void configure() {
    LOG.info("Configuring EurekaModule");
    
    // Initialize eureka
    // TODO: Move this to a bootstrap thingy
    DiscoveryManager.getInstance().initComponent(
            new CloudInstanceConfig(),
            new DefaultEurekaClientConfig());

    // Eureka - Astyanax integration
    MapBinder<String, HostSupplierProvider> hostSuppliers = MapBinder.newMapBinder(binder(), String.class, HostSupplierProvider.class);
    hostSuppliers.addBinding("eureka").to(EurekaAstyanaxHostSupplier.class);
    
    //bind(ClusterDiscoveryService.class).to(EurekaClusterDiscoveryService.class).asEagerSingleton();

}
 
Example #3
Source File: EurekaModule.java    From staash with Apache License 2.0 5 votes vote down vote up
@Override
protected void configure() {
    LOG.info("Configuring EurekaModule");
    
            DiscoveryManager.getInstance().initComponent(
            new CloudInstanceConfig(),
            new DefaultEurekaClientConfig());

    // Eureka - Astyanax integration
    MapBinder<String, HostSupplierProvider> hostSuppliers = MapBinder.newMapBinder(binder(), String.class, HostSupplierProvider.class);
    hostSuppliers.addBinding("eureka").to(EurekaAstyanaxHostSupplier.class).asEagerSingleton();
    
    //bind(ClusterDiscoveryService.class).to(EurekaClusterDiscoveryService.class).asEagerSingleton();

}
 
Example #4
Source File: EurekaHandler.java    From riposte with Apache License 2.0 4 votes vote down vote up
protected CloudInstanceConfig createCloudInstanceConfig(String namespace) {
    return new CloudInstanceConfig(namespace);
}