Search in sources :

Example 6 with ServiceInterceptor

use of com.netflix.conductor.interceptors.ServiceInterceptor in project conductor by Netflix.

the class WorkflowBulkServiceTest method before.

@Before
public void before() {
    workflowExecutor = Mockito.mock(WorkflowExecutor.class);
    Injector injector = Guice.createInjector(new AbstractModule() {

        @Override
        protected void configure() {
            bind(WorkflowExecutor.class).toInstance(workflowExecutor);
            install(new ValidationModule());
            bindInterceptor(Matchers.any(), Matchers.annotatedWith(Service.class), new ServiceInterceptor(getProvider(Validator.class)));
        }
    });
    workflowBulkService = injector.getInstance(WorkflowBulkServiceImpl.class);
}
Also used : Injector(com.google.inject.Injector) WorkflowExecutor(com.netflix.conductor.core.execution.WorkflowExecutor) ServiceInterceptor(com.netflix.conductor.interceptors.ServiceInterceptor) ValidationModule(com.netflix.conductor.core.config.ValidationModule) Validator(javax.validation.Validator) AbstractModule(com.google.inject.AbstractModule) Before(org.junit.Before)

Example 7 with ServiceInterceptor

use of com.netflix.conductor.interceptors.ServiceInterceptor in project conductor by Netflix.

the class ServerModule method configure.

@Override
protected void configure() {
    install(new CoreModule());
    install(new ValidationModule());
    install(new ArchaiusModule());
    install(new JettyModule());
    install(new GRPCModule());
    install(new EventModule());
    bindInterceptor(Matchers.any(), Matchers.annotatedWith(Service.class), new ServiceInterceptor(getProvider(Validator.class)));
    bind(Configuration.class).to(SystemPropertiesConfiguration.class).in(Scopes.SINGLETON);
    bind(ExecutorService.class).toProvider(ExecutorServiceProvider.class).in(Scopes.SINGLETON);
    bind(WorkflowSweeper.class).asEagerSingleton();
    bind(WorkflowMonitor.class).asEagerSingleton();
}
Also used : GRPCModule(com.netflix.conductor.grpc.server.GRPCModule) EventModule(com.netflix.conductor.core.config.EventModule) WorkflowSweeper(com.netflix.conductor.core.execution.WorkflowSweeper) ArchaiusModule(com.netflix.archaius.guice.ArchaiusModule) JettyModule(com.netflix.conductor.jetty.server.JettyModule) Service(com.netflix.conductor.annotations.Service) ExecutorService(java.util.concurrent.ExecutorService) ServiceInterceptor(com.netflix.conductor.interceptors.ServiceInterceptor) SystemPropertiesConfiguration(com.netflix.conductor.core.config.SystemPropertiesConfiguration) CoreModule(com.netflix.conductor.core.config.CoreModule) WorkflowMonitor(com.netflix.conductor.service.WorkflowMonitor) ValidationModule(com.netflix.conductor.core.config.ValidationModule)

Aggregations

ValidationModule (com.netflix.conductor.core.config.ValidationModule)7 ServiceInterceptor (com.netflix.conductor.interceptors.ServiceInterceptor)7 AbstractModule (com.google.inject.AbstractModule)6 Injector (com.google.inject.Injector)6 Validator (javax.validation.Validator)6 Before (org.junit.Before)6 Configuration (com.netflix.conductor.core.config.Configuration)2 EventQueues (com.netflix.conductor.core.events.EventQueues)2 WorkflowExecutor (com.netflix.conductor.core.execution.WorkflowExecutor)2 ArchaiusModule (com.netflix.archaius.guice.ArchaiusModule)1 Service (com.netflix.conductor.annotations.Service)1 CoreModule (com.netflix.conductor.core.config.CoreModule)1 EventModule (com.netflix.conductor.core.config.EventModule)1 SystemPropertiesConfiguration (com.netflix.conductor.core.config.SystemPropertiesConfiguration)1 SimpleEventProcessor (com.netflix.conductor.core.events.SimpleEventProcessor)1 WorkflowSweeper (com.netflix.conductor.core.execution.WorkflowSweeper)1 EventHandlerDAO (com.netflix.conductor.dao.EventHandlerDAO)1 MetadataDAO (com.netflix.conductor.dao.MetadataDAO)1 QueueDAO (com.netflix.conductor.dao.QueueDAO)1 GRPCModule (com.netflix.conductor.grpc.server.GRPCModule)1