diff options
author | Marc Laukien <marc@zeroc.com> | 2001-11-25 15:34:03 +0000 |
---|---|---|
committer | Marc Laukien <marc@zeroc.com> | 2001-11-25 15:34:03 +0000 |
commit | 93944cf8efcde3080f79088c78d97ff9ea3e6f15 (patch) | |
tree | ed06cf02478b01816796ba27ee216f5b56f81470 /cpp/src | |
parent | fix (diff) | |
download | ice-93944cf8efcde3080f79088c78d97ff9ea3e6f15.tar.bz2 ice-93944cf8efcde3080f79088c78d97ff9ea3e6f15.tar.xz ice-93944cf8efcde3080f79088c78d97ff9ea3e6f15.zip |
Blobject
Diffstat (limited to 'cpp/src')
-rw-r--r-- | cpp/src/Ice/Incoming.cpp | 4 | ||||
-rw-r--r-- | cpp/src/Ice/Object.cpp | 22 | ||||
-rw-r--r-- | cpp/src/Ice/Proxy.cpp | 73 | ||||
-rw-r--r-- | cpp/src/slice2cpp/Gen.cpp | 8 |
4 files changed, 100 insertions, 7 deletions
diff --git a/cpp/src/Ice/Incoming.cpp b/cpp/src/Ice/Incoming.cpp index e02c7da9be4..276c93ad5ba 100644 --- a/cpp/src/Ice/Incoming.cpp +++ b/cpp/src/Ice/Incoming.cpp @@ -89,7 +89,7 @@ IceInternal::Incoming::invoke() else { _os.write(static_cast<Byte>(DispatchOK)); - DispatchStatus status = facetServant->__dispatch(*this, operation); + DispatchStatus status = facetServant->__dispatch(*this, identity, facet, operation); _is.checkReadEncaps(); *(_os.b.begin() + statusPos) = static_cast<Byte>(status); } @@ -97,7 +97,7 @@ IceInternal::Incoming::invoke() else { _os.write(static_cast<Byte>(DispatchOK)); - DispatchStatus status = servant->__dispatch(*this, operation); + DispatchStatus status = servant->__dispatch(*this, identity, facet, operation); _is.checkReadEncaps(); *(_os.b.begin() + statusPos) = static_cast<Byte>(status); } diff --git a/cpp/src/Ice/Object.cpp b/cpp/src/Ice/Object.cpp index 9c8d3e3ebf7..2179b78bb8a 100644 --- a/cpp/src/Ice/Object.cpp +++ b/cpp/src/Ice/Object.cpp @@ -51,6 +51,17 @@ Ice::Object::ice_hash() const return reinterpret_cast<Int>(this); } +const char* Ice::Object::__classIds[] = +{ + "::Ice::Object" +}; + +const char** +Ice::Object::__getClassIds() +{ + return __classIds; +} + bool Ice::Object::ice_isA(const string& s) { @@ -89,7 +100,7 @@ const char* Ice::Object::__all[] = }; DispatchStatus -Ice::Object::__dispatch(Incoming& in, const string& s) +Ice::Object::__dispatch(Incoming& in, const string&, const string&, const string& s) { const char** b = __all; const char** e = __all + sizeof(__all) / sizeof(const char*); @@ -232,3 +243,12 @@ Ice::Object::ice_findFacet(const string& name) return 0; } } + +DispatchStatus +Ice::Blobject::__dispatch(Incoming& in, const string& identity, const string& facet, const string& operation) +{ + vector<Byte> blob; + in.is()->read(blob); + ice_invokeIn(identity, facet, operation, blob); + return ::IceInternal::DispatchOK; +} diff --git a/cpp/src/Ice/Proxy.cpp b/cpp/src/Ice/Proxy.cpp index b66ebf512b5..82a47527713 100644 --- a/cpp/src/Ice/Proxy.cpp +++ b/cpp/src/Ice/Proxy.cpp @@ -150,6 +150,40 @@ IceProxy::Ice::Object::ice_ping() } } +void +IceProxy::Ice::Object::ice_invokeIn(const string& operation, bool nonmutating, const vector<Byte>& inParams) +{ + int __cnt = 0; + while (true) + { + try + { + Handle< ::IceDelegate::Ice::Object> __del = __getDelegate(); + __del->ice_invokeIn(operation, inParams); + return; + } + catch (const LocationForward& __ex) + { + __locationForward(__ex); + } + catch (const NonRepeatable& __ex) + { + if (nonmutating) + { + __handleException(*__ex.get(), __cnt); + } + else + { + __rethrowException(*__ex.get()); + } + } + catch (const LocalException& __ex) + { + __handleException(__ex, __cnt); + } + } +} + std::string IceProxy::Ice::Object::ice_getIdentity() const { @@ -498,6 +532,18 @@ IceDelegateM::Ice::Object::ice_ping() } void +IceDelegateM::Ice::Object::ice_invokeIn(const string& operation, const vector<Byte>& inParams) +{ + Outgoing __out(__emitter, __reference, operation.c_str()); + BasicStream* __os = __out.os(); + __os->write(inParams); + if (!__out.invoke()) + { + throw ::Ice::UnknownUserException(__FILE__, __LINE__); + } +} + +void IceDelegateM::Ice::Object::ice_flush() { __emitter->flushBatchRequest(); @@ -571,6 +617,33 @@ IceDelegateD::Ice::Object::ice_ping() } void +IceDelegateD::Ice::Object::ice_invokeIn(const string& operation, const vector<Byte>& inParams) +{ + ::IceInternal::Direct __direct(__adapter, __reference, operation.c_str()); + ::Ice::Blobject* __servant = dynamic_cast< ::Ice::Blobject*>(__direct.facetServant().get()); + if (!__servant) + { + throw ::Ice::OperationNotExistException(__FILE__, __LINE__); + } + try + { + __servant->ice_invokeIn(__reference->identity, __reference->facet, operation, inParams); + } + catch (const ::Ice::LocalException&) + { + throw ::Ice::UnknownLocalException(__FILE__, __LINE__); + } + catch (const ::Ice::UserException&) + { + throw ::Ice::UnknownUserException(__FILE__, __LINE__); + } + catch (...) + { + throw ::Ice::UnknownException(__FILE__, __LINE__); + } +} + +void IceDelegateD::Ice::Object::ice_flush() { // Nothing to do for direct delegates diff --git a/cpp/src/slice2cpp/Gen.cpp b/cpp/src/slice2cpp/Gen.cpp index bc17c40d3bd..e73f836d3a6 100644 --- a/cpp/src/slice2cpp/Gen.cpp +++ b/cpp/src/slice2cpp/Gen.cpp @@ -1635,8 +1635,8 @@ Slice::Gen::ObjectVisitor::visitClassDefEnd(const ClassDefPtr& p) { H << nl << exp2 << "static const char* __mutating[" << allMutatingOpNames.size() << "];"; } - H << nl << exp2 << "virtual ::IceInternal::DispatchStatus " - << "__dispatch(::IceInternal::Incoming&, const ::std::string&);"; + H << nl << exp2 << "virtual ::IceInternal::DispatchStatus __dispatch(::IceInternal::Incoming&, " + << "const ::std::string&, const ::std::string&, const ::std::string&);"; H << nl << exp2 << "virtual bool __isMutating(const ::std::string&);"; C << sp; C << nl << "const char* " << scoped.substr(2) << "::__all[] ="; @@ -1668,8 +1668,8 @@ Slice::Gen::ObjectVisitor::visitClassDefEnd(const ClassDefPtr& p) C << eb << ';'; } C << sp; - C << nl << "::IceInternal::DispatchStatus" << nl << scoped.substr(2) - << "::__dispatch(::IceInternal::Incoming& in, const ::std::string& s)"; + C << nl << "::IceInternal::DispatchStatus" << nl << scoped.substr(2) << "::__dispatch(" + << "::IceInternal::Incoming& in, const ::std::string&, const ::std::string&, const ::std::string& s)"; C << sb; C << nl << "const char** b = __all;"; C << nl << "const char** e = __all + " << allOpNames.size() << ';'; |