Skip navigation.

Using CORBA Request-Level Interceptors

  Previous Next vertical dots separating previous/next from contents/index/pdf Contents Index View as PDF   Get Adobe Reader

 


RequestInterceptor::exception_occurred

Synopsis

Is called by the ORB to allow the interceptor to clean up any state that the interceptor might have been managing that is specific to a request.

C++ Binding

virtual void 
exception_occurred( const ReplyContext & reply_context,
CORBA::Exception_ptr excep_val) = 0;

Parameters

reply_context

A reference to a ReplyContext that contains information about the context in which the reply is being performed.

excep_val

A pointer to the exception reported by the ORB or by another interceptor.

Exceptions

None.

Description

The exception_occurred operation is called on a request-level interceptor implementation in one of three cases:

  1. Another interceptor sets an exception (rather than an exception being generated by the ORB or the method).
  2. The ORB detects an operating system or communication-related problem.
  3. A client deletes a Request object that was used to initiate a deferred synchronous DII. The exception_occurred method is called instead of the client_response or target_response method of that interceptor. The ORB calls the exception_occurred method to allow the interceptor implementation to clean up any state that it might have been managing that is specific to a request.

Return Values

None.

 


RequestLevelInterceptor::
ClientRequestInterceptor Interface

This is the base interface of all request-level interceptors. It inherits directly from the RequestLevelInterceptor::RequestInterceptor interface. The interface contains the set of operations and attributes that are supported by all client-side request-level interceptors.

Listing 8-5 OMG IDL Definition

//File: RequestLevelInterceptor.idl

#ifndef _REQUEST_LEVEL_INTERCEPTOR_IDL
#define _REQUEST_LEVEL_INTERCEPTOR_IDL

#include <orb.idl>
#include <Giop.idl>
#include <Interceptors.idl>

#pragma prefix "beasys.com"

module RequestLevelInterceptor
{
local ClientRequestInterceptor : RequestInterceptor
{
InvokeReturnStatus
client_invoke(
in RequestContext request_context,
in ServiceContextList service_context,
in CORBA::DataInputStream request_arg_stream,
in CORBA::DataOutputStream reply_arg_stream,
out ExceptionValue excep_val
);

ResponseReturnStatus
client_response(
in ReplyContext reply_context,
in ServiceContextList service_context,
in CORBA::DataInputStream arg_stream,
out ExceptionValue excep_val
);
};
};
#endif /* _REQUEST_LEVEL_INTERCEPTOR_IDL */

The implementation of the operations _duplicate, _narrow, and _nil are inherited indirectly from the implementation of the CORBA::LocalBase interface provided by the CORBA ORB in the BEA Tuxedo product.

Listing 8-6 C++ Declaration

#ifndef _RequestLevelInterceptor_h
#define _RequestLevelInterceptor_h

#include <CORBA.h>
#include <IOP.h>
#include <GIOP.h>
#include <Interceptors.h>

class OBBEXPDLL RequestLevelInterceptor
{
public:
class ClientRequestInterceptor;
typedef ClientRequestInterceptor *
ClientRequestInterceptor_ptr;

class OBBEXPDLL ClientRequestInterceptor :
public virtual RequestInterceptor
{
public:
static ClientRequestInterceptor_ptr
_duplicate(ClientRequestInterceptor_ptr obj);
static ClientRequestInterceptor_ptr
_narrow(ClientRequestInterceptor_ptr obj);
inline static ClientRequestInterceptor_ptr
_nil() { return 0; }

virtual Interceptors::InvokeReturnStatus
client_invoke(
const RequestContext & request_context,
ServiceContextList_ptr service_context,
CORBA::DataInputStream_ptr request_arg_stream,
CORBA::DataOutputStream_ptr reply_arg_stream,
CORBA::Exception_ptr & excep_val ) = 0;

virtual Interceptors::ResponseReturnStatus
client_response(
const ReplyContext & reply_context,
ServiceContextList_ptr service_context,
CORBA::DataInputStream_ptr arg_stream,
CORBA::Exception_ptr & excep_val ) = 0;

protected:
ClientRequestInterceptor(CORBA::LocalBase_ptr obj = 0) { }
virtual ~ClientRequestInterceptor(){ }

private:
ClientRequestInterceptor( const ClientRequestInterceptor&)
{ }
void operator=(const ClientRequestInterceptor&) { }
}; // class ClientRequestInterceptor
};
#endif /* _RequestLevelInterceptor_h */

 

Skip navigation bar  Back to Top Previous Next