diff options
author | William R. Otte <wotte@dre.vanderbilt.edu> | 2006-07-24 15:50:11 +0000 |
---|---|---|
committer | William R. Otte <wotte@dre.vanderbilt.edu> | 2006-07-24 15:50:11 +0000 |
commit | 6b846cf03c0bcbd8c276cb0af61a181e5f98eaae (patch) | |
tree | da50d054f9c761c3f6a5923f6979e93306c56d68 /TAO/tests/Portable_Interceptors | |
parent | 0e555b9150d38e3b3473ba325b56db2642e6352b (diff) | |
download | ATCD-6b846cf03c0bcbd8c276cb0af61a181e5f98eaae.tar.gz |
Repo restructuring
Diffstat (limited to 'TAO/tests/Portable_Interceptors')
300 files changed, 0 insertions, 24933 deletions
diff --git a/TAO/tests/Portable_Interceptors/AMI/.cvsignore b/TAO/tests/Portable_Interceptors/AMI/.cvsignore deleted file mode 100644 index e17d953477e..00000000000 --- a/TAO/tests/Portable_Interceptors/AMI/.cvsignore +++ /dev/null @@ -1,12 +0,0 @@ -TestC.cpp -TestC.h -TestC.i -TestS.cpp -TestS.h -TestS.i -TestS_T.cpp -TestS_T.h -TestS_T.i -client -server -test.ior diff --git a/TAO/tests/Portable_Interceptors/AMI/Client_Interceptor.cpp b/TAO/tests/Portable_Interceptors/AMI/Client_Interceptor.cpp deleted file mode 100644 index ed90dd7815f..00000000000 --- a/TAO/tests/Portable_Interceptors/AMI/Client_Interceptor.cpp +++ /dev/null @@ -1,151 +0,0 @@ -/** - * @file Client_Interceptor.cpp - * - * $Id$ - * - * @author Carlos O'Ryan <coryan@atdesk.com> - */ - -#include "Client_Interceptor.h" -#include "Shared_Interceptor.h" -#include "tao/OctetSeqC.h" - -#include "ace/Log_Msg.h" -#include "ace/OS_NS_string.h" - - -ACE_RCSID (AMI, - Client_Interceptor, - "$Id$") - - -unsigned long Echo_Client_Request_Interceptor::request_count = 0; -unsigned long Echo_Client_Request_Interceptor::reply_count = 0; -unsigned long Echo_Client_Request_Interceptor::other_count = 0; -unsigned long Echo_Client_Request_Interceptor::exception_count = 0; - -Echo_Client_Request_Interceptor:: -Echo_Client_Request_Interceptor (void) -{ -} - -char * -Echo_Client_Request_Interceptor::name (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - return CORBA::string_dup ("Echo_Client_Interceptor"); -} - -void -Echo_Client_Request_Interceptor::destroy (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ -} - -void -Echo_Client_Request_Interceptor::send_poll ( - PortableInterceptor::ClientRequestInfo_ptr - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - ACE_ERROR((LM_ERROR, - "ERROR, unexpected interception point called send_poll()\n")); - ACE_THROW(CORBA::BAD_PARAM ()); -} - -void -Echo_Client_Request_Interceptor::send_request ( - PortableInterceptor::ClientRequestInfo_ptr ri - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableInterceptor::ForwardRequest)) -{ - IOP::ServiceContext sc; - sc.context_id = ::service_id; - - CORBA::Octet *buf = CORBA::OctetSeq::allocbuf(magic_cookie_len); - ACE_OS::memcpy(buf, magic_cookie, magic_cookie_len); - sc.context_data.replace (magic_cookie_len, magic_cookie_len, buf, 1); - - // Add this context to the service context list. - ri->add_request_service_context (sc, - 0 - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - - // Check that the request service context can be retrieved. - IOP::ServiceContext_var rc = - ri->get_request_service_context (::service_id - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - - if (rc->context_data.length() != magic_cookie_len - || ACE_OS::memcmp( - magic_cookie, rc->context_data.get_buffer(), - magic_cookie_len) != 0 - ) - { - ACE_THROW(CORBA::BAD_PARAM()); - } - - Echo_Client_Request_Interceptor::request_count++; -} - -void -Echo_Client_Request_Interceptor::receive_reply ( - PortableInterceptor::ClientRequestInfo_ptr ri - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - // Check that the request service context can be retrieved. - IOP::ServiceContext_var rc = - ri->get_request_service_context (::service_id - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - - if (rc->context_data.length() != magic_cookie_len - || ACE_OS::memcmp( - magic_cookie, rc->context_data.get_buffer(), - magic_cookie_len) != 0 - ) - { - ACE_THROW(CORBA::BAD_PARAM()); - } - - Echo_Client_Request_Interceptor::reply_count++; -} - -void -Echo_Client_Request_Interceptor::receive_other ( - PortableInterceptor::ClientRequestInfo_ptr ri - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableInterceptor::ForwardRequest)) -{ - // Check that the request service context can be retrieved. - IOP::ServiceContext_var rc = - ri->get_request_service_context (::service_id - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - - if (rc->context_data.length() != magic_cookie_len - || ACE_OS::memcmp( - magic_cookie, rc->context_data.get_buffer(), - magic_cookie_len) != 0 - ) - { - ACE_THROW (CORBA::BAD_PARAM ()); - } - - Echo_Client_Request_Interceptor::other_count++; -} - -void -Echo_Client_Request_Interceptor::receive_exception ( - PortableInterceptor::ClientRequestInfo_ptr - ACE_ENV_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableInterceptor::ForwardRequest)) -{ - Echo_Client_Request_Interceptor::exception_count++; -} diff --git a/TAO/tests/Portable_Interceptors/AMI/Client_Interceptor.h b/TAO/tests/Portable_Interceptors/AMI/Client_Interceptor.h deleted file mode 100644 index f775ebe2052..00000000000 --- a/TAO/tests/Portable_Interceptors/AMI/Client_Interceptor.h +++ /dev/null @@ -1,59 +0,0 @@ -/** - * @file Client_Interceptor.h - * - * $Id$ - * - * @author Carlos O'Ryan <coryan@atdesk.com> - */ -#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" - -class Echo_Client_Request_Interceptor - : public virtual PortableInterceptor::ClientRequestInterceptor - , public virtual TAO_Local_RefCounted_Object -{ -public: - Echo_Client_Request_Interceptor (void); - - static unsigned long request_count; - static unsigned long reply_count; - static unsigned long other_count; - static unsigned long exception_count; - - 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)); -}; - -#endif /* Client_Interceptor__h_ */ diff --git a/TAO/tests/Portable_Interceptors/AMI/Client_ORBInitializer.cpp b/TAO/tests/Portable_Interceptors/AMI/Client_ORBInitializer.cpp deleted file mode 100644 index 46ecb32ca03..00000000000 --- a/TAO/tests/Portable_Interceptors/AMI/Client_ORBInitializer.cpp +++ /dev/null @@ -1,38 +0,0 @@ -/** - * @file Client_ORBInitializer.cpp - * - * $Id$ - * - * @author Carlos O'Ryan <coryan@atdesk.com> - */ - -#include "Client_ORBInitializer.h" -#include "Client_Interceptor.h" - -ACE_RCSID(Portable_Interceptor_AMI, Client_ORBInitializer, "$Id$") - -Client_ORBInitializer::Client_ORBInitializer () -{ -} - -void -Client_ORBInitializer::pre_init ( - PortableInterceptor::ORBInitInfo_ptr - ACE_ENV_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ -} - -void -Client_ORBInitializer::post_init ( - PortableInterceptor::ORBInitInfo_ptr info - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - PortableInterceptor::ClientRequestInterceptor_var interceptor( - new Echo_Client_Request_Interceptor); - - info->add_client_request_interceptor (interceptor.in () - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; -} diff --git a/TAO/tests/Portable_Interceptors/AMI/Client_ORBInitializer.h b/TAO/tests/Portable_Interceptors/AMI/Client_ORBInitializer.h deleted file mode 100644 index 41c892cfb4f..00000000000 --- a/TAO/tests/Portable_Interceptors/AMI/Client_ORBInitializer.h +++ /dev/null @@ -1,33 +0,0 @@ -/** - * @file Client_ORBInitializer.h - * - * $Id$ - * - * @author Carlos O'Ryan <coryan@atdesk.com> - */ - -#ifndef Client_ORBInitializer__h_ -#define Client_ORBInitializer__h_ -#include /**/ "ace/pre.h" - -#include "tao/PI/PI.h" -#include "tao/LocalObject.h" - -class Client_ORBInitializer - : public virtual PortableInterceptor::ORBInitializer - , public virtual TAO_Local_RefCounted_Object -{ -public: - Client_ORBInitializer (); - - virtual void pre_init (PortableInterceptor::ORBInitInfo_ptr info - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)); - - virtual void post_init (PortableInterceptor::ORBInitInfo_ptr info - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)); -}; - -#include /**/ "ace/post.h" -#endif /* Client_ORBInitializer__h_ */ diff --git a/TAO/tests/Portable_Interceptors/AMI/Echo.cpp b/TAO/tests/Portable_Interceptors/AMI/Echo.cpp deleted file mode 100644 index 677ebee90b9..00000000000 --- a/TAO/tests/Portable_Interceptors/AMI/Echo.cpp +++ /dev/null @@ -1,30 +0,0 @@ -/** - * @file Echo.cpp - * - * $Id$ - * - * @author Carlos O'Ryan <coryan@atdesk.com> - */ -#include "Echo.h" - -ACE_RCSID(Portable_Interceptors_AMI, Echo, "$Id$") - -Echo::Echo(CORBA::ORB_ptr orb) - : orb_(CORBA::ORB::_duplicate(orb)) -{ -} - -char * -Echo::echo_operation(char const * the_input - ACE_ENV_ARG_DECL_NOT_USED) - ACE_THROW_SPEC((CORBA::SystemException)) -{ - return CORBA::string_dup(the_input); -} - -void -Echo::shutdown(ACE_ENV_SINGLE_ARG_DECL) - ACE_THROW_SPEC((CORBA::SystemException)) -{ - this->orb_->shutdown(0 ACE_ENV_ARG_PARAMETER); -} diff --git a/TAO/tests/Portable_Interceptors/AMI/Echo.h b/TAO/tests/Portable_Interceptors/AMI/Echo.h deleted file mode 100644 index de20793bbde..00000000000 --- a/TAO/tests/Portable_Interceptors/AMI/Echo.h +++ /dev/null @@ -1,30 +0,0 @@ -/** - * @file Echo.h - * - * $Id$ - * - * @author Carlos O'Ryan <coryan@atdesk.com> - */ -#ifndef Echo__h_ -#define Echo__h_ - -#include "TestS.h" -#include "tao/PortableServer/PortableServer.h" - -class Echo - : public POA_Test::Echo -{ -public: - Echo(CORBA::ORB_ptr orb); - - virtual char * echo_operation(char const * the_input - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC((CORBA::SystemException)); - virtual void shutdown(ACE_ENV_SINGLE_ARG_DECL) - ACE_THROW_SPEC((CORBA::SystemException)); - -private: - CORBA::ORB_var orb_; -}; - -#endif /* Echo__h_ */ diff --git a/TAO/tests/Portable_Interceptors/AMI/Echo_Handler.cpp b/TAO/tests/Portable_Interceptors/AMI/Echo_Handler.cpp deleted file mode 100644 index 3dc6be77b96..00000000000 --- a/TAO/tests/Portable_Interceptors/AMI/Echo_Handler.cpp +++ /dev/null @@ -1,53 +0,0 @@ -/** - * @file Echo_Handler.cpp - * - * $Id$ - * - * @author Carlos O'Ryan <coryan@atdesk.com> - */ -#include "Echo_Handler.h" - - -ACE_RCSID (AMI, - Echo_Handler, - "$Id$") - - -Echo_Handler::Echo_Handler(void) - : replies_ (0) -{ -} - -void -Echo_Handler::echo_operation (char const * - ACE_ENV_ARG_DECL_NOT_USED) - ACE_THROW_SPEC((CORBA::SystemException)) -{ - ++this->replies_; -} - -void -Echo_Handler::echo_operation_excep (::Messaging::ExceptionHolder * - ACE_ENV_ARG_DECL_NOT_USED) - ACE_THROW_SPEC((CORBA::SystemException)) -{ -} - -void -Echo_Handler::shutdown (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) - ACE_THROW_SPEC((CORBA::SystemException)) -{ -} - -void -Echo_Handler::shutdown_excep (::Messaging::ExceptionHolder * - ACE_ENV_ARG_DECL_NOT_USED) - ACE_THROW_SPEC((CORBA::SystemException)) -{ -} - -CORBA::ULong -Echo_Handler::replies (void) const -{ - return this->replies_; -} diff --git a/TAO/tests/Portable_Interceptors/AMI/Echo_Handler.h b/TAO/tests/Portable_Interceptors/AMI/Echo_Handler.h deleted file mode 100644 index 76517aa76f2..00000000000 --- a/TAO/tests/Portable_Interceptors/AMI/Echo_Handler.h +++ /dev/null @@ -1,38 +0,0 @@ -/** - * @file Echo_Handler.h - * - * $Id$ - * - * @author Carlos O'Ryan <coryan@atdesk.com> - */ -#ifndef Echo_Handler__h_ -#define Echo_Handler__h_ - -#include "TestS.h" -#include "tao/PortableServer/PortableServer.h" - -class Echo_Handler - : public POA_Test::AMI_EchoHandler -{ -public: - Echo_Handler(void); - - virtual void echo_operation(char const * retval - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC((CORBA::SystemException)); - virtual void echo_operation_excep(::Messaging::ExceptionHolder * h - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC((CORBA::SystemException)); - virtual void shutdown(ACE_ENV_SINGLE_ARG_DECL) - ACE_THROW_SPEC((CORBA::SystemException)); - virtual void shutdown_excep(::Messaging::ExceptionHolder * h - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC((CORBA::SystemException)); - - CORBA::ULong replies (void) const; - -private: - CORBA::ULong replies_; -}; - -#endif /* Echo_Handler__h_ */ diff --git a/TAO/tests/Portable_Interceptors/AMI/PI_AMI.mpc b/TAO/tests/Portable_Interceptors/AMI/PI_AMI.mpc deleted file mode 100644 index f55237bc40f..00000000000 --- a/TAO/tests/Portable_Interceptors/AMI/PI_AMI.mpc +++ /dev/null @@ -1,23 +0,0 @@ -// -*- MPC -*- -// $Id$ - -project(*Client) : taoserver, ami, pi, interceptors { - exename = client - source_files { - client.cpp - Client_Interceptor.cpp - Client_ORBInitializer.cpp - Echo_Handler.cpp - } -} - -project(*server) : taoserver, ami, pi_server, interceptors { - exename = server - after += *Client - source_files { - server.cpp - Server_Interceptor.cpp - Server_ORBInitializer.cpp - Echo.cpp - } -} diff --git a/TAO/tests/Portable_Interceptors/AMI/Server_Interceptor.cpp b/TAO/tests/Portable_Interceptors/AMI/Server_Interceptor.cpp deleted file mode 100644 index 4e8e110e4cd..00000000000 --- a/TAO/tests/Portable_Interceptors/AMI/Server_Interceptor.cpp +++ /dev/null @@ -1,99 +0,0 @@ -/** - * @file Server_Interceptor.cpp - * - * $Id$ - * - * @author Carlos O'Ryan <coryan@atdesk.com> - */ - -#include "Server_Interceptor.h" -#include "Shared_Interceptor.h" -#include "tao/OctetSeqC.h" -#include "ace/OS_NS_string.h" - - -ACE_RCSID (AMI, - Server_Interceptor, - "$Id$") - - -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 ("Echo_Server_Interceptor"); -} - -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; - - if (ACE_OS::strcmp ("_is_a", 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; - - if (sc->context_data.length() != magic_cookie_len - || ACE_OS::memcmp( - magic_cookie, sc->context_data.get_buffer(), - magic_cookie_len) != 0) - { - ACE_THROW(CORBA::BAD_PARAM()); - } -} - - -void -Echo_Server_Request_Interceptor::receive_request ( - PortableInterceptor::ServerRequestInfo_ptr - ACE_ENV_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableInterceptor::ForwardRequest)) -{ -} - -void -Echo_Server_Request_Interceptor::send_reply ( - PortableInterceptor::ServerRequestInfo_ptr - ACE_ENV_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ -} - -void -Echo_Server_Request_Interceptor::send_exception ( - PortableInterceptor::ServerRequestInfo_ptr - ACE_ENV_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableInterceptor::ForwardRequest)) -{ -} - -void -Echo_Server_Request_Interceptor::send_other ( - PortableInterceptor::ServerRequestInfo_ptr - ACE_ENV_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableInterceptor::ForwardRequest)) -{ -} diff --git a/TAO/tests/Portable_Interceptors/AMI/Server_Interceptor.h b/TAO/tests/Portable_Interceptors/AMI/Server_Interceptor.h deleted file mode 100644 index 6ccb824bc8a..00000000000 --- a/TAO/tests/Portable_Interceptors/AMI/Server_Interceptor.h +++ /dev/null @@ -1,55 +0,0 @@ -/** - * @file Server_Interceptor.h - * - * $Id$ - * - * @author Carlos O'Ryan <coryan@atdesk.com> - */ -#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" - -class Echo_Server_Request_Interceptor - : public virtual PortableInterceptor::ServerRequestInterceptor - , public virtual TAO_Local_RefCounted_Object -{ -public: - Echo_Server_Request_Interceptor (); - - virtual char * name (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - 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)); -}; - -#endif /* Server_Interceptor__h_ */ diff --git a/TAO/tests/Portable_Interceptors/AMI/Server_ORBInitializer.cpp b/TAO/tests/Portable_Interceptors/AMI/Server_ORBInitializer.cpp deleted file mode 100644 index dc409dd644e..00000000000 --- a/TAO/tests/Portable_Interceptors/AMI/Server_ORBInitializer.cpp +++ /dev/null @@ -1,40 +0,0 @@ -/** - * @file Server_ORBInitializer.cpp - * - * $Id$ - * - * @author Carlos O'Ryan <coryan@atdesk.com> - */ - -#include "Server_ORBInitializer.h" -#include "Server_Interceptor.h" - -ACE_RCSID (AMI, - Server_ORBInitializer, - "$Id$") - -Server_ORBInitializer::Server_ORBInitializer (void) -{ -} - -void -Server_ORBInitializer::pre_init ( - PortableInterceptor::ORBInitInfo_ptr - ACE_ENV_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ -} - -void -Server_ORBInitializer::post_init ( - PortableInterceptor::ORBInitInfo_ptr info - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - PortableInterceptor::ServerRequestInterceptor_var interceptor( - new Echo_Server_Request_Interceptor); - - info->add_server_request_interceptor (interceptor.in () - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; -} diff --git a/TAO/tests/Portable_Interceptors/AMI/Server_ORBInitializer.h b/TAO/tests/Portable_Interceptors/AMI/Server_ORBInitializer.h deleted file mode 100644 index f02c068b74f..00000000000 --- a/TAO/tests/Portable_Interceptors/AMI/Server_ORBInitializer.h +++ /dev/null @@ -1,33 +0,0 @@ -/** - * @file Server_ORBInitializer.h - * - * $Id$ - * - * @author Carlos O'Ryan <coryan@atdesk.com> - */ - -#ifndef Server_ORBInitializer__h_ -#define Server_ORBInitializer__h_ -#include /**/ "ace/pre.h" - -#include "tao/PI/PI.h" -#include "tao/LocalObject.h" - -class Server_ORBInitializer - : public virtual PortableInterceptor::ORBInitializer - , public virtual TAO_Local_RefCounted_Object -{ -public: - Server_ORBInitializer (void); - - virtual void pre_init (PortableInterceptor::ORBInitInfo_ptr info - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)); - - virtual void post_init (PortableInterceptor::ORBInitInfo_ptr info - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)); -}; - -#include /**/ "ace/post.h" -#endif /* Client_ORBInitializer__h_ */ diff --git a/TAO/tests/Portable_Interceptors/AMI/Shared_Interceptor.h b/TAO/tests/Portable_Interceptors/AMI/Shared_Interceptor.h deleted file mode 100644 index 9bc2f8b241b..00000000000 --- a/TAO/tests/Portable_Interceptors/AMI/Shared_Interceptor.h +++ /dev/null @@ -1,18 +0,0 @@ -/** - * @file Shared_Interceptor.h - * - * $Id$ - * - */ -#ifndef Shared_Interceptor__h_ -#define Shared_Interceptor__h_ - -#include "tao/IOPC.h" - -// Unreserved (and probably unwanted) ServiceId -const IOP::ServiceId service_id = 0xdeadbeef; - -const char magic_cookie[] = "Magic Cookie"; -const CORBA::ULong magic_cookie_len = sizeof(magic_cookie); - -#endif /* Shared_Interceptor__h_ */ diff --git a/TAO/tests/Portable_Interceptors/AMI/Test.idl b/TAO/tests/Portable_Interceptors/AMI/Test.idl deleted file mode 100644 index 12dc7a0df2f..00000000000 --- a/TAO/tests/Portable_Interceptors/AMI/Test.idl +++ /dev/null @@ -1,19 +0,0 @@ -/** - * @file Test.idl - * - * $Id$ - * - * @author Carlos O'Ryan <coryan@atdesk.com> - */ - -module Test -{ - - interface Echo - { - string echo_operation(in string the_input); - - void shutdown(); - }; - -}; diff --git a/TAO/tests/Portable_Interceptors/AMI/client.cpp b/TAO/tests/Portable_Interceptors/AMI/client.cpp deleted file mode 100644 index 571ccf476a0..00000000000 --- a/TAO/tests/Portable_Interceptors/AMI/client.cpp +++ /dev/null @@ -1,319 +0,0 @@ -#include "Echo_Handler.h" -#include "Client_ORBInitializer.h" -#include "Client_Interceptor.h" - -#include "tao/ORBInitializer_Registry.h" - -#include "ace/Get_Opt.h" -#include "ace/Log_Msg.h" -#include <iostream> - -ACE_RCSID (AMI, - client, - "$Id$") - - -const char *ior = "file://test.ior"; -static int exit_status = 0; -const unsigned long ITERATIONS = 100; - -int -parse_args (int argc, char *argv[]) -{ - ACE_Get_Opt get_opts (argc, argv, "k:"); - int c; - - while ((c = get_opts ()) != -1) - switch (c) - { - case 'k': - ior = get_opts.opt_arg (); - break; - - case '?': - default: - ACE_ERROR_RETURN ((LM_ERROR, - "usage: %s " - "-k <ior> " - "\n", - argv [0]), - -1); - } - // Indicates sucessful parsing of the command line - return 0; -} - -static void test_synchronous (Test::Echo_ptr echo - ACE_ENV_ARG_DECL); - -static void test_ami (CORBA::ORB_ptr orb, - Test::Echo_ptr echo - ACE_ENV_ARG_DECL); -int -main (int argc, char *argv[]) -{ - ACE_TRY_NEW_ENV - { - { - PortableInterceptor::ORBInitializer_var initializer ( - new Client_ORBInitializer); - PortableInterceptor::register_orb_initializer (initializer.in() - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - } - - CORBA::ORB_var orb = - CORBA::ORB_init (argc, argv, "" ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - if (parse_args (argc, argv) != 0) - return 1; - - CORBA::Object_var poa_object = - orb->resolve_initial_references ("RootPOA" - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - PortableServer::POA_var root_poa = - PortableServer::POA::_narrow (poa_object.in () - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - if (CORBA::is_nil (root_poa.in ())) - ACE_ERROR_RETURN ((LM_ERROR, - " (%P|%t) Panic: nil RootPOA\n"), - 1); - - PortableServer::POAManager_var poa_manager = - root_poa->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - - CORBA::Object_var tmp = - orb->string_to_object (ior ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - Test::Echo_var echo = - Test::Echo::_narrow (tmp.in () ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - poa_manager->activate (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - - if (CORBA::is_nil (echo.in ())) - { - ACE_ERROR_RETURN ((LM_DEBUG, - "Nil Test::Echo reference <%s>\n", - ior), - 1); - } - - test_synchronous (echo.in () - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - test_ami (orb.in (), - echo.in () - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - echo->shutdown (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - - orb->destroy (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - - unsigned long request_count = - Echo_Client_Request_Interceptor::request_count; - unsigned long response_count = - Echo_Client_Request_Interceptor::reply_count - + Echo_Client_Request_Interceptor::other_count - + Echo_Client_Request_Interceptor::exception_count; - - if (request_count != response_count) - { - ACE_ERROR ((LM_ERROR, - "ERROR: Mismatched count of requests and responses " - " (request = %d, response = %d)\n", - request_count, response_count)); - } - - if (request_count == 0) - { - ACE_ERROR ((LM_ERROR, - "ERROR: No requests handled ")); - } - - if (response_count == 0) - { - ACE_ERROR ((LM_ERROR, - "ERROR: No response handled ")); - } - } - ACE_CATCHANY - { - ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, - "Exception caught:"); - return 1; - } - ACE_ENDTRY; - - return exit_status; -} - -static void -test_synchronous (Test::Echo_ptr echo - ACE_ENV_ARG_DECL) -{ - unsigned long initial_request_count = - Echo_Client_Request_Interceptor::request_count; - unsigned long initial_reply_count = - Echo_Client_Request_Interceptor::reply_count; - - for (unsigned long i = 0; i != ITERATIONS; ++i) - { - CORBA::String_var s = - echo->echo_operation ("dummy message" - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - } - - unsigned long total_request_count = - Echo_Client_Request_Interceptor::request_count - initial_request_count; - unsigned long total_reply_count = - Echo_Client_Request_Interceptor::reply_count - initial_reply_count; - - if (total_request_count != ITERATIONS - || total_reply_count != ITERATIONS) - { - ACE_ERROR((LM_ERROR, - "ERROR: Invalid or mismatched request/reply " - "count (request = %d, reply = %d)\n", - total_request_count, total_reply_count)); - exit_status = 1; - } - - if (total_request_count == 0) - { - ACE_ERROR ((LM_ERROR, - "ERROR: No synchronouse requests handled ")); - } - - if (total_reply_count == 0) - { - ACE_ERROR ((LM_ERROR, - "ERROR: No synchronouse requests handled ")); - } -} - -static void -test_ami (CORBA::ORB_ptr orb, - Test::Echo_ptr echo - ACE_ENV_ARG_DECL) -{ - Test::AMI_EchoHandler_var echo_handler; - Echo_Handler * echo_handler_impl = new Echo_Handler; - - PortableServer::ServantBase_var safe_echo_handler = echo_handler_impl; - - echo_handler = - echo_handler_impl->_this (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; - - unsigned long initial_request_count = - Echo_Client_Request_Interceptor::request_count; - unsigned long initial_other_count = - Echo_Client_Request_Interceptor::other_count; - - for (unsigned long i = 0; i != ITERATIONS; ++i) - { - echo->sendc_echo_operation ( - echo_handler.in (), - "dummy message" - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - } - - unsigned long total_request_count = - Echo_Client_Request_Interceptor::request_count - initial_request_count; - unsigned long total_other_count = - Echo_Client_Request_Interceptor::other_count - initial_other_count; - - if (total_request_count != ITERATIONS - || total_other_count != ITERATIONS) - { - ACE_ERROR((LM_ERROR, - "ERROR: In test_ami () unexpected request/other " - "count (request = %d, other = %d)\n", - total_request_count, total_other_count)); - exit_status = 1; - } - - initial_request_count = - Echo_Client_Request_Interceptor::request_count; - unsigned long initial_reply_count = - Echo_Client_Request_Interceptor::reply_count; - - while (echo_handler_impl->replies () != ITERATIONS) - { - CORBA::Boolean pending = - orb->work_pending (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; - - if (pending) - { - orb->perform_work (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; - } - - } - - total_request_count = - Echo_Client_Request_Interceptor::request_count - initial_request_count; - unsigned long total_reply_count = - Echo_Client_Request_Interceptor::reply_count - initial_reply_count; - - if (total_request_count != ITERATIONS - || total_reply_count != ITERATIONS) - { - ACE_ERROR((LM_ERROR, - "ERROR: In test_ami () unexpected request/reply " - "count (request = %d, reply = %d)\n", - total_request_count, total_reply_count)); - exit_status = 1; - } -} - -#if 0 -static void -wait_for_exception (CORBA::ORB_ptr orb, - Test::Echo_ptr echo - ACE_ENV_ARG_DECL) -{ - ACE_Time_Value tv (1, 0); - orb->run (tv ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - - bool exception_detected = false; - - while(!exception_detected) - { - ACE_TRY - { - CORBA::String_var dummy = - echo->echo_operation ("foo" - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - } - ACE_CATCHANY - { - exception_detected = true; - } - ACE_ENDTRY; - } - - tv = ACE_Time_Value (1, 0); - orb->run (tv ACE_ENV_ARG_PARAMETER); - ACE_CHECK; -} - -#endif /*if 0*/ diff --git a/TAO/tests/Portable_Interceptors/AMI/run_test.pl b/TAO/tests/Portable_Interceptors/AMI/run_test.pl deleted file mode 100755 index 651271d4d03..00000000000 --- a/TAO/tests/Portable_Interceptors/AMI/run_test.pl +++ /dev/null @@ -1,48 +0,0 @@ -eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' - & eval 'exec perl -S $0 $argv:q' - if 0; - -# $Id$ -# -*- perl -*- - -use lib '../../../../bin'; -use PerlACE::Run_Test; - -$iorfile = PerlACE::LocalFile ("server.ior"); -unlink $iorfile; -$status = 0; - -if (PerlACE::is_vxworks_test()) { - $SV = new PerlACE::ProcessVX ("server", "-o server.ior"); -} -else { - $SV = new PerlACE::Process ("server", "-o $iorfile"); -} -$CL = new PerlACE::Process ("client", " -k file://$iorfile"); - -$SV->Spawn (); - -if (PerlACE::waitforfile_timed ($iorfile, - $PerlACE::wait_interval_for_process_creation) == -1) { - print STDERR "ERROR: cannot find file <$iorfile>\n"; - $SV->Kill (); $SV->TimedWait (1); - exit 1; -} - -$client = $CL->SpawnWaitKill (300); - -if ($client != 0) { - print STDERR "ERROR: client returned $client\n"; - $status = 1; -} - -$server = $SV->WaitKill (10); - -if ($server != 0) { - print STDERR "ERROR: server returned $server\n"; - $status = 1; -} - -unlink $iorfile; - -exit $status; diff --git a/TAO/tests/Portable_Interceptors/AMI/server.cpp b/TAO/tests/Portable_Interceptors/AMI/server.cpp deleted file mode 100644 index 0c52ac89b18..00000000000 --- a/TAO/tests/Portable_Interceptors/AMI/server.cpp +++ /dev/null @@ -1,127 +0,0 @@ -#include "Echo.h" -#include "Server_ORBInitializer.h" - -#include "tao/ORBInitializer_Registry.h" - -#include "ace/Get_Opt.h" -#include "ace/OS_NS_stdio.h" - - -ACE_RCSID (Portable_Interceptors, - AMI, - "$Id$") - - -const char *ior_output_file = "test.ior"; - -int -parse_args (int argc, char *argv[]) -{ - ACE_Get_Opt get_opts (argc, argv, "o:"); - int c; - - while ((c = get_opts ()) != -1) - switch (c) - { - case 'o': - ior_output_file = get_opts.opt_arg (); - break; - - case '?': - default: - ACE_ERROR_RETURN ((LM_ERROR, - "usage: %s " - "-o <iorfile>" - "\n", - argv [0]), - -1); - } - // Indicates sucessful parsing of the command line - return 0; -} - -int -main (int argc, char *argv[]) -{ - ACE_TRY_NEW_ENV - { - { - PortableInterceptor::ORBInitializer_var initializer( - new Server_ORBInitializer); - PortableInterceptor::register_orb_initializer(initializer.in() - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - } - - CORBA::ORB_var orb = - CORBA::ORB_init (argc, argv, "" ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - CORBA::Object_var poa_object = - orb->resolve_initial_references("RootPOA" ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - PortableServer::POA_var root_poa = - PortableServer::POA::_narrow (poa_object.in () ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - if (CORBA::is_nil (root_poa.in ())) - ACE_ERROR_RETURN ((LM_ERROR, - " (%P|%t) Panic: nil RootPOA\n"), - 1); - - PortableServer::POAManager_var poa_manager = - root_poa->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - - if (parse_args (argc, argv) != 0) - return 1; - - Echo *echo_impl; - ACE_NEW_RETURN (echo_impl, - Echo (orb.in ()), - 1); - PortableServer::ServantBase_var owner_transfer(echo_impl); - - Test::Echo_var echo = - echo_impl->_this (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - - CORBA::String_var ior = - orb->object_to_string (echo.in () ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - // Output the IOR to the <ior_output_file> - FILE *output_file = ACE_OS::fopen (ior_output_file, "w"); - if (output_file == 0) - ACE_ERROR_RETURN ((LM_ERROR, - "Cannot open output file for writing IOR: %s", - ior_output_file), - 1); - ACE_OS::fprintf (output_file, "%s", ior.in ()); - ACE_OS::fclose (output_file); - - poa_manager->activate (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - - orb->run (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - - ACE_DEBUG ((LM_DEBUG, "(%P|%t) server - event loop finished\n")); - - root_poa->destroy (1, 1 ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - orb->destroy (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - } - ACE_CATCHANY - { - ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, - "Exception caught:"); - return 1; - } - ACE_ENDTRY; - - return 0; -} diff --git a/TAO/tests/Portable_Interceptors/AdvSlot/AdvSlot.mpc b/TAO/tests/Portable_Interceptors/AdvSlot/AdvSlot.mpc deleted file mode 100644 index d53cfd5839c..00000000000 --- a/TAO/tests/Portable_Interceptors/AdvSlot/AdvSlot.mpc +++ /dev/null @@ -1,28 +0,0 @@ -// $Id$ -project(*idl): taoidldefaults { - IDL_Files { - StateTransfer.idl - } - custom_only = 1 -} - -project(*Server): taoserver, pi_server, exceptions { - after += *idl - Source_Files { - StateTransferS.cpp - StateTransferC.cpp - server.cpp - } - IDL_Files { - } -} - -project(*Client): taoclient, exceptions { - after += *idl - Source_Files { - StateTransferC.cpp - client.cpp - } - IDL_Files { - } -} diff --git a/TAO/tests/Portable_Interceptors/AdvSlot/StateTransfer.idl b/TAO/tests/Portable_Interceptors/AdvSlot/StateTransfer.idl deleted file mode 100644 index 663d4c57cbc..00000000000 --- a/TAO/tests/Portable_Interceptors/AdvSlot/StateTransfer.idl +++ /dev/null @@ -1,12 +0,0 @@ -// file : StateTransfer.idl -// author : Boris Kolpackov <boris@dre.vanderbilt.edu> -// cvs-id : $Id$ - -interface StateTransfer -{ - short - number (); - - oneway void - shutdown (); -}; diff --git a/TAO/tests/Portable_Interceptors/AdvSlot/client.cpp b/TAO/tests/Portable_Interceptors/AdvSlot/client.cpp deleted file mode 100644 index 0a9b7436bf1..00000000000 --- a/TAO/tests/Portable_Interceptors/AdvSlot/client.cpp +++ /dev/null @@ -1,27 +0,0 @@ -// author : Boris Kolpackov <boris@dre.vanderbilt.edu> -// cvs-id : $Id$ - -#include "StateTransferC.h" - -int -main (int argc, char *argv[]) -{ - CORBA::ORB_var orb = CORBA::ORB_init (argc, argv); - - if (argc != 2) - { - ACE_DEBUG ((LM_ERROR, "Usage: %s <ior>\n", argv[0])); - return -1; - } - - CORBA::Object_var obj = orb->string_to_object (argv[1]); - StateTransfer_var server = StateTransfer::_narrow (obj.in ()); - - CORBA::Short n = server->number (); - - ACE_DEBUG ((LM_ERROR, "Got number %d\n", n)); - - server->shutdown (); - - return 0; -} diff --git a/TAO/tests/Portable_Interceptors/AdvSlot/run_test.pl b/TAO/tests/Portable_Interceptors/AdvSlot/run_test.pl deleted file mode 100755 index 2cfe882b1b5..00000000000 --- a/TAO/tests/Portable_Interceptors/AdvSlot/run_test.pl +++ /dev/null @@ -1,50 +0,0 @@ -eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' - & eval 'exec perl -S $0 $argv:q' - if 0; - -# $Id$ -# -*- perl -*- - -use lib '../../../../bin'; -use PerlACE::Run_Test; - -$status = 0; -$file = PerlACE::LocalFile ("server.ior"); - -unlink $file; - -if (PerlACE::is_vxworks_test()) { - $SV = new PerlACE::ProcessVX ("server", ""); -} -else { - $SV = new PerlACE::Process ("server", ""); -} -$CL = new PerlACE::Process ("client", "file://$file"); - -print STDERR "\n\n==== Running advanced slot test\n"; - -$SV->Spawn (); - -if (PerlACE::waitforfile_timed ($file, 15) == -1) { - print STDERR "ERROR: cannot find file <$file>\n"; - $SV->Kill (); - exit 1; -} - -$client = $CL->SpawnWaitKill (60); - -if ($client != 0) { - print STDERR "ERROR: client returned $client\n"; - $status = 1; -} - -$server = $SV->WaitKill (5); - -if ($server != 0) { - print STDERR "ERROR: server returned $server\n"; - $status = 1; -} - -unlink $file; - -exit $status; diff --git a/TAO/tests/Portable_Interceptors/AdvSlot/server.cpp b/TAO/tests/Portable_Interceptors/AdvSlot/server.cpp deleted file mode 100644 index 6c5f5825295..00000000000 --- a/TAO/tests/Portable_Interceptors/AdvSlot/server.cpp +++ /dev/null @@ -1,199 +0,0 @@ -// author : Boris Kolpackov <boris@kolpackov.net> -// cvs-id : $Id$ - -#include "tao/LocalObject.h" -#include "tao/ORBInitializer_Registry.h" - -#include "tao/PI/PI.h" -#include "tao/PI_Server/PI_Server.h" - -#include "ace/OS_NS_stdio.h" - -#include "StateTransferS.h" - -using namespace CORBA; -using namespace PortableServer; -using namespace PortableInterceptor; - -// -// -PortableInterceptor::SlotId slot_id; - - -// -// -class StateTransferImpl: public virtual POA_StateTransfer -{ -public: - StateTransferImpl (ORB_ptr orb) - : orb_ (ORB::_duplicate (orb)) - { - } - - virtual Short - number () throw (SystemException) - { - // Prepare state update. - // - Any state; - CORBA::Long number = 5; - state <<= number; - - Object_var obj (orb_->resolve_initial_references ("PICurrent")); - PortableInterceptor::Current_var pic ( - PortableInterceptor::Current::_narrow (obj.in ())); - - pic->set_slot (slot_id, state); - - return 1; - } - - virtual void - shutdown () throw (SystemException) - { - ACE_DEBUG ((LM_DEBUG, "Server is shutting down.\n")); - this->orb_->shutdown (0); - } - -private: - ORB_var orb_; -}; - - -// -// -class ReplicaController: public virtual ServerRequestInterceptor, - public virtual TAO_Local_RefCounted_Object -{ -public: - virtual char* - name () throw (SystemException) - { - return string_dup ("ReplicaController"); - } - - virtual void - destroy () throw (SystemException) - { - } - -#if TAO_HAS_EXTENDED_FT_INTERCEPTORS == 1 - virtual void - tao_ft_interception_point (ServerRequestInfo_ptr, OctetSeq_out) - throw (SystemException, ForwardRequest) - { - } -#endif /*TAO_HAS_EXTENDED_FT_INTERCEPTORS*/ - - virtual void - receive_request_service_contexts (ServerRequestInfo_ptr) - throw (SystemException, ForwardRequest) - { - } - - virtual void - receive_request (ServerRequestInfo_ptr) - throw (SystemException, ForwardRequest) - { - } - - virtual void - send_reply (ServerRequestInfo_ptr ri) throw (SystemException) - { - Any_var state (ri->get_slot (slot_id)); - CORBA::Long n (0); - state >>= n; - - if (n == 5) - ACE_DEBUG ((LM_DEBUG, "State value is correctly %d.\n", n)); - else - ACE_ERROR ((LM_ERROR, "ERROR: State value is incorrectly %d.\n", n)); - } - - virtual void - send_exception (ServerRequestInfo_ptr) - throw (SystemException, ForwardRequest) - { - } - - virtual void - send_other (ServerRequestInfo_ptr) throw (SystemException, ForwardRequest) - { - } -}; - - -// -// -class ORB_Initializer : public virtual ORBInitializer, - public virtual TAO_Local_RefCounted_Object -{ -public: - virtual void - pre_init (ORBInitInfo_ptr) throw (SystemException) - { - } - - virtual void - post_init (ORBInitInfo_ptr info) throw (SystemException) - { - slot_id = info->allocate_slot_id (); - ACE_DEBUG ((LM_DEBUG, "Allocated slot with id %d.\n", slot_id)); - - - ServerRequestInterceptor_var interceptor (new ReplicaController ()); - info->add_server_request_interceptor (interceptor.in ()); - } -}; - -int -main (int argc, char *argv[]) -{ - ORBInitializer_var orb_initializer (new ORB_Initializer ()); - register_orb_initializer (orb_initializer.in ()); - - ORB_var orb (ORB_init (argc, argv)); - - Object_var obj (orb->resolve_initial_references ("RootPOA")); - - POA_var root_poa (POA::_narrow (obj.in ())); - POAManager_var poa_manager (root_poa->the_POAManager ()); - - StateTransferImpl* impl = new StateTransferImpl (orb.in ()); - ServantBase_var impl_var (impl); - - StateTransfer_var ref (impl->_this ()); - String_var ior (orb->object_to_string (ref.in ())); - - poa_manager->activate (); - - - // Dump the ior. - // - FILE *output_file= ACE_OS::fopen ("server.ior", "w"); - if (output_file == 0) - { - ACE_ERROR_RETURN ((LM_ERROR, - "Cannot open output file <%s> for writing " - "IOR: %s", - ior.in ()), - 1); - } - - ACE_OS::fprintf (output_file, "%s", ior.in ()); - ACE_OS::fclose (output_file); - - ACE_DEBUG ((LM_DEBUG, "Server is ready, IOR is in 'server.ior'\n")); - - - // Run the ORB event loop. - // - orb->run (); - - root_poa->destroy (1, 1); - orb->destroy (); - - ACE_DEBUG ((LM_DEBUG, "Event loop finished.\n")); - - return 0; -} diff --git a/TAO/tests/Portable_Interceptors/AdvSlotDblCpy/AdvSlotDblCpy.mpc b/TAO/tests/Portable_Interceptors/AdvSlotDblCpy/AdvSlotDblCpy.mpc deleted file mode 100644 index 0242f6d3360..00000000000 --- a/TAO/tests/Portable_Interceptors/AdvSlotDblCpy/AdvSlotDblCpy.mpc +++ /dev/null @@ -1,28 +0,0 @@ -// $Id$ -project(*idl): taoidldefaults { - IDL_Files { - InvokeMe.idl - } - custom_only = 1 -} - -project(*Server): taoserver, pi_server, exceptions { - after += *idl - Source_Files { - InvokeMeS.cpp - InvokeMeC.cpp - server.cpp - } - IDL_Files { - } -} - -project(*Client): taoclient, exceptions { - after += *idl - Source_Files { - InvokeMeC.cpp - client.cpp - } - IDL_Files { - } -} diff --git a/TAO/tests/Portable_Interceptors/AdvSlotDblCpy/InvokeMe.idl b/TAO/tests/Portable_Interceptors/AdvSlotDblCpy/InvokeMe.idl deleted file mode 100644 index a6f58fd0b93..00000000000 --- a/TAO/tests/Portable_Interceptors/AdvSlotDblCpy/InvokeMe.idl +++ /dev/null @@ -1,12 +0,0 @@ -// file : StateTransfer.idl -// author : Boris Kolpackov <boris@dre.vanderbilt.edu> -// cvs-id : $Id$ - -interface InvokeMe -{ - void - invoke_me (); - - oneway void - shutdown (); -}; diff --git a/TAO/tests/Portable_Interceptors/AdvSlotDblCpy/README b/TAO/tests/Portable_Interceptors/AdvSlotDblCpy/README deleted file mode 100644 index 0ccccc13a8c..00000000000 --- a/TAO/tests/Portable_Interceptors/AdvSlotDblCpy/README +++ /dev/null @@ -1,60 +0,0 @@ -The test should complete without exceptions or asserts. - -This test checks that simply calling GetSlot works at every -Server side interception point. - -This used to trigger the following assert in the send_reply -interception point if the slot had not actually been updated -after the RSC->TSC logical copy that occurs after the -"receive_request_service_contexts" (such as in the -"receive_request" or the actual IDL interface implementation -code) before the logical copy TSC->RSC that then occurs -before the "send_reply" interception point. - -send_reply -> get_slot(TSC) -> long (62) SERVER -send_reply -> get_slot(RSC) -ACE_ASSERT: file ...\TAO\tao\PI\PICurrent_Impl.cpp, line 53 -assertion failed for 'this->lc_slot_table_ != -&this->slot_table_'.Aborting... - -This test also checks that the set_slot(RSC) does not effect -the TSC that exists before the first logical copy (at the end -of receive_request_service_contexts) and after the second -logical copy that occurs after the IDL interface implimentation -call (i.e. during send_reply). - -The run should look like this: - -Allocated slot with id 0. -Server is ready, IOR is in 'server.ior' -SERVER receive_request_service_contexts -> get_slot(TSC) -> is EMPTY -> OK -SERVER receive_request_service_contexts -> get_slot(RSC) -> is EMPTY -> OK -SERVER receive_request_service_contexts -> set_slot(RSC) -> long (62) -SERVER receive_request_service_contexts -> get_slot(TSC) -> is EMPTY -> OK -SERVER receive_request_service_contexts -> get_slot(RSC) -> is long (62) -> OK -SERVER receive_request -> get_slot(TSC) -> is long (62) -> OK -SERVER receive_request -> get_slot(RSC) -> is long (62) -> OK -invoke_me -SERVER send_reply -> get_slot(TSC) -> is long (62) -> OK -SERVER send_reply -> get_slot(RSC) -> is long (62) -> OK -SERVER send_reply -> set_slot(RSC) -> long (63) -SERVER send_reply -> get_slot(TSC) -> is long (62) -> OK -SERVER send_reply -> get_slot(RSC) -> is long (63) -> OK - -SERVER receive_request_service_contexts -> get_slot(TSC) -> is long (62) -> OK -SERVER receive_request_service_contexts -> get_slot(RSC) -> is EMPTY -> OK -SERVER receive_request_service_contexts -> set_slot(RSC) -> long (62) -SERVER receive_request_service_contexts -> get_slot(TSC) -> is long (62) -> OK -SERVER receive_request_service_contexts -> get_slot(RSC) -> is long (62) -> OK -SERVER receive_request -> get_slot(TSC) -> is long (62) -> OK -SERVER receive_request -> get_slot(RSC) -> is long (62) -> OK -invoke_me -SERVER send_reply -> get_slot(TSC) -> is long (62) -> OK -SERVER send_reply -> get_slot(RSC) -> is long (62) -> OK -SERVER send_reply -> set_slot(RSC) -> long (63) -SERVER send_reply -> get_slot(TSC) -> is long (62) -> OK -SERVER send_reply -> get_slot(RSC) -> is long (63) -> OK - - -Server is shutting down. -Event loop finished. diff --git a/TAO/tests/Portable_Interceptors/AdvSlotDblCpy/client.cpp b/TAO/tests/Portable_Interceptors/AdvSlotDblCpy/client.cpp deleted file mode 100644 index 8a959137c9a..00000000000 --- a/TAO/tests/Portable_Interceptors/AdvSlotDblCpy/client.cpp +++ /dev/null @@ -1,41 +0,0 @@ -// author : Boris Kolpackov <boris@dre.vanderbilt.edu> -// cvs-id : $Id$ - -#include "InvokeMeC.h" - -namespace -{ - class always - { - const InvokeMe_ptr server_; - public: - always(const InvokeMe_ptr x):server_(x) {} - ~always() - { - ACE_DEBUG ((LM_DEBUG, "\n")); - server_->shutdown (); - } - }; -} - -int -main (int argc, char *argv[]) -{ - CORBA::ORB_var orb = CORBA::ORB_init (argc, argv); - - if (argc != 2) - { - ACE_DEBUG ((LM_ERROR, "Usage: %s <ior>\n", argv[0])); - return -1; - } - - CORBA::Object_var obj = orb->string_to_object (argv[1]); - InvokeMe_var server = InvokeMe::_narrow (obj.in ()); - - always Shutdown( server.in () ); // When goes out of scope! - server->invoke_me (); - ACE_DEBUG ((LM_DEBUG, "\n")); - server->invoke_me (); - - return 0; -} diff --git a/TAO/tests/Portable_Interceptors/AdvSlotDblCpy/run_test.pl b/TAO/tests/Portable_Interceptors/AdvSlotDblCpy/run_test.pl deleted file mode 100755 index 6adfc99fd7b..00000000000 --- a/TAO/tests/Portable_Interceptors/AdvSlotDblCpy/run_test.pl +++ /dev/null @@ -1,50 +0,0 @@ -eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' - & eval 'exec perl -S $0 $argv:q' - if 0; - -# $Id$ -# -*- perl -*- - -use lib '../../../../bin'; -use PerlACE::Run_Test; - -$status = 0; -$file = PerlACE::LocalFile ("server.ior"); - -unlink $file; - -if (PerlACE::is_vxworks_test()) { - $SV = new PerlACE::ProcessVX ("server", ""); -} -else { - $SV = new PerlACE::Process ("server", ""); -} -$CL = new PerlACE::Process ("client", "file://$file"); - -print STDERR "\n\n==== Running advanced slot double copy test\n"; - -$SV->Spawn (); - -if (PerlACE::waitforfile_timed ($file, 15) == -1) { - print STDERR "ERROR: cannot find file <$file>\n"; - $SV->Kill (); - exit 1; -} - -$client = $CL->SpawnWaitKill (60); - -if ($client != 0) { - print STDERR "ERROR: client returned $client\n"; - $status = 1; -} - -$server = $SV->WaitKill (5); - -if ($server != 0) { - print STDERR "ERROR: server returned $server\n"; - $status = 1; -} - -unlink $file; - -exit $status; diff --git a/TAO/tests/Portable_Interceptors/AdvSlotDblCpy/server.cpp b/TAO/tests/Portable_Interceptors/AdvSlotDblCpy/server.cpp deleted file mode 100644 index 729804b2872..00000000000 --- a/TAO/tests/Portable_Interceptors/AdvSlotDblCpy/server.cpp +++ /dev/null @@ -1,326 +0,0 @@ -// author : Boris Kolpackov <boris@kolpackov.net> -// cvs-id : $Id$ - -#include "tao/AnyTypeCode/AnyTypeCode_methods.h" - -#include "tao/PI/PI.h" -#include "tao/PI_Server/PI_Server.h" - -#include "tao/LocalObject.h" -#include "tao/ORBInitializer_Registry.h" - -#include "ace/OS_NS_stdio.h" - -#include "InvokeMeS.h" - -using namespace CORBA; -using namespace PortableServer; -using namespace PortableInterceptor; - -namespace -{ - PortableInterceptor::SlotId slot_id; - - CORBA::Long getMySlot( - PortableInterceptor::ServerRequestInfo_ptr ri, - PortableInterceptor::Current_ptr pi_current, - const char *location, - const CORBA::Long correctTSCvalue, - const CORBA::Long correctRSCvalue) - { - CORBA::Long number= 0; - CORBA::String_var - op= ri->operation (); - - const bool correctOperation= - (0 == ACE_OS::strcmp( op.in (), "invoke_me" )); - - if (correctOperation) - { - CORBA::Any_var data; - - ACE_DEBUG ((LM_DEBUG, "SERVER %s -> get_slot(TSC) -> is ", location)); - data= pi_current->get_slot( slot_id ); - CORBA::TypeCode_var - tc= data->type(); - if (tc->kind() == CORBA::tk_null) - { - ACE_DEBUG ((LM_DEBUG, "EMPTY -> ")); - if (0 != correctTSCvalue) - { - ACE_DEBUG ((LM_DEBUG, "WRONG\n")); - throw INTERNAL (); - } - ACE_DEBUG ((LM_DEBUG, "OK\n")); - } - else if (data.in() >>= number) - { - ACE_DEBUG ((LM_DEBUG, "long (%d) -> ", number)); - if ((0 != correctTSCvalue) && (correctTSCvalue != number)) - { - ACE_DEBUG ((LM_DEBUG, "WRONG\n")); - throw INTERNAL (); - } - ACE_DEBUG ((LM_DEBUG, "OK\n")); - } - else - { - ACE_DEBUG ((LM_DEBUG, "UNKNOWN TYPE\n")); - throw INTERNAL (); - } - - ACE_DEBUG ((LM_DEBUG, "SERVER %s -> get_slot(RSC) -> is ", location)); - data= ri->get_slot( slot_id ); - - tc= data->type(); - if (tc->kind() == CORBA::tk_null) - { - ACE_DEBUG ((LM_DEBUG, "EMPTY -> ")); - if (0 != correctRSCvalue) - { - ACE_DEBUG ((LM_DEBUG, "WRONG\n")); - throw INTERNAL (); - } - ACE_DEBUG ((LM_DEBUG, "OK\n")); -#if TAO_HAS_EXTENDED_FT_INTERCEPTORS == 1 - number= 61; -#else - number= 62; -#endif /* TAO_HAS_EXTENDED_FT_INTERCEPTORS == 1 */ - } - else if (data.in() >>= number) - { - ACE_DEBUG ((LM_DEBUG, "long (%d) -> ", number)); - if ((0 != correctRSCvalue) && (correctRSCvalue != number)) - { - ACE_DEBUG ((LM_DEBUG, "WRONG\n")); - throw INTERNAL (); - } - ACE_DEBUG ((LM_DEBUG, "OK\n")); - ++number; - } - else - { - ACE_DEBUG ((LM_DEBUG, "WRONG TYPE\n")); - throw INTERNAL(); - } - } - - return number; - } - - void getAndSetMySlot( - PortableInterceptor::ServerRequestInfo_ptr ri, - PortableInterceptor::Current_ptr pi_current, - const char *location, - const CORBA::Long correctTSCvalue, - const CORBA::Long correctRSCvalue) - { - const CORBA::Long number= - getMySlot( - ri, - pi_current, - location, - correctTSCvalue, - correctRSCvalue ); - - if (number && (0 != ACE_OS::strcmp( location, "receive_request" ))) - { - // Insert data into the RSC (request scope current). - CORBA::Any data; - data <<= number; - - ACE_DEBUG ((LM_DEBUG, "SERVER %s -> set_slot(RSC)", location)); - ri->set_slot( slot_id, data ); - - ACE_DEBUG ((LM_DEBUG, " -> long (%d)\n", number)); - - getMySlot( - ri, - pi_current, - location, - correctTSCvalue, - number ); - } - } -} - -// -// -class InvokeMeImpl: public virtual POA_InvokeMe -{ -public: - InvokeMeImpl (ORB_ptr orb) - : orb_ (ORB::_duplicate (orb)) - { - } - - virtual void invoke_me() throw (SystemException) - { - ACE_DEBUG ((LM_DEBUG, "invoke_me\n")); - } - - virtual void - shutdown () throw (SystemException) - { - ACE_DEBUG ((LM_DEBUG, "\nServer is shutting down.\n")); - this->orb_->shutdown (0); - } - -private: - ORB_var orb_; -}; - - -// -// -class ReplicaController: public virtual ServerRequestInterceptor, - public virtual TAO_Local_RefCounted_Object -{ - PortableInterceptor::Current_ptr pi_current_; -public: - ReplicaController ( PortableInterceptor::Current_ptr pi_current ) - : pi_current_( pi_current ) - { - } - - virtual char* - name () throw (SystemException) - { - return string_dup ("ReplicaController"); - } - - virtual void - destroy () throw (SystemException) - { - } - -#if TAO_HAS_EXTENDED_FT_INTERCEPTORS == 1 - virtual void - tao_ft_interception_point (ServerRequestInfo_ptr ri, OctetSeq_out) - throw (SystemException, ForwardRequest) - { - getAndSetMySlot( ri, this->pi_current_, "tao_ft_interception_point", 0, 0 ); - } -#endif /*TAO_HAS_EXTENDED_FT_INTERCEPTORS*/ - - virtual void - receive_request_service_contexts (ServerRequestInfo_ptr ri) - throw (SystemException, ForwardRequest) - { -#if TAO_HAS_EXTENDED_FT_INTERCEPTORS == 1 - getAndSetMySlot( ri, this->pi_current_, "receive_request_service_contexts", 0, 61 ); -#else - getAndSetMySlot( ri, this->pi_current_, "receive_request_service_contexts", 0, 0 ); -#endif /* TAO_HAS_EXTENDED_FT_INTERCEPTORS == 1 */ - } - - virtual void - receive_request (ServerRequestInfo_ptr ri) - throw (SystemException, ForwardRequest) - { - getAndSetMySlot( ri, this->pi_current_, "receive_request", 62, 62 ); - } - - virtual void - send_reply (ServerRequestInfo_ptr ri) throw (SystemException) - { - getAndSetMySlot( ri, this->pi_current_, "send_reply", 62, 62 ); - } - - virtual void - send_exception (ServerRequestInfo_ptr ri) - throw (SystemException, ForwardRequest) - { - getAndSetMySlot( ri, this->pi_current_, "send_exception", 62, 62 ); - } - - virtual void - send_other (ServerRequestInfo_ptr ri) - throw (SystemException, ForwardRequest) - { - getAndSetMySlot( ri, this->pi_current_, "send_other", 62, 62 ); - } -}; - - -// -// -class ORB_Initializer : public virtual ORBInitializer, - public virtual TAO_Local_RefCounted_Object -{ -public: - virtual void - pre_init (ORBInitInfo_ptr) throw (SystemException) - { - } - - virtual void - post_init (ORBInitInfo_ptr info) throw (SystemException) - { - CORBA::Object_var obj = - info->resolve_initial_references ("PICurrent"); - - PortableInterceptor::Current_var pi_current = - PortableInterceptor::Current::_narrow (obj.in ()); - - slot_id = info->allocate_slot_id (); - ACE_DEBUG ((LM_DEBUG, "Allocated slot with id %d.\n", slot_id)); - - ServerRequestInterceptor_var - interceptor (new ReplicaController (pi_current.in ())); - info->add_server_request_interceptor (interceptor.in ()); - } -}; - -int -main (int argc, char *argv[]) -{ - ORBInitializer_var orb_initializer (new ORB_Initializer ()); - register_orb_initializer (orb_initializer.in ()); - - ORB_var orb (ORB_init (argc, argv)); - - Object_var obj (orb->resolve_initial_references ("RootPOA")); - - POA_var root_poa (POA::_narrow (obj.in ())); - POAManager_var poa_manager (root_poa->the_POAManager ()); - - InvokeMeImpl* impl = new InvokeMeImpl (orb.in ()); - ServantBase_var impl_var (impl); - - InvokeMe_var ref (impl->_this ()); - String_var ior (orb->object_to_string (ref.in ())); - - poa_manager->activate (); - - - // Dump the ior. - // - FILE *output_file= ACE_OS::fopen ("server.ior", "w"); - if (output_file == 0) - { - ACE_ERROR_RETURN ((LM_ERROR, - "Cannot open output file <%s> for writing " - "IOR: %s", - ior.in ()), - 1); - } - - ACE_OS::fprintf (output_file, "%s", ior.in ()); - ACE_OS::fclose (output_file); - - ACE_DEBUG ((LM_DEBUG, "Server is ready, IOR is in 'server.ior'\n")); - - - // Run the ORB event loop. - // - orb->run (); - - root_poa->destroy (1, 1); - orb->destroy (); - - ACE_DEBUG ((LM_DEBUG, "Event loop finished.\n")); - - return 0; -} diff --git a/TAO/tests/Portable_Interceptors/AdvSlotExt/AdvSlotExt.mpc b/TAO/tests/Portable_Interceptors/AdvSlotExt/AdvSlotExt.mpc deleted file mode 100644 index d53cfd5839c..00000000000 --- a/TAO/tests/Portable_Interceptors/AdvSlotExt/AdvSlotExt.mpc +++ /dev/null @@ -1,28 +0,0 @@ -// $Id$ -project(*idl): taoidldefaults { - IDL_Files { - StateTransfer.idl - } - custom_only = 1 -} - -project(*Server): taoserver, pi_server, exceptions { - after += *idl - Source_Files { - StateTransferS.cpp - StateTransferC.cpp - server.cpp - } - IDL_Files { - } -} - -project(*Client): taoclient, exceptions { - after += *idl - Source_Files { - StateTransferC.cpp - client.cpp - } - IDL_Files { - } -} diff --git a/TAO/tests/Portable_Interceptors/AdvSlotExt/StateTransfer.idl b/TAO/tests/Portable_Interceptors/AdvSlotExt/StateTransfer.idl deleted file mode 100644 index 663d4c57cbc..00000000000 --- a/TAO/tests/Portable_Interceptors/AdvSlotExt/StateTransfer.idl +++ /dev/null @@ -1,12 +0,0 @@ -// file : StateTransfer.idl -// author : Boris Kolpackov <boris@dre.vanderbilt.edu> -// cvs-id : $Id$ - -interface StateTransfer -{ - short - number (); - - oneway void - shutdown (); -}; diff --git a/TAO/tests/Portable_Interceptors/AdvSlotExt/client.cpp b/TAO/tests/Portable_Interceptors/AdvSlotExt/client.cpp deleted file mode 100644 index 0a9b7436bf1..00000000000 --- a/TAO/tests/Portable_Interceptors/AdvSlotExt/client.cpp +++ /dev/null @@ -1,27 +0,0 @@ -// author : Boris Kolpackov <boris@dre.vanderbilt.edu> -// cvs-id : $Id$ - -#include "StateTransferC.h" - -int -main (int argc, char *argv[]) -{ - CORBA::ORB_var orb = CORBA::ORB_init (argc, argv); - - if (argc != 2) - { - ACE_DEBUG ((LM_ERROR, "Usage: %s <ior>\n", argv[0])); - return -1; - } - - CORBA::Object_var obj = orb->string_to_object (argv[1]); - StateTransfer_var server = StateTransfer::_narrow (obj.in ()); - - CORBA::Short n = server->number (); - - ACE_DEBUG ((LM_ERROR, "Got number %d\n", n)); - - server->shutdown (); - - return 0; -} diff --git a/TAO/tests/Portable_Interceptors/AdvSlotExt/run_test.pl b/TAO/tests/Portable_Interceptors/AdvSlotExt/run_test.pl deleted file mode 100755 index 2cfe882b1b5..00000000000 --- a/TAO/tests/Portable_Interceptors/AdvSlotExt/run_test.pl +++ /dev/null @@ -1,50 +0,0 @@ -eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' - & eval 'exec perl -S $0 $argv:q' - if 0; - -# $Id$ -# -*- perl -*- - -use lib '../../../../bin'; -use PerlACE::Run_Test; - -$status = 0; -$file = PerlACE::LocalFile ("server.ior"); - -unlink $file; - -if (PerlACE::is_vxworks_test()) { - $SV = new PerlACE::ProcessVX ("server", ""); -} -else { - $SV = new PerlACE::Process ("server", ""); -} -$CL = new PerlACE::Process ("client", "file://$file"); - -print STDERR "\n\n==== Running advanced slot test\n"; - -$SV->Spawn (); - -if (PerlACE::waitforfile_timed ($file, 15) == -1) { - print STDERR "ERROR: cannot find file <$file>\n"; - $SV->Kill (); - exit 1; -} - -$client = $CL->SpawnWaitKill (60); - -if ($client != 0) { - print STDERR "ERROR: client returned $client\n"; - $status = 1; -} - -$server = $SV->WaitKill (5); - -if ($server != 0) { - print STDERR "ERROR: server returned $server\n"; - $status = 1; -} - -unlink $file; - -exit $status; diff --git a/TAO/tests/Portable_Interceptors/AdvSlotExt/server.cpp b/TAO/tests/Portable_Interceptors/AdvSlotExt/server.cpp deleted file mode 100644 index 1a1256f6ad7..00000000000 --- a/TAO/tests/Portable_Interceptors/AdvSlotExt/server.cpp +++ /dev/null @@ -1,242 +0,0 @@ -// author : Boris Kolpackov <boris@kolpackov.net> -// cvs-id : $Id$ - -#include "tao/LocalObject.h" -#include "tao/ORBInitializer_Registry.h" - -#include "tao/PI/PI.h" -#include "tao/PI_Server/PI_Server.h" - -#include "ace/OS_NS_stdio.h" - -#include "StateTransferS.h" - -using namespace CORBA; -using namespace PortableServer; -using namespace PortableInterceptor; - -// -// -PortableInterceptor::SlotId slot_id; - - -// -// -class StateTransferImpl: public virtual POA_StateTransfer -{ -public: - StateTransferImpl (ORB_ptr orb) - : orb_ (ORB::_duplicate (orb)) - { - } - - virtual Short - number () throw (SystemException) - { - // Prepare state update. - // - Any state; - CORBA::Long number = 5; - state <<= number; - - Object_var obj (orb_->resolve_initial_references ("PICurrent")); - PortableInterceptor::Current_var pic ( - PortableInterceptor::Current::_narrow (obj.in ())); - - pic->set_slot (slot_id, state); - - return 1; - } - - virtual void - shutdown () throw (SystemException) - { - ACE_DEBUG ((LM_DEBUG, "Server is shutting down.\n")); - this->orb_->shutdown (0); - } - -private: - ORB_var orb_; -}; - - -// -// -class ReplicaController: public virtual ServerRequestInterceptor, - public virtual TAO_Local_RefCounted_Object -{ -public: - ReplicaController (PortableInterceptor::Current_ptr pi_current) - : pi_current_ (PortableInterceptor::Current::_duplicate (pi_current)) - { - } - - virtual char* - name () throw (SystemException) - { - return string_dup ("ReplicaController"); - } - - virtual void - destroy () throw (SystemException) - { - } - -#if TAO_HAS_EXTENDED_FT_INTERCEPTORS == 1 - virtual void - tao_ft_interception_point (ServerRequestInfo_ptr, OctetSeq_out) - throw (SystemException, ForwardRequest) - { - } -#endif /*TAO_HAS_EXTENDED_FT_INTERCEPTORS*/ - - virtual void - receive_request_service_contexts (ServerRequestInfo_ptr) - throw (SystemException, ForwardRequest) - { - } - - virtual void - receive_request (ServerRequestInfo_ptr ri) - throw (SystemException, ForwardRequest) - { - Any state; - CORBA::Long number = 5; - state <<= number; - - // After we have set things to TSC, change the value in RSC, at this - // moment no copy should be done anymore. - pi_current_->set_slot (slot_id, state); - CORBA::Long number6 = 6; - state <<= number6; - ri->set_slot (slot_id, state); - - Any_var state_get (pi_current_->get_slot (slot_id)); - CORBA::Long n (0); - state_get >>= n; - - if (n == 5) - ACE_DEBUG ((LM_DEBUG, "State value is correctly %d.\n", n)); - else - ACE_ERROR ((LM_ERROR, "ERROR: State value is incorrectly %d.\n", n)); - } - - virtual void - send_reply (ServerRequestInfo_ptr ri) throw (SystemException) - { - CORBA::String_var op = ri->operation (ACE_ENV_SINGLE_ARG_PARAMETER); - - if (ACE_OS::strcmp (op.in (), "number") != 0) - return; // Don't mess with PICurrent if not invoking test method. - - Any_var state (ri->get_slot (slot_id)); - CORBA::Long n (0); - state >>= n; - - if (n == 5) - ACE_DEBUG ((LM_DEBUG, "State value is correctly %d.\n", n)); - else - ACE_ERROR ((LM_ERROR, "ERROR: State value is incorrectly %d.\n", n)); - } - - virtual void - send_exception (ServerRequestInfo_ptr) - throw (SystemException, ForwardRequest) - { - } - - virtual void - send_other (ServerRequestInfo_ptr) throw (SystemException, ForwardRequest) - { - } - PortableInterceptor::Current_var pi_current_; -}; - - -// -// -class ORB_Initializer : public virtual ORBInitializer, - public virtual TAO_Local_RefCounted_Object -{ -public: - virtual void - pre_init (ORBInitInfo_ptr) throw (SystemException) - { - } - - virtual void - post_init (ORBInitInfo_ptr info) throw (SystemException) - { - slot_id = info->allocate_slot_id (); - ACE_DEBUG ((LM_DEBUG, "Allocated slot with id %d.\n", slot_id)); - - CORBA::Object_var obj = - info->resolve_initial_references ("PICurrent"); - - PortableInterceptor::Current_var pi_current = - PortableInterceptor::Current::_narrow (obj.in ()); - - if (CORBA::is_nil (pi_current.in ())) - { - ACE_ERROR ((LM_ERROR, - "(%P|%t) ERROR: Could not resolve PICurrent object.\n")); - - ACE_THROW (CORBA::INTERNAL ()); - } - - ServerRequestInterceptor_var interceptor (new ReplicaController (pi_current.in ())); - info->add_server_request_interceptor (interceptor.in ()); - } -}; - -int -main (int argc, char *argv[]) -{ - ORBInitializer_var orb_initializer (new ORB_Initializer ()); - register_orb_initializer (orb_initializer.in ()); - - ORB_var orb (ORB_init (argc, argv)); - - Object_var obj (orb->resolve_initial_references ("RootPOA")); - - POA_var root_poa (POA::_narrow (obj.in ())); - POAManager_var poa_manager (root_poa->the_POAManager ()); - - StateTransferImpl* impl = new StateTransferImpl (orb.in ()); - ServantBase_var impl_var (impl); - - StateTransfer_var ref (impl->_this ()); - String_var ior (orb->object_to_string (ref.in ())); - - poa_manager->activate (); - - - // Dump the ior. - // - FILE *output_file= ACE_OS::fopen ("server.ior", "w"); - if (output_file == 0) - { - ACE_ERROR_RETURN ((LM_ERROR, - "Cannot open output file <%s> for writing " - "IOR: %s", - ior.in ()), - 1); - } - - ACE_OS::fprintf (output_file, "%s", ior.in ()); - ACE_OS::fclose (output_file); - - ACE_DEBUG ((LM_DEBUG, "Server is ready, IOR is in 'server.ior'\n")); - - - // Run the ORB event loop. - // - orb->run (); - - root_poa->destroy (1, 1); - orb->destroy (); - - ACE_DEBUG ((LM_DEBUG, "Event loop finished.\n")); - - return 0; -} diff --git a/TAO/tests/Portable_Interceptors/Benchmark/.cvsignore b/TAO/tests/Portable_Interceptors/Benchmark/.cvsignore deleted file mode 100644 index f2ad85300eb..00000000000 --- a/TAO/tests/Portable_Interceptors/Benchmark/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -client -server diff --git a/TAO/tests/Portable_Interceptors/Benchmark/Client_ORBInitializer.cpp b/TAO/tests/Portable_Interceptors/Benchmark/Client_ORBInitializer.cpp deleted file mode 100644 index 4cad9dde31b..00000000000 --- a/TAO/tests/Portable_Interceptors/Benchmark/Client_ORBInitializer.cpp +++ /dev/null @@ -1,73 +0,0 @@ -// -*- C++ -*- -// -// $Id$ -// - -#include "Client_ORBInitializer.h" -#include "client_interceptors.h" -#include "Interceptor_Type.h" - -ACE_RCSID (Benchmark, Client_ORBInitializer, "$Id$") - -Client_ORBInitializer::Client_ORBInitializer (int interceptor_type) - : interceptor_type_ (interceptor_type) -{ -} - -void -Client_ORBInitializer::pre_init ( - PortableInterceptor::ORBInitInfo_ptr - ACE_ENV_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ -} - -void -Client_ORBInitializer::post_init ( - PortableInterceptor::ORBInitInfo_ptr info - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - - PortableInterceptor::ClientRequestInterceptor_ptr tmp = - PortableInterceptor::ClientRequestInterceptor::_nil (); - - switch (this->interceptor_type_) - { - default: - case IT_NONE: - return; - - case IT_NOOP: - { - // Installing the Vault interceptor - ACE_NEW_THROW_EX (tmp, - Vault_Client_Request_NOOP_Interceptor (), - CORBA::NO_MEMORY ()); - break; - } - case IT_CONTEXT: - { - // Installing the Vault interceptor - ACE_NEW_THROW_EX (tmp, - Vault_Client_Request_Context_Interceptor (), - CORBA::NO_MEMORY ()); - break; - } - case IT_DYNAMIC: - { - // Installing the Vault interceptor - ACE_NEW_THROW_EX (tmp, - Vault_Client_Request_Dynamic_Interceptor (), - CORBA::NO_MEMORY ()); - break; - } - } - ACE_CHECK; - - PortableInterceptor::ClientRequestInterceptor_var interceptor = tmp; - - info->add_client_request_interceptor (interceptor.in () - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; -} diff --git a/TAO/tests/Portable_Interceptors/Benchmark/Client_ORBInitializer.h b/TAO/tests/Portable_Interceptors/Benchmark/Client_ORBInitializer.h deleted file mode 100644 index f26c625ffbe..00000000000 --- a/TAO/tests/Portable_Interceptors/Benchmark/Client_ORBInitializer.h +++ /dev/null @@ -1,52 +0,0 @@ -// -*- C++ -*- -// -// $Id$ -// - -#ifndef TAO_CLIENT_ORB_INITIALIZER_H -#define TAO_CLIENT_ORB_INITIALIZER_H -#include /**/ "ace/pre.h" - -#include "tao/PI/PI.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "tao/LocalObject.h" - -// This is to remove "inherits via dominance" warnings from MSVC. -// MSVC is being a little too paranoid. -#if defined(_MSC_VER) -#pragma warning(push) -#pragma warning(disable:4250) -#endif /* _MSC_VER */ - -/// Client ORB initializer. -class Client_ORBInitializer : - public virtual PortableInterceptor::ORBInitializer, - public virtual TAO_Local_RefCounted_Object -{ -public: - /// Constructor - Client_ORBInitializer (int interceptor_type); - - virtual void pre_init (PortableInterceptor::ORBInitInfo_ptr info - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - virtual void post_init (PortableInterceptor::ORBInitInfo_ptr info - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - -private: - int interceptor_type_; - // The type of interceptor that this initializer will create -}; - -#if defined(_MSC_VER) -#pragma warning(pop) -#endif /* _MSC_VER */ - -#include /**/ "ace/post.h" -#endif /* TAO_CLIENT_ORB_INITIALIZER_H */ diff --git a/TAO/tests/Portable_Interceptors/Benchmark/Interceptor_Type.cpp b/TAO/tests/Portable_Interceptors/Benchmark/Interceptor_Type.cpp deleted file mode 100644 index 4d79250c2cb..00000000000 --- a/TAO/tests/Portable_Interceptors/Benchmark/Interceptor_Type.cpp +++ /dev/null @@ -1,29 +0,0 @@ -// -*- C++ -*- -// -// $Id$ -// - -#include "Interceptor_Type.h" -#include "ace/OS_String.h" - -ACE_RCSID (Benchmark, Interceptor_Type, "$Id$") - -void get_interceptor_type (int argc, char *argv[], - int &interceptor_type) -{ - interceptor_type = IT_NONE; - for (int i = 1; i < argc - 1; ++i) - { - if (ACE_OS_String::strcmp (argv[i], "-r") == 0) - { - if (ACE_OS_String::strcmp (argv[i+1], ACE_TEXT ("none")) == 0) - interceptor_type = IT_NONE; - if (ACE_OS_String::strcmp (argv[i+1], ACE_TEXT ("noop")) == 0) - interceptor_type = IT_NOOP; - if (ACE_OS_String::strcmp (argv[i+1], ACE_TEXT ("context")) == 0) - interceptor_type = IT_CONTEXT; - if (ACE_OS_String::strcmp (argv[i+1], ACE_TEXT ("dynamic")) == 0) - interceptor_type = IT_DYNAMIC; - } - } -} diff --git a/TAO/tests/Portable_Interceptors/Benchmark/Interceptor_Type.h b/TAO/tests/Portable_Interceptors/Benchmark/Interceptor_Type.h deleted file mode 100644 index aed618939fa..00000000000 --- a/TAO/tests/Portable_Interceptors/Benchmark/Interceptor_Type.h +++ /dev/null @@ -1,33 +0,0 @@ -// -*- C++ -*- -// -// $Id$ -// - -#ifndef TAO_INTERCEPTOR_TYPE_H -#define TAO_INTERCEPTOR_TYPE_H -#include /**/ "ace/pre.h" - -#include "ace/config-all.h" - -/// The different type of interceptors have different functionality -/// to perform. -enum Interceptor_Type -{ - /// Do not register an interceptor - IT_NONE, - - /// Does nothing on all interception points - IT_NOOP, - - /// Perform service context manipulation - IT_CONTEXT, - - /// Invoke dynamic interface methods and does extraction from anys. - IT_DYNAMIC -}; - -void get_interceptor_type (int argc, char *argv[], - int &interceptor_type); - -#include /**/ "ace/post.h" -#endif /* TAO_INTERCEPTOR_TYPE_H */ diff --git a/TAO/tests/Portable_Interceptors/Benchmark/PI_Benchmark.mpc b/TAO/tests/Portable_Interceptors/Benchmark/PI_Benchmark.mpc deleted file mode 100644 index 59737568104..00000000000 --- a/TAO/tests/Portable_Interceptors/Benchmark/PI_Benchmark.mpc +++ /dev/null @@ -1,26 +0,0 @@ -// -*- MPC -*- -// $Id$ - -project(*Server): taoserver, pi_server, interceptors { - Source_Files { - test_i.cpp - server_interceptors.cpp - marker.cpp - Server_ORBInitializer.cpp - Interceptor_Type.cpp - server.cpp - } -} - -project(*Client): taoclient, pi, interceptors { - after += *Server - Source_Files { - testC.cpp - client_interceptors.cpp - marker.cpp - Client_ORBInitializer.cpp - Interceptor_Type.cpp - client.cpp - } -} - diff --git a/TAO/tests/Portable_Interceptors/Benchmark/README b/TAO/tests/Portable_Interceptors/Benchmark/README deleted file mode 100644 index 17bd3d2d88d..00000000000 --- a/TAO/tests/Portable_Interceptors/Benchmark/README +++ /dev/null @@ -1,10 +0,0 @@ -# $Id$ - -This test allows you to visually check the correct invocation of -TAO's portable interceptors, especially the Dynamic interface. - - To run the test, try: - - server -o test.ior - - client diff --git a/TAO/tests/Portable_Interceptors/Benchmark/Server_ORBInitializer.cpp b/TAO/tests/Portable_Interceptors/Benchmark/Server_ORBInitializer.cpp deleted file mode 100644 index 5ab4c2336d5..00000000000 --- a/TAO/tests/Portable_Interceptors/Benchmark/Server_ORBInitializer.cpp +++ /dev/null @@ -1,75 +0,0 @@ -// -*- C++ -*- -// -// $Id$ -// - -#include "Server_ORBInitializer.h" -#include "Interceptor_Type.h" -#include "server_interceptors.h" - -ACE_RCSID (Benchmark, - Server_ORBInitializer, - "$Id$") - -Server_ORBInitializer::Server_ORBInitializer (int interceptor_type) - : interceptor_type_ (interceptor_type) -{ -} - -void -Server_ORBInitializer::pre_init ( - PortableInterceptor::ORBInitInfo_ptr - ACE_ENV_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ -} - -void -Server_ORBInitializer::post_init ( - PortableInterceptor::ORBInitInfo_ptr info - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - - PortableInterceptor::ServerRequestInterceptor_ptr tmp = - PortableInterceptor::ServerRequestInterceptor::_nil (); - - switch (this->interceptor_type_) - { - default: - case IT_NONE: - return; - - case IT_NOOP: - { - // Installing the Vault interceptor - ACE_NEW_THROW_EX (tmp, - Vault_Server_Request_NOOP_Interceptor (), - CORBA::NO_MEMORY ()); - break; - } - case IT_CONTEXT: - { - // Installing the Vault interceptor - ACE_NEW_THROW_EX (tmp, - Vault_Server_Request_Context_Interceptor (), - CORBA::NO_MEMORY ()); - break; - } - case IT_DYNAMIC: - { - // Installing the Vault interceptor - ACE_NEW_THROW_EX (tmp, - Vault_Server_Request_Dynamic_Interceptor (), - CORBA::NO_MEMORY ()); - break; - } - } - ACE_CHECK; - - PortableInterceptor::ServerRequestInterceptor_var interceptor = tmp; - - info->add_server_request_interceptor (interceptor.in () - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; -} diff --git a/TAO/tests/Portable_Interceptors/Benchmark/Server_ORBInitializer.h b/TAO/tests/Portable_Interceptors/Benchmark/Server_ORBInitializer.h deleted file mode 100644 index 599301a17d9..00000000000 --- a/TAO/tests/Portable_Interceptors/Benchmark/Server_ORBInitializer.h +++ /dev/null @@ -1,51 +0,0 @@ -// -*- C++ -*- -// -// $Id$ -// - -#ifndef TAO_SERVER_ORB_INITIALIZER_H -#define TAO_SERVER_ORB_INITIALIZER_H -#include /**/ "ace/pre.h" - -#include "tao/PI/PI.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "tao/LocalObject.h" - -// This is to remove "inherits via dominance" warnings from MSVC. -// MSVC is being a little too paranoid. -#if defined(_MSC_VER) -#pragma warning(push) -#pragma warning(disable:4250) -#endif /* _MSC_VER */ - -/// Server ORB initializer. -class Server_ORBInitializer : - public virtual PortableInterceptor::ORBInitializer, - public virtual TAO_Local_RefCounted_Object -{ -public: - /// Constructor - Server_ORBInitializer (int interceptor_type); - - virtual void pre_init (PortableInterceptor::ORBInitInfo_ptr info - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - virtual void post_init (PortableInterceptor::ORBInitInfo_ptr info - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - -private: - int interceptor_type_; -}; - -#if defined(_MSC_VER) -#pragma warning(pop) -#endif /* _MSC_VER */ - -#include /**/ "ace/post.h" -#endif /* TAO_SERVER_ORB_INITIALIZER_H */ diff --git a/TAO/tests/Portable_Interceptors/Benchmark/client.cpp b/TAO/tests/Portable_Interceptors/Benchmark/client.cpp deleted file mode 100644 index a874f7d3121..00000000000 --- a/TAO/tests/Portable_Interceptors/Benchmark/client.cpp +++ /dev/null @@ -1,244 +0,0 @@ -// $Id$ - -#include "testC.h" -#include "marker.h" -#include "Client_ORBInitializer.h" -#include "Interceptor_Type.h" - -#include "tao/debug.h" -#include "tao/ORBInitializer_Registry.h" - -#include "ace/Get_Opt.h" -#include "ace/OS_NS_errno.h" - -ACE_RCSID (Benchmark, - client, - "$Id$") - -const char *ior = "file://test.ior"; -int niterations = 5; -int register_interceptor = 1; - -int -parse_args (int argc, char *argv[]) -{ - ACE_Get_Opt get_opts (argc, argv, "ef:n:"); - int c; - - while ((c = get_opts ()) != -1) - switch (c) - { - case 'e': - break; - case 'f': - ior = get_opts.opt_arg (); - break; - case 'n': - niterations = ACE_OS::atoi (get_opts.opt_arg ()); - break; - case '?': - default: - ACE_ERROR_RETURN ((LM_ERROR, - "usage: %s " - "-v -r <register_interceptor> " - "\n", - argv [0]), - -1); - } - return 0; -} - - - -void -run_test (Test_Interceptors::Secure_Vault_ptr server - ACE_ENV_ARG_DECL) -{ - int i = 0; - const char user[] = "root"; - Marker marker; - ACE_Throughput_Stats throughput; - - ACE_DEBUG ((LM_DEBUG, "High res. timer calibration....")); - ACE_UINT32 gsf = ACE_High_Res_Timer::global_scale_factor (); - ACE_DEBUG ((LM_DEBUG, "done\n")); - - marker.accumulate_into (throughput, 1); - ACE_hrtime_t throughput_base = ACE_OS::gethrtime (); - for (i = 0; i < niterations ; ++i) - { - // Record current time. - ACE_hrtime_t latency_base = ACE_OS::gethrtime (); - - server->ready (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; - - // Grab timestamp again. - ACE_hrtime_t now = ACE_OS::gethrtime (); - - // Record statistics. - marker.sample (now - throughput_base, - now - latency_base, - 1); - - ACE_CHECK; - if (TAO_debug_level > 0 && i % 100 == 0) - ACE_DEBUG ((LM_DEBUG, "(%P|%t) iteration = %d\n", i)); - } - - marker.dump_stats ("Ready method ", gsf, 1); - - ACE_TRY - { - marker.accumulate_into (throughput, 2); - throughput_base = ACE_OS::gethrtime (); - - for (i = 0; i < niterations ; ++i) - { - // Record current time. - ACE_hrtime_t latency_base = ACE_OS::gethrtime (); - - server->authenticate (user ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - // Grab timestamp again. - ACE_hrtime_t now = ACE_OS::gethrtime (); - - // Record statistics. - marker.sample (now - throughput_base, - now - latency_base, - 2); - - if (TAO_debug_level > 0 && i % 100 == 0) - ACE_DEBUG ((LM_DEBUG, "(%P|%t) iteration = %d\n", i)); - } - marker.dump_stats ("Authenticate method ", gsf, 2); - } - ACE_CATCH (Test_Interceptors::Invalid, userex) - { - ACE_DEBUG ((LM_DEBUG, "Invalid user\n")); - } - ACE_ENDTRY; - ACE_CHECK; - - Test_Interceptors::Secure_Vault::Record record; - record.check_num = 1; - record.amount = 1000; - CORBA::Long id = 1; - - marker.accumulate_into (throughput, 3); - throughput_base = ACE_OS::gethrtime (); - - for (i = 0; i < niterations ; ++i) - { - // Record current time. - ACE_hrtime_t latency_base = ACE_OS::gethrtime (); - - server->update_records (id, - record - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - - // Grab timestamp again. - ACE_hrtime_t now = ACE_OS::gethrtime (); - - // Record statistics. - marker.sample (now - throughput_base, - now - latency_base, - 3); - - ACE_CHECK; - if (TAO_debug_level > 0 && i % 100 == 0) - ACE_DEBUG ((LM_DEBUG, "(%P|%t) iteration = %d\n", i)); - - } - - marker.dump_stats ("update records method ", gsf, 3); -} - - -int -main (int argc, char *argv[]) -{ - int priority = - (ACE_Sched_Params::priority_min (ACE_SCHED_FIFO) - + ACE_Sched_Params::priority_max (ACE_SCHED_FIFO)) / 2; - // Enable FIFO scheduling, e.g., RT scheduling class on Solaris. - - if (ACE_OS::sched_params (ACE_Sched_Params (ACE_SCHED_FIFO, - priority, - ACE_SCOPE_PROCESS)) != 0) - { - if (ACE_OS::last_error () == EPERM) - { - ACE_DEBUG ((LM_DEBUG, - "client (%P|%t): user is not superuser, " - "test runs in time-shared class\n")); - } - else - ACE_ERROR ((LM_ERROR, - "client (%P|%t): sched_params failed\n")); - } - - int interceptor_type; - get_interceptor_type (argc, argv, interceptor_type); - - ACE_TRY_NEW_ENV - { - PortableInterceptor::ORBInitializer_ptr temp_initializer; - - ACE_NEW_RETURN (temp_initializer, - Client_ORBInitializer (interceptor_type), - -1); // No exceptions yet! - PortableInterceptor::ORBInitializer_var initializer = - temp_initializer; - - PortableInterceptor::register_orb_initializer (initializer.in () - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - CORBA::ORB_var orb = - CORBA::ORB_init (argc, argv, "" ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - if (parse_args (argc, argv) != 0) - return 1; - - CORBA::Object_var object = - orb->string_to_object (ior ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - Test_Interceptors::Secure_Vault_var server = - Test_Interceptors::Secure_Vault::_narrow (object.in () - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - if (CORBA::is_nil (server.in ())) - { - ACE_ERROR_RETURN ((LM_ERROR, - "Object reference <%s> is nil\n", - ior), - 1); - } - - ACE_DEBUG ((LM_DEBUG, "\nFunctionality test begins now...\n")); - - // This test is useful for benchmarking the differences when - // the same method is intercepted by different interceptors - // wanting to achieve different functionality. - run_test (server.in () ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - server->shutdown (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - } - ACE_CATCHANY - { - ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, - "Caught exception:"); - return 1; - } - ACE_ENDTRY; - - return 0; -} diff --git a/TAO/tests/Portable_Interceptors/Benchmark/client_interceptors.cpp b/TAO/tests/Portable_Interceptors/Benchmark/client_interceptors.cpp deleted file mode 100644 index 0086a292ed7..00000000000 --- a/TAO/tests/Portable_Interceptors/Benchmark/client_interceptors.cpp +++ /dev/null @@ -1,495 +0,0 @@ -// $Id$ - -#include "client_interceptors.h" - -#include "tao/AnyTypeCode/DynamicC.h" -#include "tao/AnyTypeCode/TypeCode.h" -#include "ace/OS_NS_string.h" -#include "ace/Log_Msg.h" - -ACE_RCSID (Benchmark, - client_interceptors, - "$Id$") - -const CORBA::ULong request_ctx_id = 0xdead; -//const CORBA::ULong reply_ctx_id = 0xbeef; // Never used. - -Vault_Client_Request_Interceptor::Vault_Client_Request_Interceptor (void) - : myname_ ("Vault_Client_Interceptor") -{ -} - -Vault_Client_Request_Interceptor::~Vault_Client_Request_Interceptor () -{ -} - -char * -Vault_Client_Request_Interceptor::name (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - return CORBA::string_dup (this->myname_); -} - -void -Vault_Client_Request_Interceptor::destroy (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ -} - -void -Vault_Client_Request_Interceptor::send_poll ( - PortableInterceptor::ClientRequestInfo_ptr - ACE_ENV_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - // Do nothing -} - -void -Vault_Client_Request_Interceptor::send_request ( - PortableInterceptor::ClientRequestInfo_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) - { - // Make the context to send the context to the target. - IOP::ServiceContext sc; - sc.context_id = request_ctx_id; - - const char passwd[] = "root123"; - CORBA::ULong string_len = sizeof (passwd) + 1; - CORBA::Octet *buf = 0; - ACE_NEW (buf, - CORBA::Octet [string_len]); - ACE_OS::strcpy (reinterpret_cast<char *> (buf), passwd); - - sc.context_data.replace (string_len, string_len, buf, 1); - - // Add this context to the service context list. - ri->add_request_service_context (sc, 0 ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - } - - 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_Client_Request_Interceptor::receive_reply ( - PortableInterceptor::ClientRequestInfo_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_Client_Request_Interceptor::receive_other ( - PortableInterceptor::ClientRequestInfo_ptr - ACE_ENV_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableInterceptor::ForwardRequest)) -{ - // Do nothing -} - -void -Vault_Client_Request_Interceptor::receive_exception ( - PortableInterceptor::ClientRequestInfo_ptr ri - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableInterceptor::ForwardRequest)) -{ - - CORBA::Any_var any = ri->received_exception (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; - - CORBA::TypeCode_var tc = any->type (); - - const char *id = tc->id (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; - - CORBA::String_var exception_id = - ri->received_exception_id (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; - - if (ACE_OS::strcmp (id, exception_id.in ()) != 0) - ACE_ERROR ((LM_ERROR, - "Mismatched exception IDs: %s != %s\n", - id, - exception_id.in ())); -} - - -////////////////////////////////// Context ///////////////////////// - -Vault_Client_Request_Context_Interceptor::Vault_Client_Request_Context_Interceptor (void) - : myname_ ("Vault_Client_Context_Interceptor") -{ -} - -Vault_Client_Request_Context_Interceptor::~Vault_Client_Request_Context_Interceptor () -{ -} - -char * -Vault_Client_Request_Context_Interceptor::name ( - ACE_ENV_SINGLE_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - return CORBA::string_dup (this->myname_); -} - -void -Vault_Client_Request_Context_Interceptor::destroy ( - ACE_ENV_SINGLE_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ -} - -void -Vault_Client_Request_Context_Interceptor::send_poll ( - PortableInterceptor::ClientRequestInfo_ptr - ACE_ENV_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - // Do nothing -} - -void -Vault_Client_Request_Context_Interceptor::send_request ( - PortableInterceptor::ClientRequestInfo_ptr ri - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableInterceptor::ForwardRequest)) -{ - - // MAke the context to send the context to the target - IOP::ServiceContext sc; - sc.context_id = request_ctx_id; - - const char passwd[] = "root123"; - CORBA::ULong string_len = sizeof (passwd) + 1; - CORBA::Octet *buf = 0; - ACE_NEW_THROW_EX (buf, - CORBA::Octet [string_len], - CORBA::NO_MEMORY ()); - ACE_CHECK; - - ACE_OS::strcpy (reinterpret_cast<char *> (buf), passwd); - - sc.context_data.replace (string_len, string_len, buf, 1); - - // Add this context to the service context list. - ri->add_request_service_context (sc, 0 ACE_ENV_ARG_PARAMETER); - ACE_CHECK; -} - -void -Vault_Client_Request_Context_Interceptor::receive_other ( - PortableInterceptor::ClientRequestInfo_ptr - ACE_ENV_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableInterceptor::ForwardRequest)) -{ - // Do nothing -} - -void -Vault_Client_Request_Context_Interceptor::receive_reply ( - PortableInterceptor::ClientRequestInfo_ptr - ACE_ENV_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - -} - -void -Vault_Client_Request_Context_Interceptor::receive_exception ( - PortableInterceptor::ClientRequestInfo_ptr ri - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableInterceptor::ForwardRequest)) -{ - - CORBA::Any_var any = ri->received_exception (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; - - CORBA::TypeCode_var tc = any->type (); - - const char *id = tc->id (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; - - CORBA::String_var exception_id = - ri->received_exception_id (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; - - if (ACE_OS::strcmp (id, exception_id.in ()) != 0) - ACE_ERROR ((LM_ERROR, - "Mismatched exception IDs %s != %s\n", - id, - exception_id.in ())); -} - - -///////////////////////////////////Dynamic //////////////////////////////////// - -Vault_Client_Request_Dynamic_Interceptor::Vault_Client_Request_Dynamic_Interceptor (void) - : myname_ ("Vault_Client_Dynamic_Interceptor") -{ -} - -Vault_Client_Request_Dynamic_Interceptor::~Vault_Client_Request_Dynamic_Interceptor () -{ -} - -char * -Vault_Client_Request_Dynamic_Interceptor::name ( - ACE_ENV_SINGLE_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - return CORBA::string_dup (this->myname_); -} - -void -Vault_Client_Request_Dynamic_Interceptor::destroy ( - ACE_ENV_SINGLE_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ -} - -void -Vault_Client_Request_Dynamic_Interceptor::send_poll ( - PortableInterceptor::ClientRequestInfo_ptr - ACE_ENV_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - // Do nothing -} - -void -Vault_Client_Request_Dynamic_Interceptor::send_request ( - PortableInterceptor::ClientRequestInfo_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_Client_Request_Dynamic_Interceptor::receive_reply ( - PortableInterceptor::ClientRequestInfo_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_Client_Request_Dynamic_Interceptor::receive_other ( - PortableInterceptor::ClientRequestInfo_ptr - ACE_ENV_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableInterceptor::ForwardRequest)) -{ - // Do nothing -} - -void -Vault_Client_Request_Dynamic_Interceptor::receive_exception ( - PortableInterceptor::ClientRequestInfo_ptr ri - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableInterceptor::ForwardRequest)) -{ - - CORBA::Any_var any = ri->received_exception (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; - - CORBA::TypeCode_var tc = any->type (); - - const char *id = tc->id (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; - - CORBA::String_var exception_id = - ri->received_exception_id (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; - - if (ACE_OS::strcmp (id, exception_id.in ()) != 0) - ACE_ERROR ((LM_ERROR, - "Mismatched exception IDs %s != %s\n", - id, - exception_id.in ())); -} - - -//////////////////////////////NOOP/////////////////////////////////////// - -Vault_Client_Request_NOOP_Interceptor::Vault_Client_Request_NOOP_Interceptor (void) - : myname_ ("Vault_Client_NOOP_Interceptor") -{ -} - -Vault_Client_Request_NOOP_Interceptor::~Vault_Client_Request_NOOP_Interceptor () -{ -} - -char * -Vault_Client_Request_NOOP_Interceptor::name (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - return CORBA::string_dup (this->myname_); -} - -void -Vault_Client_Request_NOOP_Interceptor::destroy ( - ACE_ENV_SINGLE_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ -} - -void -Vault_Client_Request_NOOP_Interceptor::send_poll ( - PortableInterceptor::ClientRequestInfo_ptr - ACE_ENV_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - // Do nothing -} - -void -Vault_Client_Request_NOOP_Interceptor::send_request ( - PortableInterceptor::ClientRequestInfo_ptr - ACE_ENV_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableInterceptor::ForwardRequest)) -{ - -} - -void -Vault_Client_Request_NOOP_Interceptor::receive_other ( - PortableInterceptor::ClientRequestInfo_ptr - ACE_ENV_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableInterceptor::ForwardRequest)) -{ - // Do nothing -} - -void -Vault_Client_Request_NOOP_Interceptor::receive_reply ( - PortableInterceptor::ClientRequestInfo_ptr - ACE_ENV_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - -} - -void -Vault_Client_Request_NOOP_Interceptor::receive_exception ( - PortableInterceptor::ClientRequestInfo_ptr ri - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableInterceptor::ForwardRequest)) -{ - - CORBA::Any_var any = ri->received_exception (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; - - CORBA::TypeCode_var tc = any->type (); - - const char *id = tc->id (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; - - CORBA::String_var exception_id = - ri->received_exception_id (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; - - if (ACE_OS::strcmp (id, exception_id.in ()) != 0) - ACE_ERROR ((LM_ERROR, - "Mismatched exception IDs %s != %s\n", - id, - exception_id.in ())); -} - - diff --git a/TAO/tests/Portable_Interceptors/Benchmark/client_interceptors.h b/TAO/tests/Portable_Interceptors/Benchmark/client_interceptors.h deleted file mode 100644 index 75f8d621f40..00000000000 --- a/TAO/tests/Portable_Interceptors/Benchmark/client_interceptors.h +++ /dev/null @@ -1,207 +0,0 @@ -// -*- 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/marker.cpp b/TAO/tests/Portable_Interceptors/Benchmark/marker.cpp deleted file mode 100644 index dda5ff3c73b..00000000000 --- a/TAO/tests/Portable_Interceptors/Benchmark/marker.cpp +++ /dev/null @@ -1,69 +0,0 @@ -// $Id$ -#include "marker.h" - -void -Marker::accumulate_into (ACE_Throughput_Stats &throughput, - int which_method) const -{ - switch (which_method) - { - case 1: // method ready - throughput.accumulate (this->throughput_method_ready_); - break; - case 2: // method authenticate - throughput.accumulate (this->throughput_method_authenticate_); - break; - case 3: // method update_records - throughput.accumulate (this->throughput_method_update_records_); - break; - default: - break; - } - -} - -void -Marker::dump_stats (const char* msg, - ACE_UINT32 gsf, - int which_method) -{ - switch (which_method) - { - case 1: // method ready - this->throughput_method_ready_.dump_results (msg, gsf); - break; - case 2: // method authentciate - this->throughput_method_authenticate_.dump_results (msg, gsf); - break; - case 3: // method update_records - this->throughput_method_update_records_.dump_results (msg, gsf); - break; - default: - break; - } -} - -void -Marker::sample (ACE_hrtime_t throughput_diff, - ACE_hrtime_t latency_diff, - int which_method) -{ - switch (which_method) - { - case 1: // method ready - this->throughput_method_ready_.sample (throughput_diff, - latency_diff); - break; - case 2: // method authentciate - this->throughput_method_authenticate_.sample (throughput_diff, - latency_diff); - break; - case 3: // method update_records - this->throughput_method_update_records_.sample (throughput_diff, - latency_diff); - break; - default: - break; - } - -} diff --git a/TAO/tests/Portable_Interceptors/Benchmark/marker.h b/TAO/tests/Portable_Interceptors/Benchmark/marker.h deleted file mode 100644 index 8afb698337e..00000000000 --- a/TAO/tests/Portable_Interceptors/Benchmark/marker.h +++ /dev/null @@ -1,32 +0,0 @@ -// $Id$ - -#include "ace/High_Res_Timer.h" -#include "ace/Sched_Params.h" -#include "ace/Stats.h" - -class Marker -{ - public: - - void accumulate_into (ACE_Throughput_Stats &throughput, - int which_method) const; - // Accumulate the throughput statistics into <throughput> - - void dump_stats (const char* msg, - ACE_UINT32 gsf, - int which_method); - // Print stats - - void sample (ACE_hrtime_t throughput_diff, - ACE_hrtime_t latency_diff, - int which_method); - // get the sample. - - private: - ACE_Throughput_Stats throughput_method_ready_; - // Keep throughput statistics on a per-thread basis - ACE_Throughput_Stats throughput_method_authenticate_; - // Keep throughput statistics on a per-thread basis - ACE_Throughput_Stats throughput_method_update_records_; - // Keep throughput statistics on a per-thread basis -}; diff --git a/TAO/tests/Portable_Interceptors/Benchmark/run_test.pl b/TAO/tests/Portable_Interceptors/Benchmark/run_test.pl deleted file mode 100755 index 32b233a0ed9..00000000000 --- a/TAO/tests/Portable_Interceptors/Benchmark/run_test.pl +++ /dev/null @@ -1,45 +0,0 @@ -eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' - & eval 'exec perl -S $0 $argv:q' - if 0; - -# $Id$ -# -*- perl -*- - -use lib '../../../../bin'; -use PerlACE::Run_Test; - -$status = 0; -$file = PerlACE::LocalFile ("test.ior"); - -unlink $file; - -$SV = new PerlACE::Process ("server", "-ORBobjrefstyle url -o $file"); -$CL = new PerlACE::Process ("client", "-ORBobjrefstyle url -f file://$file"); - -print STDERR "\n\n==== Running interceptor Benchmark test\n"; - -$SV->Spawn (); - -if (PerlACE::waitforfile_timed ($file, 15) == -1) { - print STDERR "ERROR: cannot find file <$file>\n"; - $SV->Kill (); - exit 1; -} - -$client = $CL->SpawnWaitKill (60); - -if ($client != 0) { - print STDERR "ERROR: client returned $client\n"; - $status = 1; -} - -$server = $SV->WaitKill (5); - -if ($server != 0) { - print STDERR "ERROR: server returned $server\n"; - $status = 1; -} - -unlink $file; - -exit 0; diff --git a/TAO/tests/Portable_Interceptors/Benchmark/server.cpp b/TAO/tests/Portable_Interceptors/Benchmark/server.cpp deleted file mode 100644 index c556aed2940..00000000000 --- a/TAO/tests/Portable_Interceptors/Benchmark/server.cpp +++ /dev/null @@ -1,143 +0,0 @@ -// $Id$ - -#include "test_i.h" -#include "Server_ORBInitializer.h" -#include "Interceptor_Type.h" - -#include "tao/ORBInitializer_Registry.h" - -#include "ace/Get_Opt.h" -#include "ace/OS_NS_stdio.h" - -ACE_RCSID(Benchmark, server, "$Id$") - -const char *ior_output_file = "test.ior"; -int register_interceptor = 1; - -int -parse_args (int argc, char *argv[]) -{ - ACE_Get_Opt get_opts (argc, argv, "o:"); - int c; - - while ((c = get_opts ()) != -1) - switch (c) - { - case 'o': - ior_output_file = get_opts.opt_arg (); - break; - case '?': - default: - ACE_ERROR_RETURN ((LM_ERROR, - "usage: %s " - "-o <iorfile> -r <register_interceptor>" - "\n", - argv [0]), - -1); - } - // Indicates sucessful parsing of the command line - return 0; -} - -int -main (int argc, char *argv[]) -{ - int interceptor_type; - get_interceptor_type (argc, argv, interceptor_type); - - ACE_TRY_NEW_ENV - { - PortableInterceptor::ORBInitializer_ptr temp_initializer; - - ACE_NEW_RETURN (temp_initializer, - Server_ORBInitializer (interceptor_type), - -1); // No exceptions yet! - PortableInterceptor::ORBInitializer_var initializer = - temp_initializer; - - PortableInterceptor::register_orb_initializer (initializer.in () - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - CORBA::ORB_var orb = - CORBA::ORB_init (argc, argv, "" ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - if (parse_args (argc, argv) != 0) - return 1; - - CORBA::Object_var poa_object = - orb->resolve_initial_references("RootPOA" ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - if (CORBA::is_nil (poa_object.in ())) - ACE_ERROR_RETURN ((LM_ERROR, - " (%P|%t) Unable to initialize the POA.\n"), - 1); - - PortableServer::POA_var root_poa = - PortableServer::POA::_narrow (poa_object.in () ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - PortableServer::POAManager_var poa_manager = - root_poa->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - - poa_manager->activate (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - - Secure_Vault_i server_impl (orb.in ()); - - PortableServer::ObjectId_var id = - root_poa->activate_object (&server_impl - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - CORBA::Object_var test_obj = - root_poa->id_to_reference (id.in () - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - Test_Interceptors::Secure_Vault_var server = - Test_Interceptors::Secure_Vault::_narrow (test_obj.in () - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - CORBA::String_var ior = - orb->object_to_string (server.in () ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - ACE_DEBUG ((LM_DEBUG, - "Test_Interceptors::Secure_Vault: <%s>\n", - ior.in ())); - - // If the ior_output_file exists, output the ior to it - if (ior_output_file != 0) - { - FILE *output_file= ACE_OS::fopen (ior_output_file, "w"); - if (output_file == 0) - ACE_ERROR_RETURN ((LM_ERROR, - "Cannot open output file for writing IOR: %s", - ior_output_file), - 1); - ACE_OS::fprintf (output_file, "%s", ior.in ()); - ACE_OS::fclose (output_file); - } - - orb->run (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - - ACE_DEBUG ((LM_DEBUG, "event loop finished\n")); - - root_poa->destroy (1, 1 ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - } - ACE_CATCHANY - { - ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, - "Caught exception:"); - return 1; - } - ACE_ENDTRY; - - return 0; -} diff --git a/TAO/tests/Portable_Interceptors/Benchmark/server_interceptors.cpp b/TAO/tests/Portable_Interceptors/Benchmark/server_interceptors.cpp deleted file mode 100644 index a11b66691d3..00000000000 --- a/TAO/tests/Portable_Interceptors/Benchmark/server_interceptors.cpp +++ /dev/null @@ -1,405 +0,0 @@ -// $Id$ - -#include "server_interceptors.h" - -#include "tao/AnyTypeCode/DynamicC.h" -#include "tao/AnyTypeCode/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/server_interceptors.h b/TAO/tests/Portable_Interceptors/Benchmark/server_interceptors.h deleted file mode 100644 index 3adc2fe8424..00000000000 --- a/TAO/tests/Portable_Interceptors/Benchmark/server_interceptors.h +++ /dev/null @@ -1,215 +0,0 @@ -// -*- C++ -*- -// -// $Id$ - -#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" - -#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_Server_Request_Interceptor - : public virtual PortableInterceptor::ServerRequestInterceptor, - public virtual TAO_Local_RefCounted_Object -{ - // = Server-side Vault interceptor. For checking interceptor visually only. -public: - Vault_Server_Request_Interceptor (void); - // cotr. - ~Vault_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_; -}; - -class Vault_Server_Request_Context_Interceptor - : public virtual PortableInterceptor::ServerRequestInterceptor, - public virtual TAO_Local_RefCounted_Object -{ - // = Server-side Vault interceptor. For checking interceptor visually only. -public: - Vault_Server_Request_Context_Interceptor (void); - // cotr. - ~Vault_Server_Request_Context_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_; -}; - -class Vault_Server_Request_Dynamic_Interceptor - : public virtual PortableInterceptor::ServerRequestInterceptor, - public virtual TAO_Local_RefCounted_Object -{ - // = Server-side Vault interceptor. For checking interceptor visually only. -public: - Vault_Server_Request_Dynamic_Interceptor (void); - // cotr. - ~Vault_Server_Request_Dynamic_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_; -}; - -class Vault_Server_Request_NOOP_Interceptor - : public virtual PortableInterceptor::ServerRequestInterceptor, - public virtual TAO_Local_RefCounted_Object -{ - // = Server-side Vault interceptor. For checking interceptor visually only. -public: - Vault_Server_Request_NOOP_Interceptor (void); - // cotr. - ~Vault_Server_Request_NOOP_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 */ diff --git a/TAO/tests/Portable_Interceptors/Benchmark/test.idl b/TAO/tests/Portable_Interceptors/Benchmark/test.idl deleted file mode 100644 index 734ad8e5301..00000000000 --- a/TAO/tests/Portable_Interceptors/Benchmark/test.idl +++ /dev/null @@ -1,51 +0,0 @@ -// -*- IDL -*- -// -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// TAO/tests/Portable_Interceptors -// -// = FILENAME -// test.idl -// -// = DESCRIPTION -// Simple IDL file to test portable interceptor support. -// -// = AUTHORS -// Kirthika Parameswaran <kirthika@cs.wustl.edu> -// ============================================================================ - -module Test_Interceptors -{ - exception Invalid {}; - - interface Secure_Vault - { - // = TITLE - // A test idl for checking interceptor with the aim of - // performing benchmarks. - // - // = DESCRIPTION - // A secure vault into which one can store transaction details. - - struct Record - { - long check_num; - long amount; - }; - - short ready (); - // No args/exceptions operation. - - void authenticate (in string user) raises (Invalid); - // throws a user exception. - - long update_records (in long id, in Record val); - // Normal operation with a return val. - - oneway void shutdown (); - // shutdown the ORB - }; -}; diff --git a/TAO/tests/Portable_Interceptors/Benchmark/test_i.cpp b/TAO/tests/Portable_Interceptors/Benchmark/test_i.cpp deleted file mode 100644 index f94c81f5efd..00000000000 --- a/TAO/tests/Portable_Interceptors/Benchmark/test_i.cpp +++ /dev/null @@ -1,47 +0,0 @@ -// $Id$ - -#include "test_i.h" -#include "marker.h" -#include "ace/OS_NS_string.h" - -ACE_RCSID(Benchmark, test_i, "$Id$") - -Secure_Vault_i::Secure_Vault_i (CORBA::ORB_ptr orb) - : orb_ (CORBA::ORB::_duplicate (orb)) -{ -} -// ctor - -CORBA::Short -Secure_Vault_i::ready (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - return 1; -} - -void -Secure_Vault_i::authenticate (const char * user - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - Test_Interceptors::Invalid)) -{ - if (ACE_OS::strcmp (user, "root") != 0) - ACE_THROW (Test_Interceptors::Invalid ()); - -} - -CORBA::Long -Secure_Vault_i::update_records (CORBA::Long, - const Test_Interceptors::Secure_Vault::Record & - ACE_ENV_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ -return 1; -} - -void -Secure_Vault_i::shutdown (ACE_ENV_SINGLE_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - this->orb_->shutdown (0 ACE_ENV_ARG_PARAMETER); -} diff --git a/TAO/tests/Portable_Interceptors/Benchmark/test_i.h b/TAO/tests/Portable_Interceptors/Benchmark/test_i.h deleted file mode 100644 index 1e91333a22d..00000000000 --- a/TAO/tests/Portable_Interceptors/Benchmark/test_i.h +++ /dev/null @@ -1,52 +0,0 @@ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// TAO/tests/Portable_Interceptors/Benchmark -// -// = FILENAME -// test_i.h -// -// = AUTHOR -// Nanbor Wang -// -// ============================================================================ - -#ifndef TAO_INTERCEPTOR_TEST_I_H -#define TAO_INTERCEPTOR_TEST_I_H - -#include "testS.h" - -class Secure_Vault_i : public POA_Test_Interceptors::Secure_Vault -{ - // = DESCRIPTION - // Implements the Secure_Vault interface in test.idl - -public: - Secure_Vault_i (CORBA::ORB_ptr orb); - // ctor - - virtual CORBA::Short ready (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - virtual void authenticate (const char * user - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException, - Test_Interceptors::Invalid)); - // Passwd sent in the service context list - - virtual CORBA::Long update_records (CORBA::Long id, - const Test_Interceptors::Secure_Vault::Record & val - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - virtual void shutdown (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - private: - CORBA::ORB_var orb_; - // The ORB pointer (for shutdown.) -}; - -#endif /* TAO_INTERCEPTOR_TEST_I_H */ diff --git a/TAO/tests/Portable_Interceptors/Bug_1559/.cvsignore b/TAO/tests/Portable_Interceptors/Bug_1559/.cvsignore deleted file mode 100644 index f2ad85300eb..00000000000 --- a/TAO/tests/Portable_Interceptors/Bug_1559/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -client -server diff --git a/TAO/tests/Portable_Interceptors/Bug_1559/Bug_1559.mpc b/TAO/tests/Portable_Interceptors/Bug_1559/Bug_1559.mpc deleted file mode 100644 index 2e992878fcb..00000000000 --- a/TAO/tests/Portable_Interceptors/Bug_1559/Bug_1559.mpc +++ /dev/null @@ -1,22 +0,0 @@ -// -*- MPC -*- -// $Id$ - -project(*Server): taoserver, pi_server, interceptors { - Source_Files { - test_i.cpp - Server_ORBInitializer.cpp - server_interceptor.cpp - server.cpp - } -} - -project(*Client): taoclient, pi, interceptors { - after += *Server - Source_Files { - testC.cpp - Client_ORBInitializer.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 deleted file mode 100644 index fd053e810f0..00000000000 --- a/TAO/tests/Portable_Interceptors/Bug_1559/Client_ORBInitializer.cpp +++ /dev/null @@ -1,50 +0,0 @@ -// -*- C++ -*- -// -// $Id$ -// - -#include "Client_ORBInitializer.h" -#include "client_interceptor.h" - -ACE_RCSID (Service_Context_Manipulation, Client_ORBInitializer, "$Id$") - -Client_ORBInitializer::Client_ORBInitializer (void) -{ -} - -void -Client_ORBInitializer::pre_init ( - PortableInterceptor::ORBInitInfo_ptr - ACE_ENV_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ -} - -void -Client_ORBInitializer::post_init ( - PortableInterceptor::ORBInitInfo_ptr info - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - - CORBA::String_var orb_id = - info->orb_id (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; - - PortableInterceptor::ClientRequestInterceptor_ptr interceptor = - PortableInterceptor::ClientRequestInterceptor::_nil (); - - // Install the Echo client request interceptor - ACE_NEW_THROW_EX (interceptor, - Echo_Client_Request_Interceptor (orb_id.in ()), - CORBA::NO_MEMORY ()); - ACE_CHECK; - - PortableInterceptor::ClientRequestInterceptor_var - client_interceptor = interceptor; - - info->add_client_request_interceptor (client_interceptor.in () - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; -} - diff --git a/TAO/tests/Portable_Interceptors/Bug_1559/Client_ORBInitializer.h b/TAO/tests/Portable_Interceptors/Bug_1559/Client_ORBInitializer.h deleted file mode 100644 index 569419fb346..00000000000 --- a/TAO/tests/Portable_Interceptors/Bug_1559/Client_ORBInitializer.h +++ /dev/null @@ -1,48 +0,0 @@ -// -*- C++ -*- -// -// $Id$ -// - -#ifndef TAO_CLIENT_ORB_INITIALIZER_H -#define TAO_CLIENT_ORB_INITIALIZER_H -#include /**/ "ace/pre.h" - -#include "tao/PI/PI.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "tao/LocalObject.h" - -// This is to remove "inherits via dominance" warnings from MSVC. -// MSVC is being a little too paranoid. -#if defined(_MSC_VER) -#pragma warning(push) -#pragma warning(disable:4250) -#endif /* _MSC_VER */ - -/// Client ORB initializer. -class Client_ORBInitializer : - public virtual PortableInterceptor::ORBInitializer, - public virtual TAO_Local_RefCounted_Object -{ -public: - /// Constructor - Client_ORBInitializer (void); - - virtual void pre_init (PortableInterceptor::ORBInitInfo_ptr info - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - virtual void post_init (PortableInterceptor::ORBInitInfo_ptr info - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); -}; - -#if defined(_MSC_VER) -#pragma warning(pop) -#endif /* _MSC_VER */ - -#include /**/ "ace/post.h" -#endif /* TAO_CLIENT_ORB_INITIALIZER_H */ diff --git a/TAO/tests/Portable_Interceptors/Bug_1559/Server_ORBInitializer.cpp b/TAO/tests/Portable_Interceptors/Bug_1559/Server_ORBInitializer.cpp deleted file mode 100644 index b5590a28f3b..00000000000 --- a/TAO/tests/Portable_Interceptors/Bug_1559/Server_ORBInitializer.cpp +++ /dev/null @@ -1,49 +0,0 @@ -// -*- C++ -*- -// -// $Id$ -// - -#include "Server_ORBInitializer.h" - -ACE_RCSID (Bug_1559, - Server_ORBInitializer, - "$Id$") - -Server_ORBInitializer::Server_ORBInitializer (void) -{ -} - -void -Server_ORBInitializer::pre_init ( - PortableInterceptor::ORBInitInfo_ptr - ACE_ENV_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ -} - -void -Server_ORBInitializer::post_init ( - PortableInterceptor::ORBInitInfo_ptr info - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - // Install the Echo server request interceptor - ACE_NEW_THROW_EX (this->server_interceptor_, - Echo_Server_Request_Interceptor, - CORBA::NO_MEMORY ()); - ACE_CHECK; - - PortableInterceptor::ServerRequestInterceptor_var interceptor = - this->server_interceptor_; - - info->add_server_request_interceptor (interceptor.in () - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; -} - -Echo_Server_Request_Interceptor * -Server_ORBInitializer::server_interceptor (void) -{ - return this->server_interceptor_; -} - diff --git a/TAO/tests/Portable_Interceptors/Bug_1559/Server_ORBInitializer.h b/TAO/tests/Portable_Interceptors/Bug_1559/Server_ORBInitializer.h deleted file mode 100644 index 1cd2c636db6..00000000000 --- a/TAO/tests/Portable_Interceptors/Bug_1559/Server_ORBInitializer.h +++ /dev/null @@ -1,58 +0,0 @@ -// -*- C++ -*- -// -// $Id$ -// - -#ifndef TAO_SERVER_ORB_INITIALIZER_H -#define TAO_SERVER_ORB_INITIALIZER_H -#include /**/ "ace/pre.h" - -#include "tao/PI/PI.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "tao/LocalObject.h" -#include "server_interceptor.h" - -// This is to remove "inherits via dominance" warnings from MSVC. -// MSVC is being a little too paranoid. -#if defined(_MSC_VER) -#pragma warning(push) -#pragma warning(disable:4250) -#endif /* _MSC_VER */ - -/// Server ORB initializer. -class Server_ORBInitializer : - public virtual PortableInterceptor::ORBInitializer, - public virtual TAO_Local_RefCounted_Object -{ -public: - /// Constructor - Server_ORBInitializer (void); - - virtual void pre_init (PortableInterceptor::ORBInitInfo_ptr info - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - virtual void post_init (PortableInterceptor::ORBInitInfo_ptr info - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - /// Return the created server request interceptor. Only valid after - /// post_init(), i.e. ORB_init(), has been called. - Echo_Server_Request_Interceptor * server_interceptor (void); - -private: - /// Pointer to the server request interceptor. ORB is responsible - /// for storage. - Echo_Server_Request_Interceptor * server_interceptor_; -}; - -#if defined(_MSC_VER) -#pragma warning(pop) -#endif /* _MSC_VER */ - -#include /**/ "ace/post.h" -#endif /* TAO_SERVER_ORB_INITIALIZER_H */ diff --git a/TAO/tests/Portable_Interceptors/Bug_1559/client.cpp b/TAO/tests/Portable_Interceptors/Bug_1559/client.cpp deleted file mode 100644 index 09231faacf2..00000000000 --- a/TAO/tests/Portable_Interceptors/Bug_1559/client.cpp +++ /dev/null @@ -1,133 +0,0 @@ -// $Id$ - -#include "ace/Get_Opt.h" -#include "testC.h" -#include "Client_ORBInitializer.h" -#include "tao/ORBInitializer_Registry.h" - -ACE_RCSID(Interceptors, client, "$Id$") - -const char *ior = "file://test.ior"; - -int -parse_args (int argc, char *argv[]) -{ - ACE_Get_Opt get_opts (argc, argv, "ef:"); - int c; - - while ((c = get_opts ()) != -1) - switch (c) - { - case 'e': - break; - case 'f': - ior = get_opts.opt_arg (); - break; - case '?': - default: - ACE_ERROR_RETURN ((LM_ERROR, - "usage: %s " - "-v " - "\n", - argv [0]), - -1); - } - return 0; -} - -void -run_test (Test_Interceptors::Visual_ptr server - ACE_ENV_ARG_DECL) -{ - - server->normal (10 ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - - ACE_DEBUG ((LM_DEBUG, "\"normal\" operation done\n")); - - server->nothing (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; - - ACE_DEBUG ((LM_DEBUG, "\"nothing\" operation done\n")); - - ACE_TRY - { - server->user (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - } - ACE_CATCH (Test_Interceptors::Silly, userex) - { - ACE_DEBUG ((LM_DEBUG, "Caught Silly\n")); - } - ACE_ENDTRY; - ACE_CHECK; - - ACE_TRY_EX (SYS) - { - server->system (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK_EX (SYS); - } - ACE_CATCH (CORBA::INV_OBJREF, sysex) - { - ACE_DEBUG ((LM_DEBUG, "Caught CORBA::INV_OBJREF\n")); - } - ACE_ENDTRY; - ACE_CHECK; -} - -int -main (int argc, char *argv[]) -{ - ACE_TRY_NEW_ENV - { - PortableInterceptor::ORBInitializer_ptr temp_initializer; - - ACE_NEW_RETURN (temp_initializer, - Client_ORBInitializer, - -1); // No exceptions yet! - PortableInterceptor::ORBInitializer_var initializer = - temp_initializer; - - PortableInterceptor::register_orb_initializer (initializer.in () - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - CORBA::ORB_var orb = - CORBA::ORB_init (argc, argv, "" ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - if (parse_args (argc, argv) != 0) - return 1; - - CORBA::Object_var object = - orb->string_to_object (ior ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - Test_Interceptors::Visual_var server = - Test_Interceptors::Visual::_narrow (object.in () ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - if (CORBA::is_nil (server.in ())) - { - ACE_ERROR_RETURN ((LM_ERROR, - "Object reference <%s> is nil\n", - ior), - 1); - } - - run_test (server.in () ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - server->shutdown (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - } - ACE_CATCHANY - { - ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, - "Caught exception in client:"); - return 1; - } - ACE_ENDTRY; - - return 0; -} diff --git a/TAO/tests/Portable_Interceptors/Bug_1559/client_interceptor.cpp b/TAO/tests/Portable_Interceptors/Bug_1559/client_interceptor.cpp deleted file mode 100644 index a9ea659b832..00000000000 --- a/TAO/tests/Portable_Interceptors/Bug_1559/client_interceptor.cpp +++ /dev/null @@ -1,386 +0,0 @@ -// $Id$ - -#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 (Bug_1559, - client_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_Client_Request_Interceptor:: -Echo_Client_Request_Interceptor (const char *id) - : myname_ ("Echo_Client_Interceptor"), - orb_id_ (CORBA::string_dup (id)) -{ -} - -Echo_Client_Request_Interceptor::~Echo_Client_Request_Interceptor (void) -{ -} - -char * -Echo_Client_Request_Interceptor::name (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - return CORBA::string_dup (this->myname_); -} - -void -Echo_Client_Request_Interceptor::destroy (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ -} - -void -Echo_Client_Request_Interceptor::send_poll ( - PortableInterceptor::ClientRequestInfo_ptr - ACE_ENV_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - // Do Nothing -} - -void -Echo_Client_Request_Interceptor::send_request ( - PortableInterceptor::ClientRequestInfo_ptr ri - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableInterceptor::ForwardRequest)) -{ - if (CORBA::is_nil (this->orb_.in ())) - { - int argc = 0; - this->orb_ = CORBA::ORB_init (argc, 0, - this->orb_id_.in () - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - } - - CORBA::String_var operation = - ri->operation (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; - - CORBA::Object_var target = - ri->target (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; - - CORBA::String_var ior = - this->orb_->object_to_string (target.in () ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - - ACE_DEBUG ((LM_DEBUG, - "%s.send_request " - "from \"%s\" on object: %s\n", - this->myname_, - operation.in (), - ior.in ())); - - send_request_count++; - - ACE_TRY_NEW_ENV - { - ri->get_request_service_context (::service_id ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - } - ACE_CATCH (CORBA::BAD_PARAM, error) - { - // This is supposed to happen - exception_count++; - } - ACE_ENDTRY; - - if (send_request_count == 1) - { - if (exception_count != 1) - { - ACE_ERROR ((LM_ERROR, - "ERROR: Expected exception_count is <1>\n")); - } - ACE_ASSERT (exception_count == 1); - // Populate target member of the ClientRequestInfo. - - // Make the context to send the context to the target - IOP::ServiceContext sc; - sc.context_id = ::service_id; - - CORBA::ULong string_len = ACE_OS::strlen (request_msg) + 1; - CORBA::Octet *buf = CORBA::OctetSeq::allocbuf (string_len); - ACE_OS::strcpy (reinterpret_cast<char *> (buf), request_msg); - - sc.context_data.replace (string_len, string_len, buf, 1); - - // Add this context to the service context list. - ri->add_request_service_context (sc, 0 ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - - // Check that the request service context can be retrieved. - 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: Expected request service context to be: %s.\n" - " Got: %s\n", - request_msg, - buf2)); - } - } - else if (send_request_count == 2) - { - ACE_DEBUG ((LM_DEBUG, "Exception count: %i\n", exception_count)); - if (exception_count != 2) - { - ACE_ERROR ((LM_ERROR, - "ERROR: Expected exception_count is <2>\n")); - } - ACE_ASSERT (exception_count == 2); - // Populate target member of the ClientRequestInfo. - - // Make the context to send the context to the target - IOP::ServiceContext sc; - sc.context_id = ::service_id; - - CORBA::ULong string_len = ACE_OS::strlen (forward_msg) + 1; - CORBA::Octet *buf = CORBA::OctetSeq::allocbuf (string_len); - ACE_OS::strcpy (reinterpret_cast<char *> (buf), forward_msg); - - sc.context_data.replace (string_len, string_len, buf, 1); - // Add this context to the service context list. - ri->add_request_service_context (sc, 0 ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - - // Check that the request service context can be retrieved. - 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: Expected request service context to be: %s.\n" - " Got: %s\n", - forward_msg, - buf2)); - } - } - else - { - // Something's wrong - } - -} - -void -Echo_Client_Request_Interceptor::receive_reply ( - PortableInterceptor::ClientRequestInfo_ptr ri - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - - if (CORBA::is_nil (this->orb_.in ())) - { - int argc = 0; - this->orb_ = CORBA::ORB_init (argc, 0, - this->orb_id_.in () - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - } - - CORBA::String_var operation = - ri->operation (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; - - CORBA::Object_var target = - ri->target (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; - - CORBA::String_var ior = - this->orb_->object_to_string (target.in () ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - - ACE_DEBUG ((LM_DEBUG, - "%s.receive_reply from " - "\"%s\" on object: %s\n", - this->myname_, - operation.in (), - ior.in ())); - - // Check that the reply service context was received 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, - " Received reply service context: %s\n", - buf)); - - if (ACE_OS::strcmp (buf, reply_msg) != 0) - { - ACE_ERROR ((LM_ERROR, - "ERROR: Expected reply service context to be: %s\n", - reply_msg)); - } - - // Check that no one has messed with the request service context. - 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: Expected request service context to be: %s.\n" - " Got: %s\n", - forward_msg, - buf2)); - } - send_request_count = 0; - exception_count = 0; -} - -void -Echo_Client_Request_Interceptor::receive_other ( - PortableInterceptor::ClientRequestInfo_ptr ri - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableInterceptor::ForwardRequest)) -{ - if (CORBA::is_nil (this->orb_.in ())) - { - int argc = 0; - this->orb_ = CORBA::ORB_init (argc, 0, - this->orb_id_.in ()); - } - - CORBA::String_var operation = ri->operation (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; - - CORBA::Object_var target = ri->target (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; - - CORBA::String_var ior = - this->orb_->object_to_string (target.in () ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - - ACE_DEBUG ((LM_DEBUG, - "%s.receive_other from " - "\"%s\" on object: %s\n", - this->myname_, - operation.in (), - ior.in ())); - - // Check that no one has messed with the request service context. - 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: Expected request service context to be: %s.\n" - " Got: %s\n", - request_msg, - buf)); - } -} - -void -Echo_Client_Request_Interceptor::receive_exception ( - PortableInterceptor::ClientRequestInfo_ptr ri - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableInterceptor::ForwardRequest)) -{ - - if (CORBA::is_nil (this->orb_.in ())) - { - int argc = 0; - this->orb_ = CORBA::ORB_init (argc, 0, - this->orb_id_.in () - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - } - - CORBA::String_var operation = ri->operation (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; - - CORBA::Object_var target = ri->target (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; - - CORBA::String_var ior = - this->orb_->object_to_string (target.in () ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - - ACE_DEBUG ((LM_DEBUG, - "%s.received_exception " - "from \"%s\" on object: %s\n", - this->myname_, - operation.in (), - ior.in ())); - - // Check that the reply service context was received 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, - " Received reply service context: %s\n", - buf)); - - if (ACE_OS::strcmp (buf, reply_msg) != 0) - { - ACE_ERROR ((LM_ERROR, - "ERROR: Expected reply service context to be: %s\n", - reply_msg)); - } - - // Check that no one has messed with the request service context. - 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: Expected request service context to be: %s.\n" - " Got: %s\n", - forward_msg, - buf2)); - } - send_request_count = 0; - exception_count = 0; -} - diff --git a/TAO/tests/Portable_Interceptors/Bug_1559/client_interceptor.h b/TAO/tests/Portable_Interceptors/Bug_1559/client_interceptor.h deleted file mode 100644 index 2503a4b75b7..00000000000 --- a/TAO/tests/Portable_Interceptors/Bug_1559/client_interceptor.h +++ /dev/null @@ -1,78 +0,0 @@ -// -*- 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/run_test.pl b/TAO/tests/Portable_Interceptors/Bug_1559/run_test.pl deleted file mode 100755 index fa204e17d8c..00000000000 --- a/TAO/tests/Portable_Interceptors/Bug_1559/run_test.pl +++ /dev/null @@ -1,50 +0,0 @@ -eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' - & eval 'exec perl -S $0 $argv:q' - if 0; - -# $Id$ -# -*- perl -*- - -use lib '../../../../bin'; -use PerlACE::Run_Test; - -$status = 0; -$file = PerlACE::LocalFile ("test.ior"); - -unlink $file; - -if (PerlACE::is_vxworks_test()) { - $SV = new PerlACE::ProcessVX ("server", "-o test.ior"); -} -else { - $SV = new PerlACE::Process ("server", "-o $file"); -} -$CL = new PerlACE::Process ("client", "-f file://$file"); - -print STDERR "\n\n==== Running interceptor test\n"; - -$SV->Spawn (); - -if (PerlACE::waitforfile_timed ($file, 15) == -1) { - print STDERR "ERROR: cannot find file <$file>\n"; - $SV->Kill (); - exit 1; -} - -$client = $CL->SpawnWaitKill (60); - -if ($client != 0) { - print STDERR "ERROR: client returned $client\n"; - $status = 1; -} - -$server = $SV->WaitKill (5); - -if ($server != 0) { - print STDERR "ERROR: server returned $server\n"; - $status = 1; -} - -unlink $file; - -exit $status; diff --git a/TAO/tests/Portable_Interceptors/Bug_1559/server.cpp b/TAO/tests/Portable_Interceptors/Bug_1559/server.cpp deleted file mode 100644 index 35f0c3ada75..00000000000 --- a/TAO/tests/Portable_Interceptors/Bug_1559/server.cpp +++ /dev/null @@ -1,166 +0,0 @@ -// $Id$ - -#include "ace/Get_Opt.h" -#include "ace/OS_NS_stdio.h" -#include "test_i.h" -#include "Server_ORBInitializer.h" -#include "tao/ORBInitializer_Registry.h" - -ACE_RCSID (Service_Context_Manipulation, - server, - "$Id$") - -const char *ior_output_file = "test.ior"; - -int -parse_args (int argc, char *argv[]) -{ - ACE_Get_Opt get_opts (argc, argv, "o:"); - int c; - - while ((c = get_opts ()) != -1) - switch (c) - { - case 'o': - ior_output_file = get_opts.opt_arg (); - break; - case '?': - default: - ACE_ERROR_RETURN ((LM_ERROR, - "usage: %s " - "-o <iorfile>" - "\n", - argv [0]), - -1); - } - // Indicates sucessful parsing of the command line - return 0; -} - -int -main (int argc, char *argv[]) -{ - ACE_TRY_NEW_ENV - { - Server_ORBInitializer * temp_initializer = 0; - - ACE_NEW_RETURN (temp_initializer, - Server_ORBInitializer, - -1); // No exceptions yet! - PortableInterceptor::ORBInitializer_var initializer = - temp_initializer; - - PortableInterceptor::register_orb_initializer (initializer.in () - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - // Now we can create the ORB - CORBA::ORB_var orb = - CORBA::ORB_init (argc, argv, "" ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - CORBA::Object_var poa_object = - orb->resolve_initial_references ("RootPOA" ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - if (CORBA::is_nil (poa_object.in ())) - ACE_ERROR_RETURN ((LM_ERROR, - " (%P|%t) Unable to initialize the POA.\n"), - 1); - - PortableServer::POA_var root_poa = - PortableServer::POA::_narrow (poa_object.in () ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - PortableServer::POAManager_var poa_manager = - root_poa->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - - poa_manager->activate (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - - if (parse_args (argc, argv) != 0) - return 1; - - Visual_i server_impl (orb.in ()); - - PortableServer::ObjectId_var id = - root_poa->activate_object (&server_impl - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - // Create a second object to receive forwarded requests - Visual_i forward_server_impl (orb.in ()); - - PortableServer::ObjectId_var forward_id = - root_poa->activate_object (&forward_server_impl - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - CORBA::Object_var forward_test_obj = - root_poa->id_to_reference (forward_id.in () - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - Echo_Server_Request_Interceptor * server_interceptor = - temp_initializer->server_interceptor (); - - if (server_interceptor == 0) - ACE_ERROR_RETURN ((LM_ERROR, - "(%P|%t) Could not obtain reference to " - "server request interceptor.\n"), - -1); - - server_interceptor->forward_reference (forward_test_obj.in () - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - CORBA::Object_var test_obj = - root_poa->id_to_reference (id.in () - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - Test_Interceptors::Visual_var server = - Test_Interceptors::Visual::_narrow (test_obj.in () - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - CORBA::String_var ior = - orb->object_to_string (server.in () ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - ACE_DEBUG ((LM_DEBUG, - "Test_Interceptors::Visual: <%s>\n", - ior.in ())); - - // If the ior_output_file exists, output the ior to it - if (ior_output_file != 0) - { - FILE *output_file= ACE_OS::fopen (ior_output_file, "w"); - if (output_file == 0) - ACE_ERROR_RETURN ((LM_ERROR, - "Cannot open output file for writing IOR: %s", - ior_output_file), - 1); - ACE_OS::fprintf (output_file, "%s", ior.in ()); - ACE_OS::fclose (output_file); - } - - orb->run (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - - ACE_DEBUG ((LM_DEBUG, "event loop finished\n")); - - root_poa->destroy (1, 1 ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - } - ACE_CATCHANY - { - ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, - "Caught exception in server:"); - return 1; - } - ACE_ENDTRY; - - return 0; -} diff --git a/TAO/tests/Portable_Interceptors/Bug_1559/server_interceptor.cpp b/TAO/tests/Portable_Interceptors/Bug_1559/server_interceptor.cpp deleted file mode 100644 index 7739e548ed1..00000000000 --- a/TAO/tests/Portable_Interceptors/Bug_1559/server_interceptor.cpp +++ /dev/null @@ -1,286 +0,0 @@ -// $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/server_interceptor.h b/TAO/tests/Portable_Interceptors/Bug_1559/server_interceptor.h deleted file mode 100644 index 81924ce2902..00000000000 --- a/TAO/tests/Portable_Interceptors/Bug_1559/server_interceptor.h +++ /dev/null @@ -1,81 +0,0 @@ -// -*- 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 (CORBA::Object_ptr forward_location); - - ~Echo_Server_Request_Interceptor (); - // dotr. - - void forward_reference (CORBA::Object_ptr forward_location - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)); - - 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 ri - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableInterceptor::ForwardRequest)); - -private: - const char *myname_; - CORBA::Object_ptr forward_location_; -}; - -#if defined(_MSC_VER) -#pragma warning(pop) -#endif /* _MSC_VER */ - -#endif /* TAO_SERVER_INTERCEPTOR_H */ diff --git a/TAO/tests/Portable_Interceptors/Bug_1559/test.idl b/TAO/tests/Portable_Interceptors/Bug_1559/test.idl deleted file mode 100644 index 79a06a14351..00000000000 --- a/TAO/tests/Portable_Interceptors/Bug_1559/test.idl +++ /dev/null @@ -1,48 +0,0 @@ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// TAO/tests/Interceptors -// -// = FILENAME -// test.idl -// -// = DESCRIPTION -// Simple IDL file to test portable interceptor support. -// -// = AUTHORS -// Nanbor Wang <nanbor@cs.wustl.edu> -// -// ============================================================================ - -module Test_Interceptors -{ - exception Silly - {}; - - interface Visual - { - // = TITLE - // A test idl for checking interceptor visually. - // - // = DESCRIPTION - // - - void normal (in long arg); - // Normal operation. - - void nothing (); - // Normal operation without return. - - void user () - raises (Silly); - // throws a user exception. - - void system (); - // thows a system exception. - - oneway void shutdown (); - // shutdown the ORB - }; -}; diff --git a/TAO/tests/Portable_Interceptors/Bug_1559/test_i.cpp b/TAO/tests/Portable_Interceptors/Bug_1559/test_i.cpp deleted file mode 100644 index 503c7a5b423..00000000000 --- a/TAO/tests/Portable_Interceptors/Bug_1559/test_i.cpp +++ /dev/null @@ -1,53 +0,0 @@ -// $Id$ - -#include "test_i.h" - -ACE_RCSID (Service_Context_Manipulation, - test_i, - "$Id$") - - -Visual_i::Visual_i (CORBA::ORB_ptr orb) - : orb_ (CORBA::ORB::_duplicate (orb)) -{ -} - -void -Visual_i::normal (CORBA::Long arg - ACE_ENV_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - ACE_DEBUG ((LM_DEBUG, "Visual::normal called with %d\n", arg)); -} - -void -Visual_i::nothing (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - ACE_DEBUG ((LM_DEBUG, "Visual::nothing\n")); -} - -void -Visual_i::user (ACE_ENV_SINGLE_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - Test_Interceptors::Silly)) -{ - ACE_DEBUG ((LM_DEBUG, "Visual::user, throwing Silly\n")); - ACE_THROW (Test_Interceptors::Silly ()); -} - -void -Visual_i::system (ACE_ENV_SINGLE_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - ACE_DEBUG ((LM_DEBUG, "Visual::user, throwing INV_OBJREF\n")); - ACE_THROW (CORBA::INV_OBJREF ()); -} - -void -Visual_i::shutdown (ACE_ENV_SINGLE_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - this->orb_->shutdown (0 ACE_ENV_ARG_PARAMETER); - ACE_CHECK; -} diff --git a/TAO/tests/Portable_Interceptors/Bug_1559/test_i.h b/TAO/tests/Portable_Interceptors/Bug_1559/test_i.h deleted file mode 100644 index 5a6df58c457..00000000000 --- a/TAO/tests/Portable_Interceptors/Bug_1559/test_i.h +++ /dev/null @@ -1,55 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file test_i.h - * - * $Id$ - * - * @author Nanbor Wang - */ -//============================================================================= - - -#ifndef TAO_INTERCEPTOR_TEST_I_H -#define TAO_INTERCEPTOR_TEST_I_H - -#include "testS.h" - -/** - * @class Visual_i - * - * Implements the Visual interface in test.idl - */ -class Visual_i : public POA_Test_Interceptors::Visual -{ - -public: - - Visual_i (CORBA::ORB_ptr orb); - - void normal (CORBA::Long arg - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - void nothing (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - void user (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException, - Test_Interceptors::Silly)); - - void system (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - void shutdown (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - -private: - - /// The ORB pseudo-reference (for shutdown). - CORBA::ORB_var orb_; - -}; - -#endif /* TAO_INTERCEPTOR_TEST_I_H */ diff --git a/TAO/tests/Portable_Interceptors/Bug_2088/Bug_2088.mpc b/TAO/tests/Portable_Interceptors/Bug_2088/Bug_2088.mpc deleted file mode 100644 index 87022b449ba..00000000000 --- a/TAO/tests/Portable_Interceptors/Bug_2088/Bug_2088.mpc +++ /dev/null @@ -1,10 +0,0 @@ -// -*- MPC -*- -// $Id$ - -project(*Client): taoclient, pi, interceptors { - Source_Files { - Client_ORBInitializer.cpp - client.cpp - } -} - diff --git a/TAO/tests/Portable_Interceptors/Bug_2088/Client_ORBInitializer.cpp b/TAO/tests/Portable_Interceptors/Bug_2088/Client_ORBInitializer.cpp deleted file mode 100644 index db9719164d0..00000000000 --- a/TAO/tests/Portable_Interceptors/Bug_2088/Client_ORBInitializer.cpp +++ /dev/null @@ -1,37 +0,0 @@ -// -*- C++ -*- -// -// $Id$ -// - -#include "Client_ORBInitializer.h" - -ACE_RCSID (Bug_2088, Client_ORBInitializer, "$Id$") - -Client_ORBInitializer::Client_ORBInitializer (void) : - pre_init_called (false), - post_init_called (false) -{ -} - -void -Client_ORBInitializer::pre_init ( - PortableInterceptor::ORBInitInfo_ptr - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - pre_init_called = true; - - ACE_THROW (CORBA::NO_MEMORY ()); -} - -void -Client_ORBInitializer::post_init ( - PortableInterceptor::ORBInitInfo_ptr - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - post_init_called = true; - - ACE_THROW (CORBA::NO_MEMORY ()); -} - diff --git a/TAO/tests/Portable_Interceptors/Bug_2088/Client_ORBInitializer.h b/TAO/tests/Portable_Interceptors/Bug_2088/Client_ORBInitializer.h deleted file mode 100644 index 9e1d7b79009..00000000000 --- a/TAO/tests/Portable_Interceptors/Bug_2088/Client_ORBInitializer.h +++ /dev/null @@ -1,51 +0,0 @@ -// -*- C++ -*- -// -// $Id$ -// - -#ifndef TAO_CLIENT_ORB_INITIALIZER_H -#define TAO_CLIENT_ORB_INITIALIZER_H -#include /**/ "ace/pre.h" - -#include "tao/PI/PI.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "tao/LocalObject.h" - -// This is to remove "inherits via dominance" warnings from MSVC. -// MSVC is being a little too paranoid. -#if defined(_MSC_VER) -#pragma warning(push) -#pragma warning(disable:4250) -#endif /* _MSC_VER */ - -/// Client ORB initializer. -class Client_ORBInitializer : - public virtual PortableInterceptor::ORBInitializer, - public virtual TAO_Local_RefCounted_Object -{ -public: - /// Constructor - Client_ORBInitializer (void); - - virtual void pre_init (PortableInterceptor::ORBInitInfo_ptr info - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - virtual void post_init (PortableInterceptor::ORBInitInfo_ptr info - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - bool pre_init_called; - bool post_init_called; -}; - -#if defined(_MSC_VER) -#pragma warning(pop) -#endif /* _MSC_VER */ - -#include /**/ "ace/post.h" -#endif /* TAO_CLIENT_ORB_INITIALIZER_H */ diff --git a/TAO/tests/Portable_Interceptors/Bug_2088/client.cpp b/TAO/tests/Portable_Interceptors/Bug_2088/client.cpp deleted file mode 100644 index 2b3ff3f6fbb..00000000000 --- a/TAO/tests/Portable_Interceptors/Bug_2088/client.cpp +++ /dev/null @@ -1,67 +0,0 @@ -// $Id$ - -#include "ace/Get_Opt.h" -#include "Client_ORBInitializer.h" -#include "tao/ORBInitializer_Registry.h" - -ACE_RCSID(Interceptors, client, "$Id$") - -int -main (int argc, char *argv[]) -{ - Client_ORBInitializer* initializer1 = 0; - Client_ORBInitializer* initializer2 = 0; - bool caught_exception = false; - - ACE_NEW_RETURN (initializer1, - Client_ORBInitializer, - -1); // No exceptions yet! - - ACE_NEW_RETURN (initializer2, - Client_ORBInitializer, - -1); // No exceptions yet! - - PortableInterceptor::ORBInitializer_var initializer_var1 = - initializer1; - - PortableInterceptor::ORBInitializer_var initializer_var2 = - initializer2; - - ACE_TRY_NEW_ENV - { - PortableInterceptor::register_orb_initializer (initializer_var1.in () - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - PortableInterceptor::register_orb_initializer (initializer_var2.in () - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - CORBA::ORB_var orb = - CORBA::ORB_init (argc, argv, "" ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - } - ACE_CATCH (CORBA::NO_MEMORY, ex) - { - // Initializer1 throws this exception and we should get it here - caught_exception = true; - } - ACE_CATCHANY - { - ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, - "Caught exception in client:"); - return 1; - } - ACE_ENDTRY; - - // Only the pre init for initalizer 1 must be called, other initializers - // shouldn't be caught - ACE_ASSERT (initializer1->pre_init_called == true); - ACE_ASSERT (initializer2->pre_init_called == false); - ACE_ASSERT (initializer1->post_init_called == false); - ACE_ASSERT (initializer2->post_init_called == false); - ACE_ASSERT (caught_exception == true); - - return 0; -} diff --git a/TAO/tests/Portable_Interceptors/Bug_2088/run_test.pl b/TAO/tests/Portable_Interceptors/Bug_2088/run_test.pl deleted file mode 100755 index 6cbfb81a45c..00000000000 --- a/TAO/tests/Portable_Interceptors/Bug_2088/run_test.pl +++ /dev/null @@ -1,26 +0,0 @@ -eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' - & eval 'exec perl -S $0 $argv:q' - if 0; - -# $Id$ -# -*- perl -*- - -use lib '../../../../bin'; -use PerlACE::Run_Test; - -if (PerlACE::is_vxworks_test()) { - $CL = new PerlACE::ProcessVX ("client"); -} -else { - $CL = new PerlACE::Process ("client"); -} -print STDERR "\n==== Running bug 2088 test\n"; - -$client = $CL->SpawnWaitKill (5); - -if ($client != 0) { - print STDERR "ERROR: client returned $client\n"; - $status = 1; -} - -exit $status; diff --git a/TAO/tests/Portable_Interceptors/Bug_2510_Regression/Bug_2510_Regression.mpc b/TAO/tests/Portable_Interceptors/Bug_2510_Regression/Bug_2510_Regression.mpc deleted file mode 100644 index a49d6902aa6..00000000000 --- a/TAO/tests/Portable_Interceptors/Bug_2510_Regression/Bug_2510_Regression.mpc +++ /dev/null @@ -1,20 +0,0 @@ -// -*- MPC -*- -// $Id$ - -project(*Server): taoserver, pi_server, interceptors { - Source_Files { - test_i.cpp - server.cpp - } -} - -project(*Client): taoclient, pi, interceptors { - after += *Server - Source_Files { - testC.cpp - Client_ORBInitializer.cpp - client_interceptor.cpp - client.cpp - } -} - diff --git a/TAO/tests/Portable_Interceptors/Bug_2510_Regression/Client_ORBInitializer.cpp b/TAO/tests/Portable_Interceptors/Bug_2510_Regression/Client_ORBInitializer.cpp deleted file mode 100644 index acceb91568b..00000000000 --- a/TAO/tests/Portable_Interceptors/Bug_2510_Regression/Client_ORBInitializer.cpp +++ /dev/null @@ -1,49 +0,0 @@ -// -*- C++ -*- -// -// $Id$ -// - -#include "Client_ORBInitializer.h" -#include "client_interceptor.h" - -ACE_RCSID (Bug_2510_Regression, Client_ORBInitializer, "$Id$") - -Client_ORBInitializer::Client_ORBInitializer (void) -{ -} - -void -Client_ORBInitializer::pre_init ( - PortableInterceptor::ORBInitInfo_ptr - ACE_ENV_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ -} - -void -Client_ORBInitializer::post_init ( - PortableInterceptor::ORBInitInfo_ptr info - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - PortableInterceptor::SlotId slot_id = info->allocate_slot_id (); - - PortableInterceptor::ClientRequestInterceptor_ptr interceptor = - PortableInterceptor::ClientRequestInterceptor::_nil (); - - // Install the Echo client request interceptor - ACE_NEW_THROW_EX (interceptor, - Echo_Client_Request_Interceptor (), - CORBA::NO_MEMORY ()); - ACE_CHECK; - - PortableInterceptor::ClientRequestInterceptor_var - client_interceptor = interceptor; - - info->add_client_request_interceptor (client_interceptor.in () - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - - ACE_UNUSED_ARG (slot_id); -} - diff --git a/TAO/tests/Portable_Interceptors/Bug_2510_Regression/Client_ORBInitializer.h b/TAO/tests/Portable_Interceptors/Bug_2510_Regression/Client_ORBInitializer.h deleted file mode 100644 index 569419fb346..00000000000 --- a/TAO/tests/Portable_Interceptors/Bug_2510_Regression/Client_ORBInitializer.h +++ /dev/null @@ -1,48 +0,0 @@ -// -*- C++ -*- -// -// $Id$ -// - -#ifndef TAO_CLIENT_ORB_INITIALIZER_H -#define TAO_CLIENT_ORB_INITIALIZER_H -#include /**/ "ace/pre.h" - -#include "tao/PI/PI.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "tao/LocalObject.h" - -// This is to remove "inherits via dominance" warnings from MSVC. -// MSVC is being a little too paranoid. -#if defined(_MSC_VER) -#pragma warning(push) -#pragma warning(disable:4250) -#endif /* _MSC_VER */ - -/// Client ORB initializer. -class Client_ORBInitializer : - public virtual PortableInterceptor::ORBInitializer, - public virtual TAO_Local_RefCounted_Object -{ -public: - /// Constructor - Client_ORBInitializer (void); - - virtual void pre_init (PortableInterceptor::ORBInitInfo_ptr info - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - virtual void post_init (PortableInterceptor::ORBInitInfo_ptr info - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); -}; - -#if defined(_MSC_VER) -#pragma warning(pop) -#endif /* _MSC_VER */ - -#include /**/ "ace/post.h" -#endif /* TAO_CLIENT_ORB_INITIALIZER_H */ diff --git a/TAO/tests/Portable_Interceptors/Bug_2510_Regression/client.cpp b/TAO/tests/Portable_Interceptors/Bug_2510_Regression/client.cpp deleted file mode 100644 index 7e502f3bb75..00000000000 --- a/TAO/tests/Portable_Interceptors/Bug_2510_Regression/client.cpp +++ /dev/null @@ -1,117 +0,0 @@ -// $Id$ - -#include "ace/Get_Opt.h" -#include "ace/Synch.h" -#include "testC.h" -#include "Client_ORBInitializer.h" -#include "tao/ORBInitializer_Registry.h" - -ACE_RCSID(Bug_2510_Regression, client, "$Id$") - -const char *ior = "file://test.ior"; - -int -parse_args (int argc, char *argv[]) -{ - ACE_Get_Opt get_opts (argc, argv, "ef:"); - int c; - - while ((c = get_opts ()) != -1) - switch (c) - { - case 'e': - break; - case 'f': - ior = get_opts.opt_arg (); - break; - case '?': - default: - ACE_ERROR_RETURN ((LM_ERROR, - "usage: %s " - "-v " - "\n", - argv [0]), - -1); - } - return 0; -} - -static ACE_THR_FUNC_RETURN run_test(void* pData) -{ - Test_Interceptors::Visual_ptr server = static_cast<Test_Interceptors::Visual_ptr>(pData); - - server->normal (10 ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - - return (ACE_THR_FUNC_RETURN)0; -} - -int -main (int argc, char *argv[]) -{ - ACE_TRY_NEW_ENV - { - PortableInterceptor::ORBInitializer_ptr temp_initializer; - - ACE_NEW_RETURN (temp_initializer, - Client_ORBInitializer, - -1); // No exceptions yet! - PortableInterceptor::ORBInitializer_var initializer = - temp_initializer; - - PortableInterceptor::register_orb_initializer (initializer.in () - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - CORBA::ORB_var orb = - CORBA::ORB_init (argc, argv, "" ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - if (parse_args (argc, argv) != 0) - return 1; - - CORBA::Object_var object = - orb->string_to_object (ior ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - Test_Interceptors::Visual_var server = - Test_Interceptors::Visual::_narrow (object.in () ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - if (CORBA::is_nil (server.in ())) - { - ACE_ERROR_RETURN ((LM_ERROR, - "Object reference <%s> is nil\n", - ior), - 1); - } - - ACE_hthread_t threadHandle; - if ( ACE_Thread::spawn( run_test, - static_cast<void*>(server.in()), - THR_NEW_LWP | THR_JOINABLE , - 0, - & threadHandle - ) == -1 ) - { - ACE_ERROR_RETURN ((LM_ERROR,"Cannot start thread"), 1); - } - - ACE_Thread::join (threadHandle); - ACE_TRY_CHECK; - - server->shutdown (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - } - - ACE_CATCHANY - { - ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, - "Caught exception in client:"); - return 1; - } - - ACE_ENDTRY; - - return 0; -} diff --git a/TAO/tests/Portable_Interceptors/Bug_2510_Regression/client_interceptor.cpp b/TAO/tests/Portable_Interceptors/Bug_2510_Regression/client_interceptor.cpp deleted file mode 100644 index 8b6c9a89a5c..00000000000 --- a/TAO/tests/Portable_Interceptors/Bug_2510_Regression/client_interceptor.cpp +++ /dev/null @@ -1,116 +0,0 @@ -// $Id$ - -#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 (Bug_2510_Regression, - client_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"; - -Echo_Client_Request_Interceptor:: -Echo_Client_Request_Interceptor () - : myname_ ("Echo_Client_Interceptor") -{ -} - -Echo_Client_Request_Interceptor::~Echo_Client_Request_Interceptor (void) -{ -} - -char * -Echo_Client_Request_Interceptor::name (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - return CORBA::string_dup (this->myname_); -} - -void -Echo_Client_Request_Interceptor::destroy (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ -} - -void -Echo_Client_Request_Interceptor::send_poll ( - PortableInterceptor::ClientRequestInfo_ptr - ACE_ENV_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - // Do Nothing -} - -void -Echo_Client_Request_Interceptor::send_request ( - PortableInterceptor::ClientRequestInfo_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; - - CORBA::Object_var target = - ri->target (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; - - ACE_DEBUG ((LM_DEBUG,"%s.send_request from %s\n", this->myname_, operation.in ())); -} - -void -Echo_Client_Request_Interceptor::receive_reply ( - PortableInterceptor::ClientRequestInfo_ptr ri - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - CORBA::String_var operation = - ri->operation (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; - - CORBA::Object_var target = - ri->target (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; - - ACE_DEBUG ((LM_DEBUG,"%s.receive_reply from %s\n", this->myname_, operation.in ())); -} - -void -Echo_Client_Request_Interceptor::receive_other ( - PortableInterceptor::ClientRequestInfo_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; - - CORBA::Object_var target = ri->target (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; - - ACE_DEBUG ((LM_DEBUG,"%s.receive_other from %s\n", this->myname_, operation.in ())); -} - -void -Echo_Client_Request_Interceptor::receive_exception ( - PortableInterceptor::ClientRequestInfo_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; - - CORBA::Object_var target = ri->target (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; - - ACE_DEBUG ((LM_DEBUG,"%s.receive_exception from %s\n", this->myname_, operation.in ())); -} - diff --git a/TAO/tests/Portable_Interceptors/Bug_2510_Regression/client_interceptor.h b/TAO/tests/Portable_Interceptors/Bug_2510_Regression/client_interceptor.h deleted file mode 100644 index 95c3e21346f..00000000000 --- a/TAO/tests/Portable_Interceptors/Bug_2510_Regression/client_interceptor.h +++ /dev/null @@ -1,72 +0,0 @@ -// -*- 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 (); - // 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_; -}; - -#if defined(_MSC_VER) -#pragma warning(pop) -#endif /* _MSC_VER */ - -#endif /* TAO_CLIENT_INTERCEPTOR_H */ diff --git a/TAO/tests/Portable_Interceptors/Bug_2510_Regression/run_test.pl b/TAO/tests/Portable_Interceptors/Bug_2510_Regression/run_test.pl deleted file mode 100755 index fa204e17d8c..00000000000 --- a/TAO/tests/Portable_Interceptors/Bug_2510_Regression/run_test.pl +++ /dev/null @@ -1,50 +0,0 @@ -eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' - & eval 'exec perl -S $0 $argv:q' - if 0; - -# $Id$ -# -*- perl -*- - -use lib '../../../../bin'; -use PerlACE::Run_Test; - -$status = 0; -$file = PerlACE::LocalFile ("test.ior"); - -unlink $file; - -if (PerlACE::is_vxworks_test()) { - $SV = new PerlACE::ProcessVX ("server", "-o test.ior"); -} -else { - $SV = new PerlACE::Process ("server", "-o $file"); -} -$CL = new PerlACE::Process ("client", "-f file://$file"); - -print STDERR "\n\n==== Running interceptor test\n"; - -$SV->Spawn (); - -if (PerlACE::waitforfile_timed ($file, 15) == -1) { - print STDERR "ERROR: cannot find file <$file>\n"; - $SV->Kill (); - exit 1; -} - -$client = $CL->SpawnWaitKill (60); - -if ($client != 0) { - print STDERR "ERROR: client returned $client\n"; - $status = 1; -} - -$server = $SV->WaitKill (5); - -if ($server != 0) { - print STDERR "ERROR: server returned $server\n"; - $status = 1; -} - -unlink $file; - -exit $status; diff --git a/TAO/tests/Portable_Interceptors/Bug_2510_Regression/server.cpp b/TAO/tests/Portable_Interceptors/Bug_2510_Regression/server.cpp deleted file mode 100644 index 4043ed02514..00000000000 --- a/TAO/tests/Portable_Interceptors/Bug_2510_Regression/server.cpp +++ /dev/null @@ -1,127 +0,0 @@ -// $Id$ - -#include "ace/Get_Opt.h" -#include "ace/OS_NS_stdio.h" -#include "test_i.h" -#include "tao/ORBInitializer_Registry.h" - -ACE_RCSID (Bug_2510_Regression, - server, - "$Id$") - -const char *ior_output_file = "test.ior"; - -int -parse_args (int argc, char *argv[]) -{ - ACE_Get_Opt get_opts (argc, argv, "o:"); - int c; - - while ((c = get_opts ()) != -1) - switch (c) - { - case 'o': - ior_output_file = get_opts.opt_arg (); - break; - case '?': - default: - ACE_ERROR_RETURN ((LM_ERROR, - "usage: %s " - "-o <iorfile>" - "\n", - argv [0]), - -1); - } - // Indicates sucessful parsing of the command line - return 0; -} - -int -main (int argc, char *argv[]) -{ - ACE_TRY_NEW_ENV - { - // Now create an ORB - CORBA::ORB_var orb = - CORBA::ORB_init (argc, argv, "" ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - CORBA::Object_var poa_object = - orb->resolve_initial_references ("RootPOA" ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - if (CORBA::is_nil (poa_object.in ())) - ACE_ERROR_RETURN ((LM_ERROR, - " (%P|%t) Unable to initialize the POA.\n"), - 1); - - PortableServer::POA_var root_poa = - PortableServer::POA::_narrow (poa_object.in () ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - PortableServer::POAManager_var poa_manager = - root_poa->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - - poa_manager->activate (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - - if (parse_args (argc, argv) != 0) - return 1; - - Visual_i server_impl (orb.in ()); - - PortableServer::ObjectId_var id = - root_poa->activate_object (&server_impl - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - CORBA::Object_var test_obj = - root_poa->id_to_reference (id.in () - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - Test_Interceptors::Visual_var server = - Test_Interceptors::Visual::_narrow (test_obj.in () - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - CORBA::String_var ior = - orb->object_to_string (server.in () ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - ACE_DEBUG ((LM_DEBUG, - "Test_Interceptors::Visual: <%s>\n", - ior.in ())); - - // If the ior_output_file exists, output the ior to it - if (ior_output_file != 0) - { - FILE *output_file= ACE_OS::fopen (ior_output_file, "w"); - if (output_file == 0) - ACE_ERROR_RETURN ((LM_ERROR, - "Cannot open output file for writing IOR: %s", - ior_output_file), - 1); - ACE_OS::fprintf (output_file, "%s", ior.in ()); - ACE_OS::fclose (output_file); - } - - orb->run (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - - ACE_DEBUG ((LM_DEBUG, "event loop finished\n")); - - root_poa->destroy (1, 1 ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - } - ACE_CATCHANY - { - ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, - "Caught exception in server:"); - return 1; - } - ACE_ENDTRY; - - return 0; -} diff --git a/TAO/tests/Portable_Interceptors/Bug_2510_Regression/test.idl b/TAO/tests/Portable_Interceptors/Bug_2510_Regression/test.idl deleted file mode 100644 index d895106d35a..00000000000 --- a/TAO/tests/Portable_Interceptors/Bug_2510_Regression/test.idl +++ /dev/null @@ -1,32 +0,0 @@ -// $Id$ - -module Test_Interceptors -{ - exception Silly - {}; - - interface Visual - { - // = TITLE - // A test idl for checking interceptor visually. - // - // = DESCRIPTION - // - - void normal (in long arg); - // Normal operation. - - void nothing (); - // Normal operation without return. - - void user () - raises (Silly); - // throws a user exception. - - void system (); - // thows a system exception. - - oneway void shutdown (); - // shutdown the ORB - }; -}; diff --git a/TAO/tests/Portable_Interceptors/Bug_2510_Regression/test_i.cpp b/TAO/tests/Portable_Interceptors/Bug_2510_Regression/test_i.cpp deleted file mode 100644 index 39039d4e834..00000000000 --- a/TAO/tests/Portable_Interceptors/Bug_2510_Regression/test_i.cpp +++ /dev/null @@ -1,53 +0,0 @@ -// $Id$ - -#include "test_i.h" - -ACE_RCSID (Bug_2510_Regression, - test_i, - "$Id$") - - -Visual_i::Visual_i (CORBA::ORB_ptr orb) - : orb_ (CORBA::ORB::_duplicate (orb)) -{ -} - -void -Visual_i::normal (CORBA::Long arg - ACE_ENV_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - ACE_DEBUG ((LM_DEBUG, "Visual::normal called with %d\n", arg)); -} - -void -Visual_i::nothing (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - ACE_DEBUG ((LM_DEBUG, "Visual::nothing\n")); -} - -void -Visual_i::user (ACE_ENV_SINGLE_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - Test_Interceptors::Silly)) -{ - ACE_DEBUG ((LM_DEBUG, "Visual::user, throwing Silly\n")); - ACE_THROW (Test_Interceptors::Silly ()); -} - -void -Visual_i::system (ACE_ENV_SINGLE_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - ACE_DEBUG ((LM_DEBUG, "Visual::user, throwing INV_OBJREF\n")); - ACE_THROW (CORBA::INV_OBJREF ()); -} - -void -Visual_i::shutdown (ACE_ENV_SINGLE_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - this->orb_->shutdown (0 ACE_ENV_ARG_PARAMETER); - ACE_CHECK; -} diff --git a/TAO/tests/Portable_Interceptors/Bug_2510_Regression/test_i.h b/TAO/tests/Portable_Interceptors/Bug_2510_Regression/test_i.h deleted file mode 100644 index 5a6df58c457..00000000000 --- a/TAO/tests/Portable_Interceptors/Bug_2510_Regression/test_i.h +++ /dev/null @@ -1,55 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file test_i.h - * - * $Id$ - * - * @author Nanbor Wang - */ -//============================================================================= - - -#ifndef TAO_INTERCEPTOR_TEST_I_H -#define TAO_INTERCEPTOR_TEST_I_H - -#include "testS.h" - -/** - * @class Visual_i - * - * Implements the Visual interface in test.idl - */ -class Visual_i : public POA_Test_Interceptors::Visual -{ - -public: - - Visual_i (CORBA::ORB_ptr orb); - - void normal (CORBA::Long arg - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - void nothing (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - void user (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException, - Test_Interceptors::Silly)); - - void system (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - void shutdown (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - -private: - - /// The ORB pseudo-reference (for shutdown). - CORBA::ORB_var orb_; - -}; - -#endif /* TAO_INTERCEPTOR_TEST_I_H */ diff --git a/TAO/tests/Portable_Interceptors/Collocated/Dynamic/.cvsignore b/TAO/tests/Portable_Interceptors/Collocated/Dynamic/.cvsignore deleted file mode 100644 index 307259b4b57..00000000000 --- a/TAO/tests/Portable_Interceptors/Collocated/Dynamic/.cvsignore +++ /dev/null @@ -1 +0,0 @@ -Collocated_Test diff --git a/TAO/tests/Portable_Interceptors/Collocated/Dynamic/Client_Task.cpp b/TAO/tests/Portable_Interceptors/Collocated/Dynamic/Client_Task.cpp deleted file mode 100644 index aa829e678f1..00000000000 --- a/TAO/tests/Portable_Interceptors/Collocated/Dynamic/Client_Task.cpp +++ /dev/null @@ -1,98 +0,0 @@ -// -// $Id$ -// - -#include "Client_Task.h" -#include "testC.h" -#include "interceptors.h" - -ACE_RCSID(Muxing, Client_Task, "$Id$") - -Client_Task::Client_Task (const char *ior, - CORBA::ORB_ptr corb, - ACE_Thread_Manager *thr_mgr) - : ACE_Task_Base (thr_mgr) - , input_ (ior) - , corb_ (CORBA::ORB::_duplicate (corb)) - -{ -} - -int -Client_Task::svc (void) -{ - ACE_TRY_NEW_ENV - { - - CORBA::Object_var object = - corb_->string_to_object (input_ ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - Test_Interceptors::Visual_var server = - Test_Interceptors::Visual::_narrow (object.in () ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - if (CORBA::is_nil (server.in ())) - { - ACE_ERROR_RETURN ((LM_ERROR, - "Object reference <%s> is nil\n", - this->input_), - 1); - } - - run_test (server.in () ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - server->shutdown (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - } - ACE_CATCHANY - { - ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, - "Exception caught in client task:"); - return 1; - } - ACE_ENDTRY; - - return 0; - -} - - -void -Client_Task::run_test (Test_Interceptors::Visual_ptr server - ACE_ENV_ARG_DECL) -{ - server->normal (10 ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - - CORBA::Long one = 1, two = 1; - (void) server->calculate (one, - two - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - - ACE_TRY - { - (void) server->user (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - } - ACE_CATCH (Test_Interceptors::Silly, userex) - { - ACE_DEBUG ((LM_DEBUG, "Caught Silly\n")); - } - ACE_ENDTRY; - ACE_CHECK; - - ACE_TRY_EX (SYS) - { - server->system (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK_EX (SYS); - } - ACE_CATCH (CORBA::INV_OBJREF, sysex) - { - ACE_DEBUG ((LM_DEBUG, "Caught CORBA::INV_OBJREF\n")); - } - ACE_ENDTRY; - ACE_CHECK; -} diff --git a/TAO/tests/Portable_Interceptors/Collocated/Dynamic/Client_Task.h b/TAO/tests/Portable_Interceptors/Collocated/Dynamic/Client_Task.h deleted file mode 100644 index def1f6d2bb4..00000000000 --- a/TAO/tests/Portable_Interceptors/Collocated/Dynamic/Client_Task.h +++ /dev/null @@ -1,41 +0,0 @@ -// -// $Id$ -// - -#ifndef COLLOCATED_TEST_CLIENT_TASK_H -#define COLLOCATED_TEST_CLIENT_TASK_H -#include /**/ "ace/pre.h" - -#include "tao/ORB.h" -#include "ace/Task.h" -#include "testS.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -/// Implement a Task to run the client as a thread -class Client_Task : public ACE_Task_Base -{ -public: - - /// Constructor - Client_Task (const char *input, - CORBA::ORB_ptr corb, - ACE_Thread_Manager *thr_mgr); - - /// Thread entry point - int svc (void); - - void run_test (Test_Interceptors::Visual_ptr server - ACE_ENV_ARG_DECL); - -private: - const char *input_; - - CORBA::ORB_var corb_; - -}; - -#include /**/ "ace/post.h" -#endif /* COLLOCATED_TEST_CLIENT_TASK_H */ diff --git a/TAO/tests/Portable_Interceptors/Collocated/Dynamic/Collocated_Test.cpp b/TAO/tests/Portable_Interceptors/Collocated/Dynamic/Collocated_Test.cpp deleted file mode 100644 index 1aaceae2c8c..00000000000 --- a/TAO/tests/Portable_Interceptors/Collocated/Dynamic/Collocated_Test.cpp +++ /dev/null @@ -1,138 +0,0 @@ -//$Id$ - -#include "Server_Task.h" -#include "Client_Task.h" -#include "Echo_Collocated_ORBInitializer.h" -#include "interceptors.h" -#include "tao/ORBInitializer_Registry.h" -#include "ace/Get_Opt.h" -#include "ace/Argv_Type_Converter.h" -#include "ace/SString.h" -#include "ace/Manual_Event.h" - -const char *output = "test.ior"; -const char *input = "file://test.ior"; -ACE_CString server_orb; -ACE_CString client_orb; -int -parse_args (int argc, char *argv[]) -{ - ACE_Get_Opt get_opts (argc, argv, "k:o"); - int c; - - while ((c = get_opts ()) != -1) - switch (c) - { - case 'o': - output = get_opts.opt_arg (); - break; - case 'k': - input = get_opts.opt_arg (); - break; - case '?': - default: - // This is a hack but that is okay! - return 0; - } - // Indicates sucessful parsing of the command line - return 0; -} - -int -main (int argc, char *argv[]) -{ - if (parse_args (argc, - argv) == -1) - return -1; - - server_orb.set ("server_orb"); - client_orb.set ("client_orb"); - - ACE_DECLARE_NEW_CORBA_ENV; - ACE_TRY - { - PortableInterceptor::ORBInitializer_ptr temp_initializer = - PortableInterceptor::ORBInitializer::_nil (); - - ACE_NEW_RETURN (temp_initializer, - Echo_Collocated_ORBInitializer, - -1); // No exceptions yet! - PortableInterceptor::ORBInitializer_var orb_initializer = - temp_initializer; - - PortableInterceptor::register_orb_initializer (orb_initializer.in () - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - ACE_Argv_Type_Converter satc (argc, argv); - CORBA::ORB_var sorb = - CORBA::ORB_init (satc.get_argc (), - satc.get_TCHAR_argv (), - server_orb.c_str () - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - ACE_Manual_Event me; - Server_Task server_task (output, - sorb.in (), - me, - ACE_Thread_Manager::instance ()); - - if (server_task.activate (THR_NEW_LWP | THR_JOINABLE, - 1, - 1) == -1) - { - ACE_ERROR ((LM_ERROR, "Error activating server task\n")); - } - - // Wait for the server thread to do some processing - me.wait (); - - ACE_Argv_Type_Converter catc (argc, argv); - CORBA::ORB_var corb = - CORBA::ORB_init (catc.get_argc (), - catc.get_TCHAR_argv (), - client_orb.c_str () - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - Client_Task client_task (input, - corb.in (), - ACE_Thread_Manager::instance ()); - - if (client_task.activate (THR_NEW_LWP | THR_JOINABLE, - 1, - 1) == -1) - { - ACE_ERROR ((LM_ERROR, "Error activating client task\n")); - } - - ACE_Thread_Manager::instance ()->wait (); - - sorb->destroy (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - - CORBA::ULong number_called = - Echo_Server_Request_Interceptor::server_interceptor_check_; - - if (number_called != 10) - { - ACE_ERROR ((LM_ERROR, - "(%P|%t) ERROR: Server Side Interceptors not" - " called properly, called %d times, expected 10\n", - number_called)); - } - - if (Echo_Client_Request_Interceptor::client_interceptor_check_ != 10) - ACE_ERROR ((LM_ERROR, - "(%P|%t) ERROR:Client Interceptors not called" - " properly\n")); - - } - ACE_CATCHANY - { - // Ignore exceptions.. - } - ACE_ENDTRY; - return 0; -} diff --git a/TAO/tests/Portable_Interceptors/Collocated/Dynamic/Echo_Collocated_ORBInitializer.cpp b/TAO/tests/Portable_Interceptors/Collocated/Dynamic/Echo_Collocated_ORBInitializer.cpp deleted file mode 100644 index 879b3549b22..00000000000 --- a/TAO/tests/Portable_Interceptors/Collocated/Dynamic/Echo_Collocated_ORBInitializer.cpp +++ /dev/null @@ -1,69 +0,0 @@ -// -*- C++ -*- -// -// $Id$ - -#include "Echo_Collocated_ORBInitializer.h" -#include "interceptors.h" - -#include "ace/OS_NS_string.h" - -void -Echo_Collocated_ORBInitializer::pre_init ( - PortableInterceptor::ORBInitInfo_ptr - ACE_ENV_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ -} - -void -Echo_Collocated_ORBInitializer::post_init ( - PortableInterceptor::ORBInitInfo_ptr info - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - CORBA::String_var orb_id = - info->orb_id (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; - - if (!ACE_OS::strcmp (orb_id.in (), "client_orb")) - { - PortableInterceptor::ClientRequestInterceptor_ptr interceptor = - PortableInterceptor::ClientRequestInterceptor::_nil (); - - // Install the Echo client request interceptor - ACE_NEW_THROW_EX (interceptor, - Echo_Client_Request_Interceptor, - CORBA::NO_MEMORY ()); - ACE_CHECK; - - PortableInterceptor::ClientRequestInterceptor_var - client_interceptor = interceptor; - - info->add_client_request_interceptor (client_interceptor.in () - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - } - else if (!ACE_OS::strcmp (orb_id.in (), "server_orb")) - { - PortableInterceptor::ServerRequestInterceptor_ptr interceptor = - PortableInterceptor::ServerRequestInterceptor::_nil (); - - // Install the Echo server request interceptor - ACE_NEW_THROW_EX (interceptor, - Echo_Server_Request_Interceptor, - CORBA::NO_MEMORY ()); - ACE_CHECK; - - PortableInterceptor::ServerRequestInterceptor_var - server_interceptor = interceptor; - - info->add_server_request_interceptor (server_interceptor.in () - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - } - else - { - } - -} - diff --git a/TAO/tests/Portable_Interceptors/Collocated/Dynamic/Echo_Collocated_ORBInitializer.h b/TAO/tests/Portable_Interceptors/Collocated/Dynamic/Echo_Collocated_ORBInitializer.h deleted file mode 100644 index 7a18eb9b37a..00000000000 --- a/TAO/tests/Portable_Interceptors/Collocated/Dynamic/Echo_Collocated_ORBInitializer.h +++ /dev/null @@ -1,47 +0,0 @@ -// -*- C++ -*- -// -// $Id$ - -#ifndef TAO_ECHO_CLIENT_ORB_INITIALIZER_H -#define TAO_ECHO_CLIENT_ORB_INITIALIZER_H - -#include /**/ "ace/pre.h" -#include "tao/orbconf.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "tao/PI/PI.h" -#include "tao/LocalObject.h" - -// This is to remove "inherits via dominance" warnings from MSVC. -// MSVC is being a little too paranoid. -#if defined(_MSC_VER) -#pragma warning(push) -#pragma warning(disable:4250) -#endif /* _MSC_VER */ - -/// Echo client ORB initializer. -class Echo_Collocated_ORBInitializer : - public virtual PortableInterceptor::ORBInitializer, - public virtual TAO_Local_RefCounted_Object -{ -public: - - virtual void pre_init (PortableInterceptor::ORBInitInfo_ptr info - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - virtual void post_init (PortableInterceptor::ORBInitInfo_ptr info - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); -}; - -#if defined(_MSC_VER) -#pragma warning(pop) -#endif /* _MSC_VER */ - -#include /**/ "ace/post.h" - -#endif /* TAO_ECHO_CLIENT_ORB_INITIALIZER_H */ diff --git a/TAO/tests/Portable_Interceptors/Collocated/Dynamic/PI_Dynamic.mpc b/TAO/tests/Portable_Interceptors/Collocated/Dynamic/PI_Dynamic.mpc deleted file mode 100644 index e116424db27..00000000000 --- a/TAO/tests/Portable_Interceptors/Collocated/Dynamic/PI_Dynamic.mpc +++ /dev/null @@ -1,16 +0,0 @@ -// -*- MPC -*- -// $Id$ - -project(*Collocated): taoserver, pi, pi_server, interceptors { - exename = Collocated_Test - Source_Files { - testC.cpp - testS.cpp - test_i.cpp - interceptors.cpp - Echo_Collocated_ORBInitializer.cpp - Collocated_Test.cpp - Client_Task.cpp - Server_Task.cpp - } -} diff --git a/TAO/tests/Portable_Interceptors/Collocated/Dynamic/Server_Task.cpp b/TAO/tests/Portable_Interceptors/Collocated/Dynamic/Server_Task.cpp deleted file mode 100644 index a9db6a71b8a..00000000000 --- a/TAO/tests/Portable_Interceptors/Collocated/Dynamic/Server_Task.cpp +++ /dev/null @@ -1,109 +0,0 @@ -// -// $Id$ -// -#include "Server_Task.h" -#include "test_i.h" -#include "interceptors.h" - -#include "ace/Manual_Event.h" - -ACE_RCSID(Collocated_Test, - Server_Task, - "$Id$") - - -Server_Task::Server_Task (const char *output, - CORBA::ORB_ptr sorb, - ACE_Manual_Event &me, - ACE_Thread_Manager *thr_mgr) - : ACE_Task_Base (thr_mgr) - , output_ (output) - , me_ (me) - , sorb_ (CORBA::ORB::_duplicate (sorb)) -{ -} - -int -Server_Task::svc (void) -{ - ACE_TRY_NEW_ENV - { - - CORBA::Object_var poa_object = - sorb_->resolve_initial_references ("RootPOA" ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - if (CORBA::is_nil (poa_object.in ())) - ACE_ERROR_RETURN ((LM_ERROR, - " (%P|%t) Unable to initialize the POA.\n"), - 1); - - PortableServer::POA_var root_poa = - PortableServer::POA::_narrow (poa_object.in () ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - PortableServer::POAManager_var poa_manager = - root_poa->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - - poa_manager->activate (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - - Visual_i * server_impl = 0; - ACE_NEW_RETURN (server_impl, Visual_i (sorb_.in ()), 1); - - PortableServer::ObjectId_var id = - root_poa->activate_object (server_impl - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - CORBA::Object_var test_obj = - root_poa->id_to_reference (id.in () - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - Test_Interceptors::Visual_var server = - Test_Interceptors::Visual::_narrow (test_obj.in () - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - CORBA::String_var ior = - this->sorb_->object_to_string (server.in () ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - ACE_DEBUG ((LM_DEBUG, "Test_Interceptors::Visual: <%s>\n", ior.in ())); - - // If the ior_output_file exists, output the ior to it - if (output_ != 0) - { - FILE *output_file= ACE_OS::fopen (this->output_, "w"); - if (output_file == 0) - ACE_ERROR_RETURN ((LM_ERROR, - "Cannot open output file for writing IOR: %s", - this->output_), - 1); - ACE_OS::fprintf (output_file, "%s", ior.in ()); - ACE_OS::fclose (output_file); - } - - // Signal the main thread before we call orb->run (); - this->me_.signal (); - - this->sorb_->run (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - - ACE_DEBUG ((LM_DEBUG, "event loop finished\n")); - - root_poa->destroy (1, 1 ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - } - ACE_CATCHANY - { - ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, - "Exception caught in server task:"); - return 1; - } - ACE_ENDTRY; - - return 0; -} diff --git a/TAO/tests/Portable_Interceptors/Collocated/Dynamic/Server_Task.h b/TAO/tests/Portable_Interceptors/Collocated/Dynamic/Server_Task.h deleted file mode 100644 index 2101f9a9a15..00000000000 --- a/TAO/tests/Portable_Interceptors/Collocated/Dynamic/Server_Task.h +++ /dev/null @@ -1,48 +0,0 @@ -// -*- C++ -*- -// -// $Id$ - -#ifndef COLLOCATED_SERVER_TASK_H -#define COLLOCATED_SERVER_TASK_H - -#include /**/ "ace/pre.h" - -#include "tao/ORB.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/Task.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL -class ACE_Manual_Event; -ACE_END_VERSIONED_NAMESPACE_DECL - -/// Implement a Task to run the server in a single thread -class Server_Task : public ACE_Task_Base -{ -public: - /// Constructor - Server_Task (const char *output, - CORBA::ORB_ptr sorb, - ACE_Manual_Event &me, - ACE_Thread_Manager *thr_mgr); - - /// Thread entry point - int svc (void); - -private: - /// Output file for IOR - const char *output_; - - /// Manual event to wake up the main thread to create a client - /// thread. - ACE_Manual_Event &me_; - - CORBA::ORB_var sorb_; -}; - -#include /**/ "ace/post.h" - -#endif /* COLLOCATED_SERVER_TASK_H */ diff --git a/TAO/tests/Portable_Interceptors/Collocated/Dynamic/interceptors.cpp b/TAO/tests/Portable_Interceptors/Collocated/Dynamic/interceptors.cpp deleted file mode 100644 index 907a3e1193f..00000000000 --- a/TAO/tests/Portable_Interceptors/Collocated/Dynamic/interceptors.cpp +++ /dev/null @@ -1,371 +0,0 @@ -// $Id$ - -#include "interceptors.h" -#include "tao/AnyTypeCode/AnyTypeCode_Adapter_Impl.h" -#include "tao/AnyTypeCode/DynamicC.h" -#include "tao/AnyTypeCode/TypeCode.h" -#include "ace/Log_Msg.h" -#include "ace/OS_NS_string.h" - -ACE_RCSID (Dynamic, - interceptors, - "$Id$") - -const char *request_msg = "The Echo_Request_Interceptor request message"; -const char *reply_msg = "The Echo_Request_Interceptor reply message"; -CORBA::ULong Echo_Client_Request_Interceptor::client_interceptor_check_ = 0; -CORBA::ULong Echo_Server_Request_Interceptor::server_interceptor_check_ = 0; - -Echo_Client_Request_Interceptor::Echo_Client_Request_Interceptor (void) - : myname_ ("Echo_Client_Interceptor") -{ -} - -Echo_Client_Request_Interceptor::~Echo_Client_Request_Interceptor () -{ -} - -char * -Echo_Client_Request_Interceptor::name (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - return CORBA::string_dup (this->myname_); -} - -void -Echo_Client_Request_Interceptor::destroy (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ -} - -void -Echo_Client_Request_Interceptor::send_poll ( - PortableInterceptor::ClientRequestInfo_ptr - ACE_ENV_ARG_DECL_NOT_USED - ) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - // Do nothing -} - -void -Echo_Client_Request_Interceptor::send_request ( - PortableInterceptor::ClientRequestInfo_ptr ri - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableInterceptor::ForwardRequest)) -{ - client_interceptor_check_++; - - CORBA::String_var op = - ri->operation (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; - -#if 0 - ACE_DEBUG ((LM_DEBUG, - "Echo_Client_Request_Interceptor::send_request\n")); - - ACE_DEBUG ((LM_DEBUG, - "Echo_Client_Request_Interceptor::send_request from " - "\"%s\"\n", - op.in ())); - -#endif /*if 0*/ - - 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; - -#if 0 - ACE_DEBUG ((LM_DEBUG, - "The arg is %d\n", - param)); -#endif /*if 0*/ - } -} - -void -Echo_Client_Request_Interceptor::receive_other ( - PortableInterceptor::ClientRequestInfo_ptr ri - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableInterceptor::ForwardRequest)) -{ - client_interceptor_check_++; - - CORBA::String_var op = ri->operation (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; - -#if 0 - ACE_DEBUG ((LM_DEBUG, - "Echo_Client_Request_Interceptor::receive_other " - "from \"%s\"\n", - op.in ())); -#endif /*if 0*/ -} - -void -Echo_Client_Request_Interceptor::receive_reply ( - PortableInterceptor::ClientRequestInfo_ptr ri - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - client_interceptor_check_++; - - CORBA::String_var op = ri->operation (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; - -#if 0 - ACE_DEBUG ((LM_DEBUG, - "Echo_Client_Request_Interceptor::receive_reply " - "from \"%s\"\n", - op.in ())); -#endif /*if 0*/ - - 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; - - } - else 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; - 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; - -#if 0 - ACE_DEBUG ((LM_DEBUG, - "The result of calculate is %d + %d = %d\n", - param1, - param2, - result)); -#endif /*if 0*/ - } -} - -void -Echo_Client_Request_Interceptor::receive_exception ( - PortableInterceptor::ClientRequestInfo_ptr ri - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableInterceptor::ForwardRequest)) -{ - client_interceptor_check_++; - - CORBA::String_var op = ri->operation (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; - - CORBA::String_var exception_id = - ri->received_exception_id (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; - - ACE_DEBUG ((LM_DEBUG, - "Echo_Client_Request_Interceptor::received_exception " - "from \"%s\"\n", - op.in ())); - - ACE_DEBUG ((LM_DEBUG, - "Exception ID = %s\n", - 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)) -{ - ++server_interceptor_check_; - - CORBA::String_var op = ri->operation (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; - - PortableInterceptor::ObjectId_var test_oid = - ri->object_id (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)) -{ - ++server_interceptor_check_; - - 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)) -{ - ++server_interceptor_check_; - - 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)) -{ - ++server_interceptor_check_; - - // Do Nothing -} diff --git a/TAO/tests/Portable_Interceptors/Collocated/Dynamic/interceptors.h b/TAO/tests/Portable_Interceptors/Collocated/Dynamic/interceptors.h deleted file mode 100644 index 244270d4a37..00000000000 --- a/TAO/tests/Portable_Interceptors/Collocated/Dynamic/interceptors.h +++ /dev/null @@ -1,139 +0,0 @@ -// -*- C++ -*- -// -// $Id$ - -#ifndef TAO_INTERCEPTORS_H -#define TAO_INTERCEPTORS_H -#include /**/ "ace/pre.h" - -#include "tao/PI/PI.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "tao/PI_Server/PI_Server.h" -#include "tao/PortableInterceptorC.h" -#include "tao/LocalObject.h" - -#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 ~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_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)); - - // Some identifiers that are used for error checking - static CORBA::ULong client_interceptor_check_; -private: - const char *myname_; -}; - -class Echo_Server_Request_Interceptor - : public 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_service_contexts ( - PortableInterceptor::ServerRequestInfo_ptr - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC (( - CORBA::SystemException, - PortableInterceptor::ForwardRequest - )); - - virtual void receive_request (PortableInterceptor::ServerRequestInfo_ptr ri - 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 - )); - - // Some identifiers that are used for error checking - static CORBA::ULong server_interceptor_check_; - -private: - const char *myname_; -}; - -#if defined(_MSC_VER) -#pragma warning(pop) -#endif /* _MSC_VER */ - -#include /**/ "ace/post.h" -#endif /* TAO_INTERCEPTORS_H */ diff --git a/TAO/tests/Portable_Interceptors/Collocated/Dynamic/run_test.pl b/TAO/tests/Portable_Interceptors/Collocated/Dynamic/run_test.pl deleted file mode 100755 index 011ef650c65..00000000000 --- a/TAO/tests/Portable_Interceptors/Collocated/Dynamic/run_test.pl +++ /dev/null @@ -1,42 +0,0 @@ -eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' - & eval 'exec perl -S $0 $argv:q' - if 0; - -# $Id$ -# -*- perl -*- - -use lib '../../../../../bin'; -use PerlACE::Run_Test; - -$status = 0; -$file = PerlACE::LocalFile ("test.ior"); - -unlink $file; - -if (PerlACE::is_vxworks_test()) { - $SV = new PerlACE::ProcessVX ("Collocated_Test", "-ORBObjRefStyle url"); -} -else { - $SV = new PerlACE::Process ("Collocated_Test", "-ORBObjRefStyle url"); -} - -print STDERR "\n\n==== Running interceptor collocated Dynamic test\n"; - -$SV->Spawn (); - -if (PerlACE::waitforfile_timed ($file, 15) == -1) { - print STDERR "ERROR: cannot find file <$file>\n"; - $SV->Kill (); - exit 1; -} - -$collocated = $SV->WaitKill (5); - -if ($collocated != 0) { - print STDERR "ERROR: Collocated_Test returned $collocated\n"; - $status = 1; -} - -unlink $file; - -exit $status; diff --git a/TAO/tests/Portable_Interceptors/Collocated/Dynamic/test.idl b/TAO/tests/Portable_Interceptors/Collocated/Dynamic/test.idl deleted file mode 100644 index 8671f9b0a97..00000000000 --- a/TAO/tests/Portable_Interceptors/Collocated/Dynamic/test.idl +++ /dev/null @@ -1,42 +0,0 @@ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// TAO/tests/Portable_Interceptors -// -// = FILENAME -// test.idl -// -// = DESCRIPTION -// Simple IDL file to test portable interceptor support. -// -// = AUTHORS -// Nanbor Wang <nanbor@cs.wustl.edu> -// -// ============================================================================ - -module Test_Interceptors -{ - exception Silly - {}; - - interface Visual - { - /// Normal operation. - void normal (in long arg); - - /// Normal operation with a return val. - long calculate (in long one, in long two); - - /// throws a user exception. - void user () - raises (Silly); - - /// throws a system exception. - void system (); - - /// shutdown the ORB - oneway void shutdown (); - }; -}; diff --git a/TAO/tests/Portable_Interceptors/Collocated/Dynamic/test_i.cpp b/TAO/tests/Portable_Interceptors/Collocated/Dynamic/test_i.cpp deleted file mode 100644 index 949bea21eb6..00000000000 --- a/TAO/tests/Portable_Interceptors/Collocated/Dynamic/test_i.cpp +++ /dev/null @@ -1,60 +0,0 @@ -// $Id$ - -#include "test_i.h" -#include "ace/OS_NS_unistd.h" - -ACE_RCSID(Dynamic, test_i, "$Id$") - -Visual_i::Visual_i (CORBA::ORB_ptr orb) - : orb_ (CORBA::ORB::_duplicate (orb)) -{ -} - // ctor - -void -Visual_i::normal (CORBA::Long - ACE_ENV_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - // ACE_DEBUG ((LM_DEBUG, "Visual::normal called with %d\n", arg)); -} - -CORBA::Long -Visual_i::calculate (CORBA::Long one, - CORBA::Long two - ACE_ENV_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - // ACE_DEBUG ((LM_DEBUG, "Visual::calculate\n")); - return (one + two); -} - -void -Visual_i::user (ACE_ENV_SINGLE_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException,Test_Interceptors::Silly)) -{ - // ACE_DEBUG ((LM_DEBUG, "Visual::user, throwning Silly\n")); - ACE_THROW (Test_Interceptors::Silly ()); -} - -void -Visual_i::system (ACE_ENV_SINGLE_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - // ACE_DEBUG ((LM_DEBUG, "Visual::user, throwing INV_OBJREF\n")); - ACE_THROW (CORBA::INV_OBJREF ()); -} - -void -Visual_i::shutdown (ACE_ENV_SINGLE_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - this->_remove_ref (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; - - // Give the client thread time to return from the collocated - // call to this method before shutting down the ORB. We sleep - // to avoid BAD_INV_ORDER exceptions on fast dual processor machines. - ACE_OS::sleep (1); - this->orb_->shutdown (); -} diff --git a/TAO/tests/Portable_Interceptors/Collocated/Dynamic/test_i.h b/TAO/tests/Portable_Interceptors/Collocated/Dynamic/test_i.h deleted file mode 100644 index f31756fb10a..00000000000 --- a/TAO/tests/Portable_Interceptors/Collocated/Dynamic/test_i.h +++ /dev/null @@ -1,54 +0,0 @@ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// TAO/tests/Portable_Interceptors/Dynamic -// -// = FILENAME -// test_i.h -// -// = AUTHOR -// Nanbor Wang -// -// ============================================================================ - -#ifndef TAO_INTERCEPTOR_TEST_I_H -#define TAO_INTERCEPTOR_TEST_I_H - -#include "testS.h" - -class Visual_i : public POA_Test_Interceptors::Visual -{ - // = DESCRIPTION - // Implements the Visual interface in test.idl - -public: - Visual_i (CORBA::ORB_ptr orb); - // ctor - - void normal (CORBA::Long arg - ACE_ENV_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)); - - CORBA::Long calculate ( - CORBA::Long one, - CORBA::Long two - ACE_ENV_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)); - - void user (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException,Test_Interceptors::Silly)); - - void system (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)); - - void shutdown (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)); - -private: - CORBA::ORB_var orb_; - // The ORB pointer (for shutdown.) -}; - -#endif /* TAO_INTERCEPTOR_TEST_I_H */ diff --git a/TAO/tests/Portable_Interceptors/Collocated/Service_Context_Manipulation/.cvsignore b/TAO/tests/Portable_Interceptors/Collocated/Service_Context_Manipulation/.cvsignore deleted file mode 100644 index 9b04cc7c341..00000000000 --- a/TAO/tests/Portable_Interceptors/Collocated/Service_Context_Manipulation/.cvsignore +++ /dev/null @@ -1 +0,0 @@ -collocated diff --git a/TAO/tests/Portable_Interceptors/Collocated/Service_Context_Manipulation/Client_Task.cpp b/TAO/tests/Portable_Interceptors/Collocated/Service_Context_Manipulation/Client_Task.cpp deleted file mode 100644 index c068138c6b8..00000000000 --- a/TAO/tests/Portable_Interceptors/Collocated/Service_Context_Manipulation/Client_Task.cpp +++ /dev/null @@ -1,95 +0,0 @@ -// -// $Id$ -// - -#include "Client_Task.h" -#include "testC.h" - -ACE_RCSID(Muxing, Client_Task, "$Id$") - -Client_Task::Client_Task (const char *ior, - CORBA::ORB_ptr corb, - ACE_Thread_Manager *thr_mgr) - : ACE_Task_Base (thr_mgr) - , input_ (ior) - , corb_ (CORBA::ORB::_duplicate (corb)) - -{ -} - -int -Client_Task::svc (void) -{ - ACE_TRY_NEW_ENV - { - CORBA::Object_var obj = - this->corb_->string_to_object (input_ ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - Test_Interceptors::Visual_var server = - Test_Interceptors::Visual::_narrow (obj.in () ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - if (CORBA::is_nil (server.in ())) - { - ACE_ERROR_RETURN ((LM_ERROR, - "Object reference <%s> is nil\n", - input_), - 1); - } - - run_test (server.in () ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - server->shutdown (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - - this->corb_->destroy(); - ACE_TRY_CHECK; - } - ACE_CATCHANY - { - ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, - "Exception caught in client task:"); - return 1; - } - ACE_ENDTRY; - - return 0; -} - -void -Client_Task::run_test (Test_Interceptors::Visual_ptr server - ACE_ENV_ARG_DECL) -{ - server->normal (10 ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - - - server->nothing (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; - - ACE_TRY - { - server->user (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - } - ACE_CATCH (Test_Interceptors::Silly, userex) - { - ACE_DEBUG ((LM_DEBUG, "Caught Silly\n")); - } - ACE_ENDTRY; - ACE_CHECK; - - ACE_TRY_EX (SYS) - { - server->system (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK_EX (SYS); - } - ACE_CATCH (CORBA::INV_OBJREF, sysex) - { - ACE_DEBUG ((LM_DEBUG, "Caught CORBA::INV_OBJREF\n")); - } - ACE_ENDTRY; - ACE_CHECK; -} diff --git a/TAO/tests/Portable_Interceptors/Collocated/Service_Context_Manipulation/Client_Task.h b/TAO/tests/Portable_Interceptors/Collocated/Service_Context_Manipulation/Client_Task.h deleted file mode 100644 index 080096a550b..00000000000 --- a/TAO/tests/Portable_Interceptors/Collocated/Service_Context_Manipulation/Client_Task.h +++ /dev/null @@ -1,41 +0,0 @@ -// $Id$ -// - -#ifndef SERVICE_CONTEXT_MANIPULATION_COLLOCATED_CLIENT_TASK_H -#define SERVICE_CONTEXT_MANIPULATION_COLLOCATED_CLIENT_TASK_H -#include /**/ "ace/pre.h" -#include "ace/Task.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ -#include "tao/ORB.h" - -#include "testS.h" - - -/// Implement a Task to run the client as a thread -class Client_Task : public ACE_Task_Base -{ -public: - - /// Constructor - Client_Task (const char *input, - CORBA::ORB_ptr corb, - ACE_Thread_Manager *thr_mgr); - - /// Thread entry point - int svc (void); - - void run_test (Test_Interceptors::Visual_ptr server - ACE_ENV_ARG_DECL); - -private: - const char *input_; - - CORBA::ORB_var corb_; - -}; - -#include /**/ "ace/post.h" -#endif /* SERVICE_CONTEXT_MANIPULATION_COLLOCATED_CLIENT_TASK_H */ diff --git a/TAO/tests/Portable_Interceptors/Collocated/Service_Context_Manipulation/Collocated_ORBInitializer.cpp b/TAO/tests/Portable_Interceptors/Collocated/Service_Context_Manipulation/Collocated_ORBInitializer.cpp deleted file mode 100644 index b53c358a387..00000000000 --- a/TAO/tests/Portable_Interceptors/Collocated/Service_Context_Manipulation/Collocated_ORBInitializer.cpp +++ /dev/null @@ -1,72 +0,0 @@ -// $Id$ - -#include "Collocated_ORBInitializer.h" -#include "interceptors.h" -#include "ace/OS_NS_string.h" - -Collocated_ORBInitializer::Collocated_ORBInitializer (void) -{ -} - -void -Collocated_ORBInitializer::pre_init ( - PortableInterceptor::ORBInitInfo_ptr - ACE_ENV_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ -} - -void -Collocated_ORBInitializer::post_init ( - PortableInterceptor::ORBInitInfo_ptr info - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - - CORBA::String_var orb_id = - info->orb_id (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; - - if (!ACE_OS::strcmp (orb_id.in (), "client_orb")) - { - PortableInterceptor::ClientRequestInterceptor_ptr interceptor = - PortableInterceptor::ClientRequestInterceptor::_nil (); - - // Install the Echo client request interceptor - ACE_NEW_THROW_EX (interceptor, - Echo_Client_Request_Interceptor (orb_id.in ()), - CORBA::NO_MEMORY ()); - ACE_CHECK; - - PortableInterceptor::ClientRequestInterceptor_var - client_interceptor = interceptor; - - info->add_client_request_interceptor (client_interceptor.in () - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - } - - else if (!ACE_OS::strcmp (orb_id.in (), "server_orb")) - { - PortableInterceptor::ServerRequestInterceptor_ptr interceptor = - PortableInterceptor::ServerRequestInterceptor::_nil (); - - // Install the Echo server request interceptor - ACE_NEW_THROW_EX (interceptor, - Echo_Server_Request_Interceptor, - CORBA::NO_MEMORY ()); - ACE_CHECK; - - PortableInterceptor::ServerRequestInterceptor_var - server_interceptor = interceptor; - - info->add_server_request_interceptor (server_interceptor.in () - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - } - - else - { - //Throw exception? - } -} diff --git a/TAO/tests/Portable_Interceptors/Collocated/Service_Context_Manipulation/Collocated_ORBInitializer.h b/TAO/tests/Portable_Interceptors/Collocated/Service_Context_Manipulation/Collocated_ORBInitializer.h deleted file mode 100644 index 42b2ea926a4..00000000000 --- a/TAO/tests/Portable_Interceptors/Collocated/Service_Context_Manipulation/Collocated_ORBInitializer.h +++ /dev/null @@ -1,45 +0,0 @@ -// $Id$ - -#ifndef SERVICE_CONTEXT_MANIPULATION_COLLOCATED_ORBINITIALIZER_H -#define SERVICE_CONTEXT_MANIPULATION_COLLOCATED_ORBINITIALIZER_H -#include /**/ "ace/pre.h" - -#include "tao/PI/PI.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "tao/LocalObject.h" - -// This is to remove "inherits via dominance" warnings from MSVC. -// MSVC is being a little too paranoid. -#if defined(_MSC_VER) -#pragma warning(push) -#pragma warning(disable:4250) -#endif /* _MSC_VER */ - -/// Collocated ORB initializer. -class Collocated_ORBInitializer : - public virtual PortableInterceptor::ORBInitializer, - public virtual TAO_Local_RefCounted_Object -{ -public: - /// Constructor - Collocated_ORBInitializer (void); - - virtual void pre_init (PortableInterceptor::ORBInitInfo_ptr info - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - virtual void post_init (PortableInterceptor::ORBInitInfo_ptr info - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); -}; - -#if defined(_MSC_VER) -#pragma warning(pop) -#endif /* _MSC_VER */ - -#include /**/ "ace/post.h" -#endif /* SERVICE_CONTEXT_MANIPULATION_COLLOCATED_ORBINITIALIZER_H */ diff --git a/TAO/tests/Portable_Interceptors/Collocated/Service_Context_Manipulation/Collocated_Test.cpp b/TAO/tests/Portable_Interceptors/Collocated/Service_Context_Manipulation/Collocated_Test.cpp deleted file mode 100644 index 27644baab31..00000000000 --- a/TAO/tests/Portable_Interceptors/Collocated/Service_Context_Manipulation/Collocated_Test.cpp +++ /dev/null @@ -1,122 +0,0 @@ -//$Id$ - -#include "Server_Task.h" -#include "Client_Task.h" -#include "ace/Get_Opt.h" -#include "tao/ORBInitializer_Registry.h" -#include "ace/Argv_Type_Converter.h" -#include "ace/SString.h" -#include "ace/Manual_Event.h" -#include "test_i.h" -#include "interceptors.h" -#include "Collocated_ORBInitializer.h" - -const char *output = "test.ior"; -const char *input = "file://test.ior"; -ACE_CString server_orb; -ACE_CString client_orb; - -int -parse_args (int argc, char *argv[]) -{ - ACE_Get_Opt get_opts (argc, argv, "k:o"); - int c; - - while ((c = get_opts ()) != -1) - switch (c) - { - case 'o': - output = get_opts.opt_arg (); - break; - case 'k': - input = get_opts.opt_arg (); - break; - case '?': - default: - // This is a hack but that is okay! - return 0; - } - // Indicates sucessful parsing of the command line - return 0; -} - -int -main (int argc, char *argv[]) -{ - if (parse_args (argc, - argv) == -1) - return -1; - - server_orb.set ("server_orb"); - client_orb.set ("client_orb"); - - ACE_DECLARE_NEW_CORBA_ENV; - ACE_TRY - { - PortableInterceptor::ORBInitializer_ptr temp_initializer; - - ACE_NEW_RETURN (temp_initializer, - Collocated_ORBInitializer, - -1); // No exceptions yet! - PortableInterceptor::ORBInitializer_var initializer = - temp_initializer; - - PortableInterceptor::register_orb_initializer (initializer.in () - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - ACE_Argv_Type_Converter satc (argc, argv); - - CORBA::ORB_var sorb = - CORBA::ORB_init (satc.get_argc (), - satc.get_TCHAR_argv (), - server_orb.c_str () - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - ACE_Manual_Event me; - - Server_Task server_task (output, - sorb.in (), - me, - ACE_Thread_Manager::instance ()); - - if (server_task.activate (THR_NEW_LWP | THR_JOINABLE, - 1, - 1) == -1) - { - ACE_ERROR ((LM_ERROR, "Error activating server task\n")); - } - - // Wait for the server thread to do some processing - me.wait (); - - ACE_Argv_Type_Converter catc (argc, argv); - CORBA::ORB_var corb = - CORBA::ORB_init (catc.get_argc (), - catc.get_TCHAR_argv (), - client_orb.c_str () - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - Client_Task client_task (input, - corb.in (), - ACE_Thread_Manager::instance ()); - - if (client_task.activate (THR_NEW_LWP | THR_JOINABLE, - 1, - 1) == -1) - { - ACE_ERROR ((LM_ERROR, "Error activating client task\n")); - } - - ACE_Thread_Manager::instance ()->wait (); - } - ACE_CATCHANY - { - // Ignore exceptions.. - } - ACE_ENDTRY; - - return 0; -} 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 deleted file mode 100644 index fcf3dbabb25..00000000000 --- a/TAO/tests/Portable_Interceptors/Collocated/Service_Context_Manipulation/PI_Svc_Context_Manip.mpc +++ /dev/null @@ -1,16 +0,0 @@ -// -*- MPC -*- -// $Id$ - -project(*Collocated): taoserver, pi, pi_server, interceptors { - exename = collocated - Source_Files { - testC.cpp - testS.cpp - test_i.cpp - Collocated_ORBInitializer.cpp - interceptors.cpp - Client_Task.cpp - Server_Task.cpp - Collocated_Test.cpp - } -} diff --git a/TAO/tests/Portable_Interceptors/Collocated/Service_Context_Manipulation/Server_Task.cpp b/TAO/tests/Portable_Interceptors/Collocated/Service_Context_Manipulation/Server_Task.cpp deleted file mode 100644 index e25f9e30637..00000000000 --- a/TAO/tests/Portable_Interceptors/Collocated/Service_Context_Manipulation/Server_Task.cpp +++ /dev/null @@ -1,108 +0,0 @@ -// -// $Id$ -// -#include "Server_Task.h" -#include "test_i.h" -#include "ace/OS_NS_time.h" -#include "ace/Manual_Event.h" - -Server_Task::Server_Task (const char *output, - CORBA::ORB_ptr sorb, - ACE_Manual_Event &me, - ACE_Thread_Manager *thr_mgr) - : ACE_Task_Base (thr_mgr) - , output_ (output) - , me_ (me) - , sorb_ (CORBA::ORB::_duplicate (sorb)) -{ -} - -int -Server_Task::svc (void) -{ - ACE_TRY_NEW_ENV - { - CORBA::Object_var poa_object = - this->sorb_->resolve_initial_references("RootPOA" - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - PortableServer::POA_var root_poa = - PortableServer::POA::_narrow (poa_object.in () - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - if (CORBA::is_nil (root_poa.in ())) - ACE_ERROR_RETURN ((LM_ERROR, - " (%P|%t) Panic: nil RootPOA\n"), - 1); - - PortableServer::POAManager_var poa_manager = - root_poa->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - - poa_manager->activate (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - - Visual_i *vi = 0; - ACE_NEW_RETURN (vi, Visual_i (sorb_.in ()), 1); - PortableServer::ServantBase_var server_impl = vi; - - PortableServer::ObjectId_var id = - root_poa->activate_object (server_impl.in() - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - CORBA::Object_var test_obj = - root_poa->id_to_reference (id.in () - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - Test_Interceptors::Visual_var server = - Test_Interceptors::Visual::_narrow (test_obj.in () - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - CORBA::String_var ior = - sorb_->object_to_string (server.in () ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - // If the ior_output_file exists, output the ior to it - if (output_ != 0) - { - FILE *output_file= ACE_OS::fopen (output_, "w"); - if (output_file == 0) - ACE_ERROR_RETURN ((LM_ERROR, - "Cannot open output file for writing IOR: %s", - output_), - 1); - ACE_OS::fprintf (output_file, "%s", ior.in ()); - ACE_OS::fclose (output_file); - } - - // Signal the main thread before we call orb->run (); - this->me_.signal (); - - sorb_->run (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - - struct timespec ts = {0,250000000}; // quarter second - ACE_OS::nanosleep (&ts); - ACE_DEBUG ((LM_DEBUG, "(%P|%t) server task - event loop finished\n")); - - root_poa->destroy (1, 1 ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - this->sorb_->destroy (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - } - ACE_CATCHANY - { - ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, - "Exception caught in server task:"); - return 1; - } - ACE_ENDTRY; - - return 0; -} diff --git a/TAO/tests/Portable_Interceptors/Collocated/Service_Context_Manipulation/Server_Task.h b/TAO/tests/Portable_Interceptors/Collocated/Service_Context_Manipulation/Server_Task.h deleted file mode 100644 index e048b0f737d..00000000000 --- a/TAO/tests/Portable_Interceptors/Collocated/Service_Context_Manipulation/Server_Task.h +++ /dev/null @@ -1,46 +0,0 @@ -// $Id$ - -#ifndef SERVICE_CONTEXT_MANIPULATION_COLLOCATED_SERVER_TASK_H -#define SERVICE_CONTEXT_MANIPULATION_COLLOCATED_SERVER_TASK_H - -#include /**/ "ace/pre.h" - -#include "ace/Task.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "tao/ORB.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL -class ACE_Manual_Event; -ACE_END_VERSIONED_NAMESPACE_DECL - -/// Implement a Task to run the server in a single thread -class Server_Task : public ACE_Task_Base -{ -public: - /// Constructor - Server_Task (const char *output, - CORBA::ORB_ptr sorb, - ACE_Manual_Event &me, - ACE_Thread_Manager *thr_mgr); - - /// Thread entry point - int svc (void); - -private: - /// Output file for IOR - const char *output_; - - /// Manual event to wake up the main thread to create a client - /// thread. - ACE_Manual_Event &me_; - - CORBA::ORB_var sorb_; -}; - -#include /**/ "ace/post.h" - -#endif /* SERVICE_CONTEXT_MANIPULATION_COLLOCATED_SERVER_TASK_H */ diff --git a/TAO/tests/Portable_Interceptors/Collocated/Service_Context_Manipulation/interceptors.cpp b/TAO/tests/Portable_Interceptors/Collocated/Service_Context_Manipulation/interceptors.cpp deleted file mode 100644 index 58260168b5e..00000000000 --- a/TAO/tests/Portable_Interceptors/Collocated/Service_Context_Manipulation/interceptors.cpp +++ /dev/null @@ -1,492 +0,0 @@ -// $Id$ - -#include "interceptors.h" -#include "tao/OctetSeqC.h" -#include "ace/Log_Msg.h" -#include "ace/OS_NS_string.h" - -ACE_RCSID (Service_Context_Manipulation, - interceptors, - "$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_Client_Request_Interceptor:: -Echo_Client_Request_Interceptor (const char *id) - : myname_ ("Echo_Client_Interceptor"), - orb_id_ (CORBA::string_dup (id)) -{ -} - -Echo_Client_Request_Interceptor::~Echo_Client_Request_Interceptor (void) -{ -} - -char * -Echo_Client_Request_Interceptor::name (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - return CORBA::string_dup (this->myname_); -} - -void -Echo_Client_Request_Interceptor::destroy (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ -} - -void -Echo_Client_Request_Interceptor::send_poll ( - PortableInterceptor::ClientRequestInfo_ptr - ACE_ENV_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - // Do Nothing -} - -void -Echo_Client_Request_Interceptor::send_request ( - PortableInterceptor::ClientRequestInfo_ptr ri - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableInterceptor::ForwardRequest)) -{ - - if (CORBA::is_nil (this->orb_.in ())) - { - int argc = 0; - this->orb_ = CORBA::ORB_init (argc, 0, - this->orb_id_.in () - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - } - - CORBA::String_var operation = - ri->operation (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; - - CORBA::Object_var target = ri->target (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; - - CORBA::String_var ior = - this->orb_->object_to_string (target.in () ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - - ACE_DEBUG ((LM_DEBUG, - "%s.send_request " - "from \"%s\"\n", - this->myname_, - operation.in ())); - - // Populate target member of the ClientRequestInfo. - - // Make the context to send the context to the target - IOP::ServiceContext sc; - sc.context_id = ::service_id; - - CORBA::ULong string_len = ACE_OS::strlen (request_msg) + 1; - CORBA::Octet *buf = CORBA::OctetSeq::allocbuf (string_len); - ACE_OS::strcpy (reinterpret_cast<char *> (buf), request_msg); - - sc.context_data.replace (string_len, string_len, buf, 1); - - // Add this context to the service context list. - ri->add_request_service_context (sc, 0 ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - - // Check that the request service context can be retrieved. - 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 ()); - - ACE_UNUSED_ARG (buf2); - - if (ACE_OS::strcmp (buf2, request_msg) != 0) - { - ACE_ERROR ((LM_ERROR, - "ERROR: Expected request service context to be: %s.\n" - " Got: %s\n", - request_msg, - buf2)); - } -} - -void -Echo_Client_Request_Interceptor::receive_reply ( - PortableInterceptor::ClientRequestInfo_ptr ri - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - - if (CORBA::is_nil (this->orb_.in ())) - { - int argc = 0; - this->orb_ = CORBA::ORB_init (argc, 0, - this->orb_id_.in () - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - } - - CORBA::String_var operation = - ri->operation (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; - - CORBA::Object_var target = - ri->target (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; - - CORBA::String_var ior = - this->orb_->object_to_string (target.in () ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - - ACE_DEBUG ((LM_DEBUG, - "%s.receive_reply from " - "\"%s\"\n", - this->myname_, - operation.in ())); - - ACE_TRY - { - // Check that the reply service context was received as - // expected. - IOP::ServiceContext_var sc = - ri->get_reply_service_context (::service_id - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - const char *buf = - reinterpret_cast<const char *> (sc->context_data.get_buffer ()); - ACE_DEBUG ((LM_DEBUG, - "Received reply service context: %s\n", - buf)); - - if (ACE_OS::strcmp (buf, reply_msg) != 0) - { - ACE_ERROR ((LM_ERROR, - "ERROR: Expected reply service context to be: %s\n", - reply_msg)); - } - - // Check that no one has messed with the request service context. - IOP::ServiceContext_var sc2 = - ri->get_request_service_context (::service_id - ACE_ENV_ARG_PARAMETER); - ACE_TRY_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: Expected request service context to be: %s.\n" - " Got: %s\n", - request_msg, - buf2)); - } - } - ACE_CATCH (CORBA::BAD_PARAM, ex) - { - ACE_ERROR ((LM_ERROR, - "ERROR: Service Context Error \n")); - } - ACE_ENDTRY; - ACE_CHECK; -} - -void -Echo_Client_Request_Interceptor::receive_other ( - PortableInterceptor::ClientRequestInfo_ptr - ACE_ENV_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableInterceptor::ForwardRequest)) -{ - ACE_DEBUG ((LM_DEBUG, - "%s.receive_other\n", - this->myname_)); -} - -void -Echo_Client_Request_Interceptor::receive_exception ( - PortableInterceptor::ClientRequestInfo_ptr ri - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableInterceptor::ForwardRequest)) -{ - if (CORBA::is_nil (this->orb_.in ())) - { - int argc = 0; - this->orb_ = CORBA::ORB_init (argc, 0, - this->orb_id_.in () - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - } - - CORBA::String_var operation = ri->operation (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; - - CORBA::Object_var target = ri->target (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; - - CORBA::String_var ior = - this->orb_->object_to_string (target.in () ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - - ACE_DEBUG ((LM_DEBUG, - "%s.received_exception " - "from \"%s\"\n", - this->myname_, - operation.in ())); - - ACE_TRY - { - // Check that the reply service context was received as - // expected. - IOP::ServiceContext_var sc = - ri->get_reply_service_context (::service_id - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - const char *buf = - reinterpret_cast<const char *> (sc->context_data.get_buffer ()); - ACE_DEBUG ((LM_DEBUG, - "Received reply service context: %s\n", - buf)); - - if (ACE_OS::strcmp (buf, reply_msg) != 0) - { - ACE_ERROR ((LM_ERROR, - "ERROR: Expected reply service context to be: %s\n", - reply_msg)); - } - - // Check that no one has messed with the request service context. - IOP::ServiceContext_var sc2 = - ri->get_request_service_context (::service_id - ACE_ENV_ARG_PARAMETER); - ACE_TRY_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: Expected request service context to be: %s.\n" - " Got: %s\n", - request_msg, - buf2)); - } - } - ACE_CATCH (CORBA::BAD_PARAM, ex) - { - ACE_ERROR ((LM_ERROR, - "ERROR: Service Context Error \n")); - } - ACE_ENDTRY; - ACE_CHECK; -} - -Echo_Server_Request_Interceptor::Echo_Server_Request_Interceptor (void) - : myname_ ("Echo_Server_Interceptor") -{ -} - -Echo_Server_Request_Interceptor::~Echo_Server_Request_Interceptor (void) -{ - ACE_DEBUG ((LM_DEBUG,"(%P|%t) ~Echo_Server_Request_Interceptor\n")); -} - -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, - "(%P|%t)%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 ()); - ACE_DEBUG ((LM_DEBUG, - "(%P|%t) Received service context: %s\n", - buf)); - - 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, - "(%P|%t)%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, - "(%P|%t) 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, 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; - - ACE_DEBUG ((LM_DEBUG, - "(%P|%t)%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, - "(%P|%t) 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, 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/Collocated/Service_Context_Manipulation/interceptors.h b/TAO/tests/Portable_Interceptors/Collocated/Service_Context_Manipulation/interceptors.h deleted file mode 100644 index 29904bf2b55..00000000000 --- a/TAO/tests/Portable_Interceptors/Collocated/Service_Context_Manipulation/interceptors.h +++ /dev/null @@ -1,125 +0,0 @@ -// $Id$ - -#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" - -#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 - 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 -{ - // = 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 /* SERVICE_CONTEXT_MANIPULATION_COLLOCATED_INTERCEPTORS_H */ diff --git a/TAO/tests/Portable_Interceptors/Collocated/Service_Context_Manipulation/run_test.pl b/TAO/tests/Portable_Interceptors/Collocated/Service_Context_Manipulation/run_test.pl deleted file mode 100755 index b639e4068e3..00000000000 --- a/TAO/tests/Portable_Interceptors/Collocated/Service_Context_Manipulation/run_test.pl +++ /dev/null @@ -1,82 +0,0 @@ -eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' - & eval 'exec perl -S $0 $argv:q' - if 0; - -# $Id$ -# -*- perl -*- - -use lib '../../../../../bin'; -use PerlACE::Run_Test; - -$iorfile = PerlACE::LocalFile ("test.ior"); -unlink $iorfile; -$status = 0; - -if (PerlACE::is_vxworks_test()) { - $SV = new PerlACE::ProcessVX ("collocated"); -} -else { - $SV = new PerlACE::Process ("collocated"); -} - -print STDERR "======== Running in default mode \n"; -# $SV->Arguments ("-o $iorfile -k file://$iorfile"); -$sv = $SV->SpawnWaitKill (60); - -if ($sv != 0) { - print STDERR "ERROR in Collocated_Test\n"; - $status = 1; -} -unlink $iorfile; - -print STDERR "======== Running with per-orb \n"; -$SV->Arguments ("-ORBCollocation per-orb"); -$sv = $SV->SpawnWaitKill (60); - -if ($sv != 0) { - print STDERR "ERROR in Collocated_Test\n"; - $status = 1; -} -unlink $iorfile; - -print STDERR "======== Running with no collocation \n"; -$SV->Arguments ("-ORBCollocation no"); -$sv = $SV->SpawnWaitKill (60); - -if ($sv != 0) { - print STDERR "ERROR in Collocated_Test\n"; - $status = 1; -} -unlink $iorfile; - -print STDERR "======== Running in default mode and two ORBS \n"; -$SV->Arguments ("-n"); -$sv = $SV->SpawnWaitKill (60); - -if ($sv != 0) { - print STDERR "ERROR in Collocated_Test\n"; - $status = 1; -} -unlink $iorfile; - -print STDERR "======== Running in per-orb mode and two ORBS \n"; -$SV->Arguments ("-n -ORBCollocation per-orb"); -$sv = $SV->SpawnWaitKill (60); - -if ($sv != 0) { - print STDERR "ERROR in Collocated_Test\n"; - $status = 1; -} -unlink $iorfile; - -print STDERR "======== Running in no collocation mode and two ORBS \n"; -$SV->Arguments ("-n -ORBCollocation per-orb"); -$sv = $SV->SpawnWaitKill (60); - -if ($sv != 0) { - print STDERR "ERROR in Collocated_Test\n"; - $status = 1; -} -unlink $iorfile; - -exit $status; diff --git a/TAO/tests/Portable_Interceptors/Collocated/Service_Context_Manipulation/test.idl b/TAO/tests/Portable_Interceptors/Collocated/Service_Context_Manipulation/test.idl deleted file mode 100644 index e9ed51b50c7..00000000000 --- a/TAO/tests/Portable_Interceptors/Collocated/Service_Context_Manipulation/test.idl +++ /dev/null @@ -1,48 +0,0 @@ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// TAO/tests/Portable_Interceptors/Collocated/Service_Context_Manipulation -// -// = FILENAME -// test.idl -// -// = DESCRIPTION -// Simple IDL file to test collocated portable interceptor support. -// -// = AUTHORS -// Nanbor Wang <nanbor@cs.wustl.edu> -// -// ============================================================================ - -module Test_Interceptors -{ - exception Silly - {}; - - interface Visual - { - // = TITLE - // A test idl for checking interceptor visually. - // - // = DESCRIPTION - // - - void normal (in long arg); - // Normal operation. - - void nothing (); - // Normal operation without return. - - void user () - raises (Silly); - // throws a user exception. - - void system (); - // thows a system exception. - - oneway void shutdown (); - // shutdown the ORB - }; -}; diff --git a/TAO/tests/Portable_Interceptors/Collocated/Service_Context_Manipulation/test_i.cpp b/TAO/tests/Portable_Interceptors/Collocated/Service_Context_Manipulation/test_i.cpp deleted file mode 100644 index 0b76048e39b..00000000000 --- a/TAO/tests/Portable_Interceptors/Collocated/Service_Context_Manipulation/test_i.cpp +++ /dev/null @@ -1,56 +0,0 @@ -// $Id$ - -#include "test_i.h" - -ACE_RCSID (Service_Context_Manipulation, - test_i, - "$Id$") - - -Visual_i::Visual_i (CORBA::ORB_ptr orb) - : orb_ (CORBA::ORB::_duplicate (orb)) -{ -} - -void -Visual_i::normal (CORBA::Long - ACE_ENV_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ -// ACE_DEBUG ((LM_DEBUG, "Visual::normal called with %d\n", arg)); -} - -void -Visual_i::nothing (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ -// ACE_DEBUG ((LM_DEBUG, "Visual::nothing\n")); -} - -void -Visual_i::user (ACE_ENV_SINGLE_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - Test_Interceptors::Silly)) -{ - // ACE_DEBUG ((LM_DEBUG, "Visual::user, throwing Silly\n")); - ACE_THROW (Test_Interceptors::Silly ()); -} - -void -Visual_i::system (ACE_ENV_SINGLE_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - // ACE_DEBUG ((LM_DEBUG, "Visual::user, throwing INV_OBJREF\n")); - ACE_THROW (CORBA::INV_OBJREF ()); -} - -void -Visual_i::shutdown (ACE_ENV_SINGLE_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - // this->_remove_ref (ACE_ENV_SINGLE_ARG_PARAMETER); - // ACE_CHECK; - ACE_DEBUG ((LM_DEBUG,"(%P|%t) visual_i::shutdown\n")); - this->orb_->shutdown (0 ACE_ENV_ARG_PARAMETER); - ACE_CHECK; -} diff --git a/TAO/tests/Portable_Interceptors/Collocated/Service_Context_Manipulation/test_i.h b/TAO/tests/Portable_Interceptors/Collocated/Service_Context_Manipulation/test_i.h deleted file mode 100644 index 76a767d6a6a..00000000000 --- a/TAO/tests/Portable_Interceptors/Collocated/Service_Context_Manipulation/test_i.h +++ /dev/null @@ -1,53 +0,0 @@ -//============================================================================= -/** - * @file test_i.h - * - * $Id$ - * - * @author Nanbor Wang - */ -//============================================================================= - - -#ifndef SERVICE_CONTEXT_MANIPULATION_COLLOCATED_TEST_I_H -#define SERVICE_CONTEXT_MANIPULATION_COLLOCATED_TEST_I_H - -#include "testS.h" - -/** - * @class Visual_i - * - * Implements the Visual interface in test.idl - */ -class Visual_i : public virtual POA_Test_Interceptors::Visual -{ - -public: - - Visual_i (CORBA::ORB_ptr orb); - - void normal (CORBA::Long arg - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - void nothing (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - void user (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException, - Test_Interceptors::Silly)); - - void system (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - void shutdown (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - -private: - - /// The ORB pseudo-reference (for shutdown). - CORBA::ORB_var orb_; - -}; - -#endif /* SERVICE_CONTEXT_MANIPULATION_COLLOCATED_TEST_I_H */ diff --git a/TAO/tests/Portable_Interceptors/Dynamic/.cvsignore b/TAO/tests/Portable_Interceptors/Dynamic/.cvsignore deleted file mode 100644 index f2ad85300eb..00000000000 --- a/TAO/tests/Portable_Interceptors/Dynamic/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -client -server diff --git a/TAO/tests/Portable_Interceptors/Dynamic/Echo_Client_ORBInitializer.cpp b/TAO/tests/Portable_Interceptors/Dynamic/Echo_Client_ORBInitializer.cpp deleted file mode 100644 index e67eb2afb3c..00000000000 --- a/TAO/tests/Portable_Interceptors/Dynamic/Echo_Client_ORBInitializer.cpp +++ /dev/null @@ -1,46 +0,0 @@ -// -*- C++ -*- -// -// $Id$ - -#include "Echo_Client_ORBInitializer.h" - -ACE_RCSID (Dynamic, Echo_Client_ORBInitializer, "$Id$") - -#if TAO_HAS_INTERCEPTORS == 1 - -#include "client_interceptor.h" - -void -Echo_Client_ORBInitializer::pre_init ( - PortableInterceptor::ORBInitInfo_ptr - ACE_ENV_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ -} - -void -Echo_Client_ORBInitializer::post_init ( - PortableInterceptor::ORBInitInfo_ptr info - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - - PortableInterceptor::ClientRequestInterceptor_ptr interceptor = - PortableInterceptor::ClientRequestInterceptor::_nil (); - - // Install the Echo client request interceptor - ACE_NEW_THROW_EX (interceptor, - Echo_Client_Request_Interceptor, - CORBA::NO_MEMORY ()); - ACE_CHECK; - - PortableInterceptor::ClientRequestInterceptor_var - client_interceptor = interceptor; - - info->add_client_request_interceptor (client_interceptor.in () - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - -} - -#endif /* TAO_HAS_INTERCEPTORS == 1 */ diff --git a/TAO/tests/Portable_Interceptors/Dynamic/Echo_Client_ORBInitializer.h b/TAO/tests/Portable_Interceptors/Dynamic/Echo_Client_ORBInitializer.h deleted file mode 100644 index cd09fcce9bd..00000000000 --- a/TAO/tests/Portable_Interceptors/Dynamic/Echo_Client_ORBInitializer.h +++ /dev/null @@ -1,51 +0,0 @@ -// -*- C++ -*- -// -// $Id$ - -#ifndef TAO_ECHO_CLIENT_ORB_INITIALIZER_H -#define TAO_ECHO_CLIENT_ORB_INITIALIZER_H - -#include /**/ "ace/pre.h" - -#include "tao/PI/PI.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#if TAO_HAS_INTERCEPTORS == 1 - -#include "tao/LocalObject.h" - -// This is to remove "inherits via dominance" warnings from MSVC. -// MSVC is being a little too paranoid. -#if defined(_MSC_VER) -#pragma warning(push) -#pragma warning(disable:4250) -#endif /* _MSC_VER */ - -/// Echo client ORB initializer. -class Echo_Client_ORBInitializer : - public virtual PortableInterceptor::ORBInitializer, - public virtual TAO_Local_RefCounted_Object -{ -public: - - virtual void pre_init (PortableInterceptor::ORBInitInfo_ptr info - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - virtual void post_init (PortableInterceptor::ORBInitInfo_ptr info - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); -}; - -#if defined(_MSC_VER) -#pragma warning(pop) -#endif /* _MSC_VER */ - -#endif /* TAO_HAS_INTERCEPTORS == 1 */ - -#include /**/ "ace/post.h" - -#endif /* TAO_ECHO_CLIENT_ORB_INITIALIZER_H */ diff --git a/TAO/tests/Portable_Interceptors/Dynamic/Echo_Server_ORBInitializer.cpp b/TAO/tests/Portable_Interceptors/Dynamic/Echo_Server_ORBInitializer.cpp deleted file mode 100644 index cdb8f91338e..00000000000 --- a/TAO/tests/Portable_Interceptors/Dynamic/Echo_Server_ORBInitializer.cpp +++ /dev/null @@ -1,46 +0,0 @@ -// -*- C++ -*- -// -// $Id$ - -#include "Echo_Server_ORBInitializer.h" - -ACE_RCSID (Dynamic, Echo_Server_ORBInitializer, "$Id$") - -#if TAO_HAS_INTERCEPTORS == 1 - -#include "server_interceptor.h" - -void -Echo_Server_ORBInitializer::pre_init ( - PortableInterceptor::ORBInitInfo_ptr - ACE_ENV_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ -} - -void -Echo_Server_ORBInitializer::post_init ( - PortableInterceptor::ORBInitInfo_ptr info - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - - PortableInterceptor::ServerRequestInterceptor_ptr interceptor = - PortableInterceptor::ServerRequestInterceptor::_nil (); - - // Install the Echo server request interceptor - ACE_NEW_THROW_EX (interceptor, - Echo_Server_Request_Interceptor, - CORBA::NO_MEMORY ()); - ACE_CHECK; - - PortableInterceptor::ServerRequestInterceptor_var - server_interceptor = interceptor; - - info->add_server_request_interceptor (server_interceptor.in () - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - -} - -#endif /* TAO_HAS_INTERCEPTORS == 1 */ diff --git a/TAO/tests/Portable_Interceptors/Dynamic/Echo_Server_ORBInitializer.h b/TAO/tests/Portable_Interceptors/Dynamic/Echo_Server_ORBInitializer.h deleted file mode 100644 index 26b483304c7..00000000000 --- a/TAO/tests/Portable_Interceptors/Dynamic/Echo_Server_ORBInitializer.h +++ /dev/null @@ -1,51 +0,0 @@ -// -*- C++ -*- -// -// $Id$ - -#ifndef TAO_ECHO_SERVER_ORB_INITIALIZER_H -#define TAO_ECHO_SERVER_ORB_INITIALIZER_H - -#include /**/ "ace/pre.h" - -#include "tao/PI/PI.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#if TAO_HAS_INTERCEPTORS == 1 - -#include "tao/LocalObject.h" - -// This is to remove "inherits via dominance" warnings from MSVC. -// MSVC is being a little too paranoid. -#if defined(_MSC_VER) -#pragma warning(push) -#pragma warning(disable:4250) -#endif /* _MSC_VER */ - -/// Echo server ORB initializer. -class Echo_Server_ORBInitializer : - public virtual PortableInterceptor::ORBInitializer, - public virtual TAO_Local_RefCounted_Object -{ -public: - - virtual void pre_init (PortableInterceptor::ORBInitInfo_ptr info - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - virtual void post_init (PortableInterceptor::ORBInitInfo_ptr info - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); -}; - -#if defined(_MSC_VER) -#pragma warning(pop) -#endif /* _MSC_VER */ - -#endif /* TAO_HAS_INTERCEPTORS == 1 */ - -#include /**/ "ace/post.h" - -#endif /* TAO_ECHO_SERVER_ORB_INITIALIZER_H */ diff --git a/TAO/tests/Portable_Interceptors/Dynamic/PI_Dynamic.mpc b/TAO/tests/Portable_Interceptors/Dynamic/PI_Dynamic.mpc deleted file mode 100644 index a55faf91bbf..00000000000 --- a/TAO/tests/Portable_Interceptors/Dynamic/PI_Dynamic.mpc +++ /dev/null @@ -1,22 +0,0 @@ -// -*- MPC -*- -// $Id$ - -project(*Server): taoserver, pi_server, interceptors { - Source_Files { - test_i.cpp - server_interceptor.cpp - Echo_Server_ORBInitializer.cpp - server.cpp - } -} - -project(*Client): taoclient, pi, interceptors { - after += *Server - Source_Files { - testC.cpp - client_interceptor.cpp - Echo_Client_ORBInitializer.cpp - client.cpp - } -} - diff --git a/TAO/tests/Portable_Interceptors/Dynamic/README b/TAO/tests/Portable_Interceptors/Dynamic/README deleted file mode 100644 index 4abad34898c..00000000000 --- a/TAO/tests/Portable_Interceptors/Dynamic/README +++ /dev/null @@ -1,10 +0,0 @@ -# $Id$ - -This test allows you to visually check the correct invocation of -TAO's pseudo-portable interceptors, especially the Dynamic interface. - - To run the test, try: - - server -o test.ior - - client diff --git a/TAO/tests/Portable_Interceptors/Dynamic/client.cpp b/TAO/tests/Portable_Interceptors/Dynamic/client.cpp deleted file mode 100644 index c3d906faeb3..00000000000 --- a/TAO/tests/Portable_Interceptors/Dynamic/client.cpp +++ /dev/null @@ -1,156 +0,0 @@ -// $Id$ - -#include "ace/Get_Opt.h" - -#include "testC.h" -#include "Echo_Client_ORBInitializer.h" - -#include "tao/ORBInitializer_Registry.h" - -ACE_RCSID (Dynamic, - client, - "$Id$") - -const char *ior = "file://test.ior"; - -int -parse_args (int argc, char *argv[]) -{ - ACE_Get_Opt get_opts (argc, argv, "ef:"); - int c; - - while ((c = get_opts ()) != -1) - switch (c) - { - case 'e': - break; - case 'f': - ior = get_opts.opt_arg (); - break; - case '?': - default: - ACE_ERROR_RETURN ((LM_ERROR, - "usage: %s " - "-v " - "\n", - argv [0]), - -1); - } - return 0; -} - -void -run_test (Test_Interceptors::Visual_ptr server - ACE_ENV_ARG_DECL) -{ - CORBA::String_var msg; - - server->normal (10, - msg.out () - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - - CORBA::Long one = 1, two = 1, result = 0; - result = server->calculate (one, - two - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - - ACE_DEBUG ((LM_DEBUG, - "calculate() result = %d\n", - result)); - - Test_Interceptors::Visual::VarLenStruct_var v = - server->the_structure (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; - - ACE_DEBUG ((LM_DEBUG, - "the_structure() result is:\n" - " flag = %d\n" - " message = %s\n", - v->flag, - v->message.in ())); - - ACE_TRY - { - server->user (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - } - ACE_CATCH (Test_Interceptors::Silly, userex) - { - ACE_DEBUG ((LM_DEBUG, "Caught Silly\n")); - } - ACE_ENDTRY; - ACE_CHECK; - - ACE_TRY_EX (SYS) - { - server->system (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK_EX (SYS); - } - ACE_CATCH (CORBA::INV_OBJREF, sysex) - { - ACE_DEBUG ((LM_DEBUG, "Caught CORBA::INV_OBJREF\n")); - } - ACE_ENDTRY; - ACE_CHECK; -} - -int -main (int argc, char *argv[]) -{ - ACE_TRY_NEW_ENV - { -#if TAO_HAS_INTERCEPTORS == 1 - PortableInterceptor::ORBInitializer_ptr temp_initializer = - PortableInterceptor::ORBInitializer::_nil (); - - ACE_NEW_RETURN (temp_initializer, - Echo_Client_ORBInitializer, - -1); // No exceptions yet! - PortableInterceptor::ORBInitializer_var orb_initializer = - temp_initializer; - - PortableInterceptor::register_orb_initializer (orb_initializer.in () - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; -#endif /* TAO_HAS_INTERCEPTORS == 1 */ - - CORBA::ORB_var orb = - CORBA::ORB_init (argc, argv, "" ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - if (parse_args (argc, argv) != 0) - return 1; - - CORBA::Object_var object = - orb->string_to_object (ior ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - Test_Interceptors::Visual_var server = - Test_Interceptors::Visual::_narrow (object.in () ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - if (CORBA::is_nil (server.in ())) - { - ACE_ERROR_RETURN ((LM_ERROR, - "Object reference <%s> is nil\n", - ior), - 1); - } - - run_test (server.in () ACE_ENV_ARG_PARAMETER); - - server->shutdown (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - } - ACE_CATCHANY - { - ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, - "Caught exception:"); - return 1; - } - ACE_ENDTRY; - - return 0; -} diff --git a/TAO/tests/Portable_Interceptors/Dynamic/client_interceptor.cpp b/TAO/tests/Portable_Interceptors/Dynamic/client_interceptor.cpp deleted file mode 100644 index 40b8274fa4e..00000000000 --- a/TAO/tests/Portable_Interceptors/Dynamic/client_interceptor.cpp +++ /dev/null @@ -1,255 +0,0 @@ -// $Id$ - -#include "client_interceptor.h" -#include "testC.h" - -#include "tao/AnyTypeCode/DynamicC.h" -#include "tao/AnyTypeCode/TypeCode.h" -#include "tao/AnyTypeCode/AnyTypeCode_Adapter_Impl.h" - -#include "ace/Log_Msg.h" -#include "ace/OS_NS_string.h" - -ACE_RCSID (Dynamic, - client_interceptor, - "$Id$") - -Echo_Client_Request_Interceptor::Echo_Client_Request_Interceptor (void) - : myname_ ("Echo_Client_Interceptor") -{ -} - -Echo_Client_Request_Interceptor::~Echo_Client_Request_Interceptor () -{ -} - -char * -Echo_Client_Request_Interceptor::name (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - return CORBA::string_dup (this->myname_); -} - -void -Echo_Client_Request_Interceptor::destroy (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ -} - -void -Echo_Client_Request_Interceptor::send_poll ( - PortableInterceptor::ClientRequestInfo_ptr - ACE_ENV_ARG_DECL_NOT_USED - ) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - // Do nothing -} - -void -Echo_Client_Request_Interceptor::send_request ( - PortableInterceptor::ClientRequestInfo_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_Client_Request_Interceptor::send_request from " - "\"%s\"\n", - op.in ())); - - // For the "normal" operation, get the argument list. - if (ACE_OS::strcmp (op.in (), - "normal") == 0) - { - Dynamic::ParameterList_var paramlist = - ri->arguments (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; - - if (paramlist->length () != 2) - { - ACE_ERROR ((LM_ERROR, - "(%P|%t) All parameters not available \n")); - - } - - CORBA::ULong first = 0, second = 1; // If you dont understand - // why this is done, then - // try changing it. - if (paramlist[first].mode != CORBA::PARAM_IN || - paramlist[second].mode != CORBA::PARAM_OUT) - { - ACE_ERROR ((LM_ERROR, - "(%P|%t) ERROR in the extracted argument list \n")); - } - - CORBA::Long param = 0; - paramlist[first].argument >>= param; - - if (param != 10) - { - ACE_ERROR ((LM_ERROR, - "(%P|%t) ERROR in send_request while checking ", - "the value of the extracted ", - "arguments \n")); - } - } -} - -void -Echo_Client_Request_Interceptor::receive_other ( - PortableInterceptor::ClientRequestInfo_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_Client_Request_Interceptor::receive_other " - "from \"%s\"\n", - op.in ())); -} - -void -Echo_Client_Request_Interceptor::receive_reply ( - PortableInterceptor::ClientRequestInfo_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_Client_Request_Interceptor::receive_reply " - "from \"%s\"\n", - op.in ())); - - // For the "normal" operation, get the argument list. - if (ACE_OS::strcmp (op.in (), - "normal") == 0) - { - Dynamic::ParameterList_var paramlist = - ri->arguments (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; - - if (paramlist->length () != 2) - { - ACE_ERROR ((LM_ERROR, - "(%P|%t) All parameters not available \n")); - - } - - CORBA::ULong first = 0, second = 1; // If you dont understand - // why this is done, then - // try changing it. - if (paramlist[first].mode != CORBA::PARAM_IN || - paramlist[second].mode != CORBA::PARAM_OUT) - { - ACE_ERROR ((LM_ERROR, - "(%P|%t) ERROR in the extracted argument list \n")); - } - - CORBA::Long param = 0; - paramlist[first].argument >>= param; - - if (param != 10) - { - ACE_ERROR ((LM_ERROR, - "(%P|%t) ERROR in send_request while checking ", - "the value of the extracted ", - "arguments \n")); - } - - const char *str = 0; - - paramlist[second].argument >>= str; - - CORBA::String_var transfer (str); - - if (ACE_OS::strcmp (str, - "DO_NOT_INSULT_MY_INTELLIGENCE") != 0) - { - ACE_ERROR ((LM_ERROR, - "(%P|%t) ERROR in send_request while checking ", - "the value of the extracted ", - "out arguments \n")); - } - } - - 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; - 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)); - } - - if (ACE_OS::strcmp (op.in (), "_get_the_structure") == 0) - { - CORBA::Any_var a = ri->result (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; - - Test_Interceptors::Visual::VarLenStruct * v; - - (a.in ()) >>= v; - - ACE_DEBUG ((LM_DEBUG, - "The result of the_structure() is:\n" - " flag = %d\n" - " message = %s\n", - v->flag, - v->message.in ())); - } -} - -void -Echo_Client_Request_Interceptor::receive_exception ( - PortableInterceptor::ClientRequestInfo_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_Client_Request_Interceptor::received_exception " - "from \"%s\"\n", - op.in ())); - - - CORBA::String_var exception_id = - ri->received_exception_id (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; - - ACE_DEBUG ((LM_DEBUG, - "Exception ID = %s\n", - exception_id.in ())); -} - - diff --git a/TAO/tests/Portable_Interceptors/Dynamic/client_interceptor.h b/TAO/tests/Portable_Interceptors/Dynamic/client_interceptor.h deleted file mode 100644 index d2de8b3455a..00000000000 --- a/TAO/tests/Portable_Interceptors/Dynamic/client_interceptor.h +++ /dev/null @@ -1,84 +0,0 @@ -// -*- 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/run_test.pl b/TAO/tests/Portable_Interceptors/Dynamic/run_test.pl deleted file mode 100755 index b974ed8a4be..00000000000 --- a/TAO/tests/Portable_Interceptors/Dynamic/run_test.pl +++ /dev/null @@ -1,50 +0,0 @@ -eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' - & eval 'exec perl -S $0 $argv:q' - if 0; - -# $Id$ -# -*- perl -*- - -use lib '../../../../bin'; -use PerlACE::Run_Test; - -$status = 0; -$file = PerlACE::LocalFile ("test.ior"); - -unlink $file; - -if (PerlACE::is_vxworks_test()) { - $SV = new PerlACE::ProcessVX ("server", "-o test.ior"); -} -else { - $SV = new PerlACE::Process ("server", "-o $file"); -} -$CL = new PerlACE::Process ("client", "-f file://$file"); - -print STDERR "\n\n==== Running interceptor Dynamic test\n"; - -$SV->Spawn (); - -if (PerlACE::waitforfile_timed ($file, 15) == -1) { - print STDERR "ERROR: cannot find file <$file>\n"; - $SV->Kill (); - exit 1; -} - -$client = $CL->SpawnWaitKill (60); - -if ($client != 0) { - print STDERR "ERROR: client returned $client\n"; - $status = 1; -} - -$server = $SV->WaitKill (5); - -if ($server != 0) { - print STDERR "ERROR: server returned $server\n"; - $status = 1; -} - -unlink $file; - -exit $status; diff --git a/TAO/tests/Portable_Interceptors/Dynamic/server.cpp b/TAO/tests/Portable_Interceptors/Dynamic/server.cpp deleted file mode 100644 index 2197bc560bb..00000000000 --- a/TAO/tests/Portable_Interceptors/Dynamic/server.cpp +++ /dev/null @@ -1,141 +0,0 @@ -// $Id$ - -#include "ace/Get_Opt.h" -#include "test_i.h" -#include "Echo_Server_ORBInitializer.h" -#include "ace/OS_NS_stdio.h" - -#include "tao/ORBInitializer_Registry.h" - -ACE_RCSID (Dynamic, - server, - "$Id$") - -const char *ior_output_file = "test.ior"; - -int -parse_args (int argc, char *argv[]) -{ - ACE_Get_Opt get_opts (argc, argv, "o:"); - int c; - - while ((c = get_opts ()) != -1) - switch (c) - { - case 'o': - ior_output_file = get_opts.opt_arg (); - break; - case '?': - default: - ACE_ERROR_RETURN ((LM_ERROR, - "usage: %s " - "-o <iorfile>" - "\n", - argv [0]), - -1); - } - // Indicates sucessful parsing of the command line - return 0; -} - -int -main (int argc, char *argv[]) -{ - ACE_TRY_NEW_ENV - { -#if TAO_HAS_INTERCEPTORS == 1 - PortableInterceptor::ORBInitializer_ptr temp_initializer = - PortableInterceptor::ORBInitializer::_nil (); - - ACE_NEW_RETURN (temp_initializer, - Echo_Server_ORBInitializer, - -1); // No exceptions yet! - PortableInterceptor::ORBInitializer_var orb_initializer = - temp_initializer; - - PortableInterceptor::register_orb_initializer (orb_initializer.in () - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; -#endif /* TAO_HAS_INTERCEPTORS == 1 */ - - CORBA::ORB_var orb = - CORBA::ORB_init (argc, argv, "" ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - CORBA::Object_var poa_object = - orb->resolve_initial_references ("RootPOA" ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - if (CORBA::is_nil (poa_object.in ())) - ACE_ERROR_RETURN ((LM_ERROR, - " (%P|%t) Unable to initialize the POA.\n"), - 1); - - PortableServer::POA_var root_poa = - PortableServer::POA::_narrow (poa_object.in () ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - PortableServer::POAManager_var poa_manager = - root_poa->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - - poa_manager->activate (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - - if (parse_args (argc, argv) != 0) - return 1; - - Visual_i server_impl (orb.in ()); - - PortableServer::ObjectId_var id = - root_poa->activate_object (&server_impl - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - CORBA::Object_var test_obj = - root_poa->id_to_reference (id.in () - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - Test_Interceptors::Visual_var server = - Test_Interceptors::Visual::_narrow (test_obj.in () - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - CORBA::String_var ior = - orb->object_to_string (server.in () ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - ACE_DEBUG ((LM_DEBUG, "Test_Interceptors::Visual: <%s>\n", ior.in ())); - - // If the ior_output_file exists, output the ior to it - if (ior_output_file != 0) - { - FILE *output_file= ACE_OS::fopen (ior_output_file, "w"); - if (output_file == 0) - ACE_ERROR_RETURN ((LM_ERROR, - "Cannot open output file for writing IOR: %s", - ior_output_file), - 1); - ACE_OS::fprintf (output_file, "%s", ior.in ()); - ACE_OS::fclose (output_file); - } - - orb->run (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - - ACE_DEBUG ((LM_DEBUG, "event loop finished\n")); - - root_poa->destroy (1, 1 ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - } - ACE_CATCHANY - { - ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, - "Caught exception:"); - return 1; - } - ACE_ENDTRY; - - return 0; -} diff --git a/TAO/tests/Portable_Interceptors/Dynamic/server_interceptor.cpp b/TAO/tests/Portable_Interceptors/Dynamic/server_interceptor.cpp deleted file mode 100644 index 3e1cf79ca24..00000000000 --- a/TAO/tests/Portable_Interceptors/Dynamic/server_interceptor.cpp +++ /dev/null @@ -1,182 +0,0 @@ -// $Id$ - -#include "tao/AnyTypeCode/TypeCode.h" -#include "tao/AnyTypeCode/AnyTypeCode_Adapter_Impl.h" -#include "tao/AnyTypeCode/DynamicC.h" - -#include "server_interceptor.h" -#include "testC.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/server_interceptor.h b/TAO/tests/Portable_Interceptors/Dynamic/server_interceptor.h deleted file mode 100644 index f536de965c0..00000000000 --- a/TAO/tests/Portable_Interceptors/Dynamic/server_interceptor.h +++ /dev/null @@ -1,83 +0,0 @@ -// -*- 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" - -#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 PortableInterceptor::ServerRequestInterceptor, - public virtual TAO_Local_RefCounted_Object -{ - // = Server-side echo interceptor. For checking interceptor visually only. -public: - Echo_Server_Request_Interceptor (void); - // cotr. - - 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_service_contexts ( - PortableInterceptor::ServerRequestInfo_ptr - ACE_ENV_ARG_DECL_WITH_DEFAULTS - ) - ACE_THROW_SPEC (( - CORBA::SystemException, - PortableInterceptor::ForwardRequest - )); - - virtual void receive_request (PortableInterceptor::ServerRequestInfo_ptr ri - 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 - )); - -protected: - - virtual ~Echo_Server_Request_Interceptor (void); - // dotr. - -private: - const char *myname_; - -}; - -#if defined(_MSC_VER) -#pragma warning(pop) -#endif /* _MSC_VER */ - -#endif /* TAO_SERVER_INTERCEPTOR_H */ diff --git a/TAO/tests/Portable_Interceptors/Dynamic/test.idl b/TAO/tests/Portable_Interceptors/Dynamic/test.idl deleted file mode 100644 index e46baae1473..00000000000 --- a/TAO/tests/Portable_Interceptors/Dynamic/test.idl +++ /dev/null @@ -1,61 +0,0 @@ -// -*- IDL -*- -// $Id$ - -// =================================================================== -/** - * @file test.idl - * - * $Id$ - * - * Simple IDL file to test portable interceptor support. - * - * @author Nanbor Wang <nanbor@cs.wustl.edu> - * @author Ossama Othman <ossama@dre.vanderbilt.edu> - */ -// =================================================================== - -module Test_Interceptors -{ - exception Silly {}; - - /** - * @class Visual - * - * @brief Test interface for checking interceptor visually. - * - * Test interface for checking interceptor visually. - */ - interface Visual - { - /** - * @class VarLenStruct - * - * @brief Variable length structure - * - * This structure is designed to exercise memory management in the - * @c PortableInterceptor::RequestInfo::result() method. - */ - struct VarLenStruct - { - octet flag; - string message; - }; - - /// Normal operation. - void normal (in long arg, out string msg); - - /// Normal operation with a return val. - long calculate (in long one, in long two); - - readonly attribute VarLenStruct the_structure; - - /// Throws a user exception. - void user () raises (Silly); - - /// Throws a system exception. - void system (); - - /// Shutdown the ORB. - oneway void shutdown (); - }; -}; diff --git a/TAO/tests/Portable_Interceptors/Dynamic/test_i.cpp b/TAO/tests/Portable_Interceptors/Dynamic/test_i.cpp deleted file mode 100644 index 80c51203166..00000000000 --- a/TAO/tests/Portable_Interceptors/Dynamic/test_i.cpp +++ /dev/null @@ -1,75 +0,0 @@ -// $Id$ - -#include "test_i.h" - -ACE_RCSID (Dynamic, - test_i, - "$Id$") - -Visual_i::Visual_i (CORBA::ORB_ptr orb) - : orb_ (CORBA::ORB::_duplicate (orb)) -{ -} - // ctor - -void -Visual_i::normal (CORBA::Long arg, - CORBA::String_out msg - ACE_ENV_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - ACE_DEBUG ((LM_DEBUG, "Visual::normal called with %d\n", arg)); - msg = CORBA::string_dup ("DO_NOT_INSULT_MY_INTELLIGENCE"); -} - -CORBA::Long -Visual_i::calculate (CORBA::Long one, - CORBA::Long two - ACE_ENV_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - ACE_DEBUG ((LM_DEBUG, "Visual::calculate\n")); - return (one + two); -} - -Test_Interceptors::Visual::VarLenStruct * -Visual_i::the_structure (ACE_ENV_SINGLE_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - Test_Interceptors::Visual::VarLenStruct * s; - - ACE_NEW_THROW_EX (s, - Test_Interceptors::Visual::VarLenStruct, - CORBA::NO_MEMORY ()); - ACE_CHECK_RETURN (0); - - Test_Interceptors::Visual::VarLenStruct_var safe_s = s; - - s->flag = 135; - s->message = CORBA::string_dup ("Oh Captain, my Captain!"); - - return safe_s._retn (); -} - -void -Visual_i::user (ACE_ENV_SINGLE_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException,Test_Interceptors::Silly)) -{ - ACE_DEBUG ((LM_DEBUG, "Visual::user, throwing Silly\n")); - ACE_THROW (Test_Interceptors::Silly ()); -} - -void -Visual_i::system (ACE_ENV_SINGLE_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - ACE_DEBUG ((LM_DEBUG, "Visual::user, throwing INV_OBJREF\n")); - ACE_THROW (CORBA::INV_OBJREF ()); -} - -void -Visual_i::shutdown (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - this->orb_->shutdown (); -} diff --git a/TAO/tests/Portable_Interceptors/Dynamic/test_i.h b/TAO/tests/Portable_Interceptors/Dynamic/test_i.h deleted file mode 100644 index b174c34a422..00000000000 --- a/TAO/tests/Portable_Interceptors/Dynamic/test_i.h +++ /dev/null @@ -1,53 +0,0 @@ -// -*- C++ -*- - -// =================================================================== -/** - * @file test_i.h - * - * $Id$ - * - * @author Nanbor Wang <nanbor@cs.wustl.edu> - * @author Ossama Othman <ossama@dre.vanderbilt.edu> - */ -// =================================================================== - -#ifndef TAO_INTERCEPTOR_TEST_I_H -#define TAO_INTERCEPTOR_TEST_I_H - -#include "testS.h" - -class Visual_i : public POA_Test_Interceptors::Visual -{ -public: - Visual_i (CORBA::ORB_ptr orb); - - virtual CORBA::Long calculate (CORBA::Long one, - CORBA::Long two - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)); - - void normal (CORBA::Long arg, - CORBA::String_out msg - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)); - - virtual Test_Interceptors::Visual::VarLenStruct * the_structure ( - ACE_ENV_SINGLE_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)); - - virtual void user (ACE_ENV_SINGLE_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, Test_Interceptors::Silly)); - - virtual void system (ACE_ENV_SINGLE_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)); - - virtual void shutdown (ACE_ENV_SINGLE_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)); - -private: - - CORBA::ORB_var orb_; - -}; - -#endif /* TAO_INTERCEPTOR_TEST_I_H */ diff --git a/TAO/tests/Portable_Interceptors/ForwardRequest/.cvsignore b/TAO/tests/Portable_Interceptors/ForwardRequest/.cvsignore deleted file mode 100644 index f2ad85300eb..00000000000 --- a/TAO/tests/Portable_Interceptors/ForwardRequest/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -client -server diff --git a/TAO/tests/Portable_Interceptors/ForwardRequest/Client_ORBInitializer.cpp b/TAO/tests/Portable_Interceptors/ForwardRequest/Client_ORBInitializer.cpp deleted file mode 100644 index 4845a04bed7..00000000000 --- a/TAO/tests/Portable_Interceptors/ForwardRequest/Client_ORBInitializer.cpp +++ /dev/null @@ -1,69 +0,0 @@ -// -*- C++ -*- - -#include "Client_ORBInitializer.h" - -ACE_RCSID (ForwardRequest, - Client_ORBInitializer, - "$Id$") - -#if TAO_HAS_INTERCEPTORS == 1 - -#include "Client_Request_Interceptor.h" - -#include "tao/StringSeqC.h" -#include "tao/ORB_Constants.h" -#include "ace/OS_NS_string.h" - -void -Client_ORBInitializer::pre_init ( - PortableInterceptor::ORBInitInfo_ptr - ACE_ENV_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ -} - -void -Client_ORBInitializer::post_init ( - PortableInterceptor::ORBInitInfo_ptr info - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - CORBA::String_var orb_id = info->orb_id (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; - - CORBA::StringSeq_var args = info->arguments (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; - - CORBA::String_var forward_str; - - // Extract the last forward reference from the argument list. - CORBA::ULong args_len = args->length (); - for (CORBA::ULong i = 0; i < args_len; ++i) - if (ACE_OS::strcmp ("-k", args[i]) == 0 - && i < (args_len - 1)) - forward_str = args[i + 1]; - - PortableInterceptor::ClientRequestInterceptor_ptr interceptor = - PortableInterceptor::ClientRequestInterceptor::_nil (); - - // Install the client request interceptor. - ACE_NEW_THROW_EX (interceptor, - Client_Request_Interceptor (orb_id.in (), - forward_str.in ()), - CORBA::NO_MEMORY ( - CORBA::SystemException::_tao_minor_code ( - TAO::VMCID, - ENOMEM), - CORBA::COMPLETED_NO)); - ACE_CHECK; - - PortableInterceptor::ClientRequestInterceptor_var - client_interceptor = interceptor; - - info->add_client_request_interceptor (client_interceptor.in () - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - -} - -#endif /* TAO_HAS_INTERCEPTORS == 1 */ diff --git a/TAO/tests/Portable_Interceptors/ForwardRequest/Client_ORBInitializer.h b/TAO/tests/Portable_Interceptors/ForwardRequest/Client_ORBInitializer.h deleted file mode 100644 index 10386969df0..00000000000 --- a/TAO/tests/Portable_Interceptors/ForwardRequest/Client_ORBInitializer.h +++ /dev/null @@ -1,62 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file Client_ORBInitializer.h - * - * $Id$ - * - * Implementation header for the PortableInterceptor::ForwardRequest - * exception test client side ORB initializer. - * - * @author Ossama Othman <ossama@uci.edu> - */ -//============================================================================= - -#ifndef TAO_CLIENT_ORB_INITIALIZER_H -#define TAO_CLIENT_ORB_INITIALIZER_H - -#include /**/ "ace/pre.h" - -#include "tao/PI/PI.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#if TAO_HAS_INTERCEPTORS == 1 - -#include "tao/LocalObject.h" - -// This is to remove "inherits via dominance" warnings from MSVC. -// MSVC is being a little too paranoid. -#if defined(_MSC_VER) -#pragma warning(push) -#pragma warning(disable:4250) -#endif /* _MSC_VER */ - -/// Client side ORB initializer. -class Client_ORBInitializer : - public virtual PortableInterceptor::ORBInitializer, - public virtual TAO_Local_RefCounted_Object -{ -public: - - virtual void pre_init (PortableInterceptor::ORBInitInfo_ptr info - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - virtual void post_init (PortableInterceptor::ORBInitInfo_ptr info - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); -}; - -#if defined(_MSC_VER) -#pragma warning(pop) -#endif /* _MSC_VER */ - -#endif /* TAO_HAS_INTERCEPTORS == 1 */ - -#include /**/ "ace/post.h" - -#endif /* TAO_CLIENT_ORB_INITIALIZER_H */ diff --git a/TAO/tests/Portable_Interceptors/ForwardRequest/Client_Request_Interceptor.cpp b/TAO/tests/Portable_Interceptors/ForwardRequest/Client_Request_Interceptor.cpp deleted file mode 100644 index 949746c9d36..00000000000 --- a/TAO/tests/Portable_Interceptors/ForwardRequest/Client_Request_Interceptor.cpp +++ /dev/null @@ -1,151 +0,0 @@ -// -*- C++ -*- - -#include "Client_Request_Interceptor.h" -#include "testC.h" - -#include "ace/Log_Msg.h" - -ACE_RCSID (ForwardRequest, - Client_Request_Interceptor, - "$Id$") - -Client_Request_Interceptor::Client_Request_Interceptor ( - const char *orb_id, - const char *forward_str) - : orb_id_ (CORBA::string_dup (orb_id)), - orb_ (), - request_count_ (0), - forward_str_ (CORBA::string_dup (forward_str)) -{ -} - -char * -Client_Request_Interceptor::name ( - ACE_ENV_SINGLE_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - return CORBA::string_dup ("Client_Request_Interceptor"); -} - -void -Client_Request_Interceptor::destroy (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ -} - -void -Client_Request_Interceptor::send_request ( - PortableInterceptor::ClientRequestInfo_ptr ri - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableInterceptor::ForwardRequest)) -{ - ++this->request_count_; - - CORBA::Boolean response_expected = - ri->response_expected (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; - - if (!response_expected) // A one-way request. - return; - - // Request 1 -- non-forwarded - // Request 2 -- forwarded by this interception point. - - if (this->request_count_ == 2) - { - if (CORBA::is_nil (this->orb_.in ())) - { - int argc = 0; - this->orb_ = CORBA::ORB_init (argc, - 0, - this->orb_id_.in () - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - } - - CORBA::Object_var forward = - this->orb_->string_to_object (this->forward_str_.in () - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - - CORBA::String_var forward_str = - this->orb_->object_to_string (forward.in () - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - - ACE_DEBUG ((LM_DEBUG, - "CLIENT (%P|%t) Request %d will be forwarded " - "to object 2\n" - "CLIENT (%P|%t) via send_request().\n", - this->request_count_)); - - // Notice that this is not a permanent forward. - ACE_THROW (PortableInterceptor::ForwardRequest (forward.in ())); - } -} - -void -Client_Request_Interceptor::send_poll ( - PortableInterceptor::ClientRequestInfo_ptr - ACE_ENV_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ -} - -void -Client_Request_Interceptor::receive_reply ( - PortableInterceptor::ClientRequestInfo_ptr - ACE_ENV_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ -} - -void -Client_Request_Interceptor::receive_exception ( - PortableInterceptor::ClientRequestInfo_ptr - ACE_ENV_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableInterceptor::ForwardRequest)) -{ -} - -void -Client_Request_Interceptor::receive_other ( - PortableInterceptor::ClientRequestInfo_ptr ri - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableInterceptor::ForwardRequest)) -{ - - CORBA::Boolean response_expected = - ri->response_expected (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; - - // Oneway - if (!response_expected) - return; - - PortableInterceptor::ReplyStatus reply_status = - ri->reply_status (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; - - if (reply_status == PortableInterceptor::TRANSPORT_RETRY) - return; - - // If we get this far then we should have received a - // LOCATION_FORWARD reply, either from another client request - // interceptor (not this one) or from the server. - - // 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 ()); - - ACE_DEBUG ((LM_DEBUG, - "CLIENT (%P|%t) Received LOCATION_FORWARD reply.\n")); -} diff --git a/TAO/tests/Portable_Interceptors/ForwardRequest/Client_Request_Interceptor.h b/TAO/tests/Portable_Interceptors/ForwardRequest/Client_Request_Interceptor.h deleted file mode 100644 index b39c5ae1297..00000000000 --- a/TAO/tests/Portable_Interceptors/ForwardRequest/Client_Request_Interceptor.h +++ /dev/null @@ -1,125 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file Client_Request_Interceptor.h - * - * $Id$ - * - * Implementation header for the client request interceptor for the - * PortableInterceptor::ForwardRequest test. - * - * @author Ossama Othman <ossama@uci.edu> - */ -//============================================================================= - -#ifndef CLIENT_REQUEST_INTERCEPTOR_H -#define CLIENT_REQUEST_INTERCEPTOR_H - -#include "ace/config-all.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "tao/PI/PI.h" -#include "tao/PortableInterceptorC.h" -#include "tao/LocalObject.h" -#include "tao/ORB.h" -#include "tao/CORBA_String.h" - -#if defined(_MSC_VER) -#pragma warning(push) -#pragma warning(disable:4250) -#endif /* _MSC_VER */ - -/** - * @class Client_Request_Interceptor - * - * @brief Client request interceptor that exercises - * PortableInterceptor::ForwardRequest support. - * - * This client request interceptor forwards a request to a secondary - * object by throwing the PortableInterceptor::ForwardRequest - * exception from within the send_request() interception point. It - * only forwards the initial request. See the README file for - * details. - */ -class Client_Request_Interceptor - : public virtual PortableInterceptor::ClientRequestInterceptor, - public virtual TAO_Local_RefCounted_Object -{ -public: - - /// Constructor. - Client_Request_Interceptor (const char *orb_id, - const char *forward_str); - - /** - * @name Methods Required by the Client Request Interceptor - * Interface - * - * These are methods that must be implemented since they are pure - * virtual in the abstract base class. They are the canonical - * methods required for all client request interceptors. - */ - //@{ - /// Return the name of this ClientRequestinterceptor. - virtual char * name (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - virtual void destroy (ACE_ENV_SINGLE_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 send_poll ( - PortableInterceptor::ClientRequestInfo_ptr ri - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - 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)); - - virtual void receive_other ( - PortableInterceptor::ClientRequestInfo_ptr ri - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableInterceptor::ForwardRequest)); - //@} - -private: - - ///The ID of the ORB this interceptor is registered with. - CORBA::String_var orb_id_; - - /// Pseudo-reference to the ORB this interceptor is registered - /// with. - CORBA::ORB_var orb_; - - /// The number of requests intercepted by this interceptor. - CORBA::ULong request_count_; - - /// Stringified reference to the object the initial request will be - /// forwarded to by this interceptor. - CORBA::String_var forward_str_; - -}; - -#if defined(_MSC_VER) -#pragma warning(pop) -#endif /* _MSC_VER */ - -#endif /* CLIENT_REQUEST_INTERCEPTOR_H */ diff --git a/TAO/tests/Portable_Interceptors/ForwardRequest/PI_ForwardRequest.mpc b/TAO/tests/Portable_Interceptors/ForwardRequest/PI_ForwardRequest.mpc deleted file mode 100644 index 57393219165..00000000000 --- a/TAO/tests/Portable_Interceptors/ForwardRequest/PI_ForwardRequest.mpc +++ /dev/null @@ -1,24 +0,0 @@ -// -*- MPC -*- -// $Id$ - -project(*Server): taoserver, valuetype, pi, pi_server, interceptors { - - Source_Files { - test_i.cpp - Server_ORBInitializer.cpp - Server_Request_Interceptor.cpp - server.cpp - } -} - -project(*Client): taoclient, valuetype, pi, pi_server, interceptors { - after += *Server - - Source_Files { - testC.cpp - Client_ORBInitializer.cpp - Client_Request_Interceptor.cpp - client.cpp - } -} - diff --git a/TAO/tests/Portable_Interceptors/ForwardRequest/README b/TAO/tests/Portable_Interceptors/ForwardRequest/README deleted file mode 100644 index bdc4e51263d..00000000000 --- a/TAO/tests/Portable_Interceptors/ForwardRequest/README +++ /dev/null @@ -1,72 +0,0 @@ -# $Id$ - -This test verifies that the PortableInterceptor::ForwardRequest -exception support is working properly. There are three cases that it -tests: - - - PortableInterceptor::ForwardRequest exception thrown from a client - request interception point. - - PortableInterceptor::ForwardRequest exception thrown from the - receive_request_service_contexts() server request interception - point. - - PortableInterceptor::ForwardRequest exception thrown from the - receive_request() server request interception point. - -The reason why there are two server side cases is because the -receive_request_service_contexts() interception point occurs before -the operation is dispatched to the servant. Hence, the implementation -of the PortableInterceptor::ForwardRequest-to-LOCATION_FORWARD GIOP -reply conversion in that interception point differs from the -conversion that occurs in interception points in servant skeletons. - -Two servants are activated. Their corresponding references are then -passed to the client. The following sequence of operations then -occurs: - - 1) Issue client request. - 2) Intercept the request on the client side. - 3) Forward the request to servant two by throwing the - PortableInterceptor::ForwardRequest in the - ClientRequestInterceptor::send_reply() interception point. - 4) The server will receive the request. - 5) However, it will be intercepted by the server request - interceptor. - 6) The ServerRequestInterceptor::receive_request_service_contexts() - then forwards the client request back to servant one by throwing - the PortableInterceptor::ForwardRequest exception. - 7) That exception will be converted to a LOCATION_FORWARD GIOP - reply. - 8) The client will receive the LOCATION_FORWARD reply, and then - transparently forward its request to servant one. - 9) The ServerRequestInterceptor::receive_request() interception - point will then throw the PortableInterceptor::ForwardRequest - exception to cause the request to be forwarded back to servant - two. - 10) At this point, the request will actually be handled by servant - two. - -Test output should be similar to the following: - -==== Running PortableInterceptor::ForwardRequest test - -ForwardRequestTest::test servant 1: <IOR:010000002000...> -ForwardRequestTest::test servant 2: <IOR:010000002001...> -CLIENT: Issuing request 1. -CLIENT: Request 1 handled by object 1. -CLIENT: Issuing request 2. -CLIENT (1376|1540) Request 2 will be forwarded to object 2 -CLIENT (1376|1540) via send_request(). -CLIENT: Request 2 handled by object 2. -CLIENT: Issuing request 3. -SERVER (1604|1276) Request 3 will be forwarded to object 1 -SERVER (1604|1276) via receive_request_service_contexts(). -CLIENT (1376|1540) Received LOCATION_FORWARD reply. -CLIENT: Request 3 handled by object 1. -CLIENT: Issuing request 4. -SERVER (1604|1276) Request 4 will be forwarded to object 2 -SERVER (1604|1276) via receive_request(). -CLIENT (1376|1540) Received LOCATION_FORWARD reply. -CLIENT: Request 4 handled by object 2. -Server is shutting down via object 2. -Event loop finished. -PortableInterceptor::ForwardRequest test passed. diff --git a/TAO/tests/Portable_Interceptors/ForwardRequest/Server_ORBInitializer.cpp b/TAO/tests/Portable_Interceptors/ForwardRequest/Server_ORBInitializer.cpp deleted file mode 100644 index af8304f1cbb..00000000000 --- a/TAO/tests/Portable_Interceptors/ForwardRequest/Server_ORBInitializer.cpp +++ /dev/null @@ -1,60 +0,0 @@ -// -*- C++ -*- - -#include "Server_ORBInitializer.h" - -ACE_RCSID (ForwardRequest, - Server_ORBInitializer, - "$Id$") - -#if TAO_HAS_INTERCEPTORS == 1 - -#include "Server_Request_Interceptor.h" - -#include "tao/ORB_Constants.h" - -Server_ORBInitializer::Server_ORBInitializer (void) - : server_interceptor_ () -{ -} - -void -Server_ORBInitializer::pre_init ( - PortableInterceptor::ORBInitInfo_ptr - ACE_ENV_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ -} - -void -Server_ORBInitializer::post_init ( - PortableInterceptor::ORBInitInfo_ptr info - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - PortableInterceptor::ServerRequestInterceptor_ptr interceptor; - // Install the server request interceptor. - ACE_NEW_THROW_EX (interceptor, - Server_Request_Interceptor, - CORBA::NO_MEMORY ( - CORBA::SystemException::_tao_minor_code ( - TAO::VMCID, - ENOMEM), - CORBA::COMPLETED_NO)); - ACE_CHECK; - - this->server_interceptor_ = interceptor; - - info->add_server_request_interceptor (interceptor - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; -} - -PortableInterceptor::ServerRequestInterceptor_ptr -Server_ORBInitializer::server_interceptor (void) -{ - return - PortableInterceptor::ServerRequestInterceptor::_duplicate ( - this->server_interceptor_.in ()); -} - -#endif /* TAO_HAS_INTERCEPTORS == 1 */ diff --git a/TAO/tests/Portable_Interceptors/ForwardRequest/Server_ORBInitializer.h b/TAO/tests/Portable_Interceptors/ForwardRequest/Server_ORBInitializer.h deleted file mode 100644 index 90be3b9571a..00000000000 --- a/TAO/tests/Portable_Interceptors/ForwardRequest/Server_ORBInitializer.h +++ /dev/null @@ -1,78 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file Server_ORBInitializer.h - * - * $Id$ - * - * Implementation header for the PortableInterceptor::ForwardRequest - * exception test server side ORB initializer. - * - * @author Ossama Othman <ossama@uci.edu> - */ -//============================================================================= - -#ifndef TAO_SERVER_ORB_INITIALIZER_H -#define TAO_SERVER_ORB_INITIALIZER_H - -#include /**/ "ace/pre.h" - -#include "tao/PI/PI.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#if TAO_HAS_INTERCEPTORS == 1 - -#include "tao/LocalObject.h" - -// This is to remove "inherits via dominance" warnings from MSVC. -// MSVC is being a little too paranoid. -#if defined(_MSC_VER) -#pragma warning(push) -#pragma warning(disable:4250) -#endif /* _MSC_VER */ - -// Forward declaration. -class Server_Request_Interceptor; - -/// Server side ORB initializer. -class Server_ORBInitializer : - public virtual PortableInterceptor::ORBInitializer, - public virtual TAO_Local_RefCounted_Object -{ -public: - - /// Constructor. - Server_ORBInitializer (void); - - virtual void pre_init (PortableInterceptor::ORBInitInfo_ptr info - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - virtual void post_init (PortableInterceptor::ORBInitInfo_ptr info - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - /// Return the created server request interceptor. Only valid after - /// post_init(), i.e. ORB_init(), has been called. - PortableInterceptor::ServerRequestInterceptor_ptr server_interceptor (void); - -private: - - /// Pointer to the server request interceptor. ORB is responsible - /// for storage. - PortableInterceptor::ServerRequestInterceptor_var server_interceptor_; -}; - -#if defined(_MSC_VER) -#pragma warning(pop) -#endif /* _MSC_VER */ - -#endif /* TAO_HAS_INTERCEPTORS == 1 */ - -#include /**/ "ace/post.h" - -#endif /* TAO_SERVER_ORB_INITIALIZER_H */ diff --git a/TAO/tests/Portable_Interceptors/ForwardRequest/Server_Request_Interceptor.cpp b/TAO/tests/Portable_Interceptors/ForwardRequest/Server_Request_Interceptor.cpp deleted file mode 100644 index 10ad41353cf..00000000000 --- a/TAO/tests/Portable_Interceptors/ForwardRequest/Server_Request_Interceptor.cpp +++ /dev/null @@ -1,175 +0,0 @@ -// -*- C++ -*- - -#include "Server_Request_Interceptor.h" - -#include "tao/ORB_Constants.h" - -#include "ace/Log_Msg.h" - -ACE_RCSID (ForwardRequest, - Server_Request_Interceptor, - "$Id$") - -Server_Request_Interceptor::Server_Request_Interceptor (void) - : request_count_ (0) -{ - this->obj_[0] = CORBA::Object::_nil (); - this->obj_[1] = CORBA::Object::_nil (); -} - -Server_Request_Interceptor::~Server_Request_Interceptor (void) -{ -} - -void -Server_Request_Interceptor::forward_references ( - CORBA::Object_ptr obj1, - CORBA::Object_ptr obj2 - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - if (CORBA::is_nil (obj1) || CORBA::is_nil (obj2)) - ACE_THROW (CORBA::INV_OBJREF ( - CORBA::SystemException::_tao_minor_code ( - TAO::VMCID, - EINVAL), - CORBA::COMPLETED_NO)); - - this->obj_[0] = CORBA::Object::_duplicate (obj1); - this->obj_[1] = CORBA::Object::_duplicate (obj2); -} - -char * -Server_Request_Interceptor::name (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - return CORBA::string_dup ("Server_Request_Interceptor"); -} - -void -Server_Request_Interceptor::destroy (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - CORBA::release (this->obj_[0]); - CORBA::release (this->obj_[1]); -} - -void -Server_Request_Interceptor::receive_request_service_contexts ( - PortableInterceptor::ServerRequestInfo_ptr ri - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableInterceptor::ForwardRequest)) -{ - this->request_count_++; - - CORBA::Boolean response_expected = - ri->response_expected (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; - - if (!response_expected) // A one-way request. - return; - - // Request 1 -- non-forwarded - // Request 2 -- forwarded by client request interceptor - // Request 3 -- forwarded by this interception point - - if (this->request_count_ == 3) - { - // The client request interceptor should have already forwarded - // the request to obj_[1], so we re-forward the request back to - // obj_[0]. - - ACE_DEBUG ((LM_DEBUG, - "SERVER (%P|%t) Request %d will be forwarded " - "to object 1\n" // "object 1" as in "obj_[0]" - "SERVER (%P|%t) via " - "receive_request_service_contexts().\n", - this->request_count_)); - - ACE_THROW (PortableInterceptor::ForwardRequest (this->obj_[0])); - } -} - -void -Server_Request_Interceptor::receive_request ( - PortableInterceptor::ServerRequestInfo_ptr ri - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableInterceptor::ForwardRequest)) -{ - CORBA::Boolean response_expected = - ri->response_expected (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; - - if (!response_expected) // A one-way request. - return; - - // Request 1 -- non-forwarded - // Request 2 -- forwarded by client request interceptor - // Request 3 -- forwarded by receive_request_service_contexts() - // Request 4 -- non-forwarded (give client chance to print result) - // Request 5 -- forwarded by this interception point - - if (this->request_count_ == 5) - { - // This interceptor should have already forwarded the request to - // obj_[0] so re-forward it to obj_[1]. This will be the last - // location forward. - - - ACE_DEBUG ((LM_DEBUG, - "SERVER (%P|%t) Request %d will be forwarded " - "to object 2\n" // "object 2" as in "obj_[1]" - "SERVER (%P|%t) via receive_request().\n", - this->request_count_ - 1)); - // "request_count_ - 1" is used above since there was a location - // forward. - - ACE_THROW (PortableInterceptor::ForwardRequest (this->obj_[1])); - } -} - -void -Server_Request_Interceptor::send_reply ( - PortableInterceptor::ServerRequestInfo_ptr - ACE_ENV_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ -} - -void -Server_Request_Interceptor::send_exception ( - PortableInterceptor::ServerRequestInfo_ptr - ACE_ENV_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableInterceptor::ForwardRequest)) -{ -} - -void -Server_Request_Interceptor::send_other ( - PortableInterceptor::ServerRequestInfo_ptr ri - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableInterceptor::ForwardRequest)) -{ - CORBA::Boolean response_expected = - ri->response_expected (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; - - if (!response_expected) // A one-way request. - return; - - // 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/ForwardRequest/Server_Request_Interceptor.h b/TAO/tests/Portable_Interceptors/ForwardRequest/Server_Request_Interceptor.h deleted file mode 100644 index 382097c50a0..00000000000 --- a/TAO/tests/Portable_Interceptors/ForwardRequest/Server_Request_Interceptor.h +++ /dev/null @@ -1,137 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file Server_Request_Interceptor.h - * - * $Id$ - * - * Implementation header for the server request interceptor for the - * PortableInterceptor::ForwardRequest test. - * - * @author Ossama Othman <ossama@uci.edu> - */ -//============================================================================= - -#ifndef SERVER_REQUEST_INTERCEPTOR_H -#define SERVER_REQUEST_INTERCEPTOR_H - -#include "ace/config-all.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "testC.h" -#include "tao/LocalObject.h" -#include "tao/PortableInterceptorC.h" -#include "tao/PI_Server/PI_Server.h" - -#if defined(_MSC_VER) -#pragma warning(push) -#pragma warning(disable:4250) -#endif /* _MSC_VER */ - -/** - * @class Server_Request_Interceptor - * - * @brief Simple concrete server request interceptor. - * - * This server request interceptor forwards an initial client request - * to the primary server since the client request interceptor should - * have attempted to forward a request to the secondary server. That - * request will then be forwarded back to the primary server, at which - * point the request will be handled. - * - * The PortableInterceptor::ForwardRequest code for the - * receive_request_service_contexts() interception point (which is not - * in the servant skeleton) is slightly different from the - * corresponding code in the server skeleton. Hence, - * PortableInterceptor::ForwardRequest support is tested for both - * cases by throwing that exception in the - * receive_request_service_contexts() and the receive_request() - * interception points. - * - * See the README file for test details. - */ -class Server_Request_Interceptor - : public virtual ForwardRequestTest::ServerRequestInterceptor, - public virtual TAO_Local_RefCounted_Object -{ -public: - - /// Constructor. - Server_Request_Interceptor (void); - - /// Set the references to which requests will be forwarded. - virtual void forward_references (CORBA::Object_ptr obj1, - CORBA::Object_ptr obj2 - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - /** - * @name Methods Required by the Server Request Interceptor - * Interface - * - * These are methods that must be implemented since they are pure - * virtual in the abstract base class. They are the canonical - * methods required for all server request interceptors. - */ - //@{ - /// Return the name of this ServerRequestinterceptor. - virtual char * name (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - virtual void destroy (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - virtual void receive_request_service_contexts ( - PortableInterceptor::ServerRequestInfo_ptr ri - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableInterceptor::ForwardRequest)); - - virtual void receive_request ( - PortableInterceptor::ServerRequestInfo_ptr ri - 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 ri - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableInterceptor::ForwardRequest)); - //@} - -protected: - - /// Destructor. - ~Server_Request_Interceptor (void); - -private: - - /// The number of requests intercepted by this interceptor. - CORBA::ULong request_count_; - - /// References to the two objects used in this test. - CORBA::Object_ptr obj_[2]; - -}; - -#if defined(_MSC_VER) -#pragma warning(pop) -#endif /* _MSC_VER */ - -#endif /* SERVER_REQUEST_INTERCEPTOR_H */ diff --git a/TAO/tests/Portable_Interceptors/ForwardRequest/client.cpp b/TAO/tests/Portable_Interceptors/ForwardRequest/client.cpp deleted file mode 100644 index c04cfbaf890..00000000000 --- a/TAO/tests/Portable_Interceptors/ForwardRequest/client.cpp +++ /dev/null @@ -1,162 +0,0 @@ -// -*- C++ -*- - -#include "ace/Get_Opt.h" - -#include "testC.h" -#include "Client_ORBInitializer.h" - -#include "tao/ORBInitializer_Registry.h" - -ACE_RCSID (ForwardRequest, - client, - "$Id$") - -const char *ior1 = 0; -const char *ior2 = 0; - -int -parse_args (int argc, char *argv[]) -{ - if (argc != 5) // foo -k IOR_1 -k IOR_2 - ACE_ERROR_RETURN ((LM_ERROR, - "Wrong number of arguments.\n"), - -1); - - ACE_Get_Opt get_opts (argc, argv, "k:"); - int c; - - while ((c = get_opts ()) != -1) - switch (c) - { - case 'k': - - if (ior1 == 0) - ior1 = get_opts.opt_arg (); - else if (ior2 == 0) - ior2 = get_opts.opt_arg (); - - break; - default: - ACE_ERROR_RETURN ((LM_ERROR, - "Usage: %s " - "-k IOR_1 -k IOR_2\n", - argv[0]), - -1); - } - - return 0; -} - -int -main (int argc, char *argv[]) -{ - int status = 0; - - ACE_DECLARE_NEW_CORBA_ENV; - ACE_TRY - { -#if TAO_HAS_INTERCEPTORS == 1 - PortableInterceptor::ORBInitializer_ptr temp_initializer = - PortableInterceptor::ORBInitializer::_nil (); - - ACE_NEW_RETURN (temp_initializer, - Client_ORBInitializer, - -1); // No exceptions yet! - PortableInterceptor::ORBInitializer_var orb_initializer = - temp_initializer; - - PortableInterceptor::register_orb_initializer (orb_initializer.in () - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; -#endif /* TAO_HAS_INTERCEPTORS == 1 */ - - CORBA::ORB_var orb = CORBA::ORB_init (argc, - argv, - "Client ORB" - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - if (::parse_args (argc, argv) != 0) - return -1; - - // Start out with the first IOR. Interaction with the second - // IOR occurs during the various interceptions executed during - // this test. - CORBA::Object_var object = - orb->string_to_object (ior1 ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - ForwardRequestTest::test_var server = - ForwardRequestTest::test::_narrow (object.in () ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - if (CORBA::is_nil (server.in ())) - { - ACE_ERROR_RETURN ((LM_ERROR, - "Object reference <%s> is nil\n", - ior1), - 1); - } - - // Invoke the operation four times. By design, the last three - // invocations in this test will cause - // PortableInterceptor::ForwardRequest exceptions to be thrown, - // thus causing the request to be forwarded to another object. - - CORBA::Short old_number = 0; // Previous invocation result. - CORBA::Short number = 0; // New invocation result. - for (int i = 1; i <= 4; ++i) - { - ACE_DEBUG ((LM_INFO, - "CLIENT: Issuing request %d.\n", - i)); - - if (i > 1) - old_number = number; - - number = server->number (ACE_ENV_SINGLE_ARG_PARAMETER); - - ACE_TRY_CHECK; - - ACE_DEBUG ((LM_INFO, - "CLIENT: Request %d handled by object %d.\n", - i, - number)); - - // Check if the new result is the same as the previous - // result. - // - // This test is designed so that no two sequential - // invocation results are the same. If they are the same, - // then the requests were invoked on the same object, one - // after the other. This means that forwarding did not - // occur, which is of course a failure in the - // PortableInterceptor::ForwardRequest support. - if (i > 1 && old_number == number) - { - status = -1; - - ACE_ERROR ((LM_ERROR, - "TEST FAILED: Request was not " - "forwarded.\n")); - break; - } - } - - server->shutdown (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - } - ACE_CATCHANY - { - ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, - "Caught exception:"); - return -1; - } - ACE_ENDTRY; - - if (status != -1) - ACE_DEBUG ((LM_INFO, - "PortableInterceptor::ForwardRequest test passed.\n")); - - return status; -} diff --git a/TAO/tests/Portable_Interceptors/ForwardRequest/run_test.pl b/TAO/tests/Portable_Interceptors/ForwardRequest/run_test.pl deleted file mode 100755 index 79926e14db6..00000000000 --- a/TAO/tests/Portable_Interceptors/ForwardRequest/run_test.pl +++ /dev/null @@ -1,62 +0,0 @@ -eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' - & eval 'exec perl -S $0 $argv:q' - if 0; - -# -*- perl -*- -# -# $Id$ - - -use lib '../../../../bin'; -use PerlACE::Run_Test; - -$file1 = PerlACE::LocalFile ("test1.ior"); -$file2 = PerlACE::LocalFile ("test2.ior"); - -unlink $file1; -unlink $file2; - -if (PerlACE::is_vxworks_test()) { - $SV = new PerlACE::ProcessVX ("server", "-o test1.ior -o test2.ior"); -} -else { - $SV = new PerlACE::Process ("server", "-o $file1 -o $file2"); -} -$CL = new PerlACE::Process ("client", "-k file://$file1 -k file://$file2"); - -$status = 0; - -print STDERR "\n\n==== Running PortableInterceptor::ForwardRequest test\n"; - -$SV->Spawn (); - -if (PerlACE::waitforfile_timed ($file1, 15) == -1) { - print STDERR "ERROR: cannot find file <$file1>\n"; - $SV->Kill (); - exit 1; -} - -if (PerlACE::waitforfile_timed ($file2, 15) == -1) { - print STDERR "ERROR: cannot find file <$file2>\n"; - $SV->Kill (); - exit 1; -} - -$client = $CL->SpawnWaitKill (60); - -if ($client != 0) { - print STDERR "ERROR: client returned $client\n"; - $status = 1; -} - -$server = $SV->WaitKill (5); - -if ($server != 0) { - print STDERR "ERROR: server returned $server\n"; - $status = 1; -} - -unlink $file1; -unlink $file2; - -exit $status; diff --git a/TAO/tests/Portable_Interceptors/ForwardRequest/server.cpp b/TAO/tests/Portable_Interceptors/ForwardRequest/server.cpp deleted file mode 100644 index 286a18b98c0..00000000000 --- a/TAO/tests/Portable_Interceptors/ForwardRequest/server.cpp +++ /dev/null @@ -1,230 +0,0 @@ -// -*- C++ -*- - -#include "ace/Get_Opt.h" - -#include "test_i.h" -#include "Server_ORBInitializer.h" -#include "Server_Request_Interceptor.h" - -#include "tao/ORBInitializer_Registry.h" -#include "ace/OS_NS_stdio.h" - -ACE_RCSID (ForwardRequest, - server, - "$Id$") - -const char *ior1_file = 0; -const char *ior2_file = 0; - -int -parse_args (int argc, char *argv[]) -{ - if (argc != 5) // foo -o IOR_1 -o IOR_2 - ACE_ERROR_RETURN ((LM_ERROR, - "Wrong number of arguments.\n"), - -1); - - ACE_Get_Opt get_opts (argc, argv, "o:"); - int c; - - int ior_count = 1; - - while ((c = get_opts ()) != -1) - switch (c) - { - case 'o': - - if (ior_count == 1) - { - ior1_file = get_opts.opt_arg (); - ++ior_count; - } - else if (ior_count == 2) - { - ior2_file = get_opts.opt_arg (); - ++ior_count; - } - - break; - default: - ACE_ERROR_RETURN ((LM_ERROR, - "Usage: %s " - "-o IOR_1 -o IOR_2\n", - argv[0]), - -1); - } - - return 0; -} - -int -main (int argc, char *argv[]) -{ - ACE_DECLARE_NEW_CORBA_ENV; - ACE_TRY - { -#if TAO_HAS_INTERCEPTORS == 1 - Server_ORBInitializer *temp_initializer = 0; - ACE_NEW_RETURN (temp_initializer, - Server_ORBInitializer, - -1); // No exceptions yet! - PortableInterceptor::ORBInitializer_var orb_initializer = - temp_initializer; - - PortableInterceptor::register_orb_initializer (orb_initializer.in () - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; -#endif /* TAO_HAS_INTERCEPTORS == 1 */ - - CORBA::ORB_var orb = - CORBA::ORB_init (argc, argv, "Server ORB" ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - CORBA::Object_var poa_object = - orb->resolve_initial_references ("RootPOA" ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - if (CORBA::is_nil (poa_object.in ())) - ACE_ERROR_RETURN ((LM_ERROR, - " (%P|%t) Unable to initialize the POA.\n"), - 1); - - PortableServer::POA_var root_poa = - PortableServer::POA::_narrow (poa_object.in () ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - PortableServer::POAManager_var poa_manager = - root_poa->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - - if (::parse_args (argc, argv) != 0) - return -1; - - CORBA::PolicyList policies; // Empty policy list. - - // Servant 1 - test_i servant1 (1, orb.in ()); - - PortableServer::POA_var first_poa = - root_poa->create_POA ("first POA", - poa_manager.in (), - policies - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - PortableServer::ObjectId_var oid1 = - first_poa->activate_object (&servant1 - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - CORBA::Object_var obj1 = - first_poa->servant_to_reference (&servant1 - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - CORBA::String_var ior1 = - orb->object_to_string (obj1.in () ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - ACE_DEBUG ((LM_DEBUG, - "ForwardRequestTest::test servant 1: <%s>\n", - ior1.in ())); - - // Servant 2 - test_i servant2 (2, orb.in ()); - - PortableServer::POA_var second_poa = - root_poa->create_POA ("second POA", - poa_manager.in (), - policies - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - PortableServer::ObjectId_var oid2 = - second_poa->activate_object (&servant2 - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - CORBA::Object_var obj2 = - second_poa->servant_to_reference (&servant2 - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - CORBA::String_var ior2 = - orb->object_to_string (obj2.in () ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - ACE_DEBUG ((LM_DEBUG, - "ForwardRequestTest::test servant 2: <%s>\n", - ior2.in ())); - - poa_manager->activate (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - -#if TAO_HAS_INTERCEPTORS == 1 - // Set the forward references in the server request interceptor. - PortableInterceptor::ServerRequestInterceptor_var - server_interceptor = temp_initializer->server_interceptor (); - - ForwardRequestTest::ServerRequestInterceptor_var interceptor = - ForwardRequestTest::ServerRequestInterceptor::_narrow ( - server_interceptor.in () ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - if (CORBA::is_nil (interceptor.in ())) - ACE_ERROR_RETURN ((LM_ERROR, - "(%P|%t) Could not obtain reference to " - "server request interceptor.\n"), - -1); - - interceptor->forward_references (obj1.in (), - obj2.in () - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; -#endif /* TAO_HAS_INTERCEPTORS == 1 */ - - // Write each IOR to a file. - - // IOR 1 - FILE *output_file= ACE_OS::fopen (ior1_file, "w"); - if (output_file == 0) - ACE_ERROR_RETURN ((LM_ERROR, - "Cannot open output file <%s> for writing " - "IOR: %s", - ior1.in ()), - 1); - ACE_OS::fprintf (output_file, "%s", ior1.in ()); - ACE_OS::fclose (output_file); - - // IOR 2 - output_file= ACE_OS::fopen (ior2_file, "w"); - if (output_file == 0) - ACE_ERROR_RETURN ((LM_ERROR, - "Cannot open output file for writing IOR: %s", - ior2.in ()), - 1); - ACE_OS::fprintf (output_file, "%s", ior2.in ()); - ACE_OS::fclose (output_file); - - // Run the ORB event loop. - orb->run (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - - root_poa->destroy (1, 1 ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - orb->destroy (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - - ACE_DEBUG ((LM_DEBUG, "Event loop finished.\n")); - } - ACE_CATCHANY - { - ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, - "Caught exception:"); - return -1; - } - ACE_ENDTRY; - - return 0; -} diff --git a/TAO/tests/Portable_Interceptors/ForwardRequest/test.idl b/TAO/tests/Portable_Interceptors/ForwardRequest/test.idl deleted file mode 100644 index 0b9ab7f0190..00000000000 --- a/TAO/tests/Portable_Interceptors/ForwardRequest/test.idl +++ /dev/null @@ -1,41 +0,0 @@ -// -*- IDL -*- - -//============================================================================= -/** - * @file test.idl - * - * $Id$ - * - * Simple IDL file to test PortableInterceptor::ForwardRequest - * support. - * - * @author Ossama Othman <ossama@uci.edu> - */ -//============================================================================= - -#include "tao/PI_Server/PI_Server_include.pidl" - -module ForwardRequestTest -{ - - interface test - { - /// Return the number assigned to the current object. For - /// example, object one will return "1," and object two will - /// return "2." - short number (); - - oneway void shutdown (); - }; - - local interface ServerRequestInterceptor - : PortableInterceptor::ServerRequestInterceptor - { - - /// Set the references to which requests will be forwarded. - void forward_references (in Object obj1, - in Object obj2); - - }; - -}; diff --git a/TAO/tests/Portable_Interceptors/ForwardRequest/test_i.cpp b/TAO/tests/Portable_Interceptors/ForwardRequest/test_i.cpp deleted file mode 100644 index adafe5be28d..00000000000 --- a/TAO/tests/Portable_Interceptors/ForwardRequest/test_i.cpp +++ /dev/null @@ -1,35 +0,0 @@ -// -*- C++ -*- - -#include "test_i.h" - -ACE_RCSID (ForwardRequest, - test_i, - "$Id$") - -test_i::test_i (CORBA::Short num, - CORBA::ORB_ptr orb) - : number_ (num), - orb_ (CORBA::ORB::_duplicate (orb)) -{ -} - -test_i::~test_i (void) -{ -} - -CORBA::Short -test_i::number (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - return this->number_; -} - -void -test_i::shutdown (ACE_ENV_SINGLE_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - ACE_DEBUG ((LM_DEBUG, - "Server is shutting down via object %d.\n", - this->number_)); - this->orb_->shutdown (0 ACE_ENV_ARG_PARAMETER); -} diff --git a/TAO/tests/Portable_Interceptors/ForwardRequest/test_i.h b/TAO/tests/Portable_Interceptors/ForwardRequest/test_i.h deleted file mode 100644 index 51c142c2de3..00000000000 --- a/TAO/tests/Portable_Interceptors/ForwardRequest/test_i.h +++ /dev/null @@ -1,57 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file test_i.h - * - * $Id$ - * - * Implementation header for the "test" IDL interface for the - * PortableInterceptor::ForwardRequest test. - * - * @author Ossama Othman <ossama@uci.edu> - */ -//============================================================================= - -#ifndef TEST_I_H -#define TEST_I_H - -#include "testS.h" - -/** - * @class test_i - * - * @brief Simple test class. - * - * This class implements the "test" interface used in this test. - */ -class test_i : public virtual POA_ForwardRequestTest::test -{ -public: - - /// Constructor. - test_i (CORBA::Short num, - CORBA::ORB_ptr orb); - - /// Destructor. - ~test_i (void); - - /// Return the number assigned to this object. - virtual CORBA::Short number (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - /// Shutdown the ORB. - virtual void shutdown (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - -private: - - /// The number assigned to this object. - CORBA::Short number_; - - /// Pseudo-reference to the ORB. - CORBA::ORB_var orb_; - -}; - -#endif /* TEST_I_H */ diff --git a/TAO/tests/Portable_Interceptors/IORInterceptor/.cvsignore b/TAO/tests/Portable_Interceptors/IORInterceptor/.cvsignore deleted file mode 100644 index f2ad85300eb..00000000000 --- a/TAO/tests/Portable_Interceptors/IORInterceptor/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -client -server diff --git a/TAO/tests/Portable_Interceptors/IORInterceptor/FOO_ClientRequestInterceptor.cpp b/TAO/tests/Portable_Interceptors/IORInterceptor/FOO_ClientRequestInterceptor.cpp deleted file mode 100644 index 2bf02d1ef30..00000000000 --- a/TAO/tests/Portable_Interceptors/IORInterceptor/FOO_ClientRequestInterceptor.cpp +++ /dev/null @@ -1,126 +0,0 @@ -#include "FOO_ClientRequestInterceptor.h" -#include "testC.h" - -#include "ace/Log_Msg.h" - -#include "tao/AnyTypeCode/TypeCode_Constants.h" - -ACE_RCSID (IORInterceptor, - FOO_ClientRequestInterceptor, - "$Id$") - - -FOO_ClientRequestInterceptor::FOO_ClientRequestInterceptor ( - IOP::Codec_ptr codec) - : codec_ (IOP::Codec::_duplicate (codec)) -{ -} - -char * -FOO_ClientRequestInterceptor::name ( - ACE_ENV_SINGLE_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - return CORBA::string_dup ("FOO_ClientRequestInterceptor"); -} - -void -FOO_ClientRequestInterceptor::destroy (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ -} - -void -FOO_ClientRequestInterceptor::send_request ( - PortableInterceptor::ClientRequestInfo_ptr ri - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableInterceptor::ForwardRequest)) -{ - // Verify that the tagged component that was supposed to be embedded - // into the IOR by the FOO_IORInterceptor is actually in the IOR - // profile. - IOP::TaggedComponent_var component = - ri->get_effective_component (FOO::COMPONENT_ID - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - - // The correct tagged component appears to exist. Display the - // contents of the component data, which should be a NULL terminated - // string. In the case of this test, that string should be the name - // of the IORInterceptor that added the tagged component to the IOR. - - if (component->component_data.length () == 0) - { - // This should never happen because the IORInterceptor name is - // not an empty string. - ACE_ERROR ((LM_ERROR, - "Internal test error. Empty tagged component.\n")); - - ACE_THROW (CORBA::INTERNAL ()); - } - - CORBA::ULong maximum = component->component_data.maximum (); - CORBA::ULong length = component->component_data.length (); - CORBA::Octet * buffer = component->component_data.get_buffer (); - CORBA::Boolean release = 0; // TaggedComponent retains ownership. - - CORBA::OctetSeq data (maximum, length, buffer, release); - - // Extract the data from the octet sequence. - CORBA::Any_var decoded_data = - this->codec_->decode_value (data, - CORBA::_tc_string - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - - const char * name = 0; - - if (!(decoded_data.in () >>= name)) - { - ACE_ERROR ((LM_ERROR, - "ERROR: Unable to extract tagged component " - "data from Any.\n")); - - ACE_THROW (CORBA::INTERNAL ()); - } - - ACE_DEBUG ((LM_DEBUG, - "(%P|%t) String extracted from tagged component " - "data: %s\n", - name)); -} - -void -FOO_ClientRequestInterceptor::send_poll ( - PortableInterceptor::ClientRequestInfo_ptr - ACE_ENV_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ -} - -void -FOO_ClientRequestInterceptor::receive_reply ( - PortableInterceptor::ClientRequestInfo_ptr - ACE_ENV_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ -} - -void -FOO_ClientRequestInterceptor::receive_exception ( - PortableInterceptor::ClientRequestInfo_ptr - ACE_ENV_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableInterceptor::ForwardRequest)) -{ -} - -void -FOO_ClientRequestInterceptor::receive_other ( - PortableInterceptor::ClientRequestInfo_ptr - ACE_ENV_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableInterceptor::ForwardRequest)) -{ -} diff --git a/TAO/tests/Portable_Interceptors/IORInterceptor/FOO_ClientRequestInterceptor.h b/TAO/tests/Portable_Interceptors/IORInterceptor/FOO_ClientRequestInterceptor.h deleted file mode 100644 index abe9074a545..00000000000 --- a/TAO/tests/Portable_Interceptors/IORInterceptor/FOO_ClientRequestInterceptor.h +++ /dev/null @@ -1,110 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file FOO_ClientRequestInterceptor.h - * - * $Id$ - * - * Implementation header for the "FOO" client request test - * interceptor. - * - * @author Ossama Othman <ossama@uci.edu> - */ -//============================================================================= - -#ifndef FOO_CLIENT_REQUEST_INTERCEPTOR_H -#define FOO_CLIENT_REQUEST_INTERCEPTOR_H - -#include "ace/config-all.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "tao/PI/PI.h" -#include "tao/PortableInterceptorC.h" -#include "tao/LocalObject.h" - -#if defined(_MSC_VER) -#pragma warning(push) -#pragma warning(disable:4250) -#endif /* _MSC_VER */ - -/** - * @class FOO_ClientRequestInterceptor - * - * @brief Simple concrete client request interceptor. - * - * This is a test client request interceptor that extracts a tagged - * component that should have been embedded in the server IOR by an - * IOR interceptor. It displays the contents of that tagged - * component. - */ -class FOO_ClientRequestInterceptor - : public virtual PortableInterceptor::ClientRequestInterceptor, - public virtual TAO_Local_RefCounted_Object -{ -public: - - /// Constructor - FOO_ClientRequestInterceptor (IOP::Codec_ptr codec); - - /** - * @name Methods Required by the Client Request Interceptor - * Interface - * - * These are methods that must be implemented since they are pure - * virtual in the abstract base class. They are the canonical - * methods required for all client request interceptors. - */ - //@{ - /// Return the name of this ClientRequestInterceptor. - virtual char * name (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - virtual void destroy (ACE_ENV_SINGLE_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 send_poll ( - PortableInterceptor::ClientRequestInfo_ptr ri - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - 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)); - - virtual void receive_other ( - PortableInterceptor::ClientRequestInfo_ptr ri - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableInterceptor::ForwardRequest)); - //@} - -private: - - /// The CDR encapsulation coder/decoder used to retrieve data - /// from the CDR encapsulation in the tagged component. - IOP::Codec_var codec_; - -}; - -#if defined(_MSC_VER) -#pragma warning(pop) -#endif /* _MSC_VER */ - -#endif /* FOO_CLIENT_REQUEST_INTERCEPTOR_H */ diff --git a/TAO/tests/Portable_Interceptors/IORInterceptor/FOO_Client_ORBInitializer.cpp b/TAO/tests/Portable_Interceptors/IORInterceptor/FOO_Client_ORBInitializer.cpp deleted file mode 100644 index f999b2f22bb..00000000000 --- a/TAO/tests/Portable_Interceptors/IORInterceptor/FOO_Client_ORBInitializer.cpp +++ /dev/null @@ -1,59 +0,0 @@ -#include "FOO_Client_ORBInitializer.h" -#include "FOO_ClientRequestInterceptor.h" - -#include "tao/ORB_Constants.h" -#include "tao/CodecFactory/CodecFactory.h" - -ACE_RCSID (IORInterceptor, - FOO_Client_ORBInitializer, - "$Id$") - - -void -FOO_Client_ORBInitializer::pre_init ( - PortableInterceptor::ORBInitInfo_ptr /* info */ - ACE_ENV_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ -} - -void -FOO_Client_ORBInitializer::post_init ( - PortableInterceptor::ORBInitInfo_ptr info - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - IOP::CodecFactory_var codec_factory = - info->codec_factory (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; - - // Set up a structure that contains information necessary to - // create a GIOP 1.2 CDR encapsulation Codec. - IOP::Encoding encoding; - encoding.format = IOP::ENCODING_CDR_ENCAPS; - encoding.major_version = 1; - encoding.minor_version = 2; - - // Obtain the CDR encapsulation Codec. - IOP::Codec_var codec = - codec_factory->create_codec (encoding - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - - PortableInterceptor::ClientRequestInterceptor_ptr foo; - ACE_NEW_THROW_EX (foo, - FOO_ClientRequestInterceptor (codec.in ()), - CORBA::NO_MEMORY ( - CORBA::SystemException::_tao_minor_code ( - TAO::VMCID, - ENOMEM), - CORBA::COMPLETED_NO)); - ACE_CHECK; - - PortableInterceptor::ClientRequestInterceptor_var interceptor = - foo; - - info->add_client_request_interceptor (interceptor.in () - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; -} diff --git a/TAO/tests/Portable_Interceptors/IORInterceptor/FOO_Client_ORBInitializer.h b/TAO/tests/Portable_Interceptors/IORInterceptor/FOO_Client_ORBInitializer.h deleted file mode 100644 index a047658b5a8..00000000000 --- a/TAO/tests/Portable_Interceptors/IORInterceptor/FOO_Client_ORBInitializer.h +++ /dev/null @@ -1,74 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file FOO_Client_ORBInitializer.h - * - * $Id$ - * - * Implementation header for the "FOO" IOR test interceptor ORB - * initializer. - * - * @author Ossama Othman <ossama@uci.edu> - */ -//============================================================================= - -#ifndef FOO_CLIENT_ORB_INITIALIZER_H -#define FOO_CLIENT_ORB_INITIALIZER_H - -#include "ace/config-all.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "tao/PI/PI.h" -#include "tao/LocalObject.h" - -#if defined(_MSC_VER) -#pragma warning(push) -#pragma warning(disable:4250) -#endif /* _MSC_VER */ - -/** - * @class FOO_Client_ORBInitializer - * - * @brief Simple concrete ORB initializer. - * - * This is a test ORB initializer that registers an Client for - * this test. - */ -class FOO_Client_ORBInitializer : - public virtual PortableInterceptor::ORBInitializer, - public virtual TAO_Local_RefCounted_Object -{ -public: - - /** - * @name Methods Required by the ORBInitializer Interface - * - * These are methods that must be implemented since they are pure - * virtual in the abstract base class. They are the canonical - * methods required for all ORB initializers. - */ - //@{ - /// The pre-initialization hook. - virtual void pre_init ( - PortableInterceptor::ORBInitInfo_ptr info - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - /// The post-initialization hook. - virtual void post_init ( - PortableInterceptor::ORBInitInfo_ptr info - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - //@} - -}; - -#if defined(_MSC_VER) -#pragma warning(pop) -#endif /* _MSC_VER */ - -#endif /* FOO_CLIENT_ORB_INITIALIZER_H */ diff --git a/TAO/tests/Portable_Interceptors/IORInterceptor/FOO_IORInterceptor.cpp b/TAO/tests/Portable_Interceptors/IORInterceptor/FOO_IORInterceptor.cpp deleted file mode 100644 index c29013285ff..00000000000 --- a/TAO/tests/Portable_Interceptors/IORInterceptor/FOO_IORInterceptor.cpp +++ /dev/null @@ -1,198 +0,0 @@ -#include "FOO_IORInterceptor.h" -#include "testS.h" - -#include "tao/ORB_Constants.h" - -ACE_RCSID (IORInterceptor, - FOO_IORInterceptor, - "$Id$") - - -FOO_IORInterceptor::FOO_IORInterceptor (IOP::Codec_ptr codec) - : codec_ (IOP::Codec::_duplicate (codec)) -{ -} - -char * -FOO_IORInterceptor::name (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - return CORBA::string_dup ("FOO_IORInterceptor"); -} - -void -FOO_IORInterceptor::destroy (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ -} - -void -FOO_IORInterceptor::establish_components ( - PortableInterceptor::IORInfo_ptr info - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - // According to the Portable Interceptors specification, - // IORInterceptor::establish_components() must not throw an - // exception. We check for exceptions despite this fact. The ORB - // does the right thing, and ignores any IOR interceptors that throw - // an exception. - - CORBA::String_var name = this->name (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; - - CORBA::Any data; - data <<= name.in (); - - CORBA::OctetSeq_var encoded_data = - this->codec_->encode_value (data - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - - // Construct a tagged component. - IOP::TaggedComponent component; - - component.tag = FOO::COMPONENT_ID; - - const CORBA::ULong maximum = encoded_data->maximum (); - const CORBA::ULong length = encoded_data->length (); - CORBA::Octet * buffer = encoded_data->get_buffer (); - const CORBA::Boolean release = 0; // OctetSeq retains ownership. - - ACE_ASSERT (maximum > 1); // Sanity check. - ACE_ASSERT (length > 1); // Sanity check. - - component.component_data.replace (maximum, length, buffer, release); - - ACE_ASSERT (component.component_data.length () == length); - - // Add the tagged component to all profiles. - info->add_ior_component (component - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - - ACE_DEBUG ((LM_DEBUG, - "(%P|%t) Added tagged component containing the\n" - "(%P|%t) string \"%s\" to all profiles.\n", - name.in ())); - - - // Add the tagged component to all IIOP profiles. - info->add_ior_component_to_profile (component, - IOP::TAG_INTERNET_IOP - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - - ACE_DEBUG ((LM_DEBUG, - "(%P|%t) Added tagged component containing the\n" - "(%P|%t) string \"%s\" to all IIOP profiles.\n", - name.in ())); - - - ACE_TRY - { - // Verify that policy retrieval internals work, and do not cause - // memory access violations. - CORBA::Policy_var policy = - info->get_effective_policy (PortableServer::THREAD_POLICY_ID - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - ACE_DEBUG ((LM_DEBUG, - "(%P|%t) Successfully retrieved effective policy.\n")); - } - ACE_CATCH (CORBA::INV_POLICY, ex) - { - if (ex.minor () != (CORBA::OMGVMCID | 3)) - ACE_RE_THROW; - } - ACE_ENDTRY; - ACE_CHECK; -} - -void -FOO_IORInterceptor::components_established ( - PortableInterceptor::IORInfo_ptr info - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - // Construct a dummy tagged component. - IOP::TaggedComponent component; - - component.tag = 0; - component.component_data.length (1); - - - ACE_TRY_EX (ALL) - { - // Add the tagged component to all profiles. - // - // This call should fail since it shouldn't be possible to add - // an IOR component after establish_components() has been - // called. - info->add_ior_component (component - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK_EX (ALL); - - // The above call should NOT have succeeded. - ACE_TRY_THROW_EX (CORBA::INTERNAL (), ALL); - } - ACE_CATCH (CORBA::BAD_INV_ORDER, ex) - { - if (ex.minor () != (CORBA::OMGVMCID | 14)) - { - ACE_PRINT_EXCEPTION (ex, - "Unexpected exception"); - - ACE_RE_THROW_EX (ALL); - } - } - ACE_ENDTRY; - ACE_CHECK; - - ACE_TRY_EX (PROFILE) - { - // Add the tagged component to all profiles. - // - // This call should fail since it shouldn't be possible to add - // an IOR component after establish_components() has been - // called. - info->add_ior_component_to_profile (component, - IOP::TAG_INTERNET_IOP - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK_EX (PROFILE); - - // The above call should NOT have succeeded. - ACE_TRY_THROW_EX (CORBA::INTERNAL (), PROFILE); - } - ACE_CATCH (CORBA::BAD_INV_ORDER, ex) - { - if (ex.minor () != (CORBA::OMGVMCID | 14)) - { - ACE_PRINT_EXCEPTION (ex, - "Unexpected exception"); - - ACE_RE_THROW_EX (PROFILE); - } - } - ACE_ENDTRY; - ACE_CHECK; -} - -void -FOO_IORInterceptor::adapter_manager_state_changed ( - const char *, - PortableInterceptor::AdapterState - ACE_ENV_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ -} - -void -FOO_IORInterceptor:: adapter_state_changed ( - const PortableInterceptor::ObjectReferenceTemplateSeq &, - PortableInterceptor::AdapterState - ACE_ENV_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ -} diff --git a/TAO/tests/Portable_Interceptors/IORInterceptor/FOO_IORInterceptor.h b/TAO/tests/Portable_Interceptors/IORInterceptor/FOO_IORInterceptor.h deleted file mode 100644 index 4fc980070d1..00000000000 --- a/TAO/tests/Portable_Interceptors/IORInterceptor/FOO_IORInterceptor.h +++ /dev/null @@ -1,110 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file FOO_IORInterceptor.h - * - * $Id$ - * - * Implementation header for the "FOO" IOR test interceptor. - * - * @author Ossama Othman <ossama@uci.edu> - */ -//============================================================================= - -#ifndef FOO_IOR_INTERCEPTOR_H -#define FOO_IOR_INTERCEPTOR_H - -#include "ace/config-all.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "tao/IORInterceptor/IORInterceptor.h" -#include "tao/CodecFactory/CodecFactory.h" -#include "tao/PortableInterceptorC.h" -#include "tao/LocalObject.h" - -#if defined(_MSC_VER) -#pragma warning(push) -#pragma warning(disable:4250) -#endif /* _MSC_VER */ - -/** - * @class FOO_IORInterceptor - * - * @brief Simple concrete IOR interceptor. - * - * This is a test IOR interceptor that embeds a tagged component in an - * IOR. That tagged component will then be verified on the client - * side to ensure that IOR interceptor support is functioning - * properly. - */ -class FOO_IORInterceptor - : public virtual PortableInterceptor::IORInterceptor_3_0, - public virtual TAO_Local_RefCounted_Object -{ -public: - - /// Constructor - FOO_IORInterceptor (IOP::Codec_ptr codec); - - /** - * @name Methods Required by the IOR Interceptor Interface - * - * These are methods that must be implemented since they are pure - * virtual in the abstract base class. They are the canonical - * methods required for all IOR interceptors. - */ - //@{ - /// Return the name of this IORInterceptor. - virtual char * name (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - /// Cleanup resources acquired by this IORInterceptor. - virtual void destroy (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - /// Add the tagged components to the IOR. - virtual void establish_components ( - PortableInterceptor::IORInfo_ptr info - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - virtual void components_established ( - PortableInterceptor::IORInfo_ptr info - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - virtual void adapter_manager_state_changed ( - const char * id, - PortableInterceptor::AdapterState state - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC (( - CORBA::SystemException - )); - - virtual void adapter_state_changed ( - const PortableInterceptor::ObjectReferenceTemplateSeq & templates, - PortableInterceptor::AdapterState state - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC (( - CORBA::SystemException - )); - - //@} - -private: - - /// The CDR encapsulation coder/decoder used to encapsulate data - /// into a CDR encapsulation. - IOP::Codec_var codec_; - -}; - -#if defined(_MSC_VER) -#pragma warning(pop) -#endif /* _MSC_VER */ - -#endif /* FOO_IOR_INTERCEPTOR_H */ diff --git a/TAO/tests/Portable_Interceptors/IORInterceptor/FOO_IORInterceptor_ORBInitializer.cpp b/TAO/tests/Portable_Interceptors/IORInterceptor/FOO_IORInterceptor_ORBInitializer.cpp deleted file mode 100644 index 1930da1d6b0..00000000000 --- a/TAO/tests/Portable_Interceptors/IORInterceptor/FOO_IORInterceptor_ORBInitializer.cpp +++ /dev/null @@ -1,60 +0,0 @@ -// -*- C++ -*- - -#include "FOO_IORInterceptor_ORBInitializer.h" -#include "FOO_IORInterceptor.h" - -#include "tao/ORB_Constants.h" -#include "tao/CodecFactory/CodecFactory.h" - -ACE_RCSID (IORInterceptor, - FOO_IORInterceptor_ORBInitializer, - "$Id$") - -void -FOO_IORInterceptor_ORBInitializer::pre_init ( - PortableInterceptor::ORBInitInfo_ptr /* info */ - ACE_ENV_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ -} - -void -FOO_IORInterceptor_ORBInitializer::post_init ( - PortableInterceptor::ORBInitInfo_ptr info - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - IOP::CodecFactory_var codec_factory = - info->codec_factory (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; - - // Set up a structure that contains information necessary to - // create a GIOP 1.2 CDR encapsulation Codec. - IOP::Encoding encoding; - encoding.format = IOP::ENCODING_CDR_ENCAPS; - encoding.major_version = 1; - encoding.minor_version = 2; - - // Obtain the CDR encapsulation Codec. - IOP::Codec_var codec = - codec_factory->create_codec (encoding - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - - PortableInterceptor::IORInterceptor_ptr foo; - ACE_NEW_THROW_EX (foo, - FOO_IORInterceptor (codec.in ()), - CORBA::NO_MEMORY ( - CORBA::SystemException::_tao_minor_code ( - TAO::VMCID, - ENOMEM), - CORBA::COMPLETED_NO)); - ACE_CHECK; - - PortableInterceptor::IORInterceptor_var ior_interceptor = - foo; - - info->add_ior_interceptor (ior_interceptor.in () - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; -} diff --git a/TAO/tests/Portable_Interceptors/IORInterceptor/FOO_IORInterceptor_ORBInitializer.h b/TAO/tests/Portable_Interceptors/IORInterceptor/FOO_IORInterceptor_ORBInitializer.h deleted file mode 100644 index 62daa94f1ae..00000000000 --- a/TAO/tests/Portable_Interceptors/IORInterceptor/FOO_IORInterceptor_ORBInitializer.h +++ /dev/null @@ -1,74 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file FOO_IORInterceptor_ORBInitializer.h - * - * $Id$ - * - * Implementation header for the "FOO" IOR test interceptor ORB - * initializer. - * - * @author Ossama Othman <ossama@uci.edu> - */ -//============================================================================= - -#ifndef FOO_IOR_INTERCEPTOR_ORB_INITIALIZER_H -#define FOO_IOR_INTERCEPTOR_ORB_INITIALIZER_H - -#include "ace/config-all.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "tao/PI/PI.h" -#include "tao/LocalObject.h" - -#if defined(_MSC_VER) -#pragma warning(push) -#pragma warning(disable:4250) -#endif /* _MSC_VER */ - -/** - * @class FOO_IORInterceptor_ORBInitializer - * - * @brief Simple concrete ORB initializer. - * - * This is a test ORB initializer that registers an IORInterceptor for - * this test. - */ -class FOO_IORInterceptor_ORBInitializer : - public virtual PortableInterceptor::ORBInitializer, - public virtual TAO_Local_RefCounted_Object -{ -public: - - /** - * @name Methods Required by the ORBInitializer Interface - * - * These are methods that must be implemented since they are pure - * virtual in the abstract base class. They are the canonical - * methods required for all ORB initializers. - */ - //@{ - /// The pre-initialization hook. - virtual void pre_init ( - PortableInterceptor::ORBInitInfo_ptr info - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - /// The post-initialization hook. - virtual void post_init ( - PortableInterceptor::ORBInitInfo_ptr info - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - //@} - -}; - -#if defined(_MSC_VER) -#pragma warning(pop) -#endif /* _MSC_VER */ - -#endif /* FOO_IOR_INTERCEPTOR_ORB_INITIALIZER_H */ diff --git a/TAO/tests/Portable_Interceptors/IORInterceptor/PI_IORInterceptor.mpc b/TAO/tests/Portable_Interceptors/IORInterceptor/PI_IORInterceptor.mpc deleted file mode 100644 index fddc7298207..00000000000 --- a/TAO/tests/Portable_Interceptors/IORInterceptor/PI_IORInterceptor.mpc +++ /dev/null @@ -1,22 +0,0 @@ -// -*- MPC -*- -// $Id$ - -project(*Server): taoserver, iorinterceptor, interceptors { - Source_Files { - test_i.cpp - FOO_IORInterceptor_ORBInitializer.cpp - FOO_IORInterceptor.cpp - server.cpp - } -} - -project(*Client): taoclient, pi, interceptors { - after += *Server - Source_Files { - testC.cpp - FOO_Client_ORBInitializer.cpp - FOO_ClientRequestInterceptor.cpp - client.cpp - } -} - diff --git a/TAO/tests/Portable_Interceptors/IORInterceptor/README b/TAO/tests/Portable_Interceptors/IORInterceptor/README deleted file mode 100644 index fe3af0388b9..00000000000 --- a/TAO/tests/Portable_Interceptors/IORInterceptor/README +++ /dev/null @@ -1,28 +0,0 @@ -# $Id$ - -This test verifies that IOR interceptor support is working properly. -It does so by adding a unique tagged component to the IOR. If the -IOR interceptor support is working properly, then the it should be -possible to extract that tagged component from the IOR on the client -side via the - - PortableInterceptor::ClientRequestInfo::get_effective_component() - -method from within a ClientRequestInterceptor, for example. - -Run the test as follows: - - $ perl run_test.pl - -Output should be very similar to the following: - -==== Running IORInterceptor test -(4956|16384) Added tagged component containing the -(4956|16384) string "FOO_IORInterceptor" to all profiles. -(4956|16384) Added tagged component containing the -(4956|16384) string "FOO_IORInterceptor" to all IIOP profiles. -(4956|16384) Successfully retrieved effective policy. -FOO::test: <IOR:...> -(4957|16384) String extracted from tagged component data: FOO_IORInterceptor -"test_i" is shutting down. -Event loop finished. diff --git a/TAO/tests/Portable_Interceptors/IORInterceptor/client.cpp b/TAO/tests/Portable_Interceptors/IORInterceptor/client.cpp deleted file mode 100644 index a482b81963e..00000000000 --- a/TAO/tests/Portable_Interceptors/IORInterceptor/client.cpp +++ /dev/null @@ -1,95 +0,0 @@ -// -*- C++ -*- - -#include "ace/Get_Opt.h" - -#include "testC.h" -#include "FOO_Client_ORBInitializer.h" - -#include "tao/ORBInitializer_Registry.h" - -ACE_RCSID (IORInterceptor, - client, - "$Id$") - -const char *ior = "file://test.ior"; - -int -parse_args (int argc, char *argv[]) -{ - ACE_Get_Opt get_opts (argc, argv, "k:"); - int c; - - while ((c = get_opts ()) != -1) - switch (c) - { - case 'k': - ior = get_opts.opt_arg (); - break; - default: - ACE_ERROR_RETURN ((LM_ERROR, - "Usage: %s " - "-k IOR " - "\n", - argv[0]), - -1); - } - return 0; -} - -int -main (int argc, char *argv[]) -{ - ACE_DECLARE_NEW_CORBA_ENV; - ACE_TRY - { -#if TAO_HAS_INTERCEPTORS == 1 - PortableInterceptor::ORBInitializer_ptr temp_initializer = - PortableInterceptor::ORBInitializer::_nil (); - - ACE_NEW_RETURN (temp_initializer, - FOO_Client_ORBInitializer, - -1); // No exceptions yet! - PortableInterceptor::ORBInitializer_var orb_initializer = - temp_initializer; - - PortableInterceptor::register_orb_initializer (orb_initializer.in () - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; -#endif /* TAO_HAS_INTERCEPTORS == 1 */ - - CORBA::ORB_var orb = - CORBA::ORB_init (argc, argv, "client_orb" ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - if (parse_args (argc, argv) != 0) - return 1; - - CORBA::Object_var obj = - orb->string_to_object (ior ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - FOO::test_var server = - FOO::test::_narrow (obj.in () ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - if (CORBA::is_nil (server.in ())) - { - ACE_ERROR_RETURN ((LM_ERROR, - "Object reference <%s> is nil.\n", - ior), - 1); - } - - server->shutdown (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - } - ACE_CATCHANY - { - ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, - "IORInterceptor test (client-side):"); - return -1; - } - ACE_ENDTRY; - - return 0; -} diff --git a/TAO/tests/Portable_Interceptors/IORInterceptor/run_test.pl b/TAO/tests/Portable_Interceptors/IORInterceptor/run_test.pl deleted file mode 100755 index d6c417c48cb..00000000000 --- a/TAO/tests/Portable_Interceptors/IORInterceptor/run_test.pl +++ /dev/null @@ -1,50 +0,0 @@ -eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' - & eval 'exec perl -S $0 $argv:q' - if 0; - -# -*- perl -*- -# $Id$ - -use lib '../../../../bin'; -use PerlACE::Run_Test; - -$status = 0; -$file = PerlACE::LocalFile ("test.ior"); - -unlink $file; - -if (PerlACE::is_vxworks_test()) { - $SV = new PerlACE::ProcessVX ("server", "-o test.ior"); -} -else { - $SV = new PerlACE::Process ("server", "-o $file"); -} -$CL = new PerlACE::Process ("client", "-k file://$file"); - -print STDERR "\n\n==== Running IORInterceptor test\n"; - -$SV->Spawn (); - -if (PerlACE::waitforfile_timed ($file, 15) == -1) { - print STDERR "ERROR: cannot find file <$file>\n"; - $SV->Kill (); - exit 1; -} - -$client = $CL->SpawnWaitKill (60); - -if ($client != 0) { - print STDERR "ERROR: client returned $client\n"; - $status = 1; -} - -$server = $SV->WaitKill (5); - -if ($server != 0) { - print STDERR "ERROR: server returned $server\n"; - $status = 1; -} - -unlink $file; - -exit $status; diff --git a/TAO/tests/Portable_Interceptors/IORInterceptor/server.cpp b/TAO/tests/Portable_Interceptors/IORInterceptor/server.cpp deleted file mode 100644 index a91cf021548..00000000000 --- a/TAO/tests/Portable_Interceptors/IORInterceptor/server.cpp +++ /dev/null @@ -1,148 +0,0 @@ -// -*- C++ -*- - -#include "ace/Get_Opt.h" - -#include "test_i.h" -#include "FOO_IORInterceptor_ORBInitializer.h" - -#include "tao/ORBInitializer_Registry.h" -#include "ace/OS_NS_stdio.h" - -ACE_RCSID (IORInterceptor, - server, - "$Id$") - -const char *ior_output_file = "test.ior"; - -int -parse_args (int argc, char *argv[]) -{ - ACE_Get_Opt get_opts (argc, argv, "o:"); - int c; - - while ((c = get_opts ()) != -1) - switch (c) - { - case 'o': - ior_output_file = get_opts.opt_arg (); - break; - default: - ACE_ERROR_RETURN ((LM_ERROR, - "Usage: %s " - "-o <iorfile>" - "\n", - argv[0]), - -1); - } - - // Indicates sucessful parsing of the command line - return 0; -} - -int -main (int argc, char *argv[]) -{ - ACE_DECLARE_NEW_CORBA_ENV; - ACE_TRY - { -#if TAO_HAS_INTERCEPTORS == 1 - PortableInterceptor::ORBInitializer_ptr temp_initializer = - PortableInterceptor::ORBInitializer::_nil (); - - ACE_NEW_RETURN (temp_initializer, - FOO_IORInterceptor_ORBInitializer, - -1); // No CORBA exceptions yet! - PortableInterceptor::ORBInitializer_var orb_initializer = - temp_initializer; - - PortableInterceptor::register_orb_initializer (orb_initializer.in () - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - -#endif /* TAO_HAS_INTERCEPTORS == 1 */ - - CORBA::ORB_var orb = CORBA::ORB_init (argc, - argv, - "test_orb" - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - CORBA::Object_var obj = - orb->resolve_initial_references ("RootPOA" - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - PortableServer::POA_var root_poa = - PortableServer::POA::_narrow (obj.in () ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - if (CORBA::is_nil (root_poa.in ())) - ACE_ERROR_RETURN ((LM_ERROR, - "Unable to obtain RootPOA reference.\n"), - -1); - - PortableServer::POAManager_var poa_manager = - root_poa->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - - poa_manager->activate (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - - if (parse_args (argc, argv) != 0) - return -1; - - test_i server_impl (orb.in ()); - - obj = server_impl._this (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - - FOO::test_var server = FOO::test::_narrow (obj.in () - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - if (CORBA::is_nil (server.in ())) - ACE_ERROR_RETURN ((LM_ERROR, - "Unable to obtain reference to FOO::test " - "object.\n"), - -1); - - CORBA::String_var ior = - orb->object_to_string (server.in () ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - ACE_DEBUG ((LM_INFO, "FOO::test: <%s>\n", ior.in ())); - - // If the ior_output_file exists, output the IOR to it. - if (ior_output_file != 0) - { - FILE *output_file = ACE_OS::fopen (ior_output_file, "w"); - if (output_file == 0) - ACE_ERROR_RETURN ((LM_ERROR, - "Cannot open output file for writing " - "IOR: %s", - ior_output_file), - 1); - ACE_OS::fprintf (output_file, "%s", ior.in ()); - ACE_OS::fclose (output_file); - } - - orb->run (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - - ACE_DEBUG ((LM_INFO, "Event loop finished.\n")); - - // The interceptors will be destroyed when we call this - orb->destroy (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - } - ACE_CATCHANY - { - ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, - "IORInterceptor test (server-side):"); - - return -1; - } - ACE_ENDTRY; - - return 0; -} diff --git a/TAO/tests/Portable_Interceptors/IORInterceptor/test.idl b/TAO/tests/Portable_Interceptors/IORInterceptor/test.idl deleted file mode 100644 index f6914d3edcc..00000000000 --- a/TAO/tests/Portable_Interceptors/IORInterceptor/test.idl +++ /dev/null @@ -1,30 +0,0 @@ -// -*- IDL -*- - -//============================================================================= -/** - * @file test.idl - * - * $Id$ - * - * "test" IDL interface for the IORInterceptor test. - * - * @author Ossama Othman <ossama@uci.edu> - */ -//============================================================================= - - -#include "tao/IOP.pidl" - -module FOO -{ - - interface test - { - oneway void shutdown (); - }; - - // @@ Hopefully, this tagged component ID won't be reserved by - // anything, anytime soon. - const IOP::ComponentId COMPONENT_ID = 3456; - -}; diff --git a/TAO/tests/Portable_Interceptors/IORInterceptor/test_i.cpp b/TAO/tests/Portable_Interceptors/IORInterceptor/test_i.cpp deleted file mode 100644 index ecdb6b3560f..00000000000 --- a/TAO/tests/Portable_Interceptors/IORInterceptor/test_i.cpp +++ /dev/null @@ -1,21 +0,0 @@ -// -*- C++ -*- - -#include "test_i.h" - -ACE_RCSID (IORInterceptors, - test_i, - "$Id$") - -test_i::test_i (CORBA::ORB_ptr orb) - : orb_ (CORBA::ORB::_duplicate (orb)) -{ -} - -void -test_i::shutdown (ACE_ENV_SINGLE_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - ACE_DEBUG ((LM_DEBUG, - "\"test_i\" is shutting down.\n")); - this->orb_->shutdown (0 ACE_ENV_ARG_PARAMETER); -} diff --git a/TAO/tests/Portable_Interceptors/IORInterceptor/test_i.h b/TAO/tests/Portable_Interceptors/IORInterceptor/test_i.h deleted file mode 100644 index a712ff5c8d7..00000000000 --- a/TAO/tests/Portable_Interceptors/IORInterceptor/test_i.h +++ /dev/null @@ -1,47 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file test_i.h - * - * $Id$ - * - * Implementation header for the "test" IDL interface for the - * IORInterceptor test. - * - * @author Ossama Othman <ossama@uci.edu> - */ -//============================================================================= - -#ifndef TEST_I_H -#define TEST_I_H - -#include "testS.h" - -/** - * @class test_i - * - * @brief Simple test class. - * - * This class exists only to make it possible to generate an IOR to - * which the test IOR interceptor will add a tagged component. - */ -class test_i : public virtual POA_FOO::test -{ -public: - - /// Constructor. - test_i (CORBA::ORB_ptr orb); - - /// Shutdown the ORB. - virtual void shutdown (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - -private: - - /// Pseudo-reference to the ORB. - CORBA::ORB_var orb_; - -}; - -#endif /* TEST_I_H */ diff --git a/TAO/tests/Portable_Interceptors/ORB_Shutdown/.cvsignore b/TAO/tests/Portable_Interceptors/ORB_Shutdown/.cvsignore deleted file mode 100644 index f2ad85300eb..00000000000 --- a/TAO/tests/Portable_Interceptors/ORB_Shutdown/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -client -server diff --git a/TAO/tests/Portable_Interceptors/ORB_Shutdown/PI_ORB_Shutdown.mpc b/TAO/tests/Portable_Interceptors/ORB_Shutdown/PI_ORB_Shutdown.mpc deleted file mode 100644 index 600ba5c118b..00000000000 --- a/TAO/tests/Portable_Interceptors/ORB_Shutdown/PI_ORB_Shutdown.mpc +++ /dev/null @@ -1,22 +0,0 @@ -// -*- MPC -*- -// -// $Id$ - -project(*Server): taoserver, pi_server, interceptors { - Source_Files { - test_i.cpp - Server_ORBInitializer.cpp - Server_Request_Interceptor.cpp - server.cpp - } -} - -project(*Client): taoclient, anytypecode { - after += *Server - - Source_Files { - testC.cpp - client.cpp - } -} - diff --git a/TAO/tests/Portable_Interceptors/ORB_Shutdown/README b/TAO/tests/Portable_Interceptors/ORB_Shutdown/README deleted file mode 100644 index 285817b4223..00000000000 --- a/TAO/tests/Portable_Interceptors/ORB_Shutdown/README +++ /dev/null @@ -1,16 +0,0 @@ -# $Id$ - -This test verifies that the ServerRequestInterceptor::destroy() method -is not called prematurely, e.g. during ORB::shutdown() and before -ending interception points have been called. - -See bug report 1642 in our bug tracking system for complete details. - -Test output should be similar to the following: - -==== Running PortableInterceptor ORB::shutdown() test -test servant: <IOR:010000000...> -Hello! -Shutting down ORB. -Event loop finished. -PortableInterceptor ORB::shutdown() test passed. diff --git a/TAO/tests/Portable_Interceptors/ORB_Shutdown/Server_ORBInitializer.cpp b/TAO/tests/Portable_Interceptors/ORB_Shutdown/Server_ORBInitializer.cpp deleted file mode 100644 index 04262d84180..00000000000 --- a/TAO/tests/Portable_Interceptors/ORB_Shutdown/Server_ORBInitializer.cpp +++ /dev/null @@ -1,52 +0,0 @@ -// -*- C++ -*- - -#include "Server_ORBInitializer.h" - -ACE_RCSID (ForwardRequest, - Server_ORBInitializer, - "$Id$") - -#if TAO_HAS_INTERCEPTORS == 1 - -#include "Server_Request_Interceptor.h" - -#include "tao/ORB_Constants.h" - -Server_ORBInitializer::Server_ORBInitializer (bool & destroy_called) - : destroy_called_ (destroy_called) -{ -} - -void -Server_ORBInitializer::pre_init ( - PortableInterceptor::ORBInitInfo_ptr - ACE_ENV_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ -} - -void -Server_ORBInitializer::post_init ( - PortableInterceptor::ORBInitInfo_ptr info - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - PortableInterceptor::ServerRequestInterceptor_ptr interceptor; - ACE_NEW_THROW_EX (interceptor, - Server_Request_Interceptor (this->destroy_called_), - CORBA::NO_MEMORY ( - CORBA::SystemException::_tao_minor_code ( - TAO::VMCID, - ENOMEM), - CORBA::COMPLETED_NO)); - ACE_CHECK; - - PortableInterceptor::ServerRequestInterceptor_var server_interceptor = - interceptor; - - info->add_server_request_interceptor (interceptor - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; -} - -#endif /* TAO_HAS_INTERCEPTORS == 1 */ diff --git a/TAO/tests/Portable_Interceptors/ORB_Shutdown/Server_ORBInitializer.h b/TAO/tests/Portable_Interceptors/ORB_Shutdown/Server_ORBInitializer.h deleted file mode 100644 index 1498e7c020c..00000000000 --- a/TAO/tests/Portable_Interceptors/ORB_Shutdown/Server_ORBInitializer.h +++ /dev/null @@ -1,71 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file Server_ORBInitializer.h - * - * $Id$ - * - * Implementation header for the PortableInterceptor ORB::shutdown() - * test server side ORB initializer. - * - * @author Ossama Othman <ossama@dre.vanderbilt.edu> - */ -//============================================================================= - -#ifndef TAO_SERVER_ORB_INITIALIZER_H -#define TAO_SERVER_ORB_INITIALIZER_H - -#include "tao/LocalObject.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#if TAO_HAS_INTERCEPTORS == 1 - -#include "tao/PI/PI.h" - -// This is to remove "inherits via dominance" warnings from MSVC. -// MSVC is being a little too paranoid. -#if defined(_MSC_VER) -#pragma warning(push) -#pragma warning(disable:4250) -#endif /* _MSC_VER */ - -// Forward declaration. -class Server_Request_Interceptor; - -/// Server side ORB initializer. -class Server_ORBInitializer - : public virtual PortableInterceptor::ORBInitializer, - public virtual TAO_Local_RefCounted_Object -{ -public: - - /// Constructor. - Server_ORBInitializer (bool & destroy_called); - - virtual void pre_init (PortableInterceptor::ORBInitInfo_ptr info - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - virtual void post_init (PortableInterceptor::ORBInitInfo_ptr info - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - -private: - - /// Flag that states whether this interceptor's @c destroy() method - /// was called. - bool & destroy_called_; - -}; - -#if defined(_MSC_VER) -#pragma warning(pop) -#endif /* _MSC_VER */ - -#endif /* TAO_HAS_INTERCEPTORS == 1 */ - -#endif /* TAO_SERVER_ORB_INITIALIZER_H */ diff --git a/TAO/tests/Portable_Interceptors/ORB_Shutdown/Server_Request_Interceptor.cpp b/TAO/tests/Portable_Interceptors/ORB_Shutdown/Server_Request_Interceptor.cpp deleted file mode 100644 index d7cd081e6d3..00000000000 --- a/TAO/tests/Portable_Interceptors/ORB_Shutdown/Server_Request_Interceptor.cpp +++ /dev/null @@ -1,90 +0,0 @@ -#include "Server_Request_Interceptor.h" - -#include "ace/Log_Msg.h" - -ACE_RCSID (ORB_Shutdown, - Server_Request_Interceptor, - "$Id$") - -Server_Request_Interceptor::Server_Request_Interceptor (bool & destroy_called) - : destroy_called_ (destroy_called) -{ - this->destroy_called_ = false; // Sanity check. -} - -Server_Request_Interceptor::~Server_Request_Interceptor (void) -{ - // ORB::destroy() should have been called, which in turn should have - // called the Interceptor::destroy() method in all registered - // interceptors. - ACE_ASSERT (this->destroy_called_ == true); -} - -char * -Server_Request_Interceptor::name (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - return CORBA::string_dup ("Server_Request_Interceptor"); -} - -void -Server_Request_Interceptor::destroy (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - this->destroy_called_ = true; -} - -void -Server_Request_Interceptor::receive_request_service_contexts ( - PortableInterceptor::ServerRequestInfo_ptr - ACE_ENV_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableInterceptor::ForwardRequest)) -{ - // Interceptor::destroy() should not have been called yet. - ACE_ASSERT (this->destroy_called_ == false); -} - -void -Server_Request_Interceptor::receive_request ( - PortableInterceptor::ServerRequestInfo_ptr - ACE_ENV_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableInterceptor::ForwardRequest)) - -{ - // Interceptor::destroy() should not have been called yet. - ACE_ASSERT (this->destroy_called_ == false); -} - -void -Server_Request_Interceptor::send_reply ( - PortableInterceptor::ServerRequestInfo_ptr - ACE_ENV_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - // Interceptor::destroy() should not have been called yet. - ACE_ASSERT (this->destroy_called_ == false); -} - -void -Server_Request_Interceptor::send_exception ( - PortableInterceptor::ServerRequestInfo_ptr - ACE_ENV_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableInterceptor::ForwardRequest)) -{ - // Interceptor::destroy() should not have been called yet. - ACE_ASSERT (this->destroy_called_ == false); -} - -void -Server_Request_Interceptor::send_other ( - PortableInterceptor::ServerRequestInfo_ptr - ACE_ENV_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableInterceptor::ForwardRequest)) -{ - // Interceptor::destroy() should not have been called yet. - ACE_ASSERT (this->destroy_called_ == false); -} diff --git a/TAO/tests/Portable_Interceptors/ORB_Shutdown/Server_Request_Interceptor.h b/TAO/tests/Portable_Interceptors/ORB_Shutdown/Server_Request_Interceptor.h deleted file mode 100644 index 10e3add572b..00000000000 --- a/TAO/tests/Portable_Interceptors/ORB_Shutdown/Server_Request_Interceptor.h +++ /dev/null @@ -1,116 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file Server_Request_Interceptor.h - * - * $Id$ - * - * Implementation header for the server request interceptor for the - * PortableInterceptor ORB::shutdown() test. - * - * @author Ossama Othman <ossama@dre.vanderbilt.edu> - */ -//============================================================================= - -#ifndef SERVER_REQUEST_INTERCEPTOR_H -#define SERVER_REQUEST_INTERCEPTOR_H - -#include "ace/config-all.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "tao/PI_Server/PI_Server.h" -#include "tao/PortableInterceptorC.h" -#include "tao/LocalObject.h" - -#if defined(_MSC_VER) -#pragma warning(push) -#pragma warning(disable:4250) -#endif /* _MSC_VER */ - -/** - * @class Server_Request_Interceptor - * - * @brief Simple concrete server request interceptor. - * - * This server request interceptor simply determines if its @c - * destroy() method is invoked out of order. - * - * See the README file for test details. - */ -class Server_Request_Interceptor - : public virtual PortableInterceptor::ServerRequestInterceptor, - public virtual TAO_Local_RefCounted_Object -{ -public: - - /// Constructor. - Server_Request_Interceptor (bool & destroy_called); - - /** - * @name Methods Required by the Server Request Interceptor - * Interface - * - * These are methods that must be implemented since they are pure - * virtual in the abstract base class. They are the canonical - * methods required for all server request interceptors. - */ - //@{ - /// Return the name of this ServerRequestinterceptor. - virtual char * name (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - virtual void destroy (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - virtual void receive_request_service_contexts ( - PortableInterceptor::ServerRequestInfo_ptr ri - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableInterceptor::ForwardRequest)); - - virtual void receive_request ( - PortableInterceptor::ServerRequestInfo_ptr ri - 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 ri - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableInterceptor::ForwardRequest)); - //@} - -protected: - - /// Destructor. - ~Server_Request_Interceptor (void); - -private: - - /// Flag that states whether this interceptor's @c destroy() method - /// was called. - bool & destroy_called_; - -}; - -#if defined(_MSC_VER) -#pragma warning(pop) -#endif /* _MSC_VER */ - -#endif /* SERVER_REQUEST_INTERCEPTOR_H */ diff --git a/TAO/tests/Portable_Interceptors/ORB_Shutdown/client.cpp b/TAO/tests/Portable_Interceptors/ORB_Shutdown/client.cpp deleted file mode 100644 index ca70543c315..00000000000 --- a/TAO/tests/Portable_Interceptors/ORB_Shutdown/client.cpp +++ /dev/null @@ -1,91 +0,0 @@ -// -*- C++ -*- - -#include "ace/Get_Opt.h" - -#include "testC.h" - - -ACE_RCSID (ORB_Shutdown, - client, - "$Id$") - - -const char *ior = 0; - -int -parse_args (int argc, char *argv[]) -{ - ACE_Get_Opt get_opts (argc, argv, "k:"); - int c; - - while ((c = get_opts ()) != -1) - switch (c) - { - case 'k': - - if (ior == 0) - ior = get_opts.opt_arg (); - - break; - default: - ACE_ERROR_RETURN ((LM_ERROR, - "Usage: %s " - "-k IOR\n", - argv[0]), - -1); - } - - return 0; -} - -int -main (int argc, char *argv[]) -{ - ACE_DECLARE_NEW_CORBA_ENV; - ACE_TRY - { - CORBA::ORB_var orb = CORBA::ORB_init (argc, - argv, - "Client ORB" - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - if (::parse_args (argc, argv) != 0) - return -1; - - CORBA::Object_var object = - orb->string_to_object (ior - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - test_var server = test::_narrow (object.in () - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - if (CORBA::is_nil (server.in ())) - { - ACE_ERROR_RETURN ((LM_ERROR, - "Object reference <%s> is nil\n", - ior), - 1); - } - - server->hello (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - - server->shutdown (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - } - ACE_CATCHANY - { - ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, - "Caught exception:"); - return -1; - } - ACE_ENDTRY; - - ACE_DEBUG ((LM_INFO, - "PortableInterceptor ORB::shutdown() test passed.\n")); - - return 0; -} diff --git a/TAO/tests/Portable_Interceptors/ORB_Shutdown/run_test.pl b/TAO/tests/Portable_Interceptors/ORB_Shutdown/run_test.pl deleted file mode 100755 index 6c03ec53a45..00000000000 --- a/TAO/tests/Portable_Interceptors/ORB_Shutdown/run_test.pl +++ /dev/null @@ -1,53 +0,0 @@ -eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' - & eval 'exec perl -S $0 $argv:q' - if 0; - -# -*- perl -*- -# -# $Id$ - - -use lib '../../../../bin'; -use PerlACE::Run_Test; - -$file = PerlACE::LocalFile ("test.ior"); - -unlink $file; - -if (PerlACE::is_vxworks_test()) { - $SV = new PerlACE::ProcessVX ("server", "-o test.ior"); -} -else { - $SV = new PerlACE::Process ("server", "-o $file"); -} -$CL = new PerlACE::Process ("client", "-k file://$file"); - -$status = 0; - -print STDERR "\n\n==== Running PortableInterceptor ORB::shutdown() test\n"; - -$SV->Spawn (); - -if (PerlACE::waitforfile_timed ($file, 15) == -1) { - print STDERR "ERROR: cannot find file <$file>\n"; - $SV->Kill (); - exit 1; -} - -$client = $CL->SpawnWaitKill (60); - -if ($client != 0) { - print STDERR "ERROR: client returned $client\n"; - $status = 1; -} - -$server = $SV->WaitKill (5); - -if ($server != 0) { - print STDERR "ERROR: server returned $server\n"; - $status = 1; -} - -unlink $file; - -exit $status; diff --git a/TAO/tests/Portable_Interceptors/ORB_Shutdown/server.cpp b/TAO/tests/Portable_Interceptors/ORB_Shutdown/server.cpp deleted file mode 100644 index 000fda92d76..00000000000 --- a/TAO/tests/Portable_Interceptors/ORB_Shutdown/server.cpp +++ /dev/null @@ -1,138 +0,0 @@ -#include "ace/Get_Opt.h" - -#include "test_i.h" -#include "Server_ORBInitializer.h" -#include "Server_Request_Interceptor.h" - -#include "tao/ORBInitializer_Registry.h" -#include "ace/OS_NS_stdio.h" - - -ACE_RCSID (ORB_Shutdown, - server, - "$Id$") - - -const char *ior_file = 0; - -int -parse_args (int argc, char *argv[]) -{ - ACE_Get_Opt get_opts (argc, argv, "o:"); - int c; - - while ((c = get_opts ()) != -1) - switch (c) - { - case 'o': - ior_file = get_opts.opt_arg (); - break; - default: - ACE_ERROR_RETURN ((LM_ERROR, - "Usage: %s " - "-o IOR\n", - argv[0]), - -1); - } - - return 0; -} - -int -main (int argc, char *argv[]) -{ - ACE_DECLARE_NEW_CORBA_ENV; - ACE_TRY - { - bool destroy_called = false; - -#if TAO_HAS_INTERCEPTORS == 1 - Server_ORBInitializer *temp_initializer = 0; - ACE_NEW_RETURN (temp_initializer, - Server_ORBInitializer (destroy_called), - -1); // No exceptions yet! - PortableInterceptor::ORBInitializer_var orb_initializer = - temp_initializer; - - PortableInterceptor::register_orb_initializer (orb_initializer.in () - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; -#endif /* TAO_HAS_INTERCEPTORS == 1 */ - - CORBA::ORB_var orb = - CORBA::ORB_init (argc, argv, "Server ORB" ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - CORBA::Object_var poa_object = - orb->resolve_initial_references ("RootPOA" ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - if (CORBA::is_nil (poa_object.in ())) - ACE_ERROR_RETURN ((LM_ERROR, - " (%P|%t) Unable to initialize the POA.\n"), - 1); - - PortableServer::POA_var root_poa = - PortableServer::POA::_narrow (poa_object.in () ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - PortableServer::POAManager_var poa_manager = - root_poa->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - - poa_manager->activate (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - - if (::parse_args (argc, argv) != 0) - return -1; - - test_i servant (orb.in ()); - - CORBA::Object_var obj = - servant._this (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - - CORBA::String_var ior = - orb->object_to_string (obj.in () - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - ACE_DEBUG ((LM_DEBUG, - "test servant: <%s>\n", - ior.in ())); - - // Write IOR to a file. - FILE *output_file= ACE_OS::fopen (ior_file, "w"); - if (output_file == 0) - ACE_ERROR_RETURN ((LM_ERROR, - "Cannot open output file <%s> for writing " - "IOR: %s", - ior.in ()), - 1); - ACE_OS::fprintf (output_file, "%s", ior.in ()); - ACE_OS::fclose (output_file); - - // Run the ORB event loop. - orb->run (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - - root_poa->destroy (1, 1 ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - orb->destroy (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - - ACE_ASSERT (destroy_called == true); - - ACE_DEBUG ((LM_DEBUG, "Event loop finished.\n")); - } - ACE_CATCHANY - { - ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, - "Caught exception:"); - return -1; - } - ACE_ENDTRY; - - return 0; -} diff --git a/TAO/tests/Portable_Interceptors/ORB_Shutdown/test.idl b/TAO/tests/Portable_Interceptors/ORB_Shutdown/test.idl deleted file mode 100644 index a186afb08e8..00000000000 --- a/TAO/tests/Portable_Interceptors/ORB_Shutdown/test.idl +++ /dev/null @@ -1,21 +0,0 @@ -// -*- IDL -*- - -//============================================================================= -/** - * @file test.idl - * - * $Id$ - * - * Simple IDL file to test PortableInterceptor/ORB::shutdown() - * semantics. - * - * @author Ossama Othman <ossama@dre.vanderbilt.edu> - */ -//============================================================================= - -interface test -{ - void hello (); - - oneway void shutdown (); -}; diff --git a/TAO/tests/Portable_Interceptors/ORB_Shutdown/test_i.cpp b/TAO/tests/Portable_Interceptors/ORB_Shutdown/test_i.cpp deleted file mode 100644 index 8e96015a4c1..00000000000 --- a/TAO/tests/Portable_Interceptors/ORB_Shutdown/test_i.cpp +++ /dev/null @@ -1,34 +0,0 @@ -#include "test_i.h" - - -ACE_RCSID (ORB_Shutdown, - test_i, - "$Id$") - - -test_i::test_i (CORBA::ORB_ptr orb) - : orb_ (CORBA::ORB::_duplicate (orb)) -{ -} - -test_i::~test_i (void) -{ -} - -void -test_i::hello (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - ACE_DEBUG ((LM_DEBUG, "Hello!\n")); -} - -void -test_i::shutdown (ACE_ENV_SINGLE_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - ACE_DEBUG ((LM_DEBUG, - "Shutting down ORB.\n")); - - this->orb_->shutdown (0 - ACE_ENV_ARG_PARAMETER); -} diff --git a/TAO/tests/Portable_Interceptors/ORB_Shutdown/test_i.h b/TAO/tests/Portable_Interceptors/ORB_Shutdown/test_i.h deleted file mode 100644 index 4ada828b0c2..00000000000 --- a/TAO/tests/Portable_Interceptors/ORB_Shutdown/test_i.h +++ /dev/null @@ -1,53 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file test_i.h - * - * $Id$ - * - * Implementation header for the "test" IDL interface for the - * PortableInterceptor ORB::shutdown() test. - * - * @author Ossama Othman <ossama@dre.vanderbilt.edu> - */ -//============================================================================= - -#ifndef TEST_I_H -#define TEST_I_H - -#include "testS.h" - -/** - * @class test_i - * - * @brief Simple test class. - * - * This class implements the "test" interface used in this test. - */ -class test_i : public virtual POA_test -{ -public: - - /// Constructor. - test_i (CORBA::ORB_ptr orb); - - /// Destructor. - ~test_i (void); - - /// Say hello. - virtual void hello (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - /// Shutdown the ORB. - virtual void shutdown (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - -private: - - /// Pseudo-reference to the ORB. - CORBA::ORB_var orb_; - -}; - -#endif /* TEST_I_H */ diff --git a/TAO/tests/Portable_Interceptors/PICurrent/.cvsignore b/TAO/tests/Portable_Interceptors/PICurrent/.cvsignore deleted file mode 100644 index f2ad85300eb..00000000000 --- a/TAO/tests/Portable_Interceptors/PICurrent/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -client -server diff --git a/TAO/tests/Portable_Interceptors/PICurrent/ClientORBInitializer.cpp b/TAO/tests/Portable_Interceptors/PICurrent/ClientORBInitializer.cpp deleted file mode 100644 index 425c916436e..00000000000 --- a/TAO/tests/Portable_Interceptors/PICurrent/ClientORBInitializer.cpp +++ /dev/null @@ -1,70 +0,0 @@ -// -*- C++ -*- - -#include "ClientORBInitializer.h" -#include "ClientRequestInterceptor.h" - -#include "tao/ORB_Constants.h" - -#include "ace/Log_Msg.h" - -ACE_RCSID (PICurrent, - ClientORBInitializer, - "$Id$") - - -PortableInterceptor::SlotId slot_id = 2093843211; - - -void -ClientORBInitializer::pre_init ( - PortableInterceptor::ORBInitInfo_ptr /* info */ - ACE_ENV_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ -} - -void -ClientORBInitializer::post_init ( - PortableInterceptor::ORBInitInfo_ptr info - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - CORBA::Object_var obj = - info->resolve_initial_references ("PICurrent" - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - - PortableInterceptor::Current_var pi_current = - PortableInterceptor::Current::_narrow (obj.in () - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - - if (CORBA::is_nil (pi_current.in ())) - { - ACE_ERROR ((LM_ERROR, - "(%P|%t) ERROR: Could not resolve PICurrent object.\n")); - - ACE_THROW (CORBA::INTERNAL ()); - } - - ::slot_id = info->allocate_slot_id (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; - - PortableInterceptor::ClientRequestInterceptor_ptr foo; - ACE_NEW_THROW_EX (foo, - ClientRequestInterceptor (::slot_id, - pi_current.in ()), - CORBA::NO_MEMORY ( - CORBA::SystemException::_tao_minor_code ( - TAO::VMCID, - ENOMEM), - CORBA::COMPLETED_NO)); - ACE_CHECK; - - PortableInterceptor::ClientRequestInterceptor_var interceptor = - foo; - - info->add_client_request_interceptor (interceptor.in () - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; -} diff --git a/TAO/tests/Portable_Interceptors/PICurrent/ClientORBInitializer.h b/TAO/tests/Portable_Interceptors/PICurrent/ClientORBInitializer.h deleted file mode 100644 index f540262ca7b..00000000000 --- a/TAO/tests/Portable_Interceptors/PICurrent/ClientORBInitializer.h +++ /dev/null @@ -1,81 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file ClientORBInitializer.h - * - * $Id$ - * - * @author Ossama Othman <ossama@uci.edu> - */ -//============================================================================= - -#ifndef CLIENT_ORB_INITIALIZER_H -#define CLIENT_ORB_INITIALIZER_H - -#include "ace/config-all.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "tao/PI/PI.h" -#include "tao/LocalObject.h" - -#if defined(_MSC_VER) -#pragma warning(push) -#pragma warning(disable:4250) -#endif /* _MSC_VER */ - - -// Test's SlotId made global for ease of implementation. -// It is initialized to a large number to make it obvious when the -// SlotId is invalid. -// -// Don't do this if you have more than one ORB in your application or -// if thread-safety is an issue!!! -extern PortableInterceptor::SlotId slot_id; - - -/** - * @class ClientORBInitializer - * - * @brief Simple concrete ORB initializer. - * - * This is a test ORB initializer that registers an - * ClientRequestInterceptor for this test. - */ -class ClientORBInitializer : - public virtual PortableInterceptor::ORBInitializer, - public virtual TAO_Local_RefCounted_Object -{ -public: - - /** - * @name Methods Required by the ORBInitializer Interface - * - * These are methods that must be implemented since they are pure - * virtual in the abstract base class. They are the canonical - * methods required for all ORB initializers. - */ - //@{ - /// The pre-initialization hook. - virtual void pre_init ( - PortableInterceptor::ORBInitInfo_ptr info - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - /// The post-initialization hook. - virtual void post_init ( - PortableInterceptor::ORBInitInfo_ptr info - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - //@} - -}; - -#if defined(_MSC_VER) -#pragma warning(pop) -#endif /* _MSC_VER */ - -#endif /* CLIENT_ORB_INITIALIZER_H */ diff --git a/TAO/tests/Portable_Interceptors/PICurrent/ClientRequestInterceptor.cpp b/TAO/tests/Portable_Interceptors/PICurrent/ClientRequestInterceptor.cpp deleted file mode 100644 index 66a253f3074..00000000000 --- a/TAO/tests/Portable_Interceptors/PICurrent/ClientRequestInterceptor.cpp +++ /dev/null @@ -1,156 +0,0 @@ -#include "ClientRequestInterceptor.h" - -#include "tao/CORBA_String.h" - -#include "ace/Log_Msg.h" -#include "ace/OS_NS_string.h" - - -ACE_RCSID (PICurrent, - ClientRequestInterceptor, - "$Id$") - - -ClientRequestInterceptor::ClientRequestInterceptor ( - PortableInterceptor::SlotId id, - PortableInterceptor::Current_ptr pi_current) - : slot_id_ (id), - pi_current_ (PortableInterceptor::Current::_duplicate (pi_current)) -{ -} - -char * -ClientRequestInterceptor::name ( - ACE_ENV_SINGLE_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - return CORBA::string_dup ("ClientRequestInterceptor"); -} - -void -ClientRequestInterceptor::destroy (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ -} - -void -ClientRequestInterceptor::send_request ( - PortableInterceptor::ClientRequestInfo_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 (), "invoke_me") != 0) - return; // Don't mess with PICurrent if not invoking test method. - - ACE_TRY - { - // Retrieve data from the RSC (request scope current). - CORBA::Long number = 0; - - CORBA::Any_var data = - ri->get_slot (this->slot_id_ - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - if (!(data.in () >>= number)) - { - ACE_ERROR ((LM_ERROR, - "(%P|%t) ERROR: Unable to extract data from Any.\n")); - - ACE_TRY_THROW (CORBA::INTERNAL ()); - } - - ACE_DEBUG ((LM_DEBUG, - "(%P|%t) Extracted <%d> from RSC slot %u\n", - number, - this->slot_id_)); - - CORBA::Any new_data; - CORBA::String_var s = CORBA::string_dup ("Et tu Brute?"); - - new_data <<= s.in (); - - // Now reset the contents of our slot in the thread-scope - // current (TSC). - this->pi_current_->set_slot (this->slot_id_, - new_data - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - // Now retrieve the data from the RSC again. It should not have - // changed! - CORBA::Long number2 = -1; - - CORBA::Any_var data2 = - ri->get_slot (this->slot_id_ - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - if (!(data2.in () >>= number2) - || number != number2) - { - ACE_ERROR ((LM_ERROR, - "(%P|%t) ERROR: RSC was modified after " - "TSC was modified.\n")); - - ACE_TRY_THROW (CORBA::INTERNAL ()); - } - - } - ACE_CATCH (PortableInterceptor::InvalidSlot, ex) - { - ACE_PRINT_EXCEPTION (ex, - "Exception thrown in " - "send_request()\n"); - - ACE_DEBUG ((LM_DEBUG, - "Invalid slot: %u\n", - this->slot_id_)); - - ACE_TRY_THROW (CORBA::INTERNAL ()); - } - ACE_ENDTRY; - ACE_CHECK; - - ACE_DEBUG ((LM_INFO, - "(%P|%t) Client side RSC/TSC semantics appear " - "to be correct.\n")); -} - -void -ClientRequestInterceptor::send_poll ( - PortableInterceptor::ClientRequestInfo_ptr - ACE_ENV_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ -} - -void -ClientRequestInterceptor::receive_reply ( - PortableInterceptor::ClientRequestInfo_ptr - ACE_ENV_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ -} - -void -ClientRequestInterceptor::receive_exception ( - PortableInterceptor::ClientRequestInfo_ptr - ACE_ENV_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableInterceptor::ForwardRequest)) -{ -} - -void -ClientRequestInterceptor::receive_other ( - PortableInterceptor::ClientRequestInfo_ptr - ACE_ENV_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableInterceptor::ForwardRequest)) -{ -} diff --git a/TAO/tests/Portable_Interceptors/PICurrent/ClientRequestInterceptor.h b/TAO/tests/Portable_Interceptors/PICurrent/ClientRequestInterceptor.h deleted file mode 100644 index c4709fff0a6..00000000000 --- a/TAO/tests/Portable_Interceptors/PICurrent/ClientRequestInterceptor.h +++ /dev/null @@ -1,113 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file ClientRequestInterceptor.h - * - * $Id$ - * - * @author Ossama Othman <ossama@uci.edu> - */ -//============================================================================= - -#ifndef CLIENT_REQUEST_INTERCEPTOR_H -#define CLIENT_REQUEST_INTERCEPTOR_H - -#include "ace/config-all.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "tao/PI/PI.h" -#include "tao/PortableInterceptorC.h" -#include "tao/LocalObject.h" - -#if defined(_MSC_VER) -#pragma warning(push) -#pragma warning(disable:4250) -#endif /* _MSC_VER */ - -/** - * @class ClientRequestInterceptor - * - * @brief Simple concrete client request interceptor. - * - * This is a test client request interceptor that verifies that the - * client side PICurrent semantics are correct. In particular, it - * verifies that the request-scope current (RSC) is not modified after - * the contents of the thread-scope current (TSC) are copied to it. - * This is particularly important for ORBs that initially perform a - * logical copy for performance reasons. - */ -class ClientRequestInterceptor - : public virtual PortableInterceptor::ClientRequestInterceptor, - public virtual TAO_Local_RefCounted_Object -{ -public: - - /// Constructor. - ClientRequestInterceptor (PortableInterceptor::SlotId slot_id, - PortableInterceptor::Current_ptr pi_current); - - /** - * @name Methods Required by the Client Request Interceptor - * Interface - * - * These are methods that must be implemented since they are pure - * virtual in the abstract base class. They are the canonical - * methods required for all client request interceptors. - */ - //@{ - /// Return the name of this ClientRequestInterceptor. - virtual char * name (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - virtual void destroy (ACE_ENV_SINGLE_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 send_poll ( - PortableInterceptor::ClientRequestInfo_ptr ri - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - 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)); - - virtual void receive_other ( - PortableInterceptor::ClientRequestInfo_ptr ri - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableInterceptor::ForwardRequest)); - //@} - -private: - - /// The PICurrent slot ID allocated to this application during ORB - /// initialization. - PortableInterceptor::SlotId slot_id_; - - /// Reference to the PICurrent object. - PortableInterceptor::Current_var pi_current_; - -}; - -#if defined(_MSC_VER) -#pragma warning(pop) -#endif /* _MSC_VER */ - -#endif /* CLIENT_REQUEST_INTERCEPTOR_H */ diff --git a/TAO/tests/Portable_Interceptors/PICurrent/ClientRequestInterceptor2.cpp b/TAO/tests/Portable_Interceptors/PICurrent/ClientRequestInterceptor2.cpp deleted file mode 100644 index 5eae8540505..00000000000 --- a/TAO/tests/Portable_Interceptors/PICurrent/ClientRequestInterceptor2.cpp +++ /dev/null @@ -1,127 +0,0 @@ -#include "ClientRequestInterceptor2.h" - -#include "tao/CORBA_String.h" - -#include "ace/Log_Msg.h" -#include "ace/OS_NS_string.h" - -ACE_RCSID (PICurrent, - ClientRequestInterceptor2, - "$Id$") - - -ClientRequestInterceptor2::ClientRequestInterceptor2 ( - PortableInterceptor::SlotId id) - : slot_id_ (id) -{ -} - -char * -ClientRequestInterceptor2::name ( - ACE_ENV_SINGLE_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - return CORBA::string_dup ("ClientRequestInterceptor2"); -} - -void -ClientRequestInterceptor2::destroy (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ -} - -void -ClientRequestInterceptor2::send_request ( - PortableInterceptor::ClientRequestInfo_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 (), "invoke_you") != 0) - return; // Don't mess with PICurrent if not invoking test method. - - ACE_TRY - { - // The goal of this test is to verify that a request scope - // current was successfully shallow copied from a TSC that - // itself was shallow copied from a ServerRequestInfo's RSC. - // Specifically, verify that the RSC->TSC->RSC sequence of - // copies occurred correctly. - - // Retrieve data from the RSC (request scope current). - CORBA::Long number = 0; - - CORBA::Any_var data = - ri->get_slot (this->slot_id_ - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - if (!(data.in () >>= number)) - { - ACE_ERROR ((LM_ERROR, - "(%P|%t) ERROR: Unable to extract data from " - "CORBA::Any retrieved from RSC.\n")); - - ACE_TRY_THROW (CORBA::INTERNAL ()); - } - - ACE_DEBUG ((LM_DEBUG, - "(%P|%t) Extracted <%d> from RSC slot %u\n", - number, - this->slot_id_)); - } - ACE_CATCH (PortableInterceptor::InvalidSlot, ex) - { - ACE_PRINT_EXCEPTION (ex, - "Exception thrown in " - "send_request()\n"); - - ACE_DEBUG ((LM_DEBUG, - "Invalid slot: %u\n", - this->slot_id_)); - - ACE_TRY_THROW (CORBA::INTERNAL ()); - } - ACE_ENDTRY; - ACE_CHECK; - - ACE_DEBUG ((LM_INFO, - "(%P|%t) RSC->TSC->RSC copying appears to be working.\n")); -} - -void -ClientRequestInterceptor2::send_poll ( - PortableInterceptor::ClientRequestInfo_ptr - ACE_ENV_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ -} - -void -ClientRequestInterceptor2::receive_reply ( - PortableInterceptor::ClientRequestInfo_ptr - ACE_ENV_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ -} - -void -ClientRequestInterceptor2::receive_exception ( - PortableInterceptor::ClientRequestInfo_ptr - ACE_ENV_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableInterceptor::ForwardRequest)) -{ -} - -void -ClientRequestInterceptor2::receive_other ( - PortableInterceptor::ClientRequestInfo_ptr - ACE_ENV_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableInterceptor::ForwardRequest)) -{ -} diff --git a/TAO/tests/Portable_Interceptors/PICurrent/ClientRequestInterceptor2.h b/TAO/tests/Portable_Interceptors/PICurrent/ClientRequestInterceptor2.h deleted file mode 100644 index cfca53a52d6..00000000000 --- a/TAO/tests/Portable_Interceptors/PICurrent/ClientRequestInterceptor2.h +++ /dev/null @@ -1,106 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file ClientRequestInterceptor2.h - * - * $Id$ - * - * @author Ossama Othman <ossama@uci.edu> - */ -//============================================================================= - -#ifndef CLIENT_REQUEST_INTERCEPTOR2_H -#define CLIENT_REQUEST_INTERCEPTOR2_H - -#include "ace/config-all.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "tao/PI/PI.h" -#include "tao/PortableInterceptorC.h" -#include "tao/LocalObject.h" - -#if defined(_MSC_VER) -#pragma warning(push) -#pragma warning(disable:4250) -#endif /* _MSC_VER */ - -/** - * @class ClientRequestInterceptor2 - * - * @brief Simple concrete client request interceptor. - * - * This is a test client request interceptor that verifies that is - * used when verifying that the RSC->TSC->RSC copying semantics work - * as expected. - */ -class ClientRequestInterceptor2 - : public virtual PortableInterceptor::ClientRequestInterceptor, - public virtual TAO_Local_RefCounted_Object -{ -public: - - /// Constructor. - ClientRequestInterceptor2 (PortableInterceptor::SlotId slot_id); - - /** - * @name Methods Required by the Client Request Interceptor - * Interface - * - * These are methods that must be implemented since they are pure - * virtual in the abstract base class. They are the canonical - * methods required for all client request interceptors. - */ - //@{ - /// Return the name of this ClientRequestInterceptor. - virtual char * name (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - virtual void destroy (ACE_ENV_SINGLE_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 send_poll ( - PortableInterceptor::ClientRequestInfo_ptr ri - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - 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)); - - virtual void receive_other ( - PortableInterceptor::ClientRequestInfo_ptr ri - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableInterceptor::ForwardRequest)); - //@} - -private: - - /// The PICurrent slot ID allocated to this application during ORB - /// initialization. - PortableInterceptor::SlotId slot_id_; - -}; - -#if defined(_MSC_VER) -#pragma warning(pop) -#endif /* _MSC_VER */ - -#endif /* CLIENT_REQUEST_INTERCEPTOR_H */ diff --git a/TAO/tests/Portable_Interceptors/PICurrent/PI_PICurrent.mpc b/TAO/tests/Portable_Interceptors/PICurrent/PI_PICurrent.mpc deleted file mode 100644 index 39a60cd5c75..00000000000 --- a/TAO/tests/Portable_Interceptors/PICurrent/PI_PICurrent.mpc +++ /dev/null @@ -1,23 +0,0 @@ -// -*- MPC -*- -// $Id$ - -project(*Server): taoserver, pi_server, interceptors { - Source_Files { - test_i.cpp - ServerORBInitializer.cpp - ServerRequestInterceptor.cpp - ClientRequestInterceptor2.cpp - server.cpp - } -} - -project(*Client): taoclient, pi, interceptors { - after += *Server - Source_Files { - testC.cpp - ClientORBInitializer.cpp - ClientRequestInterceptor.cpp - client.cpp - } -} - diff --git a/TAO/tests/Portable_Interceptors/PICurrent/README b/TAO/tests/Portable_Interceptors/PICurrent/README deleted file mode 100644 index 275a73e9974..00000000000 --- a/TAO/tests/Portable_Interceptors/PICurrent/README +++ /dev/null @@ -1,30 +0,0 @@ -# -# $Id$ -# - -This test verifies that the "PICurrent" object semantics are correct -on both the client side and the server side. In particular, it -attempts to make sure the request scope current (RSC) and thread scope -current (TSC) copying semantics are correct when transitioning between -the two scopes on both the client and server sides. This is -accomplished by setting and getting elements of different types in the -RSC and TSC slot tables at various points during the course of an -invocation. - -Expected output is along the lines of the following: - -==== Running PICurrent test -PICurrentTest::test: <IOR:010000001b000000...> -(9378|1078768288) Extracted <46> from RSC slot 0 -(9378|1078768288) Client side RSC/TSC semantics appear to be correct. -(9377|1080582944) Inserted number <62> into RSC. -Test method invoked. -(9377|1080582944) Retrieved number <62> from TSC. -(9377|1080582944) Extracted <62> from RSC slot 0 -(9377|1080582944) RSC->TSC->RSC copying appears to be working. -(9377|1080582944) String "Drink milk!" inserted into TSC. -(9377|1080582944) Retrieved "Drink milk!" from the RSC. -(9377|1080582944) Server side RSC/TSC semantics appear to be correct. -(9378|1078768288) Retrieved "Et tu Brute?" from the TSC. -(9377|1080582944) Server is shutting down. -Event loop finished. diff --git a/TAO/tests/Portable_Interceptors/PICurrent/ServerORBInitializer.cpp b/TAO/tests/Portable_Interceptors/PICurrent/ServerORBInitializer.cpp deleted file mode 100644 index daa05dfb4ad..00000000000 --- a/TAO/tests/Portable_Interceptors/PICurrent/ServerORBInitializer.cpp +++ /dev/null @@ -1,97 +0,0 @@ -// -*- C++ -*- - -#include "ServerORBInitializer.h" -#include "ServerRequestInterceptor.h" -#include "ClientRequestInterceptor2.h" -#include "tao/PI/ORBInitInfo.h" -#include "tao/ORB_Core.h" - -ACE_RCSID (PICurrent, - ServerORBInitializer, - "$Id$") - -PortableInterceptor::SlotId slot_id = 2093843221; - -void -ServerORBInitializer::pre_init ( - PortableInterceptor::ORBInitInfo_ptr /* info */ - ACE_ENV_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ -} - -void -ServerORBInitializer::post_init ( - PortableInterceptor::ORBInitInfo_ptr info - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - CORBA::Object_var obj = - info->resolve_initial_references ("PICurrent" - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - - PortableInterceptor::Current_var pi_current = - PortableInterceptor::Current::_narrow (obj.in () - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - - if (CORBA::is_nil (pi_current.in ())) - { - ACE_ERROR ((LM_ERROR, - "(%P|%t) ERROR: Could not resolve PICurrent object.\n")); - - ACE_THROW (CORBA::INTERNAL ()); - } - - ::slot_id = info->allocate_slot_id (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; - - PortableInterceptor::ServerRequestInterceptor_ptr server_tmp; - ACE_NEW_THROW_EX (server_tmp, - ServerRequestInterceptor (::slot_id, - pi_current.in ()), - CORBA::NO_MEMORY ( - CORBA::SystemException::_tao_minor_code ( - TAO::VMCID, - ENOMEM), - CORBA::COMPLETED_NO)); - ACE_CHECK; - - PortableInterceptor::ServerRequestInterceptor_var server_interceptor = - server_tmp; - - info->add_server_request_interceptor (server_interceptor.in () - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - - PortableInterceptor::ClientRequestInterceptor_ptr client_tmp; - ACE_NEW_THROW_EX (client_tmp, - ClientRequestInterceptor2 (::slot_id), - CORBA::NO_MEMORY ( - CORBA::SystemException::_tao_minor_code ( - TAO::VMCID, - ENOMEM), - CORBA::COMPLETED_NO)); - ACE_CHECK; - - PortableInterceptor::ClientRequestInterceptor_var client_interceptor = - client_tmp; - - info->add_client_request_interceptor (client_interceptor.in () - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - - // Disable collocation -- TAO-specific!!! - // - // Collocation optimizations must be disabled since TAO doesn't - // implement interceptor support for THRU_POA collocated - // invocations yet, and we need to force a client request - // interceptor to be invoked in this server. - TAO_ORBInitInfo_var tao_info = - TAO_ORBInitInfo::_narrow (info - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - - tao_info->orb_core ()->optimize_collocation_objects (0); -} diff --git a/TAO/tests/Portable_Interceptors/PICurrent/ServerORBInitializer.h b/TAO/tests/Portable_Interceptors/PICurrent/ServerORBInitializer.h deleted file mode 100644 index 9c997d45f6c..00000000000 --- a/TAO/tests/Portable_Interceptors/PICurrent/ServerORBInitializer.h +++ /dev/null @@ -1,82 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file ServerORBInitializer.h - * - * $Id$ - * - * Implementation header for the PICurrentTest server-side ORB - * initializer. - * - * @author Ossama Othman <ossama@uci.edu> - */ -//============================================================================= - -#ifndef SERVER_ORB_INITIALIZER_H -#define SERVER_ORB_INITIALIZER_H - -#include "ace/config-all.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "tao/PI/PI.h" -#include "tao/LocalObject.h" - -#if defined(_MSC_VER) -#pragma warning(push) -#pragma warning(disable:4250) -#endif /* _MSC_VER */ - -// Test's SlotId made global for ease of implementation. -// It is initialized to a large number to make it obvious when the -// SlotId is invalid. -// -// Don't do this if you have more than one ORB in your application or -// if thread-safety is an issue!!! -extern PortableInterceptor::SlotId slot_id; - -/** - * @class ServerORBInitializer - * - * @brief Simple concrete ORB initializer. - * - * This is a test ORB initializer that registers an IORInterceptor for - * this test. - */ -class ServerORBInitializer : - public virtual PortableInterceptor::ORBInitializer, - public virtual TAO_Local_RefCounted_Object -{ -public: - - /** - * @name Methods Required by the ORBInitializer Interface - * - * These are methods that must be implemented since they are pure - * virtual in the abstract base class. They are the canonical - * methods required for all ORB initializers. - */ - //@{ - /// The pre-initialization hook. - virtual void pre_init ( - PortableInterceptor::ORBInitInfo_ptr info - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - /// The post-initialization hook. - virtual void post_init ( - PortableInterceptor::ORBInitInfo_ptr info - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - //@} - -}; - -#if defined(_MSC_VER) -#pragma warning(pop) -#endif /* _MSC_VER */ - -#endif /* SERVER_ORB_INITIALIZER_H */ diff --git a/TAO/tests/Portable_Interceptors/PICurrent/ServerRequestInterceptor.cpp b/TAO/tests/Portable_Interceptors/PICurrent/ServerRequestInterceptor.cpp deleted file mode 100644 index a76d1d5b774..00000000000 --- a/TAO/tests/Portable_Interceptors/PICurrent/ServerRequestInterceptor.cpp +++ /dev/null @@ -1,252 +0,0 @@ -// -*- C++ -*- - -#include "ServerRequestInterceptor.h" - -#include "tao/CORBA_String.h" - -#include "ace/Log_Msg.h" -#include "ace/OS_NS_string.h" - -ACE_RCSID (PICurrent, - ServerRequestInterceptor, - "$Id$") - -ServerRequestInterceptor::ServerRequestInterceptor ( - PortableInterceptor::SlotId id, - PortableInterceptor::Current_ptr pi_current) - : slot_id_ (id), - pi_current_ (PortableInterceptor::Current::_duplicate (pi_current)) -{ -} - -char * -ServerRequestInterceptor::name (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - return CORBA::string_dup ("ServerRequestInterceptor"); -} - -void -ServerRequestInterceptor::destroy (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ -} - -void -ServerRequestInterceptor::receive_request_service_contexts ( - 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 (), "invoke_me") != 0) - return; // Don't mess with PICurrent if not invoking test method. - - ACE_TRY - { - // Insert data into the RSC (request scope current). - - CORBA::Long number = 62; - - CORBA::Any data; - data <<= number; - - ri->set_slot (this->slot_id_, data ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - ACE_DEBUG ((LM_DEBUG, - "(%P|%t) Inserted number <%d> into RSC.\n", - number)); - } - ACE_CATCH (PortableInterceptor::InvalidSlot, ex) - { - ACE_PRINT_EXCEPTION (ex, - "Exception thrown in " - "receive_request_service_contexts()\n"); - - ACE_DEBUG ((LM_DEBUG, - "Invalid slot: %u\n", - this->slot_id_)); - - ACE_TRY_THROW (CORBA::INTERNAL ()); - } - ACE_ENDTRY; - ACE_CHECK; -} - -void -ServerRequestInterceptor::receive_request ( - PortableInterceptor::ServerRequestInfo_ptr ri - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableInterceptor::ForwardRequest)) -{ - ACE_TRY - { - CORBA::Any new_data; - CORBA::Long number = 19; - new_data <<= number; - - // Set a value in RSC, this should not effect TSC anymore - ri->set_slot (this->slot_id_, - new_data - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - // Now retrieve the data from the TSC again. It should not have - // changed to the new value - CORBA::Any_var data2 = - this->pi_current_->get_slot (this->slot_id_ - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - CORBA::Long number2 = 0; - if ((data2.in () >>= number2) - && number == number2) - { - ACE_ERROR ((LM_ERROR, - "(%P|%t) ERROR: TSC was modified because " - "RSC was modified.\n")); - - ACE_TRY_THROW (CORBA::INTERNAL ()); - } - } - ACE_CATCH (PortableInterceptor::InvalidSlot, ex) - { - ACE_PRINT_EXCEPTION (ex, - "Exception thrown in " - "send_reply()\n"); - - ACE_DEBUG ((LM_DEBUG, - "Invalid slot: %u\n", - this->slot_id_)); - - ACE_TRY_THROW (CORBA::INTERNAL ()); - } - ACE_ENDTRY; - ACE_CHECK; - - ACE_DEBUG ((LM_INFO, - "(%P|%t) Server side RSC/TSC semantics appear " - "to be correct.\n")); - -} - -void -ServerRequestInterceptor::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 (), "invoke_me") != 0) - return; // Don't mess with PICurrent if not invoking test method. - - ACE_TRY - { - CORBA::Any_var data; - - // Retrieve the data stored in the RSC. This data (a string) - // should be different from the original data (a CORBA::Long) - // stored into the RSC by the receive_request_service_contexts() - // interception point. - data = ri->get_slot (this->slot_id_ ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - // The original data in the RSC was of type CORBA::Long. If the - // following extraction from the CORBA::Any fails, then the - // original data in the RSC was not replaced with the data in - // the TSC after the test method completed. - const char *str = 0; - if (data.in () >>= str) - { - ACE_DEBUG ((LM_DEBUG, - "(%P|%t) Retrieved \"%s\" from the RSC.\n", - str)); - } - else - { - ACE_DEBUG ((LM_DEBUG, - "(%P|%t) Unable to extract data (a string) " - "from the RSC.\n")); - - ACE_THROW (CORBA::INTERNAL ()); - } - - // Now verify that the RSC is truly independent of the TSC. In - // particular, modifying the TSC at this point should not cause - // the RSC to be modified. - CORBA::Any new_data; - CORBA::Long number = 19; - - new_data <<= number; - - // Now reset the contents of our slot in the thread-scope - // current (TSC). - this->pi_current_->set_slot (this->slot_id_, - new_data - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - // Now retrieve the data from the RSC again. It should not have - // changed! - CORBA::Any_var data2 = - ri->get_slot (this->slot_id_ - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - const char *str2 = 0; - if (!(data2.in () >>= str2) - || ACE_OS::strcmp (str, str2) != 0) - { - ACE_ERROR ((LM_ERROR, - "(%P|%t) ERROR: RSC was modified after " - "TSC was modified.\n")); - - ACE_TRY_THROW (CORBA::INTERNAL ()); - } - } - ACE_CATCH (PortableInterceptor::InvalidSlot, ex) - { - ACE_PRINT_EXCEPTION (ex, - "Exception thrown in " - "send_reply()\n"); - - ACE_DEBUG ((LM_DEBUG, - "Invalid slot: %u\n", - this->slot_id_)); - - ACE_TRY_THROW (CORBA::INTERNAL ()); - } - ACE_ENDTRY; - ACE_CHECK; - - ACE_DEBUG ((LM_INFO, - "(%P|%t) Server side RSC/TSC semantics appear " - "to be correct.\n")); -} - -void -ServerRequestInterceptor::send_exception ( - PortableInterceptor::ServerRequestInfo_ptr - ACE_ENV_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableInterceptor::ForwardRequest)) -{ -} - -void -ServerRequestInterceptor::send_other ( - PortableInterceptor::ServerRequestInfo_ptr - ACE_ENV_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableInterceptor::ForwardRequest)) -{ -} diff --git a/TAO/tests/Portable_Interceptors/PICurrent/ServerRequestInterceptor.h b/TAO/tests/Portable_Interceptors/PICurrent/ServerRequestInterceptor.h deleted file mode 100644 index b9cd7bf2c5d..00000000000 --- a/TAO/tests/Portable_Interceptors/PICurrent/ServerRequestInterceptor.h +++ /dev/null @@ -1,113 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file ServerRequestInterceptor.h - * - * $Id$ - * - * Implementation header for the server request interceptor for the - * PortableInterceptor::Current test. - * - * @author Ossama Othman <ossama@uci.edu> - */ -//============================================================================= - -#ifndef SERVER_REQUEST_INTERCEPTOR_H -#define SERVER_REQUEST_INTERCEPTOR_H - -#include "ace/config-all.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "tao/PI_Server/PI_Server.h" -#include "tao/PI/PI.h" -#include "tao/PortableInterceptorC.h" -#include "tao/LocalObject.h" - -#if defined(_MSC_VER) -#pragma warning(push) -#pragma warning(disable:4250) -#endif /* _MSC_VER */ - -/** - * @class ServerRequestInterceptor - * - * @brief Simple concrete server request interceptor. - * - * This server request interceptor - */ -class ServerRequestInterceptor - : public virtual PortableInterceptor::ServerRequestInterceptor, - public virtual TAO_Local_RefCounted_Object -{ -public: - - /// Constructor. - ServerRequestInterceptor (PortableInterceptor::SlotId id, - PortableInterceptor::Current_ptr pi_current); - - /** - * @name Methods Required by the Server Request Interceptor - * Interface - * - * These are methods that must be implemented since they are pure - * virtual in the abstract base class. They are the canonical - * methods required for all server request interceptors. - */ - //@{ - /// Return the name of this ServerRequestinterceptor. - virtual char * name (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - virtual void destroy (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - virtual void receive_request_service_contexts ( - PortableInterceptor::ServerRequestInfo_ptr ri - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableInterceptor::ForwardRequest)); - - virtual void receive_request ( - PortableInterceptor::ServerRequestInfo_ptr ri - 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 ri - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableInterceptor::ForwardRequest)); - //@} - -private: - - /// The PICurrent slot ID allocated to this application during ORB - /// initialization. - PortableInterceptor::SlotId slot_id_; - - /// Reference to the PICurrent object. - PortableInterceptor::Current_var pi_current_; - -}; - -#if defined(_MSC_VER) -#pragma warning(pop) -#endif /* _MSC_VER */ - -#endif /* SERVER_REQUEST_INTERCEPTOR_H */ diff --git a/TAO/tests/Portable_Interceptors/PICurrent/client.cpp b/TAO/tests/Portable_Interceptors/PICurrent/client.cpp deleted file mode 100644 index 4d98648a2ac..00000000000 --- a/TAO/tests/Portable_Interceptors/PICurrent/client.cpp +++ /dev/null @@ -1,164 +0,0 @@ -// -*- C++ -*- - -#include "ace/Get_Opt.h" - -#include "testC.h" -#include "ClientORBInitializer.h" - -#include "tao/ORBInitializer_Registry.h" -#include "tao/PI/PI.h" - -ACE_RCSID (PICurrent, - client, - "$Id$") - -const char *ior = "file://test.ior"; - -int -parse_args (int argc, char *argv[]) -{ - ACE_Get_Opt get_opts (argc, argv, "k:"); - int c; - - while ((c = get_opts ()) != -1) - switch (c) - { - case 'k': - ior = get_opts.opt_arg (); - break; - default: - ACE_ERROR_RETURN ((LM_ERROR, - "Usage: %s " - "-k IOR " - "\n", - argv[0]), - -1); - } - return 0; -} - -int -main (int argc, char *argv[]) -{ - ACE_DECLARE_NEW_CORBA_ENV; - ACE_TRY - { - PortableInterceptor::ORBInitializer_ptr temp_initializer = - PortableInterceptor::ORBInitializer::_nil (); - - ACE_NEW_RETURN (temp_initializer, - ClientORBInitializer, - -1); // No exceptions yet! - PortableInterceptor::ORBInitializer_var orb_initializer = - temp_initializer; - - PortableInterceptor::register_orb_initializer (orb_initializer.in () - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - CORBA::ORB_var orb = - CORBA::ORB_init (argc, - argv, - "client_orb" - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - if (parse_args (argc, argv) != 0) - return 1; - - // Get the PICurrent object. - CORBA::Object_var obj = - orb->resolve_initial_references ("PICurrent" - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - PortableInterceptor::Current_var pi_current = - PortableInterceptor::Current::_narrow (obj.in () - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - if (CORBA::is_nil (pi_current.in ())) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%P|%t) ERROR: Could not resolve " - "PICurrent object.\n"), - -1); - } - - // Insert some data into the allocated PICurrent slot. - CORBA::Any data; - CORBA::Long number = 46; - - data <<= number; - - // Now reset the contents of our slot in the thread-scope - // current (TSC). - pi_current->set_slot (::slot_id, - data - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - // Resolve the target object, and perform the invocation. - obj = - orb->string_to_object (ior ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - PICurrentTest::test_var server = - PICurrentTest::test::_narrow (obj.in () ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - if (CORBA::is_nil (server.in ())) - { - ACE_ERROR_RETURN ((LM_ERROR, - "Object reference <%s> is nil.\n", - ior), - 1); - } - - server->invoke_me (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - - CORBA::Any_var new_data = - pi_current->get_slot (::slot_id - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - // The original data in the TSC was of type CORBA::Long. If the - // following extraction from the CORBA::Any fails, then the - // original data in the TSC was not replaced within the client - // request interceptor, as this test should do. - const char *str = 0; - if (new_data.in () >>= str) - { - ACE_DEBUG ((LM_DEBUG, - "(%P|%t) Retrieved \"%s\" from the TSC.\n", - str)); - } - else - { - ACE_ERROR ((LM_ERROR, - "(%P|%t) Unable to extract data (a string) " - "from the TSC.\n")); - - ACE_TRY_THROW (CORBA::INTERNAL ()); - } - - server->invoke_we (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - - server->shutdown (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - - orb->destroy (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - } - ACE_CATCHANY - { - ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, - "PICurrent test (client-side):"); - return -1; - } - ACE_ENDTRY; - - return 0; -} diff --git a/TAO/tests/Portable_Interceptors/PICurrent/run_test.pl b/TAO/tests/Portable_Interceptors/PICurrent/run_test.pl deleted file mode 100755 index 8c021fc59c4..00000000000 --- a/TAO/tests/Portable_Interceptors/PICurrent/run_test.pl +++ /dev/null @@ -1,50 +0,0 @@ -eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' - & eval 'exec perl -S $0 $argv:q' - if 0; - -# -*- perl -*- -# $Id$ - -use lib '../../../../bin'; -use PerlACE::Run_Test; - -$status = 0; -$file = PerlACE::LocalFile ("test.ior"); - -unlink $file; - -if (PerlACE::is_vxworks_test()) { - $SV = new PerlACE::ProcessVX ("server", "-o test.ior"); -} -else { - $SV = new PerlACE::Process ("server", "-o $file"); -} -$CL = new PerlACE::Process ("client", "-k file://$file"); - -print STDERR "\n\n==== Running PICurrent test\n"; - -$SV->Spawn (); - -if (PerlACE::waitforfile_timed ($file, 15) == -1) { - print STDERR "ERROR: cannot find file <$file>\n"; - $SV->Kill (); - exit 1; -} - -$client = $CL->SpawnWaitKill (60); - -if ($client != 0) { - print STDERR "ERROR: client returned $client\n"; - $status = 1; -} - -$server = $SV->WaitKill (5); - -if ($server != 0) { - print STDERR "ERROR: server returned $server\n"; - $status = 1; -} - -unlink $file; - -exit $status; diff --git a/TAO/tests/Portable_Interceptors/PICurrent/server.cpp b/TAO/tests/Portable_Interceptors/PICurrent/server.cpp deleted file mode 100644 index 3e0b650480f..00000000000 --- a/TAO/tests/Portable_Interceptors/PICurrent/server.cpp +++ /dev/null @@ -1,162 +0,0 @@ -// -*- C++ -*- - -#include "ace/Get_Opt.h" - -#include "test_i.h" -#include "ServerORBInitializer.h" - -#include "tao/ORBInitializer_Registry.h" -#include "tao/PI/PI.h" -#include "ace/OS_NS_stdio.h" - -ACE_RCSID (PICurrent, - server, - "$Id$") - -const char *ior_output_file = "test.ior"; - -extern PortableInterceptor::SlotId slot_id; - -int -parse_args (int argc, char *argv[]) -{ - ACE_Get_Opt get_opts (argc, argv, "o:"); - int c; - - while ((c = get_opts ()) != -1) - switch (c) - { - case 'o': - ior_output_file = get_opts.opt_arg (); - break; - default: - ACE_ERROR_RETURN ((LM_ERROR, - "Usage: %s " - "-o <iorfile>" - "\n", - argv[0]), - -1); - } - - // Indicates sucessful parsing of the command line - return 0; -} - -int -main (int argc, char *argv[]) -{ - ACE_DECLARE_NEW_CORBA_ENV; - ACE_TRY - { - PortableInterceptor::ORBInitializer_ptr temp_initializer = - PortableInterceptor::ORBInitializer::_nil (); - - ACE_NEW_RETURN (temp_initializer, - ServerORBInitializer, - -1); // No CORBA exceptions yet! - PortableInterceptor::ORBInitializer_var orb_initializer = - temp_initializer; - - PortableInterceptor::register_orb_initializer (orb_initializer.in () - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - CORBA::ORB_var orb = CORBA::ORB_init (argc, - argv, - "test_orb" - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - CORBA::Object_var obj = - orb->resolve_initial_references ("RootPOA" - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - PortableServer::POA_var root_poa = - PortableServer::POA::_narrow (obj.in () ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - if (CORBA::is_nil (root_poa.in ())) - ACE_ERROR_RETURN ((LM_ERROR, - "Unable to obtain RootPOA reference.\n"), - -1); - - PortableServer::POAManager_var poa_manager = - root_poa->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - - poa_manager->activate (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - - if (parse_args (argc, argv) != 0) - return -1; - - obj = orb->resolve_initial_references ("PICurrent" ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - PortableInterceptor::Current_var pi_current = - PortableInterceptor::Current::_narrow (obj.in () ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - if (CORBA::is_nil (pi_current.in ())) - ACE_ERROR_RETURN ((LM_ERROR, - "Unable to obtain PICurrent reference.\n"), - -1); - - test_i server_impl (pi_current.in (), - ::slot_id, - orb.in ()); - - obj = server_impl._this (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - - PICurrentTest::test_var server = - PICurrentTest::test::_narrow (obj.in () - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - if (CORBA::is_nil (server.in ())) - ACE_ERROR_RETURN ((LM_ERROR, - "Unable to obtain reference to " - "PICurrentTest::test object.\n"), - -1); - - CORBA::String_var ior = - orb->object_to_string (server.in () ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - ACE_DEBUG ((LM_INFO, "PICurrentTest::test: <%s>\n", ior.in ())); - - // If the ior_output_file exists, output the IOR to it. - if (ior_output_file != 0) - { - FILE *output_file = ACE_OS::fopen (ior_output_file, "w"); - if (output_file == 0) - ACE_ERROR_RETURN ((LM_ERROR, - "Cannot open output file for writing " - "IOR: %s", - ior_output_file), - 1); - ACE_OS::fprintf (output_file, "%s", ior.in ()); - ACE_OS::fclose (output_file); - } - - orb->run (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - - orb->destroy (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - - ACE_DEBUG ((LM_INFO, "Event loop finished.\n")); - } - ACE_CATCHANY - { - ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, - "PICurrent test (server-side):"); - - return -1; - } - ACE_ENDTRY; - - return 0; -} diff --git a/TAO/tests/Portable_Interceptors/PICurrent/test.idl b/TAO/tests/Portable_Interceptors/PICurrent/test.idl deleted file mode 100644 index a0f4dacae13..00000000000 --- a/TAO/tests/Portable_Interceptors/PICurrent/test.idl +++ /dev/null @@ -1,30 +0,0 @@ -// -*- IDL -*- - -//============================================================================= -/** - * @file test.idl - * - * $Id$ - * - * Simple IDL file to test PortableInterceptor::Current - * support. - * - * @author Ossama Othman <ossama@uci.edu> - */ -//============================================================================= - -module PICurrentTest -{ - - interface test - { - void invoke_me (); - - void invoke_you (); - - void invoke_we (); - - oneway void shutdown (); - }; - -}; diff --git a/TAO/tests/Portable_Interceptors/PICurrent/test_i.cpp b/TAO/tests/Portable_Interceptors/PICurrent/test_i.cpp deleted file mode 100644 index 453c16429aa..00000000000 --- a/TAO/tests/Portable_Interceptors/PICurrent/test_i.cpp +++ /dev/null @@ -1,201 +0,0 @@ -// -*- C++ -*- - -#include "test_i.h" - -ACE_RCSID (PICurrent, - test_i, - "$Id$") - -test_i::test_i (PortableInterceptor::Current_ptr current, - PortableInterceptor::SlotId id, - CORBA::ORB_ptr orb) - : current_ (PortableInterceptor::Current::_duplicate (current)), - slot_id_ (id), - orb_ (CORBA::ORB::_duplicate (orb)) -{ -} - -test_i::~test_i (void) -{ -} - -void -test_i::invoke_me (ACE_ENV_SINGLE_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - ACE_DEBUG ((LM_DEBUG, - "Test method invoked.\n")); - - // @note "TSC" is "thread scope current" - // "RSC" is "request scope current" - - // ---------------------------------------------------- - - // Verify that the following RSC->TSC->RSC copying scenario works: - // - // 1. ServerRequestInterceptor::receive_request_service_contexts() - // a. ServerRequestInfo::set_slot() - // b. RSC->TSC shallow copy - // 2. servant implementation invokes method on another server - // a. TSC->RSC shallow copy - // b. ClientRequestInterceptor::send_request() - // i. ClientRequestInfo::get_slot() - - // By this point all of step 1 has occurred. Step 2 will now - // occur. - PICurrentTest::test_var my_ref = - this->_this (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; - - // ---------------------------------------------------- - - CORBA::Any_var retrieved_any; - - ACE_TRY - { - // Retrieve data placed into RSC PICurrent by the - // receive_request_service_contexts() interception point, and - // then copied into the TSC current. - retrieved_any = - this->current_->get_slot (this->slot_id_ - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - } - ACE_CATCH (PortableInterceptor::InvalidSlot, ex) - { - ACE_PRINT_EXCEPTION (ex, - "Exception thrown in " - "test_i::invoke_me() when calling " - "Current::get_slot\n"); - - ACE_DEBUG ((LM_DEBUG, - "Invalid slot: %u\n", - this->slot_id_)); - - ACE_TRY_THROW (CORBA::INTERNAL ()); - } - ACE_CATCHANY - { - ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, - "Unexpected exception\n"); - } - ACE_ENDTRY; - ACE_CHECK; - - CORBA::Long retrieved; - if (retrieved_any.in() >>= retrieved) - ACE_DEBUG ((LM_DEBUG, - "(%P|%t) Retrieved number <%d> from TSC.\n", - retrieved)); - else - { - ACE_DEBUG ((LM_DEBUG, - "(%P|%t) Problem extracting data from " - "CORBA::Any retrieved from TSC.\n")); - - ACE_THROW (CORBA::INTERNAL ()); - } - // ---------------------------------------------------- - - // Note that the invocation must occur through the object - // reference to force the client request interceptor - // (ClientRequestInterceptor2) to be invoked. This assumes that - // DIRECT collocation (and possibly THRU_POA collocation) is - // disabled. - my_ref->invoke_you (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; - - // ---------------------------------------------------- - - // Insert some data into the TSC PICurrent object. - const char str[] = "Drink milk!"; - - CORBA::Any data; - - data <<= str; - - ACE_TRY_EX (foo) - { - this->current_->set_slot (this->slot_id_, - data - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK_EX (foo); - } - ACE_CATCH (PortableInterceptor::InvalidSlot, ex) - { - ACE_PRINT_EXCEPTION (ex, - "Exception thrown in " - "test_i::invoke_me() when calling " - "Current::set_slot\n"); - - ACE_DEBUG ((LM_DEBUG, - "Invalid slot: %u\n", - this->slot_id_)); - - ACE_TRY_THROW_EX (CORBA::INTERNAL (), foo); - } - ACE_ENDTRY; - ACE_CHECK; - - ACE_DEBUG ((LM_DEBUG, - "(%P|%t) String \"%s\" inserted into TSC.\n", - str)); -} - -void -test_i::invoke_you (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - // Nothing to be tested here. This method is here just so that we - // have a different method -} - -void -test_i::invoke_we (ACE_ENV_SINGLE_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - // Insert some data into the TSC PICurrent object. - const char str[] = "We drink milk!"; - - CORBA::Any data; - - data <<= str; - - ACE_TRY_EX (foo) - { - this->current_->set_slot (this->slot_id_, - data - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK_EX (foo); - } - ACE_CATCH (PortableInterceptor::InvalidSlot, ex) - { - ACE_PRINT_EXCEPTION (ex, - "Exception thrown in " - "test_i::invoke_me() when calling " - "Current::set_slot\n"); - - ACE_DEBUG ((LM_DEBUG, - "Invalid slot: %u\n", - this->slot_id_)); - - ACE_TRY_THROW_EX (CORBA::INTERNAL (), foo); - } - ACE_ENDTRY; - ACE_CHECK; - - ACE_DEBUG ((LM_DEBUG, - "(%P|%t) String \"%s\" inserted into TSC.\n", - str)); -} - -void -test_i::shutdown (ACE_ENV_SINGLE_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - ACE_DEBUG ((LM_DEBUG, - "(%P|%t) Server is shutting down.\n")); - - this->orb_->shutdown (0 - ACE_ENV_ARG_PARAMETER); -} diff --git a/TAO/tests/Portable_Interceptors/PICurrent/test_i.h b/TAO/tests/Portable_Interceptors/PICurrent/test_i.h deleted file mode 100644 index c9de94d10a0..00000000000 --- a/TAO/tests/Portable_Interceptors/PICurrent/test_i.h +++ /dev/null @@ -1,74 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file test_i.h - * - * $Id$ - * - * Implementation header for the "test" IDL interface for the - * PortableInterceptor::Current test. - * - * @author Ossama Othman <ossama@uci.edu> - */ -//============================================================================= - -#ifndef TEST_I_H -#define TEST_I_H - -#include "testS.h" - -#include "tao/PortableInterceptorC.h" -#include "tao/PI/PI.h" - -/** - * @class test_i - * - * @brief Simple test class. - * - * This class implements the "test" interface used in this test. - */ -class test_i : public virtual POA_PICurrentTest::test -{ -public: - - /// Constructor. - test_i (PortableInterceptor::Current_ptr current, - PortableInterceptor::SlotId id, - CORBA::ORB_ptr orb); - - /// Destructor. - ~test_i (void); - - /// Main servant test method. - virtual void invoke_me (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - /// No-op method used so that a client request interceptor will be - /// invoked when invoking this method from the above invoke_me() - /// method. Say that 10 times fast. :-) - virtual void invoke_you (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - /// Test just a set slot - virtual void invoke_we (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - /// Shutdown the ORB. - virtual void shutdown (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - -private: - - /// Reference to the PICurrent object. - PortableInterceptor::Current_var current_; - - /// SlotId in the PICurrent object assigned to this test. - PortableInterceptor::SlotId slot_id_; - - /// Pseudo-reference to the ORB. - CORBA::ORB_var orb_; - -}; - -#endif /* TEST_I_H */ diff --git a/TAO/tests/Portable_Interceptors/PolicyFactory/.cvsignore b/TAO/tests/Portable_Interceptors/PolicyFactory/.cvsignore deleted file mode 100644 index 254defddb53..00000000000 --- a/TAO/tests/Portable_Interceptors/PolicyFactory/.cvsignore +++ /dev/null @@ -1 +0,0 @@ -server diff --git a/TAO/tests/Portable_Interceptors/PolicyFactory/IORInterceptor.cpp b/TAO/tests/Portable_Interceptors/PolicyFactory/IORInterceptor.cpp deleted file mode 100644 index 5c9cae1b492..00000000000 --- a/TAO/tests/Portable_Interceptors/PolicyFactory/IORInterceptor.cpp +++ /dev/null @@ -1,78 +0,0 @@ -#include "IORInterceptor.h" -#include "testC.h" - - -ACE_RCSID (PolicyFactory, - IORInterceptor, - "$Id$") - - -IORInterceptor::IORInterceptor (void) - : success_ (false) -{ -} - -IORInterceptor::~IORInterceptor (void) -{ - ACE_ASSERT (this->success_); -} - -char * -IORInterceptor::name (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - return CORBA::string_dup (""); -} - -void -IORInterceptor::destroy (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - ACE_ASSERT (this->success_); -} - -void -IORInterceptor::establish_components ( - PortableInterceptor::IORInfo_ptr info - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - ACE_TRY - { - PortableInterceptor::ObjectReferenceTemplate_var t = - info->adapter_template (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - - PortableInterceptor::AdapterName_var a = - t->adapter_name (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - - // Only execute if POA is not RootPOA. The RootPOA will not - // have our custom policy, but the child POA we created will. - if (a->length () > 1) - { - CORBA::Policy_var policy ( - info->get_effective_policy (Test::POLICY_TYPE - ACE_ENV_ARG_PARAMETER)); - ACE_TRY_CHECK; - - Test::Policy_var test_policy (Test::Policy::_narrow ( - policy.in () - ACE_ENV_ARG_PARAMETER)); - ACE_TRY_CHECK; - - this->success_ = true; - } - } - ACE_CATCHANY - { - ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, - "EXCEPTION: " - "IORInterceptor::establish_components:"); - - ACE_ASSERT (false); - } - ACE_ENDTRY; - ACE_CHECK; -} - diff --git a/TAO/tests/Portable_Interceptors/PolicyFactory/IORInterceptor.h b/TAO/tests/Portable_Interceptors/PolicyFactory/IORInterceptor.h deleted file mode 100644 index c2ab7cf6602..00000000000 --- a/TAO/tests/Portable_Interceptors/PolicyFactory/IORInterceptor.h +++ /dev/null @@ -1,95 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file IORInterceptor.h - * - * $Id$ - * - * Implementation header for the IOR test interceptor. - * - * @author Ossama Othman <ossama@dre.vanderbilt.edu> - */ -//============================================================================= - -#ifndef IOR_INTERCEPTOR_H -#define IOR_INTERCEPTOR_H - -#include "ace/config-all.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "tao/IORInterceptor/IORInterceptor.h" -#include "tao/PortableInterceptorC.h" -#include "tao/LocalObject.h" - -#if defined(_MSC_VER) -#pragma warning(push) -#pragma warning(disable:4250) -#endif /* _MSC_VER */ - -/** - * @class IORInterceptor - * - * @brief Simple concrete IOR interceptor. - * - * This is a test IOR interceptor that embeds a tagged component in an - * IOR. That tagged component will then be verified on the client - * side to ensure that IOR interceptor support is functioning - * properly. - */ -class IORInterceptor - : public virtual PortableInterceptor::IORInterceptor, - public virtual TAO_Local_RefCounted_Object -{ -public: - - /// Constructor - IORInterceptor (void); - - /** - * @name Methods Required by the IOR Interceptor Interface - * - * These are methods that must be implemented since they are pure - * virtual in the abstract base class. They are the canonical - * methods required for all IOR interceptors. - */ - //@{ - /// Return the name of this IORInterceptor. - virtual char * name (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - /// Cleanup resources acquired by this IORInterceptor. - virtual void destroy (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - /// Add the tagged components to the IOR. - virtual void establish_components ( - PortableInterceptor::IORInfo_ptr info - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - //@} - -protected: - - /// Destructor. - /** - * Protected destructor to enforce proper memory management through - * the reference counting mechanism. - */ - ~IORInterceptor (void); - -private: - - /// IORInterceptor successfully called and executed. - bool success_; - -}; - -#if defined(_MSC_VER) -#pragma warning(pop) -#endif /* _MSC_VER */ - -#endif /* IOR_INTERCEPTOR_H */ diff --git a/TAO/tests/Portable_Interceptors/PolicyFactory/PI_PolicyFactory.mpc b/TAO/tests/Portable_Interceptors/PolicyFactory/PI_PolicyFactory.mpc deleted file mode 100644 index c625755ff58..00000000000 --- a/TAO/tests/Portable_Interceptors/PolicyFactory/PI_PolicyFactory.mpc +++ /dev/null @@ -1,14 +0,0 @@ -// -*- MPC -*- -// -// $Id$ - -project(*Server): taoserver, iorinterceptor, interceptors { - Source_Files { - testC.cpp - Policy.cpp - PolicyFactory.cpp - Server_ORBInitializer.cpp - IORInterceptor.cpp - server.cpp - } -} diff --git a/TAO/tests/Portable_Interceptors/PolicyFactory/Policy.cpp b/TAO/tests/Portable_Interceptors/PolicyFactory/Policy.cpp deleted file mode 100644 index 5c9266495e9..00000000000 --- a/TAO/tests/Portable_Interceptors/PolicyFactory/Policy.cpp +++ /dev/null @@ -1,52 +0,0 @@ -// $Id$ - -#include "Policy.h" - -#include "ace/Log_Msg.h" - -ACE_RCSID (PolicyFactory, - Policy, - "$Id$") - - -Policy::Policy (CORBA::ULong val) - : value_ (val) -{ -} - -Policy::~Policy (void) -{ -} - -CORBA::ULong -Policy::value (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - return this->value_; -} - -CORBA::PolicyType -Policy::policy_type (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - return Test::POLICY_TYPE; -} - -CORBA::Policy_ptr -Policy::copy (ACE_ENV_SINGLE_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - CORBA::Policy_ptr p; - ACE_NEW_THROW_EX (p, - Policy (this->value_), - CORBA::NO_MEMORY ()); - ACE_CHECK_RETURN (CORBA::Policy::_nil ()); - - return p; -} - -void -Policy::destroy (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ -} diff --git a/TAO/tests/Portable_Interceptors/PolicyFactory/Policy.h b/TAO/tests/Portable_Interceptors/PolicyFactory/Policy.h deleted file mode 100644 index 834e8918745..00000000000 --- a/TAO/tests/Portable_Interceptors/PolicyFactory/Policy.h +++ /dev/null @@ -1,67 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file Policy.h - * - * $Id$ - * - * Implementation header for the test Policy. - * - * @author Ossama Othman <ossama@dre.vanderbilt.edu> - */ -//============================================================================= - -#ifndef POLICY_H -#define POLICY_H - -#include "testC.h" -#include "tao/LocalObject.h" - -/** - * @class Policy - * - * @brief Implementation of the Test::Policy interface. - * - * This policy merely returns the value that was passed to it when it - * was constructed. - */ -class Policy - : public virtual Test::Policy, - public virtual TAO_Local_RefCounted_Object -{ -public: - - /// Constructor. - Policy (CORBA::ULong val); - - /// Test method defined in test IDL. - virtual CORBA::ULong value (ACE_ENV_SINGLE_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)); - - virtual CORBA::PolicyType policy_type (ACE_ENV_SINGLE_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)); - - virtual CORBA::Policy_ptr copy (ACE_ENV_SINGLE_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)); - - virtual void destroy (ACE_ENV_SINGLE_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)); - -protected: - - /// Destructor. - /** - * Protected destructor to enforce proper memory management through - * the reference counting mechanism. - */ - ~Policy (void); - -private: - - /// Pseudo-reference to the ORB. - const CORBA::ULong value_; - -}; - -#endif /* POLICY_H */ diff --git a/TAO/tests/Portable_Interceptors/PolicyFactory/PolicyFactory.cpp b/TAO/tests/Portable_Interceptors/PolicyFactory/PolicyFactory.cpp deleted file mode 100644 index 495bc24a325..00000000000 --- a/TAO/tests/Portable_Interceptors/PolicyFactory/PolicyFactory.cpp +++ /dev/null @@ -1,36 +0,0 @@ -// $Id$ - -#include "PolicyFactory.h" -#include "Policy.h" - -ACE_RCSID (PolicyFactory, - PolicyFactory, - "$Id$") - - -CORBA::Policy_ptr -PolicyFactory::create_policy (CORBA::PolicyType type, - const CORBA::Any & value - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - CORBA::PolicyError)) -{ - // Sanity check since this condition should be caught earlier by the - // TAO_PolicyFactory_Registry. - if (type != Test::POLICY_TYPE) - ACE_THROW_RETURN (CORBA::PolicyError (CORBA::BAD_POLICY_TYPE), - CORBA::Policy::_nil ()); - - CORBA::ULong val; - if (!(value >>= val)) - ACE_THROW_RETURN (CORBA::INTERNAL (), - CORBA::Policy::_nil ()); - - Policy * p = 0; - ACE_NEW_THROW_EX (p, - Policy (val), - CORBA::NO_MEMORY ()); - ACE_CHECK_RETURN (CORBA::Policy::_nil ()); - - return p; -} diff --git a/TAO/tests/Portable_Interceptors/PolicyFactory/PolicyFactory.h b/TAO/tests/Portable_Interceptors/PolicyFactory/PolicyFactory.h deleted file mode 100644 index 62baa04f807..00000000000 --- a/TAO/tests/Portable_Interceptors/PolicyFactory/PolicyFactory.h +++ /dev/null @@ -1,70 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file PolicyFactory.h - * - * $Id$ - * - * Implementation header for the test policy factory. - * - * @author Ossama Othman <ossama@dre.vanderbilt.edu> - */ -//============================================================================= - -#ifndef POLICY_FACTORY_H -#define POLICY_FACTORY_H - -#include "ace/config-all.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "tao/PI/PI.h" -#include "tao/LocalObject.h" - -#if defined(_MSC_VER) -#pragma warning(push) -#pragma warning(disable:4250) -#endif /* _MSC_VER */ - -/** - * @class PolicyFactory - * - * @brief Simple concrete PolicyFactory. - * - * This is a test PolicyFactory that constructs a Test::Policy - * object. - */ -class PolicyFactory - : public virtual PortableInterceptor::PolicyFactory, - public virtual TAO_Local_RefCounted_Object -{ -public: - - /** - * @name Methods Required by the PolicyFactory Interface - * - * These are methods that must be implemented since they are pure - * virtual in the abstract base class. They are the canonical - * methods required for all PolicyFactory sub-classes. - */ - //@{ - - /// Construct a Test::Policy object as a test. - virtual CORBA::Policy_ptr create_policy (CORBA::PolicyType type, - const CORBA::Any & value - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException, - CORBA::PolicyError)); - - //@} - -}; - -#if defined(_MSC_VER) -#pragma warning(pop) -#endif /* _MSC_VER */ - -#endif /* POLICY_FACTORY_H */ diff --git a/TAO/tests/Portable_Interceptors/PolicyFactory/README b/TAO/tests/Portable_Interceptors/PolicyFactory/README deleted file mode 100644 index b9ba6219524..00000000000 --- a/TAO/tests/Portable_Interceptors/PolicyFactory/README +++ /dev/null @@ -1,26 +0,0 @@ -# $Id$ - -This test verifies that PolicyFactory support is working properly. -Working PolicyFactory support requires the following on the server side: - -1) Ability to register a PolicyFactory through the - ORBInitInfo::register_policy_factory() method. -2) Ability to create a policy through that PolicyFactory. -3) Ability to create a POA containing that policy, even if the policy - is not meant to be used by the POA. -4) Retrieve the created policy from the POA's policy list via the - IORInfo::get_effective_policy() method. - -The client side only requires a subset of this list, i.e. items (1) -and (2), for working PolicyFactory support, so testing the server side -is enough. - -Run the test as follows: - - $ perl run_test.pl - -Output should be very similar to the following: - -==== Running PolicyFactory test - -PolicyFactory test succeeded. diff --git a/TAO/tests/Portable_Interceptors/PolicyFactory/Server_ORBInitializer.cpp b/TAO/tests/Portable_Interceptors/PolicyFactory/Server_ORBInitializer.cpp deleted file mode 100644 index e6369e699fa..00000000000 --- a/TAO/tests/Portable_Interceptors/PolicyFactory/Server_ORBInitializer.cpp +++ /dev/null @@ -1,64 +0,0 @@ -// -*- C++ -*- - -#include "Server_ORBInitializer.h" -#include "IORInterceptor.h" -#include "PolicyFactory.h" -#include "testC.h" - -#include "tao/ORB_Constants.h" - -#include "ace/OS_NS_string.h" - - -ACE_RCSID (PolicyFactory, - Server_ORBInitializer, - "$Id$") - - -void -Server_ORBInitializer::pre_init ( - PortableInterceptor::ORBInitInfo_ptr /* info */ - ACE_ENV_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ -} - -void -Server_ORBInitializer::post_init ( - PortableInterceptor::ORBInitInfo_ptr info - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - PortableInterceptor::PolicyFactory_ptr p; - ACE_NEW_THROW_EX (p, - PolicyFactory, - CORBA::NO_MEMORY ( - CORBA::SystemException::_tao_minor_code ( - TAO::VMCID, - ENOMEM), - CORBA::COMPLETED_NO)); - ACE_CHECK; - - PortableInterceptor::PolicyFactory_var policy_factory (p); - - info->register_policy_factory (Test::POLICY_TYPE, - policy_factory.in () - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - - PortableInterceptor::IORInterceptor_ptr i; - ACE_NEW_THROW_EX (i, - IORInterceptor, - CORBA::NO_MEMORY ( - CORBA::SystemException::_tao_minor_code ( - TAO::VMCID, - ENOMEM), - CORBA::COMPLETED_NO)); - ACE_CHECK; - - PortableInterceptor::IORInterceptor_var ior_interceptor (i); - - info->add_ior_interceptor (ior_interceptor.in () - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; -} diff --git a/TAO/tests/Portable_Interceptors/PolicyFactory/Server_ORBInitializer.h b/TAO/tests/Portable_Interceptors/PolicyFactory/Server_ORBInitializer.h deleted file mode 100644 index 89be36a2898..00000000000 --- a/TAO/tests/Portable_Interceptors/PolicyFactory/Server_ORBInitializer.h +++ /dev/null @@ -1,74 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file Server_ORBInitializer.h - * - * $Id$ - * - * Implementation header for the IOR test interceptor ORB - * initializer. - * - * @author Ossama Othman <ossama@dre.vanderbilt.edu> - */ -//============================================================================= - -#ifndef SERVER_ORB_INITIALIZER_H -#define SERVER_ORB_INITIALIZER_H - -#include "ace/config-all.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "tao/PI/PI.h" -#include "tao/LocalObject.h" - -#if defined(_MSC_VER) -#pragma warning(push) -#pragma warning(disable:4250) -#endif /* _MSC_VER */ - -/** - * @class Server_ORBInitializer - * - * @brief Simple concrete ORB initializer. - * - * This is a test ORB initializer that registers a PolicyFactory and - * IORInterceptor for this test. - */ -class Server_ORBInitializer - : public virtual PortableInterceptor::ORBInitializer, - public virtual TAO_Local_RefCounted_Object -{ -public: - - /** - * @name Methods Required by the ORBInitializer Interface - * - * These are methods that must be implemented since they are pure - * virtual in the abstract base class. They are the canonical - * methods required for all ORB initializers. - */ - //@{ - /// The pre-initialization hook. - virtual void pre_init ( - PortableInterceptor::ORBInitInfo_ptr info - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - /// The post-initialization hook. - virtual void post_init ( - PortableInterceptor::ORBInitInfo_ptr info - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - //@} - -}; - -#if defined(_MSC_VER) -#pragma warning(pop) -#endif /* _MSC_VER */ - -#endif /* SERVER_ORB_INITIALIZER_H */ diff --git a/TAO/tests/Portable_Interceptors/PolicyFactory/run_test.pl b/TAO/tests/Portable_Interceptors/PolicyFactory/run_test.pl deleted file mode 100755 index 58fa821c094..00000000000 --- a/TAO/tests/Portable_Interceptors/PolicyFactory/run_test.pl +++ /dev/null @@ -1,32 +0,0 @@ -eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' - & eval 'exec perl -S $0 $argv:q' - if 0; - -# -*- perl -*- -# -# $Id$ - -use lib '../../../../bin'; -use PerlACE::Run_Test; - -$status = 0; - -if (PerlACE::is_vxworks_test()) { - $SV = new PerlACE::ProcessVX ("server"); -} -else { - $SV = new PerlACE::Process ("server"); -} - -print STDERR "\n\n==== Running PolicyFactory test\n"; - -$SV->Spawn (); - -$server = $SV->WaitKill (30); - -if ($server != 0) { - print STDERR "ERROR: server returned $server\n"; - $status = 1; -} - -exit $status; diff --git a/TAO/tests/Portable_Interceptors/PolicyFactory/server.cpp b/TAO/tests/Portable_Interceptors/PolicyFactory/server.cpp deleted file mode 100644 index 1a52aa6b982..00000000000 --- a/TAO/tests/Portable_Interceptors/PolicyFactory/server.cpp +++ /dev/null @@ -1,128 +0,0 @@ -// -*- C++ -*- - -#include "Server_ORBInitializer.h" - -#include "tao/ORBInitializer_Registry.h" -#include "testC.h" - -#include "tao/PortableServer/PortableServer.h" -#include "ace/Log_Msg.h" - -ACE_RCSID (PolicyFactory, - server, - "$Id$") - -int -main (int argc, char *argv[]) -{ - ACE_DECLARE_NEW_CORBA_ENV; - ACE_TRY - { - PortableInterceptor::ORBInitializer_ptr temp_initializer = - PortableInterceptor::ORBInitializer::_nil (); - - ACE_NEW_RETURN (temp_initializer, - Server_ORBInitializer, - -1); // No CORBA exceptions yet! - PortableInterceptor::ORBInitializer_var orb_initializer = - temp_initializer; - - PortableInterceptor::register_orb_initializer (orb_initializer.in () - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - CORBA::ORB_var orb = CORBA::ORB_init (argc, - argv, - "test_orb" - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - // Create the test policy. - - const CORBA::ULong val = 40442; - CORBA::Any any; - any <<= val; - - CORBA::Policy_var p (orb->create_policy (Test::POLICY_TYPE, - any - ACE_ENV_ARG_PARAMETER)); - ACE_TRY_CHECK; - - const CORBA::PolicyType ptype = - p->policy_type (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - - // Sanity check. - if (ptype != Test::POLICY_TYPE) - ACE_TRY_THROW (CORBA::INTERNAL ()); - - Test::Policy_var policy (Test::Policy::_narrow (p.in () - ACE_ENV_ARG_PARAMETER)); - ACE_TRY_CHECK; - - const CORBA::ULong pval = policy->value (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - - // Sanity check. - if (val != pval) - ACE_TRY_THROW (CORBA::INTERNAL ()); - - CORBA::Object_var obj = - orb->resolve_initial_references ("RootPOA" - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - PortableServer::POA_var root_poa = - PortableServer::POA::_narrow (obj.in () - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - if (CORBA::is_nil (root_poa.in ())) - ACE_ERROR_RETURN ((LM_ERROR, - "Unable to obtain RootPOA reference.\n"), - -1); - - PortableServer::POAManager_var poa_manager = - root_poa->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - - CORBA::PolicyList policies (1); - policies.length (1); - - policies[0] = policy->copy (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - - PortableServer::POA_var poa = - root_poa->create_POA ("Test POA", - poa_manager.in (), - policies - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - policy->destroy (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - - poa_manager->activate (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - - root_poa->destroy (1, 1 ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - orb->destroy (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - - ACE_DEBUG ((LM_INFO, - "\n" - "PolicyFactory test succeeded.\n")); - } - ACE_CATCHANY - { - ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, - "PolicyFactory test:"); - - return -1; - } - ACE_ENDTRY; - - return 0; -} diff --git a/TAO/tests/Portable_Interceptors/PolicyFactory/test.idl b/TAO/tests/Portable_Interceptors/PolicyFactory/test.idl deleted file mode 100644 index 0f82a951fc0..00000000000 --- a/TAO/tests/Portable_Interceptors/PolicyFactory/test.idl +++ /dev/null @@ -1,31 +0,0 @@ -// -*- IDL -*- - -//============================================================================= -/** - * @file test.idl - * - * $Id$ - * - * "test" IDL interface for the PolicyFactory test. - * - * @author Ossama Othman <ossama@dre.vanderbilt.edu> - */ -//============================================================================= - - -#include "tao/Policy.pidl" - -module Test -{ - - // Hopefully this test policy type number doesn't conflict with any - // other reserved PolicyTypes. - const CORBA::PolicyType POLICY_TYPE = 3456; - - local interface Policy : CORBA::Policy - { - /// Returns value passed to PolicyFactory. - readonly attribute unsigned long value; - }; - -}; diff --git a/TAO/tests/Portable_Interceptors/Processing_Mode_Policy/Collocated/Client_Task.cpp b/TAO/tests/Portable_Interceptors/Processing_Mode_Policy/Collocated/Client_Task.cpp deleted file mode 100644 index fca62b6fe50..00000000000 --- a/TAO/tests/Portable_Interceptors/Processing_Mode_Policy/Collocated/Client_Task.cpp +++ /dev/null @@ -1,98 +0,0 @@ -// -// $Id$ -// - -#include "Client_Task.h" -#include "testC.h" -#include "interceptors.h" - -ACE_RCSID(Muxing, Client_Task, "$Id$") - -Client_Task::Client_Task (const char *ior, - CORBA::ORB_ptr corb, - ACE_Thread_Manager *thr_mgr) - : ACE_Task_Base (thr_mgr) - , input_ (ior) - , corb_ (CORBA::ORB::_duplicate (corb)) - -{ -} - -int -Client_Task::svc (void) -{ - ACE_TRY_NEW_ENV - { - - CORBA::Object_var object = - corb_->string_to_object (input_ ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - Test_Interceptors::Visual_var server = - Test_Interceptors::Visual::_narrow (object.in () ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - if (CORBA::is_nil (server.in ())) - { - ACE_ERROR_RETURN ((LM_ERROR, - "Object reference <%s> is nil\n", - this->input_), - 1); - } - - run_test (server.in () ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - server->shutdown (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - } - ACE_CATCHANY - { - ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, - "Exception caught in client task:"); - return 1; - } - ACE_ENDTRY; - - return 0; - -} - - -void -Client_Task::run_test (Test_Interceptors::Visual_ptr server - ACE_ENV_ARG_DECL) -{ - server->normal (10 ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - - CORBA::Long one = 1, two = 1; - (void) server->calculate (one, - two - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - - ACE_TRY - { - (void) server->user (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - } - ACE_CATCH (Test_Interceptors::Silly, userex) - { - ACE_DEBUG ((LM_DEBUG, "As expected, Caught Silly\n")); - } - ACE_ENDTRY; - ACE_CHECK; - - ACE_TRY_EX (SYS) - { - server->system (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK_EX (SYS); - } - ACE_CATCH (CORBA::INV_OBJREF, sysex) - { - ACE_DEBUG ((LM_DEBUG, "As expected, Caught CORBA::INV_OBJREF\n")); - } - ACE_ENDTRY; - ACE_CHECK; -} diff --git a/TAO/tests/Portable_Interceptors/Processing_Mode_Policy/Collocated/Client_Task.h b/TAO/tests/Portable_Interceptors/Processing_Mode_Policy/Collocated/Client_Task.h deleted file mode 100644 index 49074e04e89..00000000000 --- a/TAO/tests/Portable_Interceptors/Processing_Mode_Policy/Collocated/Client_Task.h +++ /dev/null @@ -1,45 +0,0 @@ -// -// $Id$ -// - -#ifndef COLLOCATED_TEST_CLIENT_TASK_H -#define COLLOCATED_TEST_CLIENT_TASK_H -#include /**/ "ace/pre.h" -#include "ace/Task.h" -#include "testS.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ -#include "tao/ORB.h" - - -/// Implement a Task to run the client as a thread -class Client_Task : public ACE_Task_Base -{ -public: - - /// Constructor - Client_Task (const char *input, - CORBA::ORB_ptr corb, - ACE_Thread_Manager *thr_mgr); - - /// Thread entry point - int svc (void); - - void run_test (Test_Interceptors::Visual_ptr server - ACE_ENV_ARG_DECL); - - /// The status of the svc loop - int status (void) const; - -private: - const char *input_; - - CORBA::ORB_var corb_; - - int status_; -}; - -#include /**/ "ace/post.h" -#endif /* COLLOCATED_TEST_CLIENT_TASK_H */ diff --git a/TAO/tests/Portable_Interceptors/Processing_Mode_Policy/Collocated/Collocated_Test.cpp b/TAO/tests/Portable_Interceptors/Processing_Mode_Policy/Collocated/Collocated_Test.cpp deleted file mode 100644 index 41d8c39fec7..00000000000 --- a/TAO/tests/Portable_Interceptors/Processing_Mode_Policy/Collocated/Collocated_Test.cpp +++ /dev/null @@ -1,226 +0,0 @@ -//$Id$ -#include "Server_Task.h" -#include "Client_Task.h" -#include "ace/Get_Opt.h" -#include "ace/Argv_Type_Converter.h" -#include "ace/SString.h" -#include "ace/Manual_Event.h" -#include "Echo_Collocated_ORBInitializer.h" -#include "tao/ORBInitializer_Registry.h" -#include "interceptors.h" - -const char *output = "test.ior"; -const char *input = "file://test.ior"; - -ACE_CString server_proc_mode_str; -ACE_CString client_proc_mode_str; -ACE_CString server_orb; -ACE_CString client_orb; - -int -parse_args (int argc, char *argv[]) -{ - ACE_Get_Opt get_opts (argc, argv, "s:c:k:o"); - int c; - - server_proc_mode_str.set ("LOCAL_AND_REMOTE"); - client_proc_mode_str.set ("LOCAL_AND_REMOTE"); - - while ((c = get_opts ()) != -1) - { - switch (c) - { - case 's': - server_proc_mode_str.set (get_opts.opt_arg ()); - break; - case 'c': - client_proc_mode_str.set (get_opts.opt_arg ()); - break; - case 'o': - output = get_opts.opt_arg (); - break; - case 'k': - input = get_opts.opt_arg (); - break; - case '?': - default: - return 0; - } - } - // Indicates sucessful parsing of the command line - return 0; -} - -int -main (int argc, char *argv[]) -{ - if (parse_args (argc, - argv) == -1) - return -1; - - server_orb.set ("server_orb"); - client_orb.set ("client_orb"); - - ACE_DECLARE_NEW_CORBA_ENV; - ACE_TRY - { - PortableInterceptor::ORBInitializer_ptr temp_initializer = - PortableInterceptor::ORBInitializer::_nil (); - - // Set up our default expectations. - CORBA::ULong expected_server_interceptor_check = 10; - CORBA::ULong expected_client_interceptor_check = 10; - - PortableInterceptor::ProcessingMode client_proc_mode = - PortableInterceptor::LOCAL_AND_REMOTE; - - if (client_proc_mode_str == "LOCAL_ONLY") - { - client_proc_mode = PortableInterceptor::LOCAL_ONLY; - ACE_DEBUG((LM_DEBUG, - "Using LOCAL_ONLY for client-side ProcessingMode.\n")); - } - else if (client_proc_mode_str == "REMOTE_ONLY") - { - client_proc_mode = PortableInterceptor::REMOTE_ONLY; - ACE_DEBUG((LM_DEBUG, - "Using REMOTE_ONLY for client-side ProcessingMode.\n")); - - // Since all of the calls are collocated, setting the client-side - // ProcessingMode to REMOTE_ONLY will cause the client request - // interceptor to not fire. Thus, we expect 0 calls on the - // client interceptor. - expected_client_interceptor_check = 0; - } - else - { - ACE_DEBUG((LM_DEBUG, - "Using LOCAL_AND_REMOTE for client-side ProcessingMode.\n")); - } - - PortableInterceptor::ProcessingMode server_proc_mode = - PortableInterceptor::LOCAL_AND_REMOTE; - - if (server_proc_mode_str == "LOCAL_ONLY") - { - server_proc_mode = PortableInterceptor::LOCAL_ONLY; - ACE_DEBUG((LM_DEBUG, - "Using LOCAL_ONLY for server-side ProcessingMode.\n")); - } - else if (server_proc_mode_str == "REMOTE_ONLY") - { - server_proc_mode = PortableInterceptor::REMOTE_ONLY; - ACE_DEBUG((LM_DEBUG, - "Using REMOTE_ONLY for server-side ProcessingMode.\n")); - - // Since all of the calls are collocated, setting the server-side - // ProcessingMode to REMOTE_ONLY will cause the server request - // interceptor to not fire. Thus, we expect 0 calls on the - // server interceptor. - expected_server_interceptor_check = 0; - } - else - { - ACE_DEBUG((LM_DEBUG, - "Using LOCAL_AND_REMOTE for server-side ProcessingMode.\n")); - } - - ACE_NEW_RETURN (temp_initializer, - Echo_Collocated_ORBInitializer (server_proc_mode, - client_proc_mode), - -1); // No exceptions yet! - PortableInterceptor::ORBInitializer_var orb_initializer = - temp_initializer; - - PortableInterceptor::register_orb_initializer (orb_initializer.in () - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - ACE_Argv_Type_Converter satc (argc, argv); - CORBA::ORB_var sorb = - CORBA::ORB_init (satc.get_argc (), - satc.get_TCHAR_argv (), - server_orb.c_str () - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - ACE_Manual_Event me; - Server_Task server_task (output, - sorb.in (), - me, - ACE_Thread_Manager::instance ()); - - if (server_task.activate (THR_NEW_LWP | THR_JOINABLE, - 1, - 1) == -1) - { - ACE_ERROR ((LM_ERROR, "Error activating server task\n")); - } - - // Wait for the server thread to do some processing - me.wait (); - - ACE_Argv_Type_Converter catc (argc, argv); - CORBA::ORB_var corb = - CORBA::ORB_init (catc.get_argc (), - catc.get_TCHAR_argv (), - client_orb.c_str () - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - Client_Task client_task (input, - corb.in (), - ACE_Thread_Manager::instance ()); - - if (client_task.activate (THR_NEW_LWP | THR_JOINABLE, - 1, - 1) == -1) - { - ACE_ERROR ((LM_ERROR, "Error activating client task\n")); - } - - ACE_Thread_Manager::instance ()->wait (); - - sorb->destroy (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - - bool failed_check = false; - - CORBA::ULong number_called = - Echo_Server_Request_Interceptor::server_interceptor_check_; - - if (number_called != expected_server_interceptor_check) - { - ACE_ERROR ((LM_ERROR, - "(%P|%t) ERROR: Server-Side Interceptors not " - "called properly, called %d times, expected %d.\n", - number_called, expected_server_interceptor_check)); - failed_check = true; - } - - number_called = - Echo_Client_Request_Interceptor::client_interceptor_check_; - - if (number_called != expected_client_interceptor_check) - { - ACE_ERROR ((LM_ERROR, - "(%P|%t) ERROR:Client-Side Interceptors not called " - "properly, called %d times, expected %d.\n", - number_called, expected_client_interceptor_check)); - failed_check = true; - } - - if (failed_check) - { - return 1; - } - } - ACE_CATCHANY - { - ACE_ERROR ((LM_ERROR, - "(%P|%t) ERROR: Some exception was caught in main().\n")); - return 1; - } - ACE_ENDTRY; - return 0; -} diff --git a/TAO/tests/Portable_Interceptors/Processing_Mode_Policy/Collocated/Echo_Collocated_ORBInitializer.cpp b/TAO/tests/Portable_Interceptors/Processing_Mode_Policy/Collocated/Echo_Collocated_ORBInitializer.cpp deleted file mode 100644 index b9773fde351..00000000000 --- a/TAO/tests/Portable_Interceptors/Processing_Mode_Policy/Collocated/Echo_Collocated_ORBInitializer.cpp +++ /dev/null @@ -1,138 +0,0 @@ -// -*- C++ -*- -// -// $Id$ - -#include "Echo_Collocated_ORBInitializer.h" -#include "interceptors.h" -#include "tao/PI/ORBInitInfo.h" -#include "tao/ORB_Core.h" -#include "ace/OS_NS_string.h" - -Echo_Collocated_ORBInitializer::Echo_Collocated_ORBInitializer ( - PortableInterceptor::ProcessingMode server_proc_mode, - PortableInterceptor::ProcessingMode client_proc_mode) - : server_processing_mode_(server_proc_mode), - client_processing_mode_(client_proc_mode) -{ -} - -void -Echo_Collocated_ORBInitializer::pre_init ( - PortableInterceptor::ORBInitInfo_ptr - ACE_ENV_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ -} - -void -Echo_Collocated_ORBInitializer::post_init ( - PortableInterceptor::ORBInitInfo_ptr info - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - CORBA::String_var orb_id = - info->orb_id (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; - - // TAO-Specific way to get to the ORB Core (and thus, the ORB). - TAO_ORBInitInfo_var tao_info = - TAO_ORBInitInfo::_narrow (info - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - - CORBA::ORB_var orb = CORBA::ORB::_duplicate(tao_info->orb_core()->orb()); - - if (CORBA::is_nil(orb.in())) - { - ACE_THROW (CORBA::INTERNAL ()); - ACE_CHECK; - } - - PortableInterceptor::ORBInitInfo_3_1_var info_3_1 = - PortableInterceptor::ORBInitInfo_3_1::_narrow(info - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - - if (CORBA::is_nil(info_3_1.in())) - { - ACE_THROW (CORBA::INTERNAL ()); - ACE_CHECK; - } - - if (!ACE_OS::strcmp (orb_id.in (), "client_orb")) - { - PortableInterceptor::ClientRequestInterceptor_ptr interceptor = - PortableInterceptor::ClientRequestInterceptor::_nil (); - - // Install the Echo client request interceptor - ACE_NEW_THROW_EX (interceptor, - Echo_Client_Request_Interceptor, - CORBA::NO_MEMORY ()); - ACE_CHECK; - - PortableInterceptor::ClientRequestInterceptor_var - client_interceptor = interceptor; - - CORBA::Any client_proc_mode_as_any; - client_proc_mode_as_any <<= this->client_processing_mode_; - - CORBA::PolicyList policy_list (1); - - policy_list.length (1); - policy_list[0] = - orb->create_policy (PortableInterceptor::PROCESSING_MODE_POLICY_TYPE, - client_proc_mode_as_any - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - - info_3_1->add_client_request_interceptor_with_policy ( - client_interceptor.in (), - policy_list - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - - policy_list[0]->destroy (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; - policy_list[0] = CORBA::Policy::_nil (); - } - else if (!ACE_OS::strcmp (orb_id.in (), "server_orb")) - { - PortableInterceptor::ServerRequestInterceptor_ptr interceptor = - PortableInterceptor::ServerRequestInterceptor::_nil (); - - // Install the Echo server request interceptor - ACE_NEW_THROW_EX (interceptor, - Echo_Server_Request_Interceptor, - CORBA::NO_MEMORY ()); - ACE_CHECK; - - PortableInterceptor::ServerRequestInterceptor_var - server_interceptor = interceptor; - - CORBA::Any server_proc_mode_as_any; - server_proc_mode_as_any <<= this->server_processing_mode_; - - CORBA::PolicyList policy_list (1); - - policy_list.length (1); - policy_list[0] = - orb->create_policy (PortableInterceptor::PROCESSING_MODE_POLICY_TYPE, - server_proc_mode_as_any - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - - info_3_1->add_server_request_interceptor_with_policy ( - server_interceptor.in (), - policy_list - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - - policy_list[0]->destroy (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; - policy_list[0] = CORBA::Policy::_nil (); - } - else - { - } -} - diff --git a/TAO/tests/Portable_Interceptors/Processing_Mode_Policy/Collocated/Echo_Collocated_ORBInitializer.h b/TAO/tests/Portable_Interceptors/Processing_Mode_Policy/Collocated/Echo_Collocated_ORBInitializer.h deleted file mode 100644 index 57d361b7b9a..00000000000 --- a/TAO/tests/Portable_Interceptors/Processing_Mode_Policy/Collocated/Echo_Collocated_ORBInitializer.h +++ /dev/null @@ -1,59 +0,0 @@ -// -*- C++ -*- -// -// $Id$ - -#ifndef TAO_ECHO_CLIENT_ORB_INITIALIZER_H -#define TAO_ECHO_CLIENT_ORB_INITIALIZER_H - -#include /**/ "ace/pre.h" - -#include "tao/orbconf.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "tao/PI/PI.h" -#include "tao/PI/ProcessingModePolicyC.h" -#include "tao/LocalObject.h" - -// This is to remove "inherits via dominance" warnings from MSVC. -// MSVC is being a little too paranoid. -#if defined(_MSC_VER) -#pragma warning(push) -#pragma warning(disable:4250) -#endif /* _MSC_VER */ - -/// Echo client ORB initializer. -class Echo_Collocated_ORBInitializer : - public virtual PortableInterceptor::ORBInitializer, - public virtual TAO_Local_RefCounted_Object -{ -public: - - Echo_Collocated_ORBInitializer - (PortableInterceptor::ProcessingMode server_proc_mode, - PortableInterceptor::ProcessingMode client_proc_mode); - - virtual void pre_init (PortableInterceptor::ORBInitInfo_ptr info - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - virtual void post_init (PortableInterceptor::ORBInitInfo_ptr info - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - -private: - - PortableInterceptor::ProcessingMode server_processing_mode_; - PortableInterceptor::ProcessingMode client_processing_mode_; -}; - -#if defined (_MSC_VER) -#pragma warning(pop) -#endif /* _MSC_VER */ - - -#include /**/ "ace/post.h" - -#endif /* TAO_ECHO_CLIENT_ORB_INITIALIZER_H */ diff --git a/TAO/tests/Portable_Interceptors/Processing_Mode_Policy/Collocated/PI_ProcMode_Collocated.mpc b/TAO/tests/Portable_Interceptors/Processing_Mode_Policy/Collocated/PI_ProcMode_Collocated.mpc deleted file mode 100644 index 0e1f9788ad5..00000000000 --- a/TAO/tests/Portable_Interceptors/Processing_Mode_Policy/Collocated/PI_ProcMode_Collocated.mpc +++ /dev/null @@ -1,16 +0,0 @@ -// -*- MPC -*- -// $Id$ - -project(*Collocated): taoserver, pi, pi_server, interceptors { - exename = PI_ProcMode_Collocated_Test - Source_Files { - testC.cpp - testS.cpp - test_i.cpp - interceptors.cpp - Echo_Collocated_ORBInitializer.cpp - Collocated_Test.cpp - Client_Task.cpp - Server_Task.cpp - } -} diff --git a/TAO/tests/Portable_Interceptors/Processing_Mode_Policy/Collocated/Server_Task.cpp b/TAO/tests/Portable_Interceptors/Processing_Mode_Policy/Collocated/Server_Task.cpp deleted file mode 100644 index a9db6a71b8a..00000000000 --- a/TAO/tests/Portable_Interceptors/Processing_Mode_Policy/Collocated/Server_Task.cpp +++ /dev/null @@ -1,109 +0,0 @@ -// -// $Id$ -// -#include "Server_Task.h" -#include "test_i.h" -#include "interceptors.h" - -#include "ace/Manual_Event.h" - -ACE_RCSID(Collocated_Test, - Server_Task, - "$Id$") - - -Server_Task::Server_Task (const char *output, - CORBA::ORB_ptr sorb, - ACE_Manual_Event &me, - ACE_Thread_Manager *thr_mgr) - : ACE_Task_Base (thr_mgr) - , output_ (output) - , me_ (me) - , sorb_ (CORBA::ORB::_duplicate (sorb)) -{ -} - -int -Server_Task::svc (void) -{ - ACE_TRY_NEW_ENV - { - - CORBA::Object_var poa_object = - sorb_->resolve_initial_references ("RootPOA" ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - if (CORBA::is_nil (poa_object.in ())) - ACE_ERROR_RETURN ((LM_ERROR, - " (%P|%t) Unable to initialize the POA.\n"), - 1); - - PortableServer::POA_var root_poa = - PortableServer::POA::_narrow (poa_object.in () ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - PortableServer::POAManager_var poa_manager = - root_poa->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - - poa_manager->activate (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - - Visual_i * server_impl = 0; - ACE_NEW_RETURN (server_impl, Visual_i (sorb_.in ()), 1); - - PortableServer::ObjectId_var id = - root_poa->activate_object (server_impl - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - CORBA::Object_var test_obj = - root_poa->id_to_reference (id.in () - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - Test_Interceptors::Visual_var server = - Test_Interceptors::Visual::_narrow (test_obj.in () - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - CORBA::String_var ior = - this->sorb_->object_to_string (server.in () ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - ACE_DEBUG ((LM_DEBUG, "Test_Interceptors::Visual: <%s>\n", ior.in ())); - - // If the ior_output_file exists, output the ior to it - if (output_ != 0) - { - FILE *output_file= ACE_OS::fopen (this->output_, "w"); - if (output_file == 0) - ACE_ERROR_RETURN ((LM_ERROR, - "Cannot open output file for writing IOR: %s", - this->output_), - 1); - ACE_OS::fprintf (output_file, "%s", ior.in ()); - ACE_OS::fclose (output_file); - } - - // Signal the main thread before we call orb->run (); - this->me_.signal (); - - this->sorb_->run (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - - ACE_DEBUG ((LM_DEBUG, "event loop finished\n")); - - root_poa->destroy (1, 1 ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - } - ACE_CATCHANY - { - ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, - "Exception caught in server task:"); - return 1; - } - ACE_ENDTRY; - - return 0; -} diff --git a/TAO/tests/Portable_Interceptors/Processing_Mode_Policy/Collocated/Server_Task.h b/TAO/tests/Portable_Interceptors/Processing_Mode_Policy/Collocated/Server_Task.h deleted file mode 100644 index 2f63a0724de..00000000000 --- a/TAO/tests/Portable_Interceptors/Processing_Mode_Policy/Collocated/Server_Task.h +++ /dev/null @@ -1,53 +0,0 @@ -// -*- C++ -*- -// -// $Id$ - -#ifndef COLLOCATED_SERVER_TASK_H -#define COLLOCATED_SERVER_TASK_H - -#include /**/ "ace/pre.h" - -#include "ace/Task.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "tao/ORB.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL -class ACE_Manual_Event; -ACE_END_VERSIONED_NAMESPACE_DECL - -/// Implement a Task to run the server in a single thread -class Server_Task : public ACE_Task_Base -{ -public: - /// Constructor - Server_Task (const char *output, - CORBA::ORB_ptr sorb, - ACE_Manual_Event &me, - ACE_Thread_Manager *thr_mgr); - - /// Thread entry point - int svc (void); - - /// The status of the svc loop - int status (void) const; - -private: - /// Output file for IOR - const char *output_; - - /// Manual event to wake up the main thread to create a client - /// thread. - ACE_Manual_Event &me_; - - CORBA::ORB_var sorb_; - - int status_; -}; - -#include /**/ "ace/post.h" - -#endif /* COLLOCATED_SERVER_TASK_H */ diff --git a/TAO/tests/Portable_Interceptors/Processing_Mode_Policy/Collocated/interceptors.cpp b/TAO/tests/Portable_Interceptors/Processing_Mode_Policy/Collocated/interceptors.cpp deleted file mode 100644 index 2082c0d81c9..00000000000 --- a/TAO/tests/Portable_Interceptors/Processing_Mode_Policy/Collocated/interceptors.cpp +++ /dev/null @@ -1,395 +0,0 @@ -// $Id$ - -#include "interceptors.h" -#include "tao/PI/ClientRequestInfoC.h" -#include "tao/PI_Server/ServerRequestInfoC.h" -#include "tao/AnyTypeCode/AnyTypeCode_Adapter_Impl.h" -#include "tao/AnyTypeCode/DynamicC.h" -#include "tao/AnyTypeCode/TypeCode.h" -#include "ace/Log_Msg.h" -#include "ace/OS_NS_string.h" - -ACE_RCSID (Dynamic, - interceptors, - "$Id$") - -const char *request_msg = "The Echo_Request_Interceptor request message"; -const char *reply_msg = "The Echo_Request_Interceptor reply message"; -CORBA::ULong Echo_Client_Request_Interceptor::client_interceptor_check_ = 0; -CORBA::ULong Echo_Server_Request_Interceptor::server_interceptor_check_ = 0; - -Echo_Client_Request_Interceptor::Echo_Client_Request_Interceptor (void) - : myname_ ("Echo_Client_Interceptor") -{ -} - -Echo_Client_Request_Interceptor::~Echo_Client_Request_Interceptor () -{ -} - -char * -Echo_Client_Request_Interceptor::name (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - return CORBA::string_dup (this->myname_); -} - -void -Echo_Client_Request_Interceptor::destroy (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ -} - -void -Echo_Client_Request_Interceptor::send_poll ( - PortableInterceptor::ClientRequestInfo_ptr - ACE_ENV_ARG_DECL_NOT_USED - ) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - // Do nothing -} - -void -Echo_Client_Request_Interceptor::send_request ( - PortableInterceptor::ClientRequestInfo_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; - - // Do not count the _is_a calls - if (ACE_OS::strcmp (op.in (), "_is_a") != 0) - { - client_interceptor_check_++; - } - - ACE_DEBUG ((LM_DEBUG, - "Echo_Client_Request_Interceptor::send_request\n")); - - ACE_DEBUG ((LM_DEBUG, - "Echo_Client_Request_Interceptor::send_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)); - } -} - -void -Echo_Client_Request_Interceptor::receive_other ( - PortableInterceptor::ClientRequestInfo_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; - - // Do not count the _is_a calls - if (ACE_OS::strcmp (op.in (), "_is_a") != 0) - { - client_interceptor_check_++; - } - ACE_DEBUG ((LM_DEBUG, - "Echo_Client_Request_Interceptor::receive_other " - "from \"%s\"\n", - op.in ())); -} - -void -Echo_Client_Request_Interceptor::receive_reply ( - PortableInterceptor::ClientRequestInfo_ptr ri - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - - CORBA::String_var op = ri->operation (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; - - // Do not count the _is_a calls - if (ACE_OS::strcmp (op.in (), "_is_a") != 0) - { - client_interceptor_check_++; - } - - ACE_DEBUG ((LM_DEBUG, - "Echo_Client_Request_Interceptor::receive_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; - - } - else 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; - 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_Client_Request_Interceptor::receive_exception ( - PortableInterceptor::ClientRequestInfo_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; - - // Do not count the _is_a calls - if (ACE_OS::strcmp (op.in (), "_is_a") != 0) - { - client_interceptor_check_++; - } - - CORBA::String_var exception_id = - ri->received_exception_id (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; - - ACE_DEBUG ((LM_DEBUG, - "Echo_Client_Request_Interceptor::received_exception " - "from \"%s\"\n", - op.in ())); - - ACE_DEBUG ((LM_DEBUG, - "Exception ID = %s\n", - 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; - - // Do not count the _is_a calls - if (ACE_OS::strcmp (op.in (), "_is_a") != 0) - { - ++server_interceptor_check_; - } - - PortableInterceptor::ObjectId_var test_oid = - ri->object_id (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; - - // Do not count the _is_a calls - if (ACE_OS::strcmp (op.in (), "_is_a") != 0) - { - ++server_interceptor_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; - - // Do not count the _is_a calls - if (ACE_OS::strcmp (op.in (), "_is_a") != 0) - { - ++server_interceptor_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)) -{ - ++server_interceptor_check_; - - // Do Nothing -} diff --git a/TAO/tests/Portable_Interceptors/Processing_Mode_Policy/Collocated/interceptors.h b/TAO/tests/Portable_Interceptors/Processing_Mode_Policy/Collocated/interceptors.h deleted file mode 100644 index c136eb18144..00000000000 --- a/TAO/tests/Portable_Interceptors/Processing_Mode_Policy/Collocated/interceptors.h +++ /dev/null @@ -1,138 +0,0 @@ -// -*- C++ -*- -// -// $Id$ - -#ifndef TAO_INTERCEPTORS_H -#define TAO_INTERCEPTORS_H -#include /**/ "ace/pre.h" - -#include "tao/PI/PI.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "tao/PI_Server/PI_Server.h" -#include "tao/LocalObject.h" - -#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 ~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_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)); - - // Some identifiers that are used for error checking - static CORBA::ULong client_interceptor_check_; -private: - const char *myname_; -}; - -class Echo_Server_Request_Interceptor - : public 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_service_contexts ( - PortableInterceptor::ServerRequestInfo_ptr - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC (( - CORBA::SystemException, - PortableInterceptor::ForwardRequest - )); - - virtual void receive_request (PortableInterceptor::ServerRequestInfo_ptr ri - 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 - )); - - // Some identifiers that are used for error checking - static CORBA::ULong server_interceptor_check_; - -private: - const char *myname_; -}; - -#if defined (_MSC_VER) -#pragma warning(pop) -#endif /* _MSC_VER */ - -#include /**/ "ace/post.h" -#endif /* TAO_INTERCEPTORS_H */ diff --git a/TAO/tests/Portable_Interceptors/Processing_Mode_Policy/Collocated/run_test.pl b/TAO/tests/Portable_Interceptors/Processing_Mode_Policy/Collocated/run_test.pl deleted file mode 100755 index e877773b96e..00000000000 --- a/TAO/tests/Portable_Interceptors/Processing_Mode_Policy/Collocated/run_test.pl +++ /dev/null @@ -1,134 +0,0 @@ -eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' - & eval 'exec perl -S $0 $argv:q' - if 0; - -# $Id$ -# -*- perl -*- - -use lib '../../../../../bin'; -use PerlACE::Run_Test; - -sub get_test_modes -{ - my $testid = shift; - - my $client_mode = "LOCAL_AND_REMOTE"; - my $server_mode = "LOCAL_AND_REMOTE"; - - # There are Nine Permutations. - if ($testid == 1) - { - $client_mode = "LOCAL_AND_REMOTE"; - $server_mode = "LOCAL_AND_REMOTE"; - } - elsif ($testid == 2) - { - $client_mode = "LOCAL_AND_REMOTE"; - $server_mode = "LOCAL_ONLY"; - } - elsif ($testid == 3) - { - $client_mode = "LOCAL_AND_REMOTE"; - $server_mode = "REMOTE_ONLY"; - } - elsif ($testid == 4) - { - $client_mode = "LOCAL_ONLY"; - $server_mode = "LOCAL_AND_REMOTE"; - } - elsif ($testid == 5) - { - $client_mode = "LOCAL_ONLY"; - $server_mode = "LOCAL_ONLY"; - } - elsif ($testid == 6) - { - $client_mode = "LOCAL_ONLY"; - $server_mode = "REMOTE_ONLY"; - } - elsif ($testid == 7) - { - $client_mode = "REMOTE_ONLY"; - $server_mode = "LOCAL_AND_REMOTE"; - } - elsif ($testid == 8) - { - $client_mode = "REMOTE_ONLY"; - $server_mode = "LOCAL_ONLY"; - } - elsif ($testid == 9) - { - $client_mode = "REMOTE_ONLY"; - $server_mode = "REMOTE_ONLY"; - } - else - { - print STDERR "ERROR: invalid testid: $testid\n"; - exit 1; - } - - return ($client_mode, $server_mode); -} - -my $status = 0; -my $file = PerlACE::LocalFile ("test.ior"); - -my $testid; - -for ($testid = 1; $testid <= 9; ++$testid) -{ - unlink $file; - - my $client_mode; - my $server_mode; - - ($client_mode, $server_mode) = get_test_modes($testid); - - my $SV; - if (PerlACE::is_vxworks_test()) { - $SV = new PerlACE::ProcessVX ("PI_ProcMode_Collocated_Test", - "-c $client_mode " . - "-s $server_mode " . - "-ORBobjrefstyle url"); - } - else { - $SV = new PerlACE::Process ("PI_ProcMode_Collocated_Test", - "-c $client_mode " . - "-s $server_mode " . - "-ORBobjrefstyle url"); - } - - print STDERR "\n\n==== Starting test variant #$testid\n\n"; - - $SV->Spawn (); - - if (PerlACE::waitforfile_timed ($file, 15) == -1) { - print STDERR "ERROR: cannot find file <$file>\n"; - $SV->Kill (); - exit 1; - } - - my $collocated = $SV->WaitKill (5); - - if ($collocated != 0) { - print STDERR "ERROR: PI_ProcMode_Collocated_Test returned $collocated\n"; - print STDERR "ERROR: For client-side mode [$client_mode],\n"; - print STDERR "ERROR: and server-side mode [$server_mode].\n"; - $status = 1; - print STDERR "\nTest variant #$testid of 9 failed!\n\n"; - } - else { - print STDERR "\nTest variant #$testid of 9 passed!\n\n"; - } -} - -unlink $file; - -if ($status == 0) { - print STDERR "\n==== All 9 test variants were successful!\n"; -} -else { - print STDERR "\n==== One or more of the 9 test variants failed!\n"; -} - -exit $status; diff --git a/TAO/tests/Portable_Interceptors/Processing_Mode_Policy/Collocated/test.idl b/TAO/tests/Portable_Interceptors/Processing_Mode_Policy/Collocated/test.idl deleted file mode 100644 index 07ed4dee088..00000000000 --- a/TAO/tests/Portable_Interceptors/Processing_Mode_Policy/Collocated/test.idl +++ /dev/null @@ -1,42 +0,0 @@ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// TAO/tests/Portable_Interceptors -// -// = FILENAME -// test.idl -// -// = DESCRIPTION -// Simple IDL file to test portable interceptor support. -// -// = AUTHORS -// Nanbor Wang <nanbor@cs.wustl.edu> -// -// ============================================================================ - -module Test_Interceptors -{ - exception Silly - {}; - - interface Visual - { - void normal (in long arg); - // Normal operation. - - long calculate (in long one, in long two); - // Normal operation with a return val. - - void user () - raises (Silly); - // throws a user exception. - - void system (); - // thows a system exception. - - oneway void shutdown (); - // shutdown the ORB - }; -}; diff --git a/TAO/tests/Portable_Interceptors/Processing_Mode_Policy/Collocated/test_i.cpp b/TAO/tests/Portable_Interceptors/Processing_Mode_Policy/Collocated/test_i.cpp deleted file mode 100644 index 31585a94528..00000000000 --- a/TAO/tests/Portable_Interceptors/Processing_Mode_Policy/Collocated/test_i.cpp +++ /dev/null @@ -1,60 +0,0 @@ -// $Id$ - -#include "test_i.h" -#include "ace/OS_NS_unistd.h" - -ACE_RCSID(Dynamic, test_i, "$Id$") - -Visual_i::Visual_i (CORBA::ORB_ptr orb) - : orb_ (CORBA::ORB::_duplicate (orb)) -{ -} - // ctor - -void -Visual_i::normal (CORBA::Long - ACE_ENV_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - // ACE_DEBUG ((LM_DEBUG, "Visual::normal called with %d\n", arg)); -} - -CORBA::Long -Visual_i::calculate (CORBA::Long one, - CORBA::Long two - ACE_ENV_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - // ACE_DEBUG ((LM_DEBUG, "Visual::calculate\n")); - return (one + two); -} - -void -Visual_i::user (ACE_ENV_SINGLE_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException,Test_Interceptors::Silly)) -{ - // ACE_DEBUG ((LM_DEBUG, "Visual::user, throwning Silly\n")); - ACE_THROW (Test_Interceptors::Silly ()); -} - -void -Visual_i::system (ACE_ENV_SINGLE_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - // ACE_DEBUG ((LM_DEBUG, "Visual::user, throwing INV_OBJREF\n")); - ACE_THROW (CORBA::INV_OBJREF ()); -} - -void -Visual_i::shutdown (ACE_ENV_SINGLE_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - this->_remove_ref (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; - - // Give the client thread time to return from the collocated - // call to this method before shutting down the ORB. We sleep - // to avoid BAD_INV_ORDER exceptions on fast dual processor machines. - ACE_OS::sleep(1); - this->orb_->shutdown (); -} diff --git a/TAO/tests/Portable_Interceptors/Processing_Mode_Policy/Collocated/test_i.h b/TAO/tests/Portable_Interceptors/Processing_Mode_Policy/Collocated/test_i.h deleted file mode 100644 index f31756fb10a..00000000000 --- a/TAO/tests/Portable_Interceptors/Processing_Mode_Policy/Collocated/test_i.h +++ /dev/null @@ -1,54 +0,0 @@ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// TAO/tests/Portable_Interceptors/Dynamic -// -// = FILENAME -// test_i.h -// -// = AUTHOR -// Nanbor Wang -// -// ============================================================================ - -#ifndef TAO_INTERCEPTOR_TEST_I_H -#define TAO_INTERCEPTOR_TEST_I_H - -#include "testS.h" - -class Visual_i : public POA_Test_Interceptors::Visual -{ - // = DESCRIPTION - // Implements the Visual interface in test.idl - -public: - Visual_i (CORBA::ORB_ptr orb); - // ctor - - void normal (CORBA::Long arg - ACE_ENV_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)); - - CORBA::Long calculate ( - CORBA::Long one, - CORBA::Long two - ACE_ENV_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)); - - void user (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException,Test_Interceptors::Silly)); - - void system (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)); - - void shutdown (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)); - -private: - CORBA::ORB_var orb_; - // The ORB pointer (for shutdown.) -}; - -#endif /* TAO_INTERCEPTOR_TEST_I_H */ diff --git a/TAO/tests/Portable_Interceptors/Processing_Mode_Policy/Remote/Client_Task.cpp b/TAO/tests/Portable_Interceptors/Processing_Mode_Policy/Remote/Client_Task.cpp deleted file mode 100644 index 0990fd47209..00000000000 --- a/TAO/tests/Portable_Interceptors/Processing_Mode_Policy/Remote/Client_Task.cpp +++ /dev/null @@ -1,98 +0,0 @@ -// -// $Id$ -// - -#include "Client_Task.h" -#include "testC.h" -#include "client_interceptor.h" - -ACE_RCSID(Remote, Client_Task, "$Id$") - -Client_Task::Client_Task (const char *ior, - CORBA::ORB_ptr corb, - ACE_Thread_Manager *thr_mgr) - : ACE_Task_Base (thr_mgr) - , input_ (ior) - , corb_ (CORBA::ORB::_duplicate (corb)) - -{ -} - -int -Client_Task::svc (void) -{ - ACE_TRY_NEW_ENV - { - - CORBA::Object_var object = - corb_->string_to_object (input_ ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - Test_Interceptors::Visual_var server = - Test_Interceptors::Visual::_narrow (object.in () ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - if (CORBA::is_nil (server.in ())) - { - ACE_ERROR_RETURN ((LM_ERROR, - "Object reference <%s> is nil\n", - this->input_), - 1); - } - - run_test (server.in () ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - server->shutdown (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - } - ACE_CATCHANY - { - ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, - "Exception caught in client task:"); - return 1; - } - ACE_ENDTRY; - - return 0; - -} - - -void -Client_Task::run_test (Test_Interceptors::Visual_ptr server - ACE_ENV_ARG_DECL) -{ - server->normal (10 ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - - CORBA::Long one = 1, two = 1; - (void) server->calculate (one, - two - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - - ACE_TRY - { - (void) server->user (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - } - ACE_CATCH (Test_Interceptors::Silly, userex) - { - ACE_DEBUG ((LM_DEBUG, "As expected, Caught Silly\n")); - } - ACE_ENDTRY; - ACE_CHECK; - - ACE_TRY_EX (SYS) - { - server->system (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK_EX (SYS); - } - ACE_CATCH (CORBA::INV_OBJREF, sysex) - { - ACE_DEBUG ((LM_DEBUG, "As expected, Caught CORBA::INV_OBJREF\n")); - } - ACE_ENDTRY; - ACE_CHECK; -} diff --git a/TAO/tests/Portable_Interceptors/Processing_Mode_Policy/Remote/Client_Task.h b/TAO/tests/Portable_Interceptors/Processing_Mode_Policy/Remote/Client_Task.h deleted file mode 100644 index 3678e806775..00000000000 --- a/TAO/tests/Portable_Interceptors/Processing_Mode_Policy/Remote/Client_Task.h +++ /dev/null @@ -1,45 +0,0 @@ -// -// $Id$ -// - -#ifndef TEST_CLIENT_TASK_H -#define TEST_CLIENT_TASK_H -#include /**/ "ace/pre.h" -#include "ace/Task.h" -#include "testS.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ -#include "tao/ORB.h" - - -/// Implement a Task to run the client as a thread -class Client_Task : public ACE_Task_Base -{ -public: - - /// Constructor - Client_Task (const char *input, - CORBA::ORB_ptr corb, - ACE_Thread_Manager *thr_mgr); - - /// Thread entry point - int svc (void); - - void run_test (Test_Interceptors::Visual_ptr server - ACE_ENV_ARG_DECL); - - /// The status of the svc loop - int status (void) const; - -private: - const char *input_; - - CORBA::ORB_var corb_; - - int status_; -}; - -#include /**/ "ace/post.h" -#endif /* TEST_CLIENT_TASK_H */ diff --git a/TAO/tests/Portable_Interceptors/Processing_Mode_Policy/Remote/Echo_Client_ORBInitializer.cpp b/TAO/tests/Portable_Interceptors/Processing_Mode_Policy/Remote/Echo_Client_ORBInitializer.cpp deleted file mode 100644 index 15751d6f087..00000000000 --- a/TAO/tests/Portable_Interceptors/Processing_Mode_Policy/Remote/Echo_Client_ORBInitializer.cpp +++ /dev/null @@ -1,90 +0,0 @@ -// -*- C++ -*- -// -// $Id$ - -#include "Echo_Client_ORBInitializer.h" -#include "client_interceptor.h" -#include "tao/PI/ORBInitInfo.h" -#include "tao/ORB_Core.h" -#include "ace/OS_NS_string.h" - -Echo_Client_ORBInitializer::Echo_Client_ORBInitializer ( - PortableInterceptor::ProcessingMode proc_mode) - : processing_mode_(proc_mode) -{ -} - -void -Echo_Client_ORBInitializer::pre_init ( - PortableInterceptor::ORBInitInfo_ptr - ACE_ENV_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ -} - -void -Echo_Client_ORBInitializer::post_init ( - PortableInterceptor::ORBInitInfo_ptr info - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - // TAO-Specific way to get to the ORB Core (and thus, the ORB). - TAO_ORBInitInfo_var tao_info = - TAO_ORBInitInfo::_narrow (info - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - - CORBA::ORB_var orb = CORBA::ORB::_duplicate(tao_info->orb_core()->orb()); - - if (CORBA::is_nil(orb.in())) - { - ACE_THROW (CORBA::INTERNAL ()); - ACE_CHECK; - } - - PortableInterceptor::ORBInitInfo_3_1_var info_3_1 = - PortableInterceptor::ORBInitInfo_3_1::_narrow(info - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - - if (CORBA::is_nil(info_3_1.in())) - { - ACE_THROW (CORBA::INTERNAL ()); - ACE_CHECK; - } - - PortableInterceptor::ClientRequestInterceptor_ptr interceptor = - PortableInterceptor::ClientRequestInterceptor::_nil (); - - // Install the Echo client request interceptor - ACE_NEW_THROW_EX (interceptor, - Echo_Client_Request_Interceptor, - CORBA::NO_MEMORY ()); - ACE_CHECK; - - PortableInterceptor::ClientRequestInterceptor_var - client_interceptor = interceptor; - - CORBA::Any client_proc_mode_as_any; - client_proc_mode_as_any <<= this->processing_mode_; - - CORBA::PolicyList policy_list (1); - - policy_list.length (1); - policy_list[0] = - orb->create_policy (PortableInterceptor::PROCESSING_MODE_POLICY_TYPE, - client_proc_mode_as_any - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - - info_3_1->add_client_request_interceptor_with_policy ( - client_interceptor.in (), - policy_list - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - - policy_list[0]->destroy (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; - policy_list[0] = CORBA::Policy::_nil (); -} - diff --git a/TAO/tests/Portable_Interceptors/Processing_Mode_Policy/Remote/Echo_Client_ORBInitializer.h b/TAO/tests/Portable_Interceptors/Processing_Mode_Policy/Remote/Echo_Client_ORBInitializer.h deleted file mode 100644 index 58506555153..00000000000 --- a/TAO/tests/Portable_Interceptors/Processing_Mode_Policy/Remote/Echo_Client_ORBInitializer.h +++ /dev/null @@ -1,58 +0,0 @@ -// -*- C++ -*- -// -// $Id$ - -#ifndef TAO_ECHO_CLIENT_ORB_INITIALIZER_H -#define TAO_ECHO_CLIENT_ORB_INITIALIZER_H - -#include /**/ "ace/pre.h" - -#include "tao/orbconf.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - - -#include "tao/PI/PI.h" -#include "tao/PI/ProcessingModePolicyC.h" -#include "tao/LocalObject.h" - -// This is to remove "inherits via dominance" warnings from MSVC. -// MSVC is being a little too paranoid. -#if defined(_MSC_VER) -#pragma warning(push) -#pragma warning(disable:4250) -#endif /* _MSC_VER */ - -/// Echo client ORB initializer. -class Echo_Client_ORBInitializer : - public virtual PortableInterceptor::ORBInitializer, - public virtual TAO_Local_RefCounted_Object -{ -public: - - Echo_Client_ORBInitializer - (PortableInterceptor::ProcessingMode proc_mode); - - virtual void pre_init (PortableInterceptor::ORBInitInfo_ptr info - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - virtual void post_init (PortableInterceptor::ORBInitInfo_ptr info - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - -private: - - PortableInterceptor::ProcessingMode processing_mode_; -}; - -#if defined (_MSC_VER) -#pragma warning(pop) -#endif /* _MSC_VER */ - - -#include /**/ "ace/post.h" - -#endif /* TAO_ECHO_CLIENT_ORB_INITIALIZER_H */ diff --git a/TAO/tests/Portable_Interceptors/Processing_Mode_Policy/Remote/Echo_Server_ORBInitializer.cpp b/TAO/tests/Portable_Interceptors/Processing_Mode_Policy/Remote/Echo_Server_ORBInitializer.cpp deleted file mode 100644 index 9136e25e126..00000000000 --- a/TAO/tests/Portable_Interceptors/Processing_Mode_Policy/Remote/Echo_Server_ORBInitializer.cpp +++ /dev/null @@ -1,94 +0,0 @@ -// -*- C++ -*- -// -// $Id$ - -#include "Echo_Server_ORBInitializer.h" -#include "server_interceptor.h" -#include "tao/PI/ORBInitInfo.h" -#include "tao/ORB_Core.h" -#include "ace/OS_NS_string.h" - -Echo_Server_ORBInitializer::Echo_Server_ORBInitializer ( - PortableInterceptor::ProcessingMode proc_mode) - : processing_mode_(proc_mode) -{ -} - -void -Echo_Server_ORBInitializer::pre_init ( - PortableInterceptor::ORBInitInfo_ptr - ACE_ENV_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ -} - -void -Echo_Server_ORBInitializer::post_init ( - PortableInterceptor::ORBInitInfo_ptr info - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - CORBA::String_var orb_id = - info->orb_id (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; - - // TAO-Specific way to get to the ORB Core (and thus, the ORB). - TAO_ORBInitInfo_var tao_info = - TAO_ORBInitInfo::_narrow (info - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - - CORBA::ORB_var orb = CORBA::ORB::_duplicate(tao_info->orb_core()->orb()); - - if (CORBA::is_nil(orb.in())) - { - ACE_THROW (CORBA::INTERNAL ()); - ACE_CHECK; - } - - PortableInterceptor::ORBInitInfo_3_1_var info_3_1 = - PortableInterceptor::ORBInitInfo_3_1::_narrow(info - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - - if (CORBA::is_nil(info_3_1.in())) - { - ACE_THROW (CORBA::INTERNAL ()); - ACE_CHECK; - } - - PortableInterceptor::ServerRequestInterceptor_ptr interceptor = - PortableInterceptor::ServerRequestInterceptor::_nil (); - - // Install the Echo server request interceptor - ACE_NEW_THROW_EX (interceptor, - Echo_Server_Request_Interceptor, - CORBA::NO_MEMORY ()); - ACE_CHECK; - - PortableInterceptor::ServerRequestInterceptor_var - server_interceptor = interceptor; - - CORBA::Any proc_mode_as_any; - proc_mode_as_any <<= this->processing_mode_; - - CORBA::PolicyList policy_list (1); - - policy_list.length (1); - policy_list[0] = - orb->create_policy (PortableInterceptor::PROCESSING_MODE_POLICY_TYPE, - proc_mode_as_any - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - - info_3_1->add_server_request_interceptor_with_policy ( - server_interceptor.in (), - policy_list - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - - policy_list[0]->destroy (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; - policy_list[0] = CORBA::Policy::_nil (); -} - diff --git a/TAO/tests/Portable_Interceptors/Processing_Mode_Policy/Remote/Echo_Server_ORBInitializer.h b/TAO/tests/Portable_Interceptors/Processing_Mode_Policy/Remote/Echo_Server_ORBInitializer.h deleted file mode 100644 index f3af07cc4ae..00000000000 --- a/TAO/tests/Portable_Interceptors/Processing_Mode_Policy/Remote/Echo_Server_ORBInitializer.h +++ /dev/null @@ -1,57 +0,0 @@ -// -*- C++ -*- -// -// $Id$ - -#ifndef TAO_ECHO_SERVER_ORB_INITIALIZER_H -#define TAO_ECHO_SERVER_ORB_INITIALIZER_H - -#include /**/ "ace/pre.h" - -#include "tao/orbconf.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "tao/PI/PI.h" -#include "tao/PI/ProcessingModePolicyC.h" -#include "tao/LocalObject.h" - -// This is to remove "inherits via dominance" warnings from MSVC. -// MSVC is being a little too paranoid. -#if defined(_MSC_VER) -#pragma warning(push) -#pragma warning(disable:4250) -#endif /* _MSC_VER */ - -/// Echo client ORB initializer. -class Echo_Server_ORBInitializer : - public virtual PortableInterceptor::ORBInitializer, - public virtual TAO_Local_RefCounted_Object -{ -public: - - Echo_Server_ORBInitializer - (PortableInterceptor::ProcessingMode proc_mode); - - virtual void pre_init (PortableInterceptor::ORBInitInfo_ptr info - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - virtual void post_init (PortableInterceptor::ORBInitInfo_ptr info - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - -private: - - PortableInterceptor::ProcessingMode processing_mode_; -}; - -#if defined (_MSC_VER) -#pragma warning(pop) -#endif /* _MSC_VER */ - - -#include /**/ "ace/post.h" - -#endif /* TAO_ECHO_SERVER_ORB_INITIALIZER_H */ diff --git a/TAO/tests/Portable_Interceptors/Processing_Mode_Policy/Remote/PI_ProcMode_Remote.mpc b/TAO/tests/Portable_Interceptors/Processing_Mode_Policy/Remote/PI_ProcMode_Remote.mpc deleted file mode 100644 index deab03af74f..00000000000 --- a/TAO/tests/Portable_Interceptors/Processing_Mode_Policy/Remote/PI_ProcMode_Remote.mpc +++ /dev/null @@ -1,26 +0,0 @@ -// -*- MPC -*- -// $Id$ - -project(*RemoteServer): taoserver, pi_server, interceptors { - exename = PI_ProcMode_Remote_TestServer - Source_Files { - testC.cpp - testS.cpp - test_i.cpp - server_interceptor.cpp - Echo_Server_ORBInitializer.cpp - server_main.cpp - Server_Task.cpp - } -} - -project(*RemoteClient): taoclient, portableserver, pi, interceptors { - exename = PI_ProcMode_Remote_TestClient - Source_Files { - testC.cpp - client_interceptor.cpp - Echo_Client_ORBInitializer.cpp - client_main.cpp - Client_Task.cpp - } -} diff --git a/TAO/tests/Portable_Interceptors/Processing_Mode_Policy/Remote/Server_Task.cpp b/TAO/tests/Portable_Interceptors/Processing_Mode_Policy/Remote/Server_Task.cpp deleted file mode 100644 index 7fbab820892..00000000000 --- a/TAO/tests/Portable_Interceptors/Processing_Mode_Policy/Remote/Server_Task.cpp +++ /dev/null @@ -1,112 +0,0 @@ -// -// $Id$ -// -#include "Server_Task.h" -#include "test_i.h" -#include "server_interceptor.h" - -#include "ace/Manual_Event.h" - -ACE_RCSID(Remote, - Server_Task, - "$Id$") - - -Server_Task::Server_Task (const char *output, - CORBA::ORB_ptr sorb, - ACE_Manual_Event &me, - ACE_Thread_Manager *thr_mgr) - : ACE_Task_Base (thr_mgr) - , output_ (output) - , me_ (me) - , sorb_ (CORBA::ORB::_duplicate (sorb)) -{ -} - -int -Server_Task::svc (void) -{ - ACE_TRY_NEW_ENV - { - - CORBA::Object_var poa_object = - sorb_->resolve_initial_references ("RootPOA" ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - if (CORBA::is_nil (poa_object.in ())) - ACE_ERROR_RETURN ((LM_ERROR, - " (%P|%t) Unable to initialize the POA.\n"), - 1); - - PortableServer::POA_var root_poa = - PortableServer::POA::_narrow (poa_object.in () ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - PortableServer::POAManager_var poa_manager = - root_poa->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - - poa_manager->activate (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - - Visual_i * server_impl = 0; - ACE_NEW_RETURN (server_impl, Visual_i (sorb_.in ()), 1); - - PortableServer::ObjectId_var id = - root_poa->activate_object (server_impl - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - CORBA::Object_var test_obj = - root_poa->id_to_reference (id.in () - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - Test_Interceptors::Visual_var server = - Test_Interceptors::Visual::_narrow (test_obj.in () - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - CORBA::String_var ior = - this->sorb_->object_to_string (server.in () ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - ACE_DEBUG ((LM_DEBUG, "Test_Interceptors::Visual: <%s>\n", ior.in ())); - - // If the ior_output_file exists, output the ior to it - if (output_ != 0) - { - FILE *output_file= ACE_OS::fopen (this->output_, "w"); - if (output_file == 0) - ACE_ERROR_RETURN ((LM_ERROR, - "Cannot open output file for writing IOR: %s", - this->output_), - 1); - ACE_OS::fprintf (output_file, "%s", ior.in ()); - ACE_OS::fclose (output_file); - } - - // Signal the main thread before we call orb->run (); - this->me_.signal (); - - this->sorb_->run (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - - ACE_DEBUG ((LM_DEBUG, "event loop finished\n")); - - root_poa->destroy (1, 1 ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - this->sorb_->destroy (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - } - ACE_CATCHANY - { - ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, - "Exception caught in server task:"); - return 1; - } - ACE_ENDTRY; - - return 0; -} diff --git a/TAO/tests/Portable_Interceptors/Processing_Mode_Policy/Remote/Server_Task.h b/TAO/tests/Portable_Interceptors/Processing_Mode_Policy/Remote/Server_Task.h deleted file mode 100644 index 6b7b9404bd5..00000000000 --- a/TAO/tests/Portable_Interceptors/Processing_Mode_Policy/Remote/Server_Task.h +++ /dev/null @@ -1,53 +0,0 @@ -// -*- C++ -*- -// -// $Id$ - -#ifndef TEST_SERVER_TASK_H -#define TEST_SERVER_TASK_H - -#include /**/ "ace/pre.h" - -#include "ace/Task.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "tao/ORB.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL -class ACE_Manual_Event; -ACE_END_VERSIONED_NAMESPACE_DECL - -/// Implement a Task to run the server in a single thread -class Server_Task : public ACE_Task_Base -{ -public: - /// Constructor - Server_Task (const char *output, - CORBA::ORB_ptr sorb, - ACE_Manual_Event &me, - ACE_Thread_Manager *thr_mgr); - - /// Thread entry point - int svc (void); - - /// The status of the svc loop - int status (void) const; - -private: - /// Output file for IOR - const char *output_; - - /// Manual event to wake up the main thread to create a client - /// thread. - ACE_Manual_Event &me_; - - CORBA::ORB_var sorb_; - - int status_; -}; - -#include /**/ "ace/post.h" - -#endif /* COLLOCATED_SERVER_TASK_H */ diff --git a/TAO/tests/Portable_Interceptors/Processing_Mode_Policy/Remote/client_interceptor.cpp b/TAO/tests/Portable_Interceptors/Processing_Mode_Policy/Remote/client_interceptor.cpp deleted file mode 100644 index 399025fa883..00000000000 --- a/TAO/tests/Portable_Interceptors/Processing_Mode_Policy/Remote/client_interceptor.cpp +++ /dev/null @@ -1,184 +0,0 @@ -// $Id$ - -#include "client_interceptor.h" -#include "tao/AnyTypeCode/AnyTypeCode_Adapter_Impl.h" -#include "tao/AnyTypeCode/DynamicC.h" -#include "tao/AnyTypeCode/TypeCode.h" -#include "ace/Log_Msg.h" -#include "ace/OS_NS_string.h" - -ACE_RCSID (Remote, - client_interceptor, - "$Id$") - -const char *request_msg = "The Echo_Client_Request_Interceptor request message"; -const char *reply_msg = "The Echo_Client_Request_Interceptor reply message"; -CORBA::ULong Echo_Client_Request_Interceptor::client_interceptor_check_ = 0; - -Echo_Client_Request_Interceptor::Echo_Client_Request_Interceptor (void) - : myname_ ("Echo_Client_Interceptor") -{ -} - -Echo_Client_Request_Interceptor::~Echo_Client_Request_Interceptor () -{ -} - -char * -Echo_Client_Request_Interceptor::name (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - return CORBA::string_dup (this->myname_); -} - -void -Echo_Client_Request_Interceptor::destroy (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ -} - -void -Echo_Client_Request_Interceptor::send_poll ( - PortableInterceptor::ClientRequestInfo_ptr - ACE_ENV_ARG_DECL_NOT_USED - ) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - // Do nothing -} - -void -Echo_Client_Request_Interceptor::send_request ( - PortableInterceptor::ClientRequestInfo_ptr ri - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableInterceptor::ForwardRequest)) -{ - client_interceptor_check_++; - - CORBA::String_var op = - ri->operation (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; - - ACE_DEBUG ((LM_DEBUG, - "Echo_Client_Request_Interceptor::send_request\n")); - - ACE_DEBUG ((LM_DEBUG, - "Echo_Client_Request_Interceptor::send_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)); - } -} - -void -Echo_Client_Request_Interceptor::receive_other ( - PortableInterceptor::ClientRequestInfo_ptr ri - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableInterceptor::ForwardRequest)) -{ - client_interceptor_check_++; - - CORBA::String_var op = ri->operation (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; - - ACE_DEBUG ((LM_DEBUG, - "Echo_Client_Request_Interceptor::receive_other " - "from \"%s\"\n", - op.in ())); -} - -void -Echo_Client_Request_Interceptor::receive_reply ( - PortableInterceptor::ClientRequestInfo_ptr ri - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - client_interceptor_check_++; - - CORBA::String_var op = ri->operation (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; - - ACE_DEBUG ((LM_DEBUG, - "Echo_Client_Request_Interceptor::receive_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; - - } - else 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; - 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_Client_Request_Interceptor::receive_exception ( - PortableInterceptor::ClientRequestInfo_ptr ri - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableInterceptor::ForwardRequest)) -{ - client_interceptor_check_++; - - CORBA::String_var op = ri->operation (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; - - CORBA::String_var exception_id = - ri->received_exception_id (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; - - ACE_DEBUG ((LM_DEBUG, - "Echo_Client_Request_Interceptor::received_exception " - "from \"%s\"\n", - op.in ())); - - ACE_DEBUG ((LM_DEBUG, - "Exception ID = %s\n", - exception_id.in ())); -} - diff --git a/TAO/tests/Portable_Interceptors/Processing_Mode_Policy/Remote/client_interceptor.h b/TAO/tests/Portable_Interceptors/Processing_Mode_Policy/Remote/client_interceptor.h deleted file mode 100644 index fc49396097a..00000000000 --- a/TAO/tests/Portable_Interceptors/Processing_Mode_Policy/Remote/client_interceptor.h +++ /dev/null @@ -1,81 +0,0 @@ -// -*- C++ -*- -// -// $Id$ - -#ifndef TAO_CLIENT_INTERCEPTOR_H -#define TAO_CLIENT_INTERCEPTOR_H -#include /**/ "ace/pre.h" - -#include "tao/PI/PI.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "tao/LocalObject.h" - -#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 ~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_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)); - - // Some identifiers that are used for error checking - static CORBA::ULong client_interceptor_check_; -private: - const char *myname_; -}; - -#if defined (_MSC_VER) -#pragma warning(pop) -#endif /* _MSC_VER */ - -#include /**/ "ace/post.h" -#endif /* TAO_CLIENT_INTERCEPTOR_H */ diff --git a/TAO/tests/Portable_Interceptors/Processing_Mode_Policy/Remote/client_main.cpp b/TAO/tests/Portable_Interceptors/Processing_Mode_Policy/Remote/client_main.cpp deleted file mode 100644 index 78a62bdf25e..00000000000 --- a/TAO/tests/Portable_Interceptors/Processing_Mode_Policy/Remote/client_main.cpp +++ /dev/null @@ -1,136 +0,0 @@ -//$Id$ -#include "Client_Task.h" -#include "ace/Get_Opt.h" -#include "ace/Argv_Type_Converter.h" -#include "ace/SString.h" -#include "ace/Manual_Event.h" -#include "Echo_Client_ORBInitializer.h" -#include "tao/ORBInitializer_Registry.h" -#include "client_interceptor.h" - -const char *input = "file://test.ior"; - -ACE_CString proc_mode_str; - -int -parse_args (int argc, char *argv[]) -{ - ACE_Get_Opt get_opts (argc, argv, "p:k:"); - int c; - - proc_mode_str.set ("LOCAL_AND_REMOTE"); - - while ((c = get_opts ()) != -1) - { - switch (c) - { - case 'p': - proc_mode_str.set (get_opts.opt_arg ()); - break; - case 'k': - input = get_opts.opt_arg (); - break; - case '?': - default: - return 0; - } - } - // Indicates sucessful parsing of the command line - return 0; -} - -int -main (int argc, char *argv[]) -{ - if (parse_args (argc, - argv) == -1) - return -1; - - ACE_DECLARE_NEW_CORBA_ENV; - ACE_TRY - { - PortableInterceptor::ORBInitializer_ptr temp_initializer = - PortableInterceptor::ORBInitializer::_nil (); - - // Set up our default expectations. - CORBA::ULong expected_interceptor_check = 12; - - PortableInterceptor::ProcessingMode proc_mode = - PortableInterceptor::LOCAL_AND_REMOTE; - - if (proc_mode_str == "LOCAL_ONLY") - { - proc_mode = PortableInterceptor::LOCAL_ONLY; - ACE_DEBUG((LM_DEBUG, - "Using LOCAL_ONLY for client-side ProcessingMode.\n")); - - // Since all of the calls are remote, setting the client-side - // ProcessingMode to LOCAL_ONLY will cause the client request - // interceptor to not fire. Thus, we expect 0 calls on the - // client interceptor. - expected_interceptor_check = 0; - } - else if (proc_mode_str == "REMOTE_ONLY") - { - proc_mode = PortableInterceptor::REMOTE_ONLY; - ACE_DEBUG((LM_DEBUG, - "Using REMOTE_ONLY for client-side ProcessingMode.\n")); - } - else - { - ACE_DEBUG((LM_DEBUG, - "Using LOCAL_AND_REMOTE for client-side ProcessingMode.\n")); - } - - ACE_NEW_RETURN (temp_initializer, - Echo_Client_ORBInitializer (proc_mode), - -1); // No exceptions yet! - PortableInterceptor::ORBInitializer_var orb_initializer = - temp_initializer; - - PortableInterceptor::register_orb_initializer (orb_initializer.in () - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - ACE_Argv_Type_Converter atc (argc, argv); - CORBA::ORB_var orb = - CORBA::ORB_init (atc.get_argc (), - atc.get_TCHAR_argv (), - "" - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - Client_Task client_task (input, - orb.in (), - ACE_Thread_Manager::instance ()); - - if (client_task.activate (THR_NEW_LWP | THR_JOINABLE, - 1, - 1) == -1) - { - ACE_ERROR ((LM_ERROR, "Error activating client task\n")); - } - - ACE_Thread_Manager::instance ()->wait (); - - CORBA::ULong number_called = - Echo_Client_Request_Interceptor::client_interceptor_check_; - - if (number_called != expected_interceptor_check) - { - ACE_ERROR ((LM_ERROR, - "(%P|%t) ERROR:Client-Side Interceptors not called " - "properly, called %d times, expected %d.\n", - number_called, expected_interceptor_check)); - return 1; - } - } - ACE_CATCHANY - { - ACE_ERROR ((LM_ERROR, - "(%P|%t) ERROR: Some exception was caught in main().\n")); - return 1; - } - ACE_ENDTRY; - return 0; -} diff --git a/TAO/tests/Portable_Interceptors/Processing_Mode_Policy/Remote/run_test.pl b/TAO/tests/Portable_Interceptors/Processing_Mode_Policy/Remote/run_test.pl deleted file mode 100755 index b04af3c2968..00000000000 --- a/TAO/tests/Portable_Interceptors/Processing_Mode_Policy/Remote/run_test.pl +++ /dev/null @@ -1,154 +0,0 @@ -eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' - & eval 'exec perl -S $0 $argv:q' - if 0; - -# $Id$ -# -*- perl -*- - -use lib '../../../../../bin'; -use PerlACE::Run_Test; - -sub get_test_modes -{ - my $testid = shift; - - my $client_mode = "LOCAL_AND_REMOTE"; - my $server_mode = "LOCAL_AND_REMOTE"; - - # There are Nine Permutations. - if ($testid == 1) - { - $client_mode = "LOCAL_AND_REMOTE"; - $server_mode = "LOCAL_AND_REMOTE"; - } - elsif ($testid == 2) - { - $client_mode = "LOCAL_AND_REMOTE"; - $server_mode = "LOCAL_ONLY"; - } - elsif ($testid == 3) - { - $client_mode = "LOCAL_AND_REMOTE"; - $server_mode = "REMOTE_ONLY"; - } - elsif ($testid == 4) - { - $client_mode = "LOCAL_ONLY"; - $server_mode = "LOCAL_AND_REMOTE"; - } - elsif ($testid == 5) - { - $client_mode = "LOCAL_ONLY"; - $server_mode = "LOCAL_ONLY"; - } - elsif ($testid == 6) - { - $client_mode = "LOCAL_ONLY"; - $server_mode = "REMOTE_ONLY"; - } - elsif ($testid == 7) - { - $client_mode = "REMOTE_ONLY"; - $server_mode = "LOCAL_AND_REMOTE"; - } - elsif ($testid == 8) - { - $client_mode = "REMOTE_ONLY"; - $server_mode = "LOCAL_ONLY"; - } - elsif ($testid == 9) - { - $client_mode = "REMOTE_ONLY"; - $server_mode = "REMOTE_ONLY"; - } - else - { - print STDERR "ERROR: invalid testid: $testid\n"; - exit 1; - } - - return ($client_mode, $server_mode); -} - -my $status = 0; -my $file = PerlACE::LocalFile ("test.ior"); - -my $testid; - -for ($testid = 1; $testid <= 9; ++$testid) -{ - unlink $file; - - my $client_mode; - my $server_mode; - - ($client_mode, $server_mode) = get_test_modes($testid); - - my $SV; - if (PerlACE::is_vxworks_test()) { - $SV = new PerlACE::ProcessVX ("PI_ProcMode_Remote_TestServer", - "-p $server_mode " . - "-ORBobjrefstyle url"); - } - else { - $SV = new PerlACE::Process ("PI_ProcMode_Remote_TestServer", - "-p $server_mode " . - "-ORBobjrefstyle url"); - } - - print STDERR "\n\n==== Starting test variant #$testid\n\n"; - - $server = $SV->Spawn (); - - if ($server != 0) { - print STDERR "ERROR: server returned $server\n"; - exit 1; - } - - if (PerlACE::waitforfile_timed ($file, 15) == -1) { - print STDERR "ERROR: cannot find file <$file>\n"; - $SV->Kill (); - exit 1; - } - - my $CLIENT; - $CLIENT = new PerlACE::Process ("PI_ProcMode_Remote_TestClient", - "-p $client_mode " . - "-ORBobjrefstyle url"); - - my $client_status = $CLIENT->SpawnWaitKill (5); - - if ($client_status != 0) { - print STDERR "ERROR: PI_ProcMode_TestClient returned $client_status\n"; - print STDERR "ERROR: For client-side mode [$client_mode],\n"; - print STDERR "ERROR: and server-side mode [$server_mode].\n"; - $status = 1; - } - - my $server_status = $SV->WaitKill (5); - - if ($server_status != 0) { - print STDERR "ERROR: PI_ProcMode_TestServer returned $server_status\n"; - print STDERR "ERROR: For client-side mode [$client_mode],\n"; - print STDERR "ERROR: and server-side mode [$server_mode].\n"; - $status = 1; - } - - if (($server_status == 0) && ($client_status == 0)) { - print STDERR "\n==== Test variant #$testid (of 9) passed!\n"; - } - else { - print STDERR "\n==== Test variant #$testid (of 9) failed!\n"; - } -} - -unlink $file; - -if ($status == 0) { - print STDERR "\n==== All 9 test variants were successful!\n"; -} -else { - print STDERR "\n==== One or more of the 9 test variants failed!\n"; -} - -exit $status; diff --git a/TAO/tests/Portable_Interceptors/Processing_Mode_Policy/Remote/server_interceptor.cpp b/TAO/tests/Portable_Interceptors/Processing_Mode_Policy/Remote/server_interceptor.cpp deleted file mode 100644 index a1928755bec..00000000000 --- a/TAO/tests/Portable_Interceptors/Processing_Mode_Policy/Remote/server_interceptor.cpp +++ /dev/null @@ -1,192 +0,0 @@ -// $Id$ - -#include "server_interceptor.h" -#include "tao/AnyTypeCode/AnyTypeCode_Adapter_Impl.h" -#include "tao/AnyTypeCode/DynamicC.h" -#include "tao/AnyTypeCode/TypeCode.h" -#include "ace/Log_Msg.h" -#include "ace/OS_NS_string.h" - -ACE_RCSID (Remote, - server_interceptor, - "$Id$") - -const char *request_msg = "The Echo_Server_Request_Interceptor request message"; -const char *reply_msg = "The Echo_Server_Request_Interceptor reply message"; -CORBA::ULong Echo_Server_Request_Interceptor::server_interceptor_check_ = 0; - -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)) -{ - ++server_interceptor_check_; - - CORBA::String_var op = ri->operation (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; - - PortableInterceptor::ObjectId_var test_oid = - ri->object_id (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)) -{ - ++server_interceptor_check_; - - 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)) -{ - ++server_interceptor_check_; - - 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)) -{ - ++server_interceptor_check_; - - // Do Nothing -} diff --git a/TAO/tests/Portable_Interceptors/Processing_Mode_Policy/Remote/server_interceptor.h b/TAO/tests/Portable_Interceptors/Processing_Mode_Policy/Remote/server_interceptor.h deleted file mode 100644 index 1c6f50936a3..00000000000 --- a/TAO/tests/Portable_Interceptors/Processing_Mode_Policy/Remote/server_interceptor.h +++ /dev/null @@ -1,84 +0,0 @@ -// -*- C++ -*- -// -// $Id$ - -#ifndef TAO_SERVER_INTERCEPTOR_H -#define TAO_SERVER_INTERCEPTOR_H -#include /**/ "ace/pre.h" - -#include "tao/PI/PI.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "tao/PI_Server/PI_Server.h" -#include "tao/LocalObject.h" - -#if defined(_MSC_VER) -#pragma warning(push) -#pragma warning(disable:4250) -#endif /* _MSC_VER */ - -class Echo_Server_Request_Interceptor - : public 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_service_contexts ( - PortableInterceptor::ServerRequestInfo_ptr - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC (( - CORBA::SystemException, - PortableInterceptor::ForwardRequest - )); - - virtual void receive_request (PortableInterceptor::ServerRequestInfo_ptr ri - 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 - )); - - // Some identifiers that are used for error checking - static CORBA::ULong server_interceptor_check_; - -private: - const char *myname_; -}; - -#if defined (_MSC_VER) -#pragma warning(pop) -#endif /* _MSC_VER */ - -#include /**/ "ace/post.h" -#endif /* TAO_SERVER_INTERCEPTOR_H */ diff --git a/TAO/tests/Portable_Interceptors/Processing_Mode_Policy/Remote/server_main.cpp b/TAO/tests/Portable_Interceptors/Processing_Mode_Policy/Remote/server_main.cpp deleted file mode 100644 index 720d51ab9ad..00000000000 --- a/TAO/tests/Portable_Interceptors/Processing_Mode_Policy/Remote/server_main.cpp +++ /dev/null @@ -1,138 +0,0 @@ -//$Id$ -#include "Server_Task.h" -#include "ace/Get_Opt.h" -#include "ace/Argv_Type_Converter.h" -#include "ace/SString.h" -#include "ace/Manual_Event.h" -#include "Echo_Server_ORBInitializer.h" -#include "tao/ORBInitializer_Registry.h" -#include "server_interceptor.h" - -const char *output = "test.ior"; - -ACE_CString proc_mode_str; - -int -parse_args (int argc, char *argv[]) -{ - ACE_Get_Opt get_opts (argc, argv, "p:o:"); - int c; - - proc_mode_str.set ("LOCAL_AND_REMOTE"); - - while ((c = get_opts ()) != -1) - { - switch (c) - { - case 'p': - proc_mode_str.set (get_opts.opt_arg ()); - break; - case 'o': - output = get_opts.opt_arg (); - break; - case '?': - default: - return 0; - } - } - // Indicates sucessful parsing of the command line - return 0; -} - -int -main (int argc, char *argv[]) -{ - if (parse_args (argc, - argv) == -1) - return -1; - - ACE_DECLARE_NEW_CORBA_ENV; - ACE_TRY - { - PortableInterceptor::ORBInitializer_ptr temp_initializer = - PortableInterceptor::ORBInitializer::_nil (); - - // Set up our default expectations. - CORBA::ULong expected_interceptor_check = 12; - - PortableInterceptor::ProcessingMode proc_mode = - PortableInterceptor::LOCAL_AND_REMOTE; - - if (proc_mode_str == "LOCAL_ONLY") - { - proc_mode = PortableInterceptor::LOCAL_ONLY; - ACE_DEBUG((LM_DEBUG, - "Using LOCAL_ONLY for server-side ProcessingMode.\n")); - - // Since all of the calls are remote, setting the server-side - // ProcessingMode to LOCAL_ONLY will cause the server request - // interceptor to not fire. Thus, we expect 0 calls on the - // server interceptor. - expected_interceptor_check = 0; - } - else if (proc_mode_str == "REMOTE_ONLY") - { - proc_mode = PortableInterceptor::REMOTE_ONLY; - ACE_DEBUG((LM_DEBUG, - "Using REMOTE_ONLY for server-side ProcessingMode.\n")); - } - else - { - ACE_DEBUG((LM_DEBUG, - "Using LOCAL_AND_REMOTE for server-side ProcessingMode.\n")); - } - - ACE_NEW_RETURN (temp_initializer, - Echo_Server_ORBInitializer (proc_mode), - -1); // No exceptions yet! - PortableInterceptor::ORBInitializer_var orb_initializer = - temp_initializer; - - PortableInterceptor::register_orb_initializer (orb_initializer.in () - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - ACE_Argv_Type_Converter atc (argc, argv); - CORBA::ORB_var orb = - CORBA::ORB_init (atc.get_argc (), - atc.get_TCHAR_argv (), - "" - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - ACE_Manual_Event me; - Server_Task server_task (output, - orb.in (), - me, - ACE_Thread_Manager::instance ()); - - if (server_task.activate (THR_NEW_LWP | THR_JOINABLE, - 1, - 1) == -1) - { - ACE_ERROR ((LM_ERROR, "Error activating server task\n")); - } - - ACE_Thread_Manager::instance ()->wait (); - - CORBA::ULong number_called = - Echo_Server_Request_Interceptor::server_interceptor_check_; - - if (number_called != expected_interceptor_check) - { - ACE_ERROR ((LM_ERROR, - "(%P|%t) ERROR: Server-Side Interceptors not " - "called properly, called %d times, expected %d.\n", - number_called, expected_interceptor_check)); - return 1; - } - } - ACE_CATCHANY - { - ACE_ERROR ((LM_ERROR, - "(%P|%t) ERROR: Some exception was caught in main().\n")); - return 1; - } - ACE_ENDTRY; - return 0; -} diff --git a/TAO/tests/Portable_Interceptors/Processing_Mode_Policy/Remote/test.idl b/TAO/tests/Portable_Interceptors/Processing_Mode_Policy/Remote/test.idl deleted file mode 100644 index 07ed4dee088..00000000000 --- a/TAO/tests/Portable_Interceptors/Processing_Mode_Policy/Remote/test.idl +++ /dev/null @@ -1,42 +0,0 @@ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// TAO/tests/Portable_Interceptors -// -// = FILENAME -// test.idl -// -// = DESCRIPTION -// Simple IDL file to test portable interceptor support. -// -// = AUTHORS -// Nanbor Wang <nanbor@cs.wustl.edu> -// -// ============================================================================ - -module Test_Interceptors -{ - exception Silly - {}; - - interface Visual - { - void normal (in long arg); - // Normal operation. - - long calculate (in long one, in long two); - // Normal operation with a return val. - - void user () - raises (Silly); - // throws a user exception. - - void system (); - // thows a system exception. - - oneway void shutdown (); - // shutdown the ORB - }; -}; diff --git a/TAO/tests/Portable_Interceptors/Processing_Mode_Policy/Remote/test_i.cpp b/TAO/tests/Portable_Interceptors/Processing_Mode_Policy/Remote/test_i.cpp deleted file mode 100644 index bf5fe31c9f8..00000000000 --- a/TAO/tests/Portable_Interceptors/Processing_Mode_Policy/Remote/test_i.cpp +++ /dev/null @@ -1,55 +0,0 @@ -// $Id$ - -#include "test_i.h" - -ACE_RCSID(Remote, test_i, "$Id$") - -Visual_i::Visual_i (CORBA::ORB_ptr orb) - : orb_ (CORBA::ORB::_duplicate (orb)) -{ -} - // ctor - -void -Visual_i::normal (CORBA::Long - ACE_ENV_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - // ACE_DEBUG ((LM_DEBUG, "Visual::normal called with %d\n", arg)); -} - -CORBA::Long -Visual_i::calculate (CORBA::Long one, - CORBA::Long two - ACE_ENV_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - // ACE_DEBUG ((LM_DEBUG, "Visual::calculate\n")); - return (one + two); -} - -void -Visual_i::user (ACE_ENV_SINGLE_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException,Test_Interceptors::Silly)) -{ - // ACE_DEBUG ((LM_DEBUG, "Visual::user, throwning Silly\n")); - ACE_THROW (Test_Interceptors::Silly ()); -} - -void -Visual_i::system (ACE_ENV_SINGLE_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - // ACE_DEBUG ((LM_DEBUG, "Visual::user, throwing INV_OBJREF\n")); - ACE_THROW (CORBA::INV_OBJREF ()); -} - -void -Visual_i::shutdown (ACE_ENV_SINGLE_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - this->_remove_ref (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; - - this->orb_->shutdown (); -} diff --git a/TAO/tests/Portable_Interceptors/Processing_Mode_Policy/Remote/test_i.h b/TAO/tests/Portable_Interceptors/Processing_Mode_Policy/Remote/test_i.h deleted file mode 100644 index f31756fb10a..00000000000 --- a/TAO/tests/Portable_Interceptors/Processing_Mode_Policy/Remote/test_i.h +++ /dev/null @@ -1,54 +0,0 @@ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// TAO/tests/Portable_Interceptors/Dynamic -// -// = FILENAME -// test_i.h -// -// = AUTHOR -// Nanbor Wang -// -// ============================================================================ - -#ifndef TAO_INTERCEPTOR_TEST_I_H -#define TAO_INTERCEPTOR_TEST_I_H - -#include "testS.h" - -class Visual_i : public POA_Test_Interceptors::Visual -{ - // = DESCRIPTION - // Implements the Visual interface in test.idl - -public: - Visual_i (CORBA::ORB_ptr orb); - // ctor - - void normal (CORBA::Long arg - ACE_ENV_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)); - - CORBA::Long calculate ( - CORBA::Long one, - CORBA::Long two - ACE_ENV_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)); - - void user (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException,Test_Interceptors::Silly)); - - void system (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)); - - void shutdown (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)); - -private: - CORBA::ORB_var orb_; - // The ORB pointer (for shutdown.) -}; - -#endif /* TAO_INTERCEPTOR_TEST_I_H */ diff --git a/TAO/tests/Portable_Interceptors/Recursive_ORBInitializer/Client_ORBInitializer.cpp b/TAO/tests/Portable_Interceptors/Recursive_ORBInitializer/Client_ORBInitializer.cpp deleted file mode 100644 index 881b1f2987f..00000000000 --- a/TAO/tests/Portable_Interceptors/Recursive_ORBInitializer/Client_ORBInitializer.cpp +++ /dev/null @@ -1,48 +0,0 @@ -// -*- C++ -*- -// -// $Id$ -// - -#include "Client_ORBInitializer.h" -#include "tao/ORBInitializer_Registry.h" - -ACE_RCSID (Recursive_ORBInitializer, - Client_ORBInitializer, - "$Id$") - -Client_ORBInitializer::Client_ORBInitializer (Client_ORBInitializer *second) : - pre_init_called (0), - post_init_called (0), - second_ (second) -{ -} - -void -Client_ORBInitializer::pre_init ( - PortableInterceptor::ORBInitInfo_ptr - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - ++pre_init_called; - - if (second_ != 0) - { - PortableInterceptor::register_orb_initializer (second_ - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - - // Registered the initializer, clear the pointer so that we only do it - // once - second_ = 0; - } -} - -void -Client_ORBInitializer::post_init ( - PortableInterceptor::ORBInitInfo_ptr - ACE_ENV_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - ++post_init_called; -} - diff --git a/TAO/tests/Portable_Interceptors/Recursive_ORBInitializer/Client_ORBInitializer.h b/TAO/tests/Portable_Interceptors/Recursive_ORBInitializer/Client_ORBInitializer.h deleted file mode 100644 index 15b78e94a6e..00000000000 --- a/TAO/tests/Portable_Interceptors/Recursive_ORBInitializer/Client_ORBInitializer.h +++ /dev/null @@ -1,53 +0,0 @@ -// -*- C++ -*- -// -// $Id$ -// - -#ifndef TAO_CLIENT_ORB_INITIALIZER_H -#define TAO_CLIENT_ORB_INITIALIZER_H -#include /**/ "ace/pre.h" - -#include "tao/PI/PI.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "tao/LocalObject.h" - -// This is to remove "inherits via dominance" warnings from MSVC. -// MSVC is being a little too paranoid. -#if defined(_MSC_VER) -#pragma warning(push) -#pragma warning(disable:4250) -#endif /* _MSC_VER */ - -/// Client ORB initializer. -class Client_ORBInitializer : - public virtual PortableInterceptor::ORBInitializer, - public virtual TAO_Local_RefCounted_Object -{ -public: - /// Constructor - Client_ORBInitializer (Client_ORBInitializer *second); - - virtual void pre_init (PortableInterceptor::ORBInitInfo_ptr info - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - virtual void post_init (PortableInterceptor::ORBInitInfo_ptr info - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - int pre_init_called; - int post_init_called; -private: - Client_ORBInitializer *second_; -}; - -#if defined(_MSC_VER) -#pragma warning(pop) -#endif /* _MSC_VER */ - -#include /**/ "ace/post.h" -#endif /* TAO_CLIENT_ORB_INITIALIZER_H */ diff --git a/TAO/tests/Portable_Interceptors/Recursive_ORBInitializer/Register_ORBInitializer.mpc b/TAO/tests/Portable_Interceptors/Recursive_ORBInitializer/Register_ORBInitializer.mpc deleted file mode 100644 index 87022b449ba..00000000000 --- a/TAO/tests/Portable_Interceptors/Recursive_ORBInitializer/Register_ORBInitializer.mpc +++ /dev/null @@ -1,10 +0,0 @@ -// -*- MPC -*- -// $Id$ - -project(*Client): taoclient, pi, interceptors { - Source_Files { - Client_ORBInitializer.cpp - client.cpp - } -} - diff --git a/TAO/tests/Portable_Interceptors/Recursive_ORBInitializer/client.cpp b/TAO/tests/Portable_Interceptors/Recursive_ORBInitializer/client.cpp deleted file mode 100644 index 9f716e09ada..00000000000 --- a/TAO/tests/Portable_Interceptors/Recursive_ORBInitializer/client.cpp +++ /dev/null @@ -1,59 +0,0 @@ -// $Id$ - -#include "Client_ORBInitializer.h" -#include "tao/ORBInitializer_Registry.h" - -ACE_RCSID(Recursive_ORBInitializer, - client, - "$Id$") - -int -main (int argc, char *argv[]) -{ - Client_ORBInitializer* initializer1 = 0; - Client_ORBInitializer* initializer2 = 0; - - ACE_NEW_RETURN (initializer2, - Client_ORBInitializer (0), - -1); // No exceptions yet! - - ACE_NEW_RETURN (initializer1, - Client_ORBInitializer (initializer2), - -1); // No exceptions yet! - - PortableInterceptor::ORBInitializer_var initializer_var1 = - initializer1; - - PortableInterceptor::ORBInitializer_var initializer_var2 = - initializer2; - - ACE_TRY_NEW_ENV - { - PortableInterceptor::register_orb_initializer (initializer_var1.in () - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - CORBA::ORB_var orb = - CORBA::ORB_init (argc, argv, "" ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - CORBA::ORB_var orb2 = - CORBA::ORB_init (argc, argv, "SecondORB" ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - } - ACE_CATCHANY - { - ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, - "Caught exception in client:"); - return 1; - } - ACE_ENDTRY; - - // The first ORBInitializer should be called twice, the second only once - ACE_ASSERT (initializer1->pre_init_called == 2); - ACE_ASSERT (initializer2->pre_init_called == 1); - ACE_ASSERT (initializer1->post_init_called == 2); - ACE_ASSERT (initializer2->post_init_called == 1); - - return 0; -} diff --git a/TAO/tests/Portable_Interceptors/Recursive_ORBInitializer/run_test.pl b/TAO/tests/Portable_Interceptors/Recursive_ORBInitializer/run_test.pl deleted file mode 100755 index 9a9a9db0c85..00000000000 --- a/TAO/tests/Portable_Interceptors/Recursive_ORBInitializer/run_test.pl +++ /dev/null @@ -1,26 +0,0 @@ -eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' - & eval 'exec perl -S $0 $argv:q' - if 0; - -# $Id$ -# -*- perl -*- - -use lib '../../../../bin'; -use PerlACE::Run_Test; - -if (PerlACE::is_vxworks_test()) { - $CL = new PerlACE::ProcessVX ("client"); -} -else { - $CL = new PerlACE::Process ("client"); -} -print STDERR "\n==== Running Recursive ORBInitializer test ====\n"; - -$client = $CL->SpawnWaitKill (5); - -if ($client != 0) { - print STDERR "ERROR: client returned $client\n"; - $status = 1; -} - -exit $status; diff --git a/TAO/tests/Portable_Interceptors/Register_Initial_References/Register_ORBInitializer.mpc b/TAO/tests/Portable_Interceptors/Register_Initial_References/Register_ORBInitializer.mpc deleted file mode 100644 index 131b4b94e54..00000000000 --- a/TAO/tests/Portable_Interceptors/Register_Initial_References/Register_ORBInitializer.mpc +++ /dev/null @@ -1,11 +0,0 @@ -// -*- MPC -*- -// $Id$ - -project(*Server): taoserver, pi, interceptors { - Source_Files { - test_i.cpp - Server_ORBInitializer.cpp - server.cpp - } -} - diff --git a/TAO/tests/Portable_Interceptors/Register_Initial_References/Server_ORBInitializer.cpp b/TAO/tests/Portable_Interceptors/Register_Initial_References/Server_ORBInitializer.cpp deleted file mode 100644 index ccbc8aefdca..00000000000 --- a/TAO/tests/Portable_Interceptors/Register_Initial_References/Server_ORBInitializer.cpp +++ /dev/null @@ -1,113 +0,0 @@ -// -*- C++ -*- -// -// $Id$ -// - -#include "Server_ORBInitializer.h" -#include "tao/ORBInitializer_Registry.h" -#include "test_i.h" - -ACE_RCSID (Recursive_ORBInitializer, - Server_ORBInitializer, - "$Id$") - -Server_ORBInitializer::Server_ORBInitializer (void) -{ -} - -void -Server_ORBInitializer::pre_init ( - PortableInterceptor::ORBInitInfo_ptr orbinitinfo - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - POA_TestModule::test* test = 0; - ACE_NEW (test, - test_i); - - CORBA::Object_ptr object = test->_this (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; - - orbinitinfo->register_initial_reference ("MyService", - object - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - - bool invalid_name = false; - ACE_TRY - { - // Registering with an empty string should give an exception - orbinitinfo->register_initial_reference ("", - object - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - } - ACE_CATCH (PortableInterceptor::ORBInitInfo::InvalidName, ex) - { - invalid_name = true; - } - ACE_CATCHANY - { - } - ACE_ENDTRY; - - if (!invalid_name) - ACE_ERROR ((LM_ERROR, "ERROR: Registering with an empty string doesn't " - "throw an exception\n")); - - bool duplicate_name = false; - ACE_TRY_EX (duplicate) - { - // Registering with an duplicate string should give an exception - orbinitinfo->register_initial_reference ("MyService", - object - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK_EX (duplicate) ; - } - ACE_CATCH (PortableInterceptor::ORBInitInfo::InvalidName, ex) - { - duplicate_name = true; - } - ACE_CATCHANY - { - } - ACE_ENDTRY; - - if (!duplicate_name) - ACE_ERROR ((LM_ERROR, "ERROR: Registering with a duplicate with ORBInitInfo " - "doesn't throw the expected exception\n")); - - bool invalid_object = false; - ACE_TRY_EX (invalid) - { - // Registering with a nil object - orbinitinfo->register_initial_reference ("NilServer", - CORBA::Object::_nil() - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK_EX (invalid); - } - ACE_CATCH (CORBA::BAD_PARAM , ex) - { - if ((ex.minor() & 0xFFFU) == 27) - { - invalid_object = true; - } - } - ACE_CATCHANY - { - } - ACE_ENDTRY; - - if (!invalid_object) - ACE_ERROR ((LM_ERROR, "ERROR: Registering with a nil object to ORBInitInfo " - "doesn't throw bad param with minor code 27\n")); -} - -void -Server_ORBInitializer::post_init ( - PortableInterceptor::ORBInitInfo_ptr - ACE_ENV_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ -} - diff --git a/TAO/tests/Portable_Interceptors/Register_Initial_References/Server_ORBInitializer.h b/TAO/tests/Portable_Interceptors/Register_Initial_References/Server_ORBInitializer.h deleted file mode 100644 index 3b9e5407eaf..00000000000 --- a/TAO/tests/Portable_Interceptors/Register_Initial_References/Server_ORBInitializer.h +++ /dev/null @@ -1,49 +0,0 @@ -// -*- C++ -*- -// -// $Id$ -// - -#ifndef TAO_SERVER_ORB_INITIALIZER_H -#define TAO_SERVER_ORB_INITIALIZER_H -#include /**/ "ace/pre.h" - -#include "tao/PI/PI.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "tao/LocalObject.h" -#include "testS.h" - -// This is to remove "inherits via dominance" warnings from MSVC. -// MSVC is being a little too paranoid. -#if defined(_MSC_VER) -#pragma warning(push) -#pragma warning(disable:4250) -#endif /* _MSC_VER */ - -/// Server ORB initializer. -class Server_ORBInitializer : - public virtual PortableInterceptor::ORBInitializer, - public virtual TAO_Local_RefCounted_Object -{ -public: - /// Constructor - Server_ORBInitializer (void); - - virtual void pre_init (PortableInterceptor::ORBInitInfo_ptr info - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - virtual void post_init (PortableInterceptor::ORBInitInfo_ptr info - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); -}; - -#if defined(_MSC_VER) -#pragma warning(pop) -#endif /* _MSC_VER */ - -#include /**/ "ace/post.h" -#endif /* TAO_SERVER_ORB_INITIALIZER_H */ diff --git a/TAO/tests/Portable_Interceptors/Register_Initial_References/run_test.pl b/TAO/tests/Portable_Interceptors/Register_Initial_References/run_test.pl deleted file mode 100755 index 30bc0d981cf..00000000000 --- a/TAO/tests/Portable_Interceptors/Register_Initial_References/run_test.pl +++ /dev/null @@ -1,26 +0,0 @@ -eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' - & eval 'exec perl -S $0 $argv:q' - if 0; - -# $Id$ -# -*- perl -*- - -use lib '../../../../bin'; -use PerlACE::Run_Test; - -if (PerlACE::is_vxworks_test()) { - $SV = new PerlACE::ProcessVX ("server"); -} -else { - $SV = new PerlACE::Process ("server"); -} -print STDERR "\n==== Running Register_Initial_References test ====\n"; - -$server = $SV->SpawnWaitKill (30); - -if ($server != 0) { - print STDERR "ERROR: server returned $server\n"; - $status = 1; -} - -exit $status; diff --git a/TAO/tests/Portable_Interceptors/Register_Initial_References/server.cpp b/TAO/tests/Portable_Interceptors/Register_Initial_References/server.cpp deleted file mode 100644 index efac5ba2c36..00000000000 --- a/TAO/tests/Portable_Interceptors/Register_Initial_References/server.cpp +++ /dev/null @@ -1,148 +0,0 @@ -// $Id$ - -#include "Server_ORBInitializer.h" -#include "tao/ORBInitializer_Registry.h" -#include "test_i.h" - -ACE_RCSID(Recursive_ORBInitializer, - server, - "$Id$") - - -int test_orb (CORBA::ORB_ptr orb ACE_ENV_ARG_DECL) -{ - int errors = 0; - - POA_TestModule::test* test = 0; - ACE_NEW_RETURN (test, - test_i, 1); - - CORBA::Object_ptr object = test->_this (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK_RETURN (1); - - orb->register_initial_reference ("ORBMyService", - object - ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (1); - - bool invalid_name = false; - ACE_TRY - { - // Registering with an empty string should give an exception - orb->register_initial_reference ("", - object - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - } - ACE_CATCH (CORBA::ORB::InvalidName, ex) - { - invalid_name = true; - } - ACE_CATCHANY - { - } - ACE_ENDTRY; - - if (!invalid_name) - { - errors++; - ACE_ERROR ((LM_ERROR, "ERROR: Registering with an empty string with the ORB" - "doesn't throw an exception\n")); - } - - bool duplicate_name = false; - ACE_TRY_EX (duplicate) - { - // Registering with an duplicate string should give an exception - orb->register_initial_reference ("ORBMyService", - object - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK_EX (duplicate); - } - ACE_CATCH (CORBA::ORB::InvalidName, ex) - { - duplicate_name = true; - } - ACE_CATCHANY - { - } - ACE_ENDTRY; - - if (!duplicate_name) - { - errors++; - ACE_ERROR ((LM_ERROR, "ERROR: Registering with a duplicate with ORB " - "doesn't throw the expected exception\n")); - } - - bool invalid_object = false; - ACE_TRY_EX (invalid) - { - // Registering with a nil object - orb->register_initial_reference ("ORBNilServer", - CORBA::Object::_nil() - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK_EX (invalid); - } - ACE_CATCH (CORBA::BAD_PARAM , ex) - { - if ((ex.minor() & 0xFFFU) == 27) - { - invalid_object = true; - } - } - ACE_CATCHANY - { - } - ACE_ENDTRY; - - if (!invalid_object) - { - errors++; - ACE_ERROR ((LM_ERROR, "ERROR: Registering with a nil object to ORB " - "doesn't throw bad param with minor code 27\n")); - } - - return errors; -} - -int -main (int argc, char *argv[]) -{ - Server_ORBInitializer *initializer = 0; - int retval = 0; - - ACE_NEW_RETURN (initializer, - Server_ORBInitializer, - -1); // No exceptions yet! - - PortableInterceptor::ORBInitializer_var initializer_var = - initializer; - - ACE_TRY_NEW_ENV - { - CORBA::ORB_var orb = - CORBA::ORB_init (argc, argv, "" ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - retval = test_orb (orb.in () ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - PortableInterceptor::register_orb_initializer (initializer_var.in () - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - CORBA::ORB_var second_orb = - CORBA::ORB_init (argc, argv, "SecondORB" ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - } - ACE_CATCHANY - { - ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, - "Caught exception in server:"); - return 1; - } - ACE_ENDTRY; - - return retval; -} diff --git a/TAO/tests/Portable_Interceptors/Register_Initial_References/test.idl b/TAO/tests/Portable_Interceptors/Register_Initial_References/test.idl deleted file mode 100644 index 8643b6cca3e..00000000000 --- a/TAO/tests/Portable_Interceptors/Register_Initial_References/test.idl +++ /dev/null @@ -1,21 +0,0 @@ -// -*- IDL -*- - -//============================================================================= -/** - * @file test.idl - * - * $Id$ - * - * Simple IDL file - * - * @author Johnny Willemsen <jwillemsen@remedy.nl> - */ -//============================================================================= - -module TestModule -{ - - interface test - { - }; -}; diff --git a/TAO/tests/Portable_Interceptors/Register_Initial_References/test_i.cpp b/TAO/tests/Portable_Interceptors/Register_Initial_References/test_i.cpp deleted file mode 100644 index 9f1c4e44e7a..00000000000 --- a/TAO/tests/Portable_Interceptors/Register_Initial_References/test_i.cpp +++ /dev/null @@ -1,16 +0,0 @@ -// -*- C++ -*- - -#include "test_i.h" - -ACE_RCSID (Register_Initial_References, - test_i, - "$Id$") - -test_i::test_i (void) -{ -} - -test_i::~test_i (void) -{ -} - diff --git a/TAO/tests/Portable_Interceptors/Register_Initial_References/test_i.h b/TAO/tests/Portable_Interceptors/Register_Initial_References/test_i.h deleted file mode 100644 index 30cf9d9bf31..00000000000 --- a/TAO/tests/Portable_Interceptors/Register_Initial_References/test_i.h +++ /dev/null @@ -1,38 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file test_i.h - * - * $Id$ - * - * @author Johnny Willemsen <jwillemsen@remedy.nl> - */ -//============================================================================= - -#ifndef TEST_I_H -#define TEST_I_H - -#include "testS.h" - -/** - * @class test_i - * - * @brief Simple test class. - * - * This class implements the "test" interface used in this test. - */ -class test_i : public virtual POA_TestModule::test -{ -public: - - /// Constructor. - test_i (void); - - /// Destructor. - ~test_i (void); - -private: -}; - -#endif /* TEST_I_H */ diff --git a/TAO/tests/Portable_Interceptors/Request_Interceptor_Flow/.cvsignore b/TAO/tests/Portable_Interceptors/Request_Interceptor_Flow/.cvsignore deleted file mode 100644 index f2ad85300eb..00000000000 --- a/TAO/tests/Portable_Interceptors/Request_Interceptor_Flow/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -client -server diff --git a/TAO/tests/Portable_Interceptors/Request_Interceptor_Flow/Client_ORBInitializer.cpp b/TAO/tests/Portable_Interceptors/Request_Interceptor_Flow/Client_ORBInitializer.cpp deleted file mode 100644 index ceb1ab95ee1..00000000000 --- a/TAO/tests/Portable_Interceptors/Request_Interceptor_Flow/Client_ORBInitializer.cpp +++ /dev/null @@ -1,77 +0,0 @@ -#include "Client_ORBInitializer.h" - -ACE_RCSID (Request_Interceptor_Flow, - Client_ORBInitializer, - "$Id$") - - -#include "tao/Exception.h" -#include "tao/ORB_Constants.h" - -#include "Client_Request_Interceptor.h" - - -void -Client_ORBInitializer::pre_init ( - PortableInterceptor::ORBInitInfo_ptr - ACE_ENV_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ -} - -void -Client_ORBInitializer::post_init ( - PortableInterceptor::ORBInitInfo_ptr info - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - - // Create and register the test request interceptors. - PortableInterceptor::ClientRequestInterceptor_ptr ci = - PortableInterceptor::ClientRequestInterceptor::_nil (); - ACE_NEW_THROW_EX (ci, - Client_Request_Interceptor ("CLIENT A"), - CORBA::NO_MEMORY ( - CORBA::SystemException::_tao_minor_code ( - TAO::VMCID, - ENOMEM), - CORBA::COMPLETED_NO)); - ACE_CHECK; - - PortableInterceptor::ClientRequestInterceptor_var ci_interceptor = - ci; - - info->add_client_request_interceptor (ci_interceptor.in () - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - - ACE_NEW_THROW_EX (ci, - Client_Request_Interceptor ("CLIENT B"), - CORBA::NO_MEMORY ( - CORBA::SystemException::_tao_minor_code ( - TAO::VMCID, - ENOMEM), - CORBA::COMPLETED_NO)); - ACE_CHECK; - - ci_interceptor = ci; - - info->add_client_request_interceptor (ci_interceptor.in () - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - - ACE_NEW_THROW_EX (ci, - Client_Request_Interceptor ("CLIENT C"), - CORBA::NO_MEMORY ( - CORBA::SystemException::_tao_minor_code ( - TAO::VMCID, - ENOMEM), - CORBA::COMPLETED_NO)); - ACE_CHECK; - - ci_interceptor = ci; - - info->add_client_request_interceptor (ci_interceptor.in () - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; -} diff --git a/TAO/tests/Portable_Interceptors/Request_Interceptor_Flow/Client_ORBInitializer.h b/TAO/tests/Portable_Interceptors/Request_Interceptor_Flow/Client_ORBInitializer.h deleted file mode 100644 index 9a14c62287c..00000000000 --- a/TAO/tests/Portable_Interceptors/Request_Interceptor_Flow/Client_ORBInitializer.h +++ /dev/null @@ -1,64 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file Client_ORBInitializer.h - * - * $Id$ - * - * @author Ossama Othman <ossama@uci.edu> - */ -//============================================================================= - - -#ifndef TAO_CLIENT_ORB_INITIALIZER_H -#define TAO_CLIENT_ORB_INITIALIZER_H - -#include /**/ "ace/pre.h" - -#include "ace/config-all.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "tao/PI/PI.h" -#include "tao/LocalObject.h" - -// This is to remove "inherits via dominance" warnings from MSVC. -// MSVC is being a little too paranoid. -#if defined(_MSC_VER) -#pragma warning(push) -#pragma warning(disable:4250) -#endif /* _MSC_VER */ - -/** - * @name Client_ORBInitializer - * - * @brief - * ORB initializer that registers all client request interceptors used - * in this test. - */ -class Client_ORBInitializer : - public virtual PortableInterceptor::ORBInitializer, - public virtual TAO_Local_RefCounted_Object -{ -public: - - virtual void pre_init (PortableInterceptor::ORBInitInfo_ptr info - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - virtual void post_init (PortableInterceptor::ORBInitInfo_ptr info - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - -}; - -#if defined(_MSC_VER) -#pragma warning(pop) -#endif /* _MSC_VER */ - -#include /**/ "ace/post.h" - -#endif /* TAO_CLIENT_ORB_INITIALIZER_H */ diff --git a/TAO/tests/Portable_Interceptors/Request_Interceptor_Flow/Client_Request_Interceptor.cpp b/TAO/tests/Portable_Interceptors/Request_Interceptor_Flow/Client_Request_Interceptor.cpp deleted file mode 100644 index dba6578f6f2..00000000000 --- a/TAO/tests/Portable_Interceptors/Request_Interceptor_Flow/Client_Request_Interceptor.cpp +++ /dev/null @@ -1,273 +0,0 @@ -// -*- C++ -*- - -#include "Client_Request_Interceptor.h" -#include "testC.h" - -#include "tao/AnyTypeCode/TypeCode.h" -#include "tao/AnyTypeCode/AnyTypeCode_Adapter_Impl.h" -#include "ace/OS_NS_string.h" - -ACE_RCSID (Request_Interceptor_Flow, - Client_Request_Interceptor, - "$Id$") - -Client_Request_Interceptor::Client_Request_Interceptor (const char *name) - : Request_Interceptor (name) -{ -} - -void -Client_Request_Interceptor::send_request ( - PortableInterceptor::ClientRequestInfo_ptr ri - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableInterceptor::ForwardRequest)) -{ - CORBA::Boolean client_side = - this->client_side_test (ri ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - - if (!client_side) - return; // Don't continue if the server side is being tested. - - ACE_DEBUG ((LM_INFO, - "%s.send_request", - this->name_.in ())); - - if (ACE_OS::strcmp ("CLIENT B", this->name_.in ()) == 0) - { - // Determine which test scenario we are in - Dynamic::ParameterList_var paramlist = - ri->arguments (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; - - Test::TestScenario scenario; - CORBA::ULong i = 0; // index -- explicitly used to avoid - // overloaded operator ambiguity. - if (paramlist[i].argument >>= scenario) - { - switch (scenario) - { - case 2: - // We can only throw a CORBA::SystemException or a - // PortableInteceptor::ForwardRequest exception due to - // the restricted exception specification dictated by - // the IDL for request interceptors. As such, an - // arbitrary CORBA::SystemException was chosen - // (NO_PERMISSION, in this case). - ACE_DEBUG ((LM_DEBUG, - " raised CORBA::NO_PERMISSION exception\n")); - ACE_THROW (CORBA::NO_PERMISSION ()); // Expected exception. - - default: - break; - } - } - else - ACE_ERROR ((LM_ERROR, - "\nERROR: send_request - Could not extract " - "arguments.\n")); - } - - ACE_DEBUG ((LM_DEBUG, - "\n")); - - this->starting_interception_point_count_++; -} - -void -Client_Request_Interceptor::send_poll ( - PortableInterceptor::ClientRequestInfo_ptr ri - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - - CORBA::Boolean client_side = - this->client_side_test (ri ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - - if (!client_side) - return; // Don't continue if the server side is being tested. - - ACE_DEBUG ((LM_INFO, - "%s.send_poll\n", - this->name_.in ())); - - this->starting_interception_point_count_++; -} - -void -Client_Request_Interceptor::receive_reply ( - PortableInterceptor::ClientRequestInfo_ptr ri - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - - CORBA::Boolean client_side = - this->client_side_test (ri ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - - if (!client_side) - return; // Don't continue if the server side is being tested. - - this->ending_interception_point_count_++; - - ACE_DEBUG ((LM_INFO, - "%s.receive_reply", - this->name_.in ())); - - if (ACE_OS::strcmp ("CLIENT B", this->name_.in ()) == 0) - { - // Determine which test scenario we are in - Dynamic::ParameterList_var paramlist = - ri->arguments (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; - - Test::TestScenario scenario; - CORBA::ULong i = 0; // index -- explicitly used to avoid - // overloaded operator ambiguity. - if (paramlist[i].argument >>= scenario) - { - switch (scenario) - { - case 3: - // We can only throw a CORBA::SystemException or a - // PortableInteceptor::ForwardRequest exception due to - // the restricted exception specification dictated by - // the IDL for request interceptors. As such, an - // arbitrary CORBA::SystemException was chosen - // (NO_PERMISSION, in this case). - ACE_DEBUG ((LM_DEBUG, - " raised CORBA::NO_PERMISSION exception\n")); - ACE_THROW (CORBA::NO_PERMISSION ()); // Expected exception. - - default: - break; - } - } - else - ACE_ERROR ((LM_ERROR, - "\nERROR: receive_reply - Could not extract " - "arguments.\n")); - } - - ACE_DEBUG ((LM_DEBUG, - "\n")); -} - -void -Client_Request_Interceptor::receive_exception ( - PortableInterceptor::ClientRequestInfo_ptr ri - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableInterceptor::ForwardRequest)) -{ - - CORBA::Boolean client_side = - this->client_side_test (ri ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - - if (!client_side) - return; // Don't continue if the server side is being tested. - - this->ending_interception_point_count_++; - - ACE_DEBUG ((LM_INFO, - "%s.receive_exception", - this->name_.in ())); - - if (ACE_OS::strcmp ("CLIENT B", this->name_.in ()) == 0) - { - // Determine which test scenario we are in - Dynamic::ParameterList_var paramlist = - ri->arguments (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; - - Test::TestScenario scenario; - CORBA::ULong i = 0; // index -- explicitly used to avoid - // overloaded operator ambiguity. - if (paramlist[i].argument >>= scenario) - { - CORBA::Any_var exception; - CORBA::TypeCode_var tc; - const char * id = 0; - - switch (scenario) - { - case 4: - exception = ri->received_exception (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; - - tc = exception->type (); - - id = tc->id (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; - - if (ACE_OS::strcmp (id, "IDL:Test/X:1.0") == 0) - { - // We can only throw a CORBA::SystemException or a - // PortableInteceptor::ForwardRequest exception due - // to the restricted exception specification - // dictated by the IDL for request interceptors. As - // such, an arbitrary CORBA::SystemException was - // chosen (NO_PERMISSION, in this case). - ACE_DEBUG ((LM_DEBUG, - " transformed Test::X exception to " - "CORBA::NO_PERMISSION exception\n")); - - // Expected exception. - ACE_THROW (CORBA::NO_PERMISSION ()); - } - else - { - ACE_ERROR ((LM_ERROR, - "\nERROR: receive_exception - Received " - "unexpected exception!\n")); - } - break; - default: - break; - } - } - else - ACE_ERROR ((LM_ERROR, - "\nERROR: receive_exception - Could not extract " - "arguments.\n")); - } - - ACE_DEBUG ((LM_DEBUG, - "\n")); -} - -void -Client_Request_Interceptor::receive_other ( - PortableInterceptor::ClientRequestInfo_ptr ri - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableInterceptor::ForwardRequest)) -{ - - CORBA::Boolean client_side = - this->client_side_test (ri ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - - if (!client_side) - return; // Don't continue if the server side is being tested. - - this->ending_interception_point_count_++; - - ACE_DEBUG ((LM_INFO, - "%s.receive_other\n", - this->name_.in ())); -} - -CORBA::Boolean -Client_Request_Interceptor::client_side_test ( - PortableInterceptor::ClientRequestInfo_ptr info - ACE_ENV_ARG_DECL) -{ - CORBA::String_var op = info->operation (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK_RETURN (0); - - return ACE_OS::strcmp (op.in (), "client_test") == 0 ? 1 : 0; -} 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 deleted file mode 100644 index bb1f24cbdcc..00000000000 --- a/TAO/tests/Portable_Interceptors/Request_Interceptor_Flow/Client_Request_Interceptor.h +++ /dev/null @@ -1,105 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file Client_Request_Interceptor.h - * - * $Id$ - * - * Implementation header for the client request interceptor for the - * request interceptor flow test. - * - * @author Ossama Othman <ossama@uci.edu> - */ -//============================================================================= - -#ifndef CLIENT_REQUEST_INTERCEPTOR_H -#define CLIENT_REQUEST_INTERCEPTOR_H - -#include "ace/config-all.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "Request_Interceptor.h" - -#include "tao/PI/PI.h" -#include "tao/PortableInterceptorC.h" -#include "tao/LocalObject.h" - -#if defined(_MSC_VER) -#pragma warning(push) -#pragma warning(disable:4250) -#endif /* _MSC_VER */ - -/** - * @class Client_Request_Interceptor - * - * @brief Client request interceptor that exercises - * PortableInterceptor::ForwardRequest support. - * - */ -class Client_Request_Interceptor - : public virtual PortableInterceptor::ClientRequestInterceptor, - public virtual TAO_Local_RefCounted_Object, - public virtual Request_Interceptor -{ -public: - - /// Constructor. - Client_Request_Interceptor (const char *name); - - /** - * @name Methods Required by the Client Request Interceptor - * Interface - * - * These are methods that must be implemented since they are pure - * virtual in the abstract base class. They are the canonical - * methods required for all client request interceptors. - */ - //@{ - virtual void send_request ( - PortableInterceptor::ClientRequestInfo_ptr ri - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableInterceptor::ForwardRequest)); - - virtual void send_poll ( - PortableInterceptor::ClientRequestInfo_ptr ri - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - 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)); - - virtual void receive_other ( - PortableInterceptor::ClientRequestInfo_ptr ri - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableInterceptor::ForwardRequest)); - //@} - -private: - - // Returns 1 if the client-side test is currently being run, and 0 - // otherwise. - CORBA::Boolean client_side_test ( - PortableInterceptor::ClientRequestInfo_ptr info - ACE_ENV_ARG_DECL); - -}; - -#if defined(_MSC_VER) -#pragma warning(pop) -#endif /* _MSC_VER */ - -#endif /* CLIENT_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 deleted file mode 100644 index ee81ede8553..00000000000 --- a/TAO/tests/Portable_Interceptors/Request_Interceptor_Flow/PI_Request_Interceptor_Flow.mpc +++ /dev/null @@ -1,24 +0,0 @@ -// -*- MPC -*- -// $Id$ - -project(*Server): taoserver, pi_server, interceptors { - Source_Files { - test_i.cpp - Server_ORBInitializer.cpp - Server_Request_Interceptor.cpp - Request_Interceptor.cpp - server.cpp - } -} - -project(*Client): taoclient, pi, interceptors { - after += *Server - Source_Files { - testC.cpp - Client_ORBInitializer.cpp - Client_Request_Interceptor.cpp - Request_Interceptor.cpp - client.cpp - } -} - diff --git a/TAO/tests/Portable_Interceptors/Request_Interceptor_Flow/README b/TAO/tests/Portable_Interceptors/Request_Interceptor_Flow/README deleted file mode 100644 index 2db42413933..00000000000 --- a/TAO/tests/Portable_Interceptors/Request_Interceptor_Flow/README +++ /dev/null @@ -1,168 +0,0 @@ -# $Id$ - -NOTE: The code in this test is highly specialized and very brittle. - Do not use it as a model for "real world" interceptor code. - - -This test verifies that proper request interceptor flow semantics -occur during a given request/invocation. It does so by executing a -canned (hard-coded) set of scenarios. Each scenario excercises a -specific flow behavior. All scenarios correspond to the ones detailed -in the Portable Interceptor specification (00-04-05). They are listed -below: - -Client Request Interceptor Flow -=============================== - -Given client request interceptors A, B and C. - ------------------------------------------------------------------------- - - Scenario 1: an exception arrives from the server: - - A.send_request is called; - B.send_request is called; - C.send_request is called; - C.receive_exception is called; - B.receive_exception is called; - A.receive_exception is called. - -The starting interception point (send_request) on each of the -client request interceptors was invoked successfully, so the ending -interception point (receive_exception in this case since the server -raised an exception) will be invoked on each of the client request -interceptors. - ------------------------------------------------------------------------- - - Scenario 2: B.send_request raises an exception: - A.send_request is called; - B.send_request is called and raises an exception - A.receive_exception is called. - -Only the starting interception point (send_request) on client request -interceptor A was completed successfully, so only its ending -interception point (receive_exception in this case) will be invoked. -No ending interception point from interceptor B will be invoked. - ------------------------------------------------------------------------- - - Scenario 3: a reply returns successfully from the server, but - B.receive_reply raises an exception: - - A.send_request is called; - B.send_request is called; - C.send_request is called; - C.receive_reply is called; - B.receive_reply is called and raises an exception - A.receive_exception is called. - -Since B.receive_reply raises an exception, and since B's and C's -ending interception point (receive_reply) has already been invoked, -then only A's ending interception point is invoked since it hasn't -been invoked yet. In this case, since an exception was raised, A's -receive_exception ending interception point is invoked. - ------------------------------------------------------------------------- - - Scenario 4: an exception X is returned by the server, but - B.receive_exception changes the exception to Y: - - A.send_request is called; - B.send_request is called; - C.send_request is called; - C.receive_exception is called with X; - B.receive_exception is called with X, raises Y; - A.receive_exception is called with Y. - -Since each client request interceptor's starting interception point -(send_request) was invoked, each client request interceptor's ending -interception point (receive_exception in this case) will be invoked. -However, A's receive_exception ending interception point will be -handed exception Y instead of exception X. - -************************************************************************ - -Server Request Interceptor Flow -=============================== - -Given server request interceptors A, B and C. - ------------------------------------------------------------------------- - - Scenario 1: an exception is raised by the target: - - A.receive_request_service_contexts is called; - B.receive_request_service_contexts is called; - C.receive_request_service_contexts is called; - A.receive_request is called; - B.receive_request is called; - C.receive_request is called; - C.send_exception is called; - B.send_exception is called; - A.send_exception is called. - -Each server request interceptor's starting interception point -(receive_request_service_contexts) was invoked, meaning that each -server request interceptor's intermediate interception point -(receive_request) will be invoked. The operation itself raises an -exception, meaning that each server request interceptor's ending -interception point (send_exception) will be invoked. - ------------------------------------------------------------------------- - - Scenario 2: B.receive_request_service_contexts raises an exception: - - A.receive_request_service_contexts is called; - B.receive_request_service_contexts is called and raises an exception - A.send_exception is called. - -Only interceptor A's starting interception point -(receive_request_service_contexts) was completed successfully, so only -its ending interception point (send_exception in this case) will be -invoked. - ------------------------------------------------------------------------- - - Scenario 3: the target invocation returns successfully, but - B.send_reply raises an exception: - - A.receive_request_service_contexts is called; - B.receive_request_service_contexts is called; - C.receive_request_service_contexts is called; - A.receive_request is called; - B.receive_request is called; - C.receive_request is called; - C.send_reply is called; - B.send_reply is called and raises an exception; - A.send_exception is called. - -Each server request interceptor's starting interception point was -invoked successfully, so each will have one (and only one) of its -ending interception points (send_reply or send_exception) invoked. In -this case, B's send_reply interception point raises an exception. B's -and C's ending interception point has already been invoked so only A's -send_exception (rather thans send_reply) ending interception point is -invoked. - ------------------------------------------------------------------------- - - Scenario 4: an exception X is raised by the target, but - B.send_exception changes the exception to Y: - - A.receive_request_service_contexts is called; - B.receive_request_service_contexts is called; - C.receive_request_service_contexts is called; - A.receive_request is called; - B.receive_request is called; - C.receive_request is called; - C.send_exception is called with X; - B.send_exception is called with X, raises Y; - A.send_exception is called with Y. - -Since each server request interceptor's starting interception point -(receive_request_service_contexts) was invoked, each server request -interceptor's ending interception point (receive_exception in this -case) will be invoked. However, A's send_exception ending -interception point will be handed exception Y exception instead of -exception X. diff --git a/TAO/tests/Portable_Interceptors/Request_Interceptor_Flow/Request_Interceptor.cpp b/TAO/tests/Portable_Interceptors/Request_Interceptor_Flow/Request_Interceptor.cpp deleted file mode 100644 index c918a767b2c..00000000000 --- a/TAO/tests/Portable_Interceptors/Request_Interceptor_Flow/Request_Interceptor.cpp +++ /dev/null @@ -1,72 +0,0 @@ -// -*- C++ -*- - -#include "Request_Interceptor.h" - -ACE_RCSID (Request_Interceptor_Flow, - Request_Interceptor, - "$Id$") - -Request_Interceptor::Request_Interceptor (const char *name) - : name_ (name), - starting_interception_point_count_ (0), - ending_interception_point_count_ (0) -{ -} - -char * -Request_Interceptor::name ( - ACE_ENV_SINGLE_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - return CORBA::string_dup (this->name_.in ()); -} - -void -Request_Interceptor::destroy (ACE_ENV_SINGLE_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - - CORBA::ULong s_count = - this->starting_interception_point_count_.value (); - - CORBA::ULong e_count = - this->ending_interception_point_count_.value (); - - if (s_count == 0) - { - ACE_ERROR ((LM_ERROR, - "(%P) ERROR: Interceptor %d \"%s\"\n" - "(%P) The number of starting interception point calls " - "is zero\n", s_count, - this->name_.in ())); - - ACE_THROW (CORBA::INTERNAL ()); - } - - if (e_count == 0) - { - ACE_ERROR ((LM_ERROR, - "(%P) ERROR: Interceptor %d \"%s\"\n" - "(%P) The number of ending interception point calls" - "is zero\n", - e_count, this->name_.in ())); - - ACE_THROW (CORBA::INTERNAL ()); - } - - if (s_count != e_count) - { - ACE_ERROR ((LM_ERROR, - "(%P) ERROR: Interceptor \"%s\"\n" - "(%P) The number of starting interception point " - "calls (%u)\n" - "(%P) did not equal the number of ending " - "interception \n" - "(%P) point calls (%u).\n\n", - this->name_.in (), - s_count, - e_count)); - - ACE_THROW (CORBA::INTERNAL ()); - } -} diff --git a/TAO/tests/Portable_Interceptors/Request_Interceptor_Flow/Request_Interceptor.h b/TAO/tests/Portable_Interceptors/Request_Interceptor_Flow/Request_Interceptor.h deleted file mode 100644 index ade0ae89891..00000000000 --- a/TAO/tests/Portable_Interceptors/Request_Interceptor_Flow/Request_Interceptor.h +++ /dev/null @@ -1,89 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file Request_Interceptor.h - * - * $Id$ - * - * Implementation header for the request interceptor base class for - * the request interceptor flow test. - * - * @author Ossama Othman <ossama@uci.edu> - */ -//============================================================================= - -#ifndef REQUEST_INTERCEPTOR_H -#define REQUEST_INTERCEPTOR_H - -#include "ace/config-all.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "tao/PI/PI.h" -#include "tao/PortableInterceptorC.h" -#include "tao/LocalObject.h" -#include "tao/CORBA_String.h" - -#include "ace/Atomic_Op.h" - -#if defined(_MSC_VER) -#pragma warning(push) -#pragma warning(disable:4250) -#endif /* _MSC_VER */ - -/** - * @class Request_Interceptor - * - * @brief Abstract base class for request interceptors used in this - * test. - */ -class Request_Interceptor - : public virtual PortableInterceptor::Interceptor -{ -public: - - /// Constructor. - Request_Interceptor (const char *name); - - /** - * @name Methods Required by the Client Request Interceptor - * Interface - * - * These are methods that must be implemented since they are pure - * virtual in the abstract base class. They are the canonical - * methods required for all client request interceptors. - */ - //@{ - /// Return the name of this Requestinterceptor. - virtual char * name (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - virtual void destroy (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - //@} - -protected: - - /// The name of this interceptor. - CORBA::String_var name_; - - /// The number of times a starting interception point has been - /// called. - ACE_Atomic_Op<TAO_SYNCH_MUTEX, CORBA::ULong> - starting_interception_point_count_; - - /// The number of times an ending interception point has been - /// called. - ACE_Atomic_Op<TAO_SYNCH_MUTEX, CORBA::ULong> - ending_interception_point_count_; - -}; - -#if defined(_MSC_VER) -#pragma warning(pop) -#endif /* _MSC_VER */ - -#endif /* REQUEST_INTERCEPTOR_H */ diff --git a/TAO/tests/Portable_Interceptors/Request_Interceptor_Flow/Server_ORBInitializer.cpp b/TAO/tests/Portable_Interceptors/Request_Interceptor_Flow/Server_ORBInitializer.cpp deleted file mode 100644 index eaf11509671..00000000000 --- a/TAO/tests/Portable_Interceptors/Request_Interceptor_Flow/Server_ORBInitializer.cpp +++ /dev/null @@ -1,75 +0,0 @@ -#include "Server_ORBInitializer.h" - -ACE_RCSID (Request_Interceptor_Flow, - Server_ORBInitializer, - "$Id$") - -#include "tao/Exception.h" -#include "tao/ORB_Constants.h" - -#include "Server_Request_Interceptor.h" - -void -Server_ORBInitializer::pre_init ( - PortableInterceptor::ORBInitInfo_ptr - ACE_ENV_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ -} - -void -Server_ORBInitializer::post_init ( - PortableInterceptor::ORBInitInfo_ptr info - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - - // Create and register the test request interceptors. - PortableInterceptor::ServerRequestInterceptor_ptr si = - PortableInterceptor::ServerRequestInterceptor::_nil (); - ACE_NEW_THROW_EX (si, - Server_Request_Interceptor ("SERVER A"), - CORBA::NO_MEMORY ( - CORBA::SystemException::_tao_minor_code ( - TAO::VMCID, - ENOMEM), - CORBA::COMPLETED_NO)); - ACE_CHECK; - - PortableInterceptor::ServerRequestInterceptor_var si_interceptor = - si; - - info->add_server_request_interceptor (si_interceptor.in () - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - - ACE_NEW_THROW_EX (si, - Server_Request_Interceptor ("SERVER B"), - CORBA::NO_MEMORY ( - CORBA::SystemException::_tao_minor_code ( - TAO::VMCID, - ENOMEM), - CORBA::COMPLETED_NO)); - ACE_CHECK; - - si_interceptor = si; - - info->add_server_request_interceptor (si_interceptor.in () - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - - ACE_NEW_THROW_EX (si, - Server_Request_Interceptor ("SERVER C"), - CORBA::NO_MEMORY ( - CORBA::SystemException::_tao_minor_code ( - TAO::VMCID, - ENOMEM), - CORBA::COMPLETED_NO)); - ACE_CHECK; - - si_interceptor = si; - - info->add_server_request_interceptor (si_interceptor.in () - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; -} diff --git a/TAO/tests/Portable_Interceptors/Request_Interceptor_Flow/Server_ORBInitializer.h b/TAO/tests/Portable_Interceptors/Request_Interceptor_Flow/Server_ORBInitializer.h deleted file mode 100644 index 0d011a67032..00000000000 --- a/TAO/tests/Portable_Interceptors/Request_Interceptor_Flow/Server_ORBInitializer.h +++ /dev/null @@ -1,64 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file Server_ORBInitializer.h - * - * $Id$ - * - * @author Ossama Othman <ossama@uci.edu> - */ -//============================================================================= - - -#ifndef TAO_SERVER_ORB_INITIALIZER_H -#define TAO_SERVER_ORB_INITIALIZER_H - -#include /**/ "ace/pre.h" - -#include "ace/config-all.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "tao/PI/PI.h" -#include "tao/LocalObject.h" - -// This is to remove "inherits via dominance" warnings from MSVC. -// MSVC is being a little too paranoid. -#if defined(_MSC_VER) -#pragma warning(push) -#pragma warning(disable:4250) -#endif /* _MSC_VER */ - -/** - * @name Server_ORBInitializer - * - * @brief - * ORB initializer that registers all server request interceptors used - * in this test. - */ -class Server_ORBInitializer : - public virtual PortableInterceptor::ORBInitializer, - public virtual TAO_Local_RefCounted_Object -{ -public: - - virtual void pre_init (PortableInterceptor::ORBInitInfo_ptr info - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - virtual void post_init (PortableInterceptor::ORBInitInfo_ptr info - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - -}; - -#if defined(_MSC_VER) -#pragma warning(pop) -#endif /* _MSC_VER */ - -#include /**/ "ace/post.h" - -#endif /* TAO_SERVER_ORB_INITIALIZER_H */ diff --git a/TAO/tests/Portable_Interceptors/Request_Interceptor_Flow/Server_Request_Interceptor.cpp b/TAO/tests/Portable_Interceptors/Request_Interceptor_Flow/Server_Request_Interceptor.cpp deleted file mode 100644 index 45e9c1b1650..00000000000 --- a/TAO/tests/Portable_Interceptors/Request_Interceptor_Flow/Server_Request_Interceptor.cpp +++ /dev/null @@ -1,263 +0,0 @@ -// -*- C++ -*- - -#include "Server_Request_Interceptor.h" - -ACE_RCSID (Request_Interceptor_Flow, - Server_Request_Interceptor, - "$Id$") - -#include "testC.h" - -#include "tao/AnyTypeCode/AnyTypeCode_Adapter_Impl.h" -#include "tao/AnyTypeCode/TypeCode.h" - -#include "ace/OS_NS_string.h" - -Server_Request_Interceptor::Server_Request_Interceptor (const char *name) - : Request_Interceptor (name), - scenario_ (0) -{ -} - -void -Server_Request_Interceptor::receive_request_service_contexts ( - PortableInterceptor::ServerRequestInfo_ptr ri - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableInterceptor::ForwardRequest)) -{ - - CORBA::Boolean server_side = - this->server_side_test (ri ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - - if (!server_side) - return; // Don't continue if the client side is being tested. - - ACE_DEBUG ((LM_INFO, - "%s.receive_request_service_contexts", - this->name_.in ())); - - if (ACE_OS::strcmp ("SERVER B", this->name_.in ()) == 0) - { - this->scenario_++; - - switch (this->scenario_) - { - case 2: - // We can only throw a CORBA::SystemException or a - // PortableInteceptor::ForwardRequest exception due to - // the restricted exception specification dictated by - // the IDL for request interceptors. As such, an - // arbitrary CORBA::SystemException was chosen - // (NO_PERMISSION, in this case). - ACE_DEBUG ((LM_DEBUG, - " raised CORBA::NO_PERMISSION exception\n")); - ACE_THROW (CORBA::NO_PERMISSION ()); // Expected exception. - - default: - break; - } - } - - ACE_DEBUG ((LM_DEBUG, - "\n")); - - this->starting_interception_point_count_++; -} - -void -Server_Request_Interceptor::receive_request ( - PortableInterceptor::ServerRequestInfo_ptr ri - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableInterceptor::ForwardRequest)) -{ - - CORBA::Boolean server_side = - this->server_side_test (ri ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - - if (!server_side) - return; // Don't continue if the client side is being tested. - - ACE_DEBUG ((LM_INFO, - "%s.receive_request\n", - this->name_.in ())); -} - -void -Server_Request_Interceptor::send_reply ( - PortableInterceptor::ServerRequestInfo_ptr ri - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - - CORBA::Boolean server_side = - this->server_side_test (ri ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - - if (!server_side) - return; // Don't continue if the client side is being tested. - - this->ending_interception_point_count_++; - - ACE_DEBUG ((LM_INFO, - "%s.send_reply", - this->name_.in ())); - - if (ACE_OS::strcmp ("SERVER B", this->name_.in ()) == 0) - { - // Determine which test scenario we are in - Dynamic::ParameterList_var paramlist = - ri->arguments (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; - - Test::TestScenario scenario; - CORBA::ULong i = 0; // index -- explicitly used to avoid - // overloaded operator ambiguity. - if (paramlist[i].argument >>= scenario) - { - switch (scenario) - { - case 3: - // We can only throw a CORBA::SystemException or a - // PortableInteceptor::ForwardRequest exception due to - // the restricted exception specification dictated by - // the IDL for request interceptors. As such, an - // arbitrary CORBA::SystemException was chosen - // (NO_PERMISSION, in this case). - ACE_DEBUG ((LM_DEBUG, - " raised CORBA::NO_PERMISSION exception\n")); - ACE_THROW (CORBA::NO_PERMISSION ()); // Expected exception. - - default: - break; - } - } - else - ACE_ERROR ((LM_ERROR, - "\nERROR: send_reply - Could not extract " - "arguments.\n")); - } - - ACE_DEBUG ((LM_DEBUG, - "\n")); -} - -void -Server_Request_Interceptor::send_exception ( - PortableInterceptor::ServerRequestInfo_ptr ri - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableInterceptor::ForwardRequest)) -{ - - CORBA::Boolean server_side = - this->server_side_test (ri ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - - if (!server_side) - return; // Don't continue if the client side is being tested. - - this->ending_interception_point_count_++; - - ACE_DEBUG ((LM_INFO, - "%s.send_exception", - this->name_.in ())); - - if (ACE_OS::strcmp ("SERVER B", this->name_.in ()) == 0) - { - // Determine which test scenario we are in - Dynamic::ParameterList_var paramlist = - ri->arguments (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; - - Test::TestScenario scenario; - CORBA::ULong i = 0; // index -- explicitly used to avoid - // overloaded operator ambiguity. - if (paramlist[i].argument >>= scenario) - { - CORBA::Any_var exception; - CORBA::TypeCode_var tc; - const char *id = 0; - - switch (scenario) - { - case 4: - exception = ri->sending_exception (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; - - tc = exception->type (); - - id = tc->id (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; - - if (ACE_OS::strcmp (id, "IDL:Test/X:1.0") == 0) - { - // We can only throw a CORBA::SystemException or a - // PortableInteceptor::ForwardRequest exception due - // to the restricted exception specification - // dictated by the IDL for request interceptors. As - // such, an arbitrary CORBA::SystemException was - // chosen (NO_PERMISSION, in this case). - ACE_DEBUG ((LM_DEBUG, - " transformed Test::X exception to " - "CORBA::NO_PERMISSION exception\n")); - - // Expected exception. - ACE_THROW (CORBA::NO_PERMISSION ()); - } - else - { - ACE_ERROR ((LM_ERROR, - "\nERROR: send_exception - Received " - "unexpected exception!\n")); - } - break; - default: - break; - } - } - else - ACE_ERROR ((LM_ERROR, - "\nERROR: send_exception - Could not extract " - "arguments.\n")); - } - - ACE_DEBUG ((LM_DEBUG, - "\n")); -} - -void -Server_Request_Interceptor::send_other ( - PortableInterceptor::ServerRequestInfo_ptr ri - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableInterceptor::ForwardRequest)) -{ - - CORBA::Boolean server_side = - this->server_side_test (ri ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - - if (!server_side) - return; // Don't continue if the client side is being tested. - - this->ending_interception_point_count_++; - - ACE_DEBUG ((LM_INFO, - "%s.send_other", - this->name_.in ())); -} - -CORBA::Boolean -Server_Request_Interceptor::server_side_test ( - PortableInterceptor::ServerRequestInfo_ptr info - ACE_ENV_ARG_DECL) -{ - CORBA::String_var op = info->operation (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK_RETURN (0); - - return ACE_OS::strcmp (op.in (), "server_test") == 0 ? 1 : 0; -} 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 deleted file mode 100644 index e0a9c66c947..00000000000 --- a/TAO/tests/Portable_Interceptors/Request_Interceptor_Flow/Server_Request_Interceptor.h +++ /dev/null @@ -1,112 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file Server_Request_Interceptor.h - * - * $Id$ - * - * Implementation header for the server request interceptor for the - * request interceptor flow test. - * - * @author Ossama Othman <ossama@uci.edu> - */ -//============================================================================= - -#ifndef SERVER_REQUEST_INTERCEPTOR_H -#define SERVER_REQUEST_INTERCEPTOR_H - -#include "ace/config-all.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "Request_Interceptor.h" - -#include "tao/PI_Server/PI_Server.h" -#include "tao/PortableInterceptorC.h" -#include "tao/LocalObject.h" - -#if defined(_MSC_VER) -#pragma warning(push) -#pragma warning(disable:4250) -#endif /* _MSC_VER */ - -/** - * @class Server_Request_Interceptor - * - * @brief Simple concrete server request interceptor. - * - * See the README file for test details. - */ -class Server_Request_Interceptor - : public virtual PortableInterceptor::ServerRequestInterceptor, - public virtual TAO_Local_RefCounted_Object, - public virtual Request_Interceptor -{ -public: - - /// Constructor. Accepts the name of the interceptor. - Server_Request_Interceptor (const char *name); - - /** - * @name Methods Required by the Server Request Interceptor - * Interface - * - * These are methods that must be implemented since they are pure - * virtual in the abstract base class. They are the canonical - * methods required for all server request interceptors. - */ - //@{ - virtual void receive_request_service_contexts ( - PortableInterceptor::ServerRequestInfo_ptr ri - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableInterceptor::ForwardRequest)); - - virtual void receive_request ( - PortableInterceptor::ServerRequestInfo_ptr ri - 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 ri - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableInterceptor::ForwardRequest)); - //@} - -private: - - /// Returns 1 if the server-side test is currently being run, and 0 - /// otherwise. - CORBA::Boolean server_side_test ( - PortableInterceptor::ServerRequestInfo_ptr info - ACE_ENV_ARG_DECL); - -private: - - /// Variable used to keep track of the scenario count. Used to get - /// around the inability to call RequestInfo::arguments() in the - /// receive_service_contexts() interception point. - CORBA::ULong scenario_; -}; - -#if defined(_MSC_VER) -#pragma warning(pop) -#endif /* _MSC_VER */ - -#endif /* SERVER_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 deleted file mode 100644 index 52caf89e452..00000000000 --- a/TAO/tests/Portable_Interceptors/Request_Interceptor_Flow/client.cpp +++ /dev/null @@ -1,224 +0,0 @@ -// -*- C++ -*- - -#include "ace/Get_Opt.h" - -#include "testC.h" -#include "Client_ORBInitializer.h" - -#include "tao/ORBInitializer_Registry.h" - -ACE_RCSID (Request_Interceptor_Flow, - client, - "$Id$") - -const char *ior = 0; - -int -parse_args (int argc, char *argv[]) -{ - if (argc != 3) // foo -k IOR - ACE_ERROR_RETURN ((LM_ERROR, - "Wrong number of arguments.\n"), - -1); - - ACE_Get_Opt get_opts (argc, argv, "k:"); - int c; - - while ((c = get_opts ()) != -1) - switch (c) - { - case 'k': - if (ior == 0) - ior = get_opts.opt_arg (); - break; - default: - ACE_ERROR_RETURN ((LM_ERROR, - "Usage: %s " - "-k IOR\n", - argv[0]), - -1); - } - - return 0; -} - -void -client_test (Test_ptr server ACE_ENV_ARG_DECL) -{ - // Currently, there are only four scenarios for the client side - // tests. - const Test::TestScenario MAX_CLIENT_SCENARIO = 4; - - for (Test::TestScenario i = 1; i <= MAX_CLIENT_SCENARIO; ++i) - { - ACE_DEBUG ((LM_INFO, - "\nCLIENT SCENARIO %d\n" - "------------------\n", - i)); - - ACE_TRY - { - 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) - { - // Expected exception. Ignore it. - } - ACE_CATCH (CORBA::NO_PERMISSION, ex) - { - // Expected exception. Ignore it. - } - ACE_CATCH (Test::UnknownScenario, ex) - { - ACE_ERROR ((LM_ERROR, - "\nERROR: Unknown scenario <%d> condition " - "returned from client_test() " - "operation.\n", - ex.scenario)); - ACE_RE_THROW; - } - ACE_CATCHANY - { - ACE_ERROR ((LM_ERROR, - "\nERROR: Exception thrown from client_test() " - "operation.\n")); - ACE_RE_THROW; - } - ACE_ENDTRY; - ACE_CHECK; - } -} - -void -server_test (Test_ptr server ACE_ENV_ARG_DECL) -{ - // Currently, there are only four scenarios for the server side - // tests. - const Test::TestScenario MAX_SERVER_SCENARIO = 4; - - for (Test::TestScenario i = 1; i <= MAX_SERVER_SCENARIO; ++i) - { - ACE_DEBUG ((LM_INFO, - "\nSERVER SCENARIO %d\n" - "------------------\n", - i)); - - ACE_TRY - { - CORBA::ULongSeq_var ulongseq; - server->server_test (i, ulongseq.out () 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) - { - // Expected exception. Ignore it. - } - ACE_CATCH (CORBA::NO_PERMISSION, ex) - { - // Expected exception. Ignore it. - } - ACE_CATCH (Test::UnknownScenario, ex) - { - ACE_ERROR ((LM_ERROR, - "\nERROR: Unknown scenario <%d> condition " - "returned from server_test() " - "operation.\n", - ex.scenario)); - ACE_RE_THROW; - } - ACE_CATCHANY - { - ACE_ERROR ((LM_ERROR, - "\nERROR: Exception thrown from server_test() " - "operation.\n")); - ACE_RE_THROW; - } - ACE_ENDTRY; - ACE_CHECK; - } -} - -int -main (int argc, char *argv[]) -{ - ACE_DECLARE_NEW_CORBA_ENV; - ACE_TRY - { - PortableInterceptor::ORBInitializer_ptr temp_initializer = - PortableInterceptor::ORBInitializer::_nil (); - - ACE_NEW_RETURN (temp_initializer, - Client_ORBInitializer, - -1); // No exceptions yet! - PortableInterceptor::ORBInitializer_var orb_initializer = - temp_initializer; - - PortableInterceptor::register_orb_initializer (orb_initializer.in () - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - CORBA::ORB_var orb = CORBA::ORB_init (argc, - argv, - "Client ORB" - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - if (::parse_args (argc, argv) != 0) - return -1; - - CORBA::Object_var object = - orb->string_to_object (ior ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - Test_var server = - Test::_narrow (object.in () ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - if (CORBA::is_nil (server.in ())) - { - ACE_ERROR_RETURN ((LM_ERROR, - "Object reference <%s> is nil\n", - ior), - 1); - } - - ::client_test (server.in () ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - ::server_test (server.in () ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - server->shutdown (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - - orb->destroy (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - } - ACE_CATCHANY - { - ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, - "Caught exception:"); - return -1; - } - ACE_ENDTRY; - - ACE_DEBUG ((LM_INFO, - "Request interceptor flow test passed.\n")); - - return 0; -} diff --git a/TAO/tests/Portable_Interceptors/Request_Interceptor_Flow/run_test.pl b/TAO/tests/Portable_Interceptors/Request_Interceptor_Flow/run_test.pl deleted file mode 100755 index 162acd63c17..00000000000 --- a/TAO/tests/Portable_Interceptors/Request_Interceptor_Flow/run_test.pl +++ /dev/null @@ -1,50 +0,0 @@ -eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' - & eval 'exec perl -S $0 $argv:q' - if 0; - -# -*- perl -*- -# $Id$ - -use lib '../../../../bin'; -use PerlACE::Run_Test; - -$status = 0; -$file = PerlACE::LocalFile ("test.ior"); - -unlink $file; - -if (PerlACE::is_vxworks_test()) { - $SV = new PerlACE::ProcessVX ("server", "-o test.ior"); -} -else { - $SV = new PerlACE::Process ("server", "-o $file"); -} -$CL = new PerlACE::Process ("client", "-k file://$file"); - -print STDERR "\n\n==== Running Request_Interceptor_Flow test\n"; - -$SV->Spawn (); - -if (PerlACE::waitforfile_timed ($file, 15) == -1) { - print STDERR "ERROR: cannot find file <$file>\n"; - $SV->Kill (); - exit 1; -} - -$client = $CL->SpawnWaitKill (60); - -if ($client != 0) { - print STDERR "ERROR: client returned $client\n"; - $status = 1; -} - -$server = $SV->WaitKill (5); - -if ($server != 0) { - print STDERR "ERROR: server returned $server\n"; - $status = 1; -} - -unlink $file; - -exit $status; diff --git a/TAO/tests/Portable_Interceptors/Request_Interceptor_Flow/server.cpp b/TAO/tests/Portable_Interceptors/Request_Interceptor_Flow/server.cpp deleted file mode 100644 index 6e4fa0d21d3..00000000000 --- a/TAO/tests/Portable_Interceptors/Request_Interceptor_Flow/server.cpp +++ /dev/null @@ -1,135 +0,0 @@ -// -*- C++ -*- - -#include "ace/Get_Opt.h" -#include "test_i.h" -#include "Server_ORBInitializer.h" - -#include "tao/ORBInitializer_Registry.h" -#include "ace/OS_NS_stdio.h" - -ACE_RCSID (Request_Interceptor_Flow, - server, - "$Id$") - -const char *ior_file = 0; - -int -parse_args (int argc, char *argv[]) -{ - if (argc != 3) // foo -o IOR - ACE_ERROR_RETURN ((LM_ERROR, - "Wrong number of arguments.\n"), - -1); - - ACE_Get_Opt get_opts (argc, argv, "o:"); - int c; - - while ((c = get_opts ()) != -1) - switch (c) - { - case 'o': - - ior_file = get_opts.opt_arg (); - break; - - default: - ACE_ERROR_RETURN ((LM_ERROR, - "Usage: %s " - "-o IOR\n", - argv[0]), - -1); - } - - return 0; -} - -int -main (int argc, char *argv[]) -{ - ACE_DECLARE_NEW_CORBA_ENV; - ACE_TRY - { - Server_ORBInitializer *temp_initializer = 0; - ACE_NEW_RETURN (temp_initializer, - Server_ORBInitializer, - -1); // No exceptions yet! - PortableInterceptor::ORBInitializer_var orb_initializer = - temp_initializer; - - PortableInterceptor::register_orb_initializer (orb_initializer.in () - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - CORBA::ORB_var orb = - CORBA::ORB_init (argc, argv, "Server ORB" ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - CORBA::Object_var poa_object = - orb->resolve_initial_references ("RootPOA" ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - if (CORBA::is_nil (poa_object.in ())) - ACE_ERROR_RETURN ((LM_ERROR, - " (%P|%t) Unable to initialize the POA.\n"), - 1); - - PortableServer::POA_var root_poa = - PortableServer::POA::_narrow (poa_object.in () ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - PortableServer::POAManager_var poa_manager = - root_poa->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - - if (::parse_args (argc, argv) != 0) - return -1; - - test_i servant (orb.in ()); - - CORBA::Object_var obj = servant._this (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - - CORBA::String_var ior = - orb->object_to_string (obj.in () ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - ACE_DEBUG ((LM_DEBUG, - "Servant:\n<%s>\n", - ior.in ())); - - poa_manager->activate (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - - // Write IOR to a file. - FILE *output_file= ACE_OS::fopen (ior_file, "w"); - if (output_file == 0) - ACE_ERROR_RETURN ((LM_ERROR, - "Cannot open output file <%s> for writing " - "IOR: %s", - ior.in ()), - 1); - ACE_OS::fprintf (output_file, "%s", ior.in ()); - ACE_OS::fclose (output_file); - - // Run the ORB event loop. - orb->run (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - - root_poa->destroy (1, 1 ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - orb->destroy (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - - ACE_DEBUG ((LM_DEBUG, "Event loop finished.\n")); - } - ACE_CATCHANY - { - ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, - "Caught exception:"); - return -1; - } - ACE_ENDTRY; - - return 0; -} diff --git a/TAO/tests/Portable_Interceptors/Request_Interceptor_Flow/test.idl b/TAO/tests/Portable_Interceptors/Request_Interceptor_Flow/test.idl deleted file mode 100644 index 036fe0dd66e..00000000000 --- a/TAO/tests/Portable_Interceptors/Request_Interceptor_Flow/test.idl +++ /dev/null @@ -1,38 +0,0 @@ -// -*- IDL -*- - -//============================================================================= -/** - * @file test.idl - * - * $Id$ - * - * IDL file to test request interceptor flow. - * - * @author Ossama Othman <ossama@uci.edu> - */ -//============================================================================= - -#include "tao/ULongSeq.pidl" - -interface Test -{ - typedef short TestScenario; - - /// Dummy exception used during the test. - exception X {}; - - /// Unknown scenario number was passed to the test operation. - exception UnknownScenario { - TestScenario scenario; - }; - - /// The client-side test operation. - void client_test (in TestScenario scenario) raises (X, UnknownScenario); - - /// The server-side test operation. - void server_test (in TestScenario scenario, out CORBA::ULongSeq myseq) raises (X, UnknownScenario); - - /// Shutdown the server. - oneway void shutdown (); - -}; diff --git a/TAO/tests/Portable_Interceptors/Request_Interceptor_Flow/test_i.cpp b/TAO/tests/Portable_Interceptors/Request_Interceptor_Flow/test_i.cpp deleted file mode 100644 index 17dee50ac55..00000000000 --- a/TAO/tests/Portable_Interceptors/Request_Interceptor_Flow/test_i.cpp +++ /dev/null @@ -1,69 +0,0 @@ -// -*- C++ -*- - -#include "test_i.h" - -ACE_RCSID (Request_Interceptor_Flow, - test_i, - "$Id$") - -test_i::test_i (CORBA::ORB_ptr orb) - : orb_ (CORBA::ORB::_duplicate (orb)) -{ -} - -void -test_i::client_test (Test::TestScenario scenario - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((Test::X, - Test::UnknownScenario, - CORBA::SystemException)) -{ - switch (scenario) - { - case 1: - case 4: - // Both the client-side and server-side tests throw this - // exception in these scenarios. - ACE_THROW (Test::X ()); // Expected test exception - case 2: - case 3: - break; - default: - ACE_THROW (Test::UnknownScenario (scenario)); // Unexpected! - } -} - -void -test_i::server_test (Test::TestScenario scenario, - CORBA::ULongSeq_out myseq - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((Test::X, - Test::UnknownScenario, - CORBA::SystemException)) -{ - myseq = new CORBA::ULongSeq; - - switch (scenario) - { - case 1: - case 4: - // Both the client-side and server-side tests throw this - // exception in these scenarios. - ACE_THROW (Test::X ()); // Expected test exception - case 2: - case 3: - break; - default: - ACE_THROW (Test::UnknownScenario (scenario)); // Unexpected! - } -} - -void -test_i::shutdown (ACE_ENV_SINGLE_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - ACE_DEBUG ((LM_INFO, - "Server is shutting down.\n")); - - this->orb_->shutdown (0 ACE_ENV_ARG_PARAMETER); -} diff --git a/TAO/tests/Portable_Interceptors/Request_Interceptor_Flow/test_i.h b/TAO/tests/Portable_Interceptors/Request_Interceptor_Flow/test_i.h deleted file mode 100644 index 604d4ffb432..00000000000 --- a/TAO/tests/Portable_Interceptors/Request_Interceptor_Flow/test_i.h +++ /dev/null @@ -1,61 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file test_i.h - * - * $Id$ - * - * Implementation header for the "test" IDL interface for the - * request interceptor flow test. - * - * @author Ossama Othman <ossama@uci.edu> - */ -//============================================================================= - -#ifndef TEST_I_H -#define TEST_I_H - -#include "testS.h" - -/** - * @class test_i - * - * @brief Simple test class. - * - * This class implements the "test" interface used in this test. - */ -class test_i : public virtual POA_Test -{ -public: - - /// Constructor. - test_i (CORBA::ORB_ptr orb); - - /// The client-side test operation. - virtual void client_test (Test::TestScenario scenario - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((Test::X, - Test::UnknownScenario, - CORBA::SystemException)); - - /// The server-side test operation. - virtual void server_test (Test::TestScenario scenario, - CORBA::ULongSeq_out myseq - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((Test::X, - Test::UnknownScenario, - CORBA::SystemException)); - - /// Shutdown the ORB. - virtual void shutdown (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - -private: - - /// Pseudo-reference to the ORB. - CORBA::ORB_var orb_; - -}; - -#endif /* TEST_I_H */ diff --git a/TAO/tests/Portable_Interceptors/Service_Context_Manipulation/.cvsignore b/TAO/tests/Portable_Interceptors/Service_Context_Manipulation/.cvsignore deleted file mode 100644 index f2ad85300eb..00000000000 --- a/TAO/tests/Portable_Interceptors/Service_Context_Manipulation/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -client -server diff --git a/TAO/tests/Portable_Interceptors/Service_Context_Manipulation/Client_ORBInitializer.cpp b/TAO/tests/Portable_Interceptors/Service_Context_Manipulation/Client_ORBInitializer.cpp deleted file mode 100644 index fd053e810f0..00000000000 --- a/TAO/tests/Portable_Interceptors/Service_Context_Manipulation/Client_ORBInitializer.cpp +++ /dev/null @@ -1,50 +0,0 @@ -// -*- C++ -*- -// -// $Id$ -// - -#include "Client_ORBInitializer.h" -#include "client_interceptor.h" - -ACE_RCSID (Service_Context_Manipulation, Client_ORBInitializer, "$Id$") - -Client_ORBInitializer::Client_ORBInitializer (void) -{ -} - -void -Client_ORBInitializer::pre_init ( - PortableInterceptor::ORBInitInfo_ptr - ACE_ENV_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ -} - -void -Client_ORBInitializer::post_init ( - PortableInterceptor::ORBInitInfo_ptr info - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - - CORBA::String_var orb_id = - info->orb_id (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; - - PortableInterceptor::ClientRequestInterceptor_ptr interceptor = - PortableInterceptor::ClientRequestInterceptor::_nil (); - - // Install the Echo client request interceptor - ACE_NEW_THROW_EX (interceptor, - Echo_Client_Request_Interceptor (orb_id.in ()), - CORBA::NO_MEMORY ()); - ACE_CHECK; - - PortableInterceptor::ClientRequestInterceptor_var - client_interceptor = interceptor; - - info->add_client_request_interceptor (client_interceptor.in () - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; -} - diff --git a/TAO/tests/Portable_Interceptors/Service_Context_Manipulation/Client_ORBInitializer.h b/TAO/tests/Portable_Interceptors/Service_Context_Manipulation/Client_ORBInitializer.h deleted file mode 100644 index 569419fb346..00000000000 --- a/TAO/tests/Portable_Interceptors/Service_Context_Manipulation/Client_ORBInitializer.h +++ /dev/null @@ -1,48 +0,0 @@ -// -*- C++ -*- -// -// $Id$ -// - -#ifndef TAO_CLIENT_ORB_INITIALIZER_H -#define TAO_CLIENT_ORB_INITIALIZER_H -#include /**/ "ace/pre.h" - -#include "tao/PI/PI.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "tao/LocalObject.h" - -// This is to remove "inherits via dominance" warnings from MSVC. -// MSVC is being a little too paranoid. -#if defined(_MSC_VER) -#pragma warning(push) -#pragma warning(disable:4250) -#endif /* _MSC_VER */ - -/// Client ORB initializer. -class Client_ORBInitializer : - public virtual PortableInterceptor::ORBInitializer, - public virtual TAO_Local_RefCounted_Object -{ -public: - /// Constructor - Client_ORBInitializer (void); - - virtual void pre_init (PortableInterceptor::ORBInitInfo_ptr info - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - virtual void post_init (PortableInterceptor::ORBInitInfo_ptr info - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); -}; - -#if defined(_MSC_VER) -#pragma warning(pop) -#endif /* _MSC_VER */ - -#include /**/ "ace/post.h" -#endif /* TAO_CLIENT_ORB_INITIALIZER_H */ 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 deleted file mode 100644 index 2e992878fcb..00000000000 --- a/TAO/tests/Portable_Interceptors/Service_Context_Manipulation/PI_Svc_Context_Manip.mpc +++ /dev/null @@ -1,22 +0,0 @@ -// -*- MPC -*- -// $Id$ - -project(*Server): taoserver, pi_server, interceptors { - Source_Files { - test_i.cpp - Server_ORBInitializer.cpp - server_interceptor.cpp - server.cpp - } -} - -project(*Client): taoclient, pi, interceptors { - after += *Server - Source_Files { - testC.cpp - Client_ORBInitializer.cpp - client_interceptor.cpp - client.cpp - } -} - diff --git a/TAO/tests/Portable_Interceptors/Service_Context_Manipulation/README b/TAO/tests/Portable_Interceptors/Service_Context_Manipulation/README deleted file mode 100644 index 4af4436596f..00000000000 --- a/TAO/tests/Portable_Interceptors/Service_Context_Manipulation/README +++ /dev/null @@ -1,8 +0,0 @@ -# $Id$ - -This test allows you to visually check proper manipulation of a -request's ServiceContextList through Portable Interceptors. - - server -o test.ior - - client diff --git a/TAO/tests/Portable_Interceptors/Service_Context_Manipulation/Server_ORBInitializer.cpp b/TAO/tests/Portable_Interceptors/Service_Context_Manipulation/Server_ORBInitializer.cpp deleted file mode 100644 index 0ad8960c819..00000000000 --- a/TAO/tests/Portable_Interceptors/Service_Context_Manipulation/Server_ORBInitializer.cpp +++ /dev/null @@ -1,45 +0,0 @@ -// -*- C++ -*- -// -// $Id$ -// - -#include "Server_ORBInitializer.h" -#include "server_interceptor.h" - -ACE_RCSID (Service_Context_Manipulation, Server_ORBInitializer, "$Id$") - -Server_ORBInitializer::Server_ORBInitializer (void) -{ -} - -void -Server_ORBInitializer::pre_init ( - PortableInterceptor::ORBInitInfo_ptr - ACE_ENV_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ -} - -void -Server_ORBInitializer::post_init ( - PortableInterceptor::ORBInitInfo_ptr info - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - PortableInterceptor::ServerRequestInterceptor_ptr interceptor = - PortableInterceptor::ServerRequestInterceptor::_nil (); - - // Install the Echo server request interceptor - ACE_NEW_THROW_EX (interceptor, - Echo_Server_Request_Interceptor, - CORBA::NO_MEMORY ()); - ACE_CHECK; - - PortableInterceptor::ServerRequestInterceptor_var - server_interceptor = interceptor; - - info->add_server_request_interceptor (server_interceptor.in () - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; -} - diff --git a/TAO/tests/Portable_Interceptors/Service_Context_Manipulation/Server_ORBInitializer.h b/TAO/tests/Portable_Interceptors/Service_Context_Manipulation/Server_ORBInitializer.h deleted file mode 100644 index 992070c71e1..00000000000 --- a/TAO/tests/Portable_Interceptors/Service_Context_Manipulation/Server_ORBInitializer.h +++ /dev/null @@ -1,48 +0,0 @@ -// -*- C++ -*- -// -// $Id$ -// - -#ifndef TAO_SERVER_ORB_INITIALIZER_H -#define TAO_SERVER_ORB_INITIALIZER_H -#include /**/ "ace/pre.h" - -#include "tao/PI/PI.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "tao/LocalObject.h" - -// This is to remove "inherits via dominance" warnings from MSVC. -// MSVC is being a little too paranoid. -#if defined(_MSC_VER) -#pragma warning(push) -#pragma warning(disable:4250) -#endif /* _MSC_VER */ - -/// Server ORB initializer. -class Server_ORBInitializer : - public virtual PortableInterceptor::ORBInitializer, - public virtual TAO_Local_RefCounted_Object -{ -public: - /// Constructor - Server_ORBInitializer (void); - - virtual void pre_init (PortableInterceptor::ORBInitInfo_ptr info - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - virtual void post_init (PortableInterceptor::ORBInitInfo_ptr info - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); -}; - -#if defined(_MSC_VER) -#pragma warning(pop) -#endif /* _MSC_VER */ - -#include /**/ "ace/post.h" -#endif /* TAO_SERVER_ORB_INITIALIZER_H */ diff --git a/TAO/tests/Portable_Interceptors/Service_Context_Manipulation/client.cpp b/TAO/tests/Portable_Interceptors/Service_Context_Manipulation/client.cpp deleted file mode 100644 index 80c6cfad678..00000000000 --- a/TAO/tests/Portable_Interceptors/Service_Context_Manipulation/client.cpp +++ /dev/null @@ -1,134 +0,0 @@ -// $Id$ - -#include "ace/Get_Opt.h" -#include "testC.h" -#include "Client_ORBInitializer.h" - -#include "tao/ORBInitializer_Registry.h" - -ACE_RCSID(Interceptors, client, "$Id$") - -const char *ior = "file://test.ior"; - -int -parse_args (int argc, char *argv[]) -{ - ACE_Get_Opt get_opts (argc, argv, "ef:"); - int c; - - while ((c = get_opts ()) != -1) - switch (c) - { - case 'e': - break; - case 'f': - ior = get_opts.opt_arg (); - break; - case '?': - default: - ACE_ERROR_RETURN ((LM_ERROR, - "usage: %s " - "-v " - "\n", - argv [0]), - -1); - } - return 0; -} - -void -run_test (Test_Interceptors::Visual_ptr server - ACE_ENV_ARG_DECL) -{ - - server->normal (10 ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - - ACE_DEBUG ((LM_DEBUG, "\"normal\" operation done\n")); - - server->nothing (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; - - ACE_DEBUG ((LM_DEBUG, "\"nothing\" operation done\n")); - - ACE_TRY - { - server->user (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - } - ACE_CATCH (Test_Interceptors::Silly, userex) - { - ACE_DEBUG ((LM_DEBUG, "Caught Silly\n")); - } - ACE_ENDTRY; - ACE_CHECK; - - ACE_TRY_EX (SYS) - { - server->system (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK_EX (SYS); - } - ACE_CATCH (CORBA::INV_OBJREF, sysex) - { - ACE_DEBUG ((LM_DEBUG, "Caught CORBA::INV_OBJREF\n")); - } - ACE_ENDTRY; - ACE_CHECK; -} - -int -main (int argc, char *argv[]) -{ - ACE_TRY_NEW_ENV - { - PortableInterceptor::ORBInitializer_ptr temp_initializer; - - ACE_NEW_RETURN (temp_initializer, - Client_ORBInitializer, - -1); // No exceptions yet! - PortableInterceptor::ORBInitializer_var initializer = - temp_initializer; - - PortableInterceptor::register_orb_initializer (initializer.in () - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - CORBA::ORB_var orb = - CORBA::ORB_init (argc, argv, "" ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - if (parse_args (argc, argv) != 0) - return 1; - - CORBA::Object_var object = - orb->string_to_object (ior ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - Test_Interceptors::Visual_var server = - Test_Interceptors::Visual::_narrow (object.in () ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - if (CORBA::is_nil (server.in ())) - { - ACE_ERROR_RETURN ((LM_ERROR, - "Object reference <%s> is nil\n", - ior), - 1); - } - - run_test (server.in () ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - server->shutdown (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - } - ACE_CATCHANY - { - ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, - "Caught exception in client:"); - return 1; - } - ACE_ENDTRY; - - return 0; -} diff --git a/TAO/tests/Portable_Interceptors/Service_Context_Manipulation/client_interceptor.cpp b/TAO/tests/Portable_Interceptors/Service_Context_Manipulation/client_interceptor.cpp deleted file mode 100644 index e9ef8474a32..00000000000 --- a/TAO/tests/Portable_Interceptors/Service_Context_Manipulation/client_interceptor.cpp +++ /dev/null @@ -1,284 +0,0 @@ -// $Id$ - -#include "client_interceptor.h" -#include "tao/OctetSeqC.h" - -#include "ace/Log_Msg.h" -#include "ace/OS_NS_string.h" - -ACE_RCSID (Service_Context_Manipulation, - interceptors, - "$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_Client_Request_Interceptor:: -Echo_Client_Request_Interceptor (const char *id) - : myname_ ("Echo_Client_Interceptor"), - orb_id_ (CORBA::string_dup (id)) -{ -} - -Echo_Client_Request_Interceptor::~Echo_Client_Request_Interceptor (void) -{ -} - -char * -Echo_Client_Request_Interceptor::name (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - return CORBA::string_dup (this->myname_); -} - -void -Echo_Client_Request_Interceptor::destroy (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ -} - -void -Echo_Client_Request_Interceptor::send_poll ( - PortableInterceptor::ClientRequestInfo_ptr - ACE_ENV_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - // Do Nothing -} - -void -Echo_Client_Request_Interceptor::send_request ( - PortableInterceptor::ClientRequestInfo_ptr ri - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableInterceptor::ForwardRequest)) -{ - - if (CORBA::is_nil (this->orb_.in ())) - { - int argc = 0; - this->orb_ = CORBA::ORB_init (argc, 0, - this->orb_id_.in () - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - } - - CORBA::String_var operation = ri->operation (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; - - CORBA::Object_var target = ri->target (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; - - CORBA::String_var ior = - this->orb_->object_to_string (target.in () ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - -#if 0 - ACE_DEBUG ((LM_DEBUG, - "%s.send_request " - "from \"%s\" on object: %s\n", - this->myname_, - operation.in (), - ior.in ())); -#endif /*if 0*/ - - - - // Populate target member of the ClientRequestInfo. - - // Make the context to send the context to the target - IOP::ServiceContext sc; - sc.context_id = ::service_id; - - CORBA::ULong string_len = ACE_OS::strlen (request_msg) + 1; - CORBA::Octet *buf = CORBA::OctetSeq::allocbuf (string_len); - ACE_OS::strcpy (reinterpret_cast<char *> (buf), request_msg); - - sc.context_data.replace (string_len, string_len, buf, 1); - - // Add this context to the service context list. - ri->add_request_service_context (sc, 0 ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - - // Check that the request service context can be retrieved. - 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: Expected request service context to be: %s.\n" - " Got: %s\n", - request_msg, - buf2)); - } - -} - -void -Echo_Client_Request_Interceptor::receive_reply ( - PortableInterceptor::ClientRequestInfo_ptr ri - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - - if (CORBA::is_nil (this->orb_.in ())) - { - int argc = 0; - this->orb_ = CORBA::ORB_init (argc, 0, - this->orb_id_.in () - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - } - - CORBA::String_var operation = ri->operation (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; - - CORBA::Object_var target = ri->target (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; - - CORBA::String_var ior = - this->orb_->object_to_string (target.in () ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - -#if 0 - ACE_DEBUG ((LM_DEBUG, - "%s.receive_reply from " - "\"%s\" on object: %s\n", - this->myname_, - operation.in (), - ior.in ())); -#endif /*if 0*/ - - // Check that the reply service context was received 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, - " Received reply service context: %s\n", - buf)); -#endif /*if 0*/ - - if (ACE_OS::strcmp (buf, reply_msg) != 0) - { - ACE_ERROR ((LM_ERROR, - "ERROR: Expected reply service context to be: %s\n", - reply_msg)); - } - - // Check that no one has messed with the request service context. - 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: Expected request service context to be: %s.\n" - " Got: %s\n", - request_msg, - buf2)); - } -} - -void -Echo_Client_Request_Interceptor::receive_other ( - PortableInterceptor::ClientRequestInfo_ptr - ACE_ENV_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableInterceptor::ForwardRequest)) -{ - ACE_DEBUG ((LM_DEBUG, - "%s.receive_other\n", - this->myname_)); -} - -void -Echo_Client_Request_Interceptor::receive_exception ( - PortableInterceptor::ClientRequestInfo_ptr ri - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableInterceptor::ForwardRequest)) -{ - - if (CORBA::is_nil (this->orb_.in ())) - { - int argc = 0; - this->orb_ = CORBA::ORB_init (argc, 0, - this->orb_id_.in () - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - } - - CORBA::String_var operation = ri->operation (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; - - CORBA::Object_var target = ri->target (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; - - CORBA::String_var ior = - this->orb_->object_to_string (target.in () ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - -#if 0 - ACE_DEBUG ((LM_DEBUG, - "%s.received_exception " - "from \"%s\" on object: %s\n", - this->myname_, - operation.in (), - ior.in ())); -#endif /*if 0*/ - - // Check that the reply service context was received 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, - " Received reply service context: %s\n", - buf)); -#endif /*if 0*/ - - if (ACE_OS::strcmp (buf, reply_msg) != 0) - { - ACE_ERROR ((LM_ERROR, - "ERROR: Expected reply service context to be: %s\n", - reply_msg)); - } - - // Check that no one has messed with the request service context. - 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: Expected request service context to be: %s.\n" - " Got: %s\n", - request_msg, - buf2)); - } -} - diff --git a/TAO/tests/Portable_Interceptors/Service_Context_Manipulation/client_interceptor.h b/TAO/tests/Portable_Interceptors/Service_Context_Manipulation/client_interceptor.h deleted file mode 100644 index 10fcbd62f70..00000000000 --- a/TAO/tests/Portable_Interceptors/Service_Context_Manipulation/client_interceptor.h +++ /dev/null @@ -1,78 +0,0 @@ -// -*- 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 - 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/Service_Context_Manipulation/run_test.pl b/TAO/tests/Portable_Interceptors/Service_Context_Manipulation/run_test.pl deleted file mode 100755 index fa204e17d8c..00000000000 --- a/TAO/tests/Portable_Interceptors/Service_Context_Manipulation/run_test.pl +++ /dev/null @@ -1,50 +0,0 @@ -eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' - & eval 'exec perl -S $0 $argv:q' - if 0; - -# $Id$ -# -*- perl -*- - -use lib '../../../../bin'; -use PerlACE::Run_Test; - -$status = 0; -$file = PerlACE::LocalFile ("test.ior"); - -unlink $file; - -if (PerlACE::is_vxworks_test()) { - $SV = new PerlACE::ProcessVX ("server", "-o test.ior"); -} -else { - $SV = new PerlACE::Process ("server", "-o $file"); -} -$CL = new PerlACE::Process ("client", "-f file://$file"); - -print STDERR "\n\n==== Running interceptor test\n"; - -$SV->Spawn (); - -if (PerlACE::waitforfile_timed ($file, 15) == -1) { - print STDERR "ERROR: cannot find file <$file>\n"; - $SV->Kill (); - exit 1; -} - -$client = $CL->SpawnWaitKill (60); - -if ($client != 0) { - print STDERR "ERROR: client returned $client\n"; - $status = 1; -} - -$server = $SV->WaitKill (5); - -if ($server != 0) { - print STDERR "ERROR: server returned $server\n"; - $status = 1; -} - -unlink $file; - -exit $status; diff --git a/TAO/tests/Portable_Interceptors/Service_Context_Manipulation/server.cpp b/TAO/tests/Portable_Interceptors/Service_Context_Manipulation/server.cpp deleted file mode 100644 index bb361528705..00000000000 --- a/TAO/tests/Portable_Interceptors/Service_Context_Manipulation/server.cpp +++ /dev/null @@ -1,141 +0,0 @@ -// $Id$ - -#include "ace/Get_Opt.h" -#include "test_i.h" -#include "Server_ORBInitializer.h" - -#include "tao/ORBInitializer_Registry.h" -#include "ace/OS_NS_stdio.h" - -ACE_RCSID (Service_Context_Manipulation, - server, - "$Id$") - -const char *ior_output_file = "test.ior"; - -int -parse_args (int argc, char *argv[]) -{ - ACE_Get_Opt get_opts (argc, argv, "o:"); - int c; - - while ((c = get_opts ()) != -1) - switch (c) - { - case 'o': - ior_output_file = get_opts.opt_arg (); - break; - case '?': - default: - ACE_ERROR_RETURN ((LM_ERROR, - "usage: %s " - "-o <iorfile>" - "\n", - argv [0]), - -1); - } - // Indicates sucessful parsing of the command line - return 0; -} - -int -main (int argc, char *argv[]) -{ - ACE_TRY_NEW_ENV - { - PortableInterceptor::ORBInitializer_ptr temp_initializer; - - ACE_NEW_RETURN (temp_initializer, - Server_ORBInitializer, - -1); // No exceptions yet! - PortableInterceptor::ORBInitializer_var initializer = - temp_initializer; - - PortableInterceptor::register_orb_initializer (initializer.in () - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - // Now we can create the ORB - CORBA::ORB_var orb = - CORBA::ORB_init (argc, argv, "" ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - CORBA::Object_var poa_object = - orb->resolve_initial_references ("RootPOA" ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - if (CORBA::is_nil (poa_object.in ())) - ACE_ERROR_RETURN ((LM_ERROR, - " (%P|%t) Unable to initialize the POA.\n"), - 1); - - PortableServer::POA_var root_poa = - PortableServer::POA::_narrow (poa_object.in () ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - PortableServer::POAManager_var poa_manager = - root_poa->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - - poa_manager->activate (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - - if (parse_args (argc, argv) != 0) - return 1; - - Visual_i server_impl (orb.in ()); - - PortableServer::ObjectId_var id = - root_poa->activate_object (&server_impl - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - CORBA::Object_var test_obj = - root_poa->id_to_reference (id.in () - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - Test_Interceptors::Visual_var server = - Test_Interceptors::Visual::_narrow (test_obj.in () - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - CORBA::String_var ior = - orb->object_to_string (server.in () ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - ACE_DEBUG ((LM_DEBUG, - "Test_Interceptors::Visual: <%s>\n", - ior.in ())); - - // If the ior_output_file exists, output the ior to it - if (ior_output_file != 0) - { - FILE *output_file= ACE_OS::fopen (ior_output_file, "w"); - if (output_file == 0) - ACE_ERROR_RETURN ((LM_ERROR, - "Cannot open output file for writing IOR: %s", - ior_output_file), - 1); - ACE_OS::fprintf (output_file, "%s", ior.in ()); - ACE_OS::fclose (output_file); - } - - orb->run (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - - ACE_DEBUG ((LM_DEBUG, "event loop finished\n")); - - root_poa->destroy (1, 1 ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - } - ACE_CATCHANY - { - ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, - "Caught exception in server:"); - return 1; - } - ACE_ENDTRY; - - return 0; -} diff --git a/TAO/tests/Portable_Interceptors/Service_Context_Manipulation/server_interceptor.cpp b/TAO/tests/Portable_Interceptors/Service_Context_Manipulation/server_interceptor.cpp deleted file mode 100644 index d253b1ab045..00000000000 --- a/TAO/tests/Portable_Interceptors/Service_Context_Manipulation/server_interceptor.cpp +++ /dev/null @@ -1,224 +0,0 @@ -// $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 deleted file mode 100644 index 9549d70f549..00000000000 --- a/TAO/tests/Portable_Interceptors/Service_Context_Manipulation/server_interceptor.h +++ /dev/null @@ -1,74 +0,0 @@ -// -*- 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 */ diff --git a/TAO/tests/Portable_Interceptors/Service_Context_Manipulation/test.idl b/TAO/tests/Portable_Interceptors/Service_Context_Manipulation/test.idl deleted file mode 100644 index 79a06a14351..00000000000 --- a/TAO/tests/Portable_Interceptors/Service_Context_Manipulation/test.idl +++ /dev/null @@ -1,48 +0,0 @@ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// TAO/tests/Interceptors -// -// = FILENAME -// test.idl -// -// = DESCRIPTION -// Simple IDL file to test portable interceptor support. -// -// = AUTHORS -// Nanbor Wang <nanbor@cs.wustl.edu> -// -// ============================================================================ - -module Test_Interceptors -{ - exception Silly - {}; - - interface Visual - { - // = TITLE - // A test idl for checking interceptor visually. - // - // = DESCRIPTION - // - - void normal (in long arg); - // Normal operation. - - void nothing (); - // Normal operation without return. - - void user () - raises (Silly); - // throws a user exception. - - void system (); - // thows a system exception. - - oneway void shutdown (); - // shutdown the ORB - }; -}; diff --git a/TAO/tests/Portable_Interceptors/Service_Context_Manipulation/test_i.cpp b/TAO/tests/Portable_Interceptors/Service_Context_Manipulation/test_i.cpp deleted file mode 100644 index 503c7a5b423..00000000000 --- a/TAO/tests/Portable_Interceptors/Service_Context_Manipulation/test_i.cpp +++ /dev/null @@ -1,53 +0,0 @@ -// $Id$ - -#include "test_i.h" - -ACE_RCSID (Service_Context_Manipulation, - test_i, - "$Id$") - - -Visual_i::Visual_i (CORBA::ORB_ptr orb) - : orb_ (CORBA::ORB::_duplicate (orb)) -{ -} - -void -Visual_i::normal (CORBA::Long arg - ACE_ENV_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - ACE_DEBUG ((LM_DEBUG, "Visual::normal called with %d\n", arg)); -} - -void -Visual_i::nothing (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - ACE_DEBUG ((LM_DEBUG, "Visual::nothing\n")); -} - -void -Visual_i::user (ACE_ENV_SINGLE_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - Test_Interceptors::Silly)) -{ - ACE_DEBUG ((LM_DEBUG, "Visual::user, throwing Silly\n")); - ACE_THROW (Test_Interceptors::Silly ()); -} - -void -Visual_i::system (ACE_ENV_SINGLE_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - ACE_DEBUG ((LM_DEBUG, "Visual::user, throwing INV_OBJREF\n")); - ACE_THROW (CORBA::INV_OBJREF ()); -} - -void -Visual_i::shutdown (ACE_ENV_SINGLE_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - this->orb_->shutdown (0 ACE_ENV_ARG_PARAMETER); - ACE_CHECK; -} diff --git a/TAO/tests/Portable_Interceptors/Service_Context_Manipulation/test_i.h b/TAO/tests/Portable_Interceptors/Service_Context_Manipulation/test_i.h deleted file mode 100644 index 5a6df58c457..00000000000 --- a/TAO/tests/Portable_Interceptors/Service_Context_Manipulation/test_i.h +++ /dev/null @@ -1,55 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file test_i.h - * - * $Id$ - * - * @author Nanbor Wang - */ -//============================================================================= - - -#ifndef TAO_INTERCEPTOR_TEST_I_H -#define TAO_INTERCEPTOR_TEST_I_H - -#include "testS.h" - -/** - * @class Visual_i - * - * Implements the Visual interface in test.idl - */ -class Visual_i : public POA_Test_Interceptors::Visual -{ - -public: - - Visual_i (CORBA::ORB_ptr orb); - - void normal (CORBA::Long arg - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - void nothing (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - void user (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException, - Test_Interceptors::Silly)); - - void system (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - void shutdown (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - -private: - - /// The ORB pseudo-reference (for shutdown). - CORBA::ORB_var orb_; - -}; - -#endif /* TAO_INTERCEPTOR_TEST_I_H */ diff --git a/TAO/tests/Portable_Interceptors/Slot/PI_Slot.mpc b/TAO/tests/Portable_Interceptors/Slot/PI_Slot.mpc deleted file mode 100644 index 2ae15155c7b..00000000000 --- a/TAO/tests/Portable_Interceptors/Slot/PI_Slot.mpc +++ /dev/null @@ -1,7 +0,0 @@ -// $Id$ - -project(*driver): orbsvcsexe, pi_server, interceptors { - Source_Files { - driver.cpp - } -} diff --git a/TAO/tests/Portable_Interceptors/Slot/driver.cpp b/TAO/tests/Portable_Interceptors/Slot/driver.cpp deleted file mode 100644 index b7d2b320500..00000000000 --- a/TAO/tests/Portable_Interceptors/Slot/driver.cpp +++ /dev/null @@ -1,64 +0,0 @@ -// file : Slot/driver.cpp -// author : Boris Kolpackov <boris@kolpackov.net> -// cvs-id : $Id$ - -#include "tao/PI/PI.h" -#include "tao/LocalObject.h" -#include "tao/ORBInitializer_Registry.h" - -PortableInterceptor::SlotId slot_id; - -class ORB_Initializer : public virtual PortableInterceptor::ORBInitializer, - public virtual TAO_Local_RefCounted_Object -{ -public: - virtual void - pre_init (PortableInterceptor::ORBInitInfo_ptr) throw (CORBA::SystemException) - { - } - - virtual void - post_init (PortableInterceptor::ORBInitInfo_ptr info) throw (CORBA::SystemException) - { - slot_id = info->allocate_slot_id (); - ACE_DEBUG ((LM_DEBUG, "Allocated slot with id %d.\n", slot_id)); - } -}; - -int -main (int argc, char *argv[]) -{ - - try - { - PortableInterceptor::ORBInitializer_var orb_initializer = new ORB_Initializer (); - PortableInterceptor::register_orb_initializer (orb_initializer.in ()); - - CORBA::ORB_var orb = CORBA::ORB_init (argc, argv); - - CORBA::Object_var pic_obj = orb->resolve_initial_references ("PICurrent"); - PortableInterceptor::Current_var pic ( - PortableInterceptor::Current::_narrow (pic_obj.in ())); - - CORBA::Any in; - in <<= CORBA::ULong (1); - pic->set_slot (slot_id, in); - - CORBA::ULong v (0); - CORBA::Any_var out = pic->get_slot (slot_id); - out >>= v; - - if (v != 1) - { - ACE_ERROR ((LM_ERROR, "ERROR: Slot value was not preserved.\n")); - return 1; - } - } - catch (PortableInterceptor::InvalidSlot const&) - { - ACE_ERROR ((LM_ERROR, "ERROR: Caught InvalidSlot exception.\n")); - return 1; - } - - return 0; -} diff --git a/TAO/tests/Portable_Interceptors/Slot/run_test.pl b/TAO/tests/Portable_Interceptors/Slot/run_test.pl deleted file mode 100755 index f6cd92fdcf5..00000000000 --- a/TAO/tests/Portable_Interceptors/Slot/run_test.pl +++ /dev/null @@ -1,26 +0,0 @@ -eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' - & eval 'exec perl -S $0 $argv:q' - if 0; - -# $Id$ -# -*- perl -*- - -use lib '../../../../bin'; -use PerlACE::Run_Test; - -if (PerlACE::is_vxworks_test()) { - $CL = new PerlACE::ProcessVX ("driver"); -} -else { - $CL = new PerlACE::Process ("driver"); -} -print STDERR "\n==== Running Slot test ====\n"; - -$client = $CL->SpawnWaitKill (5); - -if ($client != 0) { - print STDERR "ERROR: driver returned $client\n"; - $status = 1; -} - -exit $status; |