summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGES4
-rw-r--r--java/src/Ice/AsyncCallback.java30
-rw-r--r--java/src/Ice/Callback.java30
-rw-r--r--java/src/IceInternal/CommunicatorBatchOutgoingAsync.java2
-rw-r--r--java/test/Ice/ami/AllTests.java60
-rw-r--r--java/test/Ice/binding/AllTests.java2
-rw-r--r--java/test/Ice/faultTolerance/AllTests.java2
-rw-r--r--java/test/Ice/invoke/AllTests.java4
-rw-r--r--java/test/Ice/timeout/AllTests.java4
9 files changed, 73 insertions, 65 deletions
diff --git a/CHANGES b/CHANGES
index 9fe710587e2..8f2edff786d 100644
--- a/CHANGES
+++ b/CHANGES
@@ -62,6 +62,10 @@ Java Changes
thread to go away (causing the thread pool to not dispatch further
incoming messages).
+- Deprecated Ice.AsyncCallback. To use the generic asynchronous
+ callback facility, applications should derive their classes from
+ Ice.Callback.
+
C# Changes
==========
diff --git a/java/src/Ice/AsyncCallback.java b/java/src/Ice/AsyncCallback.java
index f8a5811cb20..89fd3735bb0 100644
--- a/java/src/Ice/AsyncCallback.java
+++ b/java/src/Ice/AsyncCallback.java
@@ -13,35 +13,9 @@ package Ice;
* An application can optionally supply an instance of this class in an
* asynchronous invocation. The application must create a subclass and
* implement the completed method.
+ *
+ * @deprecated This class is deprecated, use Ice.Callback instead.
**/
public abstract class AsyncCallback extends Callback
{
- /**
- * Invoked when the invocation completes. The subclass should
- * call the matching <code>end_OP</code> method on the proxy and
- * must be prepared to handle exceptions.
- *
- * @param r The asynchronous result object returned by the <code>begin_OP</code> method.
- **/
- public abstract void completed(AsyncResult r);
-
- /**
- * Invoked when the Ice run time has passed the outgoing message
- * buffer to the transport.
- *
- * @param r The asynchronous result object returned by the <code>begin_OP</code> method.
- **/
- public void sent(AsyncResult r)
- {
- }
-
- public final void __completed(AsyncResult r)
- {
- completed(r);
- }
-
- public final void __sent(AsyncResult r)
- {
- sent(r);
- }
}
diff --git a/java/src/Ice/Callback.java b/java/src/Ice/Callback.java
index 24c3004767a..debd4f55f96 100644
--- a/java/src/Ice/Callback.java
+++ b/java/src/Ice/Callback.java
@@ -16,4 +16,34 @@ package Ice;
**/
public abstract class Callback extends IceInternal.CallbackBase
{
+ /**
+ * Invoked when the invocation completes. The subclass should
+ * call the matching <code>end_OP</code> method on the proxy and
+ * must be prepared to handle exceptions.
+ *
+ * @param r The asynchronous result object returned by the <code>begin_OP</code> method.
+ **/
+ public abstract void completed(AsyncResult r);
+
+ /**
+ * Invoked when the Ice run time has passed the outgoing message
+ * buffer to the transport. The default implementation does nothing,
+ * a subclass can override it if it needs to take action when the
+ * message is successfully sent.
+ *
+ * @param r The asynchronous result object returned by the <code>begin_OP</code> method.
+ **/
+ public void sent(AsyncResult r)
+ {
+ }
+
+ public final void __completed(AsyncResult r)
+ {
+ completed(r);
+ }
+
+ public final void __sent(AsyncResult r)
+ {
+ sent(r);
+ }
}
diff --git a/java/src/IceInternal/CommunicatorBatchOutgoingAsync.java b/java/src/IceInternal/CommunicatorBatchOutgoingAsync.java
index 2ded9a70832..ec5b12f8a63 100644
--- a/java/src/IceInternal/CommunicatorBatchOutgoingAsync.java
+++ b/java/src/IceInternal/CommunicatorBatchOutgoingAsync.java
@@ -117,7 +117,7 @@ public class CommunicatorBatchOutgoingAsync extends BatchOutgoingAsync
private Ice.Communicator _communicator;
private int _useCount;
- private Ice.AsyncCallback _cb = new Ice.AsyncCallback()
+ private Ice.Callback _cb = new Ice.Callback()
{
@Override
public void completed(Ice.AsyncResult r)
diff --git a/java/test/Ice/ami/AllTests.java b/java/test/Ice/ami/AllTests.java
index e759d625743..a34331cbc25 100644
--- a/java/test/Ice/ami/AllTests.java
+++ b/java/test/Ice/ami/AllTests.java
@@ -625,7 +625,7 @@ public class AllTests
final AsyncCallback cb = new AsyncCallback();
java.util.Map<String, String> ctx = new java.util.HashMap<String, String>();
- p.begin_ice_isA("::Test::TestIntf", new Ice.AsyncCallback()
+ p.begin_ice_isA("::Test::TestIntf", new Ice.Callback()
{
public void
completed(Ice.AsyncResult r)
@@ -635,7 +635,7 @@ public class AllTests
});
cb.check();
- p.begin_ice_isA("::Test::TestIntf", ctx, new Ice.AsyncCallback()
+ p.begin_ice_isA("::Test::TestIntf", ctx, new Ice.Callback()
{
public void
completed(Ice.AsyncResult r)
@@ -645,7 +645,7 @@ public class AllTests
});
cb.check();
- p.begin_ice_ping(new Ice.AsyncCallback()
+ p.begin_ice_ping(new Ice.Callback()
{
public void
completed(Ice.AsyncResult r)
@@ -654,7 +654,7 @@ public class AllTests
}
});
cb.check();
- p.begin_ice_ping(ctx, new Ice.AsyncCallback()
+ p.begin_ice_ping(ctx, new Ice.Callback()
{
public void
completed(Ice.AsyncResult r)
@@ -664,7 +664,7 @@ public class AllTests
});
cb.check();
- p.begin_ice_id(new Ice.AsyncCallback()
+ p.begin_ice_id(new Ice.Callback()
{
public void
completed(Ice.AsyncResult r)
@@ -673,7 +673,7 @@ public class AllTests
}
});
cb.check();
- p.begin_ice_id(ctx, new Ice.AsyncCallback()
+ p.begin_ice_id(ctx, new Ice.Callback()
{
public void
completed(Ice.AsyncResult r)
@@ -683,7 +683,7 @@ public class AllTests
});
cb.check();
- p.begin_ice_ids(new Ice.AsyncCallback()
+ p.begin_ice_ids(new Ice.Callback()
{
public void
completed(Ice.AsyncResult r)
@@ -692,7 +692,7 @@ public class AllTests
}
});
cb.check();
- p.begin_ice_ids(ctx, new Ice.AsyncCallback()
+ p.begin_ice_ids(ctx, new Ice.Callback()
{
public void
completed(Ice.AsyncResult r)
@@ -702,7 +702,7 @@ public class AllTests
});
cb.check();
- p.begin_op(new Ice.AsyncCallback()
+ p.begin_op(new Ice.Callback()
{
public void
completed(Ice.AsyncResult r)
@@ -711,7 +711,7 @@ public class AllTests
}
});
cb.check();
- p.begin_op(ctx, new Ice.AsyncCallback()
+ p.begin_op(ctx, new Ice.Callback()
{
public void
completed(Ice.AsyncResult r)
@@ -721,7 +721,7 @@ public class AllTests
});
cb.check();
- p.begin_opWithResult(new Ice.AsyncCallback()
+ p.begin_opWithResult(new Ice.Callback()
{
public void
completed(Ice.AsyncResult r)
@@ -730,7 +730,7 @@ public class AllTests
}
});
cb.check();
- p.begin_opWithResult(ctx, new Ice.AsyncCallback()
+ p.begin_opWithResult(ctx, new Ice.Callback()
{
public void
completed(Ice.AsyncResult r)
@@ -740,7 +740,7 @@ public class AllTests
});
cb.check();
- p.begin_opWithUE(new Ice.AsyncCallback()
+ p.begin_opWithUE(new Ice.Callback()
{
public void
completed(Ice.AsyncResult r)
@@ -749,7 +749,7 @@ public class AllTests
}
});
cb.check();
- p.begin_opWithUE(ctx, new Ice.AsyncCallback()
+ p.begin_opWithUE(ctx, new Ice.Callback()
{
public void
completed(Ice.AsyncResult r)
@@ -1052,7 +1052,7 @@ public class AllTests
TestIntfPrx i = TestIntfPrxHelper.uncheckedCast(p.ice_adapterId("dummy"));
final AsyncCallback cb = new AsyncCallback();
- i.begin_ice_isA("::Test::TestIntf", new Ice.AsyncCallback()
+ i.begin_ice_isA("::Test::TestIntf", new Ice.Callback()
{
public void
completed(Ice.AsyncResult r)
@@ -1062,7 +1062,7 @@ public class AllTests
});
cb.check();
- i.begin_ice_ping(new Ice.AsyncCallback()
+ i.begin_ice_ping(new Ice.Callback()
{
public void
completed(Ice.AsyncResult r)
@@ -1072,7 +1072,7 @@ public class AllTests
});
cb.check();
- i.begin_ice_id(new Ice.AsyncCallback()
+ i.begin_ice_id(new Ice.Callback()
{
public void
completed(Ice.AsyncResult r)
@@ -1082,7 +1082,7 @@ public class AllTests
});
cb.check();
- i.begin_ice_ids(new Ice.AsyncCallback()
+ i.begin_ice_ids(new Ice.Callback()
{
public void
completed(Ice.AsyncResult r)
@@ -1092,7 +1092,7 @@ public class AllTests
});
cb.check();
- i.begin_op(new Ice.AsyncCallback()
+ i.begin_op(new Ice.Callback()
{
public void
completed(Ice.AsyncResult r)
@@ -1307,7 +1307,7 @@ public class AllTests
});
cb.check();
- p.begin_op(new Ice.AsyncCallback()
+ p.begin_op(new Ice.Callback()
{
public void
completed(Ice.AsyncResult result)
@@ -1432,7 +1432,7 @@ public class AllTests
{
final Thrower cb = new Thrower(throwEx[i]);
- p.begin_op(new Ice.AsyncCallback()
+ p.begin_op(new Ice.Callback()
{
public void
completed(Ice.AsyncResult result)
@@ -1509,7 +1509,7 @@ public class AllTests
b1.opBatch();
final FlushCallback cb = new FlushCallback();
Ice.AsyncResult r = b1.begin_ice_flushBatchRequests(
- new Ice.AsyncCallback()
+ new Ice.Callback()
{
@Override
public void completed(Ice.AsyncResult result)
@@ -1539,7 +1539,7 @@ public class AllTests
b1.ice_getConnection().close(false);
final FlushExCallback cb = new FlushExCallback();
Ice.AsyncResult r = b1.begin_ice_flushBatchRequests(
- new Ice.AsyncCallback()
+ new Ice.Callback()
{
@Override
public void completed(Ice.AsyncResult result)
@@ -1634,7 +1634,7 @@ public class AllTests
b1.opBatch();
final FlushCallback cb = new FlushCallback();
Ice.AsyncResult r = b1.ice_getConnection().begin_flushBatchRequests(
- new Ice.AsyncCallback()
+ new Ice.Callback()
{
@Override
public void completed(Ice.AsyncResult result)
@@ -1664,7 +1664,7 @@ public class AllTests
b1.ice_getConnection().close(false);
final FlushExCallback cb = new FlushExCallback();
Ice.AsyncResult r = b1.ice_getConnection().begin_flushBatchRequests(
- new Ice.AsyncCallback()
+ new Ice.Callback()
{
@Override
public void completed(Ice.AsyncResult result)
@@ -1759,7 +1759,7 @@ public class AllTests
b1.opBatch();
final FlushCallback cb = new FlushCallback();
Ice.AsyncResult r = communicator.begin_flushBatchRequests(
- new Ice.AsyncCallback()
+ new Ice.Callback()
{
@Override
public void completed(Ice.AsyncResult result)
@@ -1789,7 +1789,7 @@ public class AllTests
b1.ice_getConnection().close(false);
final FlushCallback cb = new FlushCallback();
Ice.AsyncResult r = communicator.begin_flushBatchRequests(
- new Ice.AsyncCallback()
+ new Ice.Callback()
{
@Override
public void completed(Ice.AsyncResult result)
@@ -1823,7 +1823,7 @@ public class AllTests
b2.opBatch();
final FlushCallback cb = new FlushCallback();
Ice.AsyncResult r = communicator.begin_flushBatchRequests(
- new Ice.AsyncCallback()
+ new Ice.Callback()
{
@Override
public void completed(Ice.AsyncResult result)
@@ -1859,7 +1859,7 @@ public class AllTests
b1.ice_getConnection().close(false);
final FlushCallback cb = new FlushCallback();
Ice.AsyncResult r = communicator.begin_flushBatchRequests(
- new Ice.AsyncCallback()
+ new Ice.Callback()
{
@Override
public void completed(Ice.AsyncResult result)
@@ -1895,7 +1895,7 @@ public class AllTests
b2.ice_getConnection().close(false);
final FlushCallback cb = new FlushCallback();
Ice.AsyncResult r = communicator.begin_flushBatchRequests(
- new Ice.AsyncCallback()
+ new Ice.Callback()
{
@Override
public void completed(Ice.AsyncResult result)
diff --git a/java/test/Ice/binding/AllTests.java b/java/test/Ice/binding/AllTests.java
index 7039b5d4abc..adbf41466b7 100644
--- a/java/test/Ice/binding/AllTests.java
+++ b/java/test/Ice/binding/AllTests.java
@@ -29,7 +29,7 @@ public class AllTests
}
}
- static class GetAdapterNameCB extends Ice.AsyncCallback
+ static class GetAdapterNameCB extends Ice.Callback
{
synchronized public void
completed(Ice.AsyncResult result)
diff --git a/java/test/Ice/faultTolerance/AllTests.java b/java/test/Ice/faultTolerance/AllTests.java
index 48db7592ca0..b29bb6b3ee0 100644
--- a/java/test/Ice/faultTolerance/AllTests.java
+++ b/java/test/Ice/faultTolerance/AllTests.java
@@ -122,7 +122,7 @@ public class AllTests
private Callback callback = new Callback();
}
- private static class AbortCallback extends Ice.AsyncCallback
+ private static class AbortCallback extends Ice.Callback
{
public void
completed(Ice.AsyncResult result)
diff --git a/java/test/Ice/invoke/AllTests.java b/java/test/Ice/invoke/AllTests.java
index 426923ab8f1..7edfce02b45 100644
--- a/java/test/Ice/invoke/AllTests.java
+++ b/java/test/Ice/invoke/AllTests.java
@@ -60,7 +60,7 @@ public class AllTests
private boolean _called;
}
- private static class opStringI extends Ice.AsyncCallback
+ private static class opStringI extends Ice.Callback
{
public opStringI(Ice.Communicator communicator)
{
@@ -95,7 +95,7 @@ public class AllTests
private Callback callback = new Callback();
}
- private static class opExceptionI extends Ice.AsyncCallback
+ private static class opExceptionI extends Ice.Callback
{
public opExceptionI(Ice.Communicator communicator)
{
diff --git a/java/test/Ice/timeout/AllTests.java b/java/test/Ice/timeout/AllTests.java
index d7418f41e95..e6d687b9250 100644
--- a/java/test/Ice/timeout/AllTests.java
+++ b/java/test/Ice/timeout/AllTests.java
@@ -60,7 +60,7 @@ public class AllTests
private boolean _called;
}
- private static class CallbackSuccess extends Ice.AsyncCallback
+ private static class CallbackSuccess extends Ice.Callback
{
public void
completed(Ice.AsyncResult result)
@@ -93,7 +93,7 @@ public class AllTests
private Callback callback = new Callback();
}
- private static class CallbackFail extends Ice.AsyncCallback
+ private static class CallbackFail extends Ice.Callback
{
public void
completed(Ice.AsyncResult result)