#include <PortableServer_PolicyFactory.h>
Inheritance diagram for TAO_PortableServer_PolicyFactory:
Public Member Functions | |
CORBA::Policy_ptr | create_policy (CORBA::PolicyType type, const CORBA::Any &value) throw (CORBA::SystemException, CORBA::PolicyError) |
Definition at line 29 of file PortableServer_PolicyFactory.h.
|
Definition at line 21 of file PortableServer_PolicyFactory.cpp. References ACE_CHECK_RETURN, ACE_ENV_ARG_PARAMETER, ACE_THROW_RETURN, and TAO::Portable_Server::create_policy().
00027 { 00028 #if (TAO_HAS_MINIMUM_POA == 0) 00029 00030 00031 if (type == ::PortableServer::THREAD_POLICY_ID) 00032 { 00033 TAO::Portable_Server::ThreadPolicy *thread_policy = 0; 00034 PortableServer::ThreadPolicyValue thr_value; 00035 00036 TAO::Portable_Server::create_policy (thread_policy, thr_value, value ACE_ENV_ARG_PARAMETER); 00037 ACE_CHECK_RETURN (CORBA::Policy::_nil ()); 00038 00039 return thread_policy; 00040 } 00041 00042 #endif /* TAO_HAS_MINIMUM_POA == 0 */ 00043 if (type == PortableServer::LIFESPAN_POLICY_ID) 00044 { 00045 TAO::Portable_Server::LifespanPolicy *lifespan_policy = 0; 00046 PortableServer::LifespanPolicyValue lifespan_value; 00047 00048 TAO::Portable_Server::create_policy (lifespan_policy, lifespan_value, value ACE_ENV_ARG_PARAMETER); 00049 ACE_CHECK_RETURN (CORBA::Policy::_nil ()); 00050 00051 return lifespan_policy; 00052 } 00053 00054 if (type == PortableServer::ID_UNIQUENESS_POLICY_ID) 00055 { 00056 TAO::Portable_Server::IdUniquenessPolicy *id_uniqueness_policy = 0; 00057 PortableServer::IdUniquenessPolicyValue id_uniqueness_value; 00058 00059 TAO::Portable_Server::create_policy (id_uniqueness_policy, id_uniqueness_value, value ACE_ENV_ARG_PARAMETER); 00060 ACE_CHECK_RETURN (CORBA::Policy::_nil ()); 00061 00062 return id_uniqueness_policy; 00063 } 00064 00065 if (type == PortableServer::ID_ASSIGNMENT_POLICY_ID) 00066 { 00067 TAO::Portable_Server::IdAssignmentPolicy *id_assignment_policy = 0; 00068 PortableServer::IdAssignmentPolicyValue id_assignment_value; 00069 00070 TAO::Portable_Server::create_policy (id_assignment_policy, id_assignment_value, value ACE_ENV_ARG_PARAMETER); 00071 ACE_CHECK_RETURN (CORBA::Policy::_nil ()); 00072 00073 return id_assignment_policy; 00074 } 00075 00076 #if (TAO_HAS_MINIMUM_POA == 0) 00077 00078 if (type == PortableServer::IMPLICIT_ACTIVATION_POLICY_ID) 00079 { 00080 TAO::Portable_Server::ImplicitActivationPolicy *implicit_activatation_policy = 0; 00081 PortableServer::ImplicitActivationPolicyValue implicit_activation_value; 00082 00083 TAO::Portable_Server::create_policy (implicit_activatation_policy, implicit_activation_value, value ACE_ENV_ARG_PARAMETER); 00084 ACE_CHECK_RETURN (CORBA::Policy::_nil ()); 00085 00086 return implicit_activatation_policy; 00087 } 00088 00089 if (type == PortableServer::SERVANT_RETENTION_POLICY_ID) 00090 { 00091 TAO::Portable_Server::ServantRetentionPolicy *servant_retention_policy = 0; 00092 PortableServer::ServantRetentionPolicyValue servant_retention_value; 00093 00094 TAO::Portable_Server::create_policy (servant_retention_policy, servant_retention_value, value ACE_ENV_ARG_PARAMETER); 00095 ACE_CHECK_RETURN (CORBA::Policy::_nil ()); 00096 00097 return servant_retention_policy; 00098 } 00099 00100 if (type == PortableServer::REQUEST_PROCESSING_POLICY_ID) 00101 { 00102 TAO::Portable_Server::RequestProcessingPolicy *request_processing_policy = 0; 00103 PortableServer::RequestProcessingPolicyValue request_processing_value; 00104 00105 TAO::Portable_Server::create_policy (request_processing_policy, request_processing_value, value ACE_ENV_ARG_PARAMETER); 00106 ACE_CHECK_RETURN (CORBA::Policy::_nil ()); 00107 00108 return request_processing_policy; 00109 } 00110 00111 #endif /* TAO_HAS_MINIMUM_POA == 0 */ 00112 00113 ACE_THROW_RETURN (CORBA::PolicyError (CORBA::BAD_POLICY_TYPE), 00114 CORBA::Policy::_nil ()); 00115 } |