// Path: dropwizard/src/main/java/net/winterly/rxjersey/dropwizard/RxJerseyBundle.java
// public class RxJerseyBundle<T extends Configuration> implements ConfiguredBundle<T> {
// 
//     private final RxJerseyServerFeature rxJerseyServerFeature = new RxJerseyServerFeature();
//     private final RxJerseyClientFeature rxJerseyClientFeature = new RxJerseyClientFeature();
// 
//     private Function<T, JerseyClientConfiguration> clientConfigurationProvider;
// 
//     public RxJerseyBundle() {
//         setClientConfigurationProvider(configuration -> {
//             int cores = Runtime.getRuntime().availableProcessors();
//             JerseyClientConfiguration clientConfiguration = new JerseyClientConfiguration();
//             clientConfiguration.setMaxThreads(cores);
// 
//             return clientConfiguration;
//         });
//     }
// 
//     @Override
//     public void run(T configuration, Environment environment) throws Exception {
//         JerseyEnvironment jersey = environment.jersey();
// 
//         JerseyClientConfiguration clientConfiguration = clientConfigurationProvider.apply(configuration);
//         Client client = getClient(environment, clientConfiguration);
// 
//         rxJerseyClientFeature.setClient(client);
// 
//         jersey.register(rxJerseyServerFeature);
//         jersey.register(rxJerseyClientFeature);
//     }
// 
//     @Override
//     public void initialize(Bootstrap<?> bootstrap) {
// 
//     }
// 
//     public RxJerseyClientFeature client() {
//         return rxJerseyClientFeature;
//     }
// 
//     public RxJerseyServerFeature server() {
//         return rxJerseyServerFeature;
//     }
// 
//     public RxJerseyBundle<T> setClientConfigurationProvider(Function<T, JerseyClientConfiguration> provider) {
//         clientConfigurationProvider = provider;
//         return this;
//     }
// 
//     public RxJerseyBundle<T> register(Class<? extends CompletableRequestInterceptor> interceptor) {
//         rxJerseyServerFeature.register(interceptor);
//         return this;
//     }
// 
//     private Client getClient(Environment environment, JerseyClientConfiguration jerseyClientConfiguration) {
//         return new JerseyClientBuilder(environment)
//                 .using(jerseyClientConfiguration)
//                 .using(new GrizzlyConnectorProvider())
//                 .buildRx("rxJerseyClient", RxFlowableInvokerProvider.class);
//     }
// }


import com.fasterxml.jackson.databind.DeserializationFeature;
import io.dropwizard.Application;
import io.dropwizard.setup.Bootstrap;
import io.dropwizard.setup.Environment;
import net.winterly.rxjersey.dropwizard.RxJerseyBundle;
package net.winterly.rxjersey.example;


public class RxJerseyApplication extends Application<RxJerseyConfiguration> {

    public static void main(String[] args) throws Exception {
        new RxJerseyApplication().run(args);
    }

    @Override
    public void initialize(Bootstrap<RxJerseyConfiguration> bootstrap) {
        bootstrap.getObjectMapper()
                .disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES);

// Path: dropwizard/src/main/java/net/winterly/rxjersey/dropwizard/RxJerseyBundle.java
// public class RxJerseyBundle<T extends Configuration> implements ConfiguredBundle<T> {
// 
//     private final RxJerseyServerFeature rxJerseyServerFeature = new RxJerseyServerFeature();
//     private final RxJerseyClientFeature rxJerseyClientFeature = new RxJerseyClientFeature();
// 
//     private Function<T, JerseyClientConfiguration> clientConfigurationProvider;
// 
//     public RxJerseyBundle() {
//         setClientConfigurationProvider(configuration -> {
//             int cores = Runtime.getRuntime().availableProcessors();
//             JerseyClientConfiguration clientConfiguration = new JerseyClientConfiguration();
//             clientConfiguration.setMaxThreads(cores);
// 
//             return clientConfiguration;
//         });
//     }
// 
//     @Override
//     public void run(T configuration, Environment environment) throws Exception {
//         JerseyEnvironment jersey = environment.jersey();
// 
//         JerseyClientConfiguration clientConfiguration = clientConfigurationProvider.apply(configuration);
//         Client client = getClient(environment, clientConfiguration);
// 
//         rxJerseyClientFeature.setClient(client);
// 
//         jersey.register(rxJerseyServerFeature);
//         jersey.register(rxJerseyClientFeature);
//     }
// 
//     @Override
//     public void initialize(Bootstrap<?> bootstrap) {
// 
//     }
// 
//     public RxJerseyClientFeature client() {
//         return rxJerseyClientFeature;
//     }
// 
//     public RxJerseyServerFeature server() {
//         return rxJerseyServerFeature;
//     }
// 
//     public RxJerseyBundle<T> setClientConfigurationProvider(Function<T, JerseyClientConfiguration> provider) {
//         clientConfigurationProvider = provider;
//         return this;
//     }
// 
//     public RxJerseyBundle<T> register(Class<? extends CompletableRequestInterceptor> interceptor) {
//         rxJerseyServerFeature.register(interceptor);
//         return this;
//     }
// 
//     private Client getClient(Environment environment, JerseyClientConfiguration jerseyClientConfiguration) {
//         return new JerseyClientBuilder(environment)
//                 .using(jerseyClientConfiguration)
//                 .using(new GrizzlyConnectorProvider())
//                 .buildRx("rxJerseyClient", RxFlowableInvokerProvider.class);
//     }
// }


// Path: example/src/main/java/net/winterly/rxjersey/example/RxJerseyApplication.java
import com.fasterxml.jackson.databind.DeserializationFeature;
import io.dropwizard.Application;
import io.dropwizard.setup.Bootstrap;
import io.dropwizard.setup.Environment;
import net.winterly.rxjersey.dropwizard.RxJerseyBundle;

package net.winterly.rxjersey.example;


public class RxJerseyApplication extends Application<RxJerseyConfiguration> {

    public static void main(String[] args) throws Exception {
        new RxJerseyApplication().run(args);
    }

    @Override
    public void initialize(Bootstrap<RxJerseyConfiguration> bootstrap) {
        bootstrap.getObjectMapper()
                .disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES);

        bootstrap.addBundle(new RxJerseyBundle<RxJerseyConfiguration>()