TAO_Notify::Delivery_Request Class Reference

Represents a request to deliver an event to a particular destination. More...

#include <Delivery_Request.h>

Collaboration diagram for TAO_Notify::Delivery_Request:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 Delivery_Request (const Routing_Slip_Ptr &routing_slip, size_t request_id)
 ~Delivery_Request ()
 a normal destructor.

void complete ()
 A method to indicate the delivery is complete.

const TAO_Notify_Event::Ptrevent () const
 An accessor method for the event associated with the Routing Slip that owns this Delivery request.

const Routing_Slip_Ptrrouting_slip () const
 An accessor method for the routing slip that owns this request.

void set_delivery_type (ACE_CDR::Octet type)
 Capture Delivery Type for the Delivery Method.

void set_destination_id (IdVec &destination_id)
 Capture destination ID for the Delivery Request.

void marshal (TAO_OutputCDR &cdr)
 Marshal peristent information for this delivery request and its delivery methods into a CDR stream.

unsigned long sequence () const
 expose routing slip method

bool should_retry () const
 expose routing slip method

void dispatch (TAO_Notify_ProxySupplier *proxy_supplier, bool filter)
 expose routing slip method

bool operator== (const Delivery_Request &rhs) const
bool operator!= (const Delivery_Request &rhs) const

Static Public Member Functions

Delivery_Request_Ptr create (const Routing_Slip_Ptr &routing_slip, size_t request_id, TAO_Notify_EventChannelFactory &ecf, TAO_InputCDR &cdr)
 A static "factory" method for use during restart.


Private Member Functions

 Delivery_Request ()
 No null constructor.

 Delivery_Request (const Delivery_Request &rhs)
 No copy constructor.

Delivery_Requestoperator= (const Delivery_Request &rhs)
 no assignment operator


Private Attributes

Routing_Slip_Ptr routing_slip_
size_t request_id_
ACE_CDR::Octet delivery_type_
IdVec destination_id_

Detailed Description

Represents a request to deliver an event to a particular destination.

A Routing Slip contains a collection of Delivery Requests. A Delivery Request is associated with a Delivery Method. Delivery Methods should be lightweight objects because they are copied, queued, and otherwise passed around while they are waiting to be executed. The Delivery Request is more stable.

Definition at line 47 of file Delivery_Request.h.


Constructor & Destructor Documentation

TAO_Notify::Delivery_Request::Delivery_Request const Routing_Slip_Ptr routing_slip,
size_t  request_id
 

Normal constructor

Parameters:
routing_slip the routing slip that owns this Delivery Request.
request_id an id that identifies this Delivery Request to the Routing Slip.

Definition at line 26 of file Delivery_Request.cpp.

References ACE_DEBUG, ACE_TEXT(), DEBUG_LEVEL, LM_DEBUG, and TAO_Notify::Routing_Slip_Ptr.

00027   : routing_slip_ (routing_slip)
00028   , request_id_ (request_id)
00029   , delivery_type_ (0)
00030 {
00031   if (DEBUG_LEVEL > 8) ACE_DEBUG ((LM_DEBUG,
00032       ACE_TEXT ("(%P|%t) Delivery_Request:: constructor\n")
00033       ));
00034 }

TAO_Notify::Delivery_Request::~Delivery_Request  ) 
 

a normal destructor.

Definition at line 36 of file Delivery_Request.cpp.

References ACE_DEBUG, ACE_TEXT(), DEBUG_LEVEL, and LM_DEBUG.

00037 {
00038   if (DEBUG_LEVEL > 8) ACE_DEBUG ((LM_DEBUG,
00039       ACE_TEXT ("(%P|%t) Delivery_Request:: destructor\n")
00040       ));
00041 }

TAO_Notify::Delivery_Request::Delivery_Request  )  [private]
 

No null constructor.

TAO_Notify::Delivery_Request::Delivery_Request const Delivery_Request rhs  )  [private]
 

No copy constructor.


Member Function Documentation

void TAO_Notify::Delivery_Request::complete  ) 
 

A method to indicate the delivery is complete.

To be called by the delivery method associated with this delivery request.

Definition at line 46 of file Delivery_Request.cpp.

References routing_slip_.

00047 {
00048   routing_slip_->delivery_request_complete (this->request_id_);
00049 }

Delivery_Request_Ptr TAO_Notify::Delivery_Request::create const Routing_Slip_Ptr routing_slip,
size_t  request_id,
TAO_Notify_EventChannelFactory ecf,
TAO_InputCDR cdr
[static]
 

A static "factory" method for use during restart.

