// Path: modules/manage/src/main/java/com/intuit/autumn/manage/ManageModule.java
// public class ManageModule extends AbstractModule {
// 
//     private static final Logger LOGGER = getLogger(ManageModule.class);
// 
//     // note: configure the jmx ephemeral port, needs to be done before the jmx subsystem is instantiated
//     static {
//         // todo: ?should we provide a means to set the back-channel port, vs one-up the public port?
//         String portStr = getProperty("com.sun.management.jmxremote.port");
//         int port = (portStr != null) ? parseInt(portStr) + 1 : 18099;
// 
//         try {
//             createRegistry(port);
//         } catch (RemoteException e) {
//             LOGGER.warn("unable to create registry on port: {}, cause: {}", port, e.getMessage());
// 
//             throw new ManageException(e);
//         }
//     }
// 
//     /**
//      * Install module dependencies.
//      */
// 
//     @Override
//     protected void configure() {
//         bind(MBeanServer.class).toInstance(ManagementFactory.getPlatformMBeanServer());
//         bind(MBeanRegistry.class).in(SINGLETON);
//     }
// }
// 
// Path: modules/utils/src/main/java/com/intuit/autumn/utils/PropertyFactory.java
// public static Properties create(final String propertyResourceName) {
//     return create(propertyResourceName, null);
// }
// 
// Path: modules/utils/src/main/java/com/intuit/autumn/utils/PropertyFactory.java
// public static String getProperty(final String key, final Properties properties) {
//     return getProperty(key, properties, null);
// }


import com.google.inject.AbstractModule;
import com.intuit.autumn.manage.ManageModule;
import org.slf4j.Logger;
import java.util.Properties;
import static com.google.inject.Scopes.SINGLETON;
import static com.google.inject.name.Names.named;
import static com.intuit.autumn.utils.PropertyFactory.create;
import static com.intuit.autumn.utils.PropertyFactory.getProperty;
import static java.lang.Integer.valueOf;
import static org.slf4j.LoggerFactory.getLogger;
/*
 * Copyright 2016 Intuit
 *
 * 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.intuit.autumn.web;




/**
 * An injector that includes wire protocol implementation dependencies, e.g.: Jetty (HTTP/S)
 */

public class WebModule extends AbstractModule {

    public static final String PROPERTY_NAME = "/web.properties";
    public static final String SECRETS_PROPERTY_NAME = "/web-secrets.properties";
    private static final Logger LOGGER = getLogger(WebModule.class);

    /**
     * Inject module dependencies.
     */

    @Override
    protected void configure() {
        install(new WebServletModule());
// Path: modules/manage/src/main/java/com/intuit/autumn/manage/ManageModule.java
// public class ManageModule extends AbstractModule {
// 
//     private static final Logger LOGGER = getLogger(ManageModule.class);
// 
//     // note: configure the jmx ephemeral port, needs to be done before the jmx subsystem is instantiated
//     static {
//         // todo: ?should we provide a means to set the back-channel port, vs one-up the public port?
//         String portStr = getProperty("com.sun.management.jmxremote.port");
//         int port = (portStr != null) ? parseInt(portStr) + 1 : 18099;
// 
//         try {
//             createRegistry(port);
//         } catch (RemoteException e) {
//             LOGGER.warn("unable to create registry on port: {}, cause: {}", port, e.getMessage());
// 
//             throw new ManageException(e);
//         }
//     }
// 
//     /**
//      * Install module dependencies.
//      */
// 
//     @Override
//     protected void configure() {
//         bind(MBeanServer.class).toInstance(ManagementFactory.getPlatformMBeanServer());
//         bind(MBeanRegistry.class).in(SINGLETON);
//     }
// }
// 
// Path: modules/utils/src/main/java/com/intuit/autumn/utils/PropertyFactory.java
// public static Properties create(final String propertyResourceName) {
//     return create(propertyResourceName, null);
// }
// 
// Path: modules/utils/src/main/java/com/intuit/autumn/utils/PropertyFactory.java
// public static String getProperty(final String key, final Properties properties) {
//     return getProperty(key, properties, null);
// }


// Path: modules/web/src/main/java/com/intuit/autumn/web/WebModule.java
import com.google.inject.AbstractModule;
import com.intuit.autumn.manage.ManageModule;
import org.slf4j.Logger;
import java.util.Properties;
import static com.google.inject.Scopes.SINGLETON;
import static com.google.inject.name.Names.named;
import static com.intuit.autumn.utils.PropertyFactory.create;
import static com.intuit.autumn.utils.PropertyFactory.getProperty;
import static java.lang.Integer.valueOf;
import static org.slf4j.LoggerFactory.getLogger;

/*
 * Copyright 2016 Intuit
 *
 * 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.intuit.autumn.web;




/**
 * An injector that includes wire protocol implementation dependencies, e.g.: Jetty (HTTP/S)
 */

public class WebModule extends AbstractModule {

    public static final String PROPERTY_NAME = "/web.properties";
    public static final String SECRETS_PROPERTY_NAME = "/web-secrets.properties";
    private static final Logger LOGGER = getLogger(WebModule.class);

    /**
     * Inject module dependencies.
     */

    @Override
    protected void configure() {
        install(new WebServletModule());
        install(new ManageModule());