RT_POA.h

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 
00003 //=============================================================================
00004 /**
00005  *  @file    RT_POA.h
00006  *
00007  *  $Id: RT_POA.h 76995 2007-02-11 12:51:42Z johnnyw $
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 
00058   CORBA::Object_ptr create_reference_with_id_and_priority (const PortableServer::ObjectId & oid,
00059                                                            const char * intf,
00060                                                            RTCORBA::Priority priority);
00061 
00062   PortableServer::ObjectId * activate_object_with_priority (PortableServer::Servant p_servant,
00063                                                             RTCORBA::Priority priority);
00064 
00065   void activate_object_with_id_and_priority (const PortableServer::ObjectId & oid,
00066                                              PortableServer::Servant p_servant,
00067                                              RTCORBA::Priority priority);
00068   // End RTCORBA specific methods
00069 
00070   // Standard POA interface methods
00071   PortableServer::POA_ptr create_POA (const char *adapter_name,
00072                                       PortableServer::POAManager_ptr poa_manager,
00073                                       const CORBA::PolicyList &policies);
00074 
00075   PortableServer::POA_ptr find_POA (const char *adapter_name,
00076                                     CORBA::Boolean activate_it);
00077 
00078   void destroy (CORBA::Boolean etherealize_objects,
00079                 CORBA::Boolean wait_for_completion);
00080 
00081 #if (TAO_HAS_MINIMUM_POA == 0) && !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO)
00082 
00083   PortableServer::ThreadPolicy_ptr create_thread_policy (
00084     PortableServer::ThreadPolicyValue value);
00085 
00086 #endif /* TAO_HAS_MINIMUM_POA == 0 */
00087 
00088 #if !defined (CORBA_E_MICRO)
00089   PortableServer::LifespanPolicy_ptr create_lifespan_policy (
00090     PortableServer::LifespanPolicyValue value);
00091 #endif
00092 
00093 #if !defined (CORBA_E_MICRO)
00094   PortableServer::IdUniquenessPolicy_ptr create_id_uniqueness_policy (
00095     PortableServer::IdUniquenessPolicyValue value);
00096 #endif
00097 
00098 #if !defined (CORBA_E_MICRO)
00099   PortableServer::IdAssignmentPolicy_ptr create_id_assignment_policy (
00100     PortableServer::IdAssignmentPolicyValue value);
00101 #endif
00102 
00103 #if (TAO_HAS_MINIMUM_POA == 0) && !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO)
00104   PortableServer::ImplicitActivationPolicy_ptr
00105     create_implicit_activation_policy (
00106       PortableServer::ImplicitActivationPolicyValue value);
00107 
00108   PortableServer::ServantRetentionPolicy_ptr
00109     create_servant_retention_policy (
00110       PortableServer::ServantRetentionPolicyValue value);
00111 
00112   PortableServer::RequestProcessingPolicy_ptr
00113     create_request_processing_policy (
00114       PortableServer::RequestProcessingPolicyValue value);
00115 
00116 #endif /* TAO_HAS_MINIMUM_POA == 0 && !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO) */
00117 
00118   char * the_name (void);
00119 
00120   PortableServer::POA_ptr the_parent (void);
00121 
00122   PortableServer::POAList *the_children (void);
00123 
00124   PortableServer::POAManager_ptr the_POAManager (void);
00125 
00126 #if (TAO_HAS_MINIMUM_POA == 0) && !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO)
00127 
00128   PortableServer::AdapterActivator_ptr the_activator (void);
00129 
00130   void the_activator (PortableServer::AdapterActivator_ptr adapter_activator);
00131 
00132   PortableServer::ServantManager_ptr get_servant_manager (void);
00133 
00134   void set_servant_manager (PortableServer::ServantManager_ptr imgr);
00135 
00136   PortableServer::Servant get_servant (void);
00137 
00138   void set_servant (PortableServer::Servant servant);
00139 
00140 #endif /* TAO_HAS_MINIMUM_POA == 0 */
00141 
00142   PortableServer::ObjectId *activate_object (PortableServer::Servant p_servant);
00143 
00144 #if !defined (CORBA_E_MICRO)
00145   void activate_object_with_id (const PortableServer::ObjectId &id,
00146                                 PortableServer::Servant p_servant);
00147 #endif
00148 
00149   void deactivate_object (const PortableServer::ObjectId &oid);
00150 
00151   CORBA::Object_ptr create_reference (const char *intf);
00152 
00153   CORBA::Object_ptr create_reference_with_id (const PortableServer::ObjectId &oid,
00154                                               const char *intf);
00155 
00156   PortableServer::ObjectId *servant_to_id (PortableServer::Servant p_servant);
00157 
00158   CORBA::Object_ptr servant_to_reference (PortableServer::Servant p_servant);
00159 
00160   PortableServer::Servant reference_to_servant (CORBA::Object_ptr reference);
00161 
00162   PortableServer::ObjectId *reference_to_id (CORBA::Object_ptr reference);
00163 
00164   PortableServer::Servant id_to_servant (const PortableServer::ObjectId &oid);
00165 
00166   CORBA::Object_ptr id_to_reference (const PortableServer::ObjectId &oid);
00167 
00168   CORBA::OctetSeq *id (void);
00169 
00170   // End standard POA interface methods.
00171 
00172   virtual CORBA::PolicyList *client_exposed_policies (CORBA::Short object_priority);
00173 
00174   TAO_RT_POA (const String &name,
00175               PortableServer::POAManager_ptr poa_manager,
00176               const TAO_POA_Policy_Set &policies,
00177               TAO_Root_POA *parent,
00178               ACE_Lock &lock,
00179               TAO_SYNCH_MUTEX &thread_lock,
00180               TAO_ORB_Core &orb_core,
00181               TAO_Object_Adapter *object_adapter);
00182 
00183   virtual ~TAO_RT_POA (void);
00184 
00185   void *thread_pool (void) const;
00186 
00187 protected:
00188 
00189   /// Template method for creating new POA's of this type.
00190   virtual TAO_Root_POA *new_POA (const String &name,
00191                                  PortableServer::POAManager_ptr poa_manager,
00192                                  const TAO_POA_Policy_Set &policies,
00193                                  TAO_Root_POA *parent,
00194                                  ACE_Lock &lock,
00195                                  TAO_SYNCH_MUTEX &thread_lock,
00196                                  TAO_ORB_Core &orb_core,
00197                                  TAO_Object_Adapter *object_adapter);
00198 
00199   virtual TAO_Stub *key_to_stub_i (const TAO::ObjectKey &key,
00200                                    const char *type_id,
00201                                    CORBA::Short priority);
00202 
00203   void validate_priority (RTCORBA::Priority priority);
00204 
00205   void validate_policies (void);
00206 
00207   /// Parse the policy list for RT policies and update our
00208   /// cached policy instance.
00209   void parse_rt_policies (TAO_POA_Policy_Set &policies);
00210 
00211   size_t endpoint_count (void);
00212 
00213   TAO_Stub *create_stub_object (const TAO::ObjectKey &object_key,
00214                                 const char *type_id,
00215                                 CORBA::PolicyList *policy_list,
00216                                 TAO_Acceptor_Filter *filter,
00217                                 TAO_PriorityBandedConnectionPolicy *priority_bands
00218                                );
00219 
00220   int lane_required (TAO_Thread_Lane *lane,
00221                      TAO_PriorityBandedConnectionPolicy *priority_bands);
00222 
00223   TAO_Thread_Pool *thread_pool_;
00224 
00225 };
00226 
00227 TAO_END_VERSIONED_NAMESPACE_DECL
00228 
00229 #if defined(_MSC_VER)
00230 #pragma warning(pop)
00231 #endif /* _MSC_VER */
00232 
00233 #if defined (__ACE_INLINE__)
00234 # include "tao/RTPortableServer/RT_POA.inl"
00235 #endif /* __ACE_INLINE__ */
00236 
00237 #endif /* TAO_HAS_CORBA_MESSAGING && TAO_HAS_CORBA_MESSAGING != 0 */
00238 
00239 #include /**/ "ace/post.h"
00240 
00241 #endif /* TAO_POA_H */

Generated on Sun Jan 27 13:31:11 2008 for TAO_RTPortableServer by doxygen 1.3.6