TAO::Portable_Server::ServantRetentionStrategyNonRetain Class Reference

#include <ServantRetentionStrategyNonRetain.h>

Inheritance diagram for TAO::Portable_Server::ServantRetentionStrategyNonRetain:

Inheritance graph
[legend]
Collaboration diagram for TAO::Portable_Server::ServantRetentionStrategyNonRetain:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 ServantRetentionStrategyNonRetain (void)
virtual void strategy_init (TAO_Root_POA *poa)
virtual void strategy_cleanup (void)
CORBA::ULong waiting_servant_deactivation (void) const
virtual PortableServer::ObjectIdactivate_object (PortableServer::Servant servant, CORBA::Short priority, bool &wait_occurred_restart_call)
virtual void activate_object_with_id (const PortableServer::ObjectId &id, PortableServer::Servant servant, CORBA::Short priority, bool &wait_occurred_restart_call)
virtual void deactivate_object (const PortableServer::ObjectId &id)
virtual PortableServer::Servant find_servant (const PortableServer::ObjectId &system_id)
virtual int is_servant_in_map (PortableServer::Servant servant, bool &wait_occurred_restart_call)
virtual PortableServer::ObjectIdsystem_id_to_object_id (const PortableServer::ObjectId &system_id)
virtual PortableServer::Servant user_id_to_servant (const PortableServer::ObjectId &id)
CORBA::Object_ptr id_to_reference (const PortableServer::ObjectId &id, bool indirect)
virtual TAO_SERVANT_LOCATION servant_present (const PortableServer::ObjectId &system_id, PortableServer::Servant &servant)
virtual PortableServer::Servant find_servant (const PortableServer::ObjectId &system_id, TAO::Portable_Server::Servant_Upcall &servant_upcall, TAO::Portable_Server::POA_Current_Impl &poa_current_impl)
virtual int find_servant_priority (const PortableServer::ObjectId &system_id, CORBA::Short &priority)
virtual void deactivate_all_objects (void)
virtual PortableServer::ObjectIdservant_to_user_id (PortableServer::Servant servant)
virtual CORBA::Object_ptr servant_to_reference (PortableServer::Servant servant)
virtual CORBA::Object_ptr create_reference (const char *intf, CORBA::Short priority)
virtual CORBA::Object_ptr create_reference_with_id (const PortableServer::ObjectId &oid, const char *intf, CORBA::Short priority)
virtual int rebind_using_user_id_and_system_id (PortableServer::Servant servant, const PortableServer::ObjectId &user_id, const PortableServer::ObjectId &system_id, TAO::Portable_Server::Servant_Upcall &servant_upcall)
virtual CORBA::Boolean servant_has_remaining_activations (PortableServer::Servant servant)
virtual int unbind_using_user_id (const PortableServer::ObjectId &user_id)
virtual::PortableServer::ServantRetentionPolicyValue type () const

Protected Attributes

TAO_Root_POApoa_

Constructor & Destructor Documentation

TAO::Portable_Server::ServantRetentionStrategyNonRetain::ServantRetentionStrategyNonRetain void   ) 
 

Definition at line 30 of file ServantRetentionStrategyNonRetain.cpp.

00030                                                                               :
00031       poa_ (0)
00032     {
00033     }


Member Function Documentation

PortableServer::ObjectId * TAO::Portable_Server::ServantRetentionStrategyNonRetain::activate_object PortableServer::Servant  servant,
CORBA::Short  priority,
bool &  wait_occurred_restart_call
[virtual]
 

Implements TAO::Portable_Server::ServantRetentionStrategy.

Reimplemented in TAO::Portable_Server::ServantRetentionStrategyRetain.

Definition at line 159 of file ServantRetentionStrategyNonRetain.cpp.

00163     {
00164       throw PortableServer::POA::WrongPolicy ();
00165     }

void TAO::Portable_Server::ServantRetentionStrategyNonRetain::activate_object_with_id const PortableServer::ObjectId id,
PortableServer::Servant  servant,
CORBA::Short  priority,
bool &  wait_occurred_restart_call
[virtual]
 

Implements TAO::Portable_Server::ServantRetentionStrategy.

Reimplemented in TAO::Portable_Server::ServantRetentionStrategyRetain.

Definition at line 169 of file ServantRetentionStrategyNonRetain.cpp.

00174     {
00175       throw PortableServer::POA::WrongPolicy ();
00176     }

CORBA::Object_ptr TAO::Portable_Server::ServantRetentionStrategyNonRetain::create_reference const char *  intf,
CORBA::Short  priority
[virtual]
 

Implements TAO::Portable_Server::ServantRetentionStrategy.

