summaryrefslogtreecommitdiff
path: root/java/src/IceInternal/ReferenceFactory.java
diff options
context:
space:
mode:
authorBenoit Foucher <benoit@zeroc.com>2013-02-18 16:59:30 +0100
committerBenoit Foucher <benoit@zeroc.com>2013-02-18 16:59:30 +0100
commitb438088a0a3adddea45967fab4482a7c87666bee (patch)
tree6170827ab72b91fe200fb0c17327e913e739e7e0 /java/src/IceInternal/ReferenceFactory.java
parentFixed (ICE-5259) - Make.common.rules should check for /Library/Developers/Ice... (diff)
downloadice-b438088a0a3adddea45967fab4482a7c87666bee.tar.bz2
ice-b438088a0a3adddea45967fab4482a7c87666bee.tar.xz
ice-b438088a0a3adddea45967fab4482a7c87666bee.zip
Fixed ICE-5247: removed proxy cache from Java/C# implementation
Diffstat (limited to 'java/src/IceInternal/ReferenceFactory.java')
-rw-r--r--java/src/IceInternal/ReferenceFactory.java80
1 files changed, 18 insertions, 62 deletions
diff --git a/java/src/IceInternal/ReferenceFactory.java b/java/src/IceInternal/ReferenceFactory.java
index 453659408b9..2d336cc8ab3 100644
--- a/java/src/IceInternal/ReferenceFactory.java
+++ b/java/src/IceInternal/ReferenceFactory.java
@@ -46,7 +46,7 @@ public final class ReferenceFactory
//
// Create new reference
//
- FixedReference ref = new FixedReference(
+ return new FixedReference(
_instance,
_communicator,
ident,
@@ -55,7 +55,6 @@ public final class ReferenceFactory
fixedConnection.endpoint().secure(),
_instance.defaultsAndOverrides().defaultEncoding,
fixedConnection);
- return updateCache(ref);
}
public Reference
@@ -667,47 +666,6 @@ public final class ReferenceFactory
_communicator = communicator;
}
- synchronized void
- destroy()
- {
- _references.clear();
- }
-
- synchronized private Reference
- updateCache(Reference ref)
- {
- //
- // If we already have an equivalent reference, use such equivalent
- // reference. Otherwise add the new reference to the reference
- // set.
- //
- // Java implementation note: A WeakHashMap is used to hold References,
- // allowing References to be garbage collected automatically. A
- // Reference serves as both key and value in the map. The
- // WeakHashMap class internally creates a weak reference for the
- // key, and we use a weak reference for the value as well.
- //
- java.lang.ref.WeakReference<Reference> w = _references.get(ref);
- if(w != null)
- {
- Reference r = w.get();
- if(r != null)
- {
- ref = r;
- }
- else
- {
- _references.put(ref, new java.lang.ref.WeakReference<Reference>(ref));
- }
- }
- else
- {
- _references.put(ref, new java.lang.ref.WeakReference<Reference>(ref));
- }
-
- return ref;
- }
-
static private String[] _suffixes =
{
"EndpointSelection",
@@ -882,29 +840,27 @@ public final class ReferenceFactory
//
// Create new reference
//
- return updateCache(new RoutableReference(_instance,
- _communicator,
- ident,
- facet,
- mode,
- secure,
- protocol,
- encoding,
- endpoints,
- adapterId,
- locatorInfo,
- routerInfo,
- collocationOptimized,
- cacheConnection,
- preferSecure,
- endpointSelection,
- locatorCacheTimeout));
+ return new RoutableReference(_instance,
+ _communicator,
+ ident,
+ facet,
+ mode,
+ secure,
+ protocol,
+ encoding,
+ endpoints,
+ adapterId,
+ locatorInfo,
+ routerInfo,
+ collocationOptimized,
+ cacheConnection,
+ preferSecure,
+ endpointSelection,
+ locatorCacheTimeout);
}
final private Instance _instance;
final private Ice.Communicator _communicator;
private Ice.RouterPrx _defaultRouter;
private Ice.LocatorPrx _defaultLocator;
- private java.util.WeakHashMap<Reference, java.lang.ref.WeakReference<Reference> > _references =
- new java.util.WeakHashMap<Reference, java.lang.ref.WeakReference<Reference> >();
}