Public Member Functions | Protected Member Functions | Private Attributes

TAO::ClientRequestInterceptor_Adapter_Impl Class Reference

#include <ClientRequestInterceptor_Adapter_Impl.h>

Inheritance diagram for TAO::ClientRequestInterceptor_Adapter_Impl:
Inheritance graph
[legend]
Collaboration diagram for TAO::ClientRequestInterceptor_Adapter_Impl:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 ClientRequestInterceptor_Adapter_Impl (void)
virtual void add_interceptor (PortableInterceptor::ClientRequestInterceptor_ptr interceptor)
 Register an interceptor.
virtual void add_interceptor (PortableInterceptor::ClientRequestInterceptor_ptr interceptor, const CORBA::PolicyList &policies)
 Register an interceptor with policies.
virtual void destroy_interceptors (void)
virtual
PortableInterceptor::ReplyStatus 
pi_reply_status (TAO::Invocation_Base const &invocation_base)
void popTSC (TAO_ORB_Core *orb_core)
void pushTSC (TAO_ORB_Core *orb_core)
PortableInterceptor Client Side Interception Points

Each of these methods corresponds to a client side interception point. There are no "intermediate" interception points on the client side, only "starting" and "ending" interception points.

virtual void send_request (Invocation_Base &invocation)
virtual void receive_reply (Invocation_Base &invocation)
virtual void receive_exception (Invocation_Base &invocation)
virtual void receive_other (Invocation_Base &invocation)

Protected Member Functions

void process_forward_request (Invocation_Base &invocation, const PortableInterceptor::ForwardRequest &exc)

Private Attributes

ClientRequestInterceptor_List interceptor_list_
 List of registered interceptors.

Detailed Description

Definition at line 64 of file ClientRequestInterceptor_Adapter_Impl.h.


Constructor & Destructor Documentation

TAO::ClientRequestInterceptor_Adapter_Impl::ClientRequestInterceptor_Adapter_Impl ( void   ) 

Definition at line 10 of file ClientRequestInterceptor_Adapter_Impl.inl.

  {
  }


Member Function Documentation

void TAO::ClientRequestInterceptor_Adapter_Impl::add_interceptor ( PortableInterceptor::ClientRequestInterceptor_ptr  interceptor  )  [virtual]

Register an interceptor.

Definition at line 226 of file ClientRequestInterceptor_Adapter_Impl.cpp.

void TAO::ClientRequestInterceptor_Adapter_Impl::add_interceptor ( PortableInterceptor::ClientRequestInterceptor_ptr  interceptor,
const CORBA::PolicyList &  policies 
) [virtual]

Register an interceptor with policies.

