summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkitty <kitty@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2002-11-26 06:02:59 +0000
committerkitty <kitty@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2002-11-26 06:02:59 +0000
commit9b44237e2caa3ee903bf282bd6995a655090deb6 (patch)
treec7a22dec240d625264c7e0d8a07e8bc148110493
parentf8798293daedfc4fed0ae3df33fd120fee7ea07c (diff)
downloadATCD-9b44237e2caa3ee903bf282bd6995a655090deb6.tar.gz
ChangeLogTag: Mon Nov 25 04:25:15 2002 Krishnakumar B <kitty@cs.wustl.edu>
-rw-r--r--ACEXML/compass/Assembly.cpp16
-rw-r--r--ACEXML/compass/Assembly.h11
-rw-r--r--ACEXML/compass/Assembly.inl9
-rw-r--r--ACEXML/compass/AssemblyFactory.cpp43
-rw-r--r--ACEXML/compass/AssemblyFactory.h35
-rw-r--r--ACEXML/compass/CCMHome.h24
-rw-r--r--ACEXML/compass/CCMHome.inl1
-rw-r--r--ACEXML/compass/CompassTypes.h14
-rw-r--r--ACEXML/compass/Compass_Export.h1
-rw-r--r--ACEXML/compass/ComponentInstallation.h17
-rw-r--r--ACEXML/compass/ComponentInstallation.inl1
-rw-r--r--ACEXML/compass/ComponentServer.cpp41
-rw-r--r--ACEXML/compass/ComponentServer.h15
-rw-r--r--ACEXML/compass/ComponentServer.inl19
-rw-r--r--ACEXML/compass/ConfigValue.cpp41
-rw-r--r--ACEXML/compass/ConfigValue.h35
-rw-r--r--ACEXML/compass/Container.h23
-rw-r--r--ACEXML/compass/Container.inl7
-rw-r--r--ACEXML/compass/ServerActivator.cpp46
-rw-r--r--ACEXML/compass/ServerActivator.h33
-rw-r--r--ACEXML/compass/ServerActivator.inl9
21 files changed, 378 insertions, 63 deletions
diff --git a/ACEXML/compass/Assembly.cpp b/ACEXML/compass/Assembly.cpp
index 4bb81e53bc2..e286d702b38 100644
--- a/ACEXML/compass/Assembly.cpp
+++ b/ACEXML/compass/Assembly.cpp
@@ -1,5 +1,10 @@
// $Id$
+
+#if defined (__ACE_INLINE__)
+#include "Assembly.inl"
+#endif /* __ACE_INLINE__ */
+
#include "ACEXML/compass/Assembly.h"
using namespace Deployment;
@@ -20,12 +25,13 @@ Assembly::~Assembly()
delete this->stream;
}
-AssemblyState
-Assembly::get_state()
-{
- return this->state_;
-}
void
Assembly::build (void)
+ ACE_THROW_SPEC ((CreateFailure))
+{}
+
+void
+Assembly::tear_down(void)
+ ACE_THROW_SPEC ((RemoveFailure))
{}
diff --git a/ACEXML/compass/Assembly.h b/ACEXML/compass/Assembly.h
index bffca408504..467458e9b36 100644
--- a/ACEXML/compass/Assembly.h
+++ b/ACEXML/compass/Assembly.h
@@ -5,7 +5,7 @@
#define COMPASS_ASSEMBLY_H
#include "ace/pre.h"
-#include "ACEXML/common/Compass_Export.h"
+#include "ACEXML/compass/Compass_Export.h"
#if !defined (ACE_LACKS_PRAGMA_ONCE)
#pragma once
@@ -16,7 +16,7 @@
namespace Deployment
{
- class Assembly
+ class Compass_Export Assembly
{
public:
Assembly(void);
@@ -35,7 +35,12 @@ namespace Deployment
AssemblyState state_;
ACEXML_CharStream* stream_;
};
-};
+}
+#if defined (__ACE_INLINE__)
+#include "Assembly.inl"
+#endif /* __ACE_INLINE__ */
+
+#include "ace/post.h"
#endif /* COMPASS_ASSEMBLY_H */
diff --git a/ACEXML/compass/Assembly.inl b/ACEXML/compass/Assembly.inl
new file mode 100644
index 00000000000..8c618dec870
--- /dev/null
+++ b/ACEXML/compass/Assembly.inl
@@ -0,0 +1,9 @@
+// $Id$
+
+using namespace Deployment;
+
+ACE_INLINE AssemblyState
+Assembly::get_state()
+{
+ return this->state_;
+}
diff --git a/ACEXML/compass/AssemblyFactory.cpp b/ACEXML/compass/AssemblyFactory.cpp
index db3d196b80a..a8f4bd5b5d2 100644
--- a/ACEXML/compass/AssemblyFactory.cpp
+++ b/ACEXML/compass/AssemblyFactory.cpp
@@ -5,14 +5,49 @@
using namespace Deployment;
+AssemblyFactory::AssemblyFactory()
+ : cookies_()
+{}
+
+AssemblyFactory::~AssemblyFactory()
+{}
+
+
Cookie
AssemblyFactory::create (const Location& assembly_loc)
+ ACE_THROW_SPEC ((InvalidLocation, CreateFailure))
{
ACEXML_StreamFactory factory;
ACEXML_CharStream* stream = factory.create_stream (assembly_loc.c_str());
if (stream == 0)
- ACE_THROW (InvalidLocation);
- char cookie[10];
- ACE_OS::sprintf (cookie, "%x", stream);
+ ACE_THROW (InvalidLocation());
+ char buf[10];
+ int size = ACE_OS::sprintf (buf, "%@", stream);
+ buf[size] = 0;
+ ACEXML_String cookie (buf);
+ Assembly* assembly = 0;
+ ACE_NEW (assembly, Assembly (AssemblyState::INACTIVE, stream));
+ if (assembly == 0)
+ ACE_THROW ((CreateFailure()));
+ if (this->cookies_.bind (ret, assembly) != 0)
+ ACE_THROW ((CreateFailure()));
+ return cookie;
+}
- ACE_NEW_RETURN (
+Assembly*
+AssemblyFactory::lookup (const Cookie& c)
+{
+ Assembly* asm = 0;
+ if (this->cookies_->find (c, asm) != 0)
+ ACE_THROW (InvalidAssembly());
+ return asm;
+}
+
+void
+AssemblyFactory::destroy (const Cookie& c)
+{
+ Assembly* asm = 0;
+ if (this->unbind (c, asm) != 0)
+ ACE_THROW (InvalidAssembly());
+ delete asm;
+}
diff --git a/ACEXML/compass/AssemblyFactory.h b/ACEXML/compass/AssemblyFactory.h
index 407a1336e44..9bad0d0cc1c 100644
--- a/ACEXML/compass/AssemblyFactory.h
+++ b/ACEXML/compass/AssemblyFactory.h
@@ -5,7 +5,7 @@
#define COMPASS_ASSEMBLY_FACTORY_H
#include "ace/pre.h"
-#include "ACEXML/common/Compass_Export.h"
+#include "ACEXML/compass/Compass_Export.h"
#if !defined (ACE_LACKS_PRAGMA_ONCE)
#pragma once
@@ -13,15 +13,39 @@
#include "ace/Singleton.h"
#include "ace/Synch.h"
-#include "ace/Unbounded_Set.h"
+#include "ace/Hash_Map_Manager.h"
#include "ACEXML/compass/CompassTypes.h"
namespace Deployment
{
- class AssemblyFactory
+
+ typedef ACE_Hash_Map_Entry<ACEXML_String,
+ Assembly*> COOKIE;
+
+ typedef ACE_Hash_Map_Manager_Ex<ACEXML_String,
+ Assembly*
+ ACE_Hash<ACEXML_String>,
+ ACE_Equal_To<ACEXML_String>,
+ ACE_SYNCH_MUTEX> COOKIES_MANAGER;
+
+ typedef ACE_Hash_Map_Iterator_Ex<ACEXML_String,
+ Assembly*
+ ACE_Hash<ACEXML_String>,
+ ACE_Equal_To<ACEXML_String>,
+ ACE_SYNCH_MUTEX> COOKIES_MANAGER_ITER;
+
+ typedef ACE_Hash_Map_Reverse_Iterator_Ex<ACEXML_String,
+ Assembly*
+ ACE_Hash<ACEXML_String>,
+ ACE_Equal_To<ACEXML_String>,
+ ACE_SYNCH_MUTEX> COOKIES_MANAGER_REVERSE_ITER;
+
+ class Compass_Export AssemblyFactory
{
public:
friend class ACE_Singleton<AssemblyFactory, ACE_SYNCH_MUTEX>;
+ AssemblyFactory();
+ ~AssemblyFactory();
Cookie create(const Location& assembly_loc)
ACE_THROW_SPEC ((InvalidLocation, CreateFailure));
@@ -34,10 +58,11 @@ namespace Deployment
AssemblyFactory (const AssemblyFactory&);
AssemblyFactory& operator= (const AssemblyFactory&);
private:
- ACE_Unbounded_Set<ACEXML_String> cookies_;
+ COOKIES_MANAGER cookies_;
};
typedef ACE_Singleton<AssemblyFactory, ACE_SYNCH_MUTEX> ASSEMBLY_FACTORY;
-};
+}
+#include "ace/post.h"
#endif /* COMPASS_ASSEMBLY_FACTORY_H */
diff --git a/ACEXML/compass/CCMHome.h b/ACEXML/compass/CCMHome.h
index f23a415d587..d339ee71e99 100644
--- a/ACEXML/compass/CCMHome.h
+++ b/ACEXML/compass/CCMHome.h
@@ -5,28 +5,38 @@
#define COMPASS_CCMHOME_H
#include "ace/pre.h"
-#include "ACEXML/common/Compass_Export.h"
+#include "ACEXML/compass/Compass_Export.h"
#if !defined (ACE_LACKS_PRAGMA_ONCE)
#pragma once
#endif /* ACE_LACKS_PRAGMA_ONCE */
+#include "ace/Unbounded_Set.h"
#include "ACEXML/compass/CompassTypes.h"
+
namespace Deployment
{
- class CCMHome
+ class Compass_Export CCMHome
{
public:
- Component* get_component_def();
+ Component* create_component()
+ ACE_THROW_SPEC ((CreateFailure));
- void remove_component (const Component* comp)
+ void remove_component (Component* comp)
ACE_THROW_SPEC ((RemoveFailure));
+
private:
- Component* comp_;
+ Component* component_;
};
- typedef vector<CCMHome*> CCMHomes;
+ typedef ACE_Unbounded_Set<CCMHome*> CCMHomes;
+
+}
+
+#if defined (__ACE_INLINE__)
+#include "CCMHome.inl"
+#endif /* __ACE_INLINE__ */
-};
+#include "ace/post.h"
#endif /* COMPASS_CCMHOME_H */
diff --git a/ACEXML/compass/CCMHome.inl b/ACEXML/compass/CCMHome.inl
new file mode 100644
index 00000000000..cfa1da318d3
--- /dev/null
+++ b/ACEXML/compass/CCMHome.inl
@@ -0,0 +1 @@
+// $Id$
diff --git a/ACEXML/compass/CompassTypes.h b/ACEXML/compass/CompassTypes.h
index ba801af8ff3..67501a8017b 100644
--- a/ACEXML/compass/CompassTypes.h
+++ b/ACEXML/compass/CompassTypes.h
@@ -4,13 +4,12 @@
#define COMPASS_TYPES_H
#include "ace/pre.h"
-#include "ACEXML/common/Compass_Export.h"
#if !defined (ACE_LACKS_PRAGMA_ONCE)
#pragma once
#endif /* ACE_LACKS_PRAGMA_ONCE */
-#include "ace/OS_String.h"
+#include "ACEXML/common/XML_Types.h"
// *************** Packaging and Deployment ***************
@@ -29,13 +28,6 @@ namespace Deployment
typedef ACEXML_String FeatureName;
- struct ConfigValue
- {
- FeatureName name;
- ACEXML_String value;
- };
- typedef vector<ConfigValue*> ConfigValues;
-
struct UnknownImplId {};
struct InvalidLocation {};
struct InstallationFailure { FailureReason reason; };
@@ -44,6 +36,8 @@ namespace Deployment
struct ImplEntryPointNotFound {};
-};
+}
+
+#include "ace/post.h"
#endif /* COMPASS_TYPES_H */
diff --git a/ACEXML/compass/Compass_Export.h b/ACEXML/compass/Compass_Export.h
index 2c5cc50290b..0e8f526a7bb 100644
--- a/ACEXML/compass/Compass_Export.h
+++ b/ACEXML/compass/Compass_Export.h
@@ -1,4 +1,3 @@
-
// -*- C++ -*-
// $Id$
// Definition for Win32 Export directives.
diff --git a/ACEXML/compass/ComponentInstallation.h b/ACEXML/compass/ComponentInstallation.h
index f02a5f08c42..3168bd3edf5 100644
--- a/ACEXML/compass/ComponentInstallation.h
+++ b/ACEXML/compass/ComponentInstallation.h
@@ -4,12 +4,17 @@
#ifndef COMPASS_COMPONENT_INSTALLATION_H
#define COMPASS_COMPONENT_INSTALLATION_H
+#include "ace/pre.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+#pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
#include "ACEXML/compass/CompassTypes.h"
namespace Deployment
{
-
- class ComponentInstallation
+ class Compass_Export ComponentInstallation
{
public:
void install(const UUID& implUUID, const Location& component_loc)
@@ -25,6 +30,12 @@ namespace Deployment
ACE_THROW_SPEC ((UnknownImplId, InstallationFailure));
};
-};
+}
+
+#if defined (__ACE_INLINE__)
+#include "ComponentInstallation.inl"
+#endif /* __ACE_INLINE__ */
+
+#include "ace/post.h"
#endif /* COMPASS_COMPONENT_INSTALLATION_H */
diff --git a/ACEXML/compass/ComponentInstallation.inl b/ACEXML/compass/ComponentInstallation.inl
new file mode 100644
index 00000000000..cfa1da318d3
--- /dev/null
+++ b/ACEXML/compass/ComponentInstallation.inl
@@ -0,0 +1 @@
+// $Id$
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;
}
diff --git a/ACEXML/compass/ComponentServer.h b/ACEXML/compass/ComponentServer.h
index 1cc371fd167..8448e4254ed 100644
--- a/ACEXML/compass/ComponentServer.h
+++ b/ACEXML/compass/ComponentServer.h
@@ -5,7 +5,7 @@
#define COMPASS_COMPONENT_SERVER_H
#include "ace/pre.h"
-#include "ACEXML/common/Compass_Export.h"
+#include "ACEXML/compass/Compass_Export.h"
#if !defined (ACE_LACKS_PRAGMA_ONCE)
#pragma once
@@ -22,15 +22,15 @@ namespace Deployment
class Compass_Export ComponentServer
{
public:
- ComponentServer();
+ ComponentServer (const ConfigValues& config);
~ComponentServer();
ServerActivator* get_server_activator ();
- Container* create_container (const ConfigValues* config)
+ Container* create_container (const ConfigValues& config)
ACE_THROW_SPEC ((CreateFailure, InvalidConfiguration));
- void remove_container (const Container* cref)
+ void remove_container (Container* cref)
ACE_THROW_SPEC ((RemoveFailure));
Containers* get_containers ();
@@ -38,16 +38,17 @@ namespace Deployment
void remove ()
ACE_THROW_SPEC ((RemoveFailure));
- ConfigValues* get_configuration (void);
+ const ConfigValues& get_configuration (void);
- void set_configuration (const ConfigValues* config);
+ void set_configuration (const ConfigValues& config);
private:
Containers* containers_;
ServerActivator* activator_;
+ ConfigValues* config_;
};
-};
+}
#if defined (__ACE_INLINE__)
#include "ComponentServer.inl"
diff --git a/ACEXML/compass/ComponentServer.inl b/ACEXML/compass/ComponentServer.inl
index 10e9b9bed40..bc29199b542 100644
--- a/ACEXML/compass/ComponentServer.inl
+++ b/ACEXML/compass/ComponentServer.inl
@@ -2,7 +2,26 @@
using namespace Deployment;
+ACE_INLINE ServerActivator*
ComponentServer::get_server_activator (void)
{
return this->activator_;
}
+
+ACE_INLINE Containers*
+ComponentServer::get_containers (void)
+{
+ return this->containers_;
+}
+
+ACE_INLINE const ConfigValues&
+ComponentServer::get_configuration (void)
+{
+ return this->config_;
+}
+
+ACE_INLINE void
+ComponentServer::set_configuration (const ConfigValues& config)
+{
+ this->config_ = config;
+}
diff --git a/ACEXML/compass/ConfigValue.cpp b/ACEXML/compass/ConfigValue.cpp
new file mode 100644
index 00000000000..7c495947cb9
--- /dev/null
+++ b/ACEXML/compass/ConfigValue.cpp
@@ -0,0 +1,41 @@
+// $Id$
+
+#include "ACEXML/compass/ConfigValue.h"
+
+using namespace Deployment;
+
+ConfigValue::ConfigValue()
+ : name_(), value_()
+{
+
+}
+
+ConfigValue::~ConfigValue()
+{
+ delete this->name_;
+ delete this->value_;
+}
+
+ConfigValue::ConfigValue (const ConfigValue& config)
+{
+ if (*this != config)
+ {
+ this->name_ = config.name_;
+ this->value_ = config.value_;
+ }
+ return *this;
+}
+
+ConfigValue&
+ConfigValue::operator= (const ConfigValue& config)
+{
+ this->name_ = config.name_;
+ this->value_ = config.value_;
+ return *this;
+}
+
+int
+ConfigValue::operator== (const ConfigValue& config)
+{
+ return (this->name_ == config.name_ && this->value_ == config.value_);
+}
diff --git a/ACEXML/compass/ConfigValue.h b/ACEXML/compass/ConfigValue.h
new file mode 100644
index 00000000000..03d0cff5210
--- /dev/null
+++ b/ACEXML/compass/ConfigValue.h
@@ -0,0 +1,35 @@
+// $Id$
+
+#ifndef COMPASS_CONFIG_VALUE_H
+#define COMPASS_CONFIG_VALUE_H
+
+#include "ace/pre.h"
+#include "ACEXML/compass/Compass_Export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+#pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "ACEXML/common/XML_Types.h"
+
+namespace Deployment
+{
+ class Compass_Export ConfigValue
+ {
+ public:
+ ConfigValue();
+ ~ConfigValue();
+ ConfigValue (const ConfigValue& config);
+ ConfigValue& operator= (const ConfigValue& config);
+ int operator== (const ConfigValue& config);
+
+ FeatureName name_;
+ ACEXML_String value_;
+ };
+
+ typedef ACE_Unbounded_Set<ConfigValue> ConfigValues;
+}
+
+#include "ace/post.h"
+
+#endif /* COMPASS_CONFIG_VALUE_H */
diff --git a/ACEXML/compass/Container.h b/ACEXML/compass/Container.h
index a3b7ff45fdb..4819904b889 100644
--- a/ACEXML/compass/Container.h
+++ b/ACEXML/compass/Container.h
@@ -3,15 +3,22 @@
#ifndef COMPASS_CONTAINER_H
#define COMPASS_CONTAINER_H
+#include "ace/pre.h"
+#include "ACEXML/compass/Compass_Export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+#pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
#include "ACEXML/compass/CompassTypes.h"
#include "ACEXML/compass/CCMHome.h"
namespace Deployment
{
- class Container
+ class Compass_Export Container
{
public:
- Container(ConfigValues* config = 0);
+ Container(const ComponentServer* server);
~Container();
ComponentServer* get_component_server ();
@@ -29,16 +36,22 @@ namespace Deployment
void remove ()
ACE_THROW_SPEC ((RemoveFailure));
- ConfigValues* get_configuration (void);
+ ConfigValues get_configuration (void);
void set_configuration (const ConfigValues* config);
private:
ConfigValues* config_;
CCMHomes* homes_;
- ComponentServer* comp_server_;
+ ComponentServer* parent_;
};
-};
+}
+
+#if defined (__ACE_INLINE__)
+#include "Container.inl"
+#endif /* __ACE_INLINE__ */
+
+#include "ace/post.h"
#endif /* COMPASS_CONTAINER_H */
diff --git a/ACEXML/compass/Container.inl b/ACEXML/compass/Container.inl
new file mode 100644
index 00000000000..9dc589a6825
--- /dev/null
+++ b/ACEXML/compass/Container.inl
@@ -0,0 +1,7 @@
+// $Id$
+
+ACE_INLINE ComponentServer*
+Container::get_component_server()
+{
+ return this->parent_;
+}
diff --git a/ACEXML/compass/ServerActivator.cpp b/ACEXML/compass/ServerActivator.cpp
new file mode 100644
index 00000000000..7155dfde574
--- /dev/null
+++ b/ACEXML/compass/ServerActivator.cpp
@@ -0,0 +1,46 @@
+// $Id$
+
+
+#if defined (__ACE_INLINE__)
+#include "ServerActivator.inl"
+#endif /* __ACE_INLINE__ */
+
+#include "ACEXML/compass/ServerActivator.h"
+
+using namespace Deployment;
+
+
+ServerActivator::ServerActivator()
+{
+ ACE_NEW (this->comp_servers_, ComponentServers());
+}
+
+ServerActivator::~ServerActivator()
+{
+ ComponentServer* entry = 0;
+ for (ComponentServers::iterator iter (*this->comp_servers_);
+ iter.next (entry) != 0;
+ iter->advance())
+ delete entry;
+}
+
+ComponentServer*
+ServerActivator::create_component_server (const ConfigValues& config)
+ ACE_THROW_SPEC ((CreateFailure, InvalidConfiguration))
+{
+ ComponentServer* cserver = 0;
+ ACE_NEW_RETURN (cserver, ComponentServer (config), 0);
+ if (this->comp_servers_->insert (cserver) < 0)
+ ACE_THROW (CreateFailure());
+ return cserver;
+}
+
+void
+ServerActivator::remove_component_server (ComponentServer* server)
+ ACE_THROW_SPEC ((RemoveFailure))
+{
+ if (this->comp_servers_->remove (server) != 0)
+ ACE_THROW (RemoveFailure());
+ delete server;
+ return;
+}
diff --git a/ACEXML/compass/ServerActivator.h b/ACEXML/compass/ServerActivator.h
index cd7de0071fb..c3e08ba3710 100644
--- a/ACEXML/compass/ServerActivator.h
+++ b/ACEXML/compass/ServerActivator.h
@@ -4,6 +4,16 @@
#ifndef COMPASS_SERVER_ACTIVATOR_H
#define COMPASS_SERVER_ACTIVATOR_H
+
+#include "ace/pre.h"
+#include "ACEXML/compass/Compass_Export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+#pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "ace/Singleton.h"
+#include "ace/Synch.h"
#include "ace/Unbounded_Set.h"
#include "ACEXML/compass/CompassTypes.h"
@@ -12,20 +22,33 @@ namespace Deployment
class ComponentServer; // Forward decl.
typedef ACE_Unbounded_Set<ComponentServer*> ComponentServers;
- class ServerActivator
+ class Compass_Export ServerActivator
{
public:
- ComponentServer* create_component_server (const ConfigValues* config)
+ friend class ACE_Singleton <ServerActivator, ACE_SYNCH_MUTEX>;
+ ServerActivator();
+ ~ServerActivator();
+ ComponentServer* create_component_server (const ConfigValues& config)
ACE_THROW_SPEC ((CreateFailure, InvalidConfiguration));
- void remove_component_server (const ComponentServer* server)
- ACE_THROW_SPEC (RemoveFailure);
+ void remove_component_server (ComponentServer* server)
+ ACE_THROW_SPEC ((RemoveFailure));
ComponentServers* get_component_servers ();
+
+ protected:
+ ServerActivator (const ServerActivator&);
+ ServerActivator& operator= (const ServerActivator&);
private:
ComponentServers* comp_servers_;
};
typedef ACE_Singleton <ServerActivator, ACE_SYNCH_MUTEX> SERVER_ACTIVATOR;
-};
+}
+
+#if defined (__ACE_INLINE__)
+#include "ServerActivator.inl"
+#endif /* __ACE_INLINE__ */
+
+#include "ace/post.h"
#endif /* COMPASS_SERVER_ACTIVATOR_H */
diff --git a/ACEXML/compass/ServerActivator.inl b/ACEXML/compass/ServerActivator.inl
new file mode 100644
index 00000000000..b1c737d7a33
--- /dev/null
+++ b/ACEXML/compass/ServerActivator.inl
@@ -0,0 +1,9 @@
+// $Id$
+
+using namespace Deployment;
+
+ACE_INLINE ComponentServers*
+ServerActivator::get_component_servers (void)
+{
+ return this->comp_servers_;
+}