diff options
author | Bernard Normier <bernard@zeroc.com> | 2007-02-01 17:09:49 +0000 |
---|---|---|
committer | Bernard Normier <bernard@zeroc.com> | 2007-02-01 17:09:49 +0000 |
commit | abada90e3f84dc703b8ddc9efcbed8a946fadead (patch) | |
tree | 2c6f9dccd510ea97cb927a7bd635422efaae547a /java/src/IceInternal/Incoming.java | |
parent | removing trace message (diff) | |
download | ice-abada90e3f84dc703b8ddc9efcbed8a946fadead.tar.bz2 ice-abada90e3f84dc703b8ddc9efcbed8a946fadead.tar.xz ice-abada90e3f84dc703b8ddc9efcbed8a946fadead.zip |
Expanded tabs into spaces
Diffstat (limited to 'java/src/IceInternal/Incoming.java')
-rw-r--r-- | java/src/IceInternal/Incoming.java | 276 |
1 files changed, 138 insertions, 138 deletions
diff --git a/java/src/IceInternal/Incoming.java b/java/src/IceInternal/Incoming.java index 8b8b1f1619a..75075840fc5 100644 --- a/java/src/IceInternal/Incoming.java +++ b/java/src/IceInternal/Incoming.java @@ -13,9 +13,9 @@ final public class Incoming extends IncomingBase { public Incoming(Instance instance, Ice.ConnectionI connection, Ice.ObjectAdapter adapter, boolean response, byte compress, - int requestId) + int requestId) { - super(instance, connection, adapter, response, compress, requestId); + super(instance, connection, adapter, response, compress, requestId); _is = new BasicStream(instance); } @@ -25,33 +25,33 @@ final public class Incoming extends IncomingBase // public void reset(Instance instance, Ice.ConnectionI connection, Ice.ObjectAdapter adapter, boolean response, byte compress, - int requestId) + int requestId) { - if(_is == null) - { - _is = new BasicStream(instance); - } + if(_is == null) + { + _is = new BasicStream(instance); + } - super.reset(instance, connection, adapter, response, compress, requestId); + super.reset(instance, connection, adapter, response, compress, requestId); } public void reclaim() { - if(_is != null) - { - _is.reset(); - } + if(_is != null) + { + _is.reset(); + } - super.reclaim(); + super.reclaim(); } public void invoke(ServantManager servantManager) { - // - // Read the current. - // + // + // Read the current. + // _current.id.__read(_is); // @@ -60,16 +60,16 @@ final public class Incoming extends IncomingBase String[] facetPath = _is.readStringSeq(); if(facetPath.length > 0) { - if(facetPath.length > 1) - { - throw new Ice.MarshalException(); - } + if(facetPath.length > 1) + { + throw new Ice.MarshalException(); + } _current.facet = facetPath[0]; } - else - { + else + { _current.facet = ""; - } + } _current.operation = _is.readString(); _current.mode = Ice.OperationMode.convert(_is.readByte()); @@ -94,114 +94,114 @@ final public class Incoming extends IncomingBase _os.startWriteEncaps(); } - // Initialize status to some value, to keep the compiler happy. - DispatchStatus status = 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 - // the caller of this operation. - // + // Initialize status to some value, to keep the compiler happy. + DispatchStatus status = 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 + // the caller of this operation. + // try { - try - { - if(servantManager != null) - { - _servant = servantManager.findServant(_current.id, _current.facet); - if(_servant == null) - { - _locator = servantManager.findServantLocator(_current.id.category); - if(_locator == null && _current.id.category.length() > 0) - { - _locator = servantManager.findServantLocator(""); - } - if(_locator != null) - { - _servant = _locator.locate(_current, _cookie); - } - } - if(_servant == null) - { - _locator = servantManager.findServantLocator(""); - if(_locator != null) - { - _servant = _locator.locate(_current, _cookie); - } - } - } - if(_servant == null) - { - if(servantManager != null && servantManager.hasServant(_current.id)) - { - status = DispatchStatus.DispatchFacetNotExist; - } - else - { - status = DispatchStatus.DispatchObjectNotExist; - } - } - else - { - status = _servant.__dispatch(this, _current); - } - } - finally - { - if(_locator != null && _servant != null && status != DispatchStatus.DispatchAsync) - { - _locator.finished(_current, _servant, _cookie.value); - } - } - } + try + { + if(servantManager != null) + { + _servant = servantManager.findServant(_current.id, _current.facet); + if(_servant == null) + { + _locator = servantManager.findServantLocator(_current.id.category); + if(_locator == null && _current.id.category.length() > 0) + { + _locator = servantManager.findServantLocator(""); + } + if(_locator != null) + { + _servant = _locator.locate(_current, _cookie); + } + } + if(_servant == null) + { + _locator = servantManager.findServantLocator(""); + if(_locator != null) + { + _servant = _locator.locate(_current, _cookie); + } + } + } + if(_servant == null) + { + if(servantManager != null && servantManager.hasServant(_current.id)) + { + status = DispatchStatus.DispatchFacetNotExist; + } + else + { + status = DispatchStatus.DispatchObjectNotExist; + } + } + else + { + status = _servant.__dispatch(this, _current); + } + } + finally + { + if(_locator != null && _servant != null && status != DispatchStatus.DispatchAsync) + { + _locator.finished(_current, _servant, _cookie.value); + } + } + } /* Not possible in Java - UserExceptions are checked exceptions catch(Ice.UserException ex) { - // ... - } - */ + // ... + } + */ catch(java.lang.Exception ex) { - _is.endReadEncaps(); - __handleException(ex); - return; + _is.endReadEncaps(); + __handleException(ex); + return; + } + + // + // Don't put the code below into the try block above. Exceptions + // in the code below are considered fatal, and must propagate to + // the caller of this operation. + // + + _is.endReadEncaps(); + + // + // DispatchAsync is "pseudo dispatch status", used internally + // only to indicate async dispatch. + // + if(status == DispatchStatus.DispatchAsync) + { + // + // If this was an asynchronous dispatch, we're done here. + // + return; } - - // - // Don't put the code below into the try block above. Exceptions - // in the code below are considered fatal, and must propagate to - // the caller of this operation. - // - - _is.endReadEncaps(); - - // - // DispatchAsync is "pseudo dispatch status", used internally - // only to indicate async dispatch. - // - if(status == DispatchStatus.DispatchAsync) - { - // - // If this was an asynchronous dispatch, we're done here. - // - return; - } - - if(_response) - { - _os.endWriteEncaps(); - - if(status != DispatchStatus.DispatchOK && status != DispatchStatus.DispatchUserException) - { - assert(status == DispatchStatus.DispatchObjectNotExist || - status == DispatchStatus.DispatchFacetNotExist || - status == DispatchStatus.DispatchOperationNotExist); - - _os.resize(Protocol.headerSize + 4, false); // Dispatch status position. - _os.writeByte((byte)status.value()); - - _current.id.__write(_os); + + if(_response) + { + _os.endWriteEncaps(); + + if(status != DispatchStatus.DispatchOK && status != DispatchStatus.DispatchUserException) + { + assert(status == DispatchStatus.DispatchObjectNotExist || + status == DispatchStatus.DispatchFacetNotExist || + status == DispatchStatus.DispatchOperationNotExist); + + _os.resize(Protocol.headerSize + 4, false); // Dispatch status position. + _os.writeByte((byte)status.value()); + + _current.id.__write(_os); // // For compatibility with the old FacetPath. @@ -216,22 +216,22 @@ final public class Incoming extends IncomingBase _os.writeStringSeq(facetPath2); } - _os.writeString(_current.operation); - } - else - { - int save = _os.pos(); - _os.pos(Protocol.headerSize + 4); // Dispatch status position. - _os.writeByte((byte)status.value()); - _os.pos(save); - } - - _connection.sendResponse(_os, _compress); - } - else - { - _connection.sendNoResponse(); - } + _os.writeString(_current.operation); + } + else + { + int save = _os.pos(); + _os.pos(Protocol.headerSize + 4); // Dispatch status position. + _os.writeByte((byte)status.value()); + _os.pos(save); + } + + _connection.sendResponse(_os, _compress); + } + else + { + _connection.sendNoResponse(); + } } public BasicStream |