• Classes
  • Modules
  • Namespaces
  • Files
  • Related Pages
  • File List
  • File Members

maciContainerServices.h

Go to the documentation of this file.
00001 #ifndef maciContainerServices_h
00002 #define maciContainerServices_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: maciContainerServices.h,v 1.31 2010/01/22 00:50:33 javarias Exp $"
00025  *
00026  * who       when      what
00027  * --------  --------  ----------------------------------------------
00028  * rcirami   27/11/03  created 
00029  */
00030 
00031 #include <acsutil.h>
00032 #include <acsContainerServices.h>
00033 #include <maciComponentStateManager.h>
00034 #include <acscomponentImpl.h>
00035 #include <logging.h>
00036 #include <maciContainerImpl.h>
00037 #include <cdbDALS.h>
00038 #include <acscomponentS.h>
00039 #include <acsErrTypeContainerServices.h>
00040 #include <acsErrTypeLifeCycle.h>
00041 #include <vector>
00042 #include <string>
00043 #include <iterator>
00044 
00045 #include <ace/Synch.h>
00046 #include <ace/Hash_Map_Manager.h>
00047 
00048 namespace maci {
00049         
00050 class ContainerImpl;
00051 
00055 class MACIContainerServices: public ContainerServices
00056 
00057 {
00058   public:
00059   
00063   MACIContainerServices(
00064     const maci::Handle componentHandle, 
00065     ACE_CString& name,
00066     PortableServer::POA_ptr poa);
00067 
00071   MACIContainerServices(
00072                   const maci::Handle componentHandle,
00073                   ACE_CString& name,
00074                   PortableServer::POA_ptr poa,
00075                   Manager_ptr manager);
00076 
00080   virtual ~MACIContainerServices();
00081  
00082   public:
00083  
00084     void test(const char* txt);
00089     CORBA::Object* getCORBAComponent(const char* name);
00090 
00095     CORBA::Object* getCORBAComponentNonSticky(const char* name);
00096     
00105     CORBA::Object* getCORBADynamicComponent(maci::ComponentSpec compSpec, bool markAsDefault);
00106     
00115     CORBA::Object* getCORBACollocatedComponent(maci::ComponentSpec compSpec, bool markAsDefault, const char* targetComponent);
00116     
00123     CORBA::Object* getCORBADefaultComponent(const char* idlType);
00124   
00125  public:
00126 
00134   ComponentInfo getComponentDescriptor(const char* componentName);
00135 
00150   ACE_CString_Vector findComponents(const char *nameWilcard, const char *typeWildcard);
00151 
00162     void releaseComponent(const char *name);
00163     
00169   void releaseAllComponents();
00170 
00180   CDB::DAL_ptr getCDB();
00181   
00184   PortableServer::POA_var getOffShootPOA() { return m_offShootPOA; }
00185 
00195   ACS::OffShoot_ptr activateOffShoot(PortableServer::Servant cbServant);
00196   
00203   void deactivateOffShoot(PortableServer::Servant cbServant);
00204   
00209   PortableServer::POA_var createOffShootPOA();
00210   
00224    maci::ComponentStateManager* getComponentStateManager();
00225 
00226     void fireComponentsUnavailable(ACE_CString_Vector& compNames);
00227     void fireComponentsAvailable(ACE_CString_Vector& compNames);
00228 
00229  private:
00230 
00232   maci::Manager_var m_manager;
00233 
00235   maci::ContainerImpl *m_containerImpl;
00236   
00238   PortableServer::POA_var m_offShootPOA; 
00239   
00241   maci::Handle m_componentHandle;
00242   
00244   typedef ACE_Hash_Map_Manager <ACE_CString, maci::Handle, ACE_Recursive_Thread_Mutex> COMPONENT_HASH_MAP;
00245   typedef ACE_Hash_Map_Iterator <ACE_CString, maci::Handle, ACE_Recursive_Thread_Mutex> COMPONENT_HASH_MAP_ITER;
00246   typedef ACE_Hash_Map_Entry <ACE_CString, maci::Handle> COMPONENT_HASH_MAP_ENTRY;
00247 
00249   COMPONENT_HASH_MAP m_usedComponents;
00250 
00252   maci::ComponentStateManager* componentStateManager_mp;
00253 };
00254 
00255 } // end namespace maci
00256 
00257 #endif // maciContainerServices_h
00258 

Generated on Thu Jul 8 2010 19:47:47 for ACS-9.0 C++ API by  doxygen 1.7.0