diff options
Diffstat (limited to 'java/src')
-rw-r--r-- | java/src/Ice/Blobject.java | 6 | ||||
-rw-r--r-- | java/src/Ice/BlobjectAsync.java | 4 | ||||
-rw-r--r-- | java/src/Ice/DispatchInterceptor.java | 14 | ||||
-rw-r--r-- | java/src/Ice/DispatchStatus.java | 48 | ||||
-rw-r--r-- | java/src/Ice/Object.java | 6 | ||||
-rw-r--r-- | java/src/Ice/ObjectImpl.java | 26 | ||||
-rw-r--r-- | java/src/Ice/_ObjectDelD.java | 32 | ||||
-rw-r--r-- | java/src/IceInternal/Direct.java | 2 | ||||
-rw-r--r-- | java/src/IceInternal/DispatchStatus.java | 76 | ||||
-rw-r--r-- | java/src/IceInternal/Incoming.java | 42 | ||||
-rw-r--r-- | java/src/IceInternal/IncomingAsync.java | 6 | ||||
-rw-r--r-- | java/src/IceInternal/IncomingBase.java | 32 | ||||
-rw-r--r-- | java/src/IceInternal/Outgoing.java | 36 | ||||
-rw-r--r-- | java/src/IceInternal/OutgoingAsync.java | 42 | ||||
-rw-r--r-- | java/src/IceInternal/ReplyStatus.java | 22 | ||||
-rw-r--r-- | java/src/IceInternal/TraceUtil.java | 38 |
16 files changed, 215 insertions, 217 deletions
diff --git a/java/src/Ice/Blobject.java b/java/src/Ice/Blobject.java index 0de693e36d0..daadab0654c 100644 --- a/java/src/Ice/Blobject.java +++ b/java/src/Ice/Blobject.java @@ -15,7 +15,7 @@ public abstract class Blobject extends Ice.ObjectImpl public abstract boolean ice_invoke(byte[] inParams, ByteSeqHolder outParams, Current current); - public IceInternal.DispatchStatus + public DispatchStatus __dispatch(IceInternal.Incoming in, Current current) { byte[] inParams; @@ -29,11 +29,11 @@ public abstract class Blobject extends Ice.ObjectImpl } if(ok) { - return IceInternal.DispatchStatus.DispatchOK; + return DispatchStatus.DispatchOK; } else { - return IceInternal.DispatchStatus.DispatchUserException; + return DispatchStatus.DispatchUserException; } } } diff --git a/java/src/Ice/BlobjectAsync.java b/java/src/Ice/BlobjectAsync.java index 5418015561f..50288c12a50 100644 --- a/java/src/Ice/BlobjectAsync.java +++ b/java/src/Ice/BlobjectAsync.java @@ -14,7 +14,7 @@ public abstract class BlobjectAsync extends Ice.ObjectImpl public abstract void ice_invoke_async(AMD_Object_ice_invoke cb, byte[] inParams, Current current); - public IceInternal.DispatchStatus + public DispatchStatus __dispatch(IceInternal.Incoming in, Current current) { byte[] inParams; @@ -29,6 +29,6 @@ public abstract class BlobjectAsync extends Ice.ObjectImpl { cb.ice_exception(ex); } - return IceInternal.DispatchStatus.DispatchAsync; + return DispatchStatus.DispatchAsync; } } diff --git a/java/src/Ice/DispatchInterceptor.java b/java/src/Ice/DispatchInterceptor.java index 7c84a47dd6e..46b6a5eeab0 100644 --- a/java/src/Ice/DispatchInterceptor.java +++ b/java/src/Ice/DispatchInterceptor.java @@ -11,16 +11,16 @@ package Ice; public abstract class DispatchInterceptor extends ObjectImpl { - public abstract IceInternal.DispatchStatus + public abstract DispatchStatus dispatch(Request request); - public IceInternal.DispatchStatus + public DispatchStatus __dispatch(IceInternal.Incoming in, Current current) { try { - IceInternal.DispatchStatus status = dispatch(in); - if(status != IceInternal.DispatchStatus.DispatchAsync) + DispatchStatus status = dispatch(in); + if(status != DispatchStatus.DispatchAsync) { // // Make sure 'in' owns the connection etc. @@ -31,7 +31,7 @@ public abstract class DispatchInterceptor extends ObjectImpl } catch(ResponseSentException e) { - return IceInternal.DispatchStatus.DispatchAsync; + return DispatchStatus.DispatchAsync; } catch(java.lang.RuntimeException e) { @@ -42,12 +42,12 @@ public abstract class DispatchInterceptor extends ObjectImpl } catch(ResponseSentException rse) { - return IceInternal.DispatchStatus.DispatchAsync; + return DispatchStatus.DispatchAsync; } } } - public IceInternal.DispatchStatus + public DispatchStatus __collocDispatch(IceInternal.Direct request) { // diff --git a/java/src/Ice/DispatchStatus.java b/java/src/Ice/DispatchStatus.java new file mode 100644 index 00000000000..51d7de328b2 --- /dev/null +++ b/java/src/Ice/DispatchStatus.java @@ -0,0 +1,48 @@ +// ********************************************************************** +// +// 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 Ice; + +public final class DispatchStatus +{ + private static DispatchStatus[] __values = new DispatchStatus[3]; + private int __value; + + public static final int _DispatchOK = 0; + public static final DispatchStatus DispatchOK = + new DispatchStatus(_DispatchOK); + + public static final int _DispatchUserException = 1; + public static final DispatchStatus DispatchUserException = + new DispatchStatus(_DispatchUserException); + + public static final int _DispatchAsync = 2; + public static final DispatchStatus DispatchAsync = + new DispatchStatus(_DispatchAsync); + + public static DispatchStatus + convert(int val) + { + assert val < 3; + return __values[val]; + } + + public int + value() + { + return __value; + } + + private + DispatchStatus(int val) + { + __value = val; + __values[val] = this; + } +} diff --git a/java/src/Ice/Object.java b/java/src/Ice/Object.java index e1d54bf9293..438e0886fa4 100644 --- a/java/src/Ice/Object.java +++ b/java/src/Ice/Object.java @@ -34,11 +34,11 @@ public interface Object void ice_preMarshal(); void ice_postUnmarshal(); - IceInternal.DispatchStatus ice_dispatch(Request request, DispatchInterceptorAsyncCallback cb); + DispatchStatus ice_dispatch(Request request, DispatchInterceptorAsyncCallback cb); - IceInternal.DispatchStatus __dispatch(IceInternal.Incoming in, Current current); + DispatchStatus __dispatch(IceInternal.Incoming in, Current current); - IceInternal.DispatchStatus __collocDispatch(IceInternal.Direct request); + DispatchStatus __collocDispatch(IceInternal.Direct request); void __write(IceInternal.BasicStream __os); void __read(IceInternal.BasicStream __is, boolean __rid); diff --git a/java/src/Ice/ObjectImpl.java b/java/src/Ice/ObjectImpl.java index 970efadc15a..dfca5d6b3f3 100644 --- a/java/src/Ice/ObjectImpl.java +++ b/java/src/Ice/ObjectImpl.java @@ -54,7 +54,7 @@ public abstract class ObjectImpl implements Object, java.lang.Cloneable return s.equals(__ids[0]); } - public static IceInternal.DispatchStatus + public static DispatchStatus ___ice_isA(Ice.Object __obj, IceInternal.Incoming __inS, Current __current) { IceInternal.BasicStream __is = __inS.is(); @@ -62,7 +62,7 @@ public abstract class ObjectImpl implements Object, java.lang.Cloneable String __id = __is.readString(); boolean __ret = __obj.ice_isA(__id, __current); __os.writeBool(__ret); - return IceInternal.DispatchStatus.DispatchOK; + return DispatchStatus.DispatchOK; } public void @@ -77,11 +77,11 @@ public abstract class ObjectImpl implements Object, java.lang.Cloneable // Nothing to do. } - public static IceInternal.DispatchStatus + public static DispatchStatus ___ice_ping(Ice.Object __obj, IceInternal.Incoming __inS, Current __current) { __obj.ice_ping(__current); - return IceInternal.DispatchStatus.DispatchOK; + return DispatchStatus.DispatchOK; } public String[] @@ -96,13 +96,13 @@ public abstract class ObjectImpl implements Object, java.lang.Cloneable return __ids; } - public static IceInternal.DispatchStatus + public static DispatchStatus ___ice_ids(Ice.Object __obj, IceInternal.Incoming __inS, Current __current) { IceInternal.BasicStream __os = __inS.os(); String[] __ret = __obj.ice_ids(__current); __os.writeStringSeq(__ret); - return IceInternal.DispatchStatus.DispatchOK; + return DispatchStatus.DispatchOK; } public String @@ -117,13 +117,13 @@ public abstract class ObjectImpl implements Object, java.lang.Cloneable return __ids[0]; } - public static IceInternal.DispatchStatus + public static DispatchStatus ___ice_id(Ice.Object __obj, IceInternal.Incoming __inS, Current __current) { IceInternal.BasicStream __os = __inS.os(); String __ret = __obj.ice_id(__current); __os.writeString(__ret); - return IceInternal.DispatchStatus.DispatchOK; + return DispatchStatus.DispatchOK; } public static String @@ -155,7 +155,7 @@ public abstract class ObjectImpl implements Object, java.lang.Cloneable "ice_ping" }; - public IceInternal.DispatchStatus + public DispatchStatus ice_dispatch(Request request, DispatchInterceptorAsyncCallback cb) { if(request.isCollocated()) @@ -184,13 +184,13 @@ public abstract class ObjectImpl implements Object, java.lang.Cloneable } } - public IceInternal.DispatchStatus + public DispatchStatus __dispatch(IceInternal.Incoming in, Current current) { int pos = java.util.Arrays.binarySearch(__all, current.operation); if(pos < 0) { - return IceInternal.DispatchStatus.DispatchOperationNotExist; + throw new Ice.OperationNotExistException(current.id, current.facet, current.operation); } switch(pos) @@ -214,10 +214,10 @@ public abstract class ObjectImpl implements Object, java.lang.Cloneable } assert(false); - return IceInternal.DispatchStatus.DispatchOperationNotExist; + throw new Ice.OperationNotExistException(current.id, current.facet, current.operation); } - public IceInternal.DispatchStatus + public DispatchStatus __collocDispatch(IceInternal.Direct request) { return request.run(this); diff --git a/java/src/Ice/_ObjectDelD.java b/java/src/Ice/_ObjectDelD.java index bac5a082d06..c99eefc5dec 100644 --- a/java/src/Ice/_ObjectDelD.java +++ b/java/src/Ice/_ObjectDelD.java @@ -22,17 +22,17 @@ public class _ObjectDelD implements _ObjectDel IceInternal.Direct __direct = new IceInternal.Direct(__current) { - public IceInternal.DispatchStatus run(Ice.Object __servant) + public DispatchStatus run(Ice.Object __servant) { __result.value = __servant.ice_isA(__id, __current); - return IceInternal.DispatchStatus.DispatchOK; + return DispatchStatus.DispatchOK; } }; try { - IceInternal.DispatchStatus __status = __direct.servant().__collocDispatch(__direct); - assert __status == IceInternal.DispatchStatus.DispatchOK; + DispatchStatus __status = __direct.servant().__collocDispatch(__direct); + assert __status == DispatchStatus.DispatchOK; return __result.value; } catch(Ice.LocalException __ex) @@ -54,17 +54,17 @@ public class _ObjectDelD implements _ObjectDel IceInternal.Direct __direct = new IceInternal.Direct(__current) { - public IceInternal.DispatchStatus run(Ice.Object __servant) + public DispatchStatus run(Ice.Object __servant) { __servant.ice_ping(__current); - return IceInternal.DispatchStatus.DispatchOK; + return DispatchStatus.DispatchOK; } }; try { - IceInternal.DispatchStatus __status = __direct.servant().__collocDispatch(__direct); - assert __status == IceInternal.DispatchStatus.DispatchOK; + DispatchStatus __status = __direct.servant().__collocDispatch(__direct); + assert __status == DispatchStatus.DispatchOK; } catch(Ice.LocalException __ex) { @@ -87,16 +87,16 @@ public class _ObjectDelD implements _ObjectDel IceInternal.Direct __direct = new IceInternal.Direct(__current) { - public IceInternal.DispatchStatus run(Ice.Object __servant) + public DispatchStatus run(Ice.Object __servant) { __result.value = __servant.ice_ids(__current); - return IceInternal.DispatchStatus.DispatchOK; + return DispatchStatus.DispatchOK; } }; try { - IceInternal.DispatchStatus __status = __direct.servant().__collocDispatch(__direct); - assert __status == IceInternal.DispatchStatus.DispatchOK; + DispatchStatus __status = __direct.servant().__collocDispatch(__direct); + assert __status == DispatchStatus.DispatchOK; return __result.value; } catch(Ice.LocalException __ex) @@ -120,16 +120,16 @@ public class _ObjectDelD implements _ObjectDel IceInternal.Direct __direct = new IceInternal.Direct(__current) { - public IceInternal.DispatchStatus run(Ice.Object __servant) + public DispatchStatus run(Ice.Object __servant) { __result.value = __servant.ice_id(__current); - return IceInternal.DispatchStatus.DispatchOK; + return DispatchStatus.DispatchOK; } }; try { - IceInternal.DispatchStatus __status = __direct.servant().__collocDispatch(__direct); - assert __status == IceInternal.DispatchStatus.DispatchOK; + DispatchStatus __status = __direct.servant().__collocDispatch(__direct); + assert __status == DispatchStatus.DispatchOK; return __result.value; } catch(Ice.LocalException __ex) diff --git a/java/src/IceInternal/Direct.java b/java/src/IceInternal/Direct.java index ac58c1481b6..6fc57c275ee 100644 --- a/java/src/IceInternal/Direct.java +++ b/java/src/IceInternal/Direct.java @@ -11,7 +11,7 @@ package IceInternal; public abstract class Direct implements Ice.Request { - public abstract DispatchStatus run(Ice.Object target); + public abstract Ice.DispatchStatus run(Ice.Object target); public final boolean isCollocated() { diff --git a/java/src/IceInternal/DispatchStatus.java b/java/src/IceInternal/DispatchStatus.java deleted file mode 100644 index ddf2813cd5f..00000000000 --- a/java/src/IceInternal/DispatchStatus.java +++ /dev/null @@ -1,76 +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 final class DispatchStatus -{ - private static DispatchStatus[] __values = new DispatchStatus[9]; - private int __value; - - public static final int _DispatchOK = 0; - public static final DispatchStatus DispatchOK = - new DispatchStatus(_DispatchOK); - - public static final int _DispatchUserException = 1; - public static final DispatchStatus DispatchUserException = - new DispatchStatus(_DispatchUserException); - - public static final int _DispatchObjectNotExist = 2; - public static final DispatchStatus DispatchObjectNotExist = - new DispatchStatus(_DispatchObjectNotExist); - - public static final int _DispatchFacetNotExist = 3; - public static final DispatchStatus DispatchFacetNotExist = - new DispatchStatus(_DispatchFacetNotExist); - - public static final int _DispatchOperationNotExist = 4; - public static final DispatchStatus DispatchOperationNotExist = - new DispatchStatus(_DispatchOperationNotExist); - - public static final int _DispatchUnknownLocalException = 5; - public static final DispatchStatus DispatchUnknownLocalException = - new DispatchStatus(_DispatchUnknownLocalException); - - public static final int _DispatchUnknownUserException = 6; - public static final DispatchStatus DispatchUnknownUserException = - new DispatchStatus(_DispatchUnknownUserException); - - public static final int _DispatchUnknownException = 7; - public static final DispatchStatus DispatchUnknownException = - new DispatchStatus(_DispatchUnknownException); - - // - // "Pseudo dispatch status", used internally only to indicate - // async dispatch. - // - public static final int _DispatchAsync = 8; - public static final DispatchStatus DispatchAsync = - new DispatchStatus(_DispatchAsync); - - public static DispatchStatus - convert(int val) - { - assert val < 9; - return __values[val]; - } - - public int - value() - { - return __value; - } - - private - DispatchStatus(int val) - { - __value = val; - __values[val] = this; - } -} diff --git a/java/src/IceInternal/Incoming.java b/java/src/IceInternal/Incoming.java index b79dca5ffc0..8a07df1c3fb 100644 --- a/java/src/IceInternal/Incoming.java +++ b/java/src/IceInternal/Incoming.java @@ -107,14 +107,15 @@ final public class Incoming extends IncomingBase implements Ice.Request if(_response) { - assert(_os.size() == Protocol.headerSize + 4); // Dispatch status position. - _os.writeByte((byte)0); + assert(_os.size() == Protocol.headerSize + 4); // Reply status position. + _os.writeByte(ReplyStatus.replyOK); _os.startWriteEncaps(); } - // Initialize status to some value, to keep the compiler happy. - DispatchStatus status = DispatchStatus.DispatchOK; - + byte replyStatus = ReplyStatus.replyOK; + + Ice.DispatchStatus dispatchStatus = Ice.DispatchStatus.DispatchOK; + // // Don't put the code above into the try block below. Exceptions // in the code above are considered fatal, and must propagate to @@ -153,21 +154,25 @@ final public class Incoming extends IncomingBase implements Ice.Request { if(servantManager != null && servantManager.hasServant(_current.id)) { - status = DispatchStatus.DispatchFacetNotExist; + replyStatus = ReplyStatus.replyFacetNotExist; } else { - status = DispatchStatus.DispatchObjectNotExist; + replyStatus = ReplyStatus.replyObjectNotExist; } } else { - status = _servant.__dispatch(this, _current); + dispatchStatus = _servant.__dispatch(this, _current); + if(dispatchStatus == Ice.DispatchStatus.DispatchUserException) + { + replyStatus = ReplyStatus.replyUserException; + } } } finally { - if(_locator != null && _servant != null && status != DispatchStatus.DispatchAsync) + if(_locator != null && _servant != null && dispatchStatus != Ice.DispatchStatus.DispatchAsync) { _locator.finished(_current, _servant, _cookie.value); } @@ -198,7 +203,7 @@ final public class Incoming extends IncomingBase implements Ice.Request // DispatchAsync is "pseudo dispatch status", used internally // only to indicate async dispatch. // - if(status == DispatchStatus.DispatchAsync) + if(dispatchStatus == Ice.DispatchStatus.DispatchAsync) { // // If this was an asynchronous dispatch, we're done here. @@ -210,14 +215,13 @@ final public class Incoming extends IncomingBase implements Ice.Request { _os.endWriteEncaps(); - if(status != DispatchStatus.DispatchOK && status != DispatchStatus.DispatchUserException) + if(replyStatus != ReplyStatus.replyOK && replyStatus != ReplyStatus.replyUserException) { - assert(status == DispatchStatus.DispatchObjectNotExist || - status == DispatchStatus.DispatchFacetNotExist || - status == DispatchStatus.DispatchOperationNotExist); + assert(replyStatus == ReplyStatus.replyObjectNotExist || + replyStatus == ReplyStatus.replyFacetNotExist); - _os.resize(Protocol.headerSize + 4, false); // Dispatch status position. - _os.writeByte((byte)status.value()); + _os.resize(Protocol.headerSize + 4, false); // Reply status position. + _os.writeByte(replyStatus); _current.id.__write(_os); @@ -239,8 +243,8 @@ final public class Incoming extends IncomingBase implements Ice.Request else { int save = _os.pos(); - _os.pos(Protocol.headerSize + 4); // Dispatch status position. - _os.writeByte((byte)status.value()); + _os.pos(Protocol.headerSize + 4); // Reply status position. + _os.writeByte(replyStatus); _os.pos(save); } @@ -308,7 +312,7 @@ final public class Incoming extends IncomingBase implements Ice.Request { _os.endWriteEncaps(); _os.resize(Protocol.headerSize + 4, false); - _os.writeByte((byte)0); + _os.writeByte(ReplyStatus.replyOK); _os.startWriteEncaps(); } } diff --git a/java/src/IceInternal/IncomingAsync.java b/java/src/IceInternal/IncomingAsync.java index 103284a12e2..acd29aeb375 100644 --- a/java/src/IceInternal/IncomingAsync.java +++ b/java/src/IceInternal/IncomingAsync.java @@ -61,15 +61,15 @@ public class IncomingAsync extends IncomingBase _os.endWriteEncaps(); int save = _os.pos(); - _os.pos(Protocol.headerSize + 4); // Dispatch status position. + _os.pos(Protocol.headerSize + 4); // Reply status position. if(ok) { - _os.writeByte((byte)DispatchStatus._DispatchOK); + _os.writeByte(ReplyStatus.replyOK); } else { - _os.writeByte((byte)DispatchStatus._DispatchUserException); + _os.writeByte(ReplyStatus.replyUserException); } _os.pos(save); diff --git a/java/src/IceInternal/IncomingBase.java b/java/src/IceInternal/IncomingBase.java index 2f15d424271..798835d0c86 100644 --- a/java/src/IceInternal/IncomingBase.java +++ b/java/src/IceInternal/IncomingBase.java @@ -184,18 +184,18 @@ public class IncomingBase if(_response) { _os.endWriteEncaps(); - _os.resize(Protocol.headerSize + 4, false); // Dispatch status position. + _os.resize(Protocol.headerSize + 4, false); // Reply status position. if(ex instanceof Ice.ObjectNotExistException) { - _os.writeByte((byte)DispatchStatus._DispatchObjectNotExist); + _os.writeByte(ReplyStatus.replyObjectNotExist); } else if(ex instanceof Ice.FacetNotExistException) { - _os.writeByte((byte)DispatchStatus._DispatchFacetNotExist); + _os.writeByte(ReplyStatus.replyFacetNotExist); } else if(ex instanceof Ice.OperationNotExistException) { - _os.writeByte((byte)DispatchStatus._DispatchOperationNotExist); + _os.writeByte(ReplyStatus.replyOperationNotExist); } else { @@ -235,8 +235,8 @@ public class IncomingBase if(_response) { _os.endWriteEncaps(); - _os.resize(Protocol.headerSize + 4, false); // Dispatch status position. - _os.writeByte((byte)DispatchStatus._DispatchUnknownLocalException); + _os.resize(Protocol.headerSize + 4, false); // Reply status position. + _os.writeByte(ReplyStatus.replyUnknownLocalException); _os.writeString(ex.unknown); _connection.sendResponse(_os, _compress); } @@ -255,8 +255,8 @@ public class IncomingBase if(_response) { _os.endWriteEncaps(); - _os.resize(Protocol.headerSize + 4, false); // Dispatch status position. - _os.writeByte((byte)DispatchStatus._DispatchUnknownUserException); + _os.resize(Protocol.headerSize + 4, false); // Reply status position. + _os.writeByte(ReplyStatus.replyUnknownUserException); _os.writeString(ex.unknown); _connection.sendResponse(_os, _compress); } @@ -275,8 +275,8 @@ public class IncomingBase if(_response) { _os.endWriteEncaps(); - _os.resize(Protocol.headerSize + 4, false); // Dispatch status position. - _os.writeByte((byte)DispatchStatus._DispatchUnknownException); + _os.resize(Protocol.headerSize + 4, false); // Reply status position. + _os.writeByte(ReplyStatus.replyUnknownException); _os.writeString(ex.unknown); _connection.sendResponse(_os, _compress); } @@ -295,8 +295,8 @@ public class IncomingBase if(_response) { _os.endWriteEncaps(); - _os.resize(Protocol.headerSize + 4, false); // Dispatch status position. - _os.writeByte((byte)DispatchStatus._DispatchUnknownLocalException); + _os.resize(Protocol.headerSize + 4, false); // Reply status position. + _os.writeByte(ReplyStatus.replyUnknownLocalException); //_os.writeString(ex.toString()); java.io.StringWriter sw = new java.io.StringWriter(); java.io.PrintWriter pw = new java.io.PrintWriter(sw); @@ -320,8 +320,8 @@ public class IncomingBase if(_response) { _os.endWriteEncaps(); - _os.resize(Protocol.headerSize + 4, false); // Dispatch status position. - _os.writeByte((byte)DispatchStatus._DispatchUnknownUserException); + _os.resize(Protocol.headerSize + 4, false); // Reply status position. + _os.writeByte(ReplyStatus.replyUnknownUserException); //_os.writeString(ex.toString()); java.io.StringWriter sw = new java.io.StringWriter(); java.io.PrintWriter pw = new java.io.PrintWriter(sw); @@ -345,8 +345,8 @@ public class IncomingBase if(_response) { _os.endWriteEncaps(); - _os.resize(Protocol.headerSize + 4, false); // Dispatch status position. - _os.writeByte((byte)DispatchStatus._DispatchUnknownException); + _os.resize(Protocol.headerSize + 4, false); // Reply status position. + _os.writeByte(ReplyStatus.replyUnknownException); //_os.writeString(ex.toString()); java.io.StringWriter sw = new java.io.StringWriter(); java.io.PrintWriter pw = new java.io.PrintWriter(sw); diff --git a/java/src/IceInternal/Outgoing.java b/java/src/IceInternal/Outgoing.java index 0b684ac7c8f..85cf0c1ce9b 100644 --- a/java/src/IceInternal/Outgoing.java +++ b/java/src/IceInternal/Outgoing.java @@ -250,11 +250,11 @@ public final class Outgoing assert(_state <= StateInProgress); _is.swap(is); - int status = (int)_is.readByte(); + byte replyStatus = _is.readByte(); - switch(status) + switch(replyStatus) { - case DispatchStatus._DispatchOK: + case ReplyStatus.replyOK: { // // Input and output parameters are always sent in an @@ -266,7 +266,7 @@ public final class Outgoing break; } - case DispatchStatus._DispatchUserException: + case ReplyStatus.replyUserException: { // // Input and output parameters are always sent in an @@ -278,26 +278,26 @@ public final class Outgoing break; } - case DispatchStatus._DispatchObjectNotExist: - case DispatchStatus._DispatchFacetNotExist: - case DispatchStatus._DispatchOperationNotExist: + case ReplyStatus.replyObjectNotExist: + case ReplyStatus.replyFacetNotExist: + case ReplyStatus.replyOperationNotExist: { Ice.RequestFailedException ex = null; - switch((int)status) + switch(replyStatus) { - case DispatchStatus._DispatchObjectNotExist: + case ReplyStatus.replyObjectNotExist: { ex = new Ice.ObjectNotExistException(); break; } - case DispatchStatus._DispatchFacetNotExist: + case ReplyStatus.replyFacetNotExist: { ex = new Ice.FacetNotExistException(); break; } - case DispatchStatus._DispatchOperationNotExist: + case ReplyStatus.replyOperationNotExist: { ex = new Ice.OperationNotExistException(); break; @@ -337,26 +337,26 @@ public final class Outgoing break; } - case DispatchStatus._DispatchUnknownException: - case DispatchStatus._DispatchUnknownLocalException: - case DispatchStatus._DispatchUnknownUserException: + case ReplyStatus.replyUnknownException: + case ReplyStatus.replyUnknownLocalException: + case ReplyStatus.replyUnknownUserException: { Ice.UnknownException ex = null; - switch((int)status) + switch(replyStatus) { - case DispatchStatus._DispatchUnknownException: + case ReplyStatus.replyUnknownException: { ex = new Ice.UnknownException(); break; } - case DispatchStatus._DispatchUnknownLocalException: + case ReplyStatus.replyUnknownLocalException: { ex = new Ice.UnknownLocalException(); break; } - case DispatchStatus._DispatchUnknownUserException: + case ReplyStatus.replyUnknownUserException: { ex = new Ice.UnknownUserException(); break; diff --git a/java/src/IceInternal/OutgoingAsync.java b/java/src/IceInternal/OutgoingAsync.java index d7a9af5d4d7..fa9e22315d1 100644 --- a/java/src/IceInternal/OutgoingAsync.java +++ b/java/src/IceInternal/OutgoingAsync.java @@ -23,26 +23,26 @@ public abstract class OutgoingAsync { synchronized(_monitor) { - int status; + byte replyStatus; try { __is.swap(is); - status = (int)__is.readByte(); + replyStatus = __is.readByte(); - switch(status) + switch(replyStatus) { - case DispatchStatus._DispatchOK: - case DispatchStatus._DispatchUserException: + case ReplyStatus.replyOK: + case ReplyStatus.replyUserException: { __is.startReadEncaps(); break; } - case DispatchStatus._DispatchObjectNotExist: - case DispatchStatus._DispatchFacetNotExist: - case DispatchStatus._DispatchOperationNotExist: + case ReplyStatus.replyObjectNotExist: + case ReplyStatus.replyFacetNotExist: + case ReplyStatus.replyOperationNotExist: { Ice.Identity id = new Ice.Identity(); id.__read(__is); @@ -68,21 +68,21 @@ public abstract class OutgoingAsync String operation = __is.readString(); Ice.RequestFailedException ex = null; - switch(status) + switch(replyStatus) { - case DispatchStatus._DispatchObjectNotExist: + case ReplyStatus.replyObjectNotExist: { ex = new Ice.ObjectNotExistException(); break; } - case DispatchStatus._DispatchFacetNotExist: + case ReplyStatus.replyFacetNotExist: { ex = new Ice.FacetNotExistException(); break; } - case DispatchStatus._DispatchOperationNotExist: + case ReplyStatus.replyOperationNotExist: { ex = new Ice.OperationNotExistException(); break; @@ -101,28 +101,28 @@ public abstract class OutgoingAsync throw ex; } - case DispatchStatus._DispatchUnknownException: - case DispatchStatus._DispatchUnknownLocalException: - case DispatchStatus._DispatchUnknownUserException: + case ReplyStatus.replyUnknownException: + case ReplyStatus.replyUnknownLocalException: + case ReplyStatus.replyUnknownUserException: { String unknown = __is.readString(); Ice.UnknownException ex = null; - switch(status) + switch(replyStatus) { - case DispatchStatus._DispatchUnknownException: + case ReplyStatus.replyUnknownException: { ex = new Ice.UnknownException(); break; } - case DispatchStatus._DispatchUnknownLocalException: + case ReplyStatus.replyUnknownLocalException: { ex = new Ice.UnknownLocalException(); break; } - case DispatchStatus._DispatchUnknownUserException: + case ReplyStatus.replyUnknownUserException: { ex = new Ice.UnknownUserException(); break; @@ -151,11 +151,11 @@ public abstract class OutgoingAsync return; } - assert(status == DispatchStatus._DispatchOK || status == DispatchStatus._DispatchUserException); + assert(replyStatus == ReplyStatus.replyOK || replyStatus == ReplyStatus.replyUserException); try { - __response(status == DispatchStatus._DispatchOK); + __response(replyStatus == ReplyStatus.replyOK); } catch(java.lang.Exception ex) { diff --git a/java/src/IceInternal/ReplyStatus.java b/java/src/IceInternal/ReplyStatus.java new file mode 100644 index 00000000000..a8598eccb06 --- /dev/null +++ b/java/src/IceInternal/ReplyStatus.java @@ -0,0 +1,22 @@ +// ********************************************************************** +// +// 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; + +interface ReplyStatus +{ + static final byte replyOK = 0; + static final byte replyUserException = 1; + static final byte replyObjectNotExist = 2; + static final byte replyFacetNotExist = 3; + static final byte replyOperationNotExist = 4; + static final byte replyUnknownLocalException = 5; + static final byte replyUnknownUserException = 6; + static final byte replyUnknownException = 7; +} diff --git a/java/src/IceInternal/TraceUtil.java b/java/src/IceInternal/TraceUtil.java index 6b57b96c540..7a81793ffdc 100644 --- a/java/src/IceInternal/TraceUtil.java +++ b/java/src/IceInternal/TraceUtil.java @@ -96,42 +96,42 @@ public final class TraceUtil int requestId = str.readInt(); s.write("\nrequest id = " + requestId); - byte status = str.readByte(); - s.write("\nreply status = " + (int)status + ' '); + byte replyStatus = str.readByte(); + s.write("\nreply status = " + (int)replyStatus + ' '); - switch(status) + switch(replyStatus) { - case DispatchStatus._DispatchOK: + case ReplyStatus.replyOK: { s.write("(ok)"); break; } - case DispatchStatus._DispatchUserException: + case ReplyStatus.replyUserException: { s.write("(user exception)"); break; } - case DispatchStatus._DispatchObjectNotExist: - case DispatchStatus._DispatchFacetNotExist: - case DispatchStatus._DispatchOperationNotExist: + case ReplyStatus.replyObjectNotExist: + case ReplyStatus.replyFacetNotExist: + case ReplyStatus.replyOperationNotExist: { - switch(status) + switch(replyStatus) { - case DispatchStatus._DispatchObjectNotExist: + case ReplyStatus.replyObjectNotExist: { s.write("(object not exist)"); break; } - case DispatchStatus._DispatchFacetNotExist: + case ReplyStatus.replyFacetNotExist: { s.write("(facet not exist)"); break; } - case DispatchStatus._DispatchOperationNotExist: + case ReplyStatus.replyOperationNotExist: { s.write("(operation not exist)"); break; @@ -148,25 +148,25 @@ public final class TraceUtil break; } - case DispatchStatus._DispatchUnknownException: - case DispatchStatus._DispatchUnknownLocalException: - case DispatchStatus._DispatchUnknownUserException: + case ReplyStatus.replyUnknownException: + case ReplyStatus.replyUnknownLocalException: + case ReplyStatus.replyUnknownUserException: { - switch(status) + switch(replyStatus) { - case DispatchStatus._DispatchUnknownException: + case ReplyStatus.replyUnknownException: { s.write("(unknown exception)"); break; } - case DispatchStatus._DispatchUnknownLocalException: + case ReplyStatus.replyUnknownLocalException: { s.write("(unknown local exception)"); break; } - case DispatchStatus._DispatchUnknownUserException: + case ReplyStatus.replyUnknownUserException: { s.write("(unknown user exception)"); break; |