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

com.aol.micro.server.events.ConfigureActiveJobsAspect Maven / Gradle / Ivy

There is a newer version: 0.91.11
Show newest version
package com.aol.micro.server.events;

import javax.annotation.Resource;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import com.google.common.eventbus.EventBus;

@Configuration
public class ConfigureActiveJobsAspect {
    @Resource(name = "microserverEventBus")
    private EventBus bus;
    private @Value("${system.logging.max.per.hour:10}") int maxLoggingCapacity;
    private @Value("${system.request.capture:true}") boolean requestCapture;

    @Bean
    public JobsBeingExecuted microEventJobsBeingExecuted() {
        return new JobsBeingExecuted(
                                     bus, maxLoggingCapacity, JobName.Types.SIMPLE);
    }

    @Bean
    public RequestTypes microEventRequestTypes() {
        RequestsBeingExecuted def = this.microEventRequestsBeingExecuted();
        RequestTypes types = new RequestTypes(
                                              bus, requestCapture);
        types.getMap()
             .put(def.getType(), def);
        return types;
    }

    @Bean
    public RequestsBeingExecuted microEventRequestsBeingExecuted() {
        return new RequestsBeingExecuted(
                                         bus);
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy