// Path: halfpipe-client/src/main/java/halfpipe/util/BeanUtils.java
// public class BeanUtils {
// 
//     private static ApplicationContext CONTEXT;
// 
//     public BeanUtils(ApplicationContext context) {
//         CONTEXT = context;
//     }
// 
//     public static ApplicationContext context() {
//         return CONTEXT;
//     }
// 
//     public static <T> T getBean(Class<T> requiredType) {
//         return CONTEXT.getBean(requiredType);
//     }
// 
//     public static <T> T getBean(String name, Class<T> requiredType) {
//         return CONTEXT.getBean(name, requiredType);
//     }
// 
//     public static <T> Optional<T> getOptionalBean(String name, Class<T> requiredType) {
//         try {
//             T bean = CONTEXT.getBean(name, requiredType);
//             return Optional.fromNullable(bean);
//         } catch (NoSuchBeanDefinitionException e) {
//             return Optional.absent();
//         }
//     }
// }


import com.netflix.zuul.context.ContextLifecycleFilter;
import halfpipe.util.BeanUtils;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.context.embedded.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
import javax.inject.Inject;
import java.util.ArrayList;
import java.util.Collection;
package halfpipe.router;



/**
 * User: spencergibb
 * Date: 4/24/14
 * Time: 8:57 PM
 */
@Configuration
@EnableAutoConfiguration
@EnableScheduling
@ComponentScan(basePackageClasses = RouterApp.class)
public class RouterApp extends WebSecurityConfigurerAdapter {

    @Inject
    BeanUtils beanUtils;

    @Bean
    RouterProperties routerProperties() {
        return new RouterProperties();
    }

    @Bean
    RouteCache routeCache() {
// Path: halfpipe-client/src/main/java/halfpipe/util/BeanUtils.java
// public class BeanUtils {
// 
//     private static ApplicationContext CONTEXT;
// 
//     public BeanUtils(ApplicationContext context) {
//         CONTEXT = context;
//     }
// 
//     public static ApplicationContext context() {
//         return CONTEXT;
//     }
// 
//     public static <T> T getBean(Class<T> requiredType) {
//         return CONTEXT.getBean(requiredType);
//     }
// 
//     public static <T> T getBean(String name, Class<T> requiredType) {
//         return CONTEXT.getBean(name, requiredType);
//     }
// 
//     public static <T> Optional<T> getOptionalBean(String name, Class<T> requiredType) {
//         try {
//             T bean = CONTEXT.getBean(name, requiredType);
//             return Optional.fromNullable(bean);
//         } catch (NoSuchBeanDefinitionException e) {
//             return Optional.absent();
//         }
//     }
// }


// Path: halfpipe-router/src/main/java/halfpipe/router/RouterApp.java
import com.netflix.zuul.context.ContextLifecycleFilter;
import halfpipe.util.BeanUtils;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.context.embedded.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
import javax.inject.Inject;
import java.util.ArrayList;
import java.util.Collection;

package halfpipe.router;



/**
 * User: spencergibb
 * Date: 4/24/14
 * Time: 8:57 PM
 */
@Configuration
@EnableAutoConfiguration
@EnableScheduling
@ComponentScan(basePackageClasses = RouterApp.class)
public class RouterApp extends WebSecurityConfigurerAdapter {

    @Inject
    BeanUtils beanUtils;

    @Bean
    RouterProperties routerProperties() {
        return new RouterProperties();
    }

    @Bean
    RouteCache routeCache() {
        return new RouteCache();