TAO_Notify_Method_Request_Lookup Class Reference

#include <Method_Request_Lookup.h>

Inheritance diagram for TAO_Notify_Method_Request_Lookup:

Inheritance graph
[legend]
Collaboration diagram for TAO_Notify_Method_Request_Lookup:

Collaboration graph
[legend]
List of all members.

Public Types

 persistence_code = 2
enum  { persistence_code = 2 }
 an arbitrary code (Octet) to identify this type of request in persistent storage More...

Public Member Functions

virtual ~TAO_Notify_Method_Request_Lookup ()
 Destructor.

Static Public Member Functions

static TAO_Notify_Method_Request_Lookup_Queueableunmarshal (TAO_Notify::Delivery_Request_Ptr &delivery_request, TAO_Notify_EventChannelFactory &ecf, TAO_InputCDR &cdr)
 Static method used to reconstruct a Method Request Dispatch.

Protected Member Functions

 TAO_Notify_Method_Request_Lookup (const TAO_Notify_Event *event, TAO_Notify_ProxyConsumer *proxy)
 Constructor.
 TAO_Notify_Method_Request_Lookup (const TAO_Notify::Delivery_Request_Ptr &delivery, TAO_Notify_ProxyConsumer *proxy)
 Constructor.
int execute_i (void)
 Execute the dispatch operation.
virtual void work (TAO_Notify_ProxySupplier *proxy_supplier)
 = TAO_ESF_Worker method

Protected Attributes

TAO_Notify_ProxyConsumerproxy_consumer_
 The Proxy.

Detailed Description

Definition at line 40 of file Method_Request_Lookup.h.


Member Enumeration Documentation

anonymous enum

an arbitrary code (Octet) to identify this type of request in persistent storage

Enumerator:
persistence_code 

Definition at line 47 of file Method_Request_Lookup.h.

00047 {persistence_code = 2};


Constructor & Destructor Documentation

TAO_Notify_Method_Request_Lookup::~TAO_Notify_Method_Request_Lookup (  )  [virtual]

Destructor.

Definition at line 42 of file Method_Request_Lookup.cpp.

00043 {
00044 }

TAO_BEGIN_VERSIONED_NAMESPACE_DECL TAO_Notify_Method_Request_Lookup::TAO_Notify_Method_Request_Lookup ( const TAO_Notify_Event event,
TAO_Notify_ProxyConsumer proxy 
) [protected]

Constructor.

Definition at line 26 of file Method_Request_Lookup.cpp.

00029   : TAO_Notify_Method_Request_Event (event)
00030   , proxy_consumer_ (proxy)
00031 {
00032 }

TAO_Notify_Method_Request_Lookup::TAO_Notify_Method_Request_Lookup ( const TAO_Notify::Delivery_Request_Ptr delivery,
TAO_Notify_ProxyConsumer proxy 
) [protected]

Constructor.

Definition at line 34 of file Method_Request_Lookup.cpp.

00037   : TAO_Notify_Method_Request_Event (delivery)
00038   , proxy_consumer_ (proxy)
00039 {
00040 }


Member Function Documentation

int TAO_Notify_Method_Request_Lookup::execute_i ( void   )  [protected]

Execute the dispatch operation.

Definition at line 61 of file Method_Request_Lookup.cpp.

References ACE_DEBUG, TAO_Notify_Proxy::check_filters(), TAO_Notify_Method_Request_Event::complete(), TAO_Notify_Event_Manager::consumer_map(), TAO_Notify_Object::event_manager(), TAO_Notify_Admin::filter_admin(), TAO_Notify_Admin::filter_operator(), TAO_ESF_Proxy_Collection< PROXY >::for_each(), LM_DEBUG, proxy_consumer_, TAO_Notify_ProxyConsumer::supplier_admin(), and TAO_debug_level.

Referenced by TAO_Notify_Method_Request_Lookup_No_Copy::execute(), and TAO_Notify_Method_Request_Lookup_Queueable::execute().

