code cleanup

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@7057 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
orbiter 14 years ago
parent 6b06e94c8c
commit 4d5446d641

@ -1192,26 +1192,6 @@ public final class HTTPDFileHandler {
public static final Object invokeServlet(final File targetClass, final RequestHeader request, final serverObjects args) throws IllegalArgumentException, IllegalAccessException, InvocationTargetException {
// debug functions: for special servlets call them without reflection to get better stack trace results
/*
if (targetClass.getName().equals("transferURL.class")) {
try {
return transferURL.respond(request, args, switchboard);
} catch (Exception e) {
Log.logException(e);
Log.logSevere("HTTPFileHandler", "fail of transferURL", e);
throw new InvocationTargetException(e);
}
}
if (targetClass.getName().equals("crawlReceipt.class")) {
try {
return crawlReceipt.respond(request, args, switchboard);
} catch (Exception e) {
Log.logException(e);
Log.logSevere("HTTPFileHandler", "fail of crawlReceipt", e);
throw new InvocationTargetException(e);
}
}
*/
Object result;
if (safeServletsMode) synchronized (switchboard) {
result = rewriteMethod(targetClass).invoke(null, new Object[] {request, args, switchboard});

@ -94,7 +94,7 @@ public final class serverCore extends AbstractBusyThread implements BusyThread {
public static final Class<?>[] sessionCallType = {String.class, Session.class}; // set up some reflection
public static final long startupTime = System.currentTimeMillis();
private static final ThreadGroup sessionThreadGroup = new ThreadGroup("sessionThreadGroup");
private static final Map<String, Object> commandObjMethodCache = new ConcurrentHashMap<String, Object>(5);
private static final Map<String, Method> commandObjMethodCache = new ConcurrentHashMap<String, Method>(5);
/**
* will be increased with each session and is used to return a hash code
@ -713,7 +713,7 @@ public final class serverCore extends AbstractBusyThread implements BusyThread {
this.controlSocket.setSoTimeout(this.socketTimeout);
// exec command and return value
Object commandMethod = commandObjMethodCache.get(reqProtocol + "_" + reqCmd);
Method commandMethod = commandObjMethodCache.get(reqProtocol + "_" + reqCmd);
if (commandMethod == null) {
try {
commandMethod = this.commandObj.getClass().getMethod(reqCmd, sessionCallType);
@ -724,7 +724,7 @@ public final class serverCore extends AbstractBusyThread implements BusyThread {
}
}
//long commandStart = System.currentTimeMillis();
Object result = ((Method)commandMethod).invoke(this.commandObj, parameter);
Object result = commandMethod.invoke(this.commandObj, parameter);
//announceMoreExecTime(commandStart - System.currentTimeMillis()); // shall be negative!
//this.log.logDebug("* session " + handle + " completed command '" + request + "'. time = " + (System.currentTimeMillis() - handle));
this.out.flush();

@ -463,6 +463,7 @@ final class memprofiler extends Thread {
} catch (final Exception e) {
Log.logException(e);
}
ImageIO.setUseCache(false);
try {
ImageIO.write(memChart.getImage(), "png", outputFile);
} catch (final IOException e) {

@ -57,6 +57,7 @@ public class YaCyApp {
static {
try {
javax.swing.UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
ImageIO.setUseCache(false); // do not write a cache to disc; keep in RAM
if (splashFile != null) splashImg = ImageIO.read(splashFile);
} catch(Exception e) {
e.printStackTrace();

Loading…
Cancel
Save