summaryrefslogtreecommitdiff
path: root/java
diff options
context:
space:
mode:
authorDwayne Boone <dwayne@zeroc.com>2007-06-12 12:13:29 -0230
committerDwayne Boone <dwayne@zeroc.com>2007-06-12 12:13:29 -0230
commit4cf00523c0fcccfcfb3859467bb546d96201e65e (patch)
tree23df49beb9d9b737e7193a755dfd44e862859fd0 /java
parentFixed bug 2220 (diff)
downloadice-4cf00523c0fcccfcfb3859467bb546d96201e65e.tar.bz2
ice-4cf00523c0fcccfcfb3859467bb546d96201e65e.tar.xz
ice-4cf00523c0fcccfcfb3859467bb546d96201e65e.zip
Bug 1658 - minor refactoring
Diffstat (limited to 'java')
-rw-r--r--java/src/Ice/ObjectAdapterI.java2
-rw-r--r--java/src/IceInternal/EndpointFactory.java2
-rw-r--r--java/src/IceInternal/EndpointI.java2
-rw-r--r--java/src/IceInternal/ReferenceFactory.java2
-rw-r--r--java/src/IceInternal/TcpEndpointFactory.java4
-rw-r--r--java/src/IceInternal/TcpEndpointI.java26
-rw-r--r--java/src/IceInternal/UdpEndpointFactory.java4
-rw-r--r--java/src/IceInternal/UdpEndpointI.java23
-rw-r--r--java/src/IceInternal/UnknownEndpointI.java2
-rw-r--r--java/ssl/jdk1.4/IceSSL/EndpointFactoryI.java4
-rw-r--r--java/ssl/jdk1.4/IceSSL/EndpointI.java25
-rw-r--r--java/ssl/jdk1.5/IceSSL/EndpointFactoryI.java4
-rw-r--r--java/ssl/jdk1.5/IceSSL/EndpointI.java25
13 files changed, 52 insertions, 73 deletions
diff --git a/java/src/Ice/ObjectAdapterI.java b/java/src/Ice/ObjectAdapterI.java
index 2026e900e77..641a1f4b171 100644
--- a/java/src/Ice/ObjectAdapterI.java
+++ b/java/src/Ice/ObjectAdapterI.java
@@ -1175,7 +1175,7 @@ public final class ObjectAdapterI implements ObjectAdapter
while(p.hasNext())
{
IceInternal.EndpointI endp = (IceInternal.EndpointI)p.next();
- java.util.ArrayList endps = endp.expand();
+ java.util.ArrayList endps = endp.expand(false);
expandedEndpoints.addAll(endps);
}
return expandedEndpoints;
diff --git a/java/src/IceInternal/EndpointFactory.java b/java/src/IceInternal/EndpointFactory.java
index 2a55a48a32a..05d05f48e25 100644
--- a/java/src/IceInternal/EndpointFactory.java
+++ b/java/src/IceInternal/EndpointFactory.java
@@ -13,7 +13,7 @@ public interface EndpointFactory
{
short type();
String protocol();
- EndpointI create(String str, boolean oaEndpoint);
+ EndpointI create(String str, boolean server);
EndpointI read(BasicStream s);
void destroy();
}
diff --git a/java/src/IceInternal/EndpointI.java b/java/src/IceInternal/EndpointI.java
index 92924847234..16f18d73ac6 100644
--- a/java/src/IceInternal/EndpointI.java
+++ b/java/src/IceInternal/EndpointI.java
@@ -114,7 +114,7 @@ abstract public class EndpointI implements Ice.Endpoint, java.lang.Comparable
// Expand endpoint out in to separate endpoints for each local
// host if endpoint was configured with no host set.
//
- public abstract java.util.ArrayList expand();
+ public abstract java.util.ArrayList expand(boolean includeLoopback);
//
// Check whether the endpoint is equivalent to a specific
diff --git a/java/src/IceInternal/ReferenceFactory.java b/java/src/IceInternal/ReferenceFactory.java
index 06864aa2092..f235e382683 100644
--- a/java/src/IceInternal/ReferenceFactory.java
+++ b/java/src/IceInternal/ReferenceFactory.java
@@ -428,7 +428,7 @@ public final class ReferenceFactory
EndpointI endp = _instance.endpointFactoryManager().create(es, false);
if(endp != null)
{
- java.util.ArrayList endps = endp.expand();
+ java.util.ArrayList endps = endp.expand(true);
endpoints.addAll(endps);
}
else
diff --git a/java/src/IceInternal/TcpEndpointFactory.java b/java/src/IceInternal/TcpEndpointFactory.java
index 1bc9e326d66..7fb5572e391 100644
--- a/java/src/IceInternal/TcpEndpointFactory.java
+++ b/java/src/IceInternal/TcpEndpointFactory.java
@@ -29,9 +29,9 @@ final class TcpEndpointFactory implements EndpointFactory
}
public EndpointI
- create(String str, boolean oaEndpoint)
+ create(String str, boolean server)
{
- return new TcpEndpointI(_instance, str, oaEndpoint);
+ return new TcpEndpointI(_instance, str, server);
}
public EndpointI
diff --git a/java/src/IceInternal/TcpEndpointI.java b/java/src/IceInternal/TcpEndpointI.java
index ecdbd544d28..5ec1cba6a60 100644
--- a/java/src/IceInternal/TcpEndpointI.java
+++ b/java/src/IceInternal/TcpEndpointI.java
@@ -14,7 +14,7 @@ final class TcpEndpointI extends EndpointI
final static short TYPE = 1;
public
- TcpEndpointI(Instance instance, String ho, int po, int ti, String conId, boolean co, boolean oae)
+ TcpEndpointI(Instance instance, String ho, int po, int ti, String conId, boolean co)
{
_instance = instance;
_host = ho;
@@ -22,19 +22,17 @@ final class TcpEndpointI extends EndpointI
_timeout = ti;
_connectionId = conId;
_compress = co;
- _oaEndpoint = oae;
calcHashValue();
}
public
- TcpEndpointI(Instance instance, String str, boolean oaEndpoint)
+ TcpEndpointI(Instance instance, String str, boolean server)
{
_instance = instance;
_host = null;
_port = 0;
_timeout = -1;
_compress = false;
- _oaEndpoint = oaEndpoint;
String[] arr = str.split("[ \t\n\r]+");
@@ -138,7 +136,7 @@ final class TcpEndpointI extends EndpointI
_host = _instance.defaultsAndOverrides().defaultHost;
if(_host == null)
{
- if(_oaEndpoint)
+ if(server)
{
_host = "0.0.0.0";
}
@@ -165,7 +163,6 @@ final class TcpEndpointI extends EndpointI
_timeout = s.readInt();
_compress = s.readBool();
s.endReadEncaps();
- _oaEndpoint = false;
calcHashValue();
}
@@ -242,7 +239,7 @@ final class TcpEndpointI extends EndpointI
}
else
{
- return new TcpEndpointI(_instance, _host, _port, timeout, _connectionId, _compress, _oaEndpoint);
+ return new TcpEndpointI(_instance, _host, _port, timeout, _connectionId, _compress);
}
}
@@ -258,7 +255,7 @@ final class TcpEndpointI extends EndpointI
}
else
{
- return new TcpEndpointI(_instance, _host, _port, _timeout, connectionId, _compress, _oaEndpoint);
+ return new TcpEndpointI(_instance, _host, _port, _timeout, connectionId, _compress);
}
}
@@ -286,7 +283,7 @@ final class TcpEndpointI extends EndpointI
}
else
{
- return new TcpEndpointI(_instance, _host, _port, _timeout, _connectionId, compress, _oaEndpoint);
+ return new TcpEndpointI(_instance, _host, _port, _timeout, _connectionId, compress);
}
}
@@ -359,8 +356,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, _connectionId,
- _compress, _oaEndpoint);
+ endpoint.value = new TcpEndpointI(_instance, _host, p.effectivePort(), _timeout, _connectionId, _compress);
return p;
}
@@ -369,7 +365,7 @@ final class TcpEndpointI extends EndpointI
// host if endpoint was configured with no host set.
//
public java.util.ArrayList
- expand()
+ expand(boolean includeLoopback)
{
java.util.ArrayList endps = new java.util.ArrayList();
if(_host.equals("0.0.0.0"))
@@ -379,10 +375,9 @@ final class TcpEndpointI extends EndpointI
while(iter.hasNext())
{
String host = (String)iter.next();
- if(!_oaEndpoint || hosts.size() == 1 || !host.equals("127.0.0.1"))
+ if(includeLoopback || hosts.size() == 1 || !host.equals("127.0.0.1"))
{
- endps.add(new TcpEndpointI(_instance, host, _port, _timeout, _connectionId, _compress,
- _oaEndpoint));
+ endps.add(new TcpEndpointI(_instance, host, _port, _timeout, _connectionId, _compress));
}
}
}
@@ -525,6 +520,5 @@ final class TcpEndpointI extends EndpointI
private int _timeout;
private String _connectionId = "";
private boolean _compress;
- private boolean _oaEndpoint;
private int _hashCode;
}
diff --git a/java/src/IceInternal/UdpEndpointFactory.java b/java/src/IceInternal/UdpEndpointFactory.java
index 76a98188408..767f803b17c 100644
--- a/java/src/IceInternal/UdpEndpointFactory.java
+++ b/java/src/IceInternal/UdpEndpointFactory.java
@@ -29,9 +29,9 @@ final class UdpEndpointFactory implements EndpointFactory
}
public EndpointI
- create(String str, boolean oaEndpoint)
+ create(String str, boolean server)
{
- return new UdpEndpointI(_instance, str, oaEndpoint);
+ return new UdpEndpointI(_instance, str, server);
}
public EndpointI
diff --git a/java/src/IceInternal/UdpEndpointI.java b/java/src/IceInternal/UdpEndpointI.java
index 30fbdfdb1c1..5e65053e752 100644
--- a/java/src/IceInternal/UdpEndpointI.java
+++ b/java/src/IceInternal/UdpEndpointI.java
@@ -14,8 +14,7 @@ final class UdpEndpointI extends EndpointI
final static short TYPE = 3;
public
- UdpEndpointI(Instance instance, String ho, int po, String mif, int mttl, boolean conn, String conId, boolean co,
- boolean oae)
+ UdpEndpointI(Instance instance, String ho, int po, String mif, int mttl, boolean conn, String conId, boolean co)
{
_instance = instance;
_host = ho;
@@ -29,12 +28,11 @@ final class UdpEndpointI extends EndpointI
_connect = conn;
_connectionId = conId;
_compress = co;
- _oaEndpoint = oae;
calcHashValue();
}
public
- UdpEndpointI(Instance instance, String str, boolean oaEndpoint)
+ UdpEndpointI(Instance instance, String str, boolean server)
{
_instance = instance;
_host = null;
@@ -45,7 +43,6 @@ final class UdpEndpointI extends EndpointI
_encodingMinor = Protocol.encodingMinor;
_connect = false;
_compress = false;
- _oaEndpoint = oaEndpoint;
String[] arr = str.split("[ \t\n\r]+");
@@ -251,7 +248,7 @@ final class UdpEndpointI extends EndpointI
_host = _instance.defaultsAndOverrides().defaultHost;
if(_host == null)
{
- if(_oaEndpoint)
+ if(server)
{
_host = "0.0.0.0";
}
@@ -302,7 +299,6 @@ final class UdpEndpointI extends EndpointI
_connect = false;
_compress = s.readBool();
s.endReadEncaps();
- _oaEndpoint = false;
calcHashValue();
}
@@ -422,7 +418,7 @@ final class UdpEndpointI extends EndpointI
else
{
return new UdpEndpointI(_instance, _host, _port, _mcastInterface, _mcastTtl, _connect, _connectionId,
- compress, _oaEndpoint);
+ compress);
}
}
@@ -439,7 +435,7 @@ final class UdpEndpointI extends EndpointI
else
{
return new UdpEndpointI(_instance, _host, _port, _mcastInterface, _mcastTtl, _connect, connectionId,
- _compress, _oaEndpoint);
+ _compress);
}
}
@@ -493,7 +489,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, _connect,
- _connectionId, _compress, _oaEndpoint);
+ _connectionId, _compress);
return p;
}
@@ -535,7 +531,7 @@ final class UdpEndpointI extends EndpointI
// host if endpoint was configured with no host set.
//
public java.util.ArrayList
- expand()
+ expand(boolean includeLoopback)
{
java.util.ArrayList endps = new java.util.ArrayList();
if(_host.equals("0.0.0.0"))
@@ -545,10 +541,10 @@ final class UdpEndpointI extends EndpointI
while(iter.hasNext())
{
String host = (String)iter.next();
- if(!_oaEndpoint || hosts.size() == 1 || !host.equals("127.0.0.1"))
+ if(includeLoopback || hosts.size() == 1 || !host.equals("127.0.0.1"))
{
endps.add(new UdpEndpointI(_instance, host, _port, _mcastInterface, _mcastTtl, _connect,
- _connectionId, _compress, _oaEndpoint));
+ _connectionId, _compress));
}
}
}
@@ -750,6 +746,5 @@ final class UdpEndpointI extends EndpointI
private boolean _connect;
private String _connectionId = "";
private boolean _compress;
- private boolean _oaEndpoint;
private int _hashCode;
}
diff --git a/java/src/IceInternal/UnknownEndpointI.java b/java/src/IceInternal/UnknownEndpointI.java
index 82518ed810b..9911f372110 100644
--- a/java/src/IceInternal/UnknownEndpointI.java
+++ b/java/src/IceInternal/UnknownEndpointI.java
@@ -263,7 +263,7 @@ final class UnknownEndpointI extends EndpointI
// host if endpoint was configured with no host set.
//
public java.util.ArrayList
- expand()
+ expand(boolean includeLoopback)
{
java.util.ArrayList endps = new java.util.ArrayList();
endps.add(this);
diff --git a/java/ssl/jdk1.4/IceSSL/EndpointFactoryI.java b/java/ssl/jdk1.4/IceSSL/EndpointFactoryI.java
index 9b8cc99309e..41f1d1eb12c 100644
--- a/java/ssl/jdk1.4/IceSSL/EndpointFactoryI.java
+++ b/java/ssl/jdk1.4/IceSSL/EndpointFactoryI.java
@@ -29,9 +29,9 @@ final class EndpointFactoryI implements IceInternal.EndpointFactory
}
public IceInternal.EndpointI
- create(String str, boolean oaEndpoint)
+ create(String str, boolean server)
{
- return new EndpointI(_instance, str, oaEndpoint);
+ return new EndpointI(_instance, str, server);
}
public IceInternal.EndpointI
diff --git a/java/ssl/jdk1.4/IceSSL/EndpointI.java b/java/ssl/jdk1.4/IceSSL/EndpointI.java
index 5c4f7152c70..90b8e7b35a2 100644
--- a/java/ssl/jdk1.4/IceSSL/EndpointI.java
+++ b/java/ssl/jdk1.4/IceSSL/EndpointI.java
@@ -14,7 +14,7 @@ final class EndpointI extends IceInternal.EndpointI
final static short TYPE = 2;
public
- EndpointI(Instance instance, String ho, int po, int ti, String conId, boolean co, boolean oae)
+ EndpointI(Instance instance, String ho, int po, int ti, String conId, boolean co)
{
_instance = instance;
_host = ho;
@@ -22,19 +22,17 @@ final class EndpointI extends IceInternal.EndpointI
_timeout = ti;
_connectionId = conId;
_compress = co;
- _oaEndpoint = oae;
calcHashValue();
}
public
- EndpointI(Instance instance, String str, boolean oaEndpoint)
+ EndpointI(Instance instance, String str, boolean server)
{
_instance = instance;
_host = null;
_port = 0;
_timeout = -1;
_compress = false;
- _oaEndpoint = oaEndpoint;
String[] arr = str.split("[ \t\n\r]+");
@@ -138,7 +136,7 @@ final class EndpointI extends IceInternal.EndpointI
_host = _instance.defaultHost();
if(_host == null)
{
- if(_oaEndpoint)
+ if(server)
{
_host = "0.0.0.0";
}
@@ -165,7 +163,6 @@ final class EndpointI extends IceInternal.EndpointI
_timeout = s.readInt();
_compress = s.readBool();
s.endReadEncaps();
- _oaEndpoint = false;
calcHashValue();
}
@@ -242,7 +239,7 @@ final class EndpointI extends IceInternal.EndpointI
}
else
{
- return new EndpointI(_instance, _host, _port, timeout, _connectionId, _compress, _oaEndpoint);
+ return new EndpointI(_instance, _host, _port, timeout, _connectionId, _compress);
}
}
@@ -258,7 +255,7 @@ final class EndpointI extends IceInternal.EndpointI
}
else
{
- return new EndpointI(_instance, _host, _port, _timeout, connectionId, _compress, _oaEndpoint);
+ return new EndpointI(_instance, _host, _port, _timeout, connectionId, _compress);
}
}
@@ -286,7 +283,7 @@ final class EndpointI extends IceInternal.EndpointI
}
else
{
- return new EndpointI(_instance, _host, _port, _timeout, _connectionId, compress, _oaEndpoint);
+ return new EndpointI(_instance, _host, _port, _timeout, _connectionId, compress);
}
}
@@ -359,8 +356,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, _connectionId, _compress,
- _oaEndpoint);
+ endpoint.value = new EndpointI(_instance, _host, p.effectivePort(), _timeout, _connectionId, _compress);
return p;
}
@@ -369,7 +365,7 @@ final class EndpointI extends IceInternal.EndpointI
// host if endpoint was configured with no host set.
//
public java.util.ArrayList
- expand()
+ expand(boolean includeLoopback)
{
java.util.ArrayList endps = new java.util.ArrayList();
if(_host.equals("0.0.0.0"))
@@ -379,9 +375,9 @@ final class EndpointI extends IceInternal.EndpointI
while(iter.hasNext())
{
String host = (String)iter.next();
- if(!_oaEndpoint || hosts.size() == 1 || !host.equals("127.0.0.1"))
+ if(includeLoopback || hosts.size() == 1 || !host.equals("127.0.0.1"))
{
- endps.add(new EndpointI(_instance, host, _port, _timeout, _connectionId, _compress, _oaEndpoint));
+ endps.add(new EndpointI(_instance, host, _port, _timeout, _connectionId, _compress));
}
}
@@ -525,6 +521,5 @@ final class EndpointI extends IceInternal.EndpointI
private int _timeout;
private String _connectionId = "";
private boolean _compress;
- private boolean _oaEndpoint;
private int _hashCode;
}
diff --git a/java/ssl/jdk1.5/IceSSL/EndpointFactoryI.java b/java/ssl/jdk1.5/IceSSL/EndpointFactoryI.java
index 9b8cc99309e..41f1d1eb12c 100644
--- a/java/ssl/jdk1.5/IceSSL/EndpointFactoryI.java
+++ b/java/ssl/jdk1.5/IceSSL/EndpointFactoryI.java
@@ -29,9 +29,9 @@ final class EndpointFactoryI implements IceInternal.EndpointFactory
}
public IceInternal.EndpointI
- create(String str, boolean oaEndpoint)
+ create(String str, boolean server)
{
- return new EndpointI(_instance, str, oaEndpoint);
+ return new EndpointI(_instance, str, server);
}
public IceInternal.EndpointI
diff --git a/java/ssl/jdk1.5/IceSSL/EndpointI.java b/java/ssl/jdk1.5/IceSSL/EndpointI.java
index a2ffea8f4d6..3eb98331905 100644
--- a/java/ssl/jdk1.5/IceSSL/EndpointI.java
+++ b/java/ssl/jdk1.5/IceSSL/EndpointI.java
@@ -14,7 +14,7 @@ final class EndpointI extends IceInternal.EndpointI
final static short TYPE = 2;
public
- EndpointI(Instance instance, String ho, int po, int ti, String conId, boolean co, boolean oae)
+ EndpointI(Instance instance, String ho, int po, int ti, String conId, boolean co)
{
_instance = instance;
_host = ho;
@@ -22,19 +22,17 @@ final class EndpointI extends IceInternal.EndpointI
_timeout = ti;
_connectionId = conId;
_compress = co;
- _oaEndpoint = oae;
calcHashValue();
}
public
- EndpointI(Instance instance, String str, boolean oaEndpoint)
+ EndpointI(Instance instance, String str, boolean server)
{
_instance = instance;
_host = null;
_port = 0;
_timeout = -1;
_compress = false;
- _oaEndpoint = oaEndpoint;
String[] arr = str.split("[ \t\n\r]+");
@@ -138,7 +136,7 @@ final class EndpointI extends IceInternal.EndpointI
_host = _instance.defaultHost();
if(_host == null)
{
- if(_oaEndpoint)
+ if(server)
{
_host = "0.0.0.0";
}
@@ -165,7 +163,6 @@ final class EndpointI extends IceInternal.EndpointI
_timeout = s.readInt();
_compress = s.readBool();
s.endReadEncaps();
- _oaEndpoint = false;
calcHashValue();
}
@@ -242,7 +239,7 @@ final class EndpointI extends IceInternal.EndpointI
}
else
{
- return new EndpointI(_instance, _host, _port, timeout, _connectionId, _compress, _oaEndpoint);
+ return new EndpointI(_instance, _host, _port, timeout, _connectionId, _compress);
}
}
@@ -258,7 +255,7 @@ final class EndpointI extends IceInternal.EndpointI
}
else
{
- return new EndpointI(_instance, _host, _port, _timeout, connectionId, _compress, _oaEndpoint);
+ return new EndpointI(_instance, _host, _port, _timeout, connectionId, _compress);
}
}
@@ -286,7 +283,7 @@ final class EndpointI extends IceInternal.EndpointI
}
else
{
- return new EndpointI(_instance, _host, _port, _timeout, _connectionId, compress, _oaEndpoint);
+ return new EndpointI(_instance, _host, _port, _timeout, _connectionId, compress);
}
}
@@ -359,8 +356,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, _connectionId, _compress,
- _oaEndpoint);
+ endpoint.value = new EndpointI(_instance, _host, p.effectivePort(), _timeout, _connectionId, _compress);
return p;
}
@@ -369,7 +365,7 @@ final class EndpointI extends IceInternal.EndpointI
// host if endpoint was configured with no host set.
//
public java.util.ArrayList
- expand()
+ expand(boolean includeLoopback)
{
java.util.ArrayList endps = new java.util.ArrayList();
if(_host.equals("0.0.0.0"))
@@ -379,9 +375,9 @@ final class EndpointI extends IceInternal.EndpointI
while(iter.hasNext())
{
String host = (String)iter.next();
- if(!_oaEndpoint || hosts.size() == 1 || !host.equals("127.0.0.1"))
+ if(includeLoopback || hosts.size() == 1 || !host.equals("127.0.0.1"))
{
- endps.add(new EndpointI(_instance, host, _port, _timeout, _connectionId, _compress, _oaEndpoint));
+ endps.add(new EndpointI(_instance, host, _port, _timeout, _connectionId, _compress));
}
}
@@ -525,6 +521,5 @@ final class EndpointI extends IceInternal.EndpointI
private int _timeout;
private String _connectionId = "";
private boolean _compress;
- private boolean _oaEndpoint;
private int _hashCode;
}