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

com.deere.example.MainConfig Maven / Gradle / Ivy

There is a newer version: 1.0.0-rc14
Show newest version
/**
 * Copyright 2019 Deere & Company
 *
 * This software may be modified and distributed under the terms
 * of the MIT license.  See the LICENSE file for details.
 */

package com.deere.example;

import com.deere.isg.worktracker.servlet.MdcExecutor;
import com.deere.isg.worktracker.spring.ZombieExceptionHandler;
import com.deere.isg.worktracker.spring.ZombieHttpInterceptor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;
import org.springframework.web.servlet.config.annotation.EnableWebMvc;

import java.util.concurrent.Executor;

@EnableWebMvc
@Configuration
public class MainConfig {
    @Bean
    public ZombieExceptionHandler zombieExceptionHandler() {
        return new ZombieExceptionHandler();
    }

    @Bean
    public RestTemplate zombieRestTemplate() {
        RestTemplate restTemplate = new RestTemplate();
        restTemplate.getInterceptors().add(new ZombieHttpInterceptor());
        return restTemplate;
    }

    @Bean
    public Executor mdcExecutor(Executor executor) {
        return new MdcExecutor(executor);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy