// Path: src/main/java/com/cisco/cta/taxii/adapter/error/ChainHandler.java
// public class ChainHandler implements Handler<Throwable> {
// 
//     private final Handler<BindValidationException> bindExceptionHandler = new BindExceptionHandler(System.err);
//     private final Handler<YAMLException> yamlExceptionHandler = new YamlExceptionHandler(System.err);
//     private final Handler<Throwable> causeHandler = new CauseHandler(System.err);
//     private final Handler<Throwable> fallBackHandler = new FallBackHandler(System.err);
// 
// 
//     @Override
//     public void handle(Throwable t) {
//         try {
//             throw t;
// 
//         } catch (NestedRuntimeException e) {
//             try {
//                 throw e.getMostSpecificCause();
//             } catch (BindValidationException bindRootCause) {
//                 bindExceptionHandler.handle(bindRootCause);
//             } catch (Throwable unknownRootCause) {
//                 fallBackHandler.handle(unknownRootCause);
//             }
// 
//         } catch (YAMLException target) {
//             yamlExceptionHandler.handle(target);
// 
//         } catch (IllegalStateException illegal) {
//             causeHandler.handle(illegal);
// 
//         } catch (Throwable e) {
//             fallBackHandler.handle(e);
//         }
//     }
// 
// }
// 
// Path: src/main/java/com/cisco/cta/taxii/adapter/error/Handler.java
// public interface Handler<T extends Throwable> {
// 
//     void handle(T t);
// }
// 
// Path: src/main/java/com/cisco/cta/taxii/adapter/smoketest/SmokeTestConfiguration.java
// @Configuration
// @Profile("smoketest")
// @Import(AdapterConfiguration.class)
// public class SmokeTestConfiguration {
// 
//     @Autowired
//     private SettingsConfiguration settingsConfig;
// 
//     @Autowired
//     private RequestFactory requestFactory;
// 
//     @Autowired
//     private Templates templates;
// 
//     @Autowired
//     private Writer logWriter;
// 
//     @Bean
//     public SmokeTestLifecycle smokeTest() {
//         return new SmokeTestLifecycle(settingsConfig, requestFactory, templates, logWriter);
//     }
// 
// }


import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import java.io.PrintStream;
import org.springframework.boot.Banner.Mode;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.WebApplicationType;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.context.ApplicationPidFileWriter;
import org.springframework.context.ConfigurableApplicationContext;
import com.cisco.cta.taxii.adapter.error.ChainHandler;
import com.cisco.cta.taxii.adapter.error.Handler;
import com.cisco.cta.taxii.adapter.smoketest.SmokeTestConfiguration;
import com.google.common.io.ByteStreams;
/*
   Copyright 2015 Cisco Systems

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
*/

package com.cisco.cta.taxii.adapter;






/**
 * Adapter main class.
 */
public class AdapterRunner {

    static ConfigurableApplicationContext ctx;
// Path: src/main/java/com/cisco/cta/taxii/adapter/error/ChainHandler.java
// public class ChainHandler implements Handler<Throwable> {
// 
//     private final Handler<BindValidationException> bindExceptionHandler = new BindExceptionHandler(System.err);
//     private final Handler<YAMLException> yamlExceptionHandler = new YamlExceptionHandler(System.err);
//     private final Handler<Throwable> causeHandler = new CauseHandler(System.err);
//     private final Handler<Throwable> fallBackHandler = new FallBackHandler(System.err);
// 
// 
//     @Override
//     public void handle(Throwable t) {
//         try {
//             throw t;
// 
//         } catch (NestedRuntimeException e) {
//             try {
//                 throw e.getMostSpecificCause();
//             } catch (BindValidationException bindRootCause) {
//                 bindExceptionHandler.handle(bindRootCause);
//             } catch (Throwable unknownRootCause) {
//                 fallBackHandler.handle(unknownRootCause);
//             }
// 
//         } catch (YAMLException target) {
//             yamlExceptionHandler.handle(target);
// 
//         } catch (IllegalStateException illegal) {
//             causeHandler.handle(illegal);
// 
//         } catch (Throwable e) {
//             fallBackHandler.handle(e);
//         }
//     }
// 
// }
// 
// Path: src/main/java/com/cisco/cta/taxii/adapter/error/Handler.java
// public interface Handler<T extends Throwable> {
// 
//     void handle(T t);
// }
// 
// Path: src/main/java/com/cisco/cta/taxii/adapter/smoketest/SmokeTestConfiguration.java
// @Configuration
// @Profile("smoketest")
// @Import(AdapterConfiguration.class)
// public class SmokeTestConfiguration {
// 
//     @Autowired
//     private SettingsConfiguration settingsConfig;
// 
//     @Autowired
//     private RequestFactory requestFactory;
// 
//     @Autowired
//     private Templates templates;
// 
//     @Autowired
//     private Writer logWriter;
// 
//     @Bean
//     public SmokeTestLifecycle smokeTest() {
//         return new SmokeTestLifecycle(settingsConfig, requestFactory, templates, logWriter);
//     }
// 
// }


// Path: src/main/java/com/cisco/cta/taxii/adapter/AdapterRunner.java
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import java.io.PrintStream;
import org.springframework.boot.Banner.Mode;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.WebApplicationType;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.context.ApplicationPidFileWriter;
import org.springframework.context.ConfigurableApplicationContext;
import com.cisco.cta.taxii.adapter.error.ChainHandler;
import com.cisco.cta.taxii.adapter.error.Handler;
import com.cisco.cta.taxii.adapter.smoketest.SmokeTestConfiguration;
import com.google.common.io.ByteStreams;

/*
   Copyright 2015 Cisco Systems

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
*/

package com.cisco.cta.taxii.adapter;






/**
 * Adapter main class.
 */
public class AdapterRunner {

    static ConfigurableApplicationContext ctx;
    private static final Handler<Throwable> errHandler = new ChainHandler();