diff options
Diffstat (limited to 'ACEXML/compass/ComponentServer.cpp')
-rw-r--r-- | ACEXML/compass/ComponentServer.cpp | 41 |
1 files changed, 33 insertions, 8 deletions
diff --git a/ACEXML/compass/ComponentServer.cpp b/ACEXML/compass/ComponentServer.cpp index cf36b9dc2ee..7014b300786 100644 --- a/ACEXML/compass/ComponentServer.cpp +++ b/ACEXML/compass/ComponentServer.cpp @@ -1,11 +1,16 @@ // $Id$ +#if defined (__ACE_INLINE__) +#include "ComponentServer.inl" +#endif /* __ACE_INLINE__ */ + #include "ACEXML/compass/ComponentServer.h" using namespace Deployment; -ComponentServer::ComponentServer() +ComponentServer::ComponentServer(const ConfigValues& config) : containers_ (0), + config_ (config), activator_ (SERVER_ACTIVATOR::instance()) {} @@ -14,6 +19,26 @@ ComponentServer::~ComponentServer() this->remove(); } +Container* +ComponentServer::create_container (const ConfigValues& config) + ACE_THROW_SPEC ((CreateFailure, InvalidConfiguration)) +{ + Container* ctr = 0; + ACE_NEW_RETURN (ctr, Container (config), 0); + if (this->containers_->insert (ctr) != 0) + ACE_THROW (CreateFailure()); + return ctr; +} + +void +ComponentServer::remove_container (Container* cref) + ACE_THROW_SPEC ((RemoveFailure)); +{ + if (this->containers_->remove (cref) != 0) + ACE_THROW (RemoveFailure()); + delete cref; +} + void ComponentServer::remove() ACE_THROW_SPEC ((RemoveFailure)) @@ -23,12 +48,12 @@ ComponentServer::remove() iter.next (entry) != 0; iter->advance()) delete entry; - this->activator_ = 0; -} -ComponentServer::remove_container (const Container* cref) - ACE_THROW_SPEC ((RemoveFailure)); -{ - if (this->containers_->remove (cref) != 0) - ACE_THROW (RemoveFailure()); + ConfigValues* value = 0; + for (ConfigValues::iterator iter (*this->config_); + iter.next (value) != 0; + iter->advance()) + delete value; + + this->activator_ = 0; } |