summaryrefslogtreecommitdiff
path: root/java-compat/src/Ice/src/main/java/IceInternal/IncomingConnectionFactory.java
diff options
context:
space:
mode:
Diffstat (limited to 'java-compat/src/Ice/src/main/java/IceInternal/IncomingConnectionFactory.java')
-rw-r--r--java-compat/src/Ice/src/main/java/IceInternal/IncomingConnectionFactory.java27
1 files changed, 24 insertions, 3 deletions
diff --git a/java-compat/src/Ice/src/main/java/IceInternal/IncomingConnectionFactory.java b/java-compat/src/Ice/src/main/java/IceInternal/IncomingConnectionFactory.java
index 1e031a86cde..9d830960d75 100644
--- a/java-compat/src/Ice/src/main/java/IceInternal/IncomingConnectionFactory.java
+++ b/java-compat/src/Ice/src/main/java/IceInternal/IncomingConnectionFactory.java
@@ -169,11 +169,30 @@ public final class IncomingConnectionFactory extends EventHandler implements Ice
}
}
+ public boolean
+ isLocal(EndpointI endpoint)
+ {
+ if(_publishedEndpoint != null && endpoint.equivalent(_publishedEndpoint))
+ {
+ return true;
+ }
+ synchronized(this)
+ {
+ return endpoint.equivalent(_endpoint);
+ }
+ }
+
public EndpointI
endpoint()
{
- // No mutex protection necessary, _endpoint is immutable.
- return _endpoint;
+ if(_publishedEndpoint != null)
+ {
+ return _publishedEndpoint;
+ }
+ synchronized(this)
+ {
+ return _endpoint;
+ }
}
public synchronized java.util.LinkedList<Ice.ConnectionI>
@@ -420,10 +439,11 @@ public final class IncomingConnectionFactory extends EventHandler implements Ice
}
public
- IncomingConnectionFactory(Instance instance, EndpointI endpoint, Ice.ObjectAdapterI adapter)
+ IncomingConnectionFactory(Instance instance, EndpointI endpoint, EndpointI publish, Ice.ObjectAdapterI adapter)
{
_instance = instance;
_endpoint = endpoint;
+ _publishedEndpoint = publish;
_adapter = adapter;
_warn = _instance.initializationData().properties.getPropertyAsInt("Ice.Warn.Connections") > 0 ? true : false;
_state = StateHolding;
@@ -718,6 +738,7 @@ public final class IncomingConnectionFactory extends EventHandler implements Ice
private Acceptor _acceptor;
private Transceiver _transceiver;
private EndpointI _endpoint;
+ private final EndpointI _publishedEndpoint;
private Ice.ObjectAdapterI _adapter;