summaryrefslogtreecommitdiff
path: root/java/src/IceInternal/FixedReference.java
diff options
context:
space:
mode:
Diffstat (limited to 'java/src/IceInternal/FixedReference.java')
-rw-r--r--java/src/IceInternal/FixedReference.java313
1 files changed, 0 insertions, 313 deletions
diff --git a/java/src/IceInternal/FixedReference.java b/java/src/IceInternal/FixedReference.java
deleted file mode 100644
index 6a5d6fc6bc1..00000000000
--- a/java/src/IceInternal/FixedReference.java
+++ /dev/null
@@ -1,313 +0,0 @@
-// **********************************************************************
-//
-// Copyright (c) 2003-2014 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 FixedReference extends Reference
-{
- public
- FixedReference(Instance instance,
- Ice.Communicator communicator,
- Ice.Identity identity,
- String facet,
- int mode,
- boolean secure,
- Ice.EncodingVersion encoding,
- Ice.ConnectionI connection)
- {
- super(instance, communicator, identity, facet, mode, secure, Ice.Util.Protocol_1_0, encoding, -1, null);
- _fixedConnection = connection;
- }
-
- @Override
- public EndpointI[]
- getEndpoints()
- {
- return _emptyEndpoints;
- }
-
- @Override
- public String
- getAdapterId()
- {
- return "";
- }
-
- @Override
- public LocatorInfo
- getLocatorInfo()
- {
- return null;
- }
-
- @Override
- public RouterInfo
- getRouterInfo()
- {
- return null;
- }
-
- @Override
- public boolean
- getCollocationOptimized()
- {
- return false;
- }
-
- @Override
- public final boolean
- getCacheConnection()
- {
- return true;
- }
-
- @Override
- public boolean
- getPreferSecure()
- {
- return false;
- }
-
- @Override
- public final Ice.EndpointSelectionType
- getEndpointSelection()
- {
- return Ice.EndpointSelectionType.Random;
- }
-
- @Override
- public int
- getLocatorCacheTimeout()
- {
- return 0;
- }
-
- @Override
- public String
- getConnectionId()
- {
- return "";
- }
-
- @Override
- public Reference
- changeEndpoints(EndpointI[] newEndpoints)
- {
- throw new Ice.FixedProxyException();
- }
-
- @Override
- public Reference
- changeAdapterId(String newAdapterId)
- {
- throw new Ice.FixedProxyException();
- }
-
- @Override
- public Reference
- changeLocator(Ice.LocatorPrx newLocator)
- {
- throw new Ice.FixedProxyException();
- }
-
- @Override
- public Reference
- changeRouter(Ice.RouterPrx newRouter)
- {
- throw new Ice.FixedProxyException();
- }
-
- @Override
- public Reference
- changeCollocationOptimized(boolean newCollocationOptimized)
- {
- throw new Ice.FixedProxyException();
- }
-
- @Override
- public final Reference
- changeCacheConnection(boolean newCache)
- {
- throw new Ice.FixedProxyException();
- }
-
- @Override
- public Reference
- changePreferSecure(boolean prefSec)
- {
- throw new Ice.FixedProxyException();
- }
-
- @Override
- public final Reference
- changeEndpointSelection(Ice.EndpointSelectionType newType)
- {
- throw new Ice.FixedProxyException();
- }
-
- @Override
- public Reference
- changeLocatorCacheTimeout(int newTimeout)
- {
- throw new Ice.FixedProxyException();
- }
-
- @Override
- public Reference
- changeTimeout(int newTimeout)
- {
- throw new Ice.FixedProxyException();
- }
-
- @Override
- public Reference
- changeConnectionId(String connectionId)
- {
- throw new Ice.FixedProxyException();
- }
-
- @Override
- public boolean
- isIndirect()
- {
- return false;
- }
-
- @Override
- public boolean
- isWellKnown()
- {
- return false;
- }
-
- @Override
- public void
- streamWrite(BasicStream s)
- throws Ice.MarshalException
- {
- throw new Ice.FixedProxyException();
- }
-
- @Override
- public String
- toString()
- throws Ice.MarshalException
- {
- throw new Ice.FixedProxyException();
- }
-
- @Override
- public java.util.Map<String, String>
- toProperty(String prefix)
- {
- throw new Ice.FixedProxyException();
- }
-
- @Override
- public void
- getConnection(GetConnectionCallback callback)
- {
- try
- {
- Ice.Holder<Boolean> compress = new Ice.Holder<Boolean>();
- switch(getMode())
- {
- case Reference.ModeTwoway:
- case Reference.ModeOneway:
- case Reference.ModeBatchOneway:
- {
- if(_fixedConnection.endpoint().datagram())
- {
- throw new Ice.NoEndpointException("");
- }
- break;
- }
-
- case Reference.ModeDatagram:
- case Reference.ModeBatchDatagram:
- {
- if(!_fixedConnection.endpoint().datagram())
- {
- throw new Ice.NoEndpointException("");
- }
- break;
- }
- }
-
- //
- // If a secure connection is requested or secure overrides is set,
- // check if the connection is secure.
- //
- boolean secure;
- DefaultsAndOverrides defaultsAndOverrides = getInstance().defaultsAndOverrides();
- if(defaultsAndOverrides.overrideSecure)
- {
- secure = defaultsAndOverrides.overrideSecureValue;
- }
- else
- {
- secure = getSecure();
- }
- if(secure && !_fixedConnection.endpoint().secure())
- {
- throw new Ice.NoEndpointException("");
- }
-
- _fixedConnection.throwException(); // Throw in case our connection is already destroyed.
-
- if(defaultsAndOverrides.overrideCompress)
- {
- compress.value = defaultsAndOverrides.overrideCompressValue;
- }
- else if(_overrideCompress)
- {
- compress.value = _compress;
- }
- else
- {
- compress.value = _fixedConnection.endpoint().compress();
- }
- callback.setConnection(_fixedConnection, compress.value);
- }
- catch(Ice.LocalException ex)
- {
- callback.setException(ex);
- }
- }
-
- @Override
- public boolean
- equals(java.lang.Object obj)
- {
- if(this == obj)
- {
- return true;
- }
- if(!(obj instanceof FixedReference))
- {
- return false;
- }
- FixedReference rhs = (FixedReference)obj;
- if(!super.equals(rhs))
- {
- return false;
- }
- return _fixedConnection.equals(rhs._fixedConnection);
- }
-
- @Override
- public int
- hashCode()
- {
- return super.hashCode();
- }
-
- private Ice.ConnectionI _fixedConnection;
- private static EndpointI[] _emptyEndpoints = new EndpointI[0];
-}