Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

acsContainerServices.h

Go to the documentation of this file.
00001 #ifndef acsContainerServices_h
00002 #define acsContainerServices_h
00003 /*******************************************************************************
00004  *    ALMA - Atacama Large Millimiter Array
00005  *    (c) European Southern Observatory, 2002
00006  *    Copyright by ESO (in the framework of the ALMA collaboration)
00007  *    and Cosylab 2002, All rights reserved
00008  *
00009  *    This library is free software; you can redistribute it and/or
00010  *    modify it under the terms of the GNU Lesser General Public
00011  *    License as published by the Free Software Foundation; either
00012  *    version 2.1 of the License, or (at your option) any later version.
00013  *
00014  *    This library is distributed in the hope that it will be useful,
00015  *    but WITHOUT ANY WARRANTY; without even the implied warranty of
00016  *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00017  *    Lesser General Public License for more details.
00018  *
00019  *    You should have received a copy of the GNU Lesser General Public
00020  *    License along with this library; if not, write to the Free Software
00021  *    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
00022  *
00023  *
00024  * "@(#) $Id: acsContainerServices.h,v 1.17 2006/10/24 15:21:32 bjeram Exp $"
00025  *
00026  * who       when      what
00027  * --------  --------  ----------------------------------------------
00028  * acaproni  2005-04-06  created
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        // It could be that the manager should be moved to MACIContainerServices
00367        ACS::ThreadManager threadManager_m;
00368       
00369    };
00370    
00371 }; // namespace maci
00372 
00373 // Include the implementation 
00374 #include "acsContainerServices.i"
00375    
00376 
00377 
00378 #endif // acsContainerServices_h

Generated on Sun Oct 29 02:26:25 2006 for ACS C++ API by doxygen 1.3.6