You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@uima.apache.org by sc...@apache.org on 2007/02/08 23:16:17 UTC
svn commit: r505055 -
/incubator/uima/uimaj/trunk/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/container/deployer/VinciTAP.java
Author: schor
Date: Thu Feb 8 14:16:17 2007
New Revision: 505055
URL: http://svn.apache.org/viewvc?view=rev&rev=505055
Log:
UIMA-284 simplification/cleanup: removed monitors, replaced waits on them with
Thread.sleep(timeout)
Modified:
incubator/uima/uimaj/trunk/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/container/deployer/VinciTAP.java
Modified: incubator/uima/uimaj/trunk/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/container/deployer/VinciTAP.java
URL: http://svn.apache.org/viewvc/incubator/uima/uimaj/trunk/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/container/deployer/VinciTAP.java?view=diff&rev=505055&r1=505054&r2=505055
==============================================================================
--- incubator/uima/uimaj/trunk/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/container/deployer/VinciTAP.java (original)
+++ incubator/uima/uimaj/trunk/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/container/deployer/VinciTAP.java Thu Feb 8 14:16:17 2007
@@ -110,8 +110,6 @@
org.apache.uima.collection.impl.cpm.Constants.CONTENT_TAG,
org.apache.uima.collection.impl.cpm.Constants.CONTENT_TAG_VALUE, contentTag, true);
- private final Object monitor = new Object();
-
public VinciTAP() {
}
@@ -202,9 +200,7 @@
new Object[] { Thread.currentThread().getName() });
}
try {
- synchronized (monitor) {
- monitor.wait(100);
- }
+ Thread.sleep(100);
} catch (InterruptedException ex) {
}
@@ -257,9 +253,7 @@
String.valueOf(aPort) });
}
try {
- synchronized (monitor) {
- monitor.wait(100);
- }
+ Thread.sleep(100);
} catch (Exception ex) {
}
} else {
@@ -1328,14 +1322,13 @@
*/
private void waitForServiceShutdown() {
int retry = 10; // Hard-coded limit.
- Object monitor = new Object();
// Try until the endpoint is closed by the service OR hard limit of tries
// has beed exceeded.
do {
try {
// establish ownership of query object, otherwise IllegalMonitorStateException is
// thrown. Than give the service time to cleanly exit.
- synchronized (monitor) {
+
if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
UIMAFramework.getLogger(this.getClass()).logrb(
Level.FINEST,
@@ -1346,12 +1339,12 @@
new Object[] { Thread.currentThread().getName(), String.valueOf(10 - retry),
String.valueOf(10) });
}
- monitor.wait(100); // wait for 50ms to give the service time to exit cleanly
+ Thread.sleep(100); // wait for 100ms to give the service time to exit cleanly
if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
UIMAFramework.getLogger(this.getClass()).log(Level.FINEST,
" Resuming CPE shutdown.Service should be down now.");
}
- }
+
} catch (InterruptedException e) {
}
if (retry-- <= 0) {