TAO_Notify_Method_Request_Dispatch Class Reference

#include <Method_Request_Dispatch.h>

Inheritance diagram for TAO_Notify_Method_Request_Dispatch:

Inheritance graph
[legend]
Collaboration diagram for TAO_Notify_Method_Request_Dispatch:

Collaboration graph
[legend]
List of all members.

Public Types

 persistence_code = 1
enum  { persistence_code = 1 }
 an arbitrary code (Octet) to identify this delivery method type in persistent storage More...

Public Member Functions

 TAO_Notify_Method_Request_Dispatch (const TAO_Notify_Event *event, TAO_Notify_ProxySupplier *proxy_supplier, bool filtering)
 Constuct from event.
 TAO_Notify_Method_Request_Dispatch (const TAO_Notify::Delivery_Request_Ptr &delivery, TAO_Notify_ProxySupplier *proxy_supplier, bool filtering)
 Construct from a delivery rquest.
 TAO_Notify_Method_Request_Dispatch (const TAO_Notify_Method_Request_Event &request, const TAO_Notify_Event *event, TAO_Notify_ProxySupplier *proxy_supplier, bool filtering)
virtual ~TAO_Notify_Method_Request_Dispatch ()
 Destructor.

Static Public Member Functions

static TAO_Notify_Method_Request_Dispatch_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

int execute_i (void)
 Execute the dispatch operation.

Protected Attributes

TAO_Notify_ProxySupplier::Ptr proxy_supplier_
 The Proxy.
bool filtering_
 Flag is true if we want to do filtering else false.

Detailed Description

Definition at line 39 of file Method_Request_Dispatch.h.


Member Enumeration Documentation

anonymous enum

an arbitrary code (Octet) to identify this delivery method type in persistent storage

Enumerator:
persistence_code 

Definition at line 44 of file Method_Request_Dispatch.h.

00044 {persistence_code = 1};


Constructor & Destructor Documentation

TAO_BEGIN_VERSIONED_NAMESPACE_DECL TAO_Notify_Method_Request_Dispatch::TAO_Notify_Method_Request_Dispatch ( const TAO_Notify_Event event,
TAO_Notify_ProxySupplier proxy_supplier,
bool  filtering 
)

Constuct from event.

Definition at line 25 of file Method_Request_Dispatch.cpp.

00029   : TAO_Notify_Method_Request_Event (event)
00030   , proxy_supplier_ (proxy_supplier)
00031   , filtering_ (filtering)
00032 {
00033 }

TAO_Notify_Method_Request_Dispatch::TAO_Notify_Method_Request_Dispatch ( const TAO_Notify::Delivery_Request_Ptr delivery,
TAO_Notify_ProxySupplier proxy_supplier,
bool  filtering 
)

Construct from a delivery rquest.

Definition at line 36 of file Method_Request_Dispatch.cpp.

00040   : TAO_Notify_Method_Request_Event (delivery)
00041   , proxy_supplier_ (proxy_supplier)
00042   , filtering_ (filtering)
00043 {
00044 }

TAO_Notify_Method_Request_Dispatch::TAO_Notify_Method_Request_Dispatch ( const TAO_Notify_Method_Request_Event request,
const TAO_Notify_Event event,
TAO_Notify_ProxySupplier proxy_supplier,
bool  filtering 
)

Constuct from another method request+event event is passed separately because we may be using a copy of the one in the previous method request

Definition at line 49 of file Method_Request_Dispatch.cpp.

00054   : TAO_Notify_Method_Request_Event (request, event)
00055   , proxy_supplier_ (proxy_supplier)
00056   , filtering_ (filtering)
00057 {
00058 }

TAO_Notify_Method_Request_Dispatch::~TAO_Notify_Method_Request_Dispatch (  )  [virtual]

Destructor.

Definition at line 60 of file Method_Request_Dispatch.cpp.

References ACE_DEBUG, ACE_TEXT(), and LM_DEBUG.

00061 {
00062 #if 0
00063   ACE_DEBUG ((LM_DEBUG,
00064               ACE_TEXT ("(%P|%t) Destroy TAO_Notify_Method_Request_Dispatch @%@\n"),
00065               this));
00066 #endif
00067 }


Member Function Documentation

int TAO_Notify_Method_Request_Dispatch::execute_i ( void   )  [protected]

Execute the dispatch operation.

Definition at line 69 of file Method_Request_Dispatch.cpp.

References CORBA::Exception::_tao_print_exception(), ACE_DEBUG, ACE_TEXT(), TAO_Notify_Consumer::deliver(), TAO_Notify_Admin::filter_admin(), TAO_Notify_Admin::filter_operator(), LM_DEBUG, proxy_supplier_, and TAO_debug_level.

Referenced by TAO_Notify_Method_Request_Dispatch_No_Copy::execute(), and TAO_Notify_Method_Request_Dispatch_Queueable::execute().

00070 {
00071   if (this->proxy_supplier_->has_shutdown ())
00072     return 0; // If we were shutdown while waiting in the queue, return with no action.
00073 
00074   if (this->filtering_ == 1)
00075     {
00076       TAO_Notify_Admin& parent = this->proxy_supplier_->consumer_admin ();
00077       CORBA::Boolean val =  this->proxy_supplier_->check_filters (this->event_,
00078                                                                   parent.filter_admin (),
00079                                                                   parent.filter_operator ());
00080 
00081       if (TAO_debug_level > 1)
00082         ACE_DEBUG ((LM_DEBUG, "Proxysupplier %x filter eval result = %d",&this->proxy_supplier_ , val));
00083 
00084       // Filter failed - do nothing.
00085       if (val == 0)
00086         return 0;
00087     }
00088 
00089   try
00090     {
00091       TAO_Notify_Consumer* consumer = this->proxy_supplier_->consumer ();
00092 
00093       if (consumer != 0)
00094         {
00095           consumer->deliver (this);
00096         }
00097     }
00098   catch (const CORBA::Exception& ex)
00099     {
00100       if (TAO_debug_level > 0)
00101         ex._tao_print_exception (
00102           ACE_TEXT (
00103             "TAO_Notify_Method_Request_Dispatch::: error sending event.\n "));
00104     }
00105 
00106   return 0;
00107 }

TAO_Notify_Method_Request_Dispatch_Queueable * TAO_Notify_Method_Request_Dispatch::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_Dispatch.cpp.

References ACE_DEBUG, ACE_ERROR, ACE_NEW_NORETURN, ACE_TEXT(), ACE_String_Base< CHAR >::c_str(), DEBUG_LEVEL, TAO_Notify_EventChannelFactory::find_proxy_consumer(), TAO_Notify_EventChannelFactory::find_proxy_supplier(), LM_DEBUG, LM_ERROR, ACE_InputCDR::read_long(), ACE_InputCDR::read_ulong(), and ACE_OS::snprintf().

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

00115 {
00116   bool ok = true;
00117   TAO_Notify_Method_Request_Dispatch_Queueable * result = 0;
00118   ACE_CString textpath;
00119   CORBA::ULong count;
00120   if (cdr.read_ulong (count))
00121   {
00122     TAO_Notify::IdVec id_path (count);
00123     for (size_t nid = 0; ok && nid < count; ++nid)
00124     {
00125       TAO_Notify_Object::ID id = 0;
00126       if ( cdr.read_long (id))
00127       {
00128         id_path.push_back (id);
00129         char idbuf[20];
00130         ACE_OS::snprintf (idbuf, sizeof(idbuf), "/%d", static_cast<int> (id));
00131         textpath += idbuf;
00132       }
00133       else
00134       {
00135         ok = false;
00136       }
00137     }
00138 
00139     if (ok)
00140     {
00141       TAO_Notify_ProxySupplier* proxy_supplier = ecf.find_proxy_supplier (id_path,
00142         0);
00143       if (proxy_supplier != 0)
00144       {
00145         if (DEBUG_LEVEL > 6) ACE_DEBUG ((LM_DEBUG,
00146           ACE_TEXT ("(%P|%t) TAO_Notify_Method_Request_Dispatch reload event for %s\n")
00147           , textpath.c_str()
00148           ));
00149         ACE_NEW_NORETURN (result,
00150           TAO_Notify_Method_Request_Dispatch_Queueable (delivery_request, proxy_supplier, true));
00151       }
00152       else
00153       {
00154         TAO_Notify_ProxyConsumer * proxy_consumer = ecf.find_proxy_consumer (id_path, 0); //@@todo
00155         if (proxy_consumer == 0)
00156         {
00157           ACE_ERROR ((LM_ERROR,
00158             ACE_TEXT ("(%P|%t) TAO_Notify_Method_Request_Dispatch::unmarshal: unknown proxy id %s\n")
00159             , textpath.c_str()
00160             ));
00161         }
00162         else
00163         {
00164           ACE_ERROR ((LM_ERROR,
00165             ACE_TEXT ("(%P|%t) TAO_Notify_Method_Request_Dispatch::unmarshal: wrong type of proxy id %s\n")
00166             , textpath.c_str()
00167             ));
00168         }
00169       }
00170     }
00171     else
00172     {
00173       ACE_ERROR ((LM_ERROR,
00174         ACE_TEXT ("(%P|%t) TAO_Notify_Method_Request_Dispatch::unmarshal: Cant read proxy id path\n")
00175         ));
00176     }
00177   }
00178   return result;
00179 }


Member Data Documentation

bool TAO_Notify_Method_Request_Dispatch::filtering_ [protected]

Flag is true if we want to do filtering else false.

Definition at line 87 of file Method_Request_Dispatch.h.

Referenced by TAO_Notify_Method_Request_Dispatch_No_Copy::copy().

TAO_Notify_ProxySupplier::Ptr TAO_Notify_Method_Request_Dispatch::proxy_supplier_ [protected]

The Proxy.

Definition at line 84 of file Method_Request_Dispatch.h.

Referenced by TAO_Notify_Method_Request_Dispatch_No_Copy::copy(), and execute_i().


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