diff options
author | Benoit Foucher <benoit@zeroc.com> | 2007-11-27 11:58:35 +0100 |
---|---|---|
committer | Benoit Foucher <benoit@zeroc.com> | 2007-11-27 11:58:35 +0100 |
commit | 47f800495093fd7679a315e2d730fea22f6135b7 (patch) | |
tree | a7b8d3488f3841367dd03d10cae293f36fd10481 /java/src/IceInternal/DirectReference.java | |
parent | Fixed SystemException to no longer derive from LocalException (diff) | |
download | ice-47f800495093fd7679a315e2d730fea22f6135b7.tar.bz2 ice-47f800495093fd7679a315e2d730fea22f6135b7.tar.xz ice-47f800495093fd7679a315e2d730fea22f6135b7.zip |
- Added support for non-blocking AMI/batch requests, connection
creation.
- Added support for AMI oneway requests.
- Changed collocation optimization to not perform any DNS lookups.
Diffstat (limited to 'java/src/IceInternal/DirectReference.java')
-rw-r--r-- | java/src/IceInternal/DirectReference.java | 59 |
1 files changed, 44 insertions, 15 deletions
diff --git a/java/src/IceInternal/DirectReference.java b/java/src/IceInternal/DirectReference.java index 56224453de5..2a60fda7e7a 100644 --- a/java/src/IceInternal/DirectReference.java +++ b/java/src/IceInternal/DirectReference.java @@ -116,7 +116,7 @@ public class DirectReference extends RoutableReference return getInstance().referenceFactory().create(getIdentity(), getContext(), getFacet(), getMode(), getSecure(), getPreferSecure(), newAdapterId, getRouterInfo(), locatorInfo, getCollocationOptimization(), getCacheConnection(), - getEndpointSelection(), getThreadPerConnection(), + getEndpointSelection(), getThreadPerConnection(), getLocatorCacheTimeout()); } @@ -188,28 +188,57 @@ public class DirectReference extends RoutableReference public Ice.ConnectionI getConnection(Ice.BooleanHolder comp) { - EndpointI[] endpts = super.getRoutedEndpoints(); - applyOverrides(endpts); - - if(endpts.length == 0) + if(getRouterInfo() != null) { - endpts = _endpoints; // Endpoint overrides are already applied on these endpoints. + // + // If we route, we send everything to the router's client + // proxy endpoints. + // + EndpointI[] endpts = getRouterInfo().getClientEndpoints(); + if(endpts.length > 0) + { + applyOverrides(endpts); + return createConnection(endpts, comp); + } } - Ice.ConnectionI connection = createConnection(endpts, comp); + return createConnection(_endpoints, comp); + } - // - // If we have a router, set the object adapter for this router - // (if any) to the new connection, so that callbacks from the - // router can be received over this new connection. - // + public void + getConnection(final GetConnectionCallback callback) + { if(getRouterInfo() != null) { - connection.setAdapter(getRouterInfo().getAdapter()); + // + // If we route, we send everything to the router's client + // proxy endpoints. + // + getRouterInfo().getClientEndpoints(new RouterInfo.GetClientEndpointsCallback() + { + public void + setEndpoints(EndpointI[] endpts) + { + if(endpts.length > 0) + { + applyOverrides(endpts); + createConnection(endpts, callback); + return; + } + + createConnection(_endpoints, callback); + } + + public void + setException(Ice.LocalException ex) + { + callback.setException(ex); + } + }); + return; } - assert(connection != null); - return connection; + createConnection(_endpoints, callback); } public boolean |