summaryrefslogtreecommitdiff
path: root/java/src/IceInternal/DirectReference.java
diff options
context:
space:
mode:
Diffstat (limited to 'java/src/IceInternal/DirectReference.java')
-rw-r--r--java/src/IceInternal/DirectReference.java55
1 files changed, 38 insertions, 17 deletions
diff --git a/java/src/IceInternal/DirectReference.java b/java/src/IceInternal/DirectReference.java
index 1a0893281a3..67565c6adcc 100644
--- a/java/src/IceInternal/DirectReference.java
+++ b/java/src/IceInternal/DirectReference.java
@@ -19,7 +19,7 @@ public class DirectReference extends RoutableReference
String fs,
int md,
boolean sec,
- Endpoint[] endpts,
+ EndpointI[] endpts,
RouterInfo rtrInfo,
boolean collocationOpt)
{
@@ -27,21 +27,16 @@ public class DirectReference extends RoutableReference
_endpoints = endpts;
}
- public Endpoint[] getEndpoints()
+ public String
+ getAdapterId()
{
- return _endpoints;
+ return "";
}
- public final Reference
- changeEndpoints(Endpoint[] newEndpoints)
+ public EndpointI[]
+ getEndpoints()
{
- if(compare(newEndpoints, _endpoints))
- {
- return this;
- }
- DirectReference r = (DirectReference)getInstance().referenceFactory().copy(this);
- r._endpoints = newEndpoints;
- return r;
+ return _endpoints;
}
public Reference
@@ -83,7 +78,7 @@ public class DirectReference extends RoutableReference
changeCompress(boolean newCompress)
{
DirectReference r = (DirectReference)getInstance().referenceFactory().copy(this);
- Endpoint[] newEndpoints = new Endpoint[_endpoints.length];
+ EndpointI[] newEndpoints = new EndpointI[_endpoints.length];
for(int i = 0; i < _endpoints.length; i++)
{
newEndpoints[i] = _endpoints[i].compress(newCompress);
@@ -96,7 +91,7 @@ public class DirectReference extends RoutableReference
changeTimeout(int newTimeout)
{
DirectReference r = (DirectReference)getInstance().referenceFactory().copy(this);
- Endpoint[] newEndpoints = new Endpoint[_endpoints.length];
+ EndpointI[] newEndpoints = new EndpointI[_endpoints.length];
for(int i = 0; i < _endpoints.length; i++)
{
newEndpoints[i] = _endpoints[i].timeout(newTimeout);
@@ -105,6 +100,32 @@ public class DirectReference extends RoutableReference
return r;
}
+ public Reference
+ changeAdapterId(String newAdapterId)
+ {
+ if(newAdapterId == null || newAdapterId.length() == 0)
+ {
+ return this;
+ }
+ LocatorInfo locatorInfo =
+ getInstance().locatorManager().get(getInstance().referenceFactory().getDefaultLocator());
+ return getInstance().referenceFactory().create(getIdentity(), getContext(), getFacet(), getMode(),
+ getSecure(), newAdapterId, getRouterInfo(), locatorInfo,
+ getCollocationOptimization());
+ }
+
+ public Reference
+ changeEndpoints(EndpointI[] newEndpoints)
+ {
+ if(compare(newEndpoints, _endpoints))
+ {
+ return this;
+ }
+ DirectReference r = (DirectReference)getInstance().referenceFactory().copy(this);
+ r._endpoints = newEndpoints;
+ return r;
+ }
+
public void
streamWrite(BasicStream s)
throws Ice.MarshalException
@@ -146,12 +167,12 @@ public class DirectReference extends RoutableReference
public Ice.ConnectionI
getConnection(Ice.BooleanHolder comp)
{
- Endpoint[] endpts = super.getRoutedEndpoints();
+ EndpointI[] endpts = super.getRoutedEndpoints();
if(endpts.length == 0)
{
endpts = _endpoints;
}
- Endpoint[] filteredEndpoints = filterEndpoints(endpts);
+ EndpointI[] filteredEndpoints = filterEndpoints(endpts);
if(filteredEndpoints.length == 0)
{
Ice.NoEndpointException ex = new Ice.NoEndpointException();
@@ -195,5 +216,5 @@ public class DirectReference extends RoutableReference
return compare(_endpoints, rhs._endpoints);
}
- private Endpoint[] _endpoints;
+ private EndpointI[] _endpoints;
}