diff options
Diffstat (limited to 'cpp/src/Ice/Proxy.cpp')
-rw-r--r-- | cpp/src/Ice/Proxy.cpp | 974 |
1 files changed, 487 insertions, 487 deletions
diff --git a/cpp/src/Ice/Proxy.cpp b/cpp/src/Ice/Proxy.cpp index eb20297fb6a..2ad7d17e5da 100644 --- a/cpp/src/Ice/Proxy.cpp +++ b/cpp/src/Ice/Proxy.cpp @@ -56,23 +56,23 @@ IceInternal::checkedCastImpl(const ObjectPrx& b, const string& f, const string& if(b) { - ObjectPrx bb = b->ice_facet(f); - try - { - if(context == 0 ? bb->ice_isA(typeId) : bb->ice_isA(typeId, *context)) - { - return bb; - } + ObjectPrx bb = b->ice_facet(f); + try + { + if(context == 0 ? bb->ice_isA(typeId) : bb->ice_isA(typeId, *context)) + { + return bb; + } #ifndef NDEBUG - else - { - assert(typeId != "::Ice::Object"); - } + else + { + assert(typeId != "::Ice::Object"); + } #endif - } - catch(const FacetNotExistException&) - { - } + } + catch(const FacetNotExistException&) + { + } } return 0; } @@ -132,21 +132,21 @@ IceProxy::Ice::Object::ice_isA(const string& typeId, const Context* context) int __cnt = 0; while(true) { - Handle< ::IceDelegate::Ice::Object> __del; - try - { - __checkTwowayOnly("ice_isA"); - __del = __getDelegate(); - return __del->ice_isA(typeId, context); - } - catch(const LocalExceptionWrapper& __ex) - { - __handleExceptionWrapperRelaxed(__del, __ex, __cnt); - } - catch(const LocalException& __ex) - { - __handleException(__del, __ex, __cnt); - } + Handle< ::IceDelegate::Ice::Object> __del; + try + { + __checkTwowayOnly("ice_isA"); + __del = __getDelegate(); + return __del->ice_isA(typeId, context); + } + catch(const LocalExceptionWrapper& __ex) + { + __handleExceptionWrapperRelaxed(__del, __ex, __cnt); + } + catch(const LocalException& __ex) + { + __handleException(__del, __ex, __cnt); + } } } @@ -156,21 +156,21 @@ IceProxy::Ice::Object::ice_ping(const Context* context) int __cnt = 0; while(true) { - Handle< ::IceDelegate::Ice::Object> __del; - try - { - __del = __getDelegate(); - __del->ice_ping(context); - return; - } - catch(const LocalExceptionWrapper& __ex) - { - __handleExceptionWrapperRelaxed(__del, __ex, __cnt); - } - catch(const LocalException& __ex) - { - __handleException(__del, __ex, __cnt); - } + Handle< ::IceDelegate::Ice::Object> __del; + try + { + __del = __getDelegate(); + __del->ice_ping(context); + return; + } + catch(const LocalExceptionWrapper& __ex) + { + __handleExceptionWrapperRelaxed(__del, __ex, __cnt); + } + catch(const LocalException& __ex) + { + __handleException(__del, __ex, __cnt); + } } } @@ -180,21 +180,21 @@ IceProxy::Ice::Object::ice_ids(const Context* context) int __cnt = 0; while(true) { - Handle< ::IceDelegate::Ice::Object> __del; - try - { - __checkTwowayOnly("ice_ids"); - __del = __getDelegate(); - return __del->ice_ids(context); - } - catch(const LocalExceptionWrapper& __ex) - { - __handleExceptionWrapperRelaxed(__del, __ex, __cnt); - } - catch(const LocalException& __ex) - { - __handleException(__del, __ex, __cnt); - } + Handle< ::IceDelegate::Ice::Object> __del; + try + { + __checkTwowayOnly("ice_ids"); + __del = __getDelegate(); + return __del->ice_ids(context); + } + catch(const LocalExceptionWrapper& __ex) + { + __handleExceptionWrapperRelaxed(__del, __ex, __cnt); + } + catch(const LocalException& __ex) + { + __handleException(__del, __ex, __cnt); + } } } @@ -204,31 +204,31 @@ IceProxy::Ice::Object::ice_id(const Context* context) int __cnt = 0; while(true) { - Handle< ::IceDelegate::Ice::Object> __del; - try - { - __checkTwowayOnly("ice_id"); - __del = __getDelegate(); - return __del->ice_id(context); - } - catch(const LocalExceptionWrapper& __ex) - { - __handleExceptionWrapperRelaxed(__del, __ex, __cnt); - } - catch(const LocalException& __ex) - { - __handleException(__del, __ex, __cnt); - } + Handle< ::IceDelegate::Ice::Object> __del; + try + { + __checkTwowayOnly("ice_id"); + __del = __getDelegate(); + return __del->ice_id(context); + } + catch(const LocalExceptionWrapper& __ex) + { + __handleExceptionWrapperRelaxed(__del, __ex, __cnt); + } + catch(const LocalException& __ex) + { + __handleException(__del, __ex, __cnt); + } } } bool IceProxy::Ice::Object::ice_invoke(const string& operation, - OperationMode mode, - const vector<Byte>& inParams, - vector<Byte>& outParams, - const Context* context) + OperationMode mode, + const vector<Byte>& inParams, + vector<Byte>& outParams, + const Context* context) { pair<const Byte*, const Byte*> inPair; if(inParams.size() == 0) @@ -238,7 +238,7 @@ IceProxy::Ice::Object::ice_invoke(const string& operation, else { inPair.first = &inParams[0]; - inPair.second = inPair.first + inParams.size(); + inPair.second = inPair.first + inParams.size(); } return ice_invoke(operation, mode, inPair, outParams, context); } @@ -246,73 +246,73 @@ IceProxy::Ice::Object::ice_invoke(const string& operation, bool IceProxy::Ice::Object::ice_invoke(const string& operation, - OperationMode mode, - const pair<const Byte*, const Byte*>& inParams, - vector<Byte>& outParams, - const Context* context) + OperationMode mode, + const pair<const Byte*, const Byte*>& inParams, + vector<Byte>& outParams, + const Context* context) { int __cnt = 0; while(true) { - Handle< ::IceDelegate::Ice::Object> __del; - try - { - __del = __getDelegate(); - return __del->ice_invoke(operation, mode, inParams, outParams, context); - } - catch(const LocalExceptionWrapper& __ex) - { - bool canRetry = mode == Nonmutating || mode == Idempotent; - if(canRetry) - { - __handleExceptionWrapperRelaxed(__del, __ex, __cnt); - } - else - { - __handleExceptionWrapper(__del, __ex); - } - } - catch(const LocalException& __ex) - { - __handleException(__del, __ex, __cnt); - } + Handle< ::IceDelegate::Ice::Object> __del; + try + { + __del = __getDelegate(); + return __del->ice_invoke(operation, mode, inParams, outParams, context); + } + catch(const LocalExceptionWrapper& __ex) + { + bool canRetry = mode == Nonmutating || mode == Idempotent; + if(canRetry) + { + __handleExceptionWrapperRelaxed(__del, __ex, __cnt); + } + else + { + __handleExceptionWrapper(__del, __ex); + } + } + catch(const LocalException& __ex) + { + __handleException(__del, __ex, __cnt); + } } } void IceProxy::Ice::Object::ice_invoke_async(const AMI_Object_ice_invokePtr& cb, - const string& operation, - OperationMode mode, - const vector<Byte>& inParams) + const string& operation, + OperationMode mode, + const vector<Byte>& inParams) { cb->__invoke(this, operation, mode, inParams, 0); } void IceProxy::Ice::Object::ice_invoke_async(const AMI_Object_ice_invokePtr& cb, - const string& operation, - OperationMode mode, - const vector<Byte>& inParams, - const Context& context) + const string& operation, + OperationMode mode, + const vector<Byte>& inParams, + const Context& context) { cb->__invoke(this, operation, mode, inParams, &context); } void IceProxy::Ice::Object::ice_invoke_async(const AMI_Array_Object_ice_invokePtr& cb, - const string& operation, - OperationMode mode, - const pair<const Byte*, const Byte*>& inParams) + const string& operation, + OperationMode mode, + const pair<const Byte*, const Byte*>& inParams) { cb->__invoke(this, operation, mode, inParams, 0); } void IceProxy::Ice::Object::ice_invoke_async(const AMI_Array_Object_ice_invokePtr& cb, - const string& operation, - OperationMode mode, - const pair<const Byte*, const Byte*>& inParams, - const Context& context) + const string& operation, + OperationMode mode, + const pair<const Byte*, const Byte*>& inParams, + const Context& context) { cb->__invoke(this, operation, mode, inParams, &context); } @@ -332,13 +332,13 @@ IceProxy::Ice::Object::ice_identity(const Identity& newIdentity) const } if(newIdentity == _reference->getIdentity()) { - return ObjectPrx(const_cast< ::IceProxy::Ice::Object*>(this)); + return ObjectPrx(const_cast< ::IceProxy::Ice::Object*>(this)); } else { - ObjectPrx proxy(new ::IceProxy::Ice::Object()); - proxy->setup(_reference->changeIdentity(newIdentity)); - return proxy; + ObjectPrx proxy(new ::IceProxy::Ice::Object()); + proxy->setup(_reference->changeIdentity(newIdentity)); + return proxy; } } @@ -387,13 +387,13 @@ IceProxy::Ice::Object::ice_facet(const string& newFacet) const { if(newFacet == _reference->getFacet()) { - return ObjectPrx(const_cast< ::IceProxy::Ice::Object*>(this)); + return ObjectPrx(const_cast< ::IceProxy::Ice::Object*>(this)); } else { - ObjectPrx proxy(new ::IceProxy::Ice::Object()); - proxy->setup(_reference->changeFacet(newFacet)); - return proxy; + ObjectPrx proxy(new ::IceProxy::Ice::Object()); + proxy->setup(_reference->changeFacet(newFacet)); + return proxy; } } @@ -414,13 +414,13 @@ IceProxy::Ice::Object::ice_adapterId(const string& newAdapterId) const { if(newAdapterId == _reference->getAdapterId()) { - return ObjectPrx(const_cast< ::IceProxy::Ice::Object*>(this)); + return ObjectPrx(const_cast< ::IceProxy::Ice::Object*>(this)); } else { - ObjectPrx proxy(new ::IceProxy::Ice::Object()); - proxy->setup(_reference->changeAdapterId(newAdapterId)); - return proxy; + ObjectPrx proxy(new ::IceProxy::Ice::Object()); + proxy->setup(_reference->changeAdapterId(newAdapterId)); + return proxy; } } @@ -437,7 +437,7 @@ IceProxy::Ice::Object::ice_getEndpoints() const EndpointSeq retSeq; for(vector<EndpointIPtr>::const_iterator p = endpoints.begin(); p != endpoints.end(); ++p) { - retSeq.push_back(EndpointPtr::dynamicCast(*p)); + retSeq.push_back(EndpointPtr::dynamicCast(*p)); } return retSeq; } @@ -448,18 +448,18 @@ IceProxy::Ice::Object::ice_endpoints(const EndpointSeq& newEndpoints) const vector<EndpointIPtr> endpoints; for(EndpointSeq::const_iterator p = newEndpoints.begin(); p != newEndpoints.end(); ++p) { - endpoints.push_back(EndpointIPtr::dynamicCast(*p)); + endpoints.push_back(EndpointIPtr::dynamicCast(*p)); } if(endpoints == _reference->getEndpoints()) { - return ObjectPrx(const_cast< ::IceProxy::Ice::Object*>(this)); + return ObjectPrx(const_cast< ::IceProxy::Ice::Object*>(this)); } else { - ObjectPrx proxy(new ::IceProxy::Ice::Object()); - proxy->setup(_reference->changeEndpoints(endpoints)); - return proxy; + ObjectPrx proxy(new ::IceProxy::Ice::Object()); + proxy->setup(_reference->changeEndpoints(endpoints)); + return proxy; } } @@ -480,13 +480,13 @@ IceProxy::Ice::Object::ice_locatorCacheTimeout(Int newTimeout) const { if(newTimeout == _reference->getLocatorCacheTimeout()) { - return ObjectPrx(const_cast< ::IceProxy::Ice::Object*>(this)); + return ObjectPrx(const_cast< ::IceProxy::Ice::Object*>(this)); } else { - ObjectPrx proxy(new ::IceProxy::Ice::Object()); - proxy->setup(_reference->changeLocatorCacheTimeout(newTimeout)); - return proxy; + ObjectPrx proxy(new ::IceProxy::Ice::Object()); + proxy->setup(_reference->changeLocatorCacheTimeout(newTimeout)); + return proxy; } } @@ -501,13 +501,13 @@ IceProxy::Ice::Object::ice_connectionCached(bool newCache) const { if(newCache == _reference->getCacheConnection()) { - return ObjectPrx(const_cast< ::IceProxy::Ice::Object*>(this)); + return ObjectPrx(const_cast< ::IceProxy::Ice::Object*>(this)); } else { - ObjectPrx proxy(new ::IceProxy::Ice::Object()); - proxy->setup(_reference->changeCacheConnection(newCache)); - return proxy; + ObjectPrx proxy(new ::IceProxy::Ice::Object()); + proxy->setup(_reference->changeCacheConnection(newCache)); + return proxy; } } @@ -522,13 +522,13 @@ IceProxy::Ice::Object::ice_endpointSelection(EndpointSelectionType newType) cons { if(newType == _reference->getEndpointSelection()) { - return ObjectPrx(const_cast< ::IceProxy::Ice::Object*>(this)); + return ObjectPrx(const_cast< ::IceProxy::Ice::Object*>(this)); } else { - ObjectPrx proxy(new ::IceProxy::Ice::Object()); - proxy->setup(_reference->changeEndpointSelection(newType)); - return proxy; + ObjectPrx proxy(new ::IceProxy::Ice::Object()); + proxy->setup(_reference->changeEndpointSelection(newType)); + return proxy; } } @@ -543,13 +543,13 @@ IceProxy::Ice::Object::ice_secure(bool b) const { if(b == _reference->getSecure()) { - return ObjectPrx(const_cast< ::IceProxy::Ice::Object*>(this)); + return ObjectPrx(const_cast< ::IceProxy::Ice::Object*>(this)); } else { - ObjectPrx proxy(new ::IceProxy::Ice::Object()); - proxy->setup(_reference->changeSecure(b)); - return proxy; + ObjectPrx proxy(new ::IceProxy::Ice::Object()); + proxy->setup(_reference->changeSecure(b)); + return proxy; } } @@ -564,13 +564,13 @@ IceProxy::Ice::Object::ice_preferSecure(bool b) const { if(b == _reference->getPreferSecure()) { - return ObjectPrx(const_cast< ::IceProxy::Ice::Object*>(this)); + return ObjectPrx(const_cast< ::IceProxy::Ice::Object*>(this)); } else { - ObjectPrx proxy(new ::IceProxy::Ice::Object()); - proxy->setup(_reference->changePreferSecure(b)); - return proxy; + ObjectPrx proxy(new ::IceProxy::Ice::Object()); + proxy->setup(_reference->changePreferSecure(b)); + return proxy; } } @@ -587,13 +587,13 @@ IceProxy::Ice::Object::ice_router(const RouterPrx& router) const ReferencePtr ref = _reference->changeRouter(router); if(ref == _reference) { - return ObjectPrx(const_cast< ::IceProxy::Ice::Object*>(this)); + return ObjectPrx(const_cast< ::IceProxy::Ice::Object*>(this)); } else { - ObjectPrx proxy(new ::IceProxy::Ice::Object()); - proxy->setup(ref); - return proxy; + ObjectPrx proxy(new ::IceProxy::Ice::Object()); + proxy->setup(ref); + return proxy; } } @@ -610,13 +610,13 @@ IceProxy::Ice::Object::ice_locator(const LocatorPrx& locator) const ReferencePtr ref = _reference->changeLocator(locator); if(ref == _reference) { - return ObjectPrx(const_cast< ::IceProxy::Ice::Object*>(this)); + return ObjectPrx(const_cast< ::IceProxy::Ice::Object*>(this)); } else { - ObjectPrx proxy(new ::IceProxy::Ice::Object()); - proxy->setup(ref); - return proxy; + ObjectPrx proxy(new ::IceProxy::Ice::Object()); + proxy->setup(ref); + return proxy; } } @@ -637,13 +637,13 @@ IceProxy::Ice::Object::ice_collocationOptimized(bool b) const { if(b == _reference->getCollocationOptimization()) { - return ObjectPrx(const_cast< ::IceProxy::Ice::Object*>(this)); + return ObjectPrx(const_cast< ::IceProxy::Ice::Object*>(this)); } else { - ObjectPrx proxy(new ::IceProxy::Ice::Object()); - proxy->setup(_reference->changeCollocationOptimization(b)); - return proxy; + ObjectPrx proxy(new ::IceProxy::Ice::Object()); + proxy->setup(_reference->changeCollocationOptimization(b)); + return proxy; } } @@ -652,13 +652,13 @@ IceProxy::Ice::Object::ice_twoway() const { if(_reference->getMode() == Reference::ModeTwoway) { - return ObjectPrx(const_cast< ::IceProxy::Ice::Object*>(this)); + return ObjectPrx(const_cast< ::IceProxy::Ice::Object*>(this)); } else { - ObjectPrx proxy(new ::IceProxy::Ice::Object()); - proxy->setup(_reference->changeMode(Reference::ModeTwoway)); - return proxy; + ObjectPrx proxy(new ::IceProxy::Ice::Object()); + proxy->setup(_reference->changeMode(Reference::ModeTwoway)); + return proxy; } } @@ -673,13 +673,13 @@ IceProxy::Ice::Object::ice_oneway() const { if(_reference->getMode() == Reference::ModeOneway) { - return ObjectPrx(const_cast< ::IceProxy::Ice::Object*>(this)); + return ObjectPrx(const_cast< ::IceProxy::Ice::Object*>(this)); } else { - ObjectPrx proxy(new ::IceProxy::Ice::Object()); - proxy->setup(_reference->changeMode(Reference::ModeOneway)); - return proxy; + ObjectPrx proxy(new ::IceProxy::Ice::Object()); + proxy->setup(_reference->changeMode(Reference::ModeOneway)); + return proxy; } } @@ -694,13 +694,13 @@ IceProxy::Ice::Object::ice_batchOneway() const { if(_reference->getMode() == Reference::ModeBatchOneway) { - return ObjectPrx(const_cast< ::IceProxy::Ice::Object*>(this)); + return ObjectPrx(const_cast< ::IceProxy::Ice::Object*>(this)); } else { - ObjectPrx proxy(new ::IceProxy::Ice::Object()); - proxy->setup(_reference->changeMode(Reference::ModeBatchOneway)); - return proxy; + ObjectPrx proxy(new ::IceProxy::Ice::Object()); + proxy->setup(_reference->changeMode(Reference::ModeBatchOneway)); + return proxy; } } @@ -715,13 +715,13 @@ IceProxy::Ice::Object::ice_datagram() const { if(_reference->getMode() == Reference::ModeDatagram) { - return ObjectPrx(const_cast< ::IceProxy::Ice::Object*>(this)); + return ObjectPrx(const_cast< ::IceProxy::Ice::Object*>(this)); } else { - ObjectPrx proxy(new ::IceProxy::Ice::Object()); - proxy->setup(_reference->changeMode(Reference::ModeDatagram)); - return proxy; + ObjectPrx proxy(new ::IceProxy::Ice::Object()); + proxy->setup(_reference->changeMode(Reference::ModeDatagram)); + return proxy; } } @@ -736,13 +736,13 @@ IceProxy::Ice::Object::ice_batchDatagram() const { if(_reference->getMode() == Reference::ModeBatchDatagram) { - return ObjectPrx(const_cast< ::IceProxy::Ice::Object*>(this)); + return ObjectPrx(const_cast< ::IceProxy::Ice::Object*>(this)); } else { - ObjectPrx proxy(new ::IceProxy::Ice::Object()); - proxy->setup(_reference->changeMode(Reference::ModeBatchDatagram)); - return proxy; + ObjectPrx proxy(new ::IceProxy::Ice::Object()); + proxy->setup(_reference->changeMode(Reference::ModeBatchDatagram)); + return proxy; } } @@ -758,13 +758,13 @@ IceProxy::Ice::Object::ice_compress(bool b) const ReferencePtr ref = _reference->changeCompress(b); if(ref == _reference) { - return ObjectPrx(const_cast< ::IceProxy::Ice::Object*>(this)); + return ObjectPrx(const_cast< ::IceProxy::Ice::Object*>(this)); } else { - ObjectPrx proxy(new ::IceProxy::Ice::Object()); - proxy->setup(ref); - return proxy; + ObjectPrx proxy(new ::IceProxy::Ice::Object()); + proxy->setup(ref); + return proxy; } } @@ -774,13 +774,13 @@ IceProxy::Ice::Object::ice_timeout(int t) const ReferencePtr ref = _reference->changeTimeout(t); if(ref == _reference) { - return ObjectPrx(const_cast< ::IceProxy::Ice::Object*>(this)); + return ObjectPrx(const_cast< ::IceProxy::Ice::Object*>(this)); } else { - ObjectPrx proxy(new ::IceProxy::Ice::Object()); - proxy->setup(ref); - return proxy; + ObjectPrx proxy(new ::IceProxy::Ice::Object()); + proxy->setup(ref); + return proxy; } } @@ -790,13 +790,13 @@ IceProxy::Ice::Object::ice_connectionId(const string& id) const ReferencePtr ref = _reference->changeConnectionId(id); if(ref == _reference) { - return ObjectPrx(const_cast< ::IceProxy::Ice::Object*>(this)); + return ObjectPrx(const_cast< ::IceProxy::Ice::Object*>(this)); } else { - ObjectPrx proxy(new ::IceProxy::Ice::Object()); - proxy->setup(ref); - return proxy; + ObjectPrx proxy(new ::IceProxy::Ice::Object()); + proxy->setup(ref); + return proxy; } } @@ -834,17 +834,17 @@ IceProxy::Ice::Object::ice_getConnection() int __cnt = 0; while(true) { - Handle< ::IceDelegate::Ice::Object> __del; - try - { - __del = __getDelegate(); - bool compress; - return __del->__getConnection(compress); - } - catch(const LocalException& __ex) - { - __handleException(__del, __ex, __cnt); - } + Handle< ::IceDelegate::Ice::Object> __del; + try + { + __del = __getDelegate(); + bool compress; + return __del->__getConnection(compress); + } + catch(const LocalException& __ex) + { + __handleException(__del, __ex, __cnt); + } } } @@ -853,20 +853,20 @@ IceProxy::Ice::Object::ice_getCachedConnection() const { Handle< ::IceDelegate::Ice::Object> __del; { - IceUtil::Mutex::Lock sync(*this); - __del = _delegate; + IceUtil::Mutex::Lock sync(*this); + __del = _delegate; } if(__del) { - try - { - bool compress; - return __del->__getConnection(compress); - } - catch(const CollocationOptimizationException&) - { - } + try + { + bool compress; + return __del->__getConnection(compress); + } + catch(const CollocationOptimizationException&) + { + } } return 0; } @@ -885,11 +885,11 @@ IceProxy::Ice::Object::__copyFrom(const ObjectPrx& from) Handle< ::IceDelegateM::Ice::Object> delegateM; { - IceUtil::Mutex::Lock sync(*from.get()); + IceUtil::Mutex::Lock sync(*from.get()); - ref = from->_reference; - delegateD = dynamic_cast< ::IceDelegateD::Ice::Object*>(from->_delegate.get()); - delegateM = dynamic_cast< ::IceDelegateM::Ice::Object*>(from->_delegate.get()); + ref = from->_reference; + delegateD = dynamic_cast< ::IceDelegateD::Ice::Object*>(from->_delegate.get()); + delegateM = dynamic_cast< ::IceDelegateM::Ice::Object*>(from->_delegate.get()); } // @@ -904,31 +904,31 @@ IceProxy::Ice::Object::__copyFrom(const ObjectPrx& from) if(_reference->getCacheConnection()) { - // - // The _delegate attribute is only used if "cache connection" - // is enabled. If it's not enabled, we don't keep track of the - // delegate -- a new delegate is created for each invocations. - // + // + // The _delegate attribute is only used if "cache connection" + // is enabled. If it's not enabled, we don't keep track of the + // delegate -- a new delegate is created for each invocations. + // - if(delegateD) - { - Handle< ::IceDelegateD::Ice::Object> delegate = __createDelegateD(); - delegate->__copyFrom(delegateD); - _delegate = delegate; - } - else if(delegateM) - { - Handle< ::IceDelegateM::Ice::Object> delegate = __createDelegateM(); - delegate->__copyFrom(delegateM); - _delegate = delegate; - } + if(delegateD) + { + Handle< ::IceDelegateD::Ice::Object> delegate = __createDelegateD(); + delegate->__copyFrom(delegateD); + _delegate = delegate; + } + else if(delegateM) + { + Handle< ::IceDelegateM::Ice::Object> delegate = __createDelegateM(); + delegate->__copyFrom(delegateM); + _delegate = delegate; + } } } void IceProxy::Ice::Object::__handleException(const ::IceInternal::Handle< ::IceDelegate::Ice::Object>& delegate, - const LocalException& ex, - int& cnt) + const LocalException& ex, + int& cnt) { // // Only _delegate needs to be mutex protected here. @@ -936,7 +936,7 @@ IceProxy::Ice::Object::__handleException(const ::IceInternal::Handle< ::IceDeleg IceUtil::Mutex::Lock sync(*this); if(delegate.get() == _delegate.get()) { - _delegate = 0; + _delegate = 0; } ProxyFactoryPtr proxyFactory; @@ -946,9 +946,9 @@ IceProxy::Ice::Object::__handleException(const ::IceInternal::Handle< ::IceDeleg } catch(const CommunicatorDestroyedException&) { - // - // The communicator is already destroyed, so we cannot retry. - // + // + // The communicator is already destroyed, so we cannot retry. + // ex.ice_throw(); } @@ -958,37 +958,37 @@ IceProxy::Ice::Object::__handleException(const ::IceInternal::Handle< ::IceDeleg void IceProxy::Ice::Object::__handleExceptionWrapper(const ::IceInternal::Handle< ::IceDelegate::Ice::Object>& delegate, - const LocalExceptionWrapper& ex) + const LocalExceptionWrapper& ex) { { - IceUtil::Mutex::Lock sync(*this); - if(delegate.get() == _delegate.get()) - { - _delegate = 0; - } + IceUtil::Mutex::Lock sync(*this); + if(delegate.get() == _delegate.get()) + { + _delegate = 0; + } } if(!ex.retry()) { - ex.get()->ice_throw(); + ex.get()->ice_throw(); } } void IceProxy::Ice::Object::__handleExceptionWrapperRelaxed(const ::IceInternal::Handle< ::IceDelegate::Ice::Object>& del, - const LocalExceptionWrapper& ex, int& cnt) + const LocalExceptionWrapper& ex, int& cnt) { if(!ex.retry()) { - __handleException(del, *ex.get(), cnt); + __handleException(del, *ex.get(), cnt); } else { - IceUtil::Mutex::Lock sync(*this); - if(del.get() == _delegate.get()) - { - _delegate = 0; - } + IceUtil::Mutex::Lock sync(*this); + if(del.get() == _delegate.get()) + { + _delegate = 0; + } } } @@ -1009,8 +1009,8 @@ IceProxy::Ice::Object::__checkTwowayOnly(const char* name) const if(!ice_isTwoway()) { TwowayOnlyException ex(__FILE__, __LINE__); - ex.operation = name; - throw ex; + ex.operation = name; + throw ex; } } @@ -1025,8 +1025,8 @@ IceProxy::Ice::Object::__checkTwowayOnly(const string& name) const if(!ice_isTwoway()) { TwowayOnlyException ex(__FILE__, __LINE__); - ex.operation = name; - throw ex; + ex.operation = name; + throw ex; } } @@ -1043,47 +1043,47 @@ IceProxy::Ice::Object::__getDelegate() if(_delegate) { - return _delegate; + return _delegate; } Handle< ::IceDelegate::Ice::Object> delegate; if(_reference->getCollocationOptimization()) { - ObjectAdapterPtr adapter = _reference->getInstance()->objectAdapterFactory()->findObjectAdapter(this); - if(adapter) - { - Handle< ::IceDelegateD::Ice::Object> d = __createDelegateD(); - d->setup(_reference, adapter); - delegate = d; - } + ObjectAdapterPtr adapter = _reference->getInstance()->objectAdapterFactory()->findObjectAdapter(this); + if(adapter) + { + Handle< ::IceDelegateD::Ice::Object> d = __createDelegateD(); + d->setup(_reference, adapter); + delegate = d; + } } if(!delegate) { - Handle< ::IceDelegateM::Ice::Object> d = __createDelegateM(); - d->setup(_reference); - delegate = d; - - // - // If this proxy is for a non-local object, and we are - // using a router, then add this proxy to the router info - // object. - // - RouterInfoPtr ri = _reference->getRouterInfo(); - if(ri) - { - ri->addProxy(this); - } + Handle< ::IceDelegateM::Ice::Object> d = __createDelegateM(); + d->setup(_reference); + delegate = d; + + // + // If this proxy is for a non-local object, and we are + // using a router, then add this proxy to the router info + // object. + // + RouterInfoPtr ri = _reference->getRouterInfo(); + if(ri) + { + ri->addProxy(this); + } } if(_reference->getCacheConnection()) { - // - // The _delegate attribute is only used if "cache connection" - // is enabled. If it's not enabled, we don't keep track of the - // delegate -- a new delegate is created for each invocations. - // - _delegate = delegate; + // + // The _delegate attribute is only used if "cache connection" + // is enabled. If it's not enabled, we don't keep track of the + // delegate -- a new delegate is created for each invocations. + // + _delegate = delegate; } return delegate; @@ -1126,34 +1126,34 @@ IceDelegateM::Ice::Object::ice_isA(const string& __id, const Context* context) Outgoing __og(__connection.get(), __reference.get(), __operation, ::Ice::Nonmutating, context, __compress); try { - BasicStream* __os = __og.os(); - __os->write(__id, false); + BasicStream* __os = __og.os(); + __os->write(__id, false); } catch(const ::Ice::LocalException& __ex) { - __og.abort(__ex); + __og.abort(__ex); } bool __ret; bool __ok = __og.invoke(); try { - BasicStream* __is = __og.is(); - if(!__ok) - { - try - { - __is->throwException(); - } - catch(const ::Ice::UserException& __ex) - { - throw ::Ice::UnknownUserException(__FILE__, __LINE__, __ex.ice_name()); - } - } + BasicStream* __is = __og.is(); + if(!__ok) + { + try + { + __is->throwException(); + } + catch(const ::Ice::UserException& __ex) + { + throw ::Ice::UnknownUserException(__FILE__, __LINE__, __ex.ice_name()); + } + } __is->read(__ret); } catch(const ::Ice::LocalException& __ex) { - throw ::IceInternal::LocalExceptionWrapper(__ex, false); + throw ::IceInternal::LocalExceptionWrapper(__ex, false); } return __ret; } @@ -1166,22 +1166,22 @@ IceDelegateM::Ice::Object::ice_ping(const Context* context) bool __ok = __og.invoke(); try { - BasicStream* __is = __og.is(); - if(!__ok) - { - try - { - __is->throwException(); - } - catch(const ::Ice::UserException& __ex) - { - throw ::Ice::UnknownUserException(__FILE__, __LINE__, __ex.ice_name()); - } - } + BasicStream* __is = __og.is(); + if(!__ok) + { + try + { + __is->throwException(); + } + catch(const ::Ice::UserException& __ex) + { + throw ::Ice::UnknownUserException(__FILE__, __LINE__, __ex.ice_name()); + } + } } catch(const ::Ice::LocalException& __ex) { - throw ::IceInternal::LocalExceptionWrapper(__ex, false); + throw ::IceInternal::LocalExceptionWrapper(__ex, false); } } @@ -1194,23 +1194,23 @@ IceDelegateM::Ice::Object::ice_ids(const Context* context) bool __ok = __og.invoke(); try { - BasicStream* __is = __og.is(); - if(!__ok) - { - try - { - __is->throwException(); - } - catch(const ::Ice::UserException& __ex) - { - throw ::Ice::UnknownUserException(__FILE__, __LINE__, __ex.ice_name()); - } - } - __is->read(__ret, false); + BasicStream* __is = __og.is(); + if(!__ok) + { + try + { + __is->throwException(); + } + catch(const ::Ice::UserException& __ex) + { + throw ::Ice::UnknownUserException(__FILE__, __LINE__, __ex.ice_name()); + } + } + __is->read(__ret, false); } catch(const ::Ice::LocalException& __ex) { - throw ::IceInternal::LocalExceptionWrapper(__ex, false); + throw ::IceInternal::LocalExceptionWrapper(__ex, false); } return __ret; } @@ -1224,23 +1224,23 @@ IceDelegateM::Ice::Object::ice_id(const Context* context) bool __ok = __og.invoke(); try { - BasicStream* __is = __og.is(); - if(!__ok) - { - try - { - __is->throwException(); - } - catch(const ::Ice::UserException& __ex) - { - throw ::Ice::UnknownUserException(__FILE__, __LINE__, __ex.ice_name()); - } - } - __is->read(__ret, false); + BasicStream* __is = __og.is(); + if(!__ok) + { + try + { + __is->throwException(); + } + catch(const ::Ice::UserException& __ex) + { + throw ::Ice::UnknownUserException(__FILE__, __LINE__, __ex.ice_name()); + } + } + __is->read(__ret, false); } catch(const ::Ice::LocalException& __ex) { - throw ::IceInternal::LocalExceptionWrapper(__ex, false); + throw ::IceInternal::LocalExceptionWrapper(__ex, false); } return __ret; } @@ -1248,19 +1248,19 @@ IceDelegateM::Ice::Object::ice_id(const Context* context) bool IceDelegateM::Ice::Object::ice_invoke(const string& operation, OperationMode mode, - const pair<const Byte*, const Byte*>& inParams, - vector<Byte>& outParams, - const Context* context) + const pair<const Byte*, const Byte*>& inParams, + vector<Byte>& outParams, + const Context* context) { Outgoing __og(__connection.get(), __reference.get(), operation, mode, context, __compress); try { - BasicStream* __os = __og.os(); - __os->writeBlob(inParams.first, static_cast<Int>(inParams.second - inParams.first)); + BasicStream* __os = __og.os(); + __os->writeBlob(inParams.first, static_cast<Int>(inParams.second - inParams.first)); } catch(const ::Ice::LocalException& __ex) { - __og.abort(__ex); + __og.abort(__ex); } bool ok = __og.invoke(); if(__reference->getMode() == Reference::ModeTwoway) @@ -1329,19 +1329,19 @@ IceDelegateD::Ice::Object::ice_isA(const string& __id, const Context* context) __initCurrent(__current, "ice_isA", ::Ice::Nonmutating, context); while(true) { - Direct __direct(__current); - bool __ret; - try - { - __ret = __direct.servant()->ice_isA(__id, __current); - } - catch(...) - { - __direct.destroy(); - throw; - } - __direct.destroy(); - return __ret; + Direct __direct(__current); + bool __ret; + try + { + __ret = __direct.servant()->ice_isA(__id, __current); + } + catch(...) + { + __direct.destroy(); + throw; + } + __direct.destroy(); + return __ret; } return false; // To keep the Visual C++ compiler happy. } @@ -1353,18 +1353,18 @@ IceDelegateD::Ice::Object::ice_ping(const ::Ice::Context* context) __initCurrent(__current, "ice_ping", ::Ice::Nonmutating, context); while(true) { - Direct __direct(__current); - try - { - __direct.servant()->ice_ping(__current); - } - catch(...) - { - __direct.destroy(); - throw; - } - __direct.destroy(); - return; + Direct __direct(__current); + try + { + __direct.servant()->ice_ping(__current); + } + catch(...) + { + __direct.destroy(); + throw; + } + __direct.destroy(); + return; } } @@ -1375,19 +1375,19 @@ IceDelegateD::Ice::Object::ice_ids(const ::Ice::Context* context) __initCurrent(__current, "ice_ids", ::Ice::Nonmutating, context); while(true) { - Direct __direct(__current); - vector<string> __ret; - try - { - __ret = __direct.servant()->ice_ids(__current); - } - catch(...) - { - __direct.destroy(); - throw; - } - __direct.destroy(); - return __ret; + Direct __direct(__current); + vector<string> __ret; + try + { + __ret = __direct.servant()->ice_ids(__current); + } + catch(...) + { + __direct.destroy(); + throw; + } + __direct.destroy(); + return __ret; } return vector<string>(); // To keep the Visual C++ compiler happy. } @@ -1399,29 +1399,29 @@ IceDelegateD::Ice::Object::ice_id(const ::Ice::Context* context) __initCurrent(__current, "ice_id", ::Ice::Nonmutating, context); while(true) { - Direct __direct(__current); - string __ret; - try - { - __ret = __direct.servant()->ice_id(__current); - } - catch(...) - { - __direct.destroy(); - throw; - } - __direct.destroy(); - return __ret; + Direct __direct(__current); + string __ret; + try + { + __ret = __direct.servant()->ice_id(__current); + } + catch(...) + { + __direct.destroy(); + throw; + } + __direct.destroy(); + return __ret; } return string(); // To keep the Visual C++ compiler happy. } bool IceDelegateD::Ice::Object::ice_invoke(const string&, - OperationMode, - const pair<const Byte*, const Byte*>& inParams, - vector<Byte>&, - const Context*) + OperationMode, + const pair<const Byte*, const Byte*>& inParams, + vector<Byte>&, + const Context*) { throw CollocationOptimizationException(__FILE__, __LINE__); return false; @@ -1456,7 +1456,7 @@ IceDelegateD::Ice::Object::__copyFrom(const ::IceInternal::Handle< ::IceDelegate void IceDelegateD::Ice::Object::__initCurrent(Current& current, const string& op, OperationMode mode, - const Context* context) + const Context* context) { current.adapter = __adapter; current.id = __reference->getIdentity(); @@ -1465,29 +1465,29 @@ IceDelegateD::Ice::Object::__initCurrent(Current& current, const string& op, Ope current.mode = mode; if(context != 0) { - // - // Explicit context - // - current.ctx = *context; + // + // Explicit context + // + current.ctx = *context; } else { - // - // Implicit context - // - const ImplicitContextIPtr& implicitContext = - __reference->getInstance()->getImplicitContext(); + // + // Implicit context + // + const ImplicitContextIPtr& implicitContext = + __reference->getInstance()->getImplicitContext(); - const Context& prxContext = __reference->getContext()->getValue(); + const Context& prxContext = __reference->getContext()->getValue(); - if(implicitContext == 0) - { - current.ctx = prxContext; - } - else - { - implicitContext->combine(prxContext, current.ctx); - } + if(implicitContext == 0) + { + current.ctx = prxContext; + } + else + { + implicitContext->combine(prxContext, current.ctx); + } } current.requestId = -1; } @@ -1512,19 +1512,19 @@ Ice::proxyIdentityLess(const ObjectPrx& lhs, const ObjectPrx& rhs) { if(!lhs && !rhs) { - return false; + return false; } else if(!lhs && rhs) { - return true; + return true; } else if(lhs && !rhs) { - return false; + return false; } else { - return lhs->ice_getIdentity() < rhs->ice_getIdentity(); + return lhs->ice_getIdentity() < rhs->ice_getIdentity(); } } @@ -1533,19 +1533,19 @@ Ice::proxyIdentityEqual(const ObjectPrx& lhs, const ObjectPrx& rhs) { if(!lhs && !rhs) { - return true; + return true; } else if(!lhs && rhs) { - return false; + return false; } else if(lhs && !rhs) { - return false; + return false; } else { - return lhs->ice_getIdentity() == rhs->ice_getIdentity(); + return lhs->ice_getIdentity() == rhs->ice_getIdentity(); } } @@ -1554,43 +1554,43 @@ Ice::proxyIdentityAndFacetLess(const ObjectPrx& lhs, const ObjectPrx& rhs) { if(!lhs && !rhs) { - return false; + return false; } else if(!lhs && rhs) { - return true; + return true; } else if(lhs && !rhs) { - return false; + return false; } else { - Identity lhsIdentity = lhs->ice_getIdentity(); - Identity rhsIdentity = rhs->ice_getIdentity(); - - if(lhsIdentity < rhsIdentity) - { - return true; - } - else if(rhsIdentity < lhsIdentity) - { - return false; - } - - string lhsFacet = lhs->ice_getFacet(); - string rhsFacet = rhs->ice_getFacet(); - - if(lhsFacet < rhsFacet) - { - return true; - } - else if(rhsFacet < lhsFacet) - { - return false; - } - - return false; + Identity lhsIdentity = lhs->ice_getIdentity(); + Identity rhsIdentity = rhs->ice_getIdentity(); + + if(lhsIdentity < rhsIdentity) + { + return true; + } + else if(rhsIdentity < lhsIdentity) + { + return false; + } + + string lhsFacet = lhs->ice_getFacet(); + string rhsFacet = rhs->ice_getFacet(); + + if(lhsFacet < rhsFacet) + { + return true; + } + else if(rhsFacet < lhsFacet) + { + return false; + } + + return false; } } @@ -1599,33 +1599,33 @@ Ice::proxyIdentityAndFacetEqual(const ObjectPrx& lhs, const ObjectPrx& rhs) { if(!lhs && !rhs) { - return true; + return true; } else if(!lhs && rhs) { - return false; + return false; } else if(lhs && !rhs) { - return false; + return false; } else { - Identity lhsIdentity = lhs->ice_getIdentity(); - Identity rhsIdentity = rhs->ice_getIdentity(); - - if(lhsIdentity == rhsIdentity) - { - string lhsFacet = lhs->ice_getFacet(); - string rhsFacet = rhs->ice_getFacet(); - - if(lhsFacet == rhsFacet) - { - return true; - } - } - - return false; + Identity lhsIdentity = lhs->ice_getIdentity(); + Identity rhsIdentity = rhs->ice_getIdentity(); + + if(lhsIdentity == rhsIdentity) + { + string lhsFacet = lhs->ice_getFacet(); + string rhsFacet = rhs->ice_getFacet(); + + if(lhsFacet == rhsFacet) + { + return true; + } + } + + return false; } } |