TAO_CEC_ProxyPushSupplier Class Reference

ProxyPushSupplier. More...

#include <CEC_ProxyPushSupplier.h>

Collaboration diagram for TAO_CEC_ProxyPushSupplier:

Collaboration graph
[legend]
List of all members.

Public Types

typedef CosEventChannelAdmin::ProxyPushSupplier_ptr _ptr_type
typedef CosEventChannelAdmin::ProxyPushSupplier_var _var_type

Public Member Functions

 TAO_CEC_ProxyPushSupplier (TAO_CEC_EventChannel *event_channel)
 constructor...

virtual ~TAO_CEC_ProxyPushSupplier (void)
 destructor...

CosEventComm::PushConsumer_ptr consumer (void) const
virtual void shutdown (ACE_ENV_SINGLE_ARG_DECL)
 The event channel is shutting down.

virtual void push (const CORBA::Any &event ACE_ENV_ARG_DECL)
 Internal methods to push an event to each consumer.

virtual void push_nocopy (CORBA::Any &event ACE_ENV_ARG_DECL)
void push_to_consumer (const CORBA::Any &event ACE_ENV_ARG_DECL)
 Pushes to the consumer, verifies that it is connected.

void reactive_push_to_consumer (const CORBA::Any &event ACE_ENV_ARG_DECL)
CORBA::Boolean consumer_non_existent (CORBA::Boolean_out disconnected ACE_ENV_ARG_DECL)
CORBA::ULong _decr_refcnt (void)
virtual PortableServer::POA_ptr _default_POA (ACE_ENV_SINGLE_ARG_DECL)
virtual void _add_ref (ACE_ENV_SINGLE_ARG_DECL)
virtual void _remove_ref (ACE_ENV_SINGLE_ARG_DECL)

Public Attributes

