summaryrefslogtreecommitdiff
path: root/cppe/src/IceE/Instance.cpp
diff options
context:
space:
mode:
authorBernard Normier <bernard@zeroc.com>2006-07-28 20:35:26 +0000
committerBernard Normier <bernard@zeroc.com>2006-07-28 20:35:26 +0000
commita7270eb607bf5602b6f10dbd2e78da18e4f3d6fb (patch)
treeef3ca6c6da06abf84b16fcb3eff00f36ab5d65d3 /cppe/src/IceE/Instance.cpp
parentcleaning up the Ruby settings (diff)
downloadice-a7270eb607bf5602b6f10dbd2e78da18e4f3d6fb.tar.bz2
ice-a7270eb607bf5602b6f10dbd2e78da18e4f3d6fb.tar.xz
ice-a7270eb607bf5602b6f10dbd2e78da18e4f3d6fb.zip
restored setDefaultContext
Diffstat (limited to 'cppe/src/IceE/Instance.cpp')
-rw-r--r--cppe/src/IceE/Instance.cpp34
1 files changed, 31 insertions, 3 deletions
diff --git a/cppe/src/IceE/Instance.cpp b/cppe/src/IceE/Instance.cpp
index 67dbb2750ba..5d7977c5fd0 100644
--- a/cppe/src/IceE/Instance.cpp
+++ b/cppe/src/IceE/Instance.cpp
@@ -222,6 +222,33 @@ IceInternal::Instance::flushBatchRequests()
}
#endif
+void
+IceInternal::Instance::setDefaultContext(const Context& ctx)
+{
+ IceUtil::RecMutex::Lock sync(*this);
+
+ if(_state == StateDestroyed)
+ {
+ throw CommunicatorDestroyedException(__FILE__, __LINE__);
+ }
+
+ _defaultContext = new SharedContext(ctx);
+}
+
+SharedContextPtr
+IceInternal::Instance::getDefaultContext() const
+{
+ IceUtil::RecMutex::Lock sync(*this);
+
+ if(_state == StateDestroyed)
+ {
+ throw CommunicatorDestroyedException(__FILE__, __LINE__);
+ }
+
+ return _defaultContext;
+}
+
+
Identity
IceInternal::Instance::stringToIdentity(const string& s) const
{
@@ -328,10 +355,11 @@ IceInternal::Instance::identityToString(const Identity& ident) const
IceInternal::Instance::Instance(const CommunicatorPtr& communicator, const InitializationData& initData) :
_state(StateActive),
_initData(initData),
- _messageSizeMax(0)
+ _messageSizeMax(0),
#ifndef ICEE_PURE_BLOCKING_CLIENT
- , _threadPerConnectionStackSize(0)
+ _threadPerConnectionStackSize(0),
#endif
+ _defaultContext(new SharedContext(initData.defaultContext))
{
try
{
@@ -514,7 +542,7 @@ IceInternal::Instance::Instance(const CommunicatorPtr& communicator, const Initi
if(!_initData.wstringConverter)
{
- const_cast<WstringConverterPtr&>(_initData.wstringConverter) = new UnicodeWstringConverter();
+ _initData.wstringConverter = new UnicodeWstringConverter();
}
__setNoDelete(false);