00001
00002
00003 #include "tao/PortableServer/RequestProcessingStrategyServantManager.h"
00004 #include "tao/PortableServer/ServantManagerC.h"
00005 #include "tao/PortableServer/Root_POA.h"
00006 #include "tao/ORB_Constants.h"
00007
00008 ACE_RCSID (PortableServer,
00009 Request_Processing,
00010 "RequestProcessingStrategyServantManager.cpp,v 1.6 2006/06/20 07:15:16 jwillemsen Exp")
00011
00012 #if (TAO_HAS_MINIMUM_POA == 0) && !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO)
00013
00014 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
00015
00016 namespace TAO
00017 {
00018 namespace Portable_Server
00019 {
00020 RequestProcessingStrategyServantManager::RequestProcessingStrategyServantManager (void)
00021 {
00022 }
00023
00024 PortableServer::Servant
00025 RequestProcessingStrategyServantManager::get_servant (
00026 ACE_ENV_SINGLE_ARG_DECL)
00027 ACE_THROW_SPEC ((CORBA::SystemException,
00028 PortableServer::POA::WrongPolicy))
00029 {
00030 ACE_THROW_RETURN (PortableServer::POA::WrongPolicy (),
00031 0);
00032 }
00033
00034 void
00035 RequestProcessingStrategyServantManager::set_servant (
00036 PortableServer::Servant servant
00037 ACE_ENV_ARG_DECL)
00038 ACE_THROW_SPEC ((CORBA::SystemException,
00039 PortableServer::POA::WrongPolicy))
00040 {
00041 ACE_UNUSED_ARG (servant);
00042
00043 ACE_THROW (PortableServer::POA::WrongPolicy ());
00044 }
00045
00046 void
00047 RequestProcessingStrategyServantManager::validate_servant_manager (
00048 PortableServer::ServantManager_ptr servant_manager
00049 ACE_ENV_ARG_DECL)
00050 {
00051
00052
00053 if (CORBA::is_nil (servant_manager))
00054 {
00055 ACE_THROW (CORBA::OBJ_ADAPTER (CORBA::OMGVMCID | 4,
00056 CORBA::COMPLETED_NO));
00057 }
00058 }
00059
00060 PortableServer::Servant
00061 RequestProcessingStrategyServantManager::system_id_to_servant (
00062 const PortableServer::ObjectId &system_id
00063 ACE_ENV_ARG_DECL)
00064 {
00065 return this->poa_->find_servant (system_id
00066 ACE_ENV_ARG_PARAMETER);
00067 }
00068
00069 PortableServer::ObjectId *
00070 RequestProcessingStrategyServantManager::servant_to_id (
00071 PortableServer::Servant servant
00072 ACE_ENV_ARG_DECL)
00073 ACE_THROW_SPEC ((CORBA::SystemException,
00074 PortableServer::POA::ServantNotActive,
00075 PortableServer::POA::WrongPolicy))
00076 {
00077 return this->poa_->servant_to_user_id (servant ACE_ENV_ARG_PARAMETER);
00078 }
00079
00080 PortableServer::Servant
00081 RequestProcessingStrategyServantManager::id_to_servant (
00082 const PortableServer::ObjectId &id
00083 ACE_ENV_ARG_DECL)
00084 ACE_THROW_SPEC ((CORBA::SystemException,
00085 PortableServer::POA::ObjectNotActive,
00086 PortableServer::POA::WrongPolicy))
00087 {
00088 return this->poa_->user_id_to_servant_i (id ACE_ENV_ARG_PARAMETER);
00089 }
00090
00091 ::PortableServer::RequestProcessingPolicyValue
00092 RequestProcessingStrategyServantManager::type() const
00093 {
00094 return ::PortableServer::USE_SERVANT_MANAGER;
00095 }
00096 }
00097 }
00098
00099 TAO_END_VERSIONED_NAMESPACE_DECL
00100
00101 #endif
00102