|
|
|
@ -637,6 +637,9 @@ public final class serverCore extends serverAbstractThread implements serverThre
|
|
|
|
|
|
|
|
|
|
public Session(ThreadGroup theThreadGroup) {
|
|
|
|
|
super(theThreadGroup,"Session");
|
|
|
|
|
|
|
|
|
|
// setting the session startup time
|
|
|
|
|
this.start = System.currentTimeMillis();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void setStopped(boolean stopped) {
|
|
|
|
@ -730,15 +733,12 @@ public final class serverCore extends serverAbstractThread implements serverThre
|
|
|
|
|
synchronized (this) {
|
|
|
|
|
try {
|
|
|
|
|
this.wait(); //Wait until we get a request to process.
|
|
|
|
|
}
|
|
|
|
|
catch (InterruptedException e) {
|
|
|
|
|
} catch (InterruptedException e) {
|
|
|
|
|
this.stopped = true;
|
|
|
|
|
// log.error("", e);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
} else {
|
|
|
|
|
//There is a task....let us execute it.
|
|
|
|
|
try {
|
|
|
|
|
execute();
|
|
|
|
@ -750,16 +750,14 @@ public final class serverCore extends serverAbstractThread implements serverThre
|
|
|
|
|
}
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
// log.error("", e);
|
|
|
|
|
}
|
|
|
|
|
finally {
|
|
|
|
|
} finally {
|
|
|
|
|
reset();
|
|
|
|
|
|
|
|
|
|
if (!this.stopped && !this.isInterrupted()) {
|
|
|
|
|
try {
|
|
|
|
|
this.setName("Session_inPool");
|
|
|
|
|
serverCore.this.theSessionPool.returnObject(this);
|
|
|
|
|
}
|
|
|
|
|
catch (Exception e1) {
|
|
|
|
|
} catch (Exception e1) {
|
|
|
|
|
// e1.printStackTrace();
|
|
|
|
|
this.stopped = true;
|
|
|
|
|
}
|
|
|
|
@ -772,8 +770,7 @@ public final class serverCore extends serverAbstractThread implements serverThre
|
|
|
|
|
private void execute() throws InterruptedException {
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
// setting the session startup time
|
|
|
|
|
this.start = System.currentTimeMillis();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// settin the session identity
|
|
|
|
|
this.identity = "-";
|
|
|
|
@ -820,7 +817,6 @@ public final class serverCore extends serverAbstractThread implements serverThre
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//log.logDebug("* session " + handle + " completed. time = " + (System.currentTimeMillis() - handle));
|
|
|
|
|
announceMoreExecTime(System.currentTimeMillis() - this.start);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void listen() {
|
|
|
|
@ -877,7 +873,9 @@ public final class serverCore extends serverAbstractThread implements serverThre
|
|
|
|
|
stringParameter[0] = this.request.trim();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
//long commandStart = System.currentTimeMillis();
|
|
|
|
|
result = ((Method)commandMethod).invoke(this.commandObj, stringParameter);
|
|
|
|
|
//announceMoreExecTime(commandStart - System.currentTimeMillis()); // shall be negative!
|
|
|
|
|
//log.logDebug("* session " + handle + " completed command '" + request + "'. time = " + (System.currentTimeMillis() - handle));
|
|
|
|
|
this.out.flush();
|
|
|
|
|
if (result == null) {
|
|
|
|
@ -939,6 +937,7 @@ public final class serverCore extends serverAbstractThread implements serverThre
|
|
|
|
|
} catch (java.io.IOException e) {
|
|
|
|
|
// connection interruption: more or less normal
|
|
|
|
|
}
|
|
|
|
|
//announceMoreExecTime(System.currentTimeMillis() - this.start);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|