RT_POA.h

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 
00003 //=============================================================================
00004 /**
00005  *  @file    RT_POA.h
00006  *
00007  *  RT_POA.h,v 1.16 2006/04/26 13:42:42 mesnier_p Exp
00008  *
00009  *  RT_POA
00010  *
00011  *  @author  Irfan Pyarali
00012  */
00013 // ===================================================================
00014 
00015 #ifndef TAO_RT_POA_H
00016 #define TAO_RT_POA_H
00017 
00018 #include /**/ "ace/pre.h"
00019 
00020 #include "tao/RTPortableServer/rtportableserver_export.h"
00021 
00022 #include "tao/PortableServer/Regular_POA.h"
00023 #include "tao/orbconf.h"
00024 
00025 #if defined (TAO_HAS_CORBA_MESSAGING) && TAO_HAS_CORBA_MESSAGING != 0
00026 
00027 #define TAO_RT_PORTABLESERVER_SAFE_INCLUDE
00028 #include "tao/RTPortableServer/RTPortableServerC.h"
00029 #undef TAO_RT_PORTABLESERVER_SAFE_INCLUDE
00030 
00031 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00032 # pragma once
00033 #endif /* ACE_LACKS_PRAGMA_ONCE */
00034 
00035 // This is to remove "inherits via dominance" warnings from MSVC.
00036 // MSVC is being a little too paranoid.
00037 #if defined(_MSC_VER)
00038 #pragma warning(push)
00039 #pragma warning(disable:4250)
00040 #endif /* _MSC_VER */
00041 
00042 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
00043 
00044 class TAO_Thread_Pool;
00045 class TAO_Thread_Lane;
00046 class TAO_PriorityBandedConnectionPolicy;
00047 
00048 class TAO_RTPortableServer_Export TAO_RT_POA
00049   : public virtual RTPortableServer::POA
00050   , public virtual TAO_Regular_POA
00051 {
00052 public:
00053 
00054   // RTCORBA specific methods
00055   CORBA::Object_ptr create_reference_with_priority (const char * intf,
00056                                                     RTCORBA::Priority priority
00057                                                     ACE_ENV_ARG_DECL_WITH_DEFAULTS)
00058     ACE_THROW_SPEC ((CORBA::SystemException,
00059                      PortableServer::POA::WrongPolicy));
00060 
00061   CORBA::Object_ptr create_reference_with_id_and_priority (const PortableServer::ObjectId & oid,
00062                                                            const char * intf,
00063                                                            RTCORBA::Priority priority
00064                                                            ACE_ENV_ARG_DECL_WITH_DEFAULTS)
00065     ACE_THROW_SPEC ((CORBA::SystemException,
00066                      PortableServer::POA::WrongPolicy));
00067 
00068   PortableServer::ObjectId * activate_object_with_priority (PortableServer::Servant p_servant,
00069                                                             RTCORBA::Priority priority
00070                                                             ACE_ENV_ARG_DECL_WITH_DEFAULTS)
00071     ACE_THROW_SPEC ((CORBA::SystemException,
00072                      PortableServer::POA::ServantAlreadyActive,
00073                      PortableServer::POA::WrongPolicy));
00074 
00075   void activate_object_with_id_and_priority (const PortableServer::ObjectId & oid,
00076                                              PortableServer::Servant p_servant,
00077                                              RTCORBA::Priority priority
00078                                              ACE_ENV_ARG_DECL_WITH_DEFAULTS)
00079     ACE_THROW_SPEC ((CORBA::SystemException,
00080                      PortableServer::POA::ServantAlreadyActive,
00081                      PortableServer::POA::ObjectAlreadyActive,
00082                      PortableServer::POA::WrongPolicy));
00083   // End RTCORBA specific methods
00084 
00085   // Standard POA interface methods
00086   PortableServer::POA_ptr create_POA (const char *adapter_name,
00087                                       PortableServer::POAManager_ptr poa_manager,
00088                                       const CORBA::PolicyList &policies
00089                                       ACE_ENV_ARG_DECL_WITH_DEFAULTS)
00090     ACE_THROW_SPEC ((CORBA::SystemException,
00091                      PortableServer::POA::AdapterAlreadyExists,
00092                      PortableServer::POA::InvalidPolicy));
00093 
00094   PortableServer::POA_ptr find_POA (const char *adapter_name,
00095                                     CORBA::Boolean activate_it
00096                                     ACE_ENV_ARG_DECL_WITH_DEFAULTS)
00097     ACE_THROW_SPEC ((CORBA::SystemException,
00098                      PortableServer::POA::AdapterNonExistent));
00099 
00100   void destroy (CORBA::Boolean etherealize_objects,
00101                 CORBA::Boolean wait_for_completion
00102                 ACE_ENV_ARG_DECL_WITH_DEFAULTS)
00103     ACE_THROW_SPEC ((CORBA::SystemException));
00104 
00105 #if (TAO_HAS_MINIMUM_POA == 0)
00106 
00107   PortableServer::ThreadPolicy_ptr create_thread_policy (PortableServer::ThreadPolicyValue value
00108                                                          ACE_ENV_ARG_DECL_WITH_DEFAULTS)
00109     ACE_THROW_SPEC ((CORBA::SystemException));
00110 
00111 #endif /* TAO_HAS_MINIMUM_POA == 0 */
00112 
00113   PortableServer::LifespanPolicy_ptr create_lifespan_policy (PortableServer::LifespanPolicyValue value
00114                                                              ACE_ENV_ARG_DECL_WITH_DEFAULTS)
00115     ACE_THROW_SPEC ((CORBA::SystemException));
00116 
00117   PortableServer::IdUniquenessPolicy_ptr create_id_uniqueness_policy (PortableServer::IdUniquenessPolicyValue value
00118                                                                       ACE_ENV_ARG_DECL_WITH_DEFAULTS)
00119     ACE_THROW_SPEC ((CORBA::SystemException));
00120 
00121   PortableServer::IdAssignmentPolicy_ptr create_id_assignment_policy (PortableServer::IdAssignmentPolicyValue value
00122                                                                       ACE_ENV_ARG_DECL_WITH_DEFAULTS)
00123     ACE_THROW_SPEC ((CORBA::SystemException));
00124 
00125 #if (TAO_HAS_MINIMUM_POA == 0)
00126 
00127   PortableServer::ImplicitActivationPolicy_ptr create_implicit_activation_policy (PortableServer::ImplicitActivationPolicyValue value
00128                                                                                   ACE_ENV_ARG_DECL_WITH_DEFAULTS)
00129     ACE_THROW_SPEC ((CORBA::SystemException));
00130 
00131   PortableServer::ServantRetentionPolicy_ptr create_servant_retention_policy (PortableServer::ServantRetentionPolicyValue value
00132                                                                               ACE_ENV_ARG_DECL_WITH_DEFAULTS)
00133     ACE_THROW_SPEC ((CORBA::SystemException));
00134 
00135   PortableServer::RequestProcessingPolicy_ptr create_request_processing_policy (PortableServer::RequestProcessingPolicyValue value
00136                                                                                 ACE_ENV_ARG_DECL_WITH_DEFAULTS)
00137     ACE_THROW_SPEC ((CORBA::SystemException));
00138 
00139 #endif /* TAO_HAS_MINIMUM_POA == 0 */
00140 
00141   char * the_name (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
00142     ACE_THROW_SPEC ((CORBA::SystemException));
00143 
00144   PortableServer::POA_ptr the_parent (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
00145     ACE_THROW_SPEC ((CORBA::SystemException));
00146 
00147   PortableServer::POAList *the_children (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
00148     ACE_THROW_SPEC ((CORBA::SystemException));
00149 
00150   PortableServer::POAManager_ptr the_POAManager (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
00151     ACE_THROW_SPEC ((CORBA::SystemException));
00152 
00153 #if (TAO_HAS_MINIMUM_POA == 0)
00154 
00155   PortableServer::AdapterActivator_ptr the_activator (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
00156     ACE_THROW_SPEC ((CORBA::SystemException));
00157 
00158   void the_activator (PortableServer::AdapterActivator_ptr adapter_activator
00159                       ACE_ENV_ARG_DECL_WITH_DEFAULTS)
00160     ACE_THROW_SPEC ((CORBA::SystemException));
00161 
00162   PortableServer::ServantManager_ptr get_servant_manager (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
00163     ACE_THROW_SPEC ((CORBA::SystemException,
00164                      PortableServer::POA::WrongPolicy));
00165 
00166   void set_servant_manager (PortableServer::ServantManager_ptr imgr
00167                             ACE_ENV_ARG_DECL_WITH_DEFAULTS)
00168     ACE_THROW_SPEC ((CORBA::SystemException,
00169                      PortableServer::POA::WrongPolicy));
00170 
00171   PortableServer::Servant get_servant (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
00172     ACE_THROW_SPEC ((CORBA::SystemException,
00173                      PortableServer::POA::NoServant,
00174                      PortableServer::POA::WrongPolicy));
00175 
00176   void set_servant (PortableServer::Servant servant
00177                     ACE_ENV_ARG_DECL_WITH_DEFAULTS)
00178     ACE_THROW_SPEC ((CORBA::SystemException,
00179                      PortableServer::POA::WrongPolicy));
00180 
00181 #endif /* TAO_HAS_MINIMUM_POA == 0 */
00182 
00183   PortableServer::ObjectId *activate_object (PortableServer::Servant p_servant
00184                                              ACE_ENV_ARG_DECL_WITH_DEFAULTS)
00185     ACE_THROW_SPEC ((CORBA::SystemException,
00186                      PortableServer::POA::ServantAlreadyActive,
00187                      PortableServer::POA::WrongPolicy));
00188 
00189   void activate_object_with_id (const PortableServer::ObjectId &id,
00190                                 PortableServer::Servant p_servant
00191                                 ACE_ENV_ARG_DECL_WITH_DEFAULTS)
00192     ACE_THROW_SPEC ((CORBA::SystemException,
00193                      PortableServer::POA::ServantAlreadyActive,
00194                      PortableServer::POA::ObjectAlreadyActive,
00195                      PortableServer::POA::WrongPolicy));
00196 
00197   void deactivate_object (const PortableServer::ObjectId &oid
00198                           ACE_ENV_ARG_DECL_WITH_DEFAULTS)
00199     ACE_THROW_SPEC ((CORBA::SystemException,
00200                      PortableServer::POA::ObjectNotActive,
00201                      PortableServer::POA::WrongPolicy));
00202 
00203   CORBA::Object_ptr create_reference (const char *intf
00204                                       ACE_ENV_ARG_DECL_WITH_DEFAULTS)
00205     ACE_THROW_SPEC ((CORBA::SystemException,
00206                      PortableServer::POA::WrongPolicy));
00207 
00208   CORBA::Object_ptr create_reference_with_id (const PortableServer::ObjectId &oid,
00209                                               const char *intf
00210                                               ACE_ENV_ARG_DECL_WITH_DEFAULTS)
00211     ACE_THROW_SPEC ((CORBA::SystemException));
00212 
00213   PortableServer::ObjectId *servant_to_id (PortableServer::Servant p_servant
00214                                            ACE_ENV_ARG_DECL_WITH_DEFAULTS)
00215     ACE_THROW_SPEC ((CORBA::SystemException,
00216                      PortableServer::POA::ServantNotActive,
00217                      PortableServer::POA::WrongPolicy));
00218 
00219   CORBA::Object_ptr servant_to_reference (PortableServer::Servant p_servant
00220                                           ACE_ENV_ARG_DECL_WITH_DEFAULTS)
00221     ACE_THROW_SPEC ((CORBA::SystemException,
00222                      PortableServer::POA::ServantNotActive,
00223                      PortableServer::POA::WrongPolicy));
00224 
00225   PortableServer::Servant reference_to_servant (CORBA::Object_ptr reference
00226                                                 ACE_ENV_ARG_DECL_WITH_DEFAULTS)
00227     ACE_THROW_SPEC ((CORBA::SystemException,
00228                      PortableServer::POA::ObjectNotActive,
00229                      PortableServer::POA::WrongAdapter,
00230                      PortableServer::POA::WrongPolicy));
00231 
00232   PortableServer::ObjectId *reference_to_id (CORBA::Object_ptr reference
00233                                              ACE_ENV_ARG_DECL_WITH_DEFAULTS)
00234     ACE_THROW_SPEC ((CORBA::SystemException,
00235                      PortableServer::POA::WrongAdapter,
00236                      PortableServer::POA::WrongPolicy));
00237 
00238   PortableServer::Servant id_to_servant (const PortableServer::ObjectId &oid
00239                                          ACE_ENV_ARG_DECL_WITH_DEFAULTS)
00240     ACE_THROW_SPEC ((CORBA::SystemException,
00241                      PortableServer::POA::ObjectNotActive,
00242                      PortableServer::POA::WrongPolicy));
00243 
00244   CORBA::Object_ptr id_to_reference (const PortableServer::ObjectId &oid
00245                                      ACE_ENV_ARG_DECL_WITH_DEFAULTS)
00246     ACE_THROW_SPEC ((CORBA::SystemException,
00247                      PortableServer::POA::ObjectNotActive,
00248                      PortableServer::POA::WrongPolicy));
00249 
00250   CORBA::OctetSeq *id (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
00251     ACE_THROW_SPEC ((CORBA::SystemException));
00252 
00253   // End standard POA interface methods.
00254 
00255   virtual CORBA::PolicyList *client_exposed_policies (CORBA::Short object_priority
00256                                                       ACE_ENV_ARG_DECL);
00257 
00258   TAO_RT_POA (const String &name,
00259               PortableServer::POAManager_ptr poa_manager,
00260               const TAO_POA_Policy_Set &policies,
00261               TAO_Root_POA *parent,
00262               ACE_Lock &lock,
00263               TAO_SYNCH_MUTEX &thread_lock,
00264               TAO_ORB_Core &orb_core,
00265               TAO_Object_Adapter *object_adapter
00266               ACE_ENV_ARG_DECL);
00267 
00268   virtual ~TAO_RT_POA (void);
00269 
00270   void *thread_pool (void) const;
00271 
00272 protected:
00273 
00274   /// Template method for creating new POA's of this type.
00275   virtual TAO_Root_POA *new_POA (const String &name,
00276                                  PortableServer::POAManager_ptr poa_manager,
00277                             const TAO_POA_Policy_Set &policies,
00278                             TAO_Root_POA *parent,
00279                             ACE_Lock &lock,
00280                             TAO_SYNCH_MUTEX &thread_lock,
00281                             TAO_ORB_Core &orb_core,
00282                             TAO_Object_Adapter *object_adapter
00283                             ACE_ENV_ARG_DECL);
00284 
00285   virtual TAO_Stub *key_to_stub_i (const TAO::ObjectKey &key,
00286                                    const char *type_id,
00287                                    CORBA::Short priority
00288                                    ACE_ENV_ARG_DECL);
00289 
00290   void validate_priority (RTCORBA::Priority priority
00291                           ACE_ENV_ARG_DECL);
00292 
00293   void validate_policies (ACE_ENV_SINGLE_ARG_DECL);
00294 
00295   /// Parse the policy list for RT policies and update our
00296   /// cached policy instance.
00297   void parse_rt_policies (TAO_POA_Policy_Set &policies
00298                           ACE_ENV_ARG_DECL);
00299 
00300   size_t endpoint_count (void);
00301 
00302   TAO_Stub *create_stub_object (const TAO::ObjectKey &object_key,
00303                                 const char *type_id,
00304                                 CORBA::PolicyList *policy_list,
00305                                 TAO_Acceptor_Filter *filter,
00306                                 TAO_PriorityBandedConnectionPolicy *priority_bands
00307                                 ACE_ENV_ARG_DECL);
00308 
00309   int lane_required (TAO_Thread_Lane *lane,
00310                      TAO_PriorityBandedConnectionPolicy *priority_bands);
00311 
00312   TAO_Thread_Pool *thread_pool_;
00313 
00314 };
00315 
00316 TAO_END_VERSIONED_NAMESPACE_DECL
00317 
00318 #if defined(_MSC_VER)
00319 #pragma warning(pop)
00320 #endif /* _MSC_VER */
00321 
00322 #if defined (__ACE_INLINE__)
00323 # include "tao/RTPortableServer/RT_POA.i"
00324 #endif /* __ACE_INLINE__ */
00325 
00326 #endif /* TAO_HAS_CORBA_MESSAGING && TAO_HAS_CORBA_MESSAGING != 0 */
00327 
00328 #include /**/ "ace/post.h"
00329 
00330 #endif /* TAO_POA_H */

Generated on Thu Nov 9 12:55:46 2006 for TAO_RTPortableServer by doxygen 1.3.6