Using CORBA Request-Level Interceptors
Is called on an interceptor implementation that supports the RequestLevelInterceptor::ClientRequestInterceptor
interface.
virtual Interceptors::ResponseReturnStatus
client_response(
const ReplyContext & reply_context,
ServiceContextList_ptr service_context,
CORBA::DataInputStream_ptr arg_stream,
CORBA::Exception_ptr & excep_val ) = 0;
A reference to a ReplyContext
that contains information about the context in which the reply is being performed.
A pointer to a ServiceContextList
containing service context information received as a result of processing the request by the target object.
Note: In BEA Tuxedo 8.0, the value of this parameter is always a nil object.
A pointer to a DataInputStream
that can be used by the interceptor implementation to retrieve the value of the reply parameters of the operation.
The following table identifies what the client_response
method returns in the DataInputStream
object based on the status contained in the ReplyContext
object:
Note: Exceptions contain a string followed by any exception members. The string contains the repository ID for the exception. The exception members are passed in the same manner as a struct. A system exception contains two unsigned long members, a minor code, and a completion status.
The client_response
operation is called on an interceptor implementation that supports the RequestLevelInterceptor::ClientRequestInterceptor
interface. The operation is called by the ORB anytime that a reply to an invocation is being received by the initiator of the request, regardless of whether the initiator is in a different address space or the same address space as the target object.
Indicates that the interceptor successfully performed any processing required and that the ORB should continue processing the reply to the request to deliver it to the initiator of the request.
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 target-side request-level interceptors.
Listing 8-7 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 TargetRequestInterceptor : RequestInterceptor
{
InvokeReturnStatus
target_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
target_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.
#ifndef _RequestLevelInterceptor_h
#define _RequestLevelInterceptor_h
#include <CORBA.h>
#include <IOP.h>
#include <GIOP.h>
#include <Interceptors.h>
class OBBEXPDLL RequestLevelInterceptor
{
public:
class TargetRequestInterceptor;
typedef TargetRequestInterceptor *
TargetRequestInterceptor_ptr;
class OBBEXPDLL TargetRequestInterceptor :
public virtual RequestInterceptor
{
public:
static TargetRequestInterceptor_ptr
_duplicate(TargetRequestInterceptor_ptr obj);
static TargetRequestInterceptor_ptr
_narrow(TargetRequestInterceptor_ptr obj);
inline static TargetRequestInterceptor_ptr
_nil() { return 0; }
virtual Interceptors::InvokeReturnStatus target_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
target_response(
const ReplyContext & reply_context,
ServiceContextList_ptr service_context,
CORBA::DataInputStream_ptr arg_stream,
CORBA::Exception_ptr & excep_val ) = 0;
protected:
TargetRequestInterceptor(CORBA::LocalBase_ptr obj = 0) { }
virtual ~TargetRequestInterceptor(){ }
private:
TargetRequestInterceptor( const TargetRequestInterceptor&)
{ }
void operator=(const TargetRequestInterceptor&) { }
}; // class TargetRequestInterceptor
};
#endif /* _RequestLevelInterceptor_h */