summaryrefslogtreecommitdiff
path: root/java/src
diff options
context:
space:
mode:
authorBenoit Foucher <benoit@zeroc.com>2012-11-13 10:17:27 +0100
committerBenoit Foucher <benoit@zeroc.com>2012-11-13 10:17:27 +0100
commit99b44d083eeee5583adfe642081a827224fa1309 (patch)
tree46bb3af634cbd5d90b9e5d46099f4e0e85f70ec6 /java/src
parentCosmetic updates to IceGrid Admin connection wizard (diff)
downloadice-99b44d083eeee5583adfe642081a827224fa1309.tar.bz2
ice-99b44d083eeee5583adfe642081a827224fa1309.tar.xz
ice-99b44d083eeee5583adfe642081a827224fa1309.zip
Fixed ICE-4927: fixed proxy encoding to marshal protocol/encoding version instead of encoding it in endpoints
Diffstat (limited to 'java/src')
-rw-r--r--java/src/Ice/ObjectPrxHelperBase.java3
-rw-r--r--java/src/IceInternal/BatchOutgoing.java1
-rw-r--r--java/src/IceInternal/CommunicatorObserverI.java38
-rw-r--r--java/src/IceInternal/EndpointI.java105
-rw-r--r--java/src/IceInternal/FixedReference.java2
-rw-r--r--java/src/IceInternal/InvocationObserverI.java12
-rw-r--r--java/src/IceInternal/LocatorManager.java63
-rw-r--r--java/src/IceInternal/OpaqueEndpointI.java9
-rw-r--r--java/src/IceInternal/Outgoing.java4
-rw-r--r--java/src/IceInternal/OutgoingAsync.java2
-rw-r--r--java/src/IceInternal/PropertyNames.java36
-rw-r--r--java/src/IceInternal/ProxyBatchOutgoingAsync.java10
-rw-r--r--java/src/IceInternal/Reference.java35
-rw-r--r--java/src/IceInternal/ReferenceFactory.java81
-rw-r--r--java/src/IceInternal/RoutableReference.java31
-rw-r--r--java/src/IceInternal/TcpConnector.java19
-rw-r--r--java/src/IceInternal/TcpEndpointI.java57
-rw-r--r--java/src/IceInternal/UdpConnector.java18
-rw-r--r--java/src/IceInternal/UdpEndpointI.java66
-rw-r--r--java/src/IceSSL/ConnectorI.java18
-rw-r--r--java/src/IceSSL/EndpointI.java54
21 files changed, 256 insertions, 408 deletions
diff --git a/java/src/Ice/ObjectPrxHelperBase.java b/java/src/Ice/ObjectPrxHelperBase.java
index 7f62f46ab80..d1fc853f6c1 100644
--- a/java/src/Ice/ObjectPrxHelperBase.java
+++ b/java/src/Ice/ObjectPrxHelperBase.java
@@ -1451,7 +1451,6 @@ public class ObjectPrxHelperBase implements ObjectPrx, java.io.Serializable
}
else
{
- IceInternal.Protocol.checkSupportedEncoding(e);
return newInstance(_reference.changeEncoding(e));
}
}
@@ -1464,7 +1463,7 @@ public class ObjectPrxHelperBase implements ObjectPrx, java.io.Serializable
public final Ice.EncodingVersion
ice_getEncodingVersion()
{
- return _reference.getEncoding();
+ return (Ice.EncodingVersion)_reference.getEncoding().clone();
}
/**
diff --git a/java/src/IceInternal/BatchOutgoing.java b/java/src/IceInternal/BatchOutgoing.java
index 69bb30285a5..07538a445b8 100644
--- a/java/src/IceInternal/BatchOutgoing.java
+++ b/java/src/IceInternal/BatchOutgoing.java
@@ -30,6 +30,7 @@ public final class BatchOutgoing implements OutgoingMessageCallback
_sent = false;
_os = new BasicStream(handler.getReference().getInstance(), Protocol.currentProtocolEncoding);
_observer = observer;
+ Protocol.checkSupportedProtocol(_handler.getReference().getProtocol());
}
public void
diff --git a/java/src/IceInternal/CommunicatorObserverI.java b/java/src/IceInternal/CommunicatorObserverI.java
index 49858cfc5d3..a8f1c68b08f 100644
--- a/java/src/IceInternal/CommunicatorObserverI.java
+++ b/java/src/IceInternal/CommunicatorObserverI.java
@@ -23,8 +23,6 @@ public class CommunicatorObserverI implements Ice.Instrumentation.CommunicatorOb
r.add("endpointType", cl.getDeclaredMethod("getEndpointInfo"), cli.getDeclaredMethod("type"));
r.add("endpointIsDatagram", cl.getDeclaredMethod("getEndpointInfo"), cli.getDeclaredMethod("datagram"));
r.add("endpointIsSecure", cl.getDeclaredMethod("getEndpointInfo"), cli.getDeclaredMethod("secure"));
- r.add("endpointProtocolVersion", cl.getDeclaredMethod("getEndpointProtocolVersion"));
- r.add("endpointEncodingVersion", cl.getDeclaredMethod("getEndpointEncodingVersion"));
r.add("endpointTimeout", cl.getDeclaredMethod("getEndpointInfo"), cli.getDeclaredField("timeout"));
r.add("endpointCompress", cl.getDeclaredMethod("getEndpointInfo"), cli.getDeclaredField("compress"));
@@ -165,18 +163,6 @@ public class CommunicatorObserverI implements Ice.Instrumentation.CommunicatorOb
return _endpointInfo;
}
- public String
- getEndpointEncodingVersion()
- {
- return Ice.Util.encodingVersionToString(getEndpointInfo().encoding);
- }
-
- public String
- getEndpointProtocolVersion()
- {
- return Ice.Util.protocolVersionToString(getEndpointInfo().protocol);
- }
-
private final Ice.ConnectionInfo _connectionInfo;
private final Ice.Endpoint _endpoint;
private final Ice.Instrumentation.ConnectionState _state;
@@ -287,18 +273,6 @@ public class CommunicatorObserverI implements Ice.Instrumentation.CommunicatorOb
return _endpointInfo;
}
- public String
- getEndpointEncodingVersion()
- {
- return Ice.Util.encodingVersionToString(getEndpointInfo().encoding);
- }
-
- public String
- getEndpointProtocolVersion()
- {
- return Ice.Util.protocolVersionToString(getEndpointInfo().protocol);
- }
-
public Ice.Current
getCurrent()
{
@@ -562,18 +536,6 @@ public class CommunicatorObserverI implements Ice.Instrumentation.CommunicatorOb
}
public String
- getEndpointEncodingVersion()
- {
- return Ice.Util.encodingVersionToString(getEndpointInfo().encoding);
- }
-
- public String
- getEndpointProtocolVersion()
- {
- return Ice.Util.protocolVersionToString(getEndpointInfo().protocol);
- }
-
- public String
getParent()
{
return "Communicator";
diff --git a/java/src/IceInternal/EndpointI.java b/java/src/IceInternal/EndpointI.java
index 60af992f668..f3a6949bc1a 100644
--- a/java/src/IceInternal/EndpointI.java
+++ b/java/src/IceInternal/EndpointI.java
@@ -11,17 +11,13 @@ package IceInternal;
abstract public class EndpointI implements Ice.Endpoint, java.lang.Comparable<EndpointI>
{
- public EndpointI(Ice.ProtocolVersion protocol, Ice.EncodingVersion encoding, String connectionId)
+ public EndpointI(String connectionId)
{
- _protocol = protocol;
- _encoding = encoding;
_connectionId = connectionId;
}
public EndpointI()
{
- _protocol = (Ice.ProtocolVersion)Protocol.currentProtocol;
- _encoding = (Ice.EncodingVersion)Protocol.currentEncoding;
}
public String
@@ -87,22 +83,6 @@ abstract public class EndpointI implements Ice.Endpoint, java.lang.Comparable<En
public abstract boolean secure();
//
- // Return the protocol supported by the endpoint.
- //
- public Ice.ProtocolVersion protocolVersion()
- {
- return _protocol;
- }
-
- //
- // Return the encoding supported by the endpoint.
- //
- public Ice.EncodingVersion encodingVersion()
- {
- return _encoding;
- }
-
- //
// Return the connection ID
//
public String connectionId()
@@ -160,42 +140,6 @@ abstract public class EndpointI implements Ice.Endpoint, java.lang.Comparable<En
public int compareTo(EndpointI p) // From java.lang.Comparable.
{
- if(_protocol.major < p._protocol.major)
- {
- return -1;
- }
- else if(p._protocol.major < _protocol.major)
- {
- return 1;
- }
-
- if(_protocol.minor < p._protocol.minor)
- {
- return -1;
- }
- else if(p._protocol.minor < _protocol.minor)
- {
- return 1;
- }
-
- if(_encoding.major < p._encoding.major)
- {
- return -1;
- }
- else if(p._encoding.major < _encoding.major)
- {
- return 1;
- }
-
- if(_encoding.minor < p._encoding.minor)
- {
- return -1;
- }
- else if(p._encoding.minor < _encoding.minor)
- {
- return 1;
- }
-
if(!_connectionId.equals(p._connectionId))
{
return _connectionId.compareTo(p._connectionId);
@@ -215,52 +159,5 @@ abstract public class EndpointI implements Ice.Endpoint, java.lang.Comparable<En
return null;
}
- protected void
- parseOption(String option, String arg, String desc, String str)
- {
- if(option.equals("-v"))
- {
- if(arg == null)
- {
- throw new Ice.EndpointParseException("no argument provided for -v option in endpoint `" +
- desc + " "+ str + "'");
- }
-
- try
- {
- _protocol = Ice.Util.stringToProtocolVersion(arg);
- }
- catch(Ice.VersionParseException e)
- {
- throw new Ice.EndpointParseException("invalid protocol version `" + arg + "' in endpoint `" +
- desc + " "+ str + "':\n" + e.str);
- }
- }
- else if(option.equals("-e"))
- {
- if(arg == null)
- {
- throw new Ice.EndpointParseException("no argument provided for -e option in endpoint `" +
- desc + " " + str + "'");
- }
-
- try
- {
- _encoding = Ice.Util.stringToEncodingVersion(arg);
- }
- catch(Ice.VersionParseException e)
- {
- throw new Ice.EndpointParseException("invalid encoding version `" + arg + "' in endpoint `" +
- desc + " "+ str + "':\n" + e.str);
- }
- }
- else
- {
- throw new Ice.EndpointParseException("unknown option `" + option + "' in `" + desc + " " + str + "'");
- }
- }
-
- protected Ice.ProtocolVersion _protocol;
- protected Ice.EncodingVersion _encoding;
protected String _connectionId = "";
}
diff --git a/java/src/IceInternal/FixedReference.java b/java/src/IceInternal/FixedReference.java
index 1c5233f77ca..020db4a4ca8 100644
--- a/java/src/IceInternal/FixedReference.java
+++ b/java/src/IceInternal/FixedReference.java
@@ -21,7 +21,7 @@ public class FixedReference extends Reference
Ice.EncodingVersion encoding,
Ice.ConnectionI connection)
{
- super(instance, communicator, identity, facet, mode, secure, encoding);
+ super(instance, communicator, identity, facet, mode, secure, Ice.Util.Protocol_1_0, encoding);
_fixedConnection = connection;
}
diff --git a/java/src/IceInternal/InvocationObserverI.java b/java/src/IceInternal/InvocationObserverI.java
index b04cdde3025..b3b4605e10e 100644
--- a/java/src/IceInternal/InvocationObserverI.java
+++ b/java/src/IceInternal/InvocationObserverI.java
@@ -90,18 +90,6 @@ public class InvocationObserverI extends IceMX.Observer<IceMX.InvocationMetrics>
return _endpointInfo;
}
- public String
- getEndpointEncodingVersion()
- {
- return Ice.Util.encodingVersionToString(getEndpointInfo().encoding);
- }
-
- public String
- getEndpointProtocolVersion()
- {
- return Ice.Util.protocolVersionToString(getEndpointInfo().protocol);
- }
-
final private Ice.ConnectionInfo _connectionInfo;
final private Ice.Endpoint _endpoint;
private String _id;
diff --git a/java/src/IceInternal/LocatorManager.java b/java/src/IceInternal/LocatorManager.java
index 06e36c1cd26..843ee55ebf4 100644
--- a/java/src/IceInternal/LocatorManager.java
+++ b/java/src/IceInternal/LocatorManager.java
@@ -11,6 +11,60 @@ package IceInternal;
public final class LocatorManager
{
+ static private class LocatorKey implements Cloneable
+ {
+ public boolean
+ equals(Object o)
+ {
+ assert(o instanceof LocatorKey);
+ LocatorKey k = (LocatorKey)o;
+ if(!k._id.equals(_id))
+ {
+ return false;
+ }
+ if(!k._encoding.equals(_encoding))
+ {
+ return false;
+ }
+ return true;
+ }
+
+ public int
+ hashCode()
+ {
+ int h = 5381;
+ h = IceInternal.HashUtil.hashAdd(h, _id);
+ h = IceInternal.HashUtil.hashAdd(h, _encoding);
+ return h;
+ }
+
+ public java.lang.Object
+ clone()
+ {
+ java.lang.Object o = null;
+ try
+ {
+ o = super.clone();
+ }
+ catch(CloneNotSupportedException ex)
+ {
+ assert false; // impossible
+ }
+ return o;
+ }
+
+ LocatorKey set(Ice.LocatorPrx locator)
+ {
+ Reference r = ((Ice.ObjectPrxHelperBase)locator).__reference();
+ _id = r.getIdentity();
+ _encoding = r.getEncoding();
+ return this;
+ }
+
+ private Ice.Identity _id;
+ private Ice.EncodingVersion _encoding;
+ }
+
LocatorManager(Ice.Properties properties)
{
_background = properties.getPropertyAsInt("Ice.BackgroundLocatorCacheUpdates") > 0;
@@ -58,11 +112,11 @@ public final class LocatorManager
// have only one table per locator (not one per locator
// proxy).
//
- LocatorTable table = _locatorTables.get(locator.ice_getIdentity());
+ LocatorTable table = _locatorTables.get(_lookupKey.set(locator));
if(table == null)
{
table = new LocatorTable();
- _locatorTables.put(locator.ice_getIdentity(), table);
+ _locatorTables.put((LocatorKey)_lookupKey.clone(), table);
}
info = new LocatorInfo(locator, table, _background);
@@ -77,6 +131,7 @@ public final class LocatorManager
private java.util.HashMap<Ice.LocatorPrx, LocatorInfo> _table =
new java.util.HashMap<Ice.LocatorPrx, LocatorInfo>();
- private java.util.HashMap<Ice.Identity, LocatorTable> _locatorTables =
- new java.util.HashMap<Ice.Identity, LocatorTable>();
+ private java.util.HashMap<LocatorKey, LocatorTable> _locatorTables =
+ new java.util.HashMap<LocatorKey, LocatorTable>();
+ private LocatorKey _lookupKey = new LocatorKey(); // A key used for the lookup
}
diff --git a/java/src/IceInternal/OpaqueEndpointI.java b/java/src/IceInternal/OpaqueEndpointI.java
index 3966d4ffe31..42a0d2da8b0 100644
--- a/java/src/IceInternal/OpaqueEndpointI.java
+++ b/java/src/IceInternal/OpaqueEndpointI.java
@@ -14,7 +14,7 @@ final class OpaqueEndpointI extends EndpointI
public
OpaqueEndpointI(String str)
{
- super(Protocol_0_0, Encoding_0_0, "");
+ super("");
_rawEncoding = Protocol.currentEncoding;
@@ -148,7 +148,7 @@ final class OpaqueEndpointI extends EndpointI
public
OpaqueEndpointI(short type, BasicStream s)
{
- super(Protocol_0_0, Encoding_0_0, "");
+ super("");
_type = type;
_rawEncoding = s.startReadEncaps();
int sz = s.getReadEncapsSize();
@@ -185,7 +185,7 @@ final class OpaqueEndpointI extends EndpointI
public Ice.EndpointInfo
getInfo()
{
- return new Ice.OpaqueEndpointInfo(_protocol, _encoding, -1, false, _rawEncoding, _rawBytes)
+ return new Ice.OpaqueEndpointInfo(-1, false, _rawEncoding, _rawBytes)
{
public short type()
{
@@ -453,7 +453,4 @@ final class OpaqueEndpointI extends EndpointI
private Ice.EncodingVersion _rawEncoding;
private byte[] _rawBytes;
private int _hashCode;
-
- private final static Ice.ProtocolVersion Protocol_0_0 = new Ice.ProtocolVersion((byte)0, (byte)0);
- private final static Ice.EncodingVersion Encoding_0_0 = new Ice.EncodingVersion((byte)0, (byte)0);
}
diff --git a/java/src/IceInternal/Outgoing.java b/java/src/IceInternal/Outgoing.java
index f2d2b6317fe..fb857e8f865 100644
--- a/java/src/IceInternal/Outgoing.java
+++ b/java/src/IceInternal/Outgoing.java
@@ -26,6 +26,8 @@ public final class Outgoing implements OutgoingMessageCallback
_encoding = handler.getReference().getEncoding();
_os = new BasicStream(_handler.getReference().getInstance(), Protocol.currentProtocolEncoding);
+ Protocol.checkSupportedProtocol(_handler.getReference().getProtocol());
+
writeHeader(operation, mode, context);
}
@@ -44,6 +46,8 @@ public final class Outgoing implements OutgoingMessageCallback
_observer = observer;
_encoding = handler.getReference().getEncoding();
+ Protocol.checkSupportedProtocol(_handler.getReference().getProtocol());
+
writeHeader(operation, mode, context);
}
diff --git a/java/src/IceInternal/OutgoingAsync.java b/java/src/IceInternal/OutgoingAsync.java
index 83166e27103..bfe52a0f49b 100644
--- a/java/src/IceInternal/OutgoingAsync.java
+++ b/java/src/IceInternal/OutgoingAsync.java
@@ -26,6 +26,8 @@ public class OutgoingAsync extends Ice.AsyncResult implements OutgoingAsyncMessa
_mode = mode;
_sentSynchronously = false;
+ Protocol.checkSupportedProtocol(_proxy.__reference().getProtocol());
+
if(explicitCtx && ctx == null)
{
ctx = _emptyContext;
diff --git a/java/src/IceInternal/PropertyNames.java b/java/src/IceInternal/PropertyNames.java
index 694aebea5d2..07dc9ac43b4 100644
--- a/java/src/IceInternal/PropertyNames.java
+++ b/java/src/IceInternal/PropertyNames.java
@@ -8,7 +8,7 @@
// **********************************************************************
//
-// Generated by makeprops.py from file ../config/PropertyNames.xml, Mon Oct 22 18:48:40 2012
+// Generated by makeprops.py from file ./config/PropertyNames.xml, Mon Nov 12 21:17:34 2012
// IMPORTANT: Do not edit this file -- any edits made here will be lost!
@@ -29,7 +29,6 @@ public final class PropertyNames
new Property("Ice\\.Admin\\.Locator\\.LocatorCacheTimeout", false, null),
new Property("Ice\\.Admin\\.Locator\\.Locator", false, null),
new Property("Ice\\.Admin\\.Locator\\.Router", false, null),
- new Property("Ice\\.Admin\\.Locator\\.EncodingVersion", false, null),
new Property("Ice\\.Admin\\.Locator\\.CollocationOptimized", false, null),
new Property("Ice\\.Admin\\.Locator", false, null),
new Property("Ice\\.Admin\\.PublishedEndpoints", false, null),
@@ -40,7 +39,6 @@ public final class PropertyNames
new Property("Ice\\.Admin\\.Router\\.LocatorCacheTimeout", false, null),
new Property("Ice\\.Admin\\.Router\\.Locator", false, null),
new Property("Ice\\.Admin\\.Router\\.Router", false, null),
- new Property("Ice\\.Admin\\.Router\\.EncodingVersion", false, null),
new Property("Ice\\.Admin\\.Router\\.CollocationOptimized", false, null),
new Property("Ice\\.Admin\\.Router", false, null),
new Property("Ice\\.Admin\\.ProxyOptions", false, null),
@@ -71,7 +69,6 @@ public final class PropertyNames
new Property("Ice\\.Default\\.Locator\\.LocatorCacheTimeout", false, null),
new Property("Ice\\.Default\\.Locator\\.Locator", false, null),
new Property("Ice\\.Default\\.Locator\\.Router", false, null),
- new Property("Ice\\.Default\\.Locator\\.EncodingVersion", false, null),
new Property("Ice\\.Default\\.Locator\\.CollocationOptimized", false, null),
new Property("Ice\\.Default\\.Locator", false, null),
new Property("Ice\\.Default\\.LocatorCacheTimeout", false, null),
@@ -84,7 +81,6 @@ public final class PropertyNames
new Property("Ice\\.Default\\.Router\\.LocatorCacheTimeout", false, null),
new Property("Ice\\.Default\\.Router\\.Locator", false, null),
new Property("Ice\\.Default\\.Router\\.Router", false, null),
- new Property("Ice\\.Default\\.Router\\.EncodingVersion", false, null),
new Property("Ice\\.Default\\.Router\\.CollocationOptimized", false, null),
new Property("Ice\\.Default\\.Router", false, null),
new Property("Ice\\.Default\\.SlicedFormat", false, null),
@@ -184,7 +180,6 @@ public final class PropertyNames
new Property("IceBox\\.ServiceManager\\.Locator\\.LocatorCacheTimeout", false, null),
new Property("IceBox\\.ServiceManager\\.Locator\\.Locator", false, null),
new Property("IceBox\\.ServiceManager\\.Locator\\.Router", false, null),
- new Property("IceBox\\.ServiceManager\\.Locator\\.EncodingVersion", false, null),
new Property("IceBox\\.ServiceManager\\.Locator\\.CollocationOptimized", false, null),
new Property("IceBox\\.ServiceManager\\.Locator", false, null),
new Property("IceBox\\.ServiceManager\\.PublishedEndpoints", false, null),
@@ -195,7 +190,6 @@ public final class PropertyNames
new Property("IceBox\\.ServiceManager\\.Router\\.LocatorCacheTimeout", false, null),
new Property("IceBox\\.ServiceManager\\.Router\\.Locator", false, null),
new Property("IceBox\\.ServiceManager\\.Router\\.Router", false, null),
- new Property("IceBox\\.ServiceManager\\.Router\\.EncodingVersion", false, null),
new Property("IceBox\\.ServiceManager\\.Router\\.CollocationOptimized", false, null),
new Property("IceBox\\.ServiceManager\\.Router", false, null),
new Property("IceBox\\.ServiceManager\\.ProxyOptions", false, null),
@@ -219,7 +213,6 @@ public final class PropertyNames
new Property("IceBoxAdmin\\.ServiceManager\\.Proxy\\.LocatorCacheTimeout", false, null),
new Property("IceBoxAdmin\\.ServiceManager\\.Proxy\\.Locator", false, null),
new Property("IceBoxAdmin\\.ServiceManager\\.Proxy\\.Router", false, null),
- new Property("IceBoxAdmin\\.ServiceManager\\.Proxy\\.EncodingVersion", false, null),
new Property("IceBoxAdmin\\.ServiceManager\\.Proxy\\.CollocationOptimized", false, null),
new Property("IceBoxAdmin\\.ServiceManager\\.Proxy", false, null),
null
@@ -248,7 +241,6 @@ public final class PropertyNames
new Property("IceGrid\\.Node\\.Locator\\.LocatorCacheTimeout", false, null),
new Property("IceGrid\\.Node\\.Locator\\.Locator", false, null),
new Property("IceGrid\\.Node\\.Locator\\.Router", false, null),
- new Property("IceGrid\\.Node\\.Locator\\.EncodingVersion", false, null),
new Property("IceGrid\\.Node\\.Locator\\.CollocationOptimized", false, null),
new Property("IceGrid\\.Node\\.Locator", false, null),
new Property("IceGrid\\.Node\\.PublishedEndpoints", false, null),
@@ -259,7 +251,6 @@ public final class PropertyNames
new Property("IceGrid\\.Node\\.Router\\.LocatorCacheTimeout", false, null),
new Property("IceGrid\\.Node\\.Router\\.Locator", false, null),
new Property("IceGrid\\.Node\\.Router\\.Router", false, null),
- new Property("IceGrid\\.Node\\.Router\\.EncodingVersion", false, null),
new Property("IceGrid\\.Node\\.Router\\.CollocationOptimized", false, null),
new Property("IceGrid\\.Node\\.Router", false, null),
new Property("IceGrid\\.Node\\.ProxyOptions", false, null),
@@ -293,7 +284,6 @@ public final class PropertyNames
new Property("IceGrid\\.Node\\.UserAccountMapper\\.LocatorCacheTimeout", false, null),
new Property("IceGrid\\.Node\\.UserAccountMapper\\.Locator", false, null),
new Property("IceGrid\\.Node\\.UserAccountMapper\\.Router", false, null),
- new Property("IceGrid\\.Node\\.UserAccountMapper\\.EncodingVersion", false, null),
new Property("IceGrid\\.Node\\.UserAccountMapper\\.CollocationOptimized", false, null),
new Property("IceGrid\\.Node\\.UserAccountMapper", false, null),
new Property("IceGrid\\.Node\\.WaitTime", false, null),
@@ -304,7 +294,6 @@ public final class PropertyNames
new Property("IceGrid\\.Registry\\.AdminPermissionsVerifier\\.LocatorCacheTimeout", false, null),
new Property("IceGrid\\.Registry\\.AdminPermissionsVerifier\\.Locator", false, null),
new Property("IceGrid\\.Registry\\.AdminPermissionsVerifier\\.Router", false, null),
- new Property("IceGrid\\.Registry\\.AdminPermissionsVerifier\\.EncodingVersion", false, null),
new Property("IceGrid\\.Registry\\.AdminPermissionsVerifier\\.CollocationOptimized", false, null),
new Property("IceGrid\\.Registry\\.AdminPermissionsVerifier", false, null),
new Property("IceGrid\\.Registry\\.AdminSessionFilters", false, null),
@@ -317,7 +306,6 @@ public final class PropertyNames
new Property("IceGrid\\.Registry\\.AdminSessionManager\\.Locator\\.LocatorCacheTimeout", false, null),
new Property("IceGrid\\.Registry\\.AdminSessionManager\\.Locator\\.Locator", false, null),
new Property("IceGrid\\.Registry\\.AdminSessionManager\\.Locator\\.Router", false, null),
- new Property("IceGrid\\.Registry\\.AdminSessionManager\\.Locator\\.EncodingVersion", false, null),
new Property("IceGrid\\.Registry\\.AdminSessionManager\\.Locator\\.CollocationOptimized", false, null),
new Property("IceGrid\\.Registry\\.AdminSessionManager\\.Locator", false, null),
new Property("IceGrid\\.Registry\\.AdminSessionManager\\.PublishedEndpoints", false, null),
@@ -328,7 +316,6 @@ public final class PropertyNames
new Property("IceGrid\\.Registry\\.AdminSessionManager\\.Router\\.LocatorCacheTimeout", false, null),
new Property("IceGrid\\.Registry\\.AdminSessionManager\\.Router\\.Locator", false, null),
new Property("IceGrid\\.Registry\\.AdminSessionManager\\.Router\\.Router", false, null),
- new Property("IceGrid\\.Registry\\.AdminSessionManager\\.Router\\.EncodingVersion", false, null),
new Property("IceGrid\\.Registry\\.AdminSessionManager\\.Router\\.CollocationOptimized", false, null),
new Property("IceGrid\\.Registry\\.AdminSessionManager\\.Router", false, null),
new Property("IceGrid\\.Registry\\.AdminSessionManager\\.ProxyOptions", false, null),
@@ -345,7 +332,6 @@ public final class PropertyNames
new Property("IceGrid\\.Registry\\.AdminSSLPermissionsVerifier\\.LocatorCacheTimeout", false, null),
new Property("IceGrid\\.Registry\\.AdminSSLPermissionsVerifier\\.Locator", false, null),
new Property("IceGrid\\.Registry\\.AdminSSLPermissionsVerifier\\.Router", false, null),
- new Property("IceGrid\\.Registry\\.AdminSSLPermissionsVerifier\\.EncodingVersion", false, null),
new Property("IceGrid\\.Registry\\.AdminSSLPermissionsVerifier\\.CollocationOptimized", false, null),
new Property("IceGrid\\.Registry\\.AdminSSLPermissionsVerifier", false, null),
new Property("IceGrid\\.Registry\\.Client\\.ACM", false, null),
@@ -357,7 +343,6 @@ public final class PropertyNames
new Property("IceGrid\\.Registry\\.Client\\.Locator\\.LocatorCacheTimeout", false, null),
new Property("IceGrid\\.Registry\\.Client\\.Locator\\.Locator", false, null),
new Property("IceGrid\\.Registry\\.Client\\.Locator\\.Router", false, null),
- new Property("IceGrid\\.Registry\\.Client\\.Locator\\.EncodingVersion", false, null),
new Property("IceGrid\\.Registry\\.Client\\.Locator\\.CollocationOptimized", false, null),
new Property("IceGrid\\.Registry\\.Client\\.Locator", false, null),
new Property("IceGrid\\.Registry\\.Client\\.PublishedEndpoints", false, null),
@@ -368,7 +353,6 @@ public final class PropertyNames
new Property("IceGrid\\.Registry\\.Client\\.Router\\.LocatorCacheTimeout", false, null),
new Property("IceGrid\\.Registry\\.Client\\.Router\\.Locator", false, null),
new Property("IceGrid\\.Registry\\.Client\\.Router\\.Router", false, null),
- new Property("IceGrid\\.Registry\\.Client\\.Router\\.EncodingVersion", false, null),
new Property("IceGrid\\.Registry\\.Client\\.Router\\.CollocationOptimized", false, null),
new Property("IceGrid\\.Registry\\.Client\\.Router", false, null),
new Property("IceGrid\\.Registry\\.Client\\.ProxyOptions", false, null),
@@ -392,7 +376,6 @@ public final class PropertyNames
new Property("IceGrid\\.Registry\\.Internal\\.Locator\\.LocatorCacheTimeout", false, null),
new Property("IceGrid\\.Registry\\.Internal\\.Locator\\.Locator", false, null),
new Property("IceGrid\\.Registry\\.Internal\\.Locator\\.Router", false, null),
- new Property("IceGrid\\.Registry\\.Internal\\.Locator\\.EncodingVersion", false, null),
new Property("IceGrid\\.Registry\\.Internal\\.Locator\\.CollocationOptimized", false, null),
new Property("IceGrid\\.Registry\\.Internal\\.Locator", false, null),
new Property("IceGrid\\.Registry\\.Internal\\.PublishedEndpoints", false, null),
@@ -403,7 +386,6 @@ public final class PropertyNames
new Property("IceGrid\\.Registry\\.Internal\\.Router\\.LocatorCacheTimeout", false, null),
new Property("IceGrid\\.Registry\\.Internal\\.Router\\.Locator", false, null),
new Property("IceGrid\\.Registry\\.Internal\\.Router\\.Router", false, null),
- new Property("IceGrid\\.Registry\\.Internal\\.Router\\.EncodingVersion", false, null),
new Property("IceGrid\\.Registry\\.Internal\\.Router\\.CollocationOptimized", false, null),
new Property("IceGrid\\.Registry\\.Internal\\.Router", false, null),
new Property("IceGrid\\.Registry\\.Internal\\.ProxyOptions", false, null),
@@ -421,7 +403,6 @@ public final class PropertyNames
new Property("IceGrid\\.Registry\\.PermissionsVerifier\\.LocatorCacheTimeout", false, null),
new Property("IceGrid\\.Registry\\.PermissionsVerifier\\.Locator", false, null),
new Property("IceGrid\\.Registry\\.PermissionsVerifier\\.Router", false, null),
- new Property("IceGrid\\.Registry\\.PermissionsVerifier\\.EncodingVersion", false, null),
new Property("IceGrid\\.Registry\\.PermissionsVerifier\\.CollocationOptimized", false, null),
new Property("IceGrid\\.Registry\\.PermissionsVerifier", false, null),
new Property("IceGrid\\.Registry\\.ReplicaName", false, null),
@@ -437,7 +418,6 @@ public final class PropertyNames
new Property("IceGrid\\.Registry\\.Server\\.Locator\\.LocatorCacheTimeout", false, null),
new Property("IceGrid\\.Registry\\.Server\\.Locator\\.Locator", false, null),
new Property("IceGrid\\.Registry\\.Server\\.Locator\\.Router", false, null),
- new Property("IceGrid\\.Registry\\.Server\\.Locator\\.EncodingVersion", false, null),
new Property("IceGrid\\.Registry\\.Server\\.Locator\\.CollocationOptimized", false, null),
new Property("IceGrid\\.Registry\\.Server\\.Locator", false, null),
new Property("IceGrid\\.Registry\\.Server\\.PublishedEndpoints", false, null),
@@ -448,7 +428,6 @@ public final class PropertyNames
new Property("IceGrid\\.Registry\\.Server\\.Router\\.LocatorCacheTimeout", false, null),
new Property("IceGrid\\.Registry\\.Server\\.Router\\.Locator", false, null),
new Property("IceGrid\\.Registry\\.Server\\.Router\\.Router", false, null),
- new Property("IceGrid\\.Registry\\.Server\\.Router\\.EncodingVersion", false, null),
new Property("IceGrid\\.Registry\\.Server\\.Router\\.CollocationOptimized", false, null),
new Property("IceGrid\\.Registry\\.Server\\.Router", false, null),
new Property("IceGrid\\.Registry\\.Server\\.ProxyOptions", false, null),
@@ -469,7 +448,6 @@ public final class PropertyNames
new Property("IceGrid\\.Registry\\.SessionManager\\.Locator\\.LocatorCacheTimeout", false, null),
new Property("IceGrid\\.Registry\\.SessionManager\\.Locator\\.Locator", false, null),
new Property("IceGrid\\.Registry\\.SessionManager\\.Locator\\.Router", false, null),
- new Property("IceGrid\\.Registry\\.SessionManager\\.Locator\\.EncodingVersion", false, null),
new Property("IceGrid\\.Registry\\.SessionManager\\.Locator\\.CollocationOptimized", false, null),
new Property("IceGrid\\.Registry\\.SessionManager\\.Locator", false, null),
new Property("IceGrid\\.Registry\\.SessionManager\\.PublishedEndpoints", false, null),
@@ -480,7 +458,6 @@ public final class PropertyNames
new Property("IceGrid\\.Registry\\.SessionManager\\.Router\\.LocatorCacheTimeout", false, null),
new Property("IceGrid\\.Registry\\.SessionManager\\.Router\\.Locator", false, null),
new Property("IceGrid\\.Registry\\.SessionManager\\.Router\\.Router", false, null),
- new Property("IceGrid\\.Registry\\.SessionManager\\.Router\\.EncodingVersion", false, null),
new Property("IceGrid\\.Registry\\.SessionManager\\.Router\\.CollocationOptimized", false, null),
new Property("IceGrid\\.Registry\\.SessionManager\\.Router", false, null),
new Property("IceGrid\\.Registry\\.SessionManager\\.ProxyOptions", false, null),
@@ -498,7 +475,6 @@ public final class PropertyNames
new Property("IceGrid\\.Registry\\.SSLPermissionsVerifier\\.LocatorCacheTimeout", false, null),
new Property("IceGrid\\.Registry\\.SSLPermissionsVerifier\\.Locator", false, null),
new Property("IceGrid\\.Registry\\.SSLPermissionsVerifier\\.Router", false, null),
- new Property("IceGrid\\.Registry\\.SSLPermissionsVerifier\\.EncodingVersion", false, null),
new Property("IceGrid\\.Registry\\.SSLPermissionsVerifier\\.CollocationOptimized", false, null),
new Property("IceGrid\\.Registry\\.SSLPermissionsVerifier", false, null),
new Property("IceGrid\\.Registry\\.Trace\\.Application", false, null),
@@ -535,7 +511,6 @@ public final class PropertyNames
new Property("IcePatch2\\.Locator\\.LocatorCacheTimeout", false, null),
new Property("IcePatch2\\.Locator\\.Locator", false, null),
new Property("IcePatch2\\.Locator\\.Router", false, null),
- new Property("IcePatch2\\.Locator\\.EncodingVersion", false, null),
new Property("IcePatch2\\.Locator\\.CollocationOptimized", false, null),
new Property("IcePatch2\\.Locator", false, null),
new Property("IcePatch2\\.PublishedEndpoints", false, null),
@@ -546,7 +521,6 @@ public final class PropertyNames
new Property("IcePatch2\\.Router\\.LocatorCacheTimeout", false, null),
new Property("IcePatch2\\.Router\\.Locator", false, null),
new Property("IcePatch2\\.Router\\.Router", false, null),
- new Property("IcePatch2\\.Router\\.EncodingVersion", false, null),
new Property("IcePatch2\\.Router\\.CollocationOptimized", false, null),
new Property("IcePatch2\\.Router", false, null),
new Property("IcePatch2\\.ProxyOptions", false, null),
@@ -630,7 +604,6 @@ public final class PropertyNames
new Property("Glacier2\\.Client\\.Locator\\.LocatorCacheTimeout", false, null),
new Property("Glacier2\\.Client\\.Locator\\.Locator", false, null),
new Property("Glacier2\\.Client\\.Locator\\.Router", false, null),
- new Property("Glacier2\\.Client\\.Locator\\.EncodingVersion", false, null),
new Property("Glacier2\\.Client\\.Locator\\.CollocationOptimized", false, null),
new Property("Glacier2\\.Client\\.Locator", false, null),
new Property("Glacier2\\.Client\\.PublishedEndpoints", false, null),
@@ -641,7 +614,6 @@ public final class PropertyNames
new Property("Glacier2\\.Client\\.Router\\.LocatorCacheTimeout", false, null),
new Property("Glacier2\\.Client\\.Router\\.Locator", false, null),
new Property("Glacier2\\.Client\\.Router\\.Router", false, null),
- new Property("Glacier2\\.Client\\.Router\\.EncodingVersion", false, null),
new Property("Glacier2\\.Client\\.Router\\.CollocationOptimized", false, null),
new Property("Glacier2\\.Client\\.Router", false, null),
new Property("Glacier2\\.Client\\.ProxyOptions", false, null),
@@ -674,7 +646,6 @@ public final class PropertyNames
new Property("Glacier2\\.PermissionsVerifier\\.LocatorCacheTimeout", false, null),
new Property("Glacier2\\.PermissionsVerifier\\.Locator", false, null),
new Property("Glacier2\\.PermissionsVerifier\\.Router", false, null),
- new Property("Glacier2\\.PermissionsVerifier\\.EncodingVersion", false, null),
new Property("Glacier2\\.PermissionsVerifier\\.CollocationOptimized", false, null),
new Property("Glacier2\\.PermissionsVerifier", false, null),
new Property("Glacier2\\.ReturnClientProxy", false, null),
@@ -684,7 +655,6 @@ public final class PropertyNames
new Property("Glacier2\\.SSLPermissionsVerifier\\.LocatorCacheTimeout", false, null),
new Property("Glacier2\\.SSLPermissionsVerifier\\.Locator", false, null),
new Property("Glacier2\\.SSLPermissionsVerifier\\.Router", false, null),
- new Property("Glacier2\\.SSLPermissionsVerifier\\.EncodingVersion", false, null),
new Property("Glacier2\\.SSLPermissionsVerifier\\.CollocationOptimized", false, null),
new Property("Glacier2\\.SSLPermissionsVerifier", false, null),
new Property("Glacier2\\.RoutingTable\\.MaxSize", false, null),
@@ -697,7 +667,6 @@ public final class PropertyNames
new Property("Glacier2\\.Server\\.Locator\\.LocatorCacheTimeout", false, null),
new Property("Glacier2\\.Server\\.Locator\\.Locator", false, null),
new Property("Glacier2\\.Server\\.Locator\\.Router", false, null),
- new Property("Glacier2\\.Server\\.Locator\\.EncodingVersion", false, null),
new Property("Glacier2\\.Server\\.Locator\\.CollocationOptimized", false, null),
new Property("Glacier2\\.Server\\.Locator", false, null),
new Property("Glacier2\\.Server\\.PublishedEndpoints", false, null),
@@ -708,7 +677,6 @@ public final class PropertyNames
new Property("Glacier2\\.Server\\.Router\\.LocatorCacheTimeout", false, null),
new Property("Glacier2\\.Server\\.Router\\.Locator", false, null),
new Property("Glacier2\\.Server\\.Router\\.Router", false, null),
- new Property("Glacier2\\.Server\\.Router\\.EncodingVersion", false, null),
new Property("Glacier2\\.Server\\.Router\\.CollocationOptimized", false, null),
new Property("Glacier2\\.Server\\.Router", false, null),
new Property("Glacier2\\.Server\\.ProxyOptions", false, null),
@@ -731,7 +699,6 @@ public final class PropertyNames
new Property("Glacier2\\.SessionManager\\.LocatorCacheTimeout", false, null),
new Property("Glacier2\\.SessionManager\\.Locator", false, null),
new Property("Glacier2\\.SessionManager\\.Router", false, null),
- new Property("Glacier2\\.SessionManager\\.EncodingVersion", false, null),
new Property("Glacier2\\.SessionManager\\.CollocationOptimized", false, null),
new Property("Glacier2\\.SessionManager", false, null),
new Property("Glacier2\\.SSLSessionManager\\.EndpointSelection", false, null),
@@ -740,7 +707,6 @@ public final class PropertyNames
new Property("Glacier2\\.SSLSessionManager\\.LocatorCacheTimeout", false, null),
new Property("Glacier2\\.SSLSessionManager\\.Locator", false, null),
new Property("Glacier2\\.SSLSessionManager\\.Router", false, null),
- new Property("Glacier2\\.SSLSessionManager\\.EncodingVersion", false, null),
new Property("Glacier2\\.SSLSessionManager\\.CollocationOptimized", false, null),
new Property("Glacier2\\.SSLSessionManager", false, null),
new Property("Glacier2\\.SessionTimeout", false, null),
diff --git a/java/src/IceInternal/ProxyBatchOutgoingAsync.java b/java/src/IceInternal/ProxyBatchOutgoingAsync.java
index 9d325d21d44..9e6a82b18b7 100644
--- a/java/src/IceInternal/ProxyBatchOutgoingAsync.java
+++ b/java/src/IceInternal/ProxyBatchOutgoingAsync.java
@@ -15,12 +15,14 @@ public class ProxyBatchOutgoingAsync extends BatchOutgoingAsync
{
super(prx.ice_getCommunicator(), ((Ice.ObjectPrxHelperBase)prx).__reference().getInstance(), operation,
callback);
- _proxy = prx;
+ _proxy = (Ice.ObjectPrxHelperBase)prx;
_observer = ObserverHelper.get(prx, operation);
}
public void __send()
{
+ Protocol.checkSupportedProtocol(_proxy.__reference().getProtocol());
+
//
// We don't automatically retry if ice_flushBatchRequests fails. Otherwise, if some batch
// requests were queued with the connection, they would be lost without being noticed.
@@ -29,7 +31,7 @@ public class ProxyBatchOutgoingAsync extends BatchOutgoingAsync
int cnt = -1; // Don't retry.
try
{
- delegate = ((Ice.ObjectPrxHelperBase)_proxy).__getDelegate(false);
+ delegate = _proxy.__getDelegate(false);
int status = delegate.__getRequestHandler().flushAsyncBatchRequests(this);
if((status & AsyncStatus.Sent) > 0)
{
@@ -42,7 +44,7 @@ public class ProxyBatchOutgoingAsync extends BatchOutgoingAsync
}
catch(Ice.LocalException __ex)
{
- cnt = ((Ice.ObjectPrxHelperBase)_proxy).__handleException(delegate, __ex, null, cnt, _observer);
+ cnt = _proxy.__handleException(delegate, __ex, null, cnt, _observer);
}
}
@@ -52,5 +54,5 @@ public class ProxyBatchOutgoingAsync extends BatchOutgoingAsync
return _proxy;
}
- private Ice.ObjectPrx _proxy;
+ private Ice.ObjectPrxHelperBase _proxy;
}
diff --git a/java/src/IceInternal/Reference.java b/java/src/IceInternal/Reference.java
index 2e6e1f4af1a..b750743c252 100644
--- a/java/src/IceInternal/Reference.java
+++ b/java/src/IceInternal/Reference.java
@@ -36,6 +36,12 @@ public abstract class Reference implements Cloneable
return _secure;
}
+ public final Ice.ProtocolVersion
+ getProtocol()
+ {
+ return _protocol;
+ }
+
public final Ice.EncodingVersion
getEncoding()
{
@@ -155,7 +161,7 @@ public abstract class Reference implements Cloneable
return r;
}
- public final Reference
+ public Reference
changeEncoding(Ice.EncodingVersion newEncoding)
{
if(newEncoding.equals(_encoding))
@@ -212,6 +218,7 @@ public abstract class Reference implements Cloneable
{
h = IceInternal.HashUtil.hashAdd(h, _compress);
}
+ h = IceInternal.HashUtil.hashAdd(h, _protocol);
h = IceInternal.HashUtil.hashAdd(h, _encoding);
_hashValue = h;
@@ -254,6 +261,12 @@ public abstract class Reference implements Cloneable
s.writeBool(_secure);
+ if(!s.getWriteEncoding().equals(Ice.Util.Encoding_1_0))
+ {
+ _protocol.__write(s);
+ _encoding.__write(s);
+ }
+
// Derived class writes the remainder of the reference.
}
@@ -348,6 +361,18 @@ public abstract class Reference implements Cloneable
s.append(" -s");
}
+ if(!_protocol.equals(Ice.Util.Protocol_1_0))
+ {
+ s.append(" -p ");
+ s.append(Ice.Util.protocolVersionToString(_protocol));
+ }
+
+ if(!_encoding.equals(Ice.Util.Encoding_1_0))
+ {
+ s.append(" -e ");
+ s.append(Ice.Util.encodingVersionToString(_encoding));
+ }
+
return s.toString();
// Derived class writes the remainder of the string.
@@ -404,6 +429,11 @@ public abstract class Reference implements Cloneable
return false;
}
+ if(!_protocol.equals(r._protocol))
+ {
+ return false;
+ }
+
if(!_encoding.equals(r._encoding))
{
return false;
@@ -440,6 +470,7 @@ public abstract class Reference implements Cloneable
private Ice.Identity _identity;
private java.util.Map<String, String> _context;
private String _facet;
+ private Ice.ProtocolVersion _protocol;
private Ice.EncodingVersion _encoding;
protected boolean _overrideCompress;
protected boolean _compress; // Only used if _overrideCompress == true
@@ -451,6 +482,7 @@ public abstract class Reference implements Cloneable
String facet,
int mode,
boolean secure,
+ Ice.ProtocolVersion protocol,
Ice.EncodingVersion encoding)
{
//
@@ -467,6 +499,7 @@ public abstract class Reference implements Cloneable
_identity = identity;
_context = _emptyContext;
_facet = facet;
+ _protocol = protocol;
_encoding = encoding;
_hashInitialized = false;
_overrideCompress = false;
diff --git a/java/src/IceInternal/ReferenceFactory.java b/java/src/IceInternal/ReferenceFactory.java
index 0d17f73b754..4ec3f1b9fba 100644
--- a/java/src/IceInternal/ReferenceFactory.java
+++ b/java/src/IceInternal/ReferenceFactory.java
@@ -19,7 +19,8 @@ public final class ReferenceFactory
return null;
}
- return create(ident, facet, tmpl.getMode(), tmpl.getSecure(), endpoints, null, null);
+ return create(ident, facet, tmpl.getMode(), tmpl.getSecure(), tmpl.getProtocol(), tmpl.getEncoding(),
+ endpoints, null, null);
}
public Reference
@@ -30,7 +31,8 @@ public final class ReferenceFactory
return null;
}
- return create(ident, facet, tmpl.getMode(), tmpl.getSecure(), null, adapterId, null);
+ return create(ident, facet, tmpl.getMode(), tmpl.getSecure(), tmpl.getProtocol(), tmpl.getEncoding(), null,
+ adapterId, null);
}
public Reference
@@ -41,8 +43,6 @@ public final class ReferenceFactory
return null;
}
- DefaultsAndOverrides defaultsAndOverrides = _instance.defaultsAndOverrides();
-
//
// Create new reference
//
@@ -53,7 +53,7 @@ public final class ReferenceFactory
"", // Facet
fixedConnection.endpoint().datagram() ? Reference.ModeDatagram : Reference.ModeTwoway,
fixedConnection.endpoint().secure(),
- defaultsAndOverrides.defaultEncoding,
+ _instance.defaultsAndOverrides().defaultEncoding,
fixedConnection);
return updateCache(ref);
}
@@ -163,6 +163,7 @@ public final class ReferenceFactory
String facet = "";
int mode = Reference.ModeTwoway;
boolean secure = false;
+ Ice.EncodingVersion encoding = _instance.defaultsAndOverrides().defaultEncoding;
String adapter = "";
while(true)
@@ -336,6 +337,25 @@ public final class ReferenceFactory
break;
}
+ case 'e':
+ {
+ if(argument == null)
+ {
+ throw new Ice.ProxyParseException("no argument provided for -e option in `" + s + "'");
+ }
+
+ try
+ {
+ encoding = Ice.Util.stringToEncodingVersion(argument);
+ }
+ catch(Ice.VersionParseException e)
+ {
+ throw new Ice.ProxyParseException("invalid encoding version `" + argument + "' in `" + s +
+ "':\n" + e.str);
+ }
+ break;
+ }
+
default:
{
Ice.ProxyParseException e = new Ice.ProxyParseException();
@@ -347,7 +367,7 @@ public final class ReferenceFactory
if(beg == -1)
{
- return create(ident, facet, mode, secure, null, null, propertyPrefix);
+ return create(ident, facet, mode, secure, Ice.Util.Protocol_1_0, encoding, null, null, propertyPrefix);
}
java.util.ArrayList<EndpointI> endpoints = new java.util.ArrayList<EndpointI>();
@@ -437,7 +457,7 @@ public final class ReferenceFactory
EndpointI[] endp = new EndpointI[endpoints.size()];
endpoints.toArray(endp);
- return create(ident, facet, mode, secure, endp, null, propertyPrefix);
+ return create(ident, facet, mode, secure, Ice.Util.Protocol_1_0, encoding, endp, null, propertyPrefix);
}
else if(s.charAt(beg) == '@')
{
@@ -496,7 +516,7 @@ public final class ReferenceFactory
e.str = "empty adapter id in `" + s + "'";
throw e;
}
- return create(ident, facet, mode, secure, null, adapter, propertyPrefix);
+ return create(ident, facet, mode, secure, Ice.Util.Protocol_1_0, encoding, null, adapter, propertyPrefix);
}
Ice.ProxyParseException ex = new Ice.ProxyParseException();
@@ -543,6 +563,21 @@ public final class ReferenceFactory
boolean secure = s.readBool();
+ Ice.ProtocolVersion protocol;
+ Ice.EncodingVersion encoding;
+ if(!s.getReadEncoding().equals(Ice.Util.Encoding_1_0))
+ {
+ protocol = new Ice.ProtocolVersion();
+ protocol.__read(s);
+ encoding = new Ice.EncodingVersion();
+ encoding.__read(s);
+ }
+ else
+ {
+ protocol = Ice.Util.Protocol_1_0;
+ encoding = Ice.Util.Encoding_1_0;
+ }
+
EndpointI[] endpoints = null;
String adapterId = null;
@@ -560,7 +595,7 @@ public final class ReferenceFactory
adapterId = s.readString();
}
- return create(ident, facet, mode, secure, endpoints, adapterId, null);
+ return create(ident, facet, mode, secure, protocol, encoding, endpoints, adapterId, null);
}
public ReferenceFactory
@@ -717,20 +752,31 @@ public final class ReferenceFactory
}
private Reference
- create(Ice.Identity ident, String facet, int mode, boolean secure, EndpointI[] endpoints, String adapterId,
- String propertyPrefix)
+ create(Ice.Identity ident, String facet, int mode, boolean secure, Ice.ProtocolVersion protocol,
+ Ice.EncodingVersion encoding, EndpointI[] endpoints, String adapterId, String propertyPrefix)
{
DefaultsAndOverrides defaultsAndOverrides = _instance.defaultsAndOverrides();
//
// Default local proxy options.
//
- LocatorInfo locatorInfo = _instance.locatorManager().get(_defaultLocator);
+ LocatorInfo locatorInfo = null;
+ if(_defaultLocator != null)
+ {
+ if(!((Ice.ObjectPrxHelperBase)_defaultLocator).__reference().getEncoding().equals(encoding))
+ {
+ locatorInfo = _instance.locatorManager().get(
+ (Ice.LocatorPrx)_defaultLocator.ice_encodingVersion(encoding));
+ }
+ else
+ {
+ locatorInfo = _instance.locatorManager().get(_defaultLocator);
+ }
+ }
RouterInfo routerInfo = _instance.routerManager().get(_defaultRouter);
boolean collocationOptimized = defaultsAndOverrides.defaultCollocationOptimization;
boolean cacheConnection = true;
boolean preferSecure = defaultsAndOverrides.defaultPreferSecure;
- Ice.EncodingVersion encoding = defaultsAndOverrides.defaultEncoding;
Ice.EndpointSelectionType endpointSelection = defaultsAndOverrides.defaultEndpointSelection;
int locatorCacheTimeout = defaultsAndOverrides.defaultLocatorCacheTimeout;
@@ -783,14 +829,6 @@ public final class ReferenceFactory
property = propertyPrefix + ".PreferSecure";
preferSecure = properties.getPropertyAsIntWithDefault(property, preferSecure ? 1 : 0) > 0;
- property = propertyPrefix + ".EncodingVersion";
- String encodingStr = properties.getProperty(property);
- if(!encodingStr.isEmpty())
- {
- encoding = Ice.Util.stringToEncodingVersion(encodingStr);
- Protocol.checkSupportedEncoding(encoding);
- }
-
property = propertyPrefix + ".EndpointSelection";
if(properties.getProperty(property).length() > 0)
{
@@ -823,6 +861,7 @@ public final class ReferenceFactory
facet,
mode,
secure,
+ protocol,
encoding,
endpoints,
adapterId,
diff --git a/java/src/IceInternal/RoutableReference.java b/java/src/IceInternal/RoutableReference.java
index 65933471a3d..98f3aacf236 100644
--- a/java/src/IceInternal/RoutableReference.java
+++ b/java/src/IceInternal/RoutableReference.java
@@ -72,6 +72,22 @@ public class RoutableReference extends Reference
}
public Reference
+ changeEncoding(Ice.EncodingVersion newEncoding)
+ {
+ RoutableReference r = (RoutableReference)super.changeEncoding(newEncoding);
+ if(r != this)
+ {
+ LocatorInfo locInfo = r._locatorInfo;
+ if(locInfo != null && !locInfo.getLocator().ice_getEncodingVersion().equals(newEncoding))
+ {
+ r._locatorInfo = getInstance().locatorManager().get(
+ (Ice.LocatorPrx)locInfo.getLocator().ice_encodingVersion(newEncoding));
+ }
+ }
+ return r;
+ }
+
+ public Reference
changeCompress(boolean newCompress)
{
RoutableReference r = (RoutableReference)super.changeCompress(newCompress);
@@ -334,7 +350,6 @@ public class RoutableReference extends Reference
properties.put(prefix + ".PreferSecure", _preferSecure ? "1" : "0");
properties.put(prefix + ".EndpointSelection",
_endpointSelection == Ice.EndpointSelectionType.Random ? "Random" : "Ordered");
- properties.put(prefix + ".EncodingVersion", Ice.Util.encodingVersionToString(getEncoding()));
StringBuffer s = new StringBuffer();
s.append(_locatorCacheTimeout);
@@ -630,6 +645,7 @@ public class RoutableReference extends Reference
String facet,
int mode,
boolean secure,
+ Ice.ProtocolVersion protocol,
Ice.EncodingVersion encoding,
EndpointI[] endpoints,
String adapterId,
@@ -641,7 +657,7 @@ public class RoutableReference extends Reference
Ice.EndpointSelectionType endpointSelection,
int locatorCacheTimeout)
{
- super(instance, communicator, identity, facet, mode, secure, encoding);
+ super(instance, communicator, identity, facet, mode, secure, protocol, encoding);
_endpoints = endpoints;
_adapterId = adapterId;
_locatorInfo = locatorInfo;
@@ -691,16 +707,13 @@ public class RoutableReference extends Reference
java.util.List<EndpointI> endpoints = new java.util.ArrayList<EndpointI>();
//
- // Filter out incompatible endpoints (whose encoding/protocol
- // versions aren't supported by this runtime, or are opaque).
+ // Filter out opaque endpoints.
//
- final Ice.EncodingVersion encoding = getEncoding();
- for(EndpointI p : allEndpoints)
+ for(EndpointI endpoint : allEndpoints)
{
- if(Protocol.isSupported(encoding, p.encodingVersion()) &&
- Protocol.isSupported(Protocol.currentProtocol, p.protocolVersion()))
+ if(!(endpoint instanceof IceInternal.OpaqueEndpointI))
{
- endpoints.add(p);
+ endpoints.add(endpoint);
}
}
diff --git a/java/src/IceInternal/TcpConnector.java b/java/src/IceInternal/TcpConnector.java
index 71503101dc5..1f7bc747880 100644
--- a/java/src/IceInternal/TcpConnector.java
+++ b/java/src/IceInternal/TcpConnector.java
@@ -68,24 +68,19 @@ final class TcpConnector implements Connector
//
// Only for use by TcpEndpoint
//
- TcpConnector(Instance instance, java.net.InetSocketAddress addr, int timeout, Ice.ProtocolVersion protocol,
- Ice.EncodingVersion encoding, String connectionId)
+ TcpConnector(Instance instance, java.net.InetSocketAddress addr, int timeout, String connectionId)
{
_instance = instance;
_traceLevels = instance.traceLevels();
_logger = instance.initializationData().logger;
_addr = addr;
_timeout = timeout;
- _protocol = protocol;
- _encoding = encoding;
_connectionId = connectionId;
_hashCode = 5381;
_hashCode = IceInternal.HashUtil.hashAdd(_hashCode , _addr.getAddress().getHostAddress());
_hashCode = IceInternal.HashUtil.hashAdd(_hashCode , _addr.getPort());
_hashCode = IceInternal.HashUtil.hashAdd(_hashCode , _timeout);
- _hashCode = IceInternal.HashUtil.hashAdd(_hashCode , _protocol);
- _hashCode = IceInternal.HashUtil.hashAdd(_hashCode , _encoding);
_hashCode = IceInternal.HashUtil.hashAdd(_hashCode , _connectionId);
}
@@ -108,16 +103,6 @@ final class TcpConnector implements Connector
return false;
}
- if(!_protocol.equals(p._protocol))
- {
- return false;
- }
-
- if(!_encoding.equals(p._encoding))
- {
- return false;
- }
-
if(!_connectionId.equals(p._connectionId))
{
return false;
@@ -131,8 +116,6 @@ final class TcpConnector implements Connector
private Ice.Logger _logger;
private java.net.InetSocketAddress _addr;
private int _timeout;
- private Ice.ProtocolVersion _protocol;
- private Ice.EncodingVersion _encoding;
private String _connectionId = "";
private int _hashCode;
}
diff --git a/java/src/IceInternal/TcpEndpointI.java b/java/src/IceInternal/TcpEndpointI.java
index 960ffed5b38..64a4a4822f7 100644
--- a/java/src/IceInternal/TcpEndpointI.java
+++ b/java/src/IceInternal/TcpEndpointI.java
@@ -12,10 +12,9 @@ package IceInternal;
final class TcpEndpointI extends EndpointI
{
public
- TcpEndpointI(Instance instance, String ho, int po, int ti, Ice.ProtocolVersion pv, Ice.EncodingVersion ev,
- String conId, boolean co)
+ TcpEndpointI(Instance instance, String ho, int po, int ti, String conId, boolean co)
{
- super(pv, ev, conId);
+ super(conId);
_instance = instance;
_host = ho;
_port = po;
@@ -27,7 +26,7 @@ final class TcpEndpointI extends EndpointI
public
TcpEndpointI(Instance instance, String str, boolean oaEndpoint)
{
- super(Protocol.currentProtocol, instance.defaultsAndOverrides().defaultEncoding, "");
+ super("");
_instance = instance;
_host = null;
_port = 0;
@@ -138,8 +137,7 @@ final class TcpEndpointI extends EndpointI
default:
{
- parseOption(option, argument, "tcp", str);
- break;
+ throw new Ice.EndpointParseException("unknown option `" + option + "' in `tcp " + str + "'");
}
}
}
@@ -171,25 +169,13 @@ final class TcpEndpointI extends EndpointI
public
TcpEndpointI(BasicStream s)
{
- super(new Ice.ProtocolVersion(), new Ice.EncodingVersion(), "");
+ super("");
_instance = s.instance();
s.startReadEncaps();
_host = s.readString();
_port = s.readInt();
_timeout = s.readInt();
_compress = s.readBool();
- if(!s.getReadEncoding().equals(Ice.Util.Encoding_1_0))
- {
- _protocol = new Ice.ProtocolVersion();
- _protocol.__read(s);
- _encoding = new Ice.EncodingVersion();
- _encoding.__read(s);
- }
- else
- {
- _protocol = Ice.Util.Protocol_1_0;
- _encoding = Ice.Util.Encoding_1_0;
- }
s.endReadEncaps();
calcHashValue();
}
@@ -206,11 +192,6 @@ final class TcpEndpointI extends EndpointI
s.writeInt(_port);
s.writeInt(_timeout);
s.writeBool(_compress);
- if(!s.getWriteEncoding().equals(Ice.Util.Encoding_1_0))
- {
- _protocol.__write(s);
- _encoding.__write(s);
- }
s.endWriteEncaps();
}
@@ -229,16 +210,6 @@ final class TcpEndpointI extends EndpointI
//
String s = "tcp";
- if(!_protocol.equals(Ice.Util.Protocol_1_0))
- {
- s += " -v " + Ice.Util.protocolVersionToString(_protocol);
- }
-
- if(!_encoding.equals(Ice.Util.Encoding_1_0))
- {
- s += " -e " + Ice.Util.encodingVersionToString(_encoding);
- }
-
if(_host != null && _host.length() > 0)
{
s += " -h ";
@@ -273,7 +244,7 @@ final class TcpEndpointI extends EndpointI
public Ice.EndpointInfo
getInfo()
{
- return new Ice.TCPEndpointInfo(_protocol, _encoding, _timeout, _compress, _host, _port)
+ return new Ice.TCPEndpointInfo(_timeout, _compress, _host, _port)
{
public short type()
{
@@ -334,7 +305,7 @@ final class TcpEndpointI extends EndpointI
}
else
{
- return new TcpEndpointI(_instance, _host, _port, timeout, _protocol, _encoding, _connectionId, _compress);
+ return new TcpEndpointI(_instance, _host, _port, timeout, _connectionId, _compress);
}
}
@@ -350,7 +321,7 @@ final class TcpEndpointI extends EndpointI
}
else
{
- return new TcpEndpointI(_instance, _host, _port, _timeout, _protocol, _encoding, connectionId, _compress);
+ return new TcpEndpointI(_instance, _host, _port, _timeout, connectionId, _compress);
}
}
@@ -378,7 +349,7 @@ final class TcpEndpointI extends EndpointI
}
else
{
- return new TcpEndpointI(_instance, _host, _port, _timeout, _protocol, _encoding, _connectionId, compress);
+ return new TcpEndpointI(_instance, _host, _port, _timeout, _connectionId, compress);
}
}
@@ -441,8 +412,7 @@ final class TcpEndpointI extends EndpointI
acceptor(EndpointIHolder endpoint, String adapterName)
{
TcpAcceptor p = new TcpAcceptor(_instance, _host, _port);
- endpoint.value = new TcpEndpointI(_instance, _host, p.effectivePort(), _timeout, _protocol, _encoding,
- _connectionId, _compress);
+ endpoint.value = new TcpEndpointI(_instance, _host, p.effectivePort(), _timeout, _connectionId, _compress);
return p;
}
@@ -463,8 +433,7 @@ final class TcpEndpointI extends EndpointI
{
for(String h : hosts)
{
- endps.add(new TcpEndpointI(_instance, h, _port, _timeout, _protocol, _encoding, _connectionId,
- _compress));
+ endps.add(new TcpEndpointI(_instance, h, _port, _timeout, _connectionId, _compress));
}
}
return endps;
@@ -551,7 +520,7 @@ final class TcpEndpointI extends EndpointI
java.util.List<Connector> connectors = new java.util.ArrayList<Connector>();
for(java.net.InetSocketAddress p : addresses)
{
- connectors.add(new TcpConnector(_instance, p, _timeout, _protocol, _encoding, _connectionId));
+ connectors.add(new TcpConnector(_instance, p, _timeout, _connectionId));
}
return connectors;
}
@@ -564,8 +533,6 @@ final class TcpEndpointI extends EndpointI
h = IceInternal.HashUtil.hashAdd(h, _host);
h = IceInternal.HashUtil.hashAdd(h, _port);
h = IceInternal.HashUtil.hashAdd(h, _timeout);
- h = IceInternal.HashUtil.hashAdd(h, _protocol);
- h = IceInternal.HashUtil.hashAdd(h, _encoding);
h = IceInternal.HashUtil.hashAdd(h, _connectionId);
h = IceInternal.HashUtil.hashAdd(h, _compress);
_hashCode = h;
diff --git a/java/src/IceInternal/UdpConnector.java b/java/src/IceInternal/UdpConnector.java
index 152e838dd58..3ca7d513080 100644
--- a/java/src/IceInternal/UdpConnector.java
+++ b/java/src/IceInternal/UdpConnector.java
@@ -46,22 +46,18 @@ final class UdpConnector implements Connector
// Only for use by TcpEndpoint
//
UdpConnector(Instance instance, java.net.InetSocketAddress addr, String mcastInterface, int mcastTtl,
- Ice.ProtocolVersion protocol, Ice.EncodingVersion encoding, String connectionId)
+ String connectionId)
{
_instance = instance;
_addr = addr;
_mcastInterface = mcastInterface;
_mcastTtl = mcastTtl;
- _protocol = protocol;
- _encoding = encoding;
_connectionId = connectionId;
_hashCode = 5381;
_hashCode = IceInternal.HashUtil.hashAdd(_hashCode , _addr.getAddress().getHostAddress());
_hashCode = IceInternal.HashUtil.hashAdd(_hashCode , _addr.getPort());
_hashCode = IceInternal.HashUtil.hashAdd(_hashCode , _mcastInterface);
- _hashCode = IceInternal.HashUtil.hashAdd(_hashCode , _protocol);
- _hashCode = IceInternal.HashUtil.hashAdd(_hashCode , _encoding);
_hashCode = IceInternal.HashUtil.hashAdd(_hashCode , _mcastTtl);
_hashCode = IceInternal.HashUtil.hashAdd(_hashCode , _connectionId);
}
@@ -85,16 +81,6 @@ final class UdpConnector implements Connector
return false;
}
- if(!_protocol.equals(p._protocol))
- {
- return false;
- }
-
- if(!_encoding.equals(p._encoding))
- {
- return false;
- }
-
if(_mcastTtl != p._mcastTtl)
{
return false;
@@ -112,8 +98,6 @@ final class UdpConnector implements Connector
private java.net.InetSocketAddress _addr;
private String _mcastInterface;
private int _mcastTtl;
- private Ice.ProtocolVersion _protocol;
- private Ice.EncodingVersion _encoding;
private String _connectionId;
private int _hashCode;
}
diff --git a/java/src/IceInternal/UdpEndpointI.java b/java/src/IceInternal/UdpEndpointI.java
index b47d941bf15..2398fc43c98 100644
--- a/java/src/IceInternal/UdpEndpointI.java
+++ b/java/src/IceInternal/UdpEndpointI.java
@@ -12,10 +12,9 @@ package IceInternal;
final class UdpEndpointI extends EndpointI
{
public
- UdpEndpointI(Instance instance, String ho, int po, String mif, int mttl, Ice.ProtocolVersion p,
- Ice.EncodingVersion e, boolean conn, String conId, boolean co)
+ UdpEndpointI(Instance instance, String ho, int po, String mif, int mttl, boolean conn, String conId, boolean co)
{
- super(p, e, conId);
+ super(conId);
_instance = instance;
_host = ho;
_port = po;
@@ -29,7 +28,7 @@ final class UdpEndpointI extends EndpointI
public
UdpEndpointI(Instance instance, String str, boolean oaEndpoint)
{
- super(Protocol.currentProtocol, instance.defaultsAndOverrides().defaultEncoding, "");
+ super("");
_instance = instance;
_host = null;
_port = 0;
@@ -120,6 +119,14 @@ final class UdpEndpointI extends EndpointI
_compress = true;
break;
}
+ else if(option == "-v")
+ {
+ _instance.initializationData().logger.warning("deprecated udp endpoint option: -v");
+ }
+ else if(option == "-e")
+ {
+ _instance.initializationData().logger.warning("deprecated udp endpoint option: -e");
+ }
else if(option.equals("--interface"))
{
if(argument == null)
@@ -156,7 +163,7 @@ final class UdpEndpointI extends EndpointI
}
else
{
- parseOption(option, argument, "udp", str);
+ throw new Ice.EndpointParseException("unknown option `" + option + "' in `udp " + str + "'");
}
}
@@ -187,13 +194,18 @@ final class UdpEndpointI extends EndpointI
public
UdpEndpointI(BasicStream s)
{
- super(new Ice.ProtocolVersion(), new Ice.EncodingVersion(), "");
+ super("");
_instance = s.instance();
s.startReadEncaps();
_host = s.readString();
_port = s.readInt();
- _protocol.__read(s);
- _encoding.__read(s);
+ if(s.getReadEncoding().equals(Ice.Util.Encoding_1_0))
+ {
+ s.readByte();
+ s.readByte();
+ s.readByte();
+ s.readByte();
+ }
// Not transmitted.
//_connect = s.readBool();
_connect = false;
@@ -212,8 +224,11 @@ final class UdpEndpointI extends EndpointI
s.startWriteEncaps();
s.writeString(_host);
s.writeInt(_port);
- _protocol.__write(s);
- _encoding.__write(s);
+ if(s.getWriteEncoding().equals(Ice.Util.Encoding_1_0))
+ {
+ Ice.Util.Protocol_1_0.__write(s);
+ Ice.Util.Encoding_1_0.__write(s);
+ }
// Not transmitted.
//s.writeBool(_connect);
s.writeBool(_compress);
@@ -235,16 +250,6 @@ final class UdpEndpointI extends EndpointI
//
String s = "udp";
- if(!_protocol.equals(Ice.Util.Protocol_1_0))
- {
- s += " -v " + Ice.Util.protocolVersionToString(_protocol);
- }
-
- if(!_encoding.equals(Ice.Util.Encoding_1_0))
- {
- s += " -e " + Ice.Util.encodingVersionToString(_encoding);
- }
-
if(_host != null && _host.length() > 0)
{
s += " -h ";
@@ -291,7 +296,7 @@ final class UdpEndpointI extends EndpointI
public Ice.EndpointInfo
getInfo()
{
- return new Ice.UDPEndpointInfo(_protocol, _encoding, -1, _compress, _host, _port, _mcastInterface, _mcastTtl)
+ return new Ice.UDPEndpointInfo(-1, _compress, _host, _port, _mcastInterface, _mcastTtl)
{
public short type()
{
@@ -362,8 +367,8 @@ final class UdpEndpointI extends EndpointI
}
else
{
- return new UdpEndpointI(_instance, _host, _port, _mcastInterface, _mcastTtl, _protocol, _encoding,
- _connect, _connectionId, compress);
+ return new UdpEndpointI(_instance, _host, _port, _mcastInterface, _mcastTtl, _connect, _connectionId,
+ compress);
}
}
@@ -379,8 +384,8 @@ final class UdpEndpointI extends EndpointI
}
else
{
- return new UdpEndpointI(_instance, _host, _port, _mcastInterface, _mcastTtl, _protocol, _encoding,
- _connect, connectionId, _compress);
+ return new UdpEndpointI(_instance, _host, _port, _mcastInterface, _mcastTtl, _connect, connectionId,
+ _compress);
}
}
@@ -425,7 +430,7 @@ final class UdpEndpointI extends EndpointI
{
UdpTransceiver p = new UdpTransceiver(_instance, _host, _port, _mcastInterface, _connect);
endpoint.value = new UdpEndpointI(_instance, _host, p.effectivePort(), _mcastInterface, _mcastTtl,
- _protocol, _encoding, _connect, _connectionId, _compress);
+ _connect, _connectionId, _compress);
return p;
}
@@ -477,8 +482,8 @@ final class UdpEndpointI extends EndpointI
{
for(String host : hosts)
{
- endps.add(new UdpEndpointI(_instance, host, _port, _mcastInterface, _mcastTtl,
- _protocol, _encoding, _connect, _connectionId, _compress));
+ endps.add(new UdpEndpointI(_instance, host, _port, _mcastInterface, _mcastTtl, _connect, _connectionId,
+ _compress));
}
}
return endps;
@@ -577,8 +582,7 @@ final class UdpEndpointI extends EndpointI
java.util.ArrayList<Connector> connectors = new java.util.ArrayList<Connector>();
for(java.net.InetSocketAddress p : addresses)
{
- connectors.add(new UdpConnector(_instance, p, _mcastInterface, _mcastTtl, _protocol, _encoding,
- _connectionId));
+ connectors.add(new UdpConnector(_instance, p, _mcastInterface, _mcastTtl, _connectionId));
}
return connectors;
}
@@ -593,8 +597,6 @@ final class UdpEndpointI extends EndpointI
h = IceInternal.HashUtil.hashAdd(h, _mcastInterface);
h = IceInternal.HashUtil.hashAdd(h, _mcastTtl);
h = IceInternal.HashUtil.hashAdd(h, _connect);
- h = IceInternal.HashUtil.hashAdd(h, _protocol);
- h = IceInternal.HashUtil.hashAdd(h, _encoding);
h = IceInternal.HashUtil.hashAdd(h, _connectionId);
h = IceInternal.HashUtil.hashAdd(h, _compress);
_hashCode = h;
diff --git a/java/src/IceSSL/ConnectorI.java b/java/src/IceSSL/ConnectorI.java
index 12db25b4f18..320640af36f 100644
--- a/java/src/IceSSL/ConnectorI.java
+++ b/java/src/IceSSL/ConnectorI.java
@@ -80,23 +80,19 @@ final class ConnectorI implements IceInternal.Connector
// Only for use by EndpointI.
//
ConnectorI(Instance instance, String host, java.net.InetSocketAddress addr, int timeout,
- Ice.ProtocolVersion protocol, Ice.EncodingVersion encoding, String connectionId)
+ String connectionId)
{
_instance = instance;
_logger = instance.communicator().getLogger();
_host = host;
_addr = addr;
_timeout = timeout;
- _protocol = protocol;
- _encoding = encoding;
_connectionId = connectionId;
_hashCode = 5381;
_hashCode = IceInternal.HashUtil.hashAdd(_hashCode , _addr.getAddress().getHostAddress());
_hashCode = IceInternal.HashUtil.hashAdd(_hashCode , _addr.getPort());
_hashCode = IceInternal.HashUtil.hashAdd(_hashCode , _timeout);
- _hashCode = IceInternal.HashUtil.hashAdd(_hashCode , _protocol);
- _hashCode = IceInternal.HashUtil.hashAdd(_hashCode , _encoding);
_hashCode = IceInternal.HashUtil.hashAdd(_hashCode , _connectionId);
}
@@ -119,16 +115,6 @@ final class ConnectorI implements IceInternal.Connector
return false;
}
- if(!_protocol.equals(p._protocol))
- {
- return false;
- }
-
- if(!_encoding.equals(p._encoding))
- {
- return false;
- }
-
if(!_connectionId.equals(p._connectionId))
{
return false;
@@ -142,8 +128,6 @@ final class ConnectorI implements IceInternal.Connector
private String _host;
private java.net.InetSocketAddress _addr;
private int _timeout;
- private Ice.ProtocolVersion _protocol;
- private Ice.EncodingVersion _encoding;
private String _connectionId;
private int _hashCode;
}
diff --git a/java/src/IceSSL/EndpointI.java b/java/src/IceSSL/EndpointI.java
index 9a004a04d38..99c94fb7997 100644
--- a/java/src/IceSSL/EndpointI.java
+++ b/java/src/IceSSL/EndpointI.java
@@ -12,10 +12,9 @@ package IceSSL;
final class EndpointI extends IceInternal.EndpointI
{
public
- EndpointI(Instance instance, String ho, int po, int ti, Ice.ProtocolVersion pv, Ice.EncodingVersion ev,
- String conId, boolean co)
+ EndpointI(Instance instance, String ho, int po, int ti, String conId, boolean co)
{
- super(pv, ev, conId);
+ super(conId);
_instance = instance;
_host = ho;
_port = po;
@@ -27,7 +26,7 @@ final class EndpointI extends IceInternal.EndpointI
public
EndpointI(Instance instance, String str, boolean oaEndpoint)
{
- super(IceInternal.Protocol.currentProtocol, instance.defaultEncoding(), "");
+ super("");
_instance = instance;
_host = null;
_port = 0;
@@ -138,7 +137,7 @@ final class EndpointI extends IceInternal.EndpointI
default:
{
- parseOption(option, argument, "ssl", str);
+ throw new Ice.EndpointParseException("unknown option `" + option + "' in `ssl " + str + "'");
}
}
}
@@ -170,23 +169,13 @@ final class EndpointI extends IceInternal.EndpointI
public
EndpointI(Instance instance, IceInternal.BasicStream s)
{
- super(new Ice.ProtocolVersion(), new Ice.EncodingVersion(), "");
+ super("");
_instance = instance;
s.startReadEncaps();
_host = s.readString();
_port = s.readInt();
_timeout = s.readInt();
_compress = s.readBool();
- if(!s.getReadEncoding().equals(Ice.Util.Encoding_1_0))
- {
- _protocol.__read(s);
- _encoding.__read(s);
- }
- else
- {
- _protocol = Ice.Util.Protocol_1_0;
- _encoding = Ice.Util.Encoding_1_0;
- }
s.endReadEncaps();
calcHashValue();
}
@@ -203,11 +192,6 @@ final class EndpointI extends IceInternal.EndpointI
s.writeInt(_port);
s.writeInt(_timeout);
s.writeBool(_compress);
- if(!s.getWriteEncoding().equals(Ice.Util.Encoding_1_0))
- {
- _protocol.__write(s);
- _encoding.__write(s);
- }
s.endWriteEncaps();
}
@@ -226,16 +210,6 @@ final class EndpointI extends IceInternal.EndpointI
//
String s = "ssl";
- if(!_protocol.equals(Ice.Util.Protocol_1_0))
- {
- s += " -v " + Ice.Util.protocolVersionToString(_protocol);
- }
-
- if(!_encoding.equals(Ice.Util.Encoding_1_0))
- {
- s += " -e " + Ice.Util.encodingVersionToString(_encoding);
- }
-
if(_host != null && _host.length() > 0)
{
s += " -h ";
@@ -270,7 +244,7 @@ final class EndpointI extends IceInternal.EndpointI
public Ice.EndpointInfo
getInfo()
{
- return new IceSSL.EndpointInfo(_protocol, _encoding, _timeout, _compress, _host, _port)
+ return new IceSSL.EndpointInfo(_timeout, _compress, _host, _port)
{
public short type()
{
@@ -331,7 +305,7 @@ final class EndpointI extends IceInternal.EndpointI
}
else
{
- return new EndpointI(_instance, _host, _port, timeout, _protocol, _encoding, _connectionId, _compress);
+ return new EndpointI(_instance, _host, _port, timeout, _connectionId, _compress);
}
}
@@ -347,7 +321,7 @@ final class EndpointI extends IceInternal.EndpointI
}
else
{
- return new EndpointI(_instance, _host, _port, _timeout, _protocol, _encoding, connectionId, _compress);
+ return new EndpointI(_instance, _host, _port, _timeout, connectionId, _compress);
}
}
@@ -375,7 +349,7 @@ final class EndpointI extends IceInternal.EndpointI
}
else
{
- return new EndpointI(_instance, _host, _port, _timeout, _protocol, _encoding, _connectionId, compress);
+ return new EndpointI(_instance, _host, _port, _timeout, _connectionId, compress);
}
}
@@ -438,8 +412,7 @@ final class EndpointI extends IceInternal.EndpointI
acceptor(IceInternal.EndpointIHolder endpoint, String adapterName)
{
AcceptorI p = new AcceptorI(_instance, adapterName, _host, _port);
- endpoint.value = new EndpointI(_instance, _host, p.effectivePort(), _timeout, _protocol, _encoding,
- _connectionId, _compress);
+ endpoint.value = new EndpointI(_instance, _host, p.effectivePort(), _timeout, _connectionId, _compress);
return p;
}
@@ -461,8 +434,7 @@ final class EndpointI extends IceInternal.EndpointI
{
for(String host : hosts)
{
- endps.add(new EndpointI(_instance, host, _port, _timeout, _protocol, _encoding, _connectionId,
- _compress));
+ endps.add(new EndpointI(_instance, host, _port, _timeout, _connectionId, _compress));
}
}
return endps;
@@ -549,7 +521,7 @@ final class EndpointI extends IceInternal.EndpointI
java.util.List<IceInternal.Connector> connectors = new java.util.ArrayList<IceInternal.Connector>();
for(java.net.InetSocketAddress p : addresses)
{
- connectors.add(new ConnectorI(_instance, _host, p, _timeout, _protocol, _encoding, _connectionId));
+ connectors.add(new ConnectorI(_instance, _host, p, _timeout, _connectionId));
}
return connectors;
}
@@ -562,8 +534,6 @@ final class EndpointI extends IceInternal.EndpointI
h = IceInternal.HashUtil.hashAdd(h, _host);
h = IceInternal.HashUtil.hashAdd(h, _port);
h = IceInternal.HashUtil.hashAdd(h, _timeout);
- h = IceInternal.HashUtil.hashAdd(h, _protocol);
- h = IceInternal.HashUtil.hashAdd(h, _encoding);
h = IceInternal.HashUtil.hashAdd(h, _connectionId);
h = IceInternal.HashUtil.hashAdd(h, _compress);
_hashCode = h;