summaryrefslogtreecommitdiff
path: root/java/src/IceInternal/DirectReference.java
diff options
context:
space:
mode:
authorBenoit Foucher <benoit@zeroc.com>2008-01-21 13:20:59 +0100
committerBenoit Foucher <benoit@zeroc.com>2008-01-21 13:20:59 +0100
commit52bd621c7d3fa7b144d8fad7941ac8d43e942be8 (patch)
treebdd7565282d503251d82205ce7fe3e57102a96d2 /java/src/IceInternal/DirectReference.java
parentasync I/O in C# (diff)
downloadice-52bd621c7d3fa7b144d8fad7941ac8d43e942be8.tar.bz2
ice-52bd621c7d3fa7b144d8fad7941ac8d43e942be8.tar.xz
ice-52bd621c7d3fa7b144d8fad7941ac8d43e942be8.zip
- Removed OA createReverseProxy method.
- Fixed bug 2141, 2645, 2632, 1547. - It's now possible to call ice_secure on a fixed proxy to require a secure connetion.
Diffstat (limited to 'java/src/IceInternal/DirectReference.java')
-rw-r--r--java/src/IceInternal/DirectReference.java264
1 files changed, 0 insertions, 264 deletions
diff --git a/java/src/IceInternal/DirectReference.java b/java/src/IceInternal/DirectReference.java
deleted file mode 100644
index 2a60fda7e7a..00000000000
--- a/java/src/IceInternal/DirectReference.java
+++ /dev/null
@@ -1,264 +0,0 @@
-// **********************************************************************
-//
-// Copyright (c) 2003-2007 ZeroC, Inc. All rights reserved.
-//
-// This copy of Ice is licensed to you under the terms described in the
-// ICE_LICENSE file included in this distribution.
-//
-// **********************************************************************
-
-package IceInternal;
-
-public class DirectReference extends RoutableReference
-{
- public
- DirectReference(Instance inst,
- Ice.Communicator com,
- Ice.Identity ident,
- java.util.Map ctx,
- String fs,
- int md,
- boolean sec,
- boolean prefSec,
- EndpointI[] endpts,
- RouterInfo rtrInfo,
- boolean collocationOpt,
- boolean cacheConnection,
- Ice.EndpointSelectionType endpointSelection,
- boolean threadPerConnection)
- {
- super(inst, com, ident, ctx, fs, md, sec, prefSec, rtrInfo, collocationOpt, cacheConnection, endpointSelection,
- threadPerConnection);
- _endpoints = endpts;
- }
-
- public String
- getAdapterId()
- {
- return "";
- }
-
- public EndpointI[]
- getEndpoints()
- {
- return _endpoints;
- }
-
- public int
- getLocatorCacheTimeout()
- {
- return 0;
- }
-
- public Reference
- changeLocator(Ice.LocatorPrx newLocator)
- {
- return this;
- }
-
- public Reference
- changeCompress(boolean newCompress)
- {
- DirectReference r = (DirectReference)super.changeCompress(newCompress);
- if(r != this) // Also override the compress flag on the endpoints if it was updated.
- {
- EndpointI[] newEndpoints = new EndpointI[_endpoints.length];
- for(int i = 0; i < _endpoints.length; i++)
- {
- newEndpoints[i] = _endpoints[i].compress(newCompress);
- }
- r._endpoints = newEndpoints;
- }
- return r;
- }
-
- public Reference
- changeTimeout(int newTimeout)
- {
- DirectReference r = (DirectReference)super.changeTimeout(newTimeout);
- if(r != this) // Also override the timeout on the endpoints if it was updated.
- {
- EndpointI[] newEndpoints = new EndpointI[_endpoints.length];
- for(int i = 0; i < _endpoints.length; i++)
- {
- newEndpoints[i] = _endpoints[i].timeout(newTimeout);
- }
- r._endpoints = newEndpoints;
- }
- return r;
- }
-
- public Reference
- changeConnectionId(String connectionId)
- {
- DirectReference r = (DirectReference)super.changeConnectionId(connectionId);
- if(r != this) // Also override the connection id on the endpoints if it was updated.
- {
- EndpointI[] newEndpoints = new EndpointI[_endpoints.length];
- for(int i = 0; i < _endpoints.length; i++)
- {
- newEndpoints[i] = _endpoints[i].connectionId(connectionId);
- }
- r._endpoints = newEndpoints;
- }
- 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(), getPreferSecure(), newAdapterId, getRouterInfo(),
- locatorInfo, getCollocationOptimization(), getCacheConnection(),
- getEndpointSelection(), getThreadPerConnection(),
- getLocatorCacheTimeout());
- }
-
- public Reference
- changeEndpoints(EndpointI[] newEndpoints)
- {
- if(java.util.Arrays.equals(newEndpoints, _endpoints))
- {
- return this;
- }
-
- DirectReference r = (DirectReference)getInstance().referenceFactory().copy(this);
- r._endpoints = newEndpoints;
- r.applyOverrides(r._endpoints);
- return r;
- }
-
- public Reference
- changeLocatorCacheTimeout(int newTimeout)
- {
- return this;
- }
-
- public void
- streamWrite(BasicStream s)
- throws Ice.MarshalException
- {
- super.streamWrite(s);
-
- s.writeSize(_endpoints.length);
- if(_endpoints.length > 0)
- {
- for(int i = 0; i < _endpoints.length; i++)
- {
- _endpoints[i].streamWrite(s);
- }
- }
- else
- {
- s.writeString(""); // Adapter id.
- }
- }
-
- public String
- toString()
- {
- //
- // WARNING: Certain features, such as proxy validation in Glacier2,
- // depend on the format of proxy strings. Changes to toString() and
- // methods called to generate parts of the reference string could break
- // these features. Please review for all features that depend on the
- // format of proxyToString() before changing this and related code.
- //
- StringBuffer s = new StringBuffer();
- s.append(super.toString());
-
- for(int i = 0; i < _endpoints.length; i++)
- {
- String endp = _endpoints[i].toString();
- if(endp != null && endp.length() > 0)
- {
- s.append(':');
- s.append(endp);
- }
- }
- return s.toString();
- }
-
- public Ice.ConnectionI
- getConnection(Ice.BooleanHolder comp)
- {
- if(getRouterInfo() != null)
- {
- //
- // If we route, we send everything to the router's client
- // proxy endpoints.
- //
- EndpointI[] endpts = getRouterInfo().getClientEndpoints();
- if(endpts.length > 0)
- {
- applyOverrides(endpts);
- return createConnection(endpts, comp);
- }
- }
-
- return createConnection(_endpoints, comp);
- }
-
- public void
- getConnection(final GetConnectionCallback callback)
- {
- if(getRouterInfo() != null)
- {
- //
- // If we route, we send everything to the router's client
- // proxy endpoints.
- //
- getRouterInfo().getClientEndpoints(new RouterInfo.GetClientEndpointsCallback()
- {
- public void
- setEndpoints(EndpointI[] endpts)
- {
- if(endpts.length > 0)
- {
- applyOverrides(endpts);
- createConnection(endpts, callback);
- return;
- }
-
- createConnection(_endpoints, callback);
- }
-
- public void
- setException(Ice.LocalException ex)
- {
- callback.setException(ex);
- }
- });
- return;
- }
-
- createConnection(_endpoints, callback);
- }
-
- public boolean
- equals(java.lang.Object obj)
- {
- if(this == obj)
- {
- return true;
- }
- if(!(obj instanceof DirectReference))
- {
- return false;
- }
- DirectReference rhs = (DirectReference)obj;
- if(!super.equals(rhs))
- {
- return false;
- }
- return java.util.Arrays.equals(_endpoints, rhs._endpoints);
- }
-
- private EndpointI[] _endpoints;
-}