Package io.dropwizard.server

Examples of io.dropwizard.server.AbstractServerFactory


     */

    public abstract SCONFIG getServiceConfig();

    public int getApplicationPort() {
        AbstractServerFactory sf = serverFactory();
        if (sf instanceof SimpleServerFactory) {
            SimpleServerFactory ssf = (SimpleServerFactory) sf;
            return ((HttpConnectorFactory)ssf.getConnector()).getPort();
        }
        if (sf instanceof DefaultServerFactory) {
            DefaultServerFactory dsf = (DefaultServerFactory) sf;
            return ((HttpConnectorFactory)dsf.getApplicationConnectors().get(0)).getPort();
        }
        throw new IllegalStateException("Unrecognized ServerFactory: "+sf.getClass().getName());
    }
View Full Code Here


        }
        throw new IllegalStateException("Unrecognized ServerFactory: "+sf.getClass().getName());
    }

    public int getAdminPort() {
        AbstractServerFactory sf = serverFactory();
        if (sf instanceof SimpleServerFactory) {
            SimpleServerFactory ssf = (SimpleServerFactory) sf;
            return ((HttpConnectorFactory)ssf.getConnector()).getPort();
        }
        if (sf instanceof DefaultServerFactory) {
            DefaultServerFactory dsf = (DefaultServerFactory) sf;
            return ((HttpConnectorFactory)dsf.getAdminConnectors().get(0)).getPort();
        }
        throw new IllegalStateException("Unrecognized ServerFactory: "+sf.getClass().getName());
    }   
View Full Code Here

    /**********************************************************************
     */

    @SuppressWarnings("unchecked")
    public THIS overrideHttpPort(int p) {
        AbstractServerFactory sf = serverFactory();
        if (sf instanceof SimpleServerFactory) {
            SimpleServerFactory ssf = (SimpleServerFactory) sf;
            ((HttpConnectorFactory)ssf.getConnector()).setPort(p);
        } else if (sf instanceof DefaultServerFactory) {
            DefaultServerFactory dsf = (DefaultServerFactory) sf;
            ((HttpConnectorFactory)dsf.getApplicationConnectors().get(0)).setPort(p);
        } else {
            throw new IllegalStateException("Unrecognized ServerFactory: "+sf.getClass().getName());
        }
        return (THIS) this;
    }
View Full Code Here

        return (THIS) this;
    }

    @SuppressWarnings("unchecked")
    public THIS overrideAdminPort(int p) {
        AbstractServerFactory sf = serverFactory();
        if (sf instanceof SimpleServerFactory) {
            // no admin port; just ignore
        } else if (sf instanceof DefaultServerFactory) {
            DefaultServerFactory dsf = (DefaultServerFactory) sf;
            ((HttpConnectorFactory)dsf.getAdminConnectors().get(0)).setPort(p);
        } else {
            throw new IllegalStateException("Unrecognized ServerFactory: "+sf.getClass().getName());
        }
        return (THIS) this;
    }
View Full Code Here

    protected AbstractServerFactory serverFactory() {
        return (AbstractServerFactory) getServerFactory();
    }

    protected SimpleServerFactory simpleServerFactory() {
        AbstractServerFactory sf = serverFactory();
        return (sf instanceof SimpleServerFactory) ? (SimpleServerFactory) sf : null;
    }
View Full Code Here

TOP

Related Classes of io.dropwizard.server.AbstractServerFactory

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.