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

 


ClientRequestInterceptor::client_response

Synopsis

Is called on an interceptor implementation that supports the RequestLevelInterceptor::ClientRequestInterceptor interface.

C++ Binding

virtual Interceptors::ResponseReturnStatus 
client_response(
const ReplyContext & reply_context,
ServiceContextList_ptr service_context,
CORBA::DataInputStream_ptr arg_stream,
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.

service_context

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.

arg_stream

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:

Status Value

Description

LOCATION_FORWARD, LOCATION_FORWARD_PERM, or NEEDS_ADDRESSING_MODE

A nil DataInputStream is supplied.

NO_EXCEPTION

The DataInputStream contains first any operation return value, then any inout and out parameters in the order in which they appear in the operation's IDL definition, from left to right. A nil DataInputStream indicates that no arguments exist.

USER_EXCEPTION or SYSTEM_EXCEPTION

The DataInputStream contains the exception that was raised by the operation.


 

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.

excep_val

A reference to a location in which the interceptor can return an exception in order to report an error. The use of this parameter is only valid if a status of REPLY_EXCEPTION is returned. Note that the ORB is responsible for the memory management for the excep_val parameter.

Exceptions

None.

Description

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.

Return Values

RESPONSE_NO_EXCEPTION

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.

RESPONSE_EXCEPTION

Indicates that the interceptor encountered an error. The parameter excep_val is used to report the exception to the ORB. Any interceptors not yet called on the way back to the client have their exception_occurred operation called by the ORB to notify them that processing the request has failed.

 


RequestLevelInterceptor::
TargetRequestInterceptor 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 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.

Listing 8-8 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 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 */

 

Skip navigation bar  Back to Top Previous Next