diff options
author | Matthew Newhook <matthew@zeroc.com> | 2014-07-23 15:06:02 -0230 |
---|---|---|
committer | Matthew Newhook <matthew@zeroc.com> | 2014-07-23 15:06:02 -0230 |
commit | 866f9ff17391176b836f9bb49f6da40c2c938441 (patch) | |
tree | 7366963294ef3356c7b887cd89af753988c21beb /java/src/IceInternal/OutgoingAsync.java | |
parent | adding ACM tests for Python/Ruby/PHP (diff) | |
download | ice-866f9ff17391176b836f9bb49f6da40c2c938441.tar.bz2 ice-866f9ff17391176b836f9bb49f6da40c2c938441.tar.xz ice-866f9ff17391176b836f9bb49f6da40c2c938441.zip |
ICE-4234 - Update Ice to use current Java threading constructs
- Use ScheduledThreadPoolDispatcher not IceUtilInternal.Timer.
- Use Ice timer in glacier2, Freeze impl.
- Align C++, C# with java changes.
- Database demo now supports mariadb.
Diffstat (limited to 'java/src/IceInternal/OutgoingAsync.java')
-rw-r--r-- | java/src/IceInternal/OutgoingAsync.java | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/java/src/IceInternal/OutgoingAsync.java b/java/src/IceInternal/OutgoingAsync.java index e5e143a7e71..d939318fd9e 100644 --- a/java/src/IceInternal/OutgoingAsync.java +++ b/java/src/IceInternal/OutgoingAsync.java @@ -9,7 +9,7 @@ package IceInternal; -public class OutgoingAsync extends Ice.AsyncResult implements OutgoingAsyncMessageCallback, TimerTask +public class OutgoingAsync extends Ice.AsyncResult implements OutgoingAsyncMessageCallback, Runnable { public OutgoingAsync(Ice.ObjectPrx prx, String operation, CallbackBase cb) { @@ -134,7 +134,8 @@ public class OutgoingAsync extends Ice.AsyncResult implements OutgoingAsyncMessa } if(_timeoutRequestHandler != null) { - _instance.timer().cancel(this); + _future.cancel(false); + _future = null; _timeoutRequestHandler = null; } _state |= Done | OK; @@ -165,7 +166,8 @@ public class OutgoingAsync extends Ice.AsyncResult implements OutgoingAsyncMessa } if(_timeoutRequestHandler != null) { - _instance.timer().cancel(this); + _future.cancel(false); + _future = null; _timeoutRequestHandler = null; } } @@ -223,7 +225,8 @@ public class OutgoingAsync extends Ice.AsyncResult implements OutgoingAsyncMessa if(_timeoutRequestHandler != null) { - _instance.timer().cancel(this); + _future.cancel(false); + _future = null; _timeoutRequestHandler = null; } @@ -412,7 +415,8 @@ public class OutgoingAsync extends Ice.AsyncResult implements OutgoingAsyncMessa int invocationTimeout = _handler.getReference().getInvocationTimeout(); if(invocationTimeout > 0) { - _instance.timer().schedule(this, invocationTimeout); + _future = _instance.timer().schedule(this, invocationTimeout, + java.util.concurrent.TimeUnit.MILLISECONDS); _timeoutRequestHandler = _handler; } } @@ -474,7 +478,7 @@ public class OutgoingAsync extends Ice.AsyncResult implements OutgoingAsyncMessa } public void - runTimerTask() + run() { __runTimerTask(); } |