#include <RequestProcessingStrategyDefaultServant.h>


Definition at line 38 of file RequestProcessingStrategyDefaultServant.h.
| TAO::Portable_Server::RequestProcessingStrategyDefaultServant::RequestProcessingStrategyDefaultServant | ( | void | ) |
Definition at line 26 of file RequestProcessingStrategyDefaultServant.cpp.
: default_servant_ (0) { }
| void TAO::Portable_Server::RequestProcessingStrategyDefaultServant::cleanup_servant | ( | PortableServer::Servant | servant, | |
| const PortableServer::ObjectId & | user_id | |||
| ) | [virtual] |
Implements TAO::Portable_Server::RequestProcessingStrategy.
Definition at line 181 of file RequestProcessingStrategyDefaultServant.cpp.
{
if (servant)
{
// ATTENTION: Trick locking here, see class header for details
Non_Servant_Upcall non_servant_upcall (*this->poa_);
ACE_UNUSED_ARG (non_servant_upcall);
servant->_remove_ref ();
}
// This operation causes the association of the Object Id specified
// by the oid parameter and its servant to be removed from the
// Active Object Map.
if (this->poa_->unbind_using_user_id (user_id) != 0)
{
throw ::CORBA::OBJ_ADAPTER ();
}
}
| void TAO::Portable_Server::RequestProcessingStrategyDefaultServant::etherealize_objects | ( | CORBA::Boolean | etherealize_objects | ) | [virtual] |
Implements TAO::Portable_Server::RequestProcessingStrategy.
Definition at line 204 of file RequestProcessingStrategyDefaultServant.cpp.
{
}
| PortableServer::Servant TAO::Portable_Server::RequestProcessingStrategyDefaultServant::get_servant | ( | void | ) | [virtual] |
Implements TAO::Portable_Server::RequestProcessingStrategy.
Definition at line 51 of file RequestProcessingStrategyDefaultServant.cpp.
{
// This operation returns the default servant associated with the
// POA.
return this->default_servant_.in ();
}
| PortableServer::ServantManager_ptr TAO::Portable_Server::RequestProcessingStrategyDefaultServant::get_servant_manager | ( | void | ) | [virtual] |
Implements TAO::Portable_Server::RequestProcessingStrategy.
Definition at line 38 of file RequestProcessingStrategyDefaultServant.cpp.
{
throw PortableServer::POA::WrongPolicy ();
}
| PortableServer::Servant TAO::Portable_Server::RequestProcessingStrategyDefaultServant::id_to_servant | ( | const PortableServer::ObjectId & | id | ) | [virtual] |
Implements TAO::Portable_Server::RequestProcessingStrategy.
Definition at line 162 of file RequestProcessingStrategyDefaultServant.cpp.
{
PortableServer::Servant servant = this->default_servant_.in ();
if (servant == 0)
{
/*
* If using default servant request processing strategy but
* no default servant is available, we will raise the
* ObjectNotActive system exception.
*/
throw PortableServer::POA::ObjectNotActive ();
}
return servant;
}
| TAO_SERVANT_LOCATION TAO::Portable_Server::RequestProcessingStrategyDefaultServant::locate_servant | ( | const PortableServer::ObjectId & | system_id, | |
| PortableServer::Servant & | servant | |||
| ) | [virtual] |
Implements TAO::Portable_Server::RequestProcessingStrategy.
Definition at line 89 of file RequestProcessingStrategyDefaultServant.cpp.
{
TAO_SERVANT_LOCATION location = TAO_SERVANT_NOT_FOUND;
location = this->poa_->servant_present (system_id, servant);
if (location == TAO_SERVANT_NOT_FOUND)
{
if (this->default_servant_.in () != 0)
{
location = TAO_DEFAULT_SERVANT;
}
}
return location;
}
| PortableServer::Servant TAO::Portable_Server::RequestProcessingStrategyDefaultServant::locate_servant | ( | const char * | operation, | |
| const PortableServer::ObjectId & | system_id, | |||
| TAO::Portable_Server::Servant_Upcall & | servant_upcall, | |||
| TAO::Portable_Server::POA_Current_Impl & | poa_current_impl, | |||
| bool & | wait_occurred_restart_call | |||
| ) | [virtual] |
Implements TAO::Portable_Server::RequestProcessingStrategy.
Definition at line 110 of file RequestProcessingStrategyDefaultServant.cpp.
{
PortableServer::Servant servant = 0;
servant = this->poa_->find_servant (system_id,
servant_upcall,
poa_current_impl);
if (servant == 0)
{
// If the POA has the USE_DEFAULT_SERVANT policy, a default servant
// has been associated with the POA so the POA will invoke the
// appropriate method on that servant. If no servant has been
// associated with the POA, the POA raises the OBJ_ADAPTER system
// exception.
PortableServer::Servant default_servant = this->default_servant_.in ();
if (default_servant == 0)
{
throw ::CORBA::OBJ_ADAPTER (
CORBA::OMGVMCID | 3,
CORBA::COMPLETED_NO);
}
else
{
// Success
servant = default_servant;
}
}
return servant;
}
| void TAO::Portable_Server::RequestProcessingStrategyDefaultServant::post_invoke_servant_cleanup | ( | const PortableServer::ObjectId & | system_id, | |
| const TAO::Portable_Server::Servant_Upcall & | servant_upcall | |||
| ) | [virtual] |
Implements TAO::Portable_Server::RequestProcessingStrategy.
Definition at line 236 of file RequestProcessingStrategyDefaultServant.cpp.
{
}
| PortableServer::ObjectId * TAO::Portable_Server::RequestProcessingStrategyDefaultServant::servant_to_id | ( | PortableServer::Servant | servant | ) | [virtual] |
Implements TAO::Portable_Server::RequestProcessingStrategy.
Definition at line 210 of file RequestProcessingStrategyDefaultServant.cpp.
{
PortableServer::Servant default_servant = this->default_servant_.in ();
if (default_servant != 0 &&
default_servant == servant)
{
// If they are the same servant, then check if we are in an
// upcall.
TAO::Portable_Server::POA_Current_Impl *poa_current_impl =
static_cast <TAO::Portable_Server::POA_Current_Impl *>
(TAO_TSS_Resources::instance ()->poa_current_impl_);
// If we are in an upcall on the default servant, return the
// ObjectId associated with the current invocation.
if (poa_current_impl != 0 &&
servant == poa_current_impl->servant ())
{
return poa_current_impl->get_object_id ();
}
}
return this->poa_->servant_to_user_id (servant);
}
| void TAO::Portable_Server::RequestProcessingStrategyDefaultServant::set_servant | ( | PortableServer::Servant | servant | ) | [virtual] |
Implements TAO::Portable_Server::RequestProcessingStrategy.
Definition at line 59 of file RequestProcessingStrategyDefaultServant.cpp.
{
// This operation registers the specified servant with the POA as
// the default servant. This servant will be used for all requests
// for which no servant is found in the Active Object Map.
this->default_servant_ = servant;
// The implementation of set_servant will invoke _add_ref at least
// once on the Servant argument before returning. When the POA no
// longer needs the Servant, it will invoke _remove_ref on it the
// same number of times.
if (servant != 0)
{
// A recursive thread lock without using a recursive thread
// lock. Non_Servant_Upcall has a magic constructor and
// destructor. We unlock the Object_Adapter lock for the
// duration of the servant activator upcalls; reacquiring once
// the upcalls complete. Even though we are releasing the lock,
// other threads will not be able to make progress since
// <Object_Adapter::non_servant_upcall_in_progress_> has been
// set.
Non_Servant_Upcall non_servant_upcall (*this->poa_);
ACE_UNUSED_ARG (non_servant_upcall);
servant->_add_ref ();
}
}
| void TAO::Portable_Server::RequestProcessingStrategyDefaultServant::set_servant_manager | ( | PortableServer::ServantManager_ptr | imgr | ) | [virtual] |
Implements TAO::Portable_Server::RequestProcessingStrategy.
Definition at line 44 of file RequestProcessingStrategyDefaultServant.cpp.
{
throw PortableServer::POA::WrongPolicy ();
}
| void TAO::Portable_Server::RequestProcessingStrategyDefaultServant::strategy_cleanup | ( | void | ) | [virtual] |
Reimplemented from TAO::Portable_Server::RequestProcessingStrategy.
Definition at line 32 of file RequestProcessingStrategyDefaultServant.cpp.
{
this->default_servant_ = 0;
}
| PortableServer::Servant TAO::Portable_Server::RequestProcessingStrategyDefaultServant::system_id_to_servant | ( | const PortableServer::ObjectId & | system_id | ) | [virtual] |
Implements TAO::Portable_Server::RequestProcessingStrategy.
Definition at line 148 of file RequestProcessingStrategyDefaultServant.cpp.
{
PortableServer::Servant servant = this->default_servant_.in ();
if (servant == 0)
{
servant = this->poa_->find_servant (system_id);
}
return servant;
}
| PortableServer::RequestProcessingPolicyValue TAO::Portable_Server::RequestProcessingStrategyDefaultServant::type | ( | void | ) | const [virtual] |
Implements TAO::Portable_Server::RequestProcessingStrategy.
Definition at line 243 of file RequestProcessingStrategyDefaultServant.cpp.
{
return ::PortableServer::USE_DEFAULT_SERVANT;
}
PortableServer::ServantBase_var TAO::Portable_Server::RequestProcessingStrategyDefaultServant::default_servant_ [private] |
Definition at line 87 of file RequestProcessingStrategyDefaultServant.h.
1.7.0