virtual void virtual activate(CosEventChannelAdmin::ProxyPushSupplier_ptr
&ACE_ENV_ARG_DECL) ACE_THROW_SPEC((CORBA void deactivate(ACE_ENV_SINGLE_ARG_DECL)
ACE_THROW_SPEC((CORBA CORBA::Boolea 
is_connected )(void) const
 Return 0 if no consumer is connected...

virtual void virtual connect_push_consumer(CosEventComm::PushConsumer_ptr
push_consumer ACE_ENV_ARG_DECL_NOT_USED)
ACE_THROW_SPEC((CORBA void
disconnect_push_supplier(ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
ACE_THROW_SPEC((CORBA CORBA::ULon 
_incr_refcnt )(void)
 Increment and decrement the reference count.


Protected Member Functions

void consumer (CosEventComm::PushConsumer_ptr consumer)
void consumer_i (CosEventComm::PushConsumer_ptr consumer)
CORBA::Boolean is_connected_i (void) const
 The private version (without locking) of is_connected().

void cleanup_i (void)
 Release the child and the consumer.


Private Attributes

TAO_CEC_EventChannelevent_channel_
 The Event Channel that owns this object.

ACE_Locklock_
 The locking strategy.

CORBA::ULong refcount_
 The reference count.

CosEventComm::PushConsumer_var consumer_
 The consumer....

PortableServer::POA_var default_POA_
 Store the default POA.


Detailed Description

ProxyPushSupplier.

Implement the CosEventChannelAdmin::ProxyPushSupplier interface, remember that this class is used to communicate with a PushConsumer, so, in effect, this is the ambassador for a consumer inside the event channel. = MEMORY MANAGMENT It does not assume ownership of the TAO_CEC_Dispatching object. It makes a copy of the ConsumerQOS and the consumer object reference. = LOCKING Locking is strategized, the event channel acts as a factory for the locking strategies.

Definition at line 58 of file CEC_ProxyPushSupplier.h.


Member Typedef Documentation

typedef CosEventChannelAdmin::ProxyPushSupplier_ptr TAO_CEC_ProxyPushSupplier::_ptr_type
 

Definition at line 61 of file CEC_ProxyPushSupplier.h.

typedef CosEventChannelAdmin::ProxyPushSupplier_var TAO_CEC_ProxyPushSupplier::_var_type
 

Definition at line 62 of file CEC_ProxyPushSupplier.h.


Constructor & Destructor Documentation

TAO_CEC_ProxyPushSupplier::TAO_CEC_ProxyPushSupplier TAO_CEC_EventChannel event_channel  ) 
 

constructor...

Definition at line 38 of file CEC_ProxyPushSupplier.cpp.

References TAO_CEC_EventChannel::create_supplier_lock(), TAO_CEC_EventChannel::get_servant_retry_map(), and TAO_CEC_EventChannel::supplier_poa().

00039   : event_channel_ (ec),
00040     refcount_ (1)
00041 {
00042 #if defined (TAO_HAS_TYPED_EVENT_CHANNEL)
00043   typed_event_channel_ = 0;
00044 #endif /* TAO_HAS_TYPED_EVENT_CHANNEL */
00045 
00046   this->lock_ =
00047     this->event_channel_->create_supplier_lock ();
00048 
00049   this->default_POA_ =
00050     this->event_channel_->supplier_poa ();
00051 
00052   this->event_channel_->get_servant_retry_map ().bind (this, 0);
00053 }

TAO_CEC_ProxyPushSupplier::~TAO_CEC_ProxyPushSupplier void   )  [virtual]
 

destructor...

Definition at line 73 of file CEC_ProxyPushSupplier.cpp.

References TAO_CEC_EventChannel::destroy_supplier_lock(), and TAO_CEC_EventChannel::get_servant_retry_map().

00074 {
00075 #if defined (TAO_HAS_TYPED_EVENT_CHANNEL)
00076   if (this->is_typed_ec () )
00077     {
00078       this->typed_event_channel_->get_servant_retry_map ().unbind (this);
00079       this->typed_event_channel_->destroy_supplier_lock (this->lock_);
00080     }
00081   else
00082     {
00083       this->event_channel_->get_servant_retry_map ().unbind (this);
00084       this->event_channel_->destroy_supplier_lock (this->lock_);
00085     }
00086 #else
00087   this->event_channel_->get_servant_retry_map ().unbind (this);
00088   this->event_channel_->destroy_supplier_lock (this->lock_);
00089 #endif /* TAO_HAS_TYPED_EVENT_CHANNEL */
00090 }


Member Function Documentation

virtual void TAO_CEC_ProxyPushSupplier::_add_ref ACE_ENV_SINGLE_ARG_DECL   )  [virtual]
 

CORBA::ULong TAO_CEC_ProxyPushSupplier::_decr_refcnt void   ) 
 

Definition at line 323 of file CEC_ProxyPushSupplier.cpp.

References ACE_GUARD_RETURN, and TAO_CEC_EventChannel::destroy_proxy().

Referenced by TAO_CEC_Push_Command::~TAO_CEC_Push_Command().

00324 {
00325   {
00326     ACE_GUARD_RETURN (ACE_Lock, ace_mon, *this->lock_, 0);
00327     --this->refcount_;
00328     if (this->refcount_ != 0)
00329       return this->refcount_;
00330   }
00331 
00332   // Notify the event channel
00333 #if defined (TAO_HAS_TYPED_EVENT_CHANNEL)
00334   if (this->is_typed_ec () )
00335     {
00336       this->typed_event_channel_->destroy_proxy (this);
00337     }
00338   else
00339     {
00340       this->event_channel_->destroy_proxy (this);
00341     }
00342 #else
00343   this->event_channel_->destroy_proxy (this);
00344 #endif /* TAO_HAS_TYPED_EVENT_CHANNEL */
00345   return 0;
00346 }

virtual PortableServer::POA_ptr TAO_CEC_ProxyPushSupplier::_default_POA ACE_ENV_SINGLE_ARG_DECL   )  [virtual]
 

virtual void TAO_CEC_ProxyPushSupplier::_remove_ref ACE_ENV_SINGLE_ARG_DECL   )  [virtual]
 

void TAO_CEC_ProxyPushSupplier::cleanup_i void   )  [protected]
 

Release the child and the consumer.

Definition at line 305 of file CEC_ProxyPushSupplier.cpp.