Reimplemented in TAO::Portable_Server::ServantRetentionStrategyRetain.

Definition at line 180 of file ServantRetentionStrategyNonRetain.cpp.

References ACE_NEW_THROW_EX, TAO_Root_POA::invoke_key_to_object_helper_i(), and TAO_Root_POA::key_to_object_params_.

00183     {
00184       // This operation creates an object reference that encapsulates a
00185       // POA-generated Object Id value and the specified interface
00186       // repository id. This operation does not cause an activation to
00187       // take place. The resulting reference may be passed to clients, so
00188       // that subsequent requests on those references will cause the
00189       // appropriate servant manager to be invoked, if one is
00190       // available. The generated Object Id value may be obtained by
00191       // invoking POA::reference_to_id with the created reference.
00192 
00193       PortableServer::ObjectId_var system_id;
00194       PortableServer::ObjectId user_id;
00195 
00196       // Otherwise, it is the NON_RETAIN policy.  Therefore, any ol'
00197       // object id will do (even an empty one).
00198       PortableServer::ObjectId *sys_id = 0;
00199       ACE_NEW_THROW_EX (sys_id,
00200                         PortableServer::ObjectId,
00201                         CORBA::NO_MEMORY ());
00202 
00203       system_id = sys_id;
00204 
00205       // User id is the same as system id.
00206       user_id = system_id.in ();
00207 
00208       // Remember params for potentially invoking <key_to_object> later.
00209       this->poa_->key_to_object_params_.set (system_id,
00210                                              intf,
00211                                              0,
00212                                              1,
00213                                              priority,
00214                                              true);
00215 
00216       return this->poa_->invoke_key_to_object_helper_i (intf, user_id);
00217     }

CORBA::Object_ptr TAO::Portable_Server::ServantRetentionStrategyNonRetain::create_reference_with_id const PortableServer::ObjectId oid,
const char *  intf,
CORBA::Short  priority
[virtual]
 

Implements TAO::Portable_Server::ServantRetentionStrategy.

Reimplemented in TAO::Portable_Server::ServantRetentionStrategyRetain.

Definition at line 220 of file ServantRetentionStrategyNonRetain.cpp.

References ACE_NEW_THROW_EX, TAO_Root_POA::invoke_key_to_object_helper_i(), and TAO_Root_POA::key_to_object_params_.

00224     {
00225       // This operation creates an object reference that encapsulates the
00226       // specified Object Id and interface repository Id values. This
00227       // operation does not cause an activation to take place.  The
00228       // resulting reference may be passed to clients, so that subsequent
00229       // requests on those references will cause the object to be
00230       // activated if necessary, or the default servant used, depending on
00231       // the applicable policies.
00232 
00233       PortableServer::Servant servant = 0;
00234       PortableServer::ObjectId_var system_id;
00235 
00236       // Otherwise, it is the NON_RETAIN policy.  Therefore, user id
00237       // is the same as system id.
00238       PortableServer::ObjectId *sys_id = 0;
00239       ACE_NEW_THROW_EX (sys_id,
00240                         PortableServer::ObjectId (oid),
00241                         CORBA::NO_MEMORY ());
00242 
00243       system_id = sys_id;
00244 
00245       // Remember params for potentially invoking <key_to_object> later.
00246       this->poa_->key_to_object_params_.set (system_id,
00247                                              intf,
00248                                              servant,
00249                                              1,
00250                                              priority,
00251                                              true);
00252 
00253       return this->poa_->invoke_key_to_object_helper_i (intf, oid);
00254     }

void TAO::Portable_Server::ServantRetentionStrategyNonRetain::deactivate_all_objects void   )  [virtual]
 

Implements TAO::Portable_Server::ServantRetentionStrategy.

Reimplemented in TAO::Portable_Server::ServantRetentionStrategyRetain.

Definition at line 140 of file ServantRetentionStrategyNonRetain.cpp.

00141     {
00142     }

void TAO::Portable_Server::ServantRetentionStrategyNonRetain::deactivate_object const PortableServer::ObjectId id  )  [virtual]
 

Implements TAO::Portable_Server::ServantRetentionStrategy.

Reimplemented in TAO::Portable_Server::ServantRetentionStrategyRetain.

Definition at line 48 of file ServantRetentionStrategyNonRetain.cpp.

00050     {
00051       // When using Non_Retain we don't have an active object map and we just
00052       // can't deactivate any object
00053       throw PortableServer::POA::WrongPolicy ();
00054     }

