use of com.netflix.titus.common.util.guice.ContainerEventBusModule in project titus-control-plane by Netflix.
the class TitusFederationModule method configure.
@Override
protected void configure() {
bind(Archaius2ConfigurationLogger.class).asEagerSingleton();
bind(Registry.class).toInstance(new DefaultRegistry());
bind(SystemLogService.class).to(LoggingSystemLogService.class);
bind(SystemAbortListener.class).to(LoggingSystemAbortListener.class);
install(new GovernatorJerseySupportModule());
install(new ContainerEventBusModule());
install(new TitusEntitySanitizerModule());
bind(HostCallerIdResolver.class).to(NoOpHostCallerIdResolver.class);
bind(CellConnector.class).to(DefaultCellConnector.class);
bind(RemoteFederationConnector.class).to(DefaultRemoteFederationConnector.class);
bind(CellWebClientConnector.class).to(DefaultCellWebClientConnector.class);
bind(WebClientFactory.class).toInstance(SimpleWebClientFactory.getInstance());
bind(CellInfoResolver.class).to(DefaultCellInfoResolver.class);
bind(RemoteFederationInfoResolver.class).to(DefaultRemoteFederationInfoResolver.class);
install(new FederationEndpointModule());
install(new ServiceModule());
}
use of com.netflix.titus.common.util.guice.ContainerEventBusModule in project titus-control-plane by Netflix.
the class ActivationProvisionListenerTest method testDeactivationOrderIsReverseOfActivation.
@Test
public void testDeactivationOrderIsReverseOfActivation() throws Exception {
LifecycleInjector injector = InjectorBuilder.fromModules(new ContainerEventBusModule(), new AbstractModule() {
@Override
protected void configure() {
bind(TitusRuntime.class).toInstance(TitusRuntimes.internal());
bind(ActivationProvisionListenerTest.class).toInstance(ActivationProvisionListenerTest.this);
bind(ServiceB.class).asEagerSingleton();
bind(ServiceA.class).asEagerSingleton();
}
}).createInjector();
ActivationLifecycle activationLifecycle = injector.getInstance(ActivationLifecycle.class);
activationLifecycle.activate();
activationLifecycle.deactivate();
assertThat(activationTrace).hasSize(4);
String firstActivated = activationTrace.get(0).getLeft();
String secondActivated = activationTrace.get(1).getLeft();
assertThat(activationTrace.subList(2, 4)).containsExactly(Pair.of(secondActivated, "DEACTIVATED"), Pair.of(firstActivated, "DEACTIVATED"));
}
use of com.netflix.titus.common.util.guice.ContainerEventBusModule in project titus-control-plane by Netflix.
the class TitusRuntimeModule method configure.
@Override
protected void configure() {
// Framework services
install(new ContainerEventBusModule());
install(new JHiccupModule());
bind(SystemLogService.class).to(LoggingSystemLogService.class);
bind(SystemAbortListener.class).to(LoggingSystemAbortListener.class);
bind(FitActionInitializer.class).asEagerSingleton();
}
use of com.netflix.titus.common.util.guice.ContainerEventBusModule in project titus-control-plane by Netflix.
the class TitusGatewayModule method configure.
@Override
protected void configure() {
bind(Archaius2ConfigurationLogger.class).asEagerSingleton();
bind(Registry.class).toInstance(new DefaultRegistry());
bind(SystemLogService.class).to(LoggingSystemLogService.class);
bind(SystemAbortListener.class).to(LoggingSystemAbortListener.class);
bind(Fabric8IOConnector.class).to(DefaultFabric8IOConnector.class).asEagerSingleton();
install(new ContainerEventBusModule());
install(new TitusContainerRegistryModule());
install(new TitusEntitySanitizerModule());
install(new TitusAdmissionModule());
install(new JobSecurityValidatorModule());
// Feature flags
install(new FeatureFlagModule());
install(new GatewayEndpointModule(enableREST));
install(new TitusMasterConnectorModule());
install(new JobManagerConnectorModule(JobEventPropagationUtil.CHECKPOINT_GATEWAY_CLIENT));
install(new JobManagerDataReplicationModule());
install(new EvictionConnectorModule());
install(new RelocationClientConnectorModule());
install(new RelocationDataReplicationModule());
bind(V3_LOG_STORAGE_INFO).toInstance(EmptyLogStorageInfo.INSTANCE);
install(new V3ServiceModule());
install(new StoreModule());
}
use of com.netflix.titus.common.util.guice.ContainerEventBusModule in project titus-control-plane by Netflix.
the class ActivationProvisionListenerTest method testServiceReordering.
@Test
public void testServiceReordering() throws Exception {
LifecycleInjector injector = InjectorBuilder.fromModules(new ContainerEventBusModule(), new AbstractModule() {
@Override
protected void configure() {
bind(TitusRuntime.class).toInstance(TitusRuntimes.internal());
bind(ActivationProvisionListenerTest.class).toInstance(ActivationProvisionListenerTest.this);
bind(ServiceB.class).asEagerSingleton();
bind(ServiceA.class).asEagerSingleton();
}
}).createInjector();
ActivationLifecycle activationLifecycle = injector.getInstance(ActivationLifecycle.class);
activationLifecycle.activate();
assertThat(activationTrace).containsExactlyInAnyOrder(Pair.of("serviceA", "ACTIVATED"), Pair.of("serviceB", "ACTIVATED"));
}
Aggregations