00306 {
00307   this->consumer_ =
00308     CosEventComm::PushConsumer::_nil ();
00309 #if defined (TAO_HAS_TYPED_EVENT_CHANNEL)
00310   this->typed_consumer_ =
00311     CosTypedEventComm::TypedPushConsumer::_nil ();
00312 #endif /* TAO_HAS_TYPED_EVENT_CHANNEL */
00313 }

ACE_INLINE void TAO_CEC_ProxyPushSupplier::consumer CosEventComm::PushConsumer_ptr  consumer  )  [protected]
 

Set the consumer, used by some implementations to change the policies used when invoking operations on the consumer.

Definition at line 66 of file CEC_ProxyPushSupplier.i.

References ACE_GUARD, and consumer_i().

00067 {
00068   ACE_GUARD (ACE_Lock, ace_mon, *this->lock_);
00069 
00070   this->consumer_i (consumer);
00071 }

ACE_INLINE CosEventComm::PushConsumer_ptr TAO_CEC_ProxyPushSupplier::consumer void   )  const
 

Return the consumer object reference. It returns nil() if it has not connected yet. NOTE: This method does not return a new reference!!! Doing so will increase the locking overhead on the critical path.

Definition at line 33 of file CEC_ProxyPushSupplier.i.

References ACE_GUARD_RETURN.

00034 {
00035   ACE_GUARD_RETURN (ACE_Lock, ace_mon, *this->lock_, 0);
00036 
00037 #if defined (TAO_HAS_TYPED_EVENT_CHANNEL)
00038   if (this->is_typed_ec ())
00039   {
00040     return this->typed_consumer_.in ();
00041   }
00042   else
00043   {
00044     return this->consumer_.in ();
00045   }
00046 #else
00047   return this->consumer_.in ();
00048 #endif /* TAO_HAS_TYPED_EVENT_CHANNEL */
00049 }

ACE_INLINE void TAO_CEC_ProxyPushSupplier::consumer_i CosEventComm::PushConsumer_ptr  consumer  )  [protected]
 

Definition at line 52 of file CEC_ProxyPushSupplier.i.

Referenced by consumer().

00053 {
00054   this->consumer_ = consumer;
00055 }

CORBA::Boolean TAO_CEC_ProxyPushSupplier::consumer_non_existent CORBA::Boolean_out disconnected  ACE_ENV_ARG_DECL  ) 
 

Invoke the _non_existent() pseudo-operation on the consumer. If it is disconnected then it returns true and sets the flag.

Definition at line 861 of file CEC_ProxyPushSupplier.cpp.

References CORBA::Object::_duplicate(), ACE_CHECK_RETURN, ACE_ENV_SINGLE_ARG_PARAMETER, ACE_GUARD_THROW_EX, is_connected_i(), and CORBA::is_nil().

00864 {
00865   CORBA::Object_var consumer;
00866   {
00867     ACE_GUARD_THROW_EX (
00868         ACE_Lock, ace_mon, *this->lock_,
00869         CORBA::INTERNAL ());
00870     ACE_CHECK_RETURN (0);
00871 
00872     disconnected = 0;
00873     if (this->is_connected_i () == 0)
00874       {
00875         disconnected = 1;
00876         return 0;
00877       }
00878 
00879 #if defined (TAO_HAS_TYPED_EVENT_CHANNEL)
00880     if (this->is_typed_ec () )
00881       {
00882         if (CORBA::is_nil (this->typed_consumer_.in ()))
00883           {
00884             return 0;
00885           }
00886         consumer = CORBA::Object::_duplicate (this->typed_consumer_.in ());
00887       }
00888     else
00889       {
00890 #endif /* TAO_HAS_TYPED_EVENT_CHANNEL */
00891     if (CORBA::is_nil (this->consumer_.in ()))
00892       {
00893         return 0;
00894       }
00895     consumer = CORBA::Object::_duplicate (this->consumer_.in ());
00896 #if defined (TAO_HAS_TYPED_EVENT_CHANNEL)
00897       } /* ! this->is_typed_ec */
00898 #endif /* TAO_HAS_TYPED_EVENT_CHANNEL */
00899   }
00900 
00901 #if (TAO_HAS_MINIMUM_CORBA == 0)
00902   return consumer->_non_existent (ACE_ENV_SINGLE_ARG_PARAMETER);
00903 #else
00904   return 0;
00905 #endif /* TAO_HAS_MINIMUM_CORBA */
00906 }

