summaryrefslogtreecommitdiff
path: root/java/src
diff options
context:
space:
mode:
authorBenoit Foucher <benoit@zeroc.com>2006-03-09 14:40:19 +0000
committerBenoit Foucher <benoit@zeroc.com>2006-03-09 14:40:19 +0000
commitf503d08955e30f2221ddc912bbce3c6a6badde5c (patch)
treea9273839e6eddada3270d5f4cabb06a3a52e7ef3 /java/src
parentFixed dropdown in mfc client for VC8 (diff)
downloadice-f503d08955e30f2221ddc912bbce3c6a6badde5c.tar.bz2
ice-f503d08955e30f2221ddc912bbce3c6a6badde5c.tar.xz
ice-f503d08955e30f2221ddc912bbce3c6a6badde5c.zip
Moved endpointSelection/cacheConnection to RoutableReference.
Diffstat (limited to 'java/src')
-rw-r--r--java/src/IceInternal/FixedReference.java24
-rw-r--r--java/src/IceInternal/Reference.java54
-rw-r--r--java/src/IceInternal/RoutableReference.java48
3 files changed, 76 insertions, 50 deletions
diff --git a/java/src/IceInternal/FixedReference.java b/java/src/IceInternal/FixedReference.java
index 026aae68d68..445fd725ca3 100644
--- a/java/src/IceInternal/FixedReference.java
+++ b/java/src/IceInternal/FixedReference.java
@@ -60,6 +60,18 @@ public class FixedReference extends Reference
return 0;
}
+ public final boolean
+ getCacheConnection()
+ {
+ return false;
+ }
+
+ public final Ice.EndpointSelectionType
+ getEndpointSelection()
+ {
+ return Ice.EndpointSelectionType.Random;
+ }
+
public Reference
changeSecure(boolean sec)
{
@@ -102,6 +114,18 @@ public class FixedReference extends Reference
return this;
}
+ public final Reference
+ changeCacheConnection(boolean newCache)
+ {
+ return this;
+ }
+
+ public final Reference
+ changeEndpointSelection(Ice.EndpointSelectionType newType)
+ {
+ return this;
+ }
+
public Reference
changeCompress(boolean newCompress)
{
diff --git a/java/src/IceInternal/Reference.java b/java/src/IceInternal/Reference.java
index 46d24798b4c..a300c92f60d 100644
--- a/java/src/IceInternal/Reference.java
+++ b/java/src/IceInternal/Reference.java
@@ -48,18 +48,6 @@ public abstract class Reference implements Cloneable
return _context;
}
- public final boolean
- getCacheConnection()
- {
- return _cacheConnection;
- }
-
- public final Ice.EndpointSelectionType
- getEndpointSelection()
- {
- return _endpointSelection;
- }
-
public final Reference
defaultContext()
{
@@ -79,6 +67,8 @@ public abstract class Reference implements Cloneable
public abstract EndpointI[] getEndpoints();
public abstract boolean getCollocationOptimization();
public abstract int getLocatorCacheTimeout();
+ public abstract boolean getCacheConnection();
+ public abstract Ice.EndpointSelectionType getEndpointSelection();
//
// The change* methods (here and in derived classes) create
@@ -140,30 +130,6 @@ public abstract class Reference implements Cloneable
return r;
}
- public final Reference
- changeCacheConnection(boolean newCache)
- {
- if(newCache == _cacheConnection)
- {
- return this;
- }
- Reference r = _instance.referenceFactory().copy(this);
- r._cacheConnection = newCache;
- return r;
- }
-
- public final Reference
- changeEndpointSelection(Ice.EndpointSelectionType newType)
- {
- if(newType == _endpointSelection)
- {
- return this;
- }
- Reference r = _instance.referenceFactory().copy(this);
- r._endpointSelection = newType;
- return r;
- }
-
public abstract Reference changeSecure(boolean newSecure);
public abstract Reference changeRouter(Ice.RouterPrx newRouter);
public abstract Reference changeLocator(Ice.LocatorPrx newLocator);
@@ -174,6 +140,8 @@ public abstract class Reference implements Cloneable
public abstract Reference changeAdapterId(String newAdapterId);
public abstract Reference changeEndpoints(EndpointI[] newEndpoints);
public abstract Reference changeLocatorCacheTimeout(int newTimeout);
+ public abstract Reference changeCacheConnection(boolean newCache);
+ public abstract Reference changeEndpointSelection(Ice.EndpointSelectionType newType);
public synchronized int
hashCode()
@@ -364,16 +332,6 @@ public abstract class Reference implements Cloneable
return false;
}
- if(_cacheConnection != r._cacheConnection)
- {
- return false;
- }
-
- if(_endpointSelection != r._endpointSelection)
- {
- return false;
- }
-
return true;
}
@@ -401,8 +359,6 @@ public abstract class Reference implements Cloneable
private java.util.Map _context;
private static java.util.HashMap _emptyContext = new java.util.HashMap();
private String _facet;
- private boolean _cacheConnection;
- private Ice.EndpointSelectionType _endpointSelection;
protected int _hashValue;
protected boolean _hashInitialized;
@@ -428,8 +384,6 @@ public abstract class Reference implements Cloneable
_identity = ident;
_context = ctx == null ? _emptyContext : ctx;
_facet = fac;
- _cacheConnection = true;
- _endpointSelection = Ice.EndpointSelectionType.Random;
_hashInitialized = false;
}
}
diff --git a/java/src/IceInternal/RoutableReference.java b/java/src/IceInternal/RoutableReference.java
index 2756b43d86c..e17e6b873d7 100644
--- a/java/src/IceInternal/RoutableReference.java
+++ b/java/src/IceInternal/RoutableReference.java
@@ -44,6 +44,18 @@ public abstract class RoutableReference extends Reference
return _collocationOptimization;
}
+ public final boolean
+ getCacheConnection()
+ {
+ return _cacheConnection;
+ }
+
+ public final Ice.EndpointSelectionType
+ getEndpointSelection()
+ {
+ return _endpointSelection;
+ }
+
public Reference
changeSecure(boolean newSecure)
{
@@ -81,6 +93,30 @@ public abstract class RoutableReference extends Reference
return r;
}
+ public final Reference
+ changeCacheConnection(boolean newCache)
+ {
+ if(newCache == _cacheConnection)
+ {
+ return this;
+ }
+ RoutableReference r = (RoutableReference)getInstance().referenceFactory().copy(this);
+ r._cacheConnection = newCache;
+ return r;
+ }
+
+ public final Reference
+ changeEndpointSelection(Ice.EndpointSelectionType newType)
+ {
+ if(newType == _endpointSelection)
+ {
+ return this;
+ }
+ RoutableReference r = (RoutableReference)getInstance().referenceFactory().copy(this);
+ r._endpointSelection = newType;
+ return r;
+ }
+
public synchronized int
hashCode()
{
@@ -107,6 +143,14 @@ public abstract class RoutableReference extends Reference
{
return false;
}
+ if(_cacheConnection != rhs._cacheConnection)
+ {
+ return false;
+ }
+ if(_endpointSelection != rhs._endpointSelection)
+ {
+ return false;
+ }
return _routerInfo == null ? rhs._routerInfo == null : _routerInfo.equals(rhs._routerInfo);
}
@@ -125,6 +169,8 @@ public abstract class RoutableReference extends Reference
_secure = sec;
_routerInfo = rtrInfo;
_collocationOptimization = collocationOpt;
+ _cacheConnection = true;
+ _endpointSelection = Ice.EndpointSelectionType.Random;
}
protected Ice.ConnectionI
@@ -305,4 +351,6 @@ public abstract class RoutableReference extends Reference
private boolean _secure;
private RouterInfo _routerInfo; // Null if no router is used.
private boolean _collocationOptimization;
+ private boolean _cacheConnection;
+ private Ice.EndpointSelectionType _endpointSelection;
}