00001 #ifndef acsContainerServices_h
00002 #define acsContainerServices_h
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031 #ifndef __cplusplus
00032 #error This is a C++ include file and cannot be used from plain C
00033 #endif
00034
00035 #include <acscomponentS.h>
00036 #include <acscomponentC.h>
00037 #include <maciC.h>
00038 #include <acsErrTypeContainerServices.h>
00039 #include <cdbDALS.h>
00040 #include <acsComponentStateManager.h>
00041 #include <acsThreadManager.h>
00042 #include <logging.h>
00043 #include <loggingLoggable.h>
00044 #include <maciErrType.h>
00045
00046 namespace maci {
00047
00056 class ContainerServices : public Logging::Loggable {
00057 public:
00064 ContainerServices(ACE_CString& compName, PortableServer::POA_ptr poa);
00065
00066
00070 virtual ~ContainerServices();
00071
00072 protected:
00082 virtual CORBA::Object* getCORBAComponent(const char* name)
00083 throw (maciErrType::CannotGetComponentExImpl)
00084 =0;
00095 virtual CORBA::Object* getCORBAComponentNonSticky(const char* name)
00096 throw (maciErrType::CannotGetComponentExImpl)
00097 =0;
00098
00107 virtual CORBA::Object* getCORBADynamicComponent(maci::ComponentSpec compSpec, bool markAsDefault)
00108 throw(maciErrType::NoPermissionExImpl,
00109 maciErrType::IncompleteComponentSpecExImpl,
00110 maciErrType::InvalidComponentSpecExImpl,
00111 maciErrType::ComponentSpecIncompatibleWithActiveComponentExImpl,
00112 maciErrType::CannotGetComponentExImpl)
00113 =0;
00114
00124 virtual CORBA::Object* getCORBACollocatedComponent(maci::ComponentSpec compSpec, bool markAsDefault, const char* targetComponent)
00125 throw(maciErrType::NoPermissionExImpl,
00126 maciErrType::IncompleteComponentSpecExImpl,
00127 maciErrType::InvalidComponentSpecExImpl,
00128 maciErrType::ComponentSpecIncompatibleWithActiveComponentExImpl,
00129 maciErrType::CannotGetComponentExImpl)
00130 =0;
00131
00139 virtual CORBA::Object* getCORBADefaultComponent(const char* idlType)
00140 throw (maciErrType::NoPermissionExImpl,
00141 maciErrType::NoDefaultComponentExImpl,
00142 maciErrType::CannotGetComponentExImpl)
00143 =0;
00144
00145 public:
00146
00152 ACE_CString getName() {
00153 return m_componentName;
00154 }
00155
00166 PortableServer::POA_var getPOA() {
00167 return m_poa;
00168 }
00169
00180 template<class T> T* getComponent(const char *name)
00181 throw (maciErrType::CannotGetComponentExImpl);
00182
00194 template<class T> T* getComponentNonSticky(const char *name)
00195 throw (maciErrType::CannotGetComponentExImpl);
00196
00206 template<class T> T* getDynamicComponent(maci::ComponentSpec compSpec, bool markAsDefault)
00207 throw(maciErrType::NoPermissionExImpl,
00208 maciErrType::IncompleteComponentSpecExImpl,
00209 maciErrType::InvalidComponentSpecExImpl,
00210 maciErrType::ComponentSpecIncompatibleWithActiveComponentExImpl,
00211 maciErrType::CannotGetComponentExImpl);
00222 template<class T> T* getCollocatedComponent(maci::ComponentSpec compSpec, bool markAsDefault, const char* targetComponent)
00223 throw(maciErrType::NoPermissionExImpl,
00224 maciErrType::IncompleteComponentSpecExImpl,
00225 maciErrType::InvalidComponentSpecExImpl,
00226 maciErrType::ComponentSpecIncompatibleWithActiveComponentExImpl,
00227 maciErrType::CannotGetComponentExImpl);
00228
00237 template<class T> T* getDefaultComponent(const char* idlType)
00238 throw (maciErrType::NoPermissionExImpl,
00239 maciErrType::NoDefaultComponentExImpl,
00240 maciErrType::CannotGetComponentExImpl);
00241
00248 virtual maci::ComponentInfo getComponentDescriptor(const char* componentName)
00249 throw (acsErrTypeContainerServices::GettingCompInfoExImpl)=0;
00250
00265 virtual ACE_CString_Vector findComponents(const char *nameWilcard, const char *typeWildcard)=0;
00266
00276 virtual void releaseComponent(const char *name)
00277 throw (maciErrType::CannotReleaseComponentExImpl)
00278 =0;
00279
00285 virtual void releaseAllComponents()=0;
00286
00295 virtual CDB::DAL_ptr getCDB()
00296 throw (acsErrTypeContainerServices::CanNotGetCDBExImpl)=0;
00297
00301 virtual PortableServer::POA_var getOffShootPOA()=0;
00302
00312 virtual ACS::OffShoot_ptr activateOffShoot(PortableServer::Servant cbServant)=0;
00313
00318 virtual void deactivateOffShoot(PortableServer::Servant cbServant)
00319 throw (acsErrTypeContainerServices::OffShootDeactivationExImpl,
00320 acsErrTypeContainerServices::OffShootPOAExImpl)=0;
00321
00326 virtual PortableServer::POA_var createOffShootPOA()=0;
00327
00341 virtual ComponentStateManager* getComponentStateManager()=0;
00342
00352 virtual ACS::ThreadManager* getThreadManager(){ return &threadManager_m; }
00353
00354 private:
00355 ACE_CString m_componentName;
00356
00361 PortableServer::POA_var m_poa;
00362
00366
00367 ACS::ThreadManager threadManager_m;
00368
00369 };
00370
00371 };
00372
00373
00374 #include "acsContainerServices.i"
00375
00376
00377
00378 #endif // acsContainerServices_h