diff options
Diffstat (limited to 'cpp/src')
-rw-r--r-- | cpp/src/Ice/Connection.cpp | 18 | ||||
-rw-r--r-- | cpp/src/Ice/Incoming.cpp | 6 | ||||
-rw-r--r-- | cpp/src/Ice/Object.cpp | 2 | ||||
-rw-r--r-- | cpp/src/slice2java/Gen.cpp | 95 |
4 files changed, 63 insertions, 58 deletions
diff --git a/cpp/src/Ice/Connection.cpp b/cpp/src/Ice/Connection.cpp index ca3446f5e29..5387f1bf8c3 100644 --- a/cpp/src/Ice/Connection.cpp +++ b/cpp/src/Ice/Connection.cpp @@ -563,6 +563,11 @@ IceInternal::Connection::sendResponse(BasicStream* os, bool compress) try { + if(--_dispatchCount == 0) + { + notifyAll(); + } + if(_state == StateClosed) { return; @@ -619,11 +624,6 @@ IceInternal::Connection::sendResponse(BasicStream* os, bool compress) _transceiver->write(*os, _endpoint->timeout()); } - if(--_dispatchCount == 0) - { - notifyAll(); - } - if(_state == StateClosing && _dispatchCount == 0) { initiateShutdown(); @@ -642,16 +642,11 @@ IceInternal::Connection::sendNoResponse() try { - if(_state == StateClosed) - { - return; - } - if(--_dispatchCount == 0) { notifyAll(); } - + if(_state == StateClosing && _dispatchCount == 0) { initiateShutdown(); @@ -1237,7 +1232,6 @@ IceInternal::Connection::setState(State state) registerWithPool(); } unregisterWithPool(); - _dispatchCount = 0; break; } } diff --git a/cpp/src/Ice/Incoming.cpp b/cpp/src/Ice/Incoming.cpp index 0969df7488c..636a2862064 100644 --- a/cpp/src/Ice/Incoming.cpp +++ b/cpp/src/Ice/Incoming.cpp @@ -204,7 +204,11 @@ IceInternal::Incoming::invoke() status = _servant->__dispatch(*this, _current); } - if(_is.b.empty()) // Asynchronous dispatch? + // + // In case of an asynchronous dispatch, _is is now empty, + // because an IncomingAsync has adopted this Incoming. + // + if(_is.b.empty()) { // // If this was an asynchronous dispatch, we're done diff --git a/cpp/src/Ice/Object.cpp b/cpp/src/Ice/Object.cpp index ac3448c8b7a..cb73cacd7ae 100644 --- a/cpp/src/Ice/Object.cpp +++ b/cpp/src/Ice/Object.cpp @@ -289,7 +289,7 @@ Ice::Object::ice_addFacet(const ObjectPtr& facet, const string& name) { IceUtil::Mutex::Lock sync(_activeFacetMapMutex); - if( (_activeFacetMapHint != _activeFacetMap.end() && _activeFacetMapHint->first == name) + if((_activeFacetMapHint != _activeFacetMap.end() && _activeFacetMapHint->first == name) || _activeFacetMap.find(name) != _activeFacetMap.end()) { AlreadyRegisteredException ex(__FILE__, __LINE__); diff --git a/cpp/src/slice2java/Gen.cpp b/cpp/src/slice2java/Gen.cpp index db1c701a3db..b7c8495a898 100644 --- a/cpp/src/slice2java/Gen.cpp +++ b/cpp/src/slice2java/Gen.cpp @@ -3127,7 +3127,7 @@ Slice::Gen::DelegateDVisitor::visitClassDefStart(const ClassDefPtr& p) string params = getParams(op, scope); string args = getArgs(op); - out << sp; + out << sp; out << nl << "public " << retS << nl << opName << '(' << params; if(!params.empty()) { @@ -3136,49 +3136,56 @@ Slice::Gen::DelegateDVisitor::visitClassDefStart(const ClassDefPtr& p) out << "java.util.Map __context)"; writeDelegateThrowsClause(scope, throws); out << sb; - list<string> metaData = op->getMetaData(); - out << nl << "Ice.Current __current = new Ice.Current();"; - out << nl << "__initCurrent(__current, \"" << op->name() << "\", " << sliceModeToIceMode(op) - << ", __context);"; - out << nl << "while(true)"; - out << sb; - out << nl << "IceInternal.Direct __direct = new IceInternal.Direct(__current);"; - out << nl << "try"; - out << sb; - out << nl << name << " __servant = null;"; - out << nl << "try"; - out << sb; - out << nl << "__servant = (" << name << ")__direct.facetServant();"; - out << eb; - out << nl << "catch(ClassCastException __ex)"; - out << sb; - out << nl << "Ice.OperationNotExistException __opEx = new Ice.OperationNotExistException();"; - out << nl << "__opEx.id = __current.id;"; - out << nl << "__opEx.facet = __current.facet;"; - out << nl << "__opEx.operation = __current.operation;"; - out << nl << "throw __opEx;"; - out << eb; - out << nl; - if(ret) - { - out << "return "; - } - out << "__servant." << opName << '(' << args; - if(!args.empty()) - { - out << ", "; - } - out << "__current);"; - if(!ret) - { - out << nl << "return;"; - } - out << eb; - out << nl << "finally"; - out << sb; - out << nl << "__direct.destroy();"; - out << eb; - out << eb; + if(p->hasMetaData("amd") || op->hasMetaData("amd")) + { + out << nl << "throw new Ice.CollocationOptimizationException();"; + } + else + { + list<string> metaData = op->getMetaData(); + out << nl << "Ice.Current __current = new Ice.Current();"; + out << nl << "__initCurrent(__current, \"" << op->name() << "\", " << sliceModeToIceMode(op) + << ", __context);"; + out << nl << "while(true)"; + out << sb; + out << nl << "IceInternal.Direct __direct = new IceInternal.Direct(__current);"; + out << nl << "try"; + out << sb; + out << nl << name << " __servant = null;"; + out << nl << "try"; + out << sb; + out << nl << "__servant = (" << name << ")__direct.facetServant();"; + out << eb; + out << nl << "catch(ClassCastException __ex)"; + out << sb; + out << nl << "Ice.OperationNotExistException __opEx = new Ice.OperationNotExistException();"; + out << nl << "__opEx.id = __current.id;"; + out << nl << "__opEx.facet = __current.facet;"; + out << nl << "__opEx.operation = __current.operation;"; + out << nl << "throw __opEx;"; + out << eb; + out << nl; + if(ret) + { + out << "return "; + } + out << "__servant." << opName << '(' << args; + if(!args.empty()) + { + out << ", "; + } + out << "__current);"; + if(!ret) + { + out << nl << "return;"; + } + out << eb; + out << nl << "finally"; + out << sb; + out << nl << "__direct.destroy();"; + out << eb; + out << eb; + } out << eb; if(p->hasMetaData("ami") || op->hasMetaData("ami")) |