Package org.mortbay.http

Examples of org.mortbay.http.HttpListener


            if (listeners != null)
            {
               boolean found = false;
               for (int i = 0; i < listeners.length; ++i)
               {
                  HttpListener listener = listeners[i];
                  if (listener.getPort() == url.getPort())
                  {
                     found = true;
                     break;
                  }
               }
View Full Code Here


            if (listeners != null)
            {
               boolean found = false;
               for (int i = 0; i < listeners.length; ++i)
               {
                  HttpListener listener = listeners[i];
                  if (listener.getPort() == url.getPort())
                  {
                     found = true;
                     break;
                  }
               }
View Full Code Here

    }

    private class UndefinedListenerState implements GBeanLifecycle {

        public void doStart() throws WaitingException, Exception {
            HttpListener tmpListener;
            try {
                if (null == protocol || protocol.equalsIgnoreCase(HTTP_PROTOCOL)) {
                    tmpListener = new SocketListener();
                } else if (protocol.equalsIgnoreCase(AJP13_PROTOCOL)) {
                    tmpListener = new AJP13Listener();
                } else if (protocol.equalsIgnoreCase(HTTPS_PROTOCOL)) {
                    tmpListener = new SunJsseListener();
                } else {
                    Class listenerClass =
                            Thread.currentThread().getContextClassLoader().loadClass(
                                    protocol);
                    Constructor constructor =
                            listenerClass.getConstructor(EMPTY_FORMAL_PARAM);
                    tmpListener =
                            (HttpListener) constructor.newInstance(EMPTY_ARGS);
                }
                tmpListener.setPort(getPort());

                if (getInterface() != null) {
                    tmpListener.setHost(getInterface());
                }
                if (getMaxConnections() > 0) {
                    ((ThreadedServer) tmpListener).setMaxThreads(getMaxConnections());
                }
                if (getMaxIdleTime() > 0) {
                    ((ThreadedServer) tmpListener).setMaxIdleTimeMs(getMaxIdleTime());
                }
                ((ThreadedServer) tmpListener).open();
                tmpListener.start();
            } catch (Exception e) {
                log.error("Problem starting Connector", e);
                throw e;
            }
            setListener(tmpListener);
View Full Code Here

    }

    public void removeConnector(JettyConnector aConnector) {
        // At this stage, the connector could be failed. In this later case
        // the underlying listener is undefined. Hence the conToListener Map.
        HttpListener httpListener;
        synchronized (conToListener) {
            httpListener = (HttpListener) conToListener.remove(aConnector);
        }
        if (null == httpListener) {
            throw new IllegalStateException("Connector not registered.");
View Full Code Here

    private class UndefinedListenerState implements GBean {
        public void setGBeanContext(GBeanContext context) {
        }

        public void doStart() throws WaitingException, Exception {
            HttpListener tmpListener;
            try {
                if (null == protocol || protocol.equalsIgnoreCase(HTTP_PROTOCOL)) {
                    tmpListener = new SocketListener();
                } else if (protocol.equalsIgnoreCase(AJP13_PROTOCOL)) {
                    tmpListener = new AJP13Listener();
                } else if (protocol.equalsIgnoreCase(HTTPS_PROTOCOL)) {
                    tmpListener = new SunJsseListener();
                } else {
                    Class listenerClass =
                            Thread.currentThread().getContextClassLoader().loadClass(
                                    protocol);
                    Constructor constructor =
                            listenerClass.getConstructor(EMPTY_FORMAL_PARAM);
                    tmpListener =
                            (HttpListener) constructor.newInstance(EMPTY_ARGS);
                }
                tmpListener.setPort(getPort());

                if (getInterface() != null) {
                    tmpListener.setHost(getInterface());
                }
                if (getMaxConnections() > 0) {
                    ((ThreadedServer) tmpListener).setMaxThreads(getMaxConnections());
                }
                if (getMaxIdleTime() > 0) {
                    ((ThreadedServer) tmpListener).setMaxIdleTimeMs(getMaxIdleTime());
                }
                ((ThreadedServer) tmpListener).open();
                tmpListener.start();
            } catch (Exception e) {
                log.error("Problem starting Connector", e);
                throw e;
            }
            setListener(tmpListener);
View Full Code Here

    }

    public void removeConnector(JettyConnector aConnector) {
        // At this stage, the connector could be failed. In this later case
        // the underlying listener is undefined. Hence the conToListener Map.
        HttpListener httpListener;
        synchronized (conToListener) {
            httpListener = (HttpListener) conToListener.remove(aConnector);
        }
        if (null == httpListener) {
            throw new IllegalStateException("Connector not registered.");
View Full Code Here

    }

    private class UndefinedListenerState implements GBeanLifecycle {

        public void doStart() throws WaitingException, Exception {
            HttpListener tmpListener;
            try {
                if (null == protocol || protocol.equalsIgnoreCase(HTTP_PROTOCOL)) {
                    tmpListener = new SocketListener();
                } else if (protocol.equalsIgnoreCase(AJP13_PROTOCOL)) {
                    tmpListener = new AJP13Listener();
                } else if (protocol.equalsIgnoreCase(HTTPS_PROTOCOL)) {
                    tmpListener = new SunJsseListener();
                } else {
                    Class listenerClass =
                            Thread.currentThread().getContextClassLoader().loadClass(
                                    protocol);
                    Constructor constructor =
                            listenerClass.getConstructor(EMPTY_FORMAL_PARAM);
                    tmpListener =
                            (HttpListener) constructor.newInstance(EMPTY_ARGS);
                }
                tmpListener.setPort(getPort());

                if (getInterface() != null) {
                    tmpListener.setHost(getInterface());
                }
                if (getMaxConnections() > 0) {
                    ((ThreadedServer) tmpListener).setMaxThreads(getMaxConnections());
                }
                if (getMaxIdleTime() > 0) {
                    ((ThreadedServer) tmpListener).setMaxIdleTimeMs(getMaxIdleTime());
                }
                ((ThreadedServer) tmpListener).open();
                tmpListener.start();
            } catch (Exception e) {
                log.error("Problem starting Connector", e);
                throw e;
            }
            setListener(tmpListener);
View Full Code Here

    }

    public void removeConnector(JettyConnector aConnector) {
        // At this stage, the connector could be failed. In this later case
        // the underlying listener is undefined. Hence the conToListener Map.
        HttpListener httpListener;
        synchronized (conToListener) {
            httpListener = (HttpListener) conToListener.remove(aConnector);
        }
        if (null == httpListener) {
            throw new IllegalStateException("Connector not registered.");
View Full Code Here

TOP

Related Classes of org.mortbay.http.HttpListener

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.