Definition at line 233 of file ClientRequestInterceptor_Adapter_Impl.cpp.

  {

void TAO::ClientRequestInterceptor_Adapter_Impl::destroy_interceptors ( void   )  [virtual]

Definition at line 241 of file ClientRequestInterceptor_Adapter_Impl.cpp.

PortableInterceptor::ReplyStatus TAO::ClientRequestInterceptor_Adapter_Impl::pi_reply_status ( TAO::Invocation_Base const &  invocation_base  )  [virtual]

Definition at line 247 of file ClientRequestInterceptor_Adapter_Impl.cpp.

  {
    this->interceptor_list_.add_interceptor (interceptor);
  }

  void
  ClientRequestInterceptor_Adapter_Impl::add_interceptor (
    PortableInterceptor::ClientRequestInterceptor_ptr interceptor,
    const CORBA::PolicyList& policies)
  {
    this->interceptor_list_.add_interceptor (interceptor, policies);
  }

  void
  ClientRequestInterceptor_Adapter_Impl::destroy_interceptors (void)
  {
    this->interceptor_list_.destroy_interceptors ();
  }

  PortableInterceptor::ReplyStatus
  ClientRequestInterceptor_Adapter_Impl::pi_reply_status (
    TAO::Invocation_Base const &invocation_base)
  {
    PortableInterceptor::ReplyStatus reply_status;

    switch (invocation_base.invoke_status ())
      {
      case TAO::TAO_INVOKE_SUCCESS:
        reply_status = PortableInterceptor::SUCCESSFUL;

void TAO::ClientRequestInterceptor_Adapter_Impl::popTSC ( TAO_ORB_Core orb_core  )  [inline]
void TAO::ClientRequestInterceptor_Adapter_Impl::process_forward_request ( Invocation_Base invocation,
const PortableInterceptor::ForwardRequest &  exc 
) [protected]

Process the given PortableInterceptor::ForwardRequest exception, i.e. invoke the receive_other() interception point, in addition to notifying the Invocation object of the LOCATION_FORWARD.

Definition at line 215 of file ClientRequestInterceptor_Adapter_Impl.cpp.

void TAO::ClientRequestInterceptor_Adapter_Impl::pushTSC ( TAO_ORB_Core orb_core  )  [inline]
void TAO::ClientRequestInterceptor_Adapter_Impl::receive_exception ( Invocation_Base invocation  )  [virtual]

This method implements one of the "ending" client side interception point.

Definition at line 78 of file ClientRequestInterceptor_Adapter_Impl.cpp.

          {
            registered.interceptor_->receive_reply (&ri);
          }
      }

    // The receive_reply() interception point does not raise a
    // PortableInterceptor::ForwardRequest exception so there is no need
    // to attempt to catch it here.
  }

  void
  ClientRequestInterceptor_Adapter_Impl::receive_exception (
      Invocation_Base &invocation)
  {
    // This is an "ending" interception point so we only process the
    // interceptors pushed on to the flow stack.

    bool const is_remote_request = invocation.is_remote_request();

    // Notice that the interceptors are processed in the opposite order
    // they were pushed onto the stack since this is an "ending"
    // interception point.
    try
      {
        TAO_ClientRequestInfo ri (&invocation);

        // Unwind the flow stack.
        size_t const len = invocation.stack_size ();
        for (size_t i = 0; i < len; ++i)
          {
            // Pop the interceptor off of the flow stack before it is
            // invoked.  This is necessary to prevent an interceptor
            // already invoked in this "ending" interception point from
            // being invoked in another "ending" interception point.
            --invocation.stack_size ();

            ClientRequestInterceptor_List::RegisteredInterceptor& registered =
              this->interceptor_list_.registered_interceptor (
                invocation.stack_size ());

            if (registered.details_.should_be_processed (is_remote_request))
              {
                registered.interceptor_->receive_exception (&ri);
              }
          }
      }
    catch (const ::PortableInterceptor::ForwardRequest& exc)
      {
        this->process_forward_request (invocation, exc);
      }
    catch ( ::CORBA::Exception& ex)
      {
        // The receive_exception() interception point in the remaining
        // interceptors must be called so call this method (not the
        // interceptor's corresponding method) recursively.  The call is
        // made recursively since the caught exception must survive

void TAO::ClientRequestInterceptor_Adapter_Impl::receive_other ( Invocation_Base invocation  )  [virtual]

This method implements one of the "ending" client side interception point.

Definition at line 146 of file ClientRequestInterceptor_Adapter_Impl.cpp.

  {
    // This is an "ending" interception point so we only process the
    // interceptors pushed on to the flow stack.

    bool const is_remote_request = invocation.is_remote_request();

    // Notice that the interceptors are processed in the opposite order
    // they were pushed onto the stack since this is an "ending"
    // interception point.

    try
      {
        TAO_ClientRequestInfo ri (&invocation);

        // Unwind the stack.
        size_t const len = invocation.stack_size ();
        for (size_t i = 0; i < len; ++i)
        {
          // Pop the interceptor off of the flow stack before it is
          // invoked.  This is necessary to prevent an interceptor
          // already invoked in this "ending" interception point from
          // being invoked in another "ending" interception point.
          --invocation.stack_size ();

          ClientRequestInterceptor_List::RegisteredInterceptor& registered =
            this->interceptor_list_.registered_interceptor (
              invocation.stack_size ());

          if (registered.details_.should_be_processed (is_remote_request))
            {
              registered.interceptor_->receive_other (&ri);
            }
        }
      }
    catch (const ::PortableInterceptor::ForwardRequest& exc)
      {
        this->process_forward_request (invocation, exc);
      }
    catch ( ::CORBA::Exception& ex)
      {
        // The receive_exception() interception point in the remaining
        // interceptors must be called so call this method (not the
        // interceptor's corresponding method) recursively.  The call is
        // made recursively since the caught exception must survive

void TAO::ClientRequestInterceptor_Adapter_Impl::receive_reply ( Invocation_Base invocation  )  [virtual]

This method implements one of the "ending" client side interception point.

Definition at line 38 of file ClientRequestInterceptor_Adapter_Impl.cpp.

          {
            ClientRequestInterceptor_List::RegisteredInterceptor& registered =
              this->interceptor_list_.registered_interceptor (i);

            if (registered.details_.should_be_processed (is_remote_request))
              {
                registered.interceptor_->send_request (&ri);
              }

            // The starting interception point completed successfully.
            // Push  the interceptor on to the flow stack.
            ++invocation.stack_size ();
          }
      }
    catch (const ::PortableInterceptor::ForwardRequest& exc)
      {
        this->process_forward_request (invocation, exc);
      }
  }

  void
  ClientRequestInterceptor_Adapter_Impl::receive_reply (
    Invocation_Base &invocation)
  {
    // This is an "ending" interception point so we only process the
    // interceptors pushed on to the flow stack.

    bool const is_remote_request = invocation.is_remote_request();

    // Notice that the interceptors are processed in the opposite order
    // they were pushed onto the stack since this is an "ending"
    // interception point.

    TAO_ClientRequestInfo ri (&invocation);

    // Unwind the stack.
    size_t const len = invocation.stack_size ();
    for (size_t i = 0; i < len; ++i)

void TAO::ClientRequestInterceptor_Adapter_Impl::send_request ( Invocation_Base invocation  )  [virtual]

This method implements one of the "starting" client side interception points.

Definition at line 4 of file ClientRequestInterceptor_Adapter_Impl.cpp.

               : ClientRequestInterceptor_Adapter_Impl.cpp 81632 2008-05-07 09:19:05Z vzykov $")

TAO_BEGIN_VERSIONED_NAMESPACE_DECL

namespace TAO
{
  void
  ClientRequestInterceptor_Adapter_Impl::send_request (
      Invocation_Base &invocation)
  {
    // This method implements one of the "starting" client side
    // interception point.

    bool const is_remote_request = invocation.is_remote_request();

    try
      {
        TAO_ClientRequestInfo ri (&invocation);


Member Data Documentation

ClientRequestInterceptor_List TAO::ClientRequestInterceptor_Adapter_Impl::interceptor_list_ [private]

List of registered interceptors.

Definition at line 125 of file ClientRequestInterceptor_Adapter_Impl.h.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines