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 { 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 // 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; Object result;
if (safeServletsMode) synchronized (switchboard) { if (safeServletsMode) synchronized (switchboard) {
result = rewriteMethod(targetClass).invoke(null, new Object[] {request, args, 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 Class<?>[] sessionCallType = {String.class, Session.class}; // set up some reflection
public static final long startupTime = System.currentTimeMillis(); public static final long startupTime = System.currentTimeMillis();
private static final ThreadGroup sessionThreadGroup = new ThreadGroup("sessionThreadGroup"); 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 * 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); this.controlSocket.setSoTimeout(this.socketTimeout);
// exec command and return value // exec command and return value
Object commandMethod = commandObjMethodCache.get(reqProtocol + "_" + reqCmd); Method commandMethod = commandObjMethodCache.get(reqProtocol + "_" + reqCmd);
if (commandMethod == null) { if (commandMethod == null) {
try { try {
commandMethod = this.commandObj.getClass().getMethod(reqCmd, sessionCallType); commandMethod = this.commandObj.getClass().getMethod(reqCmd, sessionCallType);
@ -724,7 +724,7 @@ public final class serverCore extends AbstractBusyThread implements BusyThread {
} }
} }
//long commandStart = System.currentTimeMillis(); //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! //announceMoreExecTime(commandStart - System.currentTimeMillis()); // shall be negative!
//this.log.logDebug("* session " + handle + " completed command '" + request + "'. time = " + (System.currentTimeMillis() - handle)); //this.log.logDebug("* session " + handle + " completed command '" + request + "'. time = " + (System.currentTimeMillis() - handle));
this.out.flush(); this.out.flush();

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

@ -57,6 +57,7 @@ public class YaCyApp {
static { static {
try { try {
javax.swing.UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); 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); if (splashFile != null) splashImg = ImageIO.read(splashFile);
} catch(Exception e) { } catch(Exception e) {
e.printStackTrace(); e.printStackTrace();

Loading…
Cancel
Save