summaryrefslogtreecommitdiff
path: root/java/src/IceInternal/ProxyGetConnection.java
diff options
context:
space:
mode:
Diffstat (limited to 'java/src/IceInternal/ProxyGetConnection.java')
-rw-r--r--java/src/IceInternal/ProxyGetConnection.java59
1 files changed, 59 insertions, 0 deletions
diff --git a/java/src/IceInternal/ProxyGetConnection.java b/java/src/IceInternal/ProxyGetConnection.java
new file mode 100644
index 00000000000..9f5388218db
--- /dev/null
+++ b/java/src/IceInternal/ProxyGetConnection.java
@@ -0,0 +1,59 @@
+// **********************************************************************
+//
+// Copyright (c) 2003-2014 ZeroC, Inc. All rights reserved.
+//
+// This copy of Ice is licensed to you under the terms described in the
+// ICE_LICENSE file included in this distribution.
+//
+// **********************************************************************
+
+package IceInternal;
+
+public class ProxyGetConnection extends ProxyOutgoingAsyncBase
+{
+ public static ProxyGetConnection check(Ice.AsyncResult r, Ice.ObjectPrx prx, String operation)
+ {
+ ProxyOutgoingAsyncBase.checkImpl(r, prx, operation);
+ try
+ {
+ return (ProxyGetConnection)r;
+ }
+ catch(ClassCastException ex)
+ {
+ throw new IllegalArgumentException("Incorrect AsyncResult object for end_" + operation + " method");
+ }
+ }
+
+ public ProxyGetConnection(Ice.ObjectPrxHelperBase prx, String operation, CallbackBase cb)
+ {
+ super(prx, operation, cb);
+ _observer = ObserverHelper.get(prx, operation);
+ }
+
+ @Override
+ public int send(Ice.ConnectionI connection, boolean compress, boolean response)
+ throws RetryException
+ {
+ _cachedConnection = connection;
+ if(finished(true))
+ {
+ invokeCompletedAsync();
+ }
+ return AsyncStatus.Sent;
+ }
+
+ @Override
+ public int invokeCollocated(CollocatedRequestHandler handler)
+ {
+ if(finished(true))
+ {
+ invokeCompletedAsync();
+ }
+ return AsyncStatus.Sent;
+ }
+
+ public void invoke()
+ {
+ invokeImpl(true); // userThread = true
+ }
+}