TAO_BEGIN_VERSIONED_NAMESPACE_DECL ACE_INLINE CORBA::Boolean TAO_CEC_ProxyPushSupplier::is_connected_i void   )  const [protected]
 

The private version (without locking) of is_connected().

Definition at line 8 of file CEC_ProxyPushSupplier.i.

References CORBA::is_nil().

Referenced by consumer_non_existent().

00009 {
00010 #if defined (TAO_HAS_TYPED_EVENT_CHANNEL)
00011   if (this->is_typed_ec ())
00012   {
00013     return !CORBA::is_nil (this->typed_consumer_.in ());
00014   }
00015   else
00016   {
00017   return !CORBA::is_nil (this->consumer_.in ());
00018   }
00019 #else
00020   return !CORBA::is_nil (this->consumer_.in ());
00021 #endif /* TAO_HAS_TYPED_EVENT_CHANNEL */
00022 }

virtual void TAO_CEC_ProxyPushSupplier::push const CORBA::Any &event  ACE_ENV_ARG_DECL  )  [virtual]
 

Internal methods to push an event to each consumer.

virtual void TAO_CEC_ProxyPushSupplier::push_nocopy CORBA::Any &event  ACE_ENV_ARG_DECL  )  [virtual]
 

void TAO_CEC_ProxyPushSupplier::push_to_consumer const CORBA::Any &event  ACE_ENV_ARG_DECL  ) 
 

Pushes to the consumer, verifies that it is connected.

Referenced by TAO_CEC_Push_Command::execute().

void TAO_CEC_ProxyPushSupplier::reactive_push_to_consumer const CORBA::Any &event  ACE_ENV_ARG_DECL  ) 
 

Referenced by TAO_CEC_Reactive_Dispatching::push(), and TAO_CEC_Reactive_Dispatching::push_nocopy().

virtual void TAO_CEC_ProxyPushSupplier::shutdown ACE_ENV_SINGLE_ARG_DECL   )  [virtual]
 

The event channel is shutting down.


Member Data Documentation

CORBA::ULong TAO_CEC_ProxyPushSupplier::_incr_refcnt
 

Increment and decrement the reference count.

Definition at line 316 of file CEC_ProxyPushSupplier.cpp.

Referenced by TAO_CEC_Push_Command::TAO_CEC_Push_Command().

00317 {
00318   ACE_GUARD_RETURN (ACE_Lock, ace_mon, *this->lock_, 0);
00319   return this->refcount_++;
00320 }

CosEventComm::PushConsumer_var TAO_CEC_ProxyPushSupplier::consumer_ [private]
 

The consumer....

Definition at line 185 of file CEC_ProxyPushSupplier.h.

PortableServer::POA_var TAO_CEC_ProxyPushSupplier::default_POA_ [private]
 

Store the default POA.

Definition at line 196 of file CEC_ProxyPushSupplier.h.

TAO_CEC_EventChannel* TAO_CEC_ProxyPushSupplier::event_channel_ [private]
 

The Event Channel that owns this object.

Definition at line 171 of file CEC_ProxyPushSupplier.h.

ACE_INLINE CORBA::Boolean TAO_CEC_ProxyPushSupplier::is_connected
 

Return 0 if no consumer is connected...

Definition at line 25 of file CEC_ProxyPushSupplier.i.

00026 {
00027   ACE_GUARD_RETURN (ACE_Lock, ace_mon, *this->lock_, 0);
00028 
00029   return this->is_connected_i ();
00030 }

ACE_Lock* TAO_CEC_ProxyPushSupplier::lock_ [private]
 

The locking strategy.

Definition at line 179 of file CEC_ProxyPushSupplier.h.

CORBA::ULong TAO_CEC_ProxyPushSupplier::refcount_ [private]
 

The reference count.

Definition at line 182 of file CEC_ProxyPushSupplier.h.


The documentation for this class was generated from the following files:
Generated on Thu Nov 9 13:19:41 2006 for TAO_CosEvent by doxygen 1.3.6