00062 {
00063   if (this->proxy_consumer_->has_shutdown ())
00064     return 0; // If we were shutdown while waiting in the queue, return with no action.
00065 
00066   TAO_Notify_SupplierAdmin& parent = this->proxy_consumer_->supplier_admin ();
00067 
00068   CORBA::Boolean val =  this->proxy_consumer_->check_filters (this->event_,
00069                                                              parent.filter_admin (),
00070                                                              parent.filter_operator ());
00071 
00072   if (TAO_debug_level > 1)
00073     ACE_DEBUG ((LM_DEBUG, "Proxyconsumer %x filter eval result = %d",&this->proxy_consumer_ , val));
00074 
00075   // Filter failed - do nothing.
00076   if (val == 0)
00077     return 0;
00078 
00079   // The map of subscriptions.
00080   TAO_Notify_Consumer_Map& map = this->proxy_consumer_->event_manager ().consumer_map ();
00081 
00082   TAO_Notify_Consumer_Map::ENTRY* entry = map.find (this->event_->type ());
00083 
00084   TAO_Notify_ProxySupplier_Collection* consumers = 0;
00085 
00086   if (entry != 0)
00087   {
00088     consumers = entry->collection ();
00089 
00090     if (consumers != 0)
00091       {
00092         consumers->for_each (this);
00093       }
00094 
00095     map.release (entry);
00096   }
00097 
00098   // Get the default consumers
00099   consumers = map.broadcast_collection ();
00100 
00101   if (consumers != 0)
00102     {
00103       consumers->for_each (this);
00104     }
00105   this->complete ();
00106   return 0;
00107 }

TAO_Notify_Method_Request_Lookup_Queueable * TAO_Notify_Method_Request_Lookup::unmarshal ( TAO_Notify::Delivery_Request_Ptr delivery_request,
TAO_Notify_EventChannelFactory ecf,
TAO_InputCDR cdr 
) [static]

Static method used to reconstruct a Method Request Dispatch.

Definition at line 111 of file Method_Request_Lookup.cpp.

References ACE_ERROR, ACE_NEW_NORETURN, ACE_TEXT(), TAO_Notify_EventChannelFactory::find_proxy_consumer(), LM_ERROR, ACE_InputCDR::read_long(), and ACE_InputCDR::read_ulong().

Referenced by TAO_Notify::Routing_Slip::unmarshal().

00115 {
00116   bool ok = true;
00117   TAO_Notify_Method_Request_Lookup_Queueable * result = 0;
00118   CORBA::ULong count;
00119   if (cdr.read_ulong (count))
00120   {
00121     TAO_Notify::IdVec id_path (count);
00122     for (size_t nid = 0; ok && nid < count; ++nid)
00123     {
00124       TAO_Notify_Object::ID id = 0;
00125       if ( cdr.read_long (id))
00126       {
00127         id_path.push_back (id);
00128       }
00129       else
00130       {
00131         ok = false;
00132       }
00133     }
00134 
00135     if (ok)
00136     {
00137       TAO_Notify_ProxyConsumer * proxy_consumer = ecf.find_proxy_consumer (
00138         id_path,
00139         0);
00140       if (proxy_consumer != 0)
00141       {
00142         ACE_NEW_NORETURN (result,
00143           TAO_Notify_Method_Request_Lookup_Queueable (delivery_request, proxy_consumer));
00144       }
00145       else
00146       {
00147         ACE_ERROR ((LM_ERROR,
00148           ACE_TEXT ("(%P|%t) TAO_Notify_Method_Request_Lookup_No_Copy::unmarshal: unknown proxy id\n")
00149           ));
00150       }
00151     }
00152     else
00153     {
00154       ACE_ERROR ((LM_ERROR,
00155         ACE_TEXT ("(%P|%t) TAO_Notify_Method_Request_Lookup_No_Copy::unmarshal: Cant read proxy id path\n")
00156         ));
00157     }
00158   }
00159   return result;
00160 
00161 }

void TAO_Notify_Method_Request_Lookup::work ( TAO_Notify_ProxySupplier proxy_supplier  )  [protected, virtual]

= TAO_ESF_Worker method

Implements TAO_ESF_Worker< TAO_Notify_ProxySupplier >.

Definition at line 47 of file Method_Request_Lookup.cpp.

References TAO_Notify_ProxySupplier::deliver(), TAO_Notify_Method_Request_Event::delivery_request_, and ACE_Strong_Bound_Ptr< X, ACE_LOCK >::get().

00049 {
00050   if (delivery_request_.get () == 0)
00051   {
00052     TAO_Notify_Method_Request_Dispatch_No_Copy request (*this, proxy_supplier, true);
00053     proxy_supplier->deliver (request);
00054   }
00055   else
00056   {
00057     delivery_request_->dispatch (proxy_supplier, true);
00058   }
00059 }


Member Data Documentation

TAO_Notify_ProxyConsumer* TAO_Notify_Method_Request_Lookup::proxy_consumer_ [protected]

The Proxy.

Definition at line 74 of file Method_Request_Lookup.h.

Referenced by execute_i().


The documentation for this class was generated from the following files:
Generated on Tue Feb 2 17:46:22 2010 for TAO_CosNotification by  doxygen 1.4.7