- remove double initialization of jetty

- refactor some var assignments
pull/1/head
reger 12 years ago
parent 8e52271491
commit 36b7159282

@ -56,7 +56,7 @@ public final class Connections_p {
// server sessions
// get the serverCore thread
final WorkflowThread httpd = sb.getThread("10_httpd");
//final WorkflowThread httpd = sb.getThread("10_httpd"); //not working with Jetty
// determines if name lookup should be done or not
final boolean doNameLookup;
@ -138,7 +138,7 @@ public final class Connections_p {
}
prop.put("list", idx);
prop.putNum("numMax", ((serverCore)httpd).getMaxSessionCount());
prop.putNum("numMax", -1/* ((serverCore)httpd).getMaxSessionCount()*/); //TODO: get limit from Jetty
prop.putNum("numActiveRunning", numActiveRunning);
prop.putNum("numActivePending", numActivePending);

@ -47,7 +47,7 @@ public class HttpServer {
*/
public HttpServer(int port) {
Switchboard sb = Switchboard.getSwitchboard();
server = new Server();
SelectChannelConnector connector = new SelectChannelConnector();
connector.setPort(port);
//connector.setThreadPool(new QueuedThreadPool(20));
@ -58,15 +58,15 @@ public class HttpServer {
ResourceHandler resource_handler = new ResourceHandler();
resource_handler.setDirectoriesListed(true);
resource_handler.setWelcomeFiles(new String[]{ "index.html" });
resource_handler.setWelcomeFiles(new String[]{"index.html"});
resource_handler.setResourceBase("htroot/");
HandlerList handlers = new HandlerList();
handlers.setHandlers(new Handler[]
{ domainHandler, new ProxyCacheHandler(), new ProxyHandler(), new RewriteHandler(),
new SSIHandler(new TemplateHandler()),
resource_handler, new DefaultHandler() });
{domainHandler, new ProxyCacheHandler(), new ProxyHandler(),
new RewriteHandler(), new SSIHandler(new TemplateHandler()),
resource_handler, new DefaultHandler()});
YaCySecurityHandler securityHandler = new YaCySecurityHandler();
securityHandler.setLoginService(new YaCyLoginService());

@ -102,7 +102,7 @@ public class SSIHandler extends ContentModHandler implements Handler, HandlerCon
*/
public void writeContent(final String path, HttpServletRequest request, HttpServletResponse response) {
// check if there are arguments in path string
String args = "";
String args;
String fname = path;
final int argpos = path.indexOf('?');
if (argpos > 0) {

@ -94,6 +94,7 @@ public class TemplateHandler extends AbstractHandler implements Handler {
protected void doStart() throws Exception {
super.doStart();
templateMethodCache = new ConcurrentHashMap<File, SoftReference<Method>>();
htDocsPath = Switchboard.getSwitchboard().htDocsPath.getPath();
}
@Override
@ -228,16 +229,13 @@ public class TemplateHandler extends AbstractHandler implements Handler {
try {
tmp = invokeServlet(targetClass, legacyRequestHeader, args);
} catch (InvocationTargetException e) {
// TODO Auto-generated catch block
e.printStackTrace();
ConcurrentLog.logException(e);
throw new ServletException();
} catch (IllegalArgumentException e) {
// TODO Auto-generated catch block
e.printStackTrace();
ConcurrentLog.logException(e);
throw new ServletException();
} catch (IllegalAccessException e) {
// TODO Auto-generated catch block
e.printStackTrace();
ConcurrentLog.logException(e);
throw new ServletException();
}

Loading…
Cancel
Save