diff options
Diffstat (limited to 'TAO/tests/Portable_Interceptors')
61 files changed, 1634 insertions, 1433 deletions
diff --git a/TAO/tests/Portable_Interceptors/AMI/Client_Interceptor.h b/TAO/tests/Portable_Interceptors/AMI/Client_Interceptor.h index 65cd26b41dd..f775ebe2052 100644 --- a/TAO/tests/Portable_Interceptors/AMI/Client_Interceptor.h +++ b/TAO/tests/Portable_Interceptors/AMI/Client_Interceptor.h @@ -8,6 +8,7 @@ #ifndef Client_Interceptor__h_ #define Client_Interceptor__h_ +#include "tao/PI/PI.h" #include "tao/PortableInterceptorC.h" #include "tao/LocalObject.h" #include "tao/ORB.h" diff --git a/TAO/tests/Portable_Interceptors/AMI/PI_AMI.mpc b/TAO/tests/Portable_Interceptors/AMI/PI_AMI.mpc index b5ba7c2e4b8..2ea07840a8d 100644 --- a/TAO/tests/Portable_Interceptors/AMI/PI_AMI.mpc +++ b/TAO/tests/Portable_Interceptors/AMI/PI_AMI.mpc @@ -1,7 +1,7 @@ // -*- MPC -*- // $Id$ -project(*Client) : messaging, taoserver, ami, interceptors { +project(*Client) : messaging, taoserver, ami, pi, interceptors { exename = client source_files { client.cpp @@ -11,7 +11,7 @@ project(*Client) : messaging, taoserver, ami, interceptors { } } -project(*server) : messaging, taoserver, ami, interceptors { +project(*server) : messaging, taoserver, pi_server, interceptors { exename = server source_files { server.cpp diff --git a/TAO/tests/Portable_Interceptors/AMI/Server_Interceptor.h b/TAO/tests/Portable_Interceptors/AMI/Server_Interceptor.h index 3d6935fd758..6ccb824bc8a 100644 --- a/TAO/tests/Portable_Interceptors/AMI/Server_Interceptor.h +++ b/TAO/tests/Portable_Interceptors/AMI/Server_Interceptor.h @@ -8,6 +8,7 @@ #ifndef Server_Interceptor__h_ #define Server_Interceptor__h_ +#include "tao/PI_Server/PI_Server.h" #include "tao/PortableInterceptorC.h" #include "tao/LocalObject.h" #include "tao/ORB.h" diff --git a/TAO/tests/Portable_Interceptors/Benchmark/Client_ORBInitializer.cpp b/TAO/tests/Portable_Interceptors/Benchmark/Client_ORBInitializer.cpp index ac66f70dc63..4cad9dde31b 100644 --- a/TAO/tests/Portable_Interceptors/Benchmark/Client_ORBInitializer.cpp +++ b/TAO/tests/Portable_Interceptors/Benchmark/Client_ORBInitializer.cpp @@ -4,7 +4,7 @@ // #include "Client_ORBInitializer.h" -#include "interceptors.h" +#include "client_interceptors.h" #include "Interceptor_Type.h" ACE_RCSID (Benchmark, Client_ORBInitializer, "$Id$") diff --git a/TAO/tests/Portable_Interceptors/Benchmark/PI_Benchmark.mpc b/TAO/tests/Portable_Interceptors/Benchmark/PI_Benchmark.mpc index 127c20adda3..44a76c957f7 100644 --- a/TAO/tests/Portable_Interceptors/Benchmark/PI_Benchmark.mpc +++ b/TAO/tests/Portable_Interceptors/Benchmark/PI_Benchmark.mpc @@ -1,10 +1,10 @@ // -*- MPC -*- // $Id$ -project(*Server): taoserver, interceptors { +project(*Server): taoserver, pi_server, interceptors { Source_Files { test_i.cpp - interceptors.cpp + server_interceptors.cpp marker.cpp Server_ORBInitializer.cpp Interceptor_Type.cpp @@ -12,10 +12,10 @@ project(*Server): taoserver, interceptors { } } -project(*Client): taoclient, interceptors { +project(*Client): taoclient, pi, interceptors { Source_Files { testC.cpp - interceptors.cpp + client_interceptors.cpp marker.cpp Client_ORBInitializer.cpp Interceptor_Type.cpp diff --git a/TAO/tests/Portable_Interceptors/Benchmark/Server_ORBInitializer.cpp b/TAO/tests/Portable_Interceptors/Benchmark/Server_ORBInitializer.cpp index 908f0505579..5ab4c2336d5 100644 --- a/TAO/tests/Portable_Interceptors/Benchmark/Server_ORBInitializer.cpp +++ b/TAO/tests/Portable_Interceptors/Benchmark/Server_ORBInitializer.cpp @@ -5,7 +5,7 @@ #include "Server_ORBInitializer.h" #include "Interceptor_Type.h" -#include "interceptors.h" +#include "server_interceptors.h" ACE_RCSID (Benchmark, Server_ORBInitializer, diff --git a/TAO/tests/Portable_Interceptors/Benchmark/client.cpp b/TAO/tests/Portable_Interceptors/Benchmark/client.cpp index 388a6668a6a..76a58219cf4 100644 --- a/TAO/tests/Portable_Interceptors/Benchmark/client.cpp +++ b/TAO/tests/Portable_Interceptors/Benchmark/client.cpp @@ -1,7 +1,6 @@ // $Id$ #include "testC.h" -#include "interceptors.h" #include "marker.h" #include "Client_ORBInitializer.h" #include "Interceptor_Type.h" diff --git a/TAO/tests/Portable_Interceptors/Benchmark/interceptors.cpp b/TAO/tests/Portable_Interceptors/Benchmark/client_interceptors.cpp index d618520e124..f28091c7e3e 100644 --- a/TAO/tests/Portable_Interceptors/Benchmark/interceptors.cpp +++ b/TAO/tests/Portable_Interceptors/Benchmark/client_interceptors.cpp @@ -1,6 +1,6 @@ // $Id$ -#include "interceptors.h" +#include "client_interceptors.h" #include "tao/DynamicC.h" #include "tao/TypeCode.h" @@ -8,7 +8,7 @@ #include "ace/Log_Msg.h" ACE_RCSID (Benchmark, - interceptors, + client_interceptors, "$Id$") const CORBA::ULong request_ctx_id = 0xdead; @@ -149,119 +149,6 @@ Vault_Client_Request_Interceptor::receive_exception ( } -Vault_Server_Request_Interceptor::Vault_Server_Request_Interceptor (void) - : myname_ ("Vault_Server_Interceptor") -{ -} - -Vault_Server_Request_Interceptor::~Vault_Server_Request_Interceptor () -{ -} - -char * -Vault_Server_Request_Interceptor::name (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - return CORBA::string_dup (this->myname_); -} - -void -Vault_Server_Request_Interceptor::destroy (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ -} - -void -Vault_Server_Request_Interceptor::receive_request_service_contexts ( - PortableInterceptor::ServerRequestInfo_ptr - ACE_ENV_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableInterceptor::ForwardRequest)) -{ - // Do nothing -} - -void -Vault_Server_Request_Interceptor::receive_request ( - PortableInterceptor::ServerRequestInfo_ptr ri - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableInterceptor::ForwardRequest)) -{ - - CORBA::String_var op = ri->operation (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; - - if (ACE_OS::strcmp (op.in (), "authenticate") == 0) - { - IOP::ServiceId id = request_ctx_id; - IOP::ServiceContext_var sc = - ri->get_request_service_context (id ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - - const char *buf = - reinterpret_cast<const char *> (sc->context_data.get_buffer ()); - - if (ACE_OS::strcmp (buf, "root123") != 0) - ACE_THROW (CORBA::NO_PERMISSION ()); - } - - if (ACE_OS::strcmp (op.in (), "update_records") == 0) - { - Dynamic::ParameterList_var paramlist = - ri->arguments (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; - - Test_Interceptors::Secure_Vault::Record *record; - CORBA::Long id; - CORBA::ULong i = 0; // index -- explicitly used to avoid - // overloaded operator ambiguity. - paramlist[i++].argument >>= id; - paramlist[i].argument >>= record; - } -} - -void -Vault_Server_Request_Interceptor::send_reply ( - PortableInterceptor::ServerRequestInfo_ptr ri - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - - CORBA::String_var op = ri->operation (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; - - if (ACE_OS::strcmp (op.in (), "update_records") == 0) - { - CORBA::Long result; - CORBA::Any_var result_any = ri->result (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; - - (result_any.in ()) >>= result; - } -} - -void -Vault_Server_Request_Interceptor::send_exception ( - PortableInterceptor::ServerRequestInfo_ptr - ACE_ENV_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableInterceptor::ForwardRequest)) -{ - // Do Nothing -} - -void -Vault_Server_Request_Interceptor::send_other ( - PortableInterceptor::ServerRequestInfo_ptr - ACE_ENV_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableInterceptor::ForwardRequest)) -{ - // Do Nothing -} - - ////////////////////////////////// Context ///////////////////////// Vault_Client_Request_Context_Interceptor::Vault_Client_Request_Context_Interceptor (void) @@ -373,87 +260,6 @@ Vault_Client_Request_Context_Interceptor::receive_exception ( } -Vault_Server_Request_Context_Interceptor::Vault_Server_Request_Context_Interceptor (void) - : myname_ ("Vault_Server_Context_Interceptor") -{ -} - -Vault_Server_Request_Context_Interceptor::~Vault_Server_Request_Context_Interceptor () -{ -} - -char * -Vault_Server_Request_Context_Interceptor::name ( - ACE_ENV_SINGLE_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - return CORBA::string_dup (this->myname_); -} - -void -Vault_Server_Request_Context_Interceptor::destroy ( - ACE_ENV_SINGLE_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ -} - -void -Vault_Server_Request_Context_Interceptor::receive_request_service_contexts( - PortableInterceptor::ServerRequestInfo_ptr - ACE_ENV_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableInterceptor::ForwardRequest)) -{ - // Do nothing -} - -void -Vault_Server_Request_Context_Interceptor::receive_request ( - PortableInterceptor::ServerRequestInfo_ptr ri - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableInterceptor::ForwardRequest)) -{ - - IOP::ServiceId id = request_ctx_id; - IOP::ServiceContext_var sc = - ri->get_request_service_context (id ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - - const char *buf = reinterpret_cast<const char *> (sc->context_data.get_buffer ()); - - if (ACE_OS::strcmp (buf, "root123") !=0) - ACE_THROW (CORBA::NO_PERMISSION ()); -} - -void -Vault_Server_Request_Context_Interceptor::send_reply ( - PortableInterceptor::ServerRequestInfo_ptr - ACE_ENV_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - -} - -void -Vault_Server_Request_Context_Interceptor::send_exception ( - PortableInterceptor::ServerRequestInfo_ptr - ACE_ENV_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableInterceptor::ForwardRequest)) -{ -} - -void -Vault_Server_Request_Context_Interceptor::send_other ( - PortableInterceptor::ServerRequestInfo_ptr - ACE_ENV_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableInterceptor::ForwardRequest)) -{ - // Do Nothing -} - ///////////////////////////////////Dynamic //////////////////////////////////// Vault_Client_Request_Dynamic_Interceptor::Vault_Client_Request_Dynamic_Interceptor (void) @@ -596,126 +402,6 @@ Vault_Client_Request_Dynamic_Interceptor::receive_exception ( } -Vault_Server_Request_Dynamic_Interceptor::Vault_Server_Request_Dynamic_Interceptor (void) - : myname_ ("Vault_Server_Dynamic_Interceptor") -{ -} - -Vault_Server_Request_Dynamic_Interceptor::~Vault_Server_Request_Dynamic_Interceptor () -{ -} - -char * -Vault_Server_Request_Dynamic_Interceptor::name ( - ACE_ENV_SINGLE_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - return CORBA::string_dup (this->myname_); -} - -void -Vault_Server_Request_Dynamic_Interceptor::destroy ( - ACE_ENV_SINGLE_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ -} - -void -Vault_Server_Request_Dynamic_Interceptor::receive_request ( - PortableInterceptor::ServerRequestInfo_ptr ri - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableInterceptor::ForwardRequest)) -{ - - CORBA::String_var op = ri->operation (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; - - if (ACE_OS::strcmp (op.in (), "authenticate") == 0) - { - Dynamic::ParameterList_var paramlist = - ri->arguments (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; - - const char *user; - CORBA::ULong i = 0; // index -- explicitly used to avoid - // overloaded operator ambiguity. - paramlist[i].argument >>= user; - } - - if (ACE_OS::strcmp (op.in (), "update_records") == 0) - { - Dynamic::ParameterList_var paramlist = - ri->arguments (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; - - Test_Interceptors::Secure_Vault::Record *record; - CORBA::Long id; - CORBA::ULong i = 0; // index -- explicitly used to avoid - // overloaded operator ambiguity. - paramlist[i++].argument >>= id; - paramlist[i].argument >>= record; - } -} - -void -Vault_Server_Request_Dynamic_Interceptor::receive_request_service_contexts( - PortableInterceptor::ServerRequestInfo_ptr - ACE_ENV_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableInterceptor::ForwardRequest)) -{ - // Do nothing -} - -void -Vault_Server_Request_Dynamic_Interceptor::send_reply ( - PortableInterceptor::ServerRequestInfo_ptr ri - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - - CORBA::String_var op = ri->operation (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; - - if (ACE_OS::strcmp (op.in (), "ready") == 0) - { - CORBA::Short result; - CORBA::Any_var result_any = ri->result (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; - - (result_any.in ()) >>= result; - } - - if (ACE_OS::strcmp (op.in (), "update_records") == 0) - { - CORBA::Long result; - CORBA::Any_var result_any = ri->result (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; - - (result_any.in ()) >>= result; - } -} - -void -Vault_Server_Request_Dynamic_Interceptor::send_exception ( - PortableInterceptor::ServerRequestInfo_ptr - ACE_ENV_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableInterceptor::ForwardRequest)) -{ -} - -void -Vault_Server_Request_Dynamic_Interceptor::send_other ( - PortableInterceptor::ServerRequestInfo_ptr - ACE_ENV_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableInterceptor::ForwardRequest)) -{ - // Do Nothing -} - //////////////////////////////NOOP/////////////////////////////////////// Vault_Client_Request_NOOP_Interceptor::Vault_Client_Request_NOOP_Interceptor (void) @@ -807,72 +493,3 @@ Vault_Client_Request_NOOP_Interceptor::receive_exception ( } -Vault_Server_Request_NOOP_Interceptor::Vault_Server_Request_NOOP_Interceptor (void) - : myname_ ("Vault_Server_NOOP_Interceptor") -{ -} - -Vault_Server_Request_NOOP_Interceptor::~Vault_Server_Request_NOOP_Interceptor () -{ -} - -char * -Vault_Server_Request_NOOP_Interceptor::name (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - return CORBA::string_dup (this->myname_); -} - -void -Vault_Server_Request_NOOP_Interceptor::destroy ( - ACE_ENV_SINGLE_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ -} - -void -Vault_Server_Request_NOOP_Interceptor::receive_request ( - PortableInterceptor::ServerRequestInfo_ptr - ACE_ENV_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableInterceptor::ForwardRequest)) -{ -} - -void -Vault_Server_Request_NOOP_Interceptor::receive_request_service_contexts( - PortableInterceptor::ServerRequestInfo_ptr - ACE_ENV_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableInterceptor::ForwardRequest)) -{ - // Do nothing -} - -void -Vault_Server_Request_NOOP_Interceptor::send_reply ( - PortableInterceptor::ServerRequestInfo_ptr - ACE_ENV_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - -} - -void -Vault_Server_Request_NOOP_Interceptor::send_exception ( - PortableInterceptor::ServerRequestInfo_ptr - ACE_ENV_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableInterceptor::ForwardRequest)) -{ -} - -void -Vault_Server_Request_NOOP_Interceptor::send_other ( - PortableInterceptor::ServerRequestInfo_ptr - ACE_ENV_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableInterceptor::ForwardRequest)) -{ - // Do Nothing -} diff --git a/TAO/tests/Portable_Interceptors/Benchmark/client_interceptors.h b/TAO/tests/Portable_Interceptors/Benchmark/client_interceptors.h new file mode 100644 index 00000000000..75f8d621f40 --- /dev/null +++ b/TAO/tests/Portable_Interceptors/Benchmark/client_interceptors.h @@ -0,0 +1,207 @@ +// -*- C++ -*- +// +// $Id$ + +#ifndef TAO_CLIENT_INTERCEPTOR_H +#define TAO_CLIENT_INTERCEPTOR_H + +#include "testC.h" + +#include "tao/PI/PI.h" +#include "tao/PortableInterceptorC.h" +#include "tao/LocalObject.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#if defined(_MSC_VER) +#pragma warning(push) +#pragma warning(disable:4250) +#endif /* _MSC_VER */ + +class Vault_Client_Request_Interceptor + : public virtual PortableInterceptor::ClientRequestInterceptor, + public virtual TAO_Local_RefCounted_Object +{ + // = Client-side Vault interceptor. For checking interceptor visually only. +public: + Vault_Client_Request_Interceptor (void); + // ctor. + virtual ~Vault_Client_Request_Interceptor (); + // dtor. + + virtual char * name (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + // Canonical name of the interceptor. + + virtual void destroy (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + virtual void send_poll (PortableInterceptor::ClientRequestInfo_ptr + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + virtual void send_request (PortableInterceptor::ClientRequestInfo_ptr ri + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException, + PortableInterceptor::ForwardRequest)); + + virtual void receive_reply (PortableInterceptor::ClientRequestInfo_ptr ri + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + virtual void receive_other (PortableInterceptor::ClientRequestInfo_ptr + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException, + PortableInterceptor::ForwardRequest)); + + virtual void receive_exception (PortableInterceptor::ClientRequestInfo_ptr ri + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException, + PortableInterceptor::ForwardRequest)); + +private: + const char *myname_; +}; + +class Vault_Client_Request_Context_Interceptor + : public virtual PortableInterceptor::ClientRequestInterceptor, + public virtual TAO_Local_RefCounted_Object +{ + // = Client-side Vault interceptor. For checking interceptor visually only. +public: + Vault_Client_Request_Context_Interceptor (void); + // ctor. + virtual ~Vault_Client_Request_Context_Interceptor (); + // dtor. + + virtual char * name (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + // Canonical name of the interceptor. + + virtual void destroy (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + virtual void send_poll (PortableInterceptor::ClientRequestInfo_ptr + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + virtual void send_request (PortableInterceptor::ClientRequestInfo_ptr ri + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException, + PortableInterceptor::ForwardRequest)); + + virtual void receive_reply (PortableInterceptor::ClientRequestInfo_ptr ri + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + virtual void receive_other (PortableInterceptor::ClientRequestInfo_ptr + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException, + PortableInterceptor::ForwardRequest)); + + virtual void receive_exception (PortableInterceptor::ClientRequestInfo_ptr ri + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException, + PortableInterceptor::ForwardRequest)); + +private: + const char *myname_; +}; + +class Vault_Client_Request_Dynamic_Interceptor + : public virtual PortableInterceptor::ClientRequestInterceptor, + public virtual TAO_Local_RefCounted_Object +{ + // = Client-side Vault interceptor. For checking interceptor visually only. +public: + Vault_Client_Request_Dynamic_Interceptor (void); + // ctor. + virtual ~Vault_Client_Request_Dynamic_Interceptor (); + // dtor. + + virtual char * name (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + // Canonical name of the interceptor. + + virtual void destroy (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + virtual void send_poll (PortableInterceptor::ClientRequestInfo_ptr + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + virtual void send_request (PortableInterceptor::ClientRequestInfo_ptr ri + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException, + PortableInterceptor::ForwardRequest)); + + virtual void receive_reply (PortableInterceptor::ClientRequestInfo_ptr ri + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + virtual void receive_other (PortableInterceptor::ClientRequestInfo_ptr + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException, + PortableInterceptor::ForwardRequest)); + + virtual void receive_exception (PortableInterceptor::ClientRequestInfo_ptr ri + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException, + PortableInterceptor::ForwardRequest)); + +private: + const char *myname_; +}; + +class Vault_Client_Request_NOOP_Interceptor + : public virtual PortableInterceptor::ClientRequestInterceptor, + public virtual TAO_Local_RefCounted_Object +{ + // = Client-side Vault interceptor. For checking interceptor visually only. +public: + Vault_Client_Request_NOOP_Interceptor (void); + // ctor. + virtual ~Vault_Client_Request_NOOP_Interceptor (); + // dtor. + + virtual char * name (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + // Canonical name of the interceptor. + + virtual void destroy (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + virtual void send_poll (PortableInterceptor::ClientRequestInfo_ptr + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + virtual void send_request (PortableInterceptor::ClientRequestInfo_ptr ri + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException, + PortableInterceptor::ForwardRequest)); + + virtual void receive_reply (PortableInterceptor::ClientRequestInfo_ptr ri + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + virtual void receive_other (PortableInterceptor::ClientRequestInfo_ptr + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException, + PortableInterceptor::ForwardRequest)); + + virtual void receive_exception (PortableInterceptor::ClientRequestInfo_ptr ri + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException, + PortableInterceptor::ForwardRequest)); + +private: + const char *myname_; +}; + +#if defined(_MSC_VER) +#pragma warning(pop) +#endif /* _MSC_VER */ + +#endif /* TAO_CLIENT_INTERCEPTOR_H */ diff --git a/TAO/tests/Portable_Interceptors/Benchmark/server.cpp b/TAO/tests/Portable_Interceptors/Benchmark/server.cpp index 35bec9b15a9..c556aed2940 100644 --- a/TAO/tests/Portable_Interceptors/Benchmark/server.cpp +++ b/TAO/tests/Portable_Interceptors/Benchmark/server.cpp @@ -3,7 +3,6 @@ #include "test_i.h" #include "Server_ORBInitializer.h" #include "Interceptor_Type.h" -#include "interceptors.h" #include "tao/ORBInitializer_Registry.h" diff --git a/TAO/tests/Portable_Interceptors/Benchmark/server_interceptors.cpp b/TAO/tests/Portable_Interceptors/Benchmark/server_interceptors.cpp new file mode 100644 index 00000000000..a2cfbb32e3a --- /dev/null +++ b/TAO/tests/Portable_Interceptors/Benchmark/server_interceptors.cpp @@ -0,0 +1,405 @@ +// $Id$ + +#include "server_interceptors.h" + +#include "tao/DynamicC.h" +#include "tao/TypeCode.h" +#include "ace/OS_NS_string.h" +#include "ace/Log_Msg.h" + +ACE_RCSID (Benchmark, + server_interceptors, + "$Id$") + +const CORBA::ULong request_ctx_id = 0xdead; +//const CORBA::ULong reply_ctx_id = 0xbeef; // Never used. + +Vault_Server_Request_Interceptor::Vault_Server_Request_Interceptor (void) + : myname_ ("Vault_Server_Interceptor") +{ +} + +Vault_Server_Request_Interceptor::~Vault_Server_Request_Interceptor () +{ +} + +char * +Vault_Server_Request_Interceptor::name (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) + ACE_THROW_SPEC ((CORBA::SystemException)) +{ + return CORBA::string_dup (this->myname_); +} + +void +Vault_Server_Request_Interceptor::destroy (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) + ACE_THROW_SPEC ((CORBA::SystemException)) +{ +} + +void +Vault_Server_Request_Interceptor::receive_request_service_contexts ( + PortableInterceptor::ServerRequestInfo_ptr + ACE_ENV_ARG_DECL_NOT_USED) + ACE_THROW_SPEC ((CORBA::SystemException, + PortableInterceptor::ForwardRequest)) +{ + // Do nothing +} + +void +Vault_Server_Request_Interceptor::receive_request ( + PortableInterceptor::ServerRequestInfo_ptr ri + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException, + PortableInterceptor::ForwardRequest)) +{ + + CORBA::String_var op = ri->operation (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK; + + if (ACE_OS::strcmp (op.in (), "authenticate") == 0) + { + IOP::ServiceId id = request_ctx_id; + IOP::ServiceContext_var sc = + ri->get_request_service_context (id ACE_ENV_ARG_PARAMETER); + ACE_CHECK; + + const char *buf = + reinterpret_cast<const char *> (sc->context_data.get_buffer ()); + + if (ACE_OS::strcmp (buf, "root123") != 0) + ACE_THROW (CORBA::NO_PERMISSION ()); + } + + if (ACE_OS::strcmp (op.in (), "update_records") == 0) + { + Dynamic::ParameterList_var paramlist = + ri->arguments (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK; + + Test_Interceptors::Secure_Vault::Record *record; + CORBA::Long id; + CORBA::ULong i = 0; // index -- explicitly used to avoid + // overloaded operator ambiguity. + paramlist[i++].argument >>= id; + paramlist[i].argument >>= record; + } +} + +void +Vault_Server_Request_Interceptor::send_reply ( + PortableInterceptor::ServerRequestInfo_ptr ri + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) +{ + + CORBA::String_var op = ri->operation (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK; + + if (ACE_OS::strcmp (op.in (), "update_records") == 0) + { + CORBA::Long result; + CORBA::Any_var result_any = ri->result (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK; + + (result_any.in ()) >>= result; + } +} + +void +Vault_Server_Request_Interceptor::send_exception ( + PortableInterceptor::ServerRequestInfo_ptr + ACE_ENV_ARG_DECL_NOT_USED) + ACE_THROW_SPEC ((CORBA::SystemException, + PortableInterceptor::ForwardRequest)) +{ + // Do Nothing +} + +void +Vault_Server_Request_Interceptor::send_other ( + PortableInterceptor::ServerRequestInfo_ptr + ACE_ENV_ARG_DECL_NOT_USED) + ACE_THROW_SPEC ((CORBA::SystemException, + PortableInterceptor::ForwardRequest)) +{ + // Do Nothing +} + + +////////////////////////////////// Context ///////////////////////// + +Vault_Server_Request_Context_Interceptor::Vault_Server_Request_Context_Interceptor (void) + : myname_ ("Vault_Server_Context_Interceptor") +{ +} + +Vault_Server_Request_Context_Interceptor::~Vault_Server_Request_Context_Interceptor () +{ +} + +char * +Vault_Server_Request_Context_Interceptor::name ( + ACE_ENV_SINGLE_ARG_DECL_NOT_USED) + ACE_THROW_SPEC ((CORBA::SystemException)) +{ + return CORBA::string_dup (this->myname_); +} + +void +Vault_Server_Request_Context_Interceptor::destroy ( + ACE_ENV_SINGLE_ARG_DECL_NOT_USED) + ACE_THROW_SPEC ((CORBA::SystemException)) +{ +} + +void +Vault_Server_Request_Context_Interceptor::receive_request_service_contexts( + PortableInterceptor::ServerRequestInfo_ptr + ACE_ENV_ARG_DECL_NOT_USED) + ACE_THROW_SPEC ((CORBA::SystemException, + PortableInterceptor::ForwardRequest)) +{ + // Do nothing +} + +void +Vault_Server_Request_Context_Interceptor::receive_request ( + PortableInterceptor::ServerRequestInfo_ptr ri + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException, + PortableInterceptor::ForwardRequest)) +{ + + IOP::ServiceId id = request_ctx_id; + IOP::ServiceContext_var sc = + ri->get_request_service_context (id ACE_ENV_ARG_PARAMETER); + ACE_CHECK; + + const char *buf = reinterpret_cast<const char *> (sc->context_data.get_buffer ()); + + if (ACE_OS::strcmp (buf, "root123") !=0) + ACE_THROW (CORBA::NO_PERMISSION ()); +} + +void +Vault_Server_Request_Context_Interceptor::send_reply ( + PortableInterceptor::ServerRequestInfo_ptr + ACE_ENV_ARG_DECL_NOT_USED) + ACE_THROW_SPEC ((CORBA::SystemException)) +{ + +} + +void +Vault_Server_Request_Context_Interceptor::send_exception ( + PortableInterceptor::ServerRequestInfo_ptr + ACE_ENV_ARG_DECL_NOT_USED) + ACE_THROW_SPEC ((CORBA::SystemException, + PortableInterceptor::ForwardRequest)) +{ +} + +void +Vault_Server_Request_Context_Interceptor::send_other ( + PortableInterceptor::ServerRequestInfo_ptr + ACE_ENV_ARG_DECL_NOT_USED) + ACE_THROW_SPEC ((CORBA::SystemException, + PortableInterceptor::ForwardRequest)) +{ + // Do Nothing +} + +///////////////////////////////////Dynamic //////////////////////////////////// + +Vault_Server_Request_Dynamic_Interceptor::Vault_Server_Request_Dynamic_Interceptor (void) + : myname_ ("Vault_Server_Dynamic_Interceptor") +{ +} + +Vault_Server_Request_Dynamic_Interceptor::~Vault_Server_Request_Dynamic_Interceptor () +{ +} + +char * +Vault_Server_Request_Dynamic_Interceptor::name ( + ACE_ENV_SINGLE_ARG_DECL_NOT_USED) + ACE_THROW_SPEC ((CORBA::SystemException)) +{ + return CORBA::string_dup (this->myname_); +} + +void +Vault_Server_Request_Dynamic_Interceptor::destroy ( + ACE_ENV_SINGLE_ARG_DECL_NOT_USED) + ACE_THROW_SPEC ((CORBA::SystemException)) +{ +} + +void +Vault_Server_Request_Dynamic_Interceptor::receive_request ( + PortableInterceptor::ServerRequestInfo_ptr ri + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException, + PortableInterceptor::ForwardRequest)) +{ + + CORBA::String_var op = ri->operation (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK; + + if (ACE_OS::strcmp (op.in (), "authenticate") == 0) + { + Dynamic::ParameterList_var paramlist = + ri->arguments (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK; + + const char *user; + CORBA::ULong i = 0; // index -- explicitly used to avoid + // overloaded operator ambiguity. + paramlist[i].argument >>= user; + } + + if (ACE_OS::strcmp (op.in (), "update_records") == 0) + { + Dynamic::ParameterList_var paramlist = + ri->arguments (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK; + + Test_Interceptors::Secure_Vault::Record *record; + CORBA::Long id; + CORBA::ULong i = 0; // index -- explicitly used to avoid + // overloaded operator ambiguity. + paramlist[i++].argument >>= id; + paramlist[i].argument >>= record; + } +} + +void +Vault_Server_Request_Dynamic_Interceptor::receive_request_service_contexts( + PortableInterceptor::ServerRequestInfo_ptr + ACE_ENV_ARG_DECL_NOT_USED) + ACE_THROW_SPEC ((CORBA::SystemException, + PortableInterceptor::ForwardRequest)) +{ + // Do nothing +} + +void +Vault_Server_Request_Dynamic_Interceptor::send_reply ( + PortableInterceptor::ServerRequestInfo_ptr ri + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) +{ + + CORBA::String_var op = ri->operation (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK; + + if (ACE_OS::strcmp (op.in (), "ready") == 0) + { + CORBA::Short result; + CORBA::Any_var result_any = ri->result (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK; + + (result_any.in ()) >>= result; + } + + if (ACE_OS::strcmp (op.in (), "update_records") == 0) + { + CORBA::Long result; + CORBA::Any_var result_any = ri->result (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK; + + (result_any.in ()) >>= result; + } +} + +void +Vault_Server_Request_Dynamic_Interceptor::send_exception ( + PortableInterceptor::ServerRequestInfo_ptr + ACE_ENV_ARG_DECL_NOT_USED) + ACE_THROW_SPEC ((CORBA::SystemException, + PortableInterceptor::ForwardRequest)) +{ +} + +void +Vault_Server_Request_Dynamic_Interceptor::send_other ( + PortableInterceptor::ServerRequestInfo_ptr + ACE_ENV_ARG_DECL_NOT_USED) + ACE_THROW_SPEC ((CORBA::SystemException, + PortableInterceptor::ForwardRequest)) +{ + // Do Nothing +} + +//////////////////////////////NOOP/////////////////////////////////////// + +Vault_Server_Request_NOOP_Interceptor::Vault_Server_Request_NOOP_Interceptor (void) + : myname_ ("Vault_Server_NOOP_Interceptor") +{ +} + +Vault_Server_Request_NOOP_Interceptor::~Vault_Server_Request_NOOP_Interceptor () +{ +} + +char * +Vault_Server_Request_NOOP_Interceptor::name (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) + ACE_THROW_SPEC ((CORBA::SystemException)) +{ + return CORBA::string_dup (this->myname_); +} + +void +Vault_Server_Request_NOOP_Interceptor::destroy ( + ACE_ENV_SINGLE_ARG_DECL_NOT_USED) + ACE_THROW_SPEC ((CORBA::SystemException)) +{ +} + +void +Vault_Server_Request_NOOP_Interceptor::receive_request ( + PortableInterceptor::ServerRequestInfo_ptr + ACE_ENV_ARG_DECL_NOT_USED) + ACE_THROW_SPEC ((CORBA::SystemException, + PortableInterceptor::ForwardRequest)) +{ +} + +void +Vault_Server_Request_NOOP_Interceptor::receive_request_service_contexts( + PortableInterceptor::ServerRequestInfo_ptr + ACE_ENV_ARG_DECL_NOT_USED) + ACE_THROW_SPEC ((CORBA::SystemException, + PortableInterceptor::ForwardRequest)) +{ + // Do nothing +} + +void +Vault_Server_Request_NOOP_Interceptor::send_reply ( + PortableInterceptor::ServerRequestInfo_ptr + ACE_ENV_ARG_DECL_NOT_USED) + ACE_THROW_SPEC ((CORBA::SystemException)) +{ + +} + +void +Vault_Server_Request_NOOP_Interceptor::send_exception ( + PortableInterceptor::ServerRequestInfo_ptr + ACE_ENV_ARG_DECL_NOT_USED) + ACE_THROW_SPEC ((CORBA::SystemException, + PortableInterceptor::ForwardRequest)) +{ +} + +void +Vault_Server_Request_NOOP_Interceptor::send_other ( + PortableInterceptor::ServerRequestInfo_ptr + ACE_ENV_ARG_DECL_NOT_USED) + ACE_THROW_SPEC ((CORBA::SystemException, + PortableInterceptor::ForwardRequest)) +{ + // Do Nothing +} diff --git a/TAO/tests/Portable_Interceptors/Benchmark/interceptors.h b/TAO/tests/Portable_Interceptors/Benchmark/server_interceptors.h index 6d8a4f53ae3..3adc2fe8424 100644 --- a/TAO/tests/Portable_Interceptors/Benchmark/interceptors.h +++ b/TAO/tests/Portable_Interceptors/Benchmark/server_interceptors.h @@ -2,11 +2,12 @@ // // $Id$ -#ifndef TAO_INTERCEPTORS_H -#define TAO_INTERCEPTORS_H +#ifndef TAO_SERVER_INTERCEPTOR_H +#define TAO_SERVER_INTERCEPTOR_H #include "testC.h" +#include "tao/PI_Server/PI_Server.h" #include "tao/PortableInterceptorC.h" #include "tao/LocalObject.h" @@ -19,51 +20,6 @@ #pragma warning(disable:4250) #endif /* _MSC_VER */ -class Vault_Client_Request_Interceptor - : public virtual PortableInterceptor::ClientRequestInterceptor, - public virtual TAO_Local_RefCounted_Object -{ - // = Client-side Vault interceptor. For checking interceptor visually only. -public: - Vault_Client_Request_Interceptor (void); - // ctor. - virtual ~Vault_Client_Request_Interceptor (); - // dtor. - - virtual char * name (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - // Canonical name of the interceptor. - - virtual void destroy (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - virtual void send_poll (PortableInterceptor::ClientRequestInfo_ptr - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - virtual void send_request (PortableInterceptor::ClientRequestInfo_ptr ri - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableInterceptor::ForwardRequest)); - - virtual void receive_reply (PortableInterceptor::ClientRequestInfo_ptr ri - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - virtual void receive_other (PortableInterceptor::ClientRequestInfo_ptr - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableInterceptor::ForwardRequest)); - - virtual void receive_exception (PortableInterceptor::ClientRequestInfo_ptr ri - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableInterceptor::ForwardRequest)); - -private: - const char *myname_; -}; - class Vault_Server_Request_Interceptor : public virtual PortableInterceptor::ServerRequestInterceptor, public virtual TAO_Local_RefCounted_Object @@ -111,51 +67,6 @@ private: const char *myname_; }; -class Vault_Client_Request_Context_Interceptor - : public virtual PortableInterceptor::ClientRequestInterceptor, - public virtual TAO_Local_RefCounted_Object -{ - // = Client-side Vault interceptor. For checking interceptor visually only. -public: - Vault_Client_Request_Context_Interceptor (void); - // ctor. - virtual ~Vault_Client_Request_Context_Interceptor (); - // dtor. - - virtual char * name (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - // Canonical name of the interceptor. - - virtual void destroy (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - virtual void send_poll (PortableInterceptor::ClientRequestInfo_ptr - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - virtual void send_request (PortableInterceptor::ClientRequestInfo_ptr ri - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableInterceptor::ForwardRequest)); - - virtual void receive_reply (PortableInterceptor::ClientRequestInfo_ptr ri - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - virtual void receive_other (PortableInterceptor::ClientRequestInfo_ptr - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableInterceptor::ForwardRequest)); - - virtual void receive_exception (PortableInterceptor::ClientRequestInfo_ptr ri - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableInterceptor::ForwardRequest)); - -private: - const char *myname_; -}; - class Vault_Server_Request_Context_Interceptor : public virtual PortableInterceptor::ServerRequestInterceptor, public virtual TAO_Local_RefCounted_Object @@ -203,52 +114,6 @@ private: const char *myname_; }; - -class Vault_Client_Request_Dynamic_Interceptor - : public virtual PortableInterceptor::ClientRequestInterceptor, - public virtual TAO_Local_RefCounted_Object -{ - // = Client-side Vault interceptor. For checking interceptor visually only. -public: - Vault_Client_Request_Dynamic_Interceptor (void); - // ctor. - virtual ~Vault_Client_Request_Dynamic_Interceptor (); - // dtor. - - virtual char * name (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - // Canonical name of the interceptor. - - virtual void destroy (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - virtual void send_poll (PortableInterceptor::ClientRequestInfo_ptr - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - virtual void send_request (PortableInterceptor::ClientRequestInfo_ptr ri - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableInterceptor::ForwardRequest)); - - virtual void receive_reply (PortableInterceptor::ClientRequestInfo_ptr ri - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - virtual void receive_other (PortableInterceptor::ClientRequestInfo_ptr - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableInterceptor::ForwardRequest)); - - virtual void receive_exception (PortableInterceptor::ClientRequestInfo_ptr ri - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableInterceptor::ForwardRequest)); - -private: - const char *myname_; -}; - class Vault_Server_Request_Dynamic_Interceptor : public virtual PortableInterceptor::ServerRequestInterceptor, public virtual TAO_Local_RefCounted_Object @@ -296,52 +161,6 @@ private: const char *myname_; }; - -class Vault_Client_Request_NOOP_Interceptor - : public virtual PortableInterceptor::ClientRequestInterceptor, - public virtual TAO_Local_RefCounted_Object -{ - // = Client-side Vault interceptor. For checking interceptor visually only. -public: - Vault_Client_Request_NOOP_Interceptor (void); - // ctor. - virtual ~Vault_Client_Request_NOOP_Interceptor (); - // dtor. - - virtual char * name (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - // Canonical name of the interceptor. - - virtual void destroy (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - virtual void send_poll (PortableInterceptor::ClientRequestInfo_ptr - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - virtual void send_request (PortableInterceptor::ClientRequestInfo_ptr ri - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableInterceptor::ForwardRequest)); - - virtual void receive_reply (PortableInterceptor::ClientRequestInfo_ptr ri - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - virtual void receive_other (PortableInterceptor::ClientRequestInfo_ptr - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableInterceptor::ForwardRequest)); - - virtual void receive_exception (PortableInterceptor::ClientRequestInfo_ptr ri - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableInterceptor::ForwardRequest)); - -private: - const char *myname_; -}; - class Vault_Server_Request_NOOP_Interceptor : public virtual PortableInterceptor::ServerRequestInterceptor, public virtual TAO_Local_RefCounted_Object @@ -393,4 +212,4 @@ private: #pragma warning(pop) #endif /* _MSC_VER */ -#endif /* TAO_INTERCEPTORS_H */ +#endif /* TAO_SERVER_INTERCEPTOR_H */ diff --git a/TAO/tests/Portable_Interceptors/Bug_1559/Bug_1559.mpc b/TAO/tests/Portable_Interceptors/Bug_1559/Bug_1559.mpc index 4c6778375a6..1a864c9e26f 100644 --- a/TAO/tests/Portable_Interceptors/Bug_1559/Bug_1559.mpc +++ b/TAO/tests/Portable_Interceptors/Bug_1559/Bug_1559.mpc @@ -1,20 +1,20 @@ // -*- MPC -*- // $Id$ -project(*Server): taoserver, interceptors { +project(*Server): taoserver, pi_server, interceptors { Source_Files { test_i.cpp Server_ORBInitializer.cpp - interceptors.cpp + server_interceptor.cpp server.cpp } } -project(*Client): taoclient, interceptors { +project(*Client): taoclient, pi, interceptors { Source_Files { testC.cpp Client_ORBInitializer.cpp - interceptors.cpp + client_interceptor.cpp client.cpp } } diff --git a/TAO/tests/Portable_Interceptors/Bug_1559/Client_ORBInitializer.cpp b/TAO/tests/Portable_Interceptors/Bug_1559/Client_ORBInitializer.cpp index b4732ce7376..fd053e810f0 100644 --- a/TAO/tests/Portable_Interceptors/Bug_1559/Client_ORBInitializer.cpp +++ b/TAO/tests/Portable_Interceptors/Bug_1559/Client_ORBInitializer.cpp @@ -4,7 +4,7 @@ // #include "Client_ORBInitializer.h" -#include "interceptors.h" +#include "client_interceptor.h" ACE_RCSID (Service_Context_Manipulation, Client_ORBInitializer, "$Id$") diff --git a/TAO/tests/Portable_Interceptors/Bug_1559/Server_ORBInitializer.cpp b/TAO/tests/Portable_Interceptors/Bug_1559/Server_ORBInitializer.cpp index ec2e84ac627..b5590a28f3b 100644 --- a/TAO/tests/Portable_Interceptors/Bug_1559/Server_ORBInitializer.cpp +++ b/TAO/tests/Portable_Interceptors/Bug_1559/Server_ORBInitializer.cpp @@ -4,9 +4,10 @@ // #include "Server_ORBInitializer.h" -#include "interceptors.h" -ACE_RCSID (Service_Context_Manipulation, Server_ORBInitializer, "$Id$") +ACE_RCSID (Bug_1559, + Server_ORBInitializer, + "$Id$") Server_ORBInitializer::Server_ORBInitializer (void) { diff --git a/TAO/tests/Portable_Interceptors/Bug_1559/Server_ORBInitializer.h b/TAO/tests/Portable_Interceptors/Bug_1559/Server_ORBInitializer.h index 5b3c199490d..1cd2c636db6 100644 --- a/TAO/tests/Portable_Interceptors/Bug_1559/Server_ORBInitializer.h +++ b/TAO/tests/Portable_Interceptors/Bug_1559/Server_ORBInitializer.h @@ -14,7 +14,7 @@ #endif /* ACE_LACKS_PRAGMA_ONCE */ #include "tao/LocalObject.h" -#include "interceptors.h" +#include "server_interceptor.h" // This is to remove "inherits via dominance" warnings from MSVC. // MSVC is being a little too paranoid. diff --git a/TAO/tests/Portable_Interceptors/Bug_1559/client.cpp b/TAO/tests/Portable_Interceptors/Bug_1559/client.cpp index fc917015aee..09231faacf2 100644 --- a/TAO/tests/Portable_Interceptors/Bug_1559/client.cpp +++ b/TAO/tests/Portable_Interceptors/Bug_1559/client.cpp @@ -2,7 +2,6 @@ #include "ace/Get_Opt.h" #include "testC.h" -#include "interceptors.h" #include "Client_ORBInitializer.h" #include "tao/ORBInitializer_Registry.h" diff --git a/TAO/tests/Portable_Interceptors/Bug_1559/interceptors.cpp b/TAO/tests/Portable_Interceptors/Bug_1559/client_interceptor.cpp index 067a0436399..a9ea659b832 100644 --- a/TAO/tests/Portable_Interceptors/Bug_1559/interceptors.cpp +++ b/TAO/tests/Portable_Interceptors/Bug_1559/client_interceptor.cpp @@ -1,13 +1,13 @@ // $Id$ -#include "interceptors.h" +#include "client_interceptor.h" #include "tao/OctetSeqC.h" #include "ace/Log_Msg.h" #include "tao/ORB_Constants.h" #include "ace/OS_NS_string.h" -ACE_RCSID (Service_Context_Manipulation, - interceptors, +ACE_RCSID (Bug_1559, + client_interceptor, "$Id$") const IOP::ServiceId service_id = 0xdeadbeef; @@ -384,270 +384,3 @@ Echo_Client_Request_Interceptor::receive_exception ( exception_count = 0; } -Echo_Server_Request_Interceptor::Echo_Server_Request_Interceptor (void) - : myname_ ("Echo_Server_Interceptor") -{ -} - -Echo_Server_Request_Interceptor::Echo_Server_Request_Interceptor (CORBA::Object_ptr forward_location) - : myname_ ("Echo_Server_Interceptor"), - forward_location_ (CORBA::Object::_duplicate (forward_location)) -{ -} - -Echo_Server_Request_Interceptor::~Echo_Server_Request_Interceptor (void) -{ -} - -void -Echo_Server_Request_Interceptor::forward_reference (CORBA::Object_ptr forward_location - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - if (CORBA::is_nil (forward_location)) - ACE_THROW (CORBA::INV_OBJREF ( - CORBA::SystemException::_tao_minor_code ( - TAO::VMCID, - EINVAL), - CORBA::COMPLETED_NO)); - this->forward_location_ = CORBA::Object::_duplicate (forward_location); -} - -char * -Echo_Server_Request_Interceptor::name (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - return CORBA::string_dup (this->myname_); -} - -void -Echo_Server_Request_Interceptor::destroy (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ -} - -void -Echo_Server_Request_Interceptor::receive_request_service_contexts ( - PortableInterceptor::ServerRequestInfo_ptr ri - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableInterceptor::ForwardRequest)) -{ - - CORBA::String_var operation = ri->operation (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; - - ACE_DEBUG ((LM_DEBUG, - "%s.receive_request_service_contexts from " - "\"%s\"\n", - this->myname_, - operation.in ())); - - // Ignore the "_is_a" operation since it may have been invoked - // locally on the server side as a side effect of another call, - // meaning that the client hasn't added the service context yet. - // Same goes for the shutdown call - if (ACE_OS_String::strcmp ("shutdown", operation.in ()) == 0) - return; - - IOP::ServiceId id = ::service_id; - IOP::ServiceContext_var sc = - ri->get_request_service_context (id ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - - const char *buf = - reinterpret_cast<const char *> (sc->context_data.get_buffer ()); - ACE_DEBUG ((LM_DEBUG, - " Received service context: %s\n", - buf)); - if (ACE_OS::strcmp (buf, request_msg) == 0) - { - ACE_DEBUG ((LM_DEBUG, "Sending LOCATION_FORWARD\n")); - ACE_THROW (PortableInterceptor::ForwardRequest (this->forward_location_)); - } - else if (ACE_OS::strcmp (buf, forward_msg) == 0) - { - // Make the context to send the context to the client - IOP::ServiceContext scc; - - scc.context_id = ::service_id; - - CORBA::ULong string_len = ACE_OS::strlen (reply_msg) + 1; - CORBA::Octet *buff = CORBA::OctetSeq::allocbuf (string_len); - - ACE_OS::strcpy (reinterpret_cast<char *> (buff), reply_msg); - - scc.context_data.replace (string_len, string_len, buff, 1); - - // Add this context to the service context list. - ri->add_reply_service_context (scc, 0 ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - } - else - { - ACE_ERROR ((LM_ERROR, - "ERROR: Echo_Server_Request_Interceptor::receive_request_service_contexts: " - "Expected request service context to be: %s or %s\n", - request_msg, - forward_msg)); - } -} - - -void -Echo_Server_Request_Interceptor::receive_request ( - PortableInterceptor::ServerRequestInfo_ptr - ACE_ENV_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableInterceptor::ForwardRequest)) -{ - // Do nothing -} - -void -Echo_Server_Request_Interceptor::send_reply ( - PortableInterceptor::ServerRequestInfo_ptr ri - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - - CORBA::String_var operation = ri->operation (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; - - ACE_DEBUG ((LM_DEBUG, - "%s.send_reply from \"%s\"\n", - this->myname_, - operation.in ())); - - // Check that the reply service context is set as expected. - IOP::ServiceContext_var sc = - ri->get_reply_service_context (::service_id ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - - const char *buf = reinterpret_cast<const char *> (sc->context_data.get_buffer ()); - ACE_DEBUG ((LM_DEBUG, - " Reply service context: %s\n", - buf)); - - if (ACE_OS::strcmp (buf, reply_msg) != 0) - { - ACE_ERROR ((LM_ERROR, - "ERROR: Echo_Server_Request_Interceptor::send_reply: " - "Expected reply service context to be: %s\n", - reply_msg)); - } - - // Check that the request service context hasn't been changed. - IOP::ServiceContext_var sc2 = - ri->get_request_service_context (::service_id ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - - const char *buf2 = reinterpret_cast<const char *> (sc2->context_data.get_buffer ()); - - if (ACE_OS::strcmp (buf2, forward_msg) != 0) - { - ACE_ERROR ((LM_ERROR, - "ERROR: Echo_Server_Request_Interceptor::send_reply: " - "Expected request service context to be: %s.\n" - " Got: %s\n", - forward_msg, - buf2)); - } -} - -void -Echo_Server_Request_Interceptor::send_exception ( - PortableInterceptor::ServerRequestInfo_ptr ri - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableInterceptor::ForwardRequest)) -{ - - CORBA::String_var operation = ri->operation (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; - - ACE_DEBUG ((LM_DEBUG, - "%s.send_exception from \"%s\"\n", - this->myname_, - operation.in ())); - - // Check that the reply service context is set as expected. - IOP::ServiceContext_var sc = - ri->get_reply_service_context (::service_id ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - - const char *buf = reinterpret_cast<const char *> (sc->context_data.get_buffer ()); - ACE_DEBUG ((LM_DEBUG, - " Reply service context: %s\n", - buf)); - - if (ACE_OS::strcmp (buf, reply_msg) != 0) - { - ACE_ERROR ((LM_ERROR, - "ERROR: Echo_Server_Request_Interceptor::send_exception: " - "Expected reply service context to be: %s\n", - reply_msg)); - } - - // Check that the request service context hasn't been changed. - IOP::ServiceContext_var sc2 = - ri->get_request_service_context (::service_id ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - - const char *buf2 = reinterpret_cast<const char *> (sc2->context_data.get_buffer ()); - - if (ACE_OS::strcmp (buf2, forward_msg) != 0) - { - ACE_ERROR ((LM_ERROR, - "ERROR: Echo_Server_Request_Interceptor::send_exception: " - "Expected request service context to be: %s.\n" - " Got: %s\n", - forward_msg, - buf2)); - } -} - -void -Echo_Server_Request_Interceptor::send_other ( - PortableInterceptor::ServerRequestInfo_ptr ri - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableInterceptor::ForwardRequest)) -{ - CORBA::String_var operation = ri->operation (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; - - ACE_DEBUG ((LM_DEBUG, - "%s.send_other from \"%s\"\n", - this->myname_, - operation.in ())); - - // Check that the request service context hasn't been changed. - IOP::ServiceContext_var sc = - ri->get_request_service_context (::service_id ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - - const char *buf = reinterpret_cast<const char *> (sc->context_data.get_buffer ()); - - if (ACE_OS::strcmp (buf, request_msg) != 0) - { - ACE_ERROR ((LM_ERROR, - "ERROR: Echo_Server_Request_Interceptor::send_reply: " - "Expected request service context to be: %s.\n" - " Got: %s\n", - request_msg, - buf)); - } - - // If we get this far then we should have received a - // LOCATION_FORWARD reply. - - // This will throw an exception if a location forward has not - // occured. If an exception is thrown then something is wrong with - // the PortableInterceptor::ForwardRequest support. - CORBA::Object_var forward = ri->forward_reference (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; - - if (CORBA::is_nil (forward.in ())) - ACE_THROW (CORBA::INTERNAL ()); -} diff --git a/TAO/tests/Portable_Interceptors/Bug_1559/client_interceptor.h b/TAO/tests/Portable_Interceptors/Bug_1559/client_interceptor.h new file mode 100644 index 00000000000..2503a4b75b7 --- /dev/null +++ b/TAO/tests/Portable_Interceptors/Bug_1559/client_interceptor.h @@ -0,0 +1,78 @@ +// -*- C++ -*- +// +// $Id$ + +#ifndef TAO_CLIENT_INTERCEPTOR_H +#define TAO_CLIENT_INTERCEPTOR_H + +#include "tao/PI/PI.h" +#include "tao/PortableInterceptorC.h" +#include "tao/LocalObject.h" +#include "tao/ORB.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#if defined(_MSC_VER) +#pragma warning(push) +#pragma warning(disable:4250) +#endif /* _MSC_VER */ + +class Echo_Client_Request_Interceptor + : public virtual PortableInterceptor::ClientRequestInterceptor, + public virtual TAO_Local_RefCounted_Object +{ + // = Client-side echo interceptor. For checking interceptor visually only. +public: + Echo_Client_Request_Interceptor (const char *orb_id); + // ctor. + + virtual ~Echo_Client_Request_Interceptor (); + // dtor. + + virtual char * name (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + // Canonical name of the interceptor. + + virtual void destroy (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + virtual void send_poll (PortableInterceptor::ClientRequestInfo_ptr + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + virtual void send_request (PortableInterceptor::ClientRequestInfo_ptr ri + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException, + PortableInterceptor::ForwardRequest)); + + virtual void receive_reply (PortableInterceptor::ClientRequestInfo_ptr ri + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + virtual void receive_other (PortableInterceptor::ClientRequestInfo_ptr ri + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException, + PortableInterceptor::ForwardRequest)); + + virtual void receive_exception (PortableInterceptor::ClientRequestInfo_ptr ri + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException, + PortableInterceptor::ForwardRequest)); + +private: + const char *myname_; + + CORBA::String_var orb_id_; + // The ID of the ORB where this interceptor was created, usually + // obtained from the ORBInitInfo + + CORBA::ORB_var orb_; +}; + +#if defined(_MSC_VER) +#pragma warning(pop) +#endif /* _MSC_VER */ + +#endif /* TAO_CLIENT_INTERCEPTOR_H */ diff --git a/TAO/tests/Portable_Interceptors/Bug_1559/server.cpp b/TAO/tests/Portable_Interceptors/Bug_1559/server.cpp index 6d63af38d04..35f0c3ada75 100644 --- a/TAO/tests/Portable_Interceptors/Bug_1559/server.cpp +++ b/TAO/tests/Portable_Interceptors/Bug_1559/server.cpp @@ -3,7 +3,6 @@ #include "ace/Get_Opt.h" #include "ace/OS_NS_stdio.h" #include "test_i.h" -#include "interceptors.h" #include "Server_ORBInitializer.h" #include "tao/ORBInitializer_Registry.h" diff --git a/TAO/tests/Portable_Interceptors/Bug_1559/server_interceptor.cpp b/TAO/tests/Portable_Interceptors/Bug_1559/server_interceptor.cpp new file mode 100644 index 00000000000..7739e548ed1 --- /dev/null +++ b/TAO/tests/Portable_Interceptors/Bug_1559/server_interceptor.cpp @@ -0,0 +1,286 @@ +// $Id$ + +#include "server_interceptor.h" +#include "tao/OctetSeqC.h" +#include "ace/Log_Msg.h" +#include "tao/ORB_Constants.h" +#include "ace/OS_NS_string.h" + +ACE_RCSID (Bug_1559, + server_interceptor, + "$Id$") + +const IOP::ServiceId service_id = 0xdeadbeef; +const char *request_msg = "REQUEST message"; +const char *reply_msg = "REPLY message"; +const char *forward_msg = "FORWARD message"; +int send_request_count = 0; +int exception_count = 0; + +Echo_Server_Request_Interceptor::Echo_Server_Request_Interceptor (void) + : myname_ ("Echo_Server_Interceptor") +{ +} + +Echo_Server_Request_Interceptor::Echo_Server_Request_Interceptor (CORBA::Object_ptr forward_location) + : myname_ ("Echo_Server_Interceptor"), + forward_location_ (CORBA::Object::_duplicate (forward_location)) +{ +} + +Echo_Server_Request_Interceptor::~Echo_Server_Request_Interceptor (void) +{ +} + +void +Echo_Server_Request_Interceptor::forward_reference (CORBA::Object_ptr forward_location + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) +{ + if (CORBA::is_nil (forward_location)) + ACE_THROW (CORBA::INV_OBJREF ( + CORBA::SystemException::_tao_minor_code ( + TAO::VMCID, + EINVAL), + CORBA::COMPLETED_NO)); + this->forward_location_ = CORBA::Object::_duplicate (forward_location); +} + +char * +Echo_Server_Request_Interceptor::name (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) + ACE_THROW_SPEC ((CORBA::SystemException)) +{ + return CORBA::string_dup (this->myname_); +} + +void +Echo_Server_Request_Interceptor::destroy (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) + ACE_THROW_SPEC ((CORBA::SystemException)) +{ +} + +void +Echo_Server_Request_Interceptor::receive_request_service_contexts ( + PortableInterceptor::ServerRequestInfo_ptr ri + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException, + PortableInterceptor::ForwardRequest)) +{ + + CORBA::String_var operation = ri->operation (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK; + + ACE_DEBUG ((LM_DEBUG, + "%s.receive_request_service_contexts from " + "\"%s\"\n", + this->myname_, + operation.in ())); + + // Ignore the "_is_a" operation since it may have been invoked + // locally on the server side as a side effect of another call, + // meaning that the client hasn't added the service context yet. + // Same goes for the shutdown call + if (ACE_OS_String::strcmp ("shutdown", operation.in ()) == 0) + return; + + IOP::ServiceId id = ::service_id; + IOP::ServiceContext_var sc = + ri->get_request_service_context (id ACE_ENV_ARG_PARAMETER); + ACE_CHECK; + + const char *buf = + reinterpret_cast<const char *> (sc->context_data.get_buffer ()); + ACE_DEBUG ((LM_DEBUG, + " Received service context: %s\n", + buf)); + if (ACE_OS::strcmp (buf, request_msg) == 0) + { + ACE_DEBUG ((LM_DEBUG, "Sending LOCATION_FORWARD\n")); + ACE_THROW (PortableInterceptor::ForwardRequest (this->forward_location_)); + } + else if (ACE_OS::strcmp (buf, forward_msg) == 0) + { + // Make the context to send the context to the client + IOP::ServiceContext scc; + + scc.context_id = ::service_id; + + CORBA::ULong string_len = ACE_OS::strlen (reply_msg) + 1; + CORBA::Octet *buff = CORBA::OctetSeq::allocbuf (string_len); + + ACE_OS::strcpy (reinterpret_cast<char *> (buff), reply_msg); + + scc.context_data.replace (string_len, string_len, buff, 1); + + // Add this context to the service context list. + ri->add_reply_service_context (scc, 0 ACE_ENV_ARG_PARAMETER); + ACE_CHECK; + } + else + { + ACE_ERROR ((LM_ERROR, + "ERROR: Echo_Server_Request_Interceptor::receive_request_service_contexts: " + "Expected request service context to be: %s or %s\n", + request_msg, + forward_msg)); + } +} + + +void +Echo_Server_Request_Interceptor::receive_request ( + PortableInterceptor::ServerRequestInfo_ptr + ACE_ENV_ARG_DECL_NOT_USED) + ACE_THROW_SPEC ((CORBA::SystemException, + PortableInterceptor::ForwardRequest)) +{ + // Do nothing +} + +void +Echo_Server_Request_Interceptor::send_reply ( + PortableInterceptor::ServerRequestInfo_ptr ri + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) +{ + + CORBA::String_var operation = ri->operation (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK; + + ACE_DEBUG ((LM_DEBUG, + "%s.send_reply from \"%s\"\n", + this->myname_, + operation.in ())); + + // Check that the reply service context is set as expected. + IOP::ServiceContext_var sc = + ri->get_reply_service_context (::service_id ACE_ENV_ARG_PARAMETER); + ACE_CHECK; + + const char *buf = reinterpret_cast<const char *> (sc->context_data.get_buffer ()); + ACE_DEBUG ((LM_DEBUG, + " Reply service context: %s\n", + buf)); + + if (ACE_OS::strcmp (buf, reply_msg) != 0) + { + ACE_ERROR ((LM_ERROR, + "ERROR: Echo_Server_Request_Interceptor::send_reply: " + "Expected reply service context to be: %s\n", + reply_msg)); + } + + // Check that the request service context hasn't been changed. + IOP::ServiceContext_var sc2 = + ri->get_request_service_context (::service_id ACE_ENV_ARG_PARAMETER); + ACE_CHECK; + + const char *buf2 = reinterpret_cast<const char *> (sc2->context_data.get_buffer ()); + + if (ACE_OS::strcmp (buf2, forward_msg) != 0) + { + ACE_ERROR ((LM_ERROR, + "ERROR: Echo_Server_Request_Interceptor::send_reply: " + "Expected request service context to be: %s.\n" + " Got: %s\n", + forward_msg, + buf2)); + } +} + +void +Echo_Server_Request_Interceptor::send_exception ( + PortableInterceptor::ServerRequestInfo_ptr ri + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException, + PortableInterceptor::ForwardRequest)) +{ + + CORBA::String_var operation = ri->operation (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK; + + ACE_DEBUG ((LM_DEBUG, + "%s.send_exception from \"%s\"\n", + this->myname_, + operation.in ())); + + // Check that the reply service context is set as expected. + IOP::ServiceContext_var sc = + ri->get_reply_service_context (::service_id ACE_ENV_ARG_PARAMETER); + ACE_CHECK; + + const char *buf = reinterpret_cast<const char *> (sc->context_data.get_buffer ()); + ACE_DEBUG ((LM_DEBUG, + " Reply service context: %s\n", + buf)); + + if (ACE_OS::strcmp (buf, reply_msg) != 0) + { + ACE_ERROR ((LM_ERROR, + "ERROR: Echo_Server_Request_Interceptor::send_exception: " + "Expected reply service context to be: %s\n", + reply_msg)); + } + + // Check that the request service context hasn't been changed. + IOP::ServiceContext_var sc2 = + ri->get_request_service_context (::service_id ACE_ENV_ARG_PARAMETER); + ACE_CHECK; + + const char *buf2 = reinterpret_cast<const char *> (sc2->context_data.get_buffer ()); + + if (ACE_OS::strcmp (buf2, forward_msg) != 0) + { + ACE_ERROR ((LM_ERROR, + "ERROR: Echo_Server_Request_Interceptor::send_exception: " + "Expected request service context to be: %s.\n" + " Got: %s\n", + forward_msg, + buf2)); + } +} + +void +Echo_Server_Request_Interceptor::send_other ( + PortableInterceptor::ServerRequestInfo_ptr ri + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException, + PortableInterceptor::ForwardRequest)) +{ + CORBA::String_var operation = ri->operation (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK; + + ACE_DEBUG ((LM_DEBUG, + "%s.send_other from \"%s\"\n", + this->myname_, + operation.in ())); + + // Check that the request service context hasn't been changed. + IOP::ServiceContext_var sc = + ri->get_request_service_context (::service_id ACE_ENV_ARG_PARAMETER); + ACE_CHECK; + + const char *buf = reinterpret_cast<const char *> (sc->context_data.get_buffer ()); + + if (ACE_OS::strcmp (buf, request_msg) != 0) + { + ACE_ERROR ((LM_ERROR, + "ERROR: Echo_Server_Request_Interceptor::send_reply: " + "Expected request service context to be: %s.\n" + " Got: %s\n", + request_msg, + buf)); + } + + // If we get this far then we should have received a + // LOCATION_FORWARD reply. + + // This will throw an exception if a location forward has not + // occured. If an exception is thrown then something is wrong with + // the PortableInterceptor::ForwardRequest support. + CORBA::Object_var forward = ri->forward_reference (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK; + + if (CORBA::is_nil (forward.in ())) + ACE_THROW (CORBA::INTERNAL ()); +} diff --git a/TAO/tests/Portable_Interceptors/Bug_1559/interceptors.h b/TAO/tests/Portable_Interceptors/Bug_1559/server_interceptor.h index eccf3ba839c..81924ce2902 100644 --- a/TAO/tests/Portable_Interceptors/Bug_1559/interceptors.h +++ b/TAO/tests/Portable_Interceptors/Bug_1559/server_interceptor.h @@ -2,9 +2,10 @@ // // $Id$ -#ifndef TAO_INTERCEPTORS_H -#define TAO_INTERCEPTORS_H +#ifndef TAO_SERVER_INTERCEPTOR_H +#define TAO_SERVER_INTERCEPTOR_H +#include "tao/PI_Server/PI_Server.h" #include "tao/PortableInterceptorC.h" #include "tao/LocalObject.h" #include "tao/ORB.h" @@ -18,58 +19,6 @@ #pragma warning(disable:4250) #endif /* _MSC_VER */ -class Echo_Client_Request_Interceptor - : public virtual PortableInterceptor::ClientRequestInterceptor, - public virtual TAO_Local_RefCounted_Object -{ - // = Client-side echo interceptor. For checking interceptor visually only. -public: - Echo_Client_Request_Interceptor (const char *orb_id); - // ctor. - - virtual ~Echo_Client_Request_Interceptor (); - // dtor. - - virtual char * name (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - // Canonical name of the interceptor. - - virtual void destroy (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - virtual void send_poll (PortableInterceptor::ClientRequestInfo_ptr - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - virtual void send_request (PortableInterceptor::ClientRequestInfo_ptr ri - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableInterceptor::ForwardRequest)); - - virtual void receive_reply (PortableInterceptor::ClientRequestInfo_ptr ri - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - virtual void receive_other (PortableInterceptor::ClientRequestInfo_ptr ri - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableInterceptor::ForwardRequest)); - - virtual void receive_exception (PortableInterceptor::ClientRequestInfo_ptr ri - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableInterceptor::ForwardRequest)); - -private: - const char *myname_; - - CORBA::String_var orb_id_; - // The ID of the ORB where this interceptor was created, usually - // obtained from the ORBInitInfo - - CORBA::ORB_var orb_; -}; - class Echo_Server_Request_Interceptor : public virtual PortableInterceptor::ServerRequestInterceptor, public virtual TAO_Local_RefCounted_Object @@ -129,4 +78,4 @@ private: #pragma warning(pop) #endif /* _MSC_VER */ -#endif /* TAO_INTERCEPTORS_H */ +#endif /* TAO_SERVER_INTERCEPTOR_H */ diff --git a/TAO/tests/Portable_Interceptors/Bug_2088/Bug_2088.mpc b/TAO/tests/Portable_Interceptors/Bug_2088/Bug_2088.mpc index 52b4b6feb17..87022b449ba 100644 --- a/TAO/tests/Portable_Interceptors/Bug_2088/Bug_2088.mpc +++ b/TAO/tests/Portable_Interceptors/Bug_2088/Bug_2088.mpc @@ -1,7 +1,7 @@ // -*- MPC -*- // $Id$ -project(*Client): taoclient, interceptors { +project(*Client): taoclient, pi, interceptors { Source_Files { Client_ORBInitializer.cpp client.cpp diff --git a/TAO/tests/Portable_Interceptors/Collocated/Dynamic/PI_Dynamic.mpc b/TAO/tests/Portable_Interceptors/Collocated/Dynamic/PI_Dynamic.mpc index fdc67018fb0..e116424db27 100644 --- a/TAO/tests/Portable_Interceptors/Collocated/Dynamic/PI_Dynamic.mpc +++ b/TAO/tests/Portable_Interceptors/Collocated/Dynamic/PI_Dynamic.mpc @@ -1,7 +1,7 @@ // -*- MPC -*- // $Id$ -project(*Collocated): taoserver, interceptors { +project(*Collocated): taoserver, pi, pi_server, interceptors { exename = Collocated_Test Source_Files { testC.cpp diff --git a/TAO/tests/Portable_Interceptors/Collocated/Dynamic/interceptors.h b/TAO/tests/Portable_Interceptors/Collocated/Dynamic/interceptors.h index 32d48f61eb3..194ab46566d 100644 --- a/TAO/tests/Portable_Interceptors/Collocated/Dynamic/interceptors.h +++ b/TAO/tests/Portable_Interceptors/Collocated/Dynamic/interceptors.h @@ -12,6 +12,8 @@ # pragma once #endif /* ACE_LACKS_PRAGMA_ONCE */ +#include "tao/PI/PI.h" +#include "tao/PI_Server/PI_Server.h" #include "tao/LocalObject.h" #if defined(_MSC_VER) diff --git a/TAO/tests/Portable_Interceptors/Collocated/Service_Context_Manipulation/PI_Svc_Context_Manip.mpc b/TAO/tests/Portable_Interceptors/Collocated/Service_Context_Manipulation/PI_Svc_Context_Manip.mpc index 4b9cd5bf967..fcf3dbabb25 100644 --- a/TAO/tests/Portable_Interceptors/Collocated/Service_Context_Manipulation/PI_Svc_Context_Manip.mpc +++ b/TAO/tests/Portable_Interceptors/Collocated/Service_Context_Manipulation/PI_Svc_Context_Manip.mpc @@ -1,7 +1,7 @@ // -*- MPC -*- // $Id$ -project(*Collocated): taoserver, interceptors { +project(*Collocated): taoserver, pi, pi_server, interceptors { exename = collocated Source_Files { testC.cpp diff --git a/TAO/tests/Portable_Interceptors/Collocated/Service_Context_Manipulation/interceptors.h b/TAO/tests/Portable_Interceptors/Collocated/Service_Context_Manipulation/interceptors.h index a31854cfe69..29904bf2b55 100644 --- a/TAO/tests/Portable_Interceptors/Collocated/Service_Context_Manipulation/interceptors.h +++ b/TAO/tests/Portable_Interceptors/Collocated/Service_Context_Manipulation/interceptors.h @@ -3,6 +3,8 @@ #ifndef SERVICE_CONTEXT_MANIPULATION_COLLOCATED_INTERCEPTORS_H #define SERVICE_CONTEXT_MANIPULATION_COLLOCATED_INTERCEPTORS_H +#include "tao/PI/PI.h" +#include "tao/PI_Server/PI_Server.h" #include "tao/PortableInterceptorC.h" #include "tao/LocalObject.h" #include "tao/ORB.h" diff --git a/TAO/tests/Portable_Interceptors/Dynamic/Echo_Client_ORBInitializer.cpp b/TAO/tests/Portable_Interceptors/Dynamic/Echo_Client_ORBInitializer.cpp index eff774840ce..e67eb2afb3c 100644 --- a/TAO/tests/Portable_Interceptors/Dynamic/Echo_Client_ORBInitializer.cpp +++ b/TAO/tests/Portable_Interceptors/Dynamic/Echo_Client_ORBInitializer.cpp @@ -8,7 +8,7 @@ ACE_RCSID (Dynamic, Echo_Client_ORBInitializer, "$Id$") #if TAO_HAS_INTERCEPTORS == 1 -#include "interceptors.h" +#include "client_interceptor.h" void Echo_Client_ORBInitializer::pre_init ( diff --git a/TAO/tests/Portable_Interceptors/Dynamic/Echo_Server_ORBInitializer.cpp b/TAO/tests/Portable_Interceptors/Dynamic/Echo_Server_ORBInitializer.cpp index d97e189d466..cdb8f91338e 100644 --- a/TAO/tests/Portable_Interceptors/Dynamic/Echo_Server_ORBInitializer.cpp +++ b/TAO/tests/Portable_Interceptors/Dynamic/Echo_Server_ORBInitializer.cpp @@ -8,7 +8,7 @@ ACE_RCSID (Dynamic, Echo_Server_ORBInitializer, "$Id$") #if TAO_HAS_INTERCEPTORS == 1 -#include "interceptors.h" +#include "server_interceptor.h" void Echo_Server_ORBInitializer::pre_init ( diff --git a/TAO/tests/Portable_Interceptors/Dynamic/PI_Dynamic.mpc b/TAO/tests/Portable_Interceptors/Dynamic/PI_Dynamic.mpc index 788d04d99e5..88fa97fd7ba 100644 --- a/TAO/tests/Portable_Interceptors/Dynamic/PI_Dynamic.mpc +++ b/TAO/tests/Portable_Interceptors/Dynamic/PI_Dynamic.mpc @@ -1,19 +1,19 @@ // -*- MPC -*- // $Id$ -project(*Server): taoserver, interceptors { +project(*Server): taoserver, pi_server, interceptors { Source_Files { test_i.cpp - interceptors.cpp + server_interceptor.cpp Echo_Server_ORBInitializer.cpp server.cpp } } -project(*Client): taoclient, interceptors { +project(*Client): taoclient, pi, interceptors { Source_Files { testC.cpp - interceptors.cpp + client_interceptor.cpp Echo_Client_ORBInitializer.cpp client.cpp } diff --git a/TAO/tests/Portable_Interceptors/Dynamic/client.cpp b/TAO/tests/Portable_Interceptors/Dynamic/client.cpp index 7a64a02ff5e..c3d906faeb3 100644 --- a/TAO/tests/Portable_Interceptors/Dynamic/client.cpp +++ b/TAO/tests/Portable_Interceptors/Dynamic/client.cpp @@ -3,7 +3,6 @@ #include "ace/Get_Opt.h" #include "testC.h" -#include "interceptors.h" #include "Echo_Client_ORBInitializer.h" #include "tao/ORBInitializer_Registry.h" @@ -102,7 +101,7 @@ main (int argc, char *argv[]) { ACE_TRY_NEW_ENV { -#if TAO_HAS_INTERCEPTORS == 1 +#if TAO_HAS_INTERCEPTORS == 1 PortableInterceptor::ORBInitializer_ptr temp_initializer = PortableInterceptor::ORBInitializer::_nil (); diff --git a/TAO/tests/Portable_Interceptors/Dynamic/interceptors.cpp b/TAO/tests/Portable_Interceptors/Dynamic/client_interceptor.cpp index 3813e57ebc0..29eae24ccda 100644 --- a/TAO/tests/Portable_Interceptors/Dynamic/interceptors.cpp +++ b/TAO/tests/Portable_Interceptors/Dynamic/client_interceptor.cpp @@ -1,6 +1,6 @@ // $Id$ -#include "interceptors.h" +#include "client_interceptor.h" #include "testC.h" #include "tao/DynamicC.h" @@ -10,7 +10,7 @@ #include "ace/OS_NS_string.h" ACE_RCSID (Dynamic, - interceptors, + client_interceptor, "$Id$") Echo_Client_Request_Interceptor::Echo_Client_Request_Interceptor (void) @@ -251,169 +251,4 @@ Echo_Client_Request_Interceptor::receive_exception ( exception_id.in ())); } -Echo_Server_Request_Interceptor::Echo_Server_Request_Interceptor (void) - : myname_ ("Echo_Server_Interceptor") -{ -} - -Echo_Server_Request_Interceptor::~Echo_Server_Request_Interceptor () -{ -} - -char * -Echo_Server_Request_Interceptor::name (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - return CORBA::string_dup (this->myname_); -} - -void -Echo_Server_Request_Interceptor::destroy (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ -} - -void -Echo_Server_Request_Interceptor::receive_request_service_contexts ( - PortableInterceptor::ServerRequestInfo_ptr - ACE_ENV_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableInterceptor::ForwardRequest)) -{ -} - -void -Echo_Server_Request_Interceptor::receive_request ( - PortableInterceptor::ServerRequestInfo_ptr ri - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableInterceptor::ForwardRequest)) -{ - - CORBA::String_var op = ri->operation (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; - - ACE_DEBUG ((LM_DEBUG, - "Echo_Server_Request_Interceptor::receive_request from \"%s\"\n", - op.in ())); - - if (ACE_OS::strcmp (op.in (), "normal") == 0) - { - Dynamic::ParameterList_var paramlist = - ri->arguments (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; - - CORBA::Long param; - CORBA::ULong i = 0; // index -- explicitly used to avoid - // overloaded operator ambiguity. - paramlist[i].argument >>= param; - - ACE_DEBUG ((LM_DEBUG, - "The arg is %d\n", - param)); - - } - - CORBA::String_var tmdi = - ri->target_most_derived_interface (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; - - ACE_DEBUG ((LM_DEBUG, - "Target most derived interface: %s\n", - tmdi.in ())); -} - -void -Echo_Server_Request_Interceptor::send_reply ( - PortableInterceptor::ServerRequestInfo_ptr ri - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - - CORBA::String_var op = ri->operation (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; - - ACE_DEBUG ((LM_DEBUG, - "Echo_Server_Request_Interceptor::send_reply from \"%s\"\n", - op.in ())); - if (ACE_OS::strcmp (op.in (), "normal") == 0) - { - Dynamic::ParameterList_var paramlist = - ri->arguments (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; - - CORBA::Long param; - CORBA::ULong i = 0; // index -- explicitly used to avoid - // overloaded operator ambiguity. - paramlist[i].argument >>= param; - ACE_DEBUG ((LM_DEBUG, - "The arg is %d\n", - param)); - } - - if (ACE_OS::strcmp (op.in (), "calculate") == 0) - { - Dynamic::ParameterList_var paramlist = - ri->arguments (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; - - CORBA::Long param1, param2, result = 0; - CORBA::ULong i = 0; // index -- explicitly used to avoid - // overloaded operator ambiguity. - paramlist[i++].argument >>= param1; - paramlist[i].argument >>= param2; - - CORBA::Any_var result_any = ri->result (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; - - (result_any.in ()) >>= result; - - ACE_DEBUG ((LM_DEBUG, - "The result of calculate is %d + %d = %d\n", - param1, - param2, - result)); - } -} - -void -Echo_Server_Request_Interceptor::send_exception ( - PortableInterceptor::ServerRequestInfo_ptr ri - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableInterceptor::ForwardRequest)) -{ - - CORBA::String_var op = ri->operation (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; - - ACE_DEBUG ((LM_DEBUG, - "Echo_Server_Request_Interceptor::send_exception " - "from \"%s\"\n", - op.in ())); - - - CORBA::Any_var any = - ri->sending_exception (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; - - CORBA::TypeCode_var type = any->type (); - - const char *exception_id = type->id (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; - - ACE_DEBUG ((LM_DEBUG, - "Exception ID = %s\n", - exception_id)); -} - -void -Echo_Server_Request_Interceptor::send_other ( - PortableInterceptor::ServerRequestInfo_ptr - ACE_ENV_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableInterceptor::ForwardRequest)) -{ - // Do Nothing -} diff --git a/TAO/tests/Portable_Interceptors/Dynamic/client_interceptor.h b/TAO/tests/Portable_Interceptors/Dynamic/client_interceptor.h new file mode 100644 index 00000000000..d2de8b3455a --- /dev/null +++ b/TAO/tests/Portable_Interceptors/Dynamic/client_interceptor.h @@ -0,0 +1,84 @@ +// -*- C++ -*- +// +// $Id$ + +#ifndef TAO_CLIENT_INTERCEPTOR_H +#define TAO_CLIENT_INTERCEPTOR_H + +#include "tao/PI/PI.h" +#include "tao/PortableInterceptorC.h" +#include "tao/LocalObject.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#if defined(_MSC_VER) +#pragma warning(push) +#pragma warning(disable:4250) +#endif /* _MSC_VER */ + +class Echo_Client_Request_Interceptor + : public virtual PortableInterceptor::ClientRequestInterceptor, + public virtual TAO_Local_RefCounted_Object +{ + // = Client-side echo interceptor. For checking interceptor visually only. +public: + + Echo_Client_Request_Interceptor (void); + // ctor. + + virtual char * name (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + // Canonical name of the interceptor. + + virtual void destroy (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + virtual void send_poll ( + PortableInterceptor::ClientRequestInfo_ptr + ACE_ENV_ARG_DECL_WITH_DEFAULTS + ) + ACE_THROW_SPEC (( + CORBA::SystemException + )); + + virtual void send_request (PortableInterceptor::ClientRequestInfo_ptr ri + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException, + PortableInterceptor::ForwardRequest)); + + virtual void receive_other ( + PortableInterceptor::ClientRequestInfo_ptr + ACE_ENV_ARG_DECL_WITH_DEFAULTS + ) + ACE_THROW_SPEC (( + CORBA::SystemException, + PortableInterceptor::ForwardRequest + )); + + virtual void receive_reply (PortableInterceptor::ClientRequestInfo_ptr ri + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + virtual void receive_exception ( + PortableInterceptor::ClientRequestInfo_ptr ri + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException, + PortableInterceptor::ForwardRequest)); + +protected: + + virtual ~Echo_Client_Request_Interceptor (void); + // dtor. + +private: + const char *myname_; + +}; + +#if defined(_MSC_VER) +#pragma warning(pop) +#endif /* _MSC_VER */ + +#endif /* TAO_CLIENT_INTERCEPTOR_H */ diff --git a/TAO/tests/Portable_Interceptors/Dynamic/server.cpp b/TAO/tests/Portable_Interceptors/Dynamic/server.cpp index e29b51d392c..2197bc560bb 100644 --- a/TAO/tests/Portable_Interceptors/Dynamic/server.cpp +++ b/TAO/tests/Portable_Interceptors/Dynamic/server.cpp @@ -2,7 +2,6 @@ #include "ace/Get_Opt.h" #include "test_i.h" -#include "interceptors.h" #include "Echo_Server_ORBInitializer.h" #include "ace/OS_NS_stdio.h" diff --git a/TAO/tests/Portable_Interceptors/Dynamic/server_interceptor.cpp b/TAO/tests/Portable_Interceptors/Dynamic/server_interceptor.cpp new file mode 100644 index 00000000000..8e072515d51 --- /dev/null +++ b/TAO/tests/Portable_Interceptors/Dynamic/server_interceptor.cpp @@ -0,0 +1,181 @@ +// $Id$ + +#include "server_interceptor.h" +#include "testC.h" + +#include "tao/DynamicC.h" +#include "tao/TypeCode.h" + +#include "ace/Log_Msg.h" +#include "ace/OS_NS_string.h" + +ACE_RCSID (Dynamic, + server_interceptor, + "$Id$") + +Echo_Server_Request_Interceptor::Echo_Server_Request_Interceptor (void) + : myname_ ("Echo_Server_Interceptor") +{ +} + +Echo_Server_Request_Interceptor::~Echo_Server_Request_Interceptor () +{ +} + +char * +Echo_Server_Request_Interceptor::name (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) + ACE_THROW_SPEC ((CORBA::SystemException)) +{ + return CORBA::string_dup (this->myname_); +} + +void +Echo_Server_Request_Interceptor::destroy (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) + ACE_THROW_SPEC ((CORBA::SystemException)) +{ +} + +void +Echo_Server_Request_Interceptor::receive_request_service_contexts ( + PortableInterceptor::ServerRequestInfo_ptr + ACE_ENV_ARG_DECL_NOT_USED) + ACE_THROW_SPEC ((CORBA::SystemException, + PortableInterceptor::ForwardRequest)) +{ +} + +void +Echo_Server_Request_Interceptor::receive_request ( + PortableInterceptor::ServerRequestInfo_ptr ri + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException, + PortableInterceptor::ForwardRequest)) +{ + + CORBA::String_var op = ri->operation (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK; + + ACE_DEBUG ((LM_DEBUG, + "Echo_Server_Request_Interceptor::receive_request from \"%s\"\n", + op.in ())); + + if (ACE_OS::strcmp (op.in (), "normal") == 0) + { + Dynamic::ParameterList_var paramlist = + ri->arguments (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK; + + CORBA::Long param; + CORBA::ULong i = 0; // index -- explicitly used to avoid + // overloaded operator ambiguity. + paramlist[i].argument >>= param; + + ACE_DEBUG ((LM_DEBUG, + "The arg is %d\n", + param)); + + } + + CORBA::String_var tmdi = + ri->target_most_derived_interface (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK; + + ACE_DEBUG ((LM_DEBUG, + "Target most derived interface: %s\n", + tmdi.in ())); +} + +void +Echo_Server_Request_Interceptor::send_reply ( + PortableInterceptor::ServerRequestInfo_ptr ri + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) +{ + + CORBA::String_var op = ri->operation (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK; + + ACE_DEBUG ((LM_DEBUG, + "Echo_Server_Request_Interceptor::send_reply from \"%s\"\n", + op.in ())); + + if (ACE_OS::strcmp (op.in (), "normal") == 0) + { + Dynamic::ParameterList_var paramlist = + ri->arguments (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK; + + CORBA::Long param; + CORBA::ULong i = 0; // index -- explicitly used to avoid + // overloaded operator ambiguity. + paramlist[i].argument >>= param; + ACE_DEBUG ((LM_DEBUG, + "The arg is %d\n", + param)); + } + + if (ACE_OS::strcmp (op.in (), "calculate") == 0) + { + Dynamic::ParameterList_var paramlist = + ri->arguments (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK; + + CORBA::Long param1, param2, result = 0; + CORBA::ULong i = 0; // index -- explicitly used to avoid + // overloaded operator ambiguity. + paramlist[i++].argument >>= param1; + paramlist[i].argument >>= param2; + + CORBA::Any_var result_any = ri->result (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK; + + (result_any.in ()) >>= result; + + ACE_DEBUG ((LM_DEBUG, + "The result of calculate is %d + %d = %d\n", + param1, + param2, + result)); + } +} + +void +Echo_Server_Request_Interceptor::send_exception ( + PortableInterceptor::ServerRequestInfo_ptr ri + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException, + PortableInterceptor::ForwardRequest)) +{ + + CORBA::String_var op = ri->operation (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK; + + ACE_DEBUG ((LM_DEBUG, + "Echo_Server_Request_Interceptor::send_exception " + "from \"%s\"\n", + op.in ())); + + + CORBA::Any_var any = + ri->sending_exception (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK; + + CORBA::TypeCode_var type = any->type (); + + const char *exception_id = type->id (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK; + + ACE_DEBUG ((LM_DEBUG, + "Exception ID = %s\n", + exception_id)); +} + +void +Echo_Server_Request_Interceptor::send_other ( + PortableInterceptor::ServerRequestInfo_ptr + ACE_ENV_ARG_DECL_NOT_USED) + ACE_THROW_SPEC ((CORBA::SystemException, + PortableInterceptor::ForwardRequest)) +{ + // Do Nothing +} diff --git a/TAO/tests/Portable_Interceptors/Dynamic/interceptors.h b/TAO/tests/Portable_Interceptors/Dynamic/server_interceptor.h index 08e31458494..f536de965c0 100644 --- a/TAO/tests/Portable_Interceptors/Dynamic/interceptors.h +++ b/TAO/tests/Portable_Interceptors/Dynamic/server_interceptor.h @@ -2,9 +2,10 @@ // // $Id$ -#ifndef TAO_INTERCEPTORS_H -#define TAO_INTERCEPTORS_H +#ifndef TAO_SERVER_INTERCEPTOR_H +#define TAO_SERVER_INTERCEPTOR_H +#include "tao/PI_Server/PI_Server.h" #include "tao/PortableInterceptorC.h" #include "tao/LocalObject.h" @@ -17,65 +18,6 @@ #pragma warning(disable:4250) #endif /* _MSC_VER */ -class Echo_Client_Request_Interceptor - : public virtual PortableInterceptor::ClientRequestInterceptor, - public virtual TAO_Local_RefCounted_Object -{ - // = Client-side echo interceptor. For checking interceptor visually only. -public: - - Echo_Client_Request_Interceptor (void); - // ctor. - - virtual char * name (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - // Canonical name of the interceptor. - - virtual void destroy (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - virtual void send_poll ( - PortableInterceptor::ClientRequestInfo_ptr - ACE_ENV_ARG_DECL_WITH_DEFAULTS - ) - ACE_THROW_SPEC (( - CORBA::SystemException - )); - - virtual void send_request (PortableInterceptor::ClientRequestInfo_ptr ri - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableInterceptor::ForwardRequest)); - - virtual void receive_other ( - PortableInterceptor::ClientRequestInfo_ptr - ACE_ENV_ARG_DECL_WITH_DEFAULTS - ) - ACE_THROW_SPEC (( - CORBA::SystemException, - PortableInterceptor::ForwardRequest - )); - - virtual void receive_reply (PortableInterceptor::ClientRequestInfo_ptr ri - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - virtual void receive_exception ( - PortableInterceptor::ClientRequestInfo_ptr ri - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableInterceptor::ForwardRequest)); - -protected: - - virtual ~Echo_Client_Request_Interceptor (void); - // dtor. - -private: - const char *myname_; - -}; - class Echo_Server_Request_Interceptor : public PortableInterceptor::ServerRequestInterceptor, public virtual TAO_Local_RefCounted_Object @@ -138,4 +80,4 @@ private: #pragma warning(pop) #endif /* _MSC_VER */ -#endif /* TAO_INTERCEPTORS_H */ +#endif /* TAO_SERVER_INTERCEPTOR_H */ diff --git a/TAO/tests/Portable_Interceptors/ForwardRequest/Client_Request_Interceptor.h b/TAO/tests/Portable_Interceptors/ForwardRequest/Client_Request_Interceptor.h index fd92d7afc55..b39c5ae1297 100644 --- a/TAO/tests/Portable_Interceptors/ForwardRequest/Client_Request_Interceptor.h +++ b/TAO/tests/Portable_Interceptors/ForwardRequest/Client_Request_Interceptor.h @@ -22,6 +22,7 @@ # pragma once #endif /* ACE_LACKS_PRAGMA_ONCE */ +#include "tao/PI/PI.h" #include "tao/PortableInterceptorC.h" #include "tao/LocalObject.h" #include "tao/ORB.h" diff --git a/TAO/tests/Portable_Interceptors/ForwardRequest/PI_ForwardRequest.mpc b/TAO/tests/Portable_Interceptors/ForwardRequest/PI_ForwardRequest.mpc index 5e8d9d3f3c9..bf1c0f6349a 100644 --- a/TAO/tests/Portable_Interceptors/ForwardRequest/PI_ForwardRequest.mpc +++ b/TAO/tests/Portable_Interceptors/ForwardRequest/PI_ForwardRequest.mpc @@ -1,7 +1,7 @@ // -*- MPC -*- // $Id$ -project(*Server): taoserver, valuetype, interceptors { +project(*Server): taoserver, valuetype, pi_server, interceptors { idlflags += -DCORBA3 -I$(TAO_ROOT) Source_Files { @@ -12,7 +12,7 @@ project(*Server): taoserver, valuetype, interceptors { } } -project(*Client): taoclient, valuetype, interceptors { +project(*Client): taoclient, valuetype, pi, interceptors { idlflags += -DCORBA3 -I$(TAO_ROOT) Source_Files { diff --git a/TAO/tests/Portable_Interceptors/ForwardRequest/Server_Request_Interceptor.h b/TAO/tests/Portable_Interceptors/ForwardRequest/Server_Request_Interceptor.h index 9117858d7d3..003883dfd77 100644 --- a/TAO/tests/Portable_Interceptors/ForwardRequest/Server_Request_Interceptor.h +++ b/TAO/tests/Portable_Interceptors/ForwardRequest/Server_Request_Interceptor.h @@ -24,6 +24,7 @@ #include "testC.h" #include "tao/LocalObject.h" +#include "tao/PortableInterceptorC.h" #if defined(_MSC_VER) #pragma warning(push) diff --git a/TAO/tests/Portable_Interceptors/ForwardRequest/test.idl b/TAO/tests/Portable_Interceptors/ForwardRequest/test.idl index 11bac421a0b..153cf4559de 100644 --- a/TAO/tests/Portable_Interceptors/ForwardRequest/test.idl +++ b/TAO/tests/Portable_Interceptors/ForwardRequest/test.idl @@ -13,7 +13,7 @@ */ //============================================================================= -#include "tao/PortableInterceptor.pidl" +#include "tao/PI_Server/ServerRequestInterceptor.pidl" module ForwardRequestTest { diff --git a/TAO/tests/Portable_Interceptors/IORInterceptor/PI_IORInterceptor.mpc b/TAO/tests/Portable_Interceptors/IORInterceptor/PI_IORInterceptor.mpc index 9ca88675e54..1bdc7d0b821 100644 --- a/TAO/tests/Portable_Interceptors/IORInterceptor/PI_IORInterceptor.mpc +++ b/TAO/tests/Portable_Interceptors/IORInterceptor/PI_IORInterceptor.mpc @@ -10,7 +10,7 @@ project(*Server): taoserver, iorinterceptor, codecfactory, interceptors { } } -project(*Client): taoclient, codecfactory, interceptors { +project(*Client): taoclient, pi, codecfactory, interceptors { Source_Files { testC.cpp FOO_Client_ORBInitializer.cpp diff --git a/TAO/tests/Portable_Interceptors/ORB_Shutdown/PI_ORB_Shutdown.mpc b/TAO/tests/Portable_Interceptors/ORB_Shutdown/PI_ORB_Shutdown.mpc index 63830c7efad..47621eb156b 100644 --- a/TAO/tests/Portable_Interceptors/ORB_Shutdown/PI_ORB_Shutdown.mpc +++ b/TAO/tests/Portable_Interceptors/ORB_Shutdown/PI_ORB_Shutdown.mpc @@ -2,7 +2,7 @@ // // $Id$ -project(*Server): taoserver, interceptors { +project(*Server): taoserver, pi_server, interceptors { Source_Files { test_i.cpp Server_ORBInitializer.cpp diff --git a/TAO/tests/Portable_Interceptors/ORB_Shutdown/Server_Request_Interceptor.h b/TAO/tests/Portable_Interceptors/ORB_Shutdown/Server_Request_Interceptor.h index fb51c80f274..10e3add572b 100644 --- a/TAO/tests/Portable_Interceptors/ORB_Shutdown/Server_Request_Interceptor.h +++ b/TAO/tests/Portable_Interceptors/ORB_Shutdown/Server_Request_Interceptor.h @@ -22,6 +22,7 @@ # pragma once #endif /* ACE_LACKS_PRAGMA_ONCE */ +#include "tao/PI_Server/PI_Server.h" #include "tao/PortableInterceptorC.h" #include "tao/LocalObject.h" diff --git a/TAO/tests/Portable_Interceptors/PICurrent/ClientRequestInterceptor.h b/TAO/tests/Portable_Interceptors/PICurrent/ClientRequestInterceptor.h index 1b5df1908e1..c4709fff0a6 100644 --- a/TAO/tests/Portable_Interceptors/PICurrent/ClientRequestInterceptor.h +++ b/TAO/tests/Portable_Interceptors/PICurrent/ClientRequestInterceptor.h @@ -19,6 +19,7 @@ # pragma once #endif /* ACE_LACKS_PRAGMA_ONCE */ +#include "tao/PI/PI.h" #include "tao/PortableInterceptorC.h" #include "tao/LocalObject.h" diff --git a/TAO/tests/Portable_Interceptors/PICurrent/ClientRequestInterceptor2.h b/TAO/tests/Portable_Interceptors/PICurrent/ClientRequestInterceptor2.h index 80e5a1812ce..cfca53a52d6 100644 --- a/TAO/tests/Portable_Interceptors/PICurrent/ClientRequestInterceptor2.h +++ b/TAO/tests/Portable_Interceptors/PICurrent/ClientRequestInterceptor2.h @@ -19,6 +19,7 @@ # pragma once #endif /* ACE_LACKS_PRAGMA_ONCE */ +#include "tao/PI/PI.h" #include "tao/PortableInterceptorC.h" #include "tao/LocalObject.h" diff --git a/TAO/tests/Portable_Interceptors/PICurrent/PI_PICurrent.mpc b/TAO/tests/Portable_Interceptors/PICurrent/PI_PICurrent.mpc index 2c7b78ec5c4..fcb0a6c8382 100644 --- a/TAO/tests/Portable_Interceptors/PICurrent/PI_PICurrent.mpc +++ b/TAO/tests/Portable_Interceptors/PICurrent/PI_PICurrent.mpc @@ -1,7 +1,7 @@ // -*- MPC -*- // $Id$ -project(*Server): taoserver, interceptors { +project(*Server): taoserver, pi_server, interceptors { Source_Files { test_i.cpp ServerORBInitializer.cpp @@ -11,7 +11,7 @@ project(*Server): taoserver, interceptors { } } -project(*Client): taoclient, interceptors { +project(*Client): taoclient, pi, interceptors { Source_Files { testC.cpp ClientORBInitializer.cpp diff --git a/TAO/tests/Portable_Interceptors/PICurrent/ServerRequestInterceptor.h b/TAO/tests/Portable_Interceptors/PICurrent/ServerRequestInterceptor.h index 6dd03706a71..0e7c09d7d9c 100644 --- a/TAO/tests/Portable_Interceptors/PICurrent/ServerRequestInterceptor.h +++ b/TAO/tests/Portable_Interceptors/PICurrent/ServerRequestInterceptor.h @@ -22,6 +22,7 @@ # pragma once #endif /* ACE_LACKS_PRAGMA_ONCE */ +#include "tao/PI_Server/PI_Server.h" #include "tao/PortableInterceptorC.h" #include "tao/LocalObject.h" diff --git a/TAO/tests/Portable_Interceptors/Request_Interceptor_Flow/Client_Request_Interceptor.h b/TAO/tests/Portable_Interceptors/Request_Interceptor_Flow/Client_Request_Interceptor.h index b9f3a729894..2c29fd378cc 100644 --- a/TAO/tests/Portable_Interceptors/Request_Interceptor_Flow/Client_Request_Interceptor.h +++ b/TAO/tests/Portable_Interceptors/Request_Interceptor_Flow/Client_Request_Interceptor.h @@ -23,6 +23,7 @@ #endif /* ACE_LACKS_PRAGMA_ONCE */ #include "tao/PortableInterceptorC.h" +#include "tao/PI/PI.h" #include "tao/LocalObject.h" #include "Request_Interceptor.h" diff --git a/TAO/tests/Portable_Interceptors/Request_Interceptor_Flow/PI_Request_Interceptor_Flow.mpc b/TAO/tests/Portable_Interceptors/Request_Interceptor_Flow/PI_Request_Interceptor_Flow.mpc index 4f1adf84453..15ecab48119 100644 --- a/TAO/tests/Portable_Interceptors/Request_Interceptor_Flow/PI_Request_Interceptor_Flow.mpc +++ b/TAO/tests/Portable_Interceptors/Request_Interceptor_Flow/PI_Request_Interceptor_Flow.mpc @@ -1,7 +1,7 @@ // -*- MPC -*- // $Id$ -project(*Server): taoserver, interceptors { +project(*Server): taoserver, pi_server, interceptors { Source_Files { test_i.cpp Server_ORBInitializer.cpp @@ -11,7 +11,7 @@ project(*Server): taoserver, interceptors { } } -project(*Client): taoclient, interceptors { +project(*Client): taoclient, pi, interceptors { Source_Files { testC.cpp Client_ORBInitializer.cpp diff --git a/TAO/tests/Portable_Interceptors/Request_Interceptor_Flow/Request_Interceptor.h b/TAO/tests/Portable_Interceptors/Request_Interceptor_Flow/Request_Interceptor.h index b1261adaa35..2eb51870c7b 100644 --- a/TAO/tests/Portable_Interceptors/Request_Interceptor_Flow/Request_Interceptor.h +++ b/TAO/tests/Portable_Interceptors/Request_Interceptor_Flow/Request_Interceptor.h @@ -25,6 +25,7 @@ #include "ace/Atomic_Op.h" #include "tao/PortableInterceptorC.h" +#include "tao/PI/PI.h" #include "tao/LocalObject.h" #include "tao/CORBA_String.h" diff --git a/TAO/tests/Portable_Interceptors/Request_Interceptor_Flow/Server_Request_Interceptor.h b/TAO/tests/Portable_Interceptors/Request_Interceptor_Flow/Server_Request_Interceptor.h index c7a6053fa86..590491e9f62 100644 --- a/TAO/tests/Portable_Interceptors/Request_Interceptor_Flow/Server_Request_Interceptor.h +++ b/TAO/tests/Portable_Interceptors/Request_Interceptor_Flow/Server_Request_Interceptor.h @@ -23,6 +23,7 @@ #endif /* ACE_LACKS_PRAGMA_ONCE */ #include "tao/PortableInterceptorC.h" +#include "tao/PI_Server/PI_Server.h" #include "tao/LocalObject.h" #include "Request_Interceptor.h" diff --git a/TAO/tests/Portable_Interceptors/Request_Interceptor_Flow/client.cpp b/TAO/tests/Portable_Interceptors/Request_Interceptor_Flow/client.cpp index 47d582bce6d..606f68fca22 100644 --- a/TAO/tests/Portable_Interceptors/Request_Interceptor_Flow/client.cpp +++ b/TAO/tests/Portable_Interceptors/Request_Interceptor_Flow/client.cpp @@ -60,6 +60,13 @@ client_test (Test_ptr server ACE_ENV_ARG_DECL) { server->client_test (i ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; + + if (i == 1) + { + ACE_ERROR ((LM_ERROR, + "\nERROR: No exception has been thrown from client_test() " + "operation.\n")); + } } ACE_CATCH (Test::X, ex) { @@ -108,6 +115,13 @@ server_test (Test_ptr server ACE_ENV_ARG_DECL) { server->server_test (i ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; + + if (i == 1) + { + ACE_ERROR ((LM_ERROR, + "\nERROR: No exception has been thrown from server_test() " + "operation.\n")); + } } ACE_CATCH (Test::X, ex) { diff --git a/TAO/tests/Portable_Interceptors/Service_Context_Manipulation/Client_ORBInitializer.cpp b/TAO/tests/Portable_Interceptors/Service_Context_Manipulation/Client_ORBInitializer.cpp index b4732ce7376..fd053e810f0 100644 --- a/TAO/tests/Portable_Interceptors/Service_Context_Manipulation/Client_ORBInitializer.cpp +++ b/TAO/tests/Portable_Interceptors/Service_Context_Manipulation/Client_ORBInitializer.cpp @@ -4,7 +4,7 @@ // #include "Client_ORBInitializer.h" -#include "interceptors.h" +#include "client_interceptor.h" ACE_RCSID (Service_Context_Manipulation, Client_ORBInitializer, "$Id$") diff --git a/TAO/tests/Portable_Interceptors/Service_Context_Manipulation/PI_Svc_Context_Manip.mpc b/TAO/tests/Portable_Interceptors/Service_Context_Manipulation/PI_Svc_Context_Manip.mpc index 4c6778375a6..1a864c9e26f 100644 --- a/TAO/tests/Portable_Interceptors/Service_Context_Manipulation/PI_Svc_Context_Manip.mpc +++ b/TAO/tests/Portable_Interceptors/Service_Context_Manipulation/PI_Svc_Context_Manip.mpc @@ -1,20 +1,20 @@ // -*- MPC -*- // $Id$ -project(*Server): taoserver, interceptors { +project(*Server): taoserver, pi_server, interceptors { Source_Files { test_i.cpp Server_ORBInitializer.cpp - interceptors.cpp + server_interceptor.cpp server.cpp } } -project(*Client): taoclient, interceptors { +project(*Client): taoclient, pi, interceptors { Source_Files { testC.cpp Client_ORBInitializer.cpp - interceptors.cpp + client_interceptor.cpp client.cpp } } diff --git a/TAO/tests/Portable_Interceptors/Service_Context_Manipulation/Server_ORBInitializer.cpp b/TAO/tests/Portable_Interceptors/Service_Context_Manipulation/Server_ORBInitializer.cpp index e0c859a8680..0ad8960c819 100644 --- a/TAO/tests/Portable_Interceptors/Service_Context_Manipulation/Server_ORBInitializer.cpp +++ b/TAO/tests/Portable_Interceptors/Service_Context_Manipulation/Server_ORBInitializer.cpp @@ -4,7 +4,7 @@ // #include "Server_ORBInitializer.h" -#include "interceptors.h" +#include "server_interceptor.h" ACE_RCSID (Service_Context_Manipulation, Server_ORBInitializer, "$Id$") diff --git a/TAO/tests/Portable_Interceptors/Service_Context_Manipulation/client.cpp b/TAO/tests/Portable_Interceptors/Service_Context_Manipulation/client.cpp index b8b3945906c..80c6cfad678 100644 --- a/TAO/tests/Portable_Interceptors/Service_Context_Manipulation/client.cpp +++ b/TAO/tests/Portable_Interceptors/Service_Context_Manipulation/client.cpp @@ -2,7 +2,6 @@ #include "ace/Get_Opt.h" #include "testC.h" -#include "interceptors.h" #include "Client_ORBInitializer.h" #include "tao/ORBInitializer_Registry.h" diff --git a/TAO/tests/Portable_Interceptors/Service_Context_Manipulation/interceptors.cpp b/TAO/tests/Portable_Interceptors/Service_Context_Manipulation/client_interceptor.cpp index 9d44f81d09e..e9ef8474a32 100644 --- a/TAO/tests/Portable_Interceptors/Service_Context_Manipulation/interceptors.cpp +++ b/TAO/tests/Portable_Interceptors/Service_Context_Manipulation/client_interceptor.cpp @@ -1,6 +1,6 @@ // $Id$ -#include "interceptors.h" +#include "client_interceptor.h" #include "tao/OctetSeqC.h" #include "ace/Log_Msg.h" @@ -282,211 +282,3 @@ Echo_Client_Request_Interceptor::receive_exception ( } } -Echo_Server_Request_Interceptor::Echo_Server_Request_Interceptor (void) - : myname_ ("Echo_Server_Interceptor") -{ -} - -Echo_Server_Request_Interceptor::~Echo_Server_Request_Interceptor (void) -{ -} - -char * -Echo_Server_Request_Interceptor::name (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - return CORBA::string_dup (this->myname_); -} - -void -Echo_Server_Request_Interceptor::destroy (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ -} - -void -Echo_Server_Request_Interceptor::receive_request_service_contexts ( - PortableInterceptor::ServerRequestInfo_ptr ri - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableInterceptor::ForwardRequest)) -{ - - CORBA::String_var operation = ri->operation (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; - - ACE_DEBUG ((LM_DEBUG, - "%s.receive_request_service_contexts from " - "\"%s\"\n", - this->myname_, - operation.in ())); - - IOP::ServiceId id = ::service_id; - IOP::ServiceContext_var sc = - ri->get_request_service_context (id ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - - const char *buf = - reinterpret_cast<const char *> (sc->context_data.get_buffer ()); -#if 0 - ACE_DEBUG ((LM_DEBUG, - " Received service context: %s\n", - buf)); -#endif /*if 0*/ - - if (ACE_OS::strcmp (buf, request_msg) != 0) - { - ACE_ERROR ((LM_ERROR, - "ERROR: Echo_Server_Request_Interceptor::receive_request_service_contexts: " - "Expected request service context to be: %s\n", - request_msg)); - } - - // Make the context to send the context to the client - IOP::ServiceContext scc; - - scc.context_id = ::service_id; - - CORBA::ULong string_len = ACE_OS::strlen (reply_msg) + 1; - CORBA::Octet *buff = CORBA::OctetSeq::allocbuf (string_len); - - ACE_OS::strcpy (reinterpret_cast<char *> (buff), reply_msg); - - scc.context_data.replace (string_len, string_len, buff, 1); - - // Add this context to the service context list. - ri->add_reply_service_context (scc, 0 ACE_ENV_ARG_PARAMETER); - ACE_CHECK; -} - - -void -Echo_Server_Request_Interceptor::receive_request ( - PortableInterceptor::ServerRequestInfo_ptr - ACE_ENV_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableInterceptor::ForwardRequest)) -{ - // Do nothing -} - -void -Echo_Server_Request_Interceptor::send_reply ( - PortableInterceptor::ServerRequestInfo_ptr ri - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - - CORBA::String_var operation = ri->operation (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; - - ACE_DEBUG ((LM_DEBUG, - "%s.send_reply from \"%s\"\n", - this->myname_, - operation.in ())); - - // Check that the reply service context is set as expected. - IOP::ServiceContext_var sc = - ri->get_reply_service_context (::service_id ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - - const char *buf = reinterpret_cast<const char *> (sc->context_data.get_buffer ()); - -#if 0 - ACE_DEBUG ((LM_DEBUG, - " Reply service context: %s\n", - buf)); -#endif /*if 0*/ - - if (ACE_OS::strcmp (buf, reply_msg) != 0) - { - ACE_ERROR ((LM_ERROR, - "ERROR: Echo_Server_Request_Interceptor::send_reply: " - "Expected reply service context to be: %s\n", - reply_msg)); - } - - // Check that the request service context hasn't been changed. - IOP::ServiceContext_var sc2 = - ri->get_request_service_context (::service_id ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - - const char *buf2 = reinterpret_cast<const char *> (sc2->context_data.get_buffer ()); - - if (ACE_OS::strcmp (buf2, request_msg) != 0) - { - ACE_ERROR ((LM_ERROR, - "ERROR: Echo_Server_Request_Interceptor::send_reply: " - "Expected request service context to be: %s.\n" - " Got: %s\n", - request_msg, - buf2)); - } -} - -void -Echo_Server_Request_Interceptor::send_exception ( - PortableInterceptor::ServerRequestInfo_ptr ri - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableInterceptor::ForwardRequest)) -{ - - CORBA::String_var operation = ri->operation (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; - -#if 0 - ACE_DEBUG ((LM_DEBUG, - "%s.send_exception from \"%s\"\n", - this->myname_, - operation.in ())); -#endif /*if 0*/ - - // Check that the reply service context is set as expected. - IOP::ServiceContext_var sc = - ri->get_reply_service_context (::service_id ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - - const char *buf = reinterpret_cast<const char *> (sc->context_data.get_buffer ()); - -#if 0 - ACE_DEBUG ((LM_DEBUG, - " Reply service context: %s\n", - buf)); -#endif /*if 0*/ - - if (ACE_OS::strcmp (buf, reply_msg) != 0) - { - ACE_ERROR ((LM_ERROR, - "ERROR: Echo_Server_Request_Interceptor::send_exception: " - "Expected reply service context to be: %s\n", - reply_msg)); - } - - // Check that the request service context hasn't been changed. - IOP::ServiceContext_var sc2 = - ri->get_request_service_context (::service_id ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - - const char *buf2 = reinterpret_cast<const char *> (sc2->context_data.get_buffer ()); - - if (ACE_OS::strcmp (buf2, request_msg) != 0) - { - ACE_ERROR ((LM_ERROR, - "ERROR: Echo_Server_Request_Interceptor::send_exception: " - "Expected request service context to be: %s.\n" - " Got: %s\n", - request_msg, - buf2)); - } -} - -void -Echo_Server_Request_Interceptor::send_other ( - PortableInterceptor::ServerRequestInfo_ptr - ACE_ENV_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableInterceptor::ForwardRequest)) -{ - // Do Nothing -} diff --git a/TAO/tests/Portable_Interceptors/Service_Context_Manipulation/interceptors.h b/TAO/tests/Portable_Interceptors/Service_Context_Manipulation/client_interceptor.h index 1b04bc02105..10fcbd62f70 100644 --- a/TAO/tests/Portable_Interceptors/Service_Context_Manipulation/interceptors.h +++ b/TAO/tests/Portable_Interceptors/Service_Context_Manipulation/client_interceptor.h @@ -2,9 +2,10 @@ // // $Id$ -#ifndef TAO_INTERCEPTORS_H -#define TAO_INTERCEPTORS_H +#ifndef TAO_CLIENT_INTERCEPTOR_H +#define TAO_CLIENT_INTERCEPTOR_H +#include "tao/PI/PI.h" #include "tao/PortableInterceptorC.h" #include "tao/LocalObject.h" #include "tao/ORB.h" @@ -70,56 +71,8 @@ private: CORBA::ORB_var orb_; }; -class Echo_Server_Request_Interceptor - : public virtual PortableInterceptor::ServerRequestInterceptor, - public virtual TAO_Local_RefCounted_Object -{ - // = Server-side echo interceptor. For checking interceptor visually only. -public: - Echo_Server_Request_Interceptor (void); - // cotr. - - ~Echo_Server_Request_Interceptor (); - // dotr. - - virtual char * name (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - // Canonical name of the interceptor. - - virtual void destroy (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - virtual void receive_request (PortableInterceptor::ServerRequestInfo_ptr ri - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableInterceptor::ForwardRequest)); - - virtual void receive_request_service_contexts ( - PortableInterceptor::ServerRequestInfo_ptr - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableInterceptor::ForwardRequest)); - - virtual void send_reply (PortableInterceptor::ServerRequestInfo_ptr ri - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - virtual void send_exception (PortableInterceptor::ServerRequestInfo_ptr ri - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableInterceptor::ForwardRequest)); - - virtual void send_other (PortableInterceptor::ServerRequestInfo_ptr - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableInterceptor::ForwardRequest)); - -private: - const char *myname_; -}; - #if defined(_MSC_VER) #pragma warning(pop) #endif /* _MSC_VER */ -#endif /* TAO_INTERCEPTORS_H */ +#endif /* TAO_CLIENT_INTERCEPTOR_H */ diff --git a/TAO/tests/Portable_Interceptors/Service_Context_Manipulation/server.cpp b/TAO/tests/Portable_Interceptors/Service_Context_Manipulation/server.cpp index d13b9bb4c63..bb361528705 100644 --- a/TAO/tests/Portable_Interceptors/Service_Context_Manipulation/server.cpp +++ b/TAO/tests/Portable_Interceptors/Service_Context_Manipulation/server.cpp @@ -2,7 +2,6 @@ #include "ace/Get_Opt.h" #include "test_i.h" -#include "interceptors.h" #include "Server_ORBInitializer.h" #include "tao/ORBInitializer_Registry.h" diff --git a/TAO/tests/Portable_Interceptors/Service_Context_Manipulation/server_interceptor.cpp b/TAO/tests/Portable_Interceptors/Service_Context_Manipulation/server_interceptor.cpp new file mode 100644 index 00000000000..d253b1ab045 --- /dev/null +++ b/TAO/tests/Portable_Interceptors/Service_Context_Manipulation/server_interceptor.cpp @@ -0,0 +1,224 @@ +// $Id$ + +#include "server_interceptor.h" +#include "tao/OctetSeqC.h" + +#include "ace/Log_Msg.h" +#include "ace/OS_NS_string.h" + +ACE_RCSID (Service_Context_Manipulation, + server_interceptor, + "$Id$") + +const IOP::ServiceId service_id = 0xdeadbeef; +const char *request_msg = "The Echo_Request_Interceptor request message"; +const char *reply_msg = "The Echo_Request_Interceptor reply message"; + +Echo_Server_Request_Interceptor::Echo_Server_Request_Interceptor (void) + : myname_ ("Echo_Server_Interceptor") +{ +} + +Echo_Server_Request_Interceptor::~Echo_Server_Request_Interceptor (void) +{ +} + +char * +Echo_Server_Request_Interceptor::name (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) + ACE_THROW_SPEC ((CORBA::SystemException)) +{ + return CORBA::string_dup (this->myname_); +} + +void +Echo_Server_Request_Interceptor::destroy (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) + ACE_THROW_SPEC ((CORBA::SystemException)) +{ +} + +void +Echo_Server_Request_Interceptor::receive_request_service_contexts ( + PortableInterceptor::ServerRequestInfo_ptr ri + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException, + PortableInterceptor::ForwardRequest)) +{ + + CORBA::String_var operation = ri->operation (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK; + + ACE_DEBUG ((LM_DEBUG, + "%s.receive_request_service_contexts from " + "\"%s\"\n", + this->myname_, + operation.in ())); + + IOP::ServiceId id = ::service_id; + IOP::ServiceContext_var sc = + ri->get_request_service_context (id ACE_ENV_ARG_PARAMETER); + ACE_CHECK; + + const char *buf = + reinterpret_cast<const char *> (sc->context_data.get_buffer ()); +#if 0 + ACE_DEBUG ((LM_DEBUG, + " Received service context: %s\n", + buf)); +#endif /*if 0*/ + + if (ACE_OS::strcmp (buf, request_msg) != 0) + { + ACE_ERROR ((LM_ERROR, + "ERROR: Echo_Server_Request_Interceptor::receive_request_service_contexts: " + "Expected request service context to be: %s\n", + request_msg)); + } + + // Make the context to send the context to the client + IOP::ServiceContext scc; + + scc.context_id = ::service_id; + + CORBA::ULong string_len = ACE_OS::strlen (reply_msg) + 1; + CORBA::Octet *buff = CORBA::OctetSeq::allocbuf (string_len); + + ACE_OS::strcpy (reinterpret_cast<char *> (buff), reply_msg); + + scc.context_data.replace (string_len, string_len, buff, 1); + + // Add this context to the service context list. + ri->add_reply_service_context (scc, 0 ACE_ENV_ARG_PARAMETER); + ACE_CHECK; +} + + +void +Echo_Server_Request_Interceptor::receive_request ( + PortableInterceptor::ServerRequestInfo_ptr + ACE_ENV_ARG_DECL_NOT_USED) + ACE_THROW_SPEC ((CORBA::SystemException, + PortableInterceptor::ForwardRequest)) +{ + // Do nothing +} + +void +Echo_Server_Request_Interceptor::send_reply ( + PortableInterceptor::ServerRequestInfo_ptr ri + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) +{ + + CORBA::String_var operation = ri->operation (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK; + + ACE_DEBUG ((LM_DEBUG, + "%s.send_reply from \"%s\"\n", + this->myname_, + operation.in ())); + + // Check that the reply service context is set as expected. + IOP::ServiceContext_var sc = + ri->get_reply_service_context (::service_id ACE_ENV_ARG_PARAMETER); + ACE_CHECK; + + const char *buf = reinterpret_cast<const char *> (sc->context_data.get_buffer ()); + +#if 0 + ACE_DEBUG ((LM_DEBUG, + " Reply service context: %s\n", + buf)); +#endif /*if 0*/ + + if (ACE_OS::strcmp (buf, reply_msg) != 0) + { + ACE_ERROR ((LM_ERROR, + "ERROR: Echo_Server_Request_Interceptor::send_reply: " + "Expected reply service context to be: %s\n", + reply_msg)); + } + + // Check that the request service context hasn't been changed. + IOP::ServiceContext_var sc2 = + ri->get_request_service_context (::service_id ACE_ENV_ARG_PARAMETER); + ACE_CHECK; + + const char *buf2 = reinterpret_cast<const char *> (sc2->context_data.get_buffer ()); + + if (ACE_OS::strcmp (buf2, request_msg) != 0) + { + ACE_ERROR ((LM_ERROR, + "ERROR: Echo_Server_Request_Interceptor::send_reply: " + "Expected request service context to be: %s.\n" + " Got: %s\n", + request_msg, + buf2)); + } +} + +void +Echo_Server_Request_Interceptor::send_exception ( + PortableInterceptor::ServerRequestInfo_ptr ri + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException, + PortableInterceptor::ForwardRequest)) +{ + + CORBA::String_var operation = ri->operation (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK; + +#if 0 + ACE_DEBUG ((LM_DEBUG, + "%s.send_exception from \"%s\"\n", + this->myname_, + operation.in ())); +#endif /*if 0*/ + + // Check that the reply service context is set as expected. + IOP::ServiceContext_var sc = + ri->get_reply_service_context (::service_id ACE_ENV_ARG_PARAMETER); + ACE_CHECK; + + const char *buf = reinterpret_cast<const char *> (sc->context_data.get_buffer ()); + +#if 0 + ACE_DEBUG ((LM_DEBUG, + " Reply service context: %s\n", + buf)); +#endif /*if 0*/ + + if (ACE_OS::strcmp (buf, reply_msg) != 0) + { + ACE_ERROR ((LM_ERROR, + "ERROR: Echo_Server_Request_Interceptor::send_exception: " + "Expected reply service context to be: %s\n", + reply_msg)); + } + + // Check that the request service context hasn't been changed. + IOP::ServiceContext_var sc2 = + ri->get_request_service_context (::service_id ACE_ENV_ARG_PARAMETER); + ACE_CHECK; + + const char *buf2 = reinterpret_cast<const char *> (sc2->context_data.get_buffer ()); + + if (ACE_OS::strcmp (buf2, request_msg) != 0) + { + ACE_ERROR ((LM_ERROR, + "ERROR: Echo_Server_Request_Interceptor::send_exception: " + "Expected request service context to be: %s.\n" + " Got: %s\n", + request_msg, + buf2)); + } +} + +void +Echo_Server_Request_Interceptor::send_other ( + PortableInterceptor::ServerRequestInfo_ptr + ACE_ENV_ARG_DECL_NOT_USED) + ACE_THROW_SPEC ((CORBA::SystemException, + PortableInterceptor::ForwardRequest)) +{ + // Do Nothing +} diff --git a/TAO/tests/Portable_Interceptors/Service_Context_Manipulation/server_interceptor.h b/TAO/tests/Portable_Interceptors/Service_Context_Manipulation/server_interceptor.h new file mode 100644 index 00000000000..9549d70f549 --- /dev/null +++ b/TAO/tests/Portable_Interceptors/Service_Context_Manipulation/server_interceptor.h @@ -0,0 +1,74 @@ +// -*- C++ -*- +// +// $Id$ + +#ifndef TAO_SERVER_INTERCEPTOR_H +#define TAO_SERVER_INTERCEPTOR_H + +#include "tao/PI_Server/PI_Server.h" +#include "tao/PortableInterceptorC.h" +#include "tao/LocalObject.h" +#include "tao/ORB.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#if defined(_MSC_VER) +#pragma warning(push) +#pragma warning(disable:4250) +#endif /* _MSC_VER */ + +class Echo_Server_Request_Interceptor + : public virtual PortableInterceptor::ServerRequestInterceptor, + public virtual TAO_Local_RefCounted_Object +{ + // = Server-side echo interceptor. For checking interceptor visually only. +public: + Echo_Server_Request_Interceptor (void); + // cotr. + + ~Echo_Server_Request_Interceptor (); + // dotr. + + virtual char * name (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + // Canonical name of the interceptor. + + virtual void destroy (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + virtual void receive_request (PortableInterceptor::ServerRequestInfo_ptr ri + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException, + PortableInterceptor::ForwardRequest)); + + virtual void receive_request_service_contexts ( + PortableInterceptor::ServerRequestInfo_ptr + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException, + PortableInterceptor::ForwardRequest)); + + virtual void send_reply (PortableInterceptor::ServerRequestInfo_ptr ri + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + virtual void send_exception (PortableInterceptor::ServerRequestInfo_ptr ri + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException, + PortableInterceptor::ForwardRequest)); + + virtual void send_other (PortableInterceptor::ServerRequestInfo_ptr + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException, + PortableInterceptor::ForwardRequest)); + +private: + const char *myname_; +}; + +#if defined(_MSC_VER) +#pragma warning(pop) +#endif /* _MSC_VER */ + +#endif /* TAO_SERVER_INTERCEPTOR_H */ |