diff options
author | Mark Spruiell <mes@zeroc.com> | 2005-07-07 19:15:16 +0000 |
---|---|---|
committer | Mark Spruiell <mes@zeroc.com> | 2005-07-07 19:15:16 +0000 |
commit | 72f0fe54fc96d9a9014b530db8f9987455d6f598 (patch) | |
tree | 092a29216d5d55e9ec2ec0d7e047a3a30f2d0239 /java/src/Ice/_ObjectDelM.java | |
parent | fixing mono compile error (diff) | |
download | ice-72f0fe54fc96d9a9014b530db8f9987455d6f598.tar.bz2 ice-72f0fe54fc96d9a9014b530db8f9987455d6f598.tar.xz ice-72f0fe54fc96d9a9014b530db8f9987455d6f598.zip |
cache Outgoing objects in connection instead of delegate
Diffstat (limited to 'java/src/Ice/_ObjectDelM.java')
-rw-r--r-- | java/src/Ice/_ObjectDelM.java | 74 |
1 files changed, 23 insertions, 51 deletions
diff --git a/java/src/Ice/_ObjectDelM.java b/java/src/Ice/_ObjectDelM.java index ecc7d390f8c..7ba99456070 100644 --- a/java/src/Ice/_ObjectDelM.java +++ b/java/src/Ice/_ObjectDelM.java @@ -15,13 +15,13 @@ public class _ObjectDelM implements _ObjectDel ice_isA(String __id, java.util.Map __context) throws IceInternal.NonRepeatable { - IceInternal.Outgoing __outS = getOutgoing("ice_isA", OperationMode.Nonmutating, __context); + IceInternal.Outgoing __og = getOutgoing("ice_isA", OperationMode.Nonmutating, __context); try { - IceInternal.BasicStream __is = __outS.is(); - IceInternal.BasicStream __os = __outS.os(); + IceInternal.BasicStream __is = __og.is(); + IceInternal.BasicStream __os = __og.os(); __os.writeString(__id); - if(!__outS.invoke()) + if(!__og.invoke()) { throw new UnknownUserException(); } @@ -36,7 +36,7 @@ public class _ObjectDelM implements _ObjectDel } finally { - reclaimOutgoing(__outS); + reclaimOutgoing(__og); } } @@ -44,17 +44,17 @@ public class _ObjectDelM implements _ObjectDel ice_ping(java.util.Map __context) throws IceInternal.NonRepeatable { - IceInternal.Outgoing __outS = getOutgoing("ice_ping", OperationMode.Nonmutating, __context); + IceInternal.Outgoing __og = getOutgoing("ice_ping", OperationMode.Nonmutating, __context); try { - if(!__outS.invoke()) + if(!__og.invoke()) { throw new UnknownUserException(); } } finally { - reclaimOutgoing(__outS); + reclaimOutgoing(__og); } } @@ -62,11 +62,11 @@ public class _ObjectDelM implements _ObjectDel ice_ids(java.util.Map __context) throws IceInternal.NonRepeatable { - IceInternal.Outgoing __outS = getOutgoing("ice_ids", OperationMode.Nonmutating, __context); + IceInternal.Outgoing __og = getOutgoing("ice_ids", OperationMode.Nonmutating, __context); try { - IceInternal.BasicStream __is = __outS.is(); - if(!__outS.invoke()) + IceInternal.BasicStream __is = __og.is(); + if(!__og.invoke()) { throw new UnknownUserException(); } @@ -81,7 +81,7 @@ public class _ObjectDelM implements _ObjectDel } finally { - reclaimOutgoing(__outS); + reclaimOutgoing(__og); } } @@ -89,11 +89,11 @@ public class _ObjectDelM implements _ObjectDel ice_id(java.util.Map __context) throws IceInternal.NonRepeatable { - IceInternal.Outgoing __outS = getOutgoing("ice_id", OperationMode.Nonmutating, __context); + IceInternal.Outgoing __og = getOutgoing("ice_id", OperationMode.Nonmutating, __context); try { - IceInternal.BasicStream __is = __outS.is(); - if(!__outS.invoke()) + IceInternal.BasicStream __is = __og.is(); + if(!__og.invoke()) { throw new UnknownUserException(); } @@ -108,7 +108,7 @@ public class _ObjectDelM implements _ObjectDel } finally { - reclaimOutgoing(__outS); + reclaimOutgoing(__og); } } @@ -116,20 +116,20 @@ public class _ObjectDelM implements _ObjectDel ice_invoke(String operation, OperationMode mode, byte[] inParams, ByteSeqHolder outParams, java.util.Map __context) throws IceInternal.NonRepeatable { - IceInternal.Outgoing __outS = getOutgoing(operation, mode, __context); + IceInternal.Outgoing __og = getOutgoing(operation, mode, __context); try { if(inParams != null) { - IceInternal.BasicStream __os = __outS.os(); + IceInternal.BasicStream __os = __og.os(); __os.writeBlob(inParams); } - boolean ok = __outS.invoke(); + boolean ok = __og.invoke(); if(__reference.getMode() == IceInternal.Reference.ModeTwoway) { try { - IceInternal.BasicStream __is = __outS.is(); + IceInternal.BasicStream __is = __og.is(); int sz = __is.getReadEncapsSize(); if(outParams != null) { @@ -145,7 +145,7 @@ public class _ObjectDelM implements _ObjectDel } finally { - reclaimOutgoing(__outS); + reclaimOutgoing(__og); } } @@ -204,40 +204,12 @@ public class _ObjectDelM implements _ObjectDel getOutgoing(String operation, OperationMode mode, java.util.Map context) throws IceInternal.NonRepeatable { - IceInternal.Outgoing out = null; - - synchronized(__outgoingMutex) - { - if(__outgoingCache == null) - { - out = new IceInternal.Outgoing(__connection, __reference, operation, mode, context, __compress); - } - else - { - out = __outgoingCache; - __outgoingCache = __outgoingCache.next; - out.reset(operation, mode, context); - out.next = null; - } - } - - return out; + return __connection.getOutgoing(__reference, operation, mode, context, __compress); } protected void reclaimOutgoing(IceInternal.Outgoing out) { - synchronized(__outgoingMutex) - { - out.next = __outgoingCache; - __outgoingCache = out; - // - // Clear references to Ice objects as soon as possible. - // - __outgoingCache.reclaim(); - } + __connection.reclaimOutgoing(out); } - - private IceInternal.Outgoing __outgoingCache; - private java.lang.Object __outgoingMutex = new java.lang.Object(); } |