diff options
Diffstat (limited to 'TAO/orbsvcs/tests/Transport_Current/Framework')
12 files changed, 622 insertions, 0 deletions
diff --git a/TAO/orbsvcs/tests/Transport_Current/Framework/Client_Request_Interceptor.h b/TAO/orbsvcs/tests/Transport_Current/Framework/Client_Request_Interceptor.h index bbda0f5f7a2..1cd7bdebacd 100644 --- a/TAO/orbsvcs/tests/Transport_Current/Framework/Client_Request_Interceptor.h +++ b/TAO/orbsvcs/tests/Transport_Current/Framework/Client_Request_Interceptor.h @@ -286,3 +286,147 @@ namespace Test #endif /* _MSC_VER */ #endif /* CLIENT_REQUEST_INTERCEPTOR_H */ +// -*- C++ -*- + +//============================================================================= +/** + * @file Client_Request_Interceptor.h + * + * $Id$ + * + * Implementation header for the client request interceptor for the + * Transport::Current 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 */ + + +namespace Test +{ + + /// A metod doing the actual testing, so we could change it for the + /// different traits implementations + + typedef int (*TEST) (CORBA::ORB_ptr ACE_ENV_ARG_DECL_WITH_DEFAULTS); + + + /** + * @class Client_Request_Interceptor + * + * @brief Client request interceptor that exercises + * Transport::Current 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, + TEST test); + /** + * @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)); + //@} + + CORBA::Long interceptions (void); + + private: + void test_transport_current (const ACE_TCHAR* amethod ACE_ENV_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException, CORBA::UserException)); + + 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_; + + /// Synchronize internal state... + TAO_SYNCH_MUTEX lock_; + + /// Unique request ID + unsigned long requestID_; + + /// Test function + TEST test_; + }; + +}; // namespace Test + +#if defined(_MSC_VER) +#pragma warning(pop) +#endif /* _MSC_VER */ + +#endif /* CLIENT_REQUEST_INTERCEPTOR_H */ diff --git a/TAO/orbsvcs/tests/Transport_Current/Framework/Current_Test_Impl.h b/TAO/orbsvcs/tests/Transport_Current/Framework/Current_Test_Impl.h index dd73bc04c11..0f741dead1b 100644 --- a/TAO/orbsvcs/tests/Transport_Current/Framework/Current_Test_Impl.h +++ b/TAO/orbsvcs/tests/Transport_Current/Framework/Current_Test_Impl.h @@ -158,3 +158,83 @@ private: }; #endif /* CURRENT_TEST_IMPL_H */ +// -*- C++ -*- + +//============================================================================= +/** + * @file Current_Test_Impl.h + * + * $Id$ + * + * Implementation header for the "test" IDL interface for the + * TAO::TransportCurrent test. + * + * @author Iliyan Jeliazkov <iliyan@ociweb.com> + */ +//============================================================================= + +#ifndef CURRENT_TEST_IMPL_H +#define CURRENT_TEST_IMPL_H + +#include "Current_TestS.h" +#include "orbsvcs/Transport_Current/TCC.h" + +/** + * @class Current_Test_Impl + * + * @brief Simple test class. + * + * This class implements the "test" interface used in this test. + */ +class Current_Test_Impl : public virtual POA_TAO::Transport::CurrentTest +{ +public: + + /// Constructor. + Current_Test_Impl (CORBA::ORB_ptr orb, PortableServer::POA_ptr poa, int do_collocated_calls = 1); + + /// Destructor. + ~Current_Test_Impl (void); + + /// Main servant test method. + virtual void invoked_by_client (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 invoked_during_upcall (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)); + + virtual ::CORBA::Long self_test (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((::CORBA::SystemException)); + +public: + /// Reports if unexpected errors have been encountered for the + /// lifetime of the instance + bool is_successful (void) const; + +private: + void test_transport_current (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + /// Main servant test method. + void invoked_by_client_i (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((::CORBA::SystemException, TAO::Transport::NoContext)); + +private: + /// Pseudo-reference to the ORB. + CORBA::ORB_var orb_; + + /// Pseudo-reference to the POA (cache) + PortableServer::POA_var poa_; + + /// + int do_collocated_calls_; +}; + +#endif /* CURRENT_TEST_IMPL_H */ diff --git a/TAO/orbsvcs/tests/Transport_Current/Framework/Framework.mpc b/TAO/orbsvcs/tests/Transport_Current/Framework/Framework.mpc index 4dc6c02369a..2c6ea40e1ed 100644 --- a/TAO/orbsvcs/tests/Transport_Current/Framework/Framework.mpc +++ b/TAO/orbsvcs/tests/Transport_Current/Framework/Framework.mpc @@ -52,3 +52,30 @@ project(*Client): taoclient, tc, pi, dynamicinterface { Current_Test.idl } } +// -*- MPC -*- +// $Id$ + +project(*Server): taoserver, tc, pi_server { + Source_Files { + server.cpp + Current_Test_Impl.cpp + Server_Request_Interceptor.cpp + Tester.cpp + Server_Main.cpp + } + IDL_Files { + Current_Test.idl + } +} + +project(*Client): taoclient, tc, pi, dynamicinterface { + after += *Server + Source_Files { + Client_Request_Interceptor.cpp + client.cpp + Tester.cpp + } + IDL_Files { + Current_Test.idl + } +} diff --git a/TAO/orbsvcs/tests/Transport_Current/Framework/ORBInitializer_T.h b/TAO/orbsvcs/tests/Transport_Current/Framework/ORBInitializer_T.h index 7faa5e3d024..24f2cdb3a99 100644 --- a/TAO/orbsvcs/tests/Transport_Current/Framework/ORBInitializer_T.h +++ b/TAO/orbsvcs/tests/Transport_Current/Framework/ORBInitializer_T.h @@ -122,3 +122,65 @@ namespace Test #endif /* ORBINITIALIZER_T_H */ +// -*- C++ -*- + +//============================================================================= +/** + * @file ORBInitializer_T.h + * + * $Id$ + * + * @author Iliyan jeliazkov <iliyan@ociweb.com> + */ +//============================================================================= + +#ifndef ORBINITIALIZER_T_H +#define ORBINITIALIZER_T_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" */ + +namespace Test +{ + // A template class for ORBInitializer, which registers + // interceptors. Partial specializations exist to handle client and + // server request interceptors. + template <typename Interceptor> + class ORBInitializer : public PortableInterceptor::ORBInitializer + { + public: + ORBInitializer (typename Interceptor::_ptr_type interceptor) + : interceptor_ (Interceptor::_duplicate (interceptor)) + { + }; + + ~ORBInitializer (void) + { + }; + + virtual void pre_init(PortableInterceptor::ORBInitInfo* ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)) + { + }; + + virtual void post_init(PortableInterceptor::ORBInitInfo* ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + private: + typename Interceptor::_var_type interceptor_; + }; + +}; + +#endif /* ORBINITIALIZER_T_H */ + + diff --git a/TAO/orbsvcs/tests/Transport_Current/Framework/README b/TAO/orbsvcs/tests/Transport_Current/Framework/README index 4ffb7eaea5e..569b6f32794 100644 --- a/TAO/orbsvcs/tests/Transport_Current/Framework/README +++ b/TAO/orbsvcs/tests/Transport_Current/Framework/README @@ -42,3 +42,25 @@ By default, the client and server will each have only one thread. Use "-t N" parameter to override that. The "-n N" client-side parameter determines how many times a particular client thread will call the server. The default is 1. +This test intents to show the usage and the expected behavior of the +Transport Current framework. The topology is the same as in the basic +Hello test: a client invokes a method on the server and then shuts it +down and exits. The special features of the test is that it attempts +to obtain Transport Traits information, using the Transport Current. + +There are four basic contexts in which a Transport information can be +requested, by definition: + + * on the client side, outside client-side interceptor; + * client side, inside an interceptor; + * server side, inside an up-call; + * server side, inside an interceptor; + +The test implements the client and the server side interceptors that +simply call a test method when invoked. A simple interception count +serves to validate the expected behavior. + +By default, the client and server will each have only one thread. Use +"-t N" parameter to override that. The "-n N" client-side parameter +determines how many times a particular client thread will call the +server. The default is 1. diff --git a/TAO/orbsvcs/tests/Transport_Current/Framework/Server_Request_Interceptor.h b/TAO/orbsvcs/tests/Transport_Current/Framework/Server_Request_Interceptor.h index 14dac8f484c..f8ae3df150a 100644 --- a/TAO/orbsvcs/tests/Transport_Current/Framework/Server_Request_Interceptor.h +++ b/TAO/orbsvcs/tests/Transport_Current/Framework/Server_Request_Interceptor.h @@ -274,3 +274,141 @@ namespace Test #endif /* _MSC_VER */ #endif /* SERVER_REQUEST_INTERCEPTOR_H */ +// -*- 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 "Current_TestC.h" + +#include "orbsvcs/Transport_Current/TCC.h" +#include "tao/PortableInterceptorC.h" +#include "tao/LocalObject.h" +#include "tao/PI_Server/PI_Server.h" + +#if defined(_MSC_VER) +#pragma warning(push) +#pragma warning(disable:4250) +#endif /* _MSC_VER */ + +#include "ORBInitializer_T.h" + +namespace Test +{ + + /// A metod doing the actual testing, so we could change it for the + /// different traits implementations + + typedef int (*TEST) (CORBA::ORB_ptr ACE_ENV_ARG_DECL_WITH_DEFAULTS); + + /** + * @class Server_Request_Interceptor + * + * @brief Simple concrete server request interceptor. + * + */ + class Server_Request_Interceptor + : public virtual PortableInterceptor::ServerRequestInterceptor, + public virtual TAO_Local_RefCounted_Object + { + public: + + /// Constructor. + Server_Request_Interceptor (const char*orb_id, TEST test); + + /// Destructor. + virtual ~Server_Request_Interceptor (void); + + virtual void test_transport_current (const char* amethod + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + virtual bool self_test (void) const; + + /** + * @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: + + /// The number of requests intercepted by this interceptor. + CORBA::ULong request_count_; + + CORBA::String_var orb_id_; + + TEST test_; + + }; + + // A specialization to handle server-side interceptor registration + template <> + void ORBInitializer<PortableInterceptor::ServerRequestInterceptor>::post_init + (PortableInterceptor::ORBInitInfo* oii ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); +}; + +#if defined(_MSC_VER) +#pragma warning(pop) +#endif /* _MSC_VER */ + +#endif /* SERVER_REQUEST_INTERCEPTOR_H */ diff --git a/TAO/orbsvcs/tests/Transport_Current/Framework/client-static.conf b/TAO/orbsvcs/tests/Transport_Current/Framework/client-static.conf index 4b547610207..113ddafe1a0 100644 --- a/TAO/orbsvcs/tests/Transport_Current/Framework/client-static.conf +++ b/TAO/orbsvcs/tests/Transport_Current/Framework/client-static.conf @@ -1,2 +1,3 @@ static TAO_Transport_Current_Loader "" static TAO_Transport_Current_Loader "" +static TAO_Transport_Current_Loader "" diff --git a/TAO/orbsvcs/tests/Transport_Current/Framework/client.conf b/TAO/orbsvcs/tests/Transport_Current/Framework/client.conf index 5effabfb371..4c0725eb55c 100644 --- a/TAO/orbsvcs/tests/Transport_Current/Framework/client.conf +++ b/TAO/orbsvcs/tests/Transport_Current/Framework/client.conf @@ -1,2 +1,3 @@ dynamic TAO_Transport_Current_Loader Service_Object * TAO_TC:_make_TAO_Transport_Current_Loader() "" dynamic TAO_Transport_Current_Loader Service_Object * TAO_TC:_make_TAO_Transport_Current_Loader() "" +dynamic TAO_Transport_Current_Loader Service_Object * TAO_TC:_make_TAO_Transport_Current_Loader() "" diff --git a/TAO/orbsvcs/tests/Transport_Current/Framework/run_test.pl b/TAO/orbsvcs/tests/Transport_Current/Framework/run_test.pl index 8e01498fbb7..4605c491ace 100755 --- a/TAO/orbsvcs/tests/Transport_Current/Framework/run_test.pl +++ b/TAO/orbsvcs/tests/Transport_Current/Framework/run_test.pl @@ -116,3 +116,62 @@ if ($server != 0) { unlink $iorfile; exit $status; +eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' + & eval 'exec perl -S $0 $argv:q' + if 0; + +# $Id$ +# -*- perl -*- + +use lib "$ENV{ACE_ROOT}/bin"; +use PerlACE::Run_Test; + +$status = 0; + +#$confmod = "-static"; + +$iorfile = PerlACE::LocalFile ("server.ior"); +$confserver = PerlACE::LocalFile ("server$confmod.conf"); +$confclient = PerlACE::LocalFile ("client$confmod.conf"); +unlink $iorfile; + +if (PerlACE::is_vxworks_test()) { + $SV = new PerlACE::ProcessVX ("server", + "@ARGV -ORBSvcConf server.conf -o server.ior"); +} +else { + $SV = new PerlACE::Process ("server", + "@ARGV -ORBSvcConf $confserver -o $iorfile"); +} + +$CL = new PerlACE::Process ("client", + "@ARGV -n 1 -ORBSvcConf $confclient -k file://$iorfile"); + +print STDERR $SV->CommandLine()."\n"; +$SV->Spawn (); + +if (PerlACE::waitforfile_timed ($iorfile, + $PerlACE::wait_interval_for_process_creation) == -1) { + print STDERR "$0: ERROR: cannot find file <$iorfile>\n"; + $SV->Kill (); $SV->TimedWait (1); + exit 1; +} + +print STDERR $CL->CommandLine()."\n"; +$client = $CL->SpawnWaitKill (300); + +if ($client != 0) { + print STDERR "$0: ERROR: client returned $client\n"; + $status = 1; +} + +$server = $SV->WaitKill (10); + +if ($server != 0) { + print STDERR "$0: ERROR: server returned $server\n"; + $status = 1; +} + +unlink $iorfile; + +exit $status; diff --git a/TAO/orbsvcs/tests/Transport_Current/Framework/server-static.conf b/TAO/orbsvcs/tests/Transport_Current/Framework/server-static.conf index 4b547610207..113ddafe1a0 100644 --- a/TAO/orbsvcs/tests/Transport_Current/Framework/server-static.conf +++ b/TAO/orbsvcs/tests/Transport_Current/Framework/server-static.conf @@ -1,2 +1,3 @@ static TAO_Transport_Current_Loader "" static TAO_Transport_Current_Loader "" +static TAO_Transport_Current_Loader "" diff --git a/TAO/orbsvcs/tests/Transport_Current/Framework/server.conf b/TAO/orbsvcs/tests/Transport_Current/Framework/server.conf index 5effabfb371..4c0725eb55c 100644 --- a/TAO/orbsvcs/tests/Transport_Current/Framework/server.conf +++ b/TAO/orbsvcs/tests/Transport_Current/Framework/server.conf @@ -1,2 +1,3 @@ dynamic TAO_Transport_Current_Loader Service_Object * TAO_TC:_make_TAO_Transport_Current_Loader() "" dynamic TAO_Transport_Current_Loader Service_Object * TAO_TC:_make_TAO_Transport_Current_Loader() "" +dynamic TAO_Transport_Current_Loader Service_Object * TAO_TC:_make_TAO_Transport_Current_Loader() "" diff --git a/TAO/orbsvcs/tests/Transport_Current/Framework/simple.cpp b/TAO/orbsvcs/tests/Transport_Current/Framework/simple.cpp index 05243f8af20..f3845750338 100644 --- a/TAO/orbsvcs/tests/Transport_Current/Framework/simple.cpp +++ b/TAO/orbsvcs/tests/Transport_Current/Framework/simple.cpp @@ -170,3 +170,89 @@ main (int argc, char *argv[]) return testCurrentLoader (argc, argv) || testCurrentORBInitializer (argc, argv); } +// -*- C++ -*- + +#include "tao/ORB.h" +#include "tao/Object.h" + +#include "ace/Service_Config.h" +#include "ace/Dynamic_Service.h" + +ACE_RCSID (Transport_Current, + simple, + "$Id$") + +int +testCurrentORBInitializer (int argc, char *argv[]) +{ + CORBA::ORB_var orb = CORBA::ORB_init (argc, argv); + + if (orb.in () == 0) + ACE_ERROR_RETURN ((LM_ERROR, ACE_TEXT ("Unable to create orb\n")), -1); + + CORBA::Object_var obj = + orb->resolve_initial_references ("TAO::Transport::Current" + ACE_ENV_ARG_PARAMETER); + + if (obj.in () == 0) + ACE_ERROR_RETURN ((LM_ERROR, ACE_TEXT ("Unable to get the Transport Current\n")), -1); + + + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("testCurrentORBInitializer: OK\n"))); + return 0; +} + + +int +testCurrentLoader (int, char *[]) +{ + + ACE_Service_Object *factory = 0; + + factory = ACE_Dynamic_Service<ACE_Service_Object>::instance + (ACE_TEXT ("TAO_Transport_Current_Loader")); + + int done = +#if defined (TAO_AS_STATIC_LIBS) + true; +#else + (factory != 0); +#endif /* TAO_AS_STATIC_LIBS */ + + if (factory == 0) + { + if (done) + ACE_ERROR_RETURN ((LM_ERROR, + ACE_TEXT ("Unable to instantiate TAO::Transport::Current_Factory\n")), + -1); + else + { + +#if !defined (TAO_AS_STATIC_LIBS) + int ret = ACE_Service_Config::process_directive + (ACE_DYNAMIC_SERVICE_DIRECTIVE("TAO_Transport_Current_Loader", + "TAO_Transport_Current", + "_make_TAO_Transport_Current_Loader", + "")); + ACE_ASSERT (ret == 0); + + factory = ACE_Dynamic_Service<ACE_Service_Object>::instance + (ACE_TEXT ("TAO_Transport_Current_Loader")); + +#endif /* !TAO_AS_STATIC_LIBS */ + } + } + + // ACE_ASSERT (factory != 0); + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("testCurrentLoader: OK\n"))); + return 0; + +} + + +int +main (int argc, char *argv[]) +{ + return testCurrentLoader (argc, argv) + || testCurrentORBInitializer (argc, argv); +} |