PortableServer::Servant TAO::Portable_Server::ServantRetentionStrategyNonRetain::find_servant const PortableServer::ObjectId system_id,
TAO::Portable_Server::Servant_Upcall servant_upcall,
TAO::Portable_Server::POA_Current_Impl poa_current_impl
[virtual]
 

Implements TAO::Portable_Server::ServantRetentionStrategy.

Reimplemented in TAO::Portable_Server::ServantRetentionStrategyRetain.

Definition at line 101 of file ServantRetentionStrategyNonRetain.cpp.

References TAO::Portable_Server::POA_Current_Impl::replace_object_id(), and TAO::Portable_Server::Servant_Upcall::user_id().

00105     {
00106       // We have the NON_RETAIN policy, user id is the system id.
00107 
00108       // Smartly copy all the data; <poa_current_impl.object_id_> does
00109       // not own the data.
00110       poa_current_impl.replace_object_id (system_id);
00111 
00112       servant_upcall.user_id (&system_id);
00113 
00114       return 0;
00115     }

PortableServer::Servant TAO::Portable_Server::ServantRetentionStrategyNonRetain::find_servant const PortableServer::ObjectId system_id  )  [virtual]
 

Implements TAO::Portable_Server::ServantRetentionStrategy.

Reimplemented in TAO::Portable_Server::ServantRetentionStrategyRetain.

Definition at line 57 of file ServantRetentionStrategyNonRetain.cpp.

00059     {
00060       throw PortableServer::POA::WrongPolicy ();
00061     }

int TAO::Portable_Server::ServantRetentionStrategyNonRetain::find_servant_priority const PortableServer::ObjectId system_id,
CORBA::Short priority
[virtual]
 

Implements TAO::Portable_Server::ServantRetentionStrategy.

Reimplemented in TAO::Portable_Server::ServantRetentionStrategyRetain.

Definition at line 118 of file ServantRetentionStrategyNonRetain.cpp.

00121     {
00122       return -1;
00123     }

CORBA::Object_ptr TAO::Portable_Server::ServantRetentionStrategyNonRetain::id_to_reference const PortableServer::ObjectId id,
bool  indirect
[virtual]
 

Implements TAO::Portable_Server::ServantRetentionStrategy.

Reimplemented in TAO::Portable_Server::ServantRetentionStrategyRetain.

Definition at line 85 of file ServantRetentionStrategyNonRetain.cpp.

00088     {
00089       throw PortableServer::POA::WrongPolicy ();
00090     }

int TAO::Portable_Server::ServantRetentionStrategyNonRetain::is_servant_in_map PortableServer::Servant  servant,
bool &  wait_occurred_restart_call
[virtual]
 

Implements TAO::Portable_Server::ServantRetentionStrategy.

Reimplemented in TAO::Portable_Server::ServantRetentionStrategyRetain.

Definition at line 126 of file ServantRetentionStrategyNonRetain.cpp.

00129     {
00130       return 0;
00131     }

int TAO::Portable_Server::ServantRetentionStrategyNonRetain::rebind_using_user_id_and_system_id PortableServer::Servant  servant,
const PortableServer::ObjectId user_id,
const PortableServer::ObjectId system_id,
TAO::Portable_Server::Servant_Upcall servant_upcall
[virtual]
 

Implements TAO::Portable_Server::ServantRetentionStrategy.

Reimplemented in TAO::Portable_Server::ServantRetentionStrategyRetain.

Definition at line 257 of file ServantRetentionStrategyNonRetain.cpp.

00262     {
00263       return -1;
00264     }

CORBA::Boolean TAO::Portable_Server::ServantRetentionStrategyNonRetain::servant_has_remaining_activations PortableServer::Servant  servant  )  [virtual]
 

Implements TAO::Portable_Server::ServantRetentionStrategy.

Reimplemented in TAO::Portable_Server::ServantRetentionStrategyRetain.

Definition at line 267 of file ServantRetentionStrategyNonRetain.cpp.

00269     {
00270       return false;
00271     }

TAO_SERVANT_LOCATION TAO::Portable_Server::ServantRetentionStrategyNonRetain::servant_present const PortableServer::ObjectId system_id,
PortableServer::Servant servant
[virtual]
 

Implements TAO::Portable_Server::ServantRetentionStrategy.

Reimplemented in TAO::Portable_Server::ServantRetentionStrategyRetain.

Definition at line 93 of file ServantRetentionStrategyNonRetain.cpp.

References TAO_SERVANT_NOT_FOUND.

00096     {
00097       return TAO_SERVANT_NOT_FOUND;
00098     }

CORBA::Object_ptr TAO::Portable_Server::ServantRetentionStrategyNonRetain::servant_to_reference PortableServer::Servant  servant  )  [virtual]
 

Implements TAO::Portable_Server::ServantRetentionStrategy.

Reimplemented in TAO::Portable_Server::ServantRetentionStrategyRetain.

Definition at line 152 of file ServantRetentionStrategyNonRetain.cpp.

00154     {
00155       throw PortableServer::POA::WrongPolicy ();
00156     }

PortableServer::ObjectId * TAO::Portable_Server::ServantRetentionStrategyNonRetain::servant_to_user_id PortableServer::Servant  servant  )  [virtual]
 

Implements TAO::Portable_Server::ServantRetentionStrategy.

Reimplemented in TAO::Portable_Server::ServantRetentionStrategyRetain.

Definition at line 145 of file ServantRetentionStrategyNonRetain.cpp.

00147     {
00148       throw PortableServer::POA::WrongPolicy ();
00149     }

void TAO::Portable_Server::ServantRetentionStrategyNonRetain::strategy_cleanup void   )  [virtual]
 

Implements TAO::Portable_Server::Policy_Strategy.

Reimplemented in TAO::Portable_Server::ServantRetentionStrategyRetain.

Definition at line 42 of file ServantRetentionStrategyNonRetain.cpp.

00043     {
00044       poa_ = 0;
00045     }

void TAO::Portable_Server::ServantRetentionStrategyNonRetain::strategy_init TAO_Root_POA poa  )  [virtual]
 

Implements TAO::Portable_Server::Policy_Strategy.

Reimplemented in TAO::Portable_Server::ServantRetentionStrategyRetain.

Definition at line 36 of file ServantRetentionStrategyNonRetain.cpp.

00037     {
00038       poa_ = poa;
00039     }

PortableServer::ObjectId * TAO::Portable_Server::ServantRetentionStrategyNonRetain::system_id_to_object_id const PortableServer::ObjectId system_id  )  [virtual]
 

Implements TAO::Portable_Server::ServantRetentionStrategy.

Reimplemented in TAO::Portable_Server::ServantRetentionStrategyRetain.

Definition at line 64 of file ServantRetentionStrategyNonRetain.cpp.

References ACE_NEW_THROW_EX.

00066     {
00067       // The system id is the id (and no conversion/transformation is
00068       // needed).
00069       PortableServer::ObjectId *id = 0;
00070       ACE_NEW_THROW_EX (id,
00071                         PortableServer::ObjectId (system_id),
00072                         CORBA::NO_MEMORY ());
00073 
00074       return id;
00075     }

PortableServer::ServantRetentionPolicyValue TAO::Portable_Server::ServantRetentionStrategyNonRetain::type  )  const [virtual]
 

Implements TAO::Portable_Server::ServantRetentionStrategy.

Reimplemented in TAO::Portable_Server::ServantRetentionStrategyRetain.

Definition at line 281 of file ServantRetentionStrategyNonRetain.cpp.

00282     {
00283       return ::PortableServer::NON_RETAIN;
00284     }

int TAO::Portable_Server::ServantRetentionStrategyNonRetain::unbind_using_user_id const PortableServer::ObjectId user_id  )  [virtual]
 

Implements TAO::Portable_Server::ServantRetentionStrategy.

Reimplemented in TAO::Portable_Server::ServantRetentionStrategyRetain.

Definition at line 274 of file ServantRetentionStrategyNonRetain.cpp.

00276     {
00277       return 0;
00278     }

PortableServer::Servant TAO::Portable_Server::ServantRetentionStrategyNonRetain::user_id_to_servant const PortableServer::ObjectId id  )  [virtual]
 

Implements TAO::Portable_Server::ServantRetentionStrategy.

Reimplemented in TAO::Portable_Server::ServantRetentionStrategyRetain.

Definition at line 78 of file ServantRetentionStrategyNonRetain.cpp.

00080     {
00081       throw PortableServer::POA::WrongPolicy ();
00082     }

CORBA::ULong TAO::Portable_Server::ServantRetentionStrategyNonRetain::waiting_servant_deactivation void   )  const [virtual]
 

Implements TAO::Portable_Server::ServantRetentionStrategy.

Reimplemented in TAO::Portable_Server::ServantRetentionStrategyRetain.

Definition at line 134 of file ServantRetentionStrategyNonRetain.cpp.

00135     {
00136       return 0;
00137     }


Member Data Documentation

TAO_Root_POA* TAO::Portable_Server::ServantRetentionStrategyNonRetain::poa_ [protected]
 

Definition at line 125 of file ServantRetentionStrategyNonRetain.h.


The documentation for this class was generated from the following files:
Generated on Sun Jan 27 13:29:24 2008 for TAO_PortableServer by doxygen 1.3.6