From 6604a2b1fa4ea2f506b5a997b73efe3ef1cae9d9 Mon Sep 17 00:00:00 2001 From: clemenso Date: Wed, 24 Sep 2008 16:04:21 +0000 Subject: remove isHandlingRequest git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@68 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- .../stal/service/impl/STALRequestBrokerImpl.java | 40 +++++++++++----------- 1 file changed, 20 insertions(+), 20 deletions(-) (limited to 'BKUOnline/src/main/java/at/gv/egiz/stal') diff --git a/BKUOnline/src/main/java/at/gv/egiz/stal/service/impl/STALRequestBrokerImpl.java b/BKUOnline/src/main/java/at/gv/egiz/stal/service/impl/STALRequestBrokerImpl.java index 6160c71e..7897f984 100644 --- a/BKUOnline/src/main/java/at/gv/egiz/stal/service/impl/STALRequestBrokerImpl.java +++ b/BKUOnline/src/main/java/at/gv/egiz/stal/service/impl/STALRequestBrokerImpl.java @@ -50,10 +50,10 @@ public class STALRequestBrokerImpl implements STALRequestBroker { protected List requests = null; protected List responses = null; protected List currentHashDataInput; - private boolean isHandlingRequest = false; +// private boolean isHandlingRequest = false; private boolean expectingResponse = false; private boolean interrupted = false; - + /** * Produce requests (and HashDataInputCallback) and wait for responses. * The next thread may enter once we consumed the responses. @@ -69,17 +69,17 @@ public class STALRequestBrokerImpl implements STALRequestBroker { return null; } try { - long beforeWait = System.currentTimeMillis(); - while (isHandlingRequest) { - log.trace("waiting to produce request"); - wait(TIMEOUT_MS); - if (System.currentTimeMillis() - beforeWait >= TIMEOUT_MS) { - log.warn("timeout while waiting to produce request"); - return Collections.singletonList((STALResponse) new ErrorResponse(ERR_6000)); - } - } +// long beforeWait = System.currentTimeMillis(); +// while (isHandlingRequest) { +// log.trace("waiting to produce request"); +// wait(TIMEOUT_MS); +// if (System.currentTimeMillis() - beforeWait >= TIMEOUT_MS) { +// log.warn("timeout while waiting to produce request"); +// return Collections.singletonList((STALResponse) new ErrorResponse(ERR_6000)); +// } +// } log.trace("produce request"); - isHandlingRequest = true; +// isHandlingRequest = true; this.requests = requests; currentHashDataInput = null; @@ -100,7 +100,7 @@ public class STALRequestBrokerImpl implements STALRequestBroker { log.trace("notifying request consumers"); notify(); - beforeWait = System.currentTimeMillis(); + long beforeWait = System.currentTimeMillis(); while (this.responses == null) { log.trace("waiting to consume response"); wait(TIMEOUT_MS); @@ -108,7 +108,7 @@ public class STALRequestBrokerImpl implements STALRequestBroker { log.warn("timeout while waiting to consume response"); this.requests = null; currentHashDataInput = null; - isHandlingRequest = false; +// isHandlingRequest = false; return Collections.singletonList((STALResponse) new ErrorResponse(ERR_6000)); } } @@ -118,9 +118,9 @@ public class STALRequestBrokerImpl implements STALRequestBroker { log.trace("notifying response producers"); notify(); - isHandlingRequest = false; - log.trace("notifying request producers"); - notify(); +// isHandlingRequest = false; +// log.trace("notifying request producers"); +// notify(); return resps; } catch (InterruptedException ex) { @@ -186,9 +186,9 @@ public class STALRequestBrokerImpl implements STALRequestBroker { List reqs = requests; requests = null; if (reqs.size() > 0 && reqs.get(0) instanceof QuitRequest) { - isHandlingRequest = false; - log.trace("consumed QUIT, notifying request producers"); - notify(); +// isHandlingRequest = false; +// log.trace("consumed QUIT, notifying request producers"); +// notify(); log.trace("expecting no response in next nextRequest()"); expectingResponse = false; } -- cgit v1.2.3