Parameters:
routing_slip. The routing slip to which the new Delivery Request should be attached.
request_id The id used to identify this Delivery Request to the Routing Slip.
ecf The EventChannelFactory responsible for reloading this Delivery Method.
cdr A CDR stream from which the peristent information for this Delivery Requect can be retrieved.
Returns:
a pointer to the newly-allocated Delivery Request

void TAO_Notify::Delivery_Request::dispatch TAO_Notify_ProxySupplier proxy_supplier,
bool  filter
 

expose routing slip method

Definition at line 88 of file Delivery_Request.cpp.

References ACE_ENV_ARG_PARAMETER, and routing_slip_.

00091 {
00092   this->routing_slip_->dispatch (proxy_supplier, filter ACE_ENV_ARG_PARAMETER);
00093 }

const TAO_Notify_Event::Ptr & TAO_Notify::Delivery_Request::event  )  const
 

An accessor method for the event associated with the Routing Slip that owns this Delivery request.

Definition at line 54 of file Delivery_Request.cpp.

References routing_slip_.

00055 {
00056   return this->routing_slip_->event ();
00057 }

void TAO_Notify::Delivery_Request::marshal TAO_OutputCDR cdr  ) 
 

Marshal peristent information for this delivery request and its delivery methods into a CDR stream.

Called during persistent event storage.

Definition at line 60 of file Delivery_Request.cpp.

References delivery_type_, destination_id_, ACE_Vector< T, DEFAULT_SIZE >::size(), ACE_OutputCDR::write_octet(), and ACE_OutputCDR::write_ulong().

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

00061 {
00062   if (this->delivery_type_ != 0)
00063   {
00064     cdr.write_octet (this->delivery_type_);
00065     size_t dest_count = this->destination_id_.size ();
00066     cdr.write_ulong (dest_count);
00067     for (size_t ndest = 0; ndest < dest_count; ++ ndest)
00068     {
00069       cdr.write_ulong (this->destination_id_ [ndest]);
00070     }
00071   }
00072 }

bool TAO_Notify::Delivery_Request::operator!= const Delivery_Request rhs  )  const
 

Delivery_Request& TAO_Notify::Delivery_Request::operator= const Delivery_Request rhs  )  [private]
 

no assignment operator

bool TAO_Notify::Delivery_Request::operator== const Delivery_Request rhs  )  const
 

const Routing_Slip_Ptr & TAO_Notify::Delivery_Request::routing_slip  )  const
 

An accessor method for the routing slip that owns this request.

Definition at line 96 of file Delivery_Request.cpp.

References routing_slip_.

00097 {
00098   return this->routing_slip_;
00099 }

unsigned long TAO_Notify::Delivery_Request::sequence  )  const
 

expose routing slip method

Definition at line 75 of file Delivery_Request.cpp.

References routing_slip_.

00076 {
00077   return this->routing_slip_->sequence ();
00078 }

ACE_INLINE void TAO_Notify::Delivery_Request::set_delivery_type ACE_CDR::Octet  type  ) 
 

Capture Delivery Type for the Delivery Method.

Called by the delivery method to capture information that should be persisted.

Definition at line 12 of file Delivery_Request.inl.

References delivery_type_.

00013 {
00014   this->delivery_type_ = type;
00015 }

ACE_INLINE void TAO_Notify::Delivery_Request::set_destination_id IdVec destination_id  ) 
 

Capture destination ID for the Delivery Request.

Called by the delivery method to capture information that should be persisted.

Definition at line 19 of file Delivery_Request.inl.

References destination_id_, and TAO_Notify::IdVec.

00020 {
00021   this->destination_id_ = destination_id;
00022 }

bool TAO_Notify::Delivery_Request::should_retry  )  const
 

expose routing slip method

Definition at line 82 of file Delivery_Request.cpp.

References routing_slip_.

00083 {
00084   return this->routing_slip_->should_retry ();
00085 }


Member Data Documentation

ACE_CDR::Octet TAO_Notify::Delivery_Request::delivery_type_ [private]
 

Definition at line 122 of file Delivery_Request.h.

Referenced by marshal(), and set_delivery_type().

IdVec TAO_Notify::Delivery_Request::destination_id_ [private]
 

Definition at line 123 of file Delivery_Request.h.

Referenced by marshal(), and set_destination_id().

size_t TAO_Notify::Delivery_Request::request_id_ [private]
 

Definition at line 121 of file Delivery_Request.h.

Routing_Slip_Ptr TAO_Notify::Delivery_Request::routing_slip_ [private]
 

Definition at line 120 of file Delivery_Request.h.

Referenced by complete(), dispatch(), event(), routing_slip(), sequence(), and should_retry().


The documentation for this class was generated from the following files:
Generated on Thu Nov 9 13:34:10 2006 for TAO_CosNotification by doxygen 1.3.6