summaryrefslogtreecommitdiff
path: root/java/src
diff options
context:
space:
mode:
authorMichi Henning <michi@zeroc.com>2002-09-04 05:39:57 +0000
committerMichi Henning <michi@zeroc.com>2002-09-04 05:39:57 +0000
commita5da64185ba234ae8dfdec11764e1821bbc67a57 (patch)
tree4aa60640dbb0b01960e8aa644ef9179594e28b6d /java/src
parentfix (diff)
downloadice-a5da64185ba234ae8dfdec11764e1821bbc67a57.tar.bz2
ice-a5da64185ba234ae8dfdec11764e1821bbc67a57.tar.xz
ice-a5da64185ba234ae8dfdec11764e1821bbc67a57.zip
Changed Current.ice to use enum OperationMode to distinguish between
Normal, Nonmutating, and Idempotent operations. Fixed bug introduced into Freeze with previous changes for saving object state. (State wasn't saved for idempotent operations.) Retested everything. I'm getting a failure in the Yellow (C++) tests, and another failure in the IceBox (Java) tests, but I don't think these are related to these changes.
Diffstat (limited to 'java/src')
-rw-r--r--java/src/Freeze/EvictorI.java5
-rw-r--r--java/src/Ice/ObjectPrx.java4
-rw-r--r--java/src/Ice/ObjectPrxHelper.java10
-rw-r--r--java/src/Ice/_ObjectDel.java2
-rw-r--r--java/src/Ice/_ObjectDelD.java19
-rw-r--r--java/src/Ice/_ObjectDelM.java20
-rw-r--r--java/src/IceInternal/Incoming.java2
-rw-r--r--java/src/IceInternal/Outgoing.java12
8 files changed, 36 insertions, 38 deletions
diff --git a/java/src/Freeze/EvictorI.java b/java/src/Freeze/EvictorI.java
index ebc1c6ac0c5..1f4a32a57e5 100644
--- a/java/src/Freeze/EvictorI.java
+++ b/java/src/Freeze/EvictorI.java
@@ -269,12 +269,9 @@ class EvictorI implements Evictor
// If we are in SaveAfterMutatingOperation mode, we must save the
// Ice Object if this was a mutating call.
//
- // TODO: ML: Badly broken now, we don't save if an operation
- // is mutating and idempotent!!!
- //
if(_persistenceMode == EvictorPersistenceMode.SaveAfterMutatingOperation)
{
- if(!current.idempotent)
+ if(current.mode != Ice.OperationMode.Nonmutating)
{
_dict.put(current.id, servant);
}
diff --git a/java/src/Ice/ObjectPrx.java b/java/src/Ice/ObjectPrx.java
index 7c2ecbe154d..c3ed34bc756 100644
--- a/java/src/Ice/ObjectPrx.java
+++ b/java/src/Ice/ObjectPrx.java
@@ -30,8 +30,8 @@ public interface ObjectPrx
String[] ice_facets(java.util.Map __context);
// Returns true if ok, false if user exception.
- boolean ice_invoke(String operation, boolean nonmutating, byte[] inParams, ByteSeqHolder outParams);
- boolean ice_invoke(String operation, boolean nonmutating, byte[] inParams, ByteSeqHolder outParams,
+ boolean ice_invoke(String operation, OperationMode mode, byte[] inParams, ByteSeqHolder outParams);
+ boolean ice_invoke(String operation, OperationMode mode, byte[] inParams, ByteSeqHolder outParams,
java.util.Map __context);
Identity ice_getIdentity();
diff --git a/java/src/Ice/ObjectPrxHelper.java b/java/src/Ice/ObjectPrxHelper.java
index 8595d307e95..fc19e9f611f 100644
--- a/java/src/Ice/ObjectPrxHelper.java
+++ b/java/src/Ice/ObjectPrxHelper.java
@@ -186,13 +186,13 @@ public class ObjectPrxHelper implements ObjectPrx
}
public final boolean
- ice_invoke(String operation, boolean nonmutating, byte[] inParams, ByteSeqHolder outParams)
+ ice_invoke(String operation, OperationMode mode, byte[] inParams, ByteSeqHolder outParams)
{
- return ice_invoke(operation, nonmutating, inParams, outParams, null);
+ return ice_invoke(operation, mode, inParams, outParams, null);
}
public final boolean
- ice_invoke(String operation, boolean nonmutating, byte[] inParams, ByteSeqHolder outParams,
+ ice_invoke(String operation, OperationMode mode, byte[] inParams, ByteSeqHolder outParams,
java.util.Map __context)
{
int __cnt = 0;
@@ -201,7 +201,7 @@ public class ObjectPrxHelper implements ObjectPrx
try
{
_ObjectDel __del = __getDelegate();
- return __del.ice_invoke(operation, nonmutating, inParams, outParams, __context);
+ return __del.ice_invoke(operation, mode, inParams, outParams, __context);
}
catch(LocationForward __ex)
{
@@ -209,7 +209,7 @@ public class ObjectPrxHelper implements ObjectPrx
}
catch(IceInternal.NonRepeatable __ex)
{
- if(nonmutating)
+ if(mode == OperationMode.Nonmutating || mode == OperationMode.Idempotent)
{
__cnt = __handleException(__ex.get(), __cnt);
}
diff --git a/java/src/Ice/_ObjectDel.java b/java/src/Ice/_ObjectDel.java
index b06e83b543b..614c880892c 100644
--- a/java/src/Ice/_ObjectDel.java
+++ b/java/src/Ice/_ObjectDel.java
@@ -27,7 +27,7 @@ public interface _ObjectDel
String[] ice_facets(java.util.Map __context)
throws LocationForward, IceInternal.NonRepeatable;
- boolean ice_invoke(String operation, boolean nonmutating, byte[] inParams, ByteSeqHolder outParams,
+ boolean ice_invoke(String operation, Ice.OperationMode mode, byte[] inParams, ByteSeqHolder outParams,
java.util.Map context)
throws LocationForward, IceInternal.NonRepeatable;
diff --git a/java/src/Ice/_ObjectDelD.java b/java/src/Ice/_ObjectDelD.java
index 5d397d2397c..390c6e70bdb 100644
--- a/java/src/Ice/_ObjectDelD.java
+++ b/java/src/Ice/_ObjectDelD.java
@@ -17,7 +17,7 @@ public class _ObjectDelD implements _ObjectDel
throws LocationForward, IceInternal.NonRepeatable
{
Current __current = new Current();
- __initCurrent(__current, "ice_isA", true, __context);
+ __initCurrent(__current, "ice_isA", OperationMode.Nonmutating, __context);
while(true)
{
IceInternal.Direct __direct = new IceInternal.Direct(__adapter, __current);
@@ -52,7 +52,7 @@ public class _ObjectDelD implements _ObjectDel
throws LocationForward, IceInternal.NonRepeatable
{
Current __current = new Current();
- __initCurrent(__current, "ice_ping", true, __context);
+ __initCurrent(__current, "ice_ping", OperationMode.Nonmutating, __context);
while(true)
{
IceInternal.Direct __direct = new IceInternal.Direct(__adapter, __current);
@@ -88,7 +88,7 @@ public class _ObjectDelD implements _ObjectDel
throws LocationForward, IceInternal.NonRepeatable
{
Current __current = new Current();
- __initCurrent(__current, "ice_ids", true, __context);
+ __initCurrent(__current, "ice_ids", OperationMode.Nonmutating, __context);
while(true)
{
IceInternal.Direct __direct = new IceInternal.Direct(__adapter, __current);
@@ -123,7 +123,7 @@ public class _ObjectDelD implements _ObjectDel
throws LocationForward, IceInternal.NonRepeatable
{
Current __current = new Current();
- __initCurrent(__current, "ice_id", true, __context);
+ __initCurrent(__current, "ice_id", OperationMode.Nonmutating, __context);
while(true)
{
IceInternal.Direct __direct = new IceInternal.Direct(__adapter, __current);
@@ -158,7 +158,7 @@ public class _ObjectDelD implements _ObjectDel
throws LocationForward, IceInternal.NonRepeatable
{
Current __current = new Current();
- __initCurrent(__current, "ice_facets", true, __context);
+ __initCurrent(__current, "ice_facets", OperationMode.Nonmutating, __context);
while(true)
{
IceInternal.Direct __direct = new IceInternal.Direct(__adapter, __current);
@@ -189,11 +189,12 @@ public class _ObjectDelD implements _ObjectDel
}
public boolean
- ice_invoke(String operation, boolean idempotent, byte[] inParams, ByteSeqHolder outParams, java.util.Map context)
+ ice_invoke(String operation, Ice.OperationMode mode, byte[] inParams, ByteSeqHolder outParams,
+ java.util.Map context)
throws LocationForward, IceInternal.NonRepeatable
{
Current current = new Current();
- __initCurrent(current, operation, idempotent, context);
+ __initCurrent(current, operation, mode, context);
while(true)
{
IceInternal.Direct __direct = new IceInternal.Direct(__adapter, current);
@@ -264,12 +265,12 @@ public class _ObjectDelD implements _ObjectDel
protected IceInternal.Reference __reference;
protected final void
- __initCurrent(Current current, String op, boolean idempotent, java.util.Map context)
+ __initCurrent(Current current, String op, Ice.OperationMode mode, java.util.Map context)
{
current.id = __reference.identity;
current.facet = __reference.facet;
current.operation = op;
- current.idempotent = idempotent;
+ current.mode = mode;
current.ctx = context;
}
diff --git a/java/src/Ice/_ObjectDelM.java b/java/src/Ice/_ObjectDelM.java
index b40f0c40874..443b39bcd3d 100644
--- a/java/src/Ice/_ObjectDelM.java
+++ b/java/src/Ice/_ObjectDelM.java
@@ -16,7 +16,7 @@ public class _ObjectDelM implements _ObjectDel
ice_isA(String __id, java.util.Map __context)
throws LocationForward, IceInternal.NonRepeatable
{
- IceInternal.Outgoing __out = getOutgoing("ice_isA", true, __context);
+ IceInternal.Outgoing __out = getOutgoing("ice_isA", OperationMode.Nonmutating, __context);
try
{
IceInternal.BasicStream __is = __out.is();
@@ -38,7 +38,7 @@ public class _ObjectDelM implements _ObjectDel
ice_ping(java.util.Map __context)
throws LocationForward, IceInternal.NonRepeatable
{
- IceInternal.Outgoing __out = getOutgoing("ice_ping", true, __context);
+ IceInternal.Outgoing __out = getOutgoing("ice_ping", OperationMode.Nonmutating, __context);
try
{
if(!__out.invoke())
@@ -56,7 +56,7 @@ public class _ObjectDelM implements _ObjectDel
ice_ids(java.util.Map __context)
throws LocationForward, IceInternal.NonRepeatable
{
- IceInternal.Outgoing __out = getOutgoing("ice_ids", true, __context);
+ IceInternal.Outgoing __out = getOutgoing("ice_ids", OperationMode.Nonmutating, __context);
try
{
IceInternal.BasicStream __is = __out.is();
@@ -76,7 +76,7 @@ public class _ObjectDelM implements _ObjectDel
ice_id(java.util.Map __context)
throws LocationForward, IceInternal.NonRepeatable
{
- IceInternal.Outgoing __out = getOutgoing("ice_id", true, __context);
+ IceInternal.Outgoing __out = getOutgoing("ice_id", OperationMode.Nonmutating, __context);
try
{
IceInternal.BasicStream __is = __out.is();
@@ -96,7 +96,7 @@ public class _ObjectDelM implements _ObjectDel
ice_facets(java.util.Map __context)
throws LocationForward, IceInternal.NonRepeatable
{
- IceInternal.Outgoing __out = getOutgoing("ice_facets", true, __context);
+ IceInternal.Outgoing __out = getOutgoing("ice_facets", OperationMode.Nonmutating, __context);
try
{
IceInternal.BasicStream __is = __out.is();
@@ -113,11 +113,11 @@ public class _ObjectDelM implements _ObjectDel
}
public boolean
- ice_invoke(String operation, boolean nonmutating, byte[] inParams, ByteSeqHolder outParams,
+ ice_invoke(String operation, OperationMode mode, byte[] inParams, ByteSeqHolder outParams,
java.util.Map __context)
throws LocationForward, IceInternal.NonRepeatable
{
- IceInternal.Outgoing __out = getOutgoing(operation, nonmutating, __context);
+ IceInternal.Outgoing __out = getOutgoing(operation, OperationMode.Nonmutating, __context);
try
{
IceInternal.BasicStream __os = __out.os();
@@ -409,7 +409,7 @@ public class _ObjectDelM implements _ObjectDel
private static EndpointComparator __comparator = new EndpointComparator();
protected IceInternal.Outgoing
- getOutgoing(String operation, boolean nonmutating, java.util.Map context)
+ getOutgoing(String operation, OperationMode mode, java.util.Map context)
{
IceInternal.Outgoing out;
@@ -417,13 +417,13 @@ public class _ObjectDelM implements _ObjectDel
{
if(__outgoingCache == null)
{
- out = new IceInternal.Outgoing(__connection, __reference, operation, nonmutating, context);
+ out = new IceInternal.Outgoing(__connection, __reference, operation, mode, context);
}
else
{
out = __outgoingCache;
__outgoingCache = __outgoingCache.next;
- out.reset(operation, nonmutating, context);
+ out.reset(operation, mode, context);
}
}
diff --git a/java/src/IceInternal/Incoming.java b/java/src/IceInternal/Incoming.java
index 782d51b0ca4..05682f38d46 100644
--- a/java/src/IceInternal/Incoming.java
+++ b/java/src/IceInternal/Incoming.java
@@ -29,7 +29,7 @@ public class Incoming
_current.id.__read(_is);
_current.facet = _is.readStringSeq();
_current.operation = _is.readString();
- _current.idempotent = _is.readBool();
+ _current.mode = Ice.OperationMode.convert(_is.readByte());
int sz = _is.readSize();
while(sz-- > 0)
{
diff --git a/java/src/IceInternal/Outgoing.java b/java/src/IceInternal/Outgoing.java
index 0bfe02b2cb8..be522da8b84 100644
--- a/java/src/IceInternal/Outgoing.java
+++ b/java/src/IceInternal/Outgoing.java
@@ -13,7 +13,7 @@ package IceInternal;
public final class Outgoing
{
public
- Outgoing(Connection connection, Reference ref, String operation, boolean idempotent, java.util.Map context)
+ Outgoing(Connection connection, Reference ref, String operation, Ice.OperationMode mode, java.util.Map context)
{
_connection = connection;
_reference = ref;
@@ -21,11 +21,11 @@ public final class Outgoing
_is = new BasicStream(ref.instance);
_os = new BasicStream(ref.instance);
- writeHeader(operation, idempotent, context);
+ writeHeader(operation, mode, context);
}
public void
- reset(String operation, boolean idempotent, java.util.Map context)
+ reset(String operation, Ice.OperationMode mode, java.util.Map context)
{
_state = StateUnsent;
_exception = null;
@@ -34,7 +34,7 @@ public final class Outgoing
_is.reset();
_os.reset();
- writeHeader(operation, idempotent, context);
+ writeHeader(operation, mode, context);
}
public void
@@ -310,7 +310,7 @@ public final class Outgoing
}
private void
- writeHeader(String operation, boolean idempotent, java.util.Map context)
+ writeHeader(String operation, Ice.OperationMode mode, java.util.Map context)
{
switch(_reference.mode)
{
@@ -333,7 +333,7 @@ public final class Outgoing
_reference.identity.__write(_os);
_os.writeStringSeq(_reference.facet);
_os.writeString(operation);
- _os.writeBool(idempotent);
+ _os.writeByte((byte)mode.value());
if(context == null)
{
_os.writeSize(0);