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);