diff options
author | Mark Spruiell <mes@zeroc.com> | 2007-01-26 16:58:00 +0000 |
---|---|---|
committer | Mark Spruiell <mes@zeroc.com> | 2007-01-26 16:58:00 +0000 |
commit | 71f7fff702750e9b779f645d21075562e5c80a40 (patch) | |
tree | 0f059491911ecc5ea3f6c680b0ae05d0f67e7bfd /java/src | |
parent | Synced with other assemby files (diff) | |
download | ice-71f7fff702750e9b779f645d21075562e5c80a40.tar.bz2 ice-71f7fff702750e9b779f645d21075562e5c80a40.tar.xz ice-71f7fff702750e9b779f645d21075562e5c80a40.zip |
preserve proxy settings for CacheConnection, EndpointSelection,
ThreadPerConnection
Diffstat (limited to 'java/src')
-rw-r--r-- | java/src/Ice/ObjectAdapterI.java | 8 | ||||
-rw-r--r-- | java/src/IceInternal/DirectReference.java | 13 | ||||
-rw-r--r-- | java/src/IceInternal/IndirectReference.java | 9 | ||||
-rw-r--r-- | java/src/IceInternal/ReferenceFactory.java | 35 | ||||
-rw-r--r-- | java/src/IceInternal/RoutableReference.java | 11 |
5 files changed, 56 insertions, 20 deletions
diff --git a/java/src/Ice/ObjectAdapterI.java b/java/src/Ice/ObjectAdapterI.java index 92ff5e0e308..dc96485796e 100644 --- a/java/src/Ice/ObjectAdapterI.java +++ b/java/src/Ice/ObjectAdapterI.java @@ -1060,7 +1060,9 @@ public final class ObjectAdapterI extends LocalObjectImpl implements ObjectAdapt _instance.referenceFactory().create(ident, new java.util.HashMap(), facet, IceInternal.Reference.ModeTwoway, false, _instance.defaultsAndOverrides().defaultPreferSecure, endpoints, null, - _instance.defaultsAndOverrides().defaultCollocationOptimization); + _instance.defaultsAndOverrides().defaultCollocationOptimization, true, + _instance.defaultsAndOverrides().defaultEndpointSelection, + _instance.threadPerConnection()); return _instance.proxyFactory().referenceToProxy(reference); } @@ -1078,7 +1080,9 @@ public final class ObjectAdapterI extends LocalObjectImpl implements ObjectAdapt IceInternal.Reference.ModeTwoway, false, _instance.defaultsAndOverrides().defaultPreferSecure, id, null, _locatorInfo, - _instance.defaultsAndOverrides().defaultCollocationOptimization, + _instance.defaultsAndOverrides().defaultCollocationOptimization, true, + _instance.defaultsAndOverrides().defaultEndpointSelection, + _instance.threadPerConnection(), _instance.defaultsAndOverrides().defaultLocatorCacheTimeout); return _instance.proxyFactory().referenceToProxy(reference); } diff --git a/java/src/IceInternal/DirectReference.java b/java/src/IceInternal/DirectReference.java index 614990baf82..ba7a73058b9 100644 --- a/java/src/IceInternal/DirectReference.java +++ b/java/src/IceInternal/DirectReference.java @@ -22,9 +22,13 @@ public class DirectReference extends RoutableReference boolean prefSec, EndpointI[] endpts, RouterInfo rtrInfo, - boolean collocationOpt) + boolean collocationOpt, + boolean cacheConnection, + Ice.EndpointSelectionType endpointSelection, + boolean threadPerConnection) { - super(inst, com, ident, ctx, fs, md, sec, prefSec, rtrInfo, collocationOpt); + super(inst, com, ident, ctx, fs, md, sec, prefSec, rtrInfo, collocationOpt, cacheConnection, endpointSelection, + threadPerConnection); _endpoints = endpts; } @@ -111,8 +115,9 @@ public class DirectReference extends RoutableReference getInstance().locatorManager().get(getInstance().referenceFactory().getDefaultLocator()); return getInstance().referenceFactory().create(getIdentity(), getContext(), getFacet(), getMode(), getSecure(), getPreferSecure(), newAdapterId, getRouterInfo(), - locatorInfo, getCollocationOptimization(), - getLocatorCacheTimeout()); + locatorInfo, getCollocationOptimization(), getCacheConnection(), + getEndpointSelection(), getThreadPerConnection(), + getLocatorCacheTimeout()); } public Reference diff --git a/java/src/IceInternal/IndirectReference.java b/java/src/IceInternal/IndirectReference.java index ce6076a564b..0d118427797 100644 --- a/java/src/IceInternal/IndirectReference.java +++ b/java/src/IceInternal/IndirectReference.java @@ -24,9 +24,13 @@ public class IndirectReference extends RoutableReference RouterInfo rtrInfo, LocatorInfo locInfo, boolean collocationOpt, + boolean cacheConnection, + Ice.EndpointSelectionType endpointSelection, + boolean threadPerConnection, int locatorCacheTimeout) { - super(inst, com, ident, ctx, fs, md, sec, prefSec, rtrInfo, collocationOpt); + super(inst, com, ident, ctx, fs, md, sec, prefSec, rtrInfo, collocationOpt, cacheConnection, endpointSelection, + threadPerConnection); _adapterId = adptid; _locatorInfo = locInfo; _locatorCacheTimeout = locatorCacheTimeout; @@ -90,7 +94,8 @@ public class IndirectReference extends RoutableReference } return getInstance().referenceFactory().create(getIdentity(), getContext(), getFacet(), getMode(), getSecure(), getPreferSecure(), newEndpoints, getRouterInfo(), - getCollocationOptimization()); + getCollocationOptimization(), getCacheConnection(), + getEndpointSelection(), getThreadPerConnection()); } public Reference diff --git a/java/src/IceInternal/ReferenceFactory.java b/java/src/IceInternal/ReferenceFactory.java index 1679d60c8d6..56125ba4335 100644 --- a/java/src/IceInternal/ReferenceFactory.java +++ b/java/src/IceInternal/ReferenceFactory.java @@ -20,7 +20,10 @@ public final class ReferenceFactory boolean preferSecure, EndpointI[] endpoints, RouterInfo routerInfo, - boolean collocationOptimization) + boolean collocationOptimization, + boolean cacheConnection, + Ice.EndpointSelectionType endpointSelection, + boolean threadPerConnection) { if(_instance == null) { @@ -36,7 +39,8 @@ public final class ReferenceFactory // Create new reference // DirectReference ref = new DirectReference(_instance, _communicator, ident, context, facet, mode, secure, - preferSecure, endpoints, routerInfo, collocationOptimization); + preferSecure, endpoints, routerInfo, collocationOptimization, + cacheConnection, endpointSelection, threadPerConnection); return updateCache(ref); } @@ -51,6 +55,9 @@ public final class ReferenceFactory RouterInfo routerInfo, LocatorInfo locatorInfo, boolean collocationOptimization, + boolean cacheConnection, + Ice.EndpointSelectionType endpointSelection, + boolean threadPerConnection, int locatorCacheTimeout) { if(_instance == null) @@ -68,7 +75,8 @@ public final class ReferenceFactory // IndirectReference ref = new IndirectReference(_instance, _communicator, ident, context, facet, mode, secure, preferSecure, adapterId, routerInfo, locatorInfo, - collocationOptimization, locatorCacheTimeout); + collocationOptimization, cacheConnection, endpointSelection, + threadPerConnection, locatorCacheTimeout); return updateCache(ref); } @@ -394,7 +402,8 @@ public final class ReferenceFactory { return create(ident, _instance.getDefaultContext(), facet, mode, secure, _instance.defaultsAndOverrides().defaultPreferSecure, "", routerInfo, - locatorInfo, _instance.defaultsAndOverrides().defaultCollocationOptimization, + locatorInfo, _instance.defaultsAndOverrides().defaultCollocationOptimization, true, + _instance.defaultsAndOverrides().defaultEndpointSelection, _instance.threadPerConnection(), _instance.defaultsAndOverrides().defaultLocatorCacheTimeout); } @@ -449,7 +458,8 @@ public final class ReferenceFactory endpoints.toArray(endp); return create(ident, _instance.getDefaultContext(), facet, mode, secure, _instance.defaultsAndOverrides().defaultPreferSecure, endp, routerInfo, - _instance.defaultsAndOverrides().defaultCollocationOptimization); + _instance.defaultsAndOverrides().defaultCollocationOptimization, true, + _instance.defaultsAndOverrides().defaultEndpointSelection, _instance.threadPerConnection()); } else if(s.charAt(beg) == '@') { @@ -492,7 +502,8 @@ public final class ReferenceFactory return create(ident, _instance.getDefaultContext(), facet, mode, secure, _instance.defaultsAndOverrides().defaultPreferSecure, adapter, routerInfo, locatorInfo, _instance.defaultsAndOverrides().defaultCollocationOptimization, - _instance.defaultsAndOverrides().defaultLocatorCacheTimeout); + true, _instance.defaultsAndOverrides().defaultEndpointSelection, + _instance.threadPerConnection(), _instance.defaultsAndOverrides().defaultLocatorCacheTimeout); } Ice.ProxyParseException ex = new Ice.ProxyParseException(); @@ -567,6 +578,12 @@ public final class ReferenceFactory ref = ref.changeCollocationOptimization(properties.getPropertyAsInt(property) > 0); } + property = propertyPrefix + ".ThreadPerConnection"; + if(properties.getProperty(property).length() != 0) + { + ref = ref.changeThreadPerConnection(properties.getPropertyAsInt(property) > 0); + } + return ref; } @@ -625,7 +642,8 @@ public final class ReferenceFactory } return create(ident, _instance.getDefaultContext(), facet, mode, secure, _instance.defaultsAndOverrides().defaultPreferSecure, endpoints, - routerInfo, _instance.defaultsAndOverrides().defaultCollocationOptimization); + routerInfo, _instance.defaultsAndOverrides().defaultCollocationOptimization, true, + _instance.defaultsAndOverrides().defaultEndpointSelection, _instance.threadPerConnection()); } else { @@ -633,7 +651,8 @@ public final class ReferenceFactory adapterId = s.readString(); return create(ident, _instance.getDefaultContext(), facet, mode, secure, _instance.defaultsAndOverrides().defaultPreferSecure, adapterId, routerInfo, locatorInfo, - _instance.defaultsAndOverrides().defaultCollocationOptimization, + _instance.defaultsAndOverrides().defaultCollocationOptimization, true, + _instance.defaultsAndOverrides().defaultEndpointSelection, _instance.threadPerConnection(), _instance.defaultsAndOverrides().defaultLocatorCacheTimeout); } } diff --git a/java/src/IceInternal/RoutableReference.java b/java/src/IceInternal/RoutableReference.java index fe7f8bd208a..3bb2620d487 100644 --- a/java/src/IceInternal/RoutableReference.java +++ b/java/src/IceInternal/RoutableReference.java @@ -265,20 +265,23 @@ public abstract class RoutableReference extends Reference boolean sec, boolean prefSec, RouterInfo rtrInfo, - boolean collocationOpt) + boolean collocationOpt, + boolean cacheConnection, + Ice.EndpointSelectionType endpointSelection, + boolean threadPerConnection) { super(inst, com, ident, ctx, fac, md); _secure = sec; _preferSecure = prefSec; _routerInfo = rtrInfo; _collocationOptimization = collocationOpt; - _cacheConnection = true; - _endpointSelection = Ice.EndpointSelectionType.Random; + _cacheConnection = cacheConnection; + _endpointSelection = endpointSelection; _overrideCompress = false; _compress = false; _overrideTimeout = false; _timeout = -1; - _threadPerConnection = inst.threadPerConnection(); + _threadPerConnection = threadPerConnection; } protected void |