diff options
author | bala <balanatarajan@users.noreply.github.com> | 2004-09-16 14:31:58 +0000 |
---|---|---|
committer | bala <balanatarajan@users.noreply.github.com> | 2004-09-16 14:31:58 +0000 |
commit | b9574ac5379ca445bbc1b27174762f8fb87381e4 (patch) | |
tree | e51688f0c4930da79db9f91a1f9581e00b742d42 | |
parent | 02a337f4ab74a7cf97f46002383e7306e2f72551 (diff) | |
download | ATCD-b9574ac5379ca445bbc1b27174762f8fb87381e4.tar.gz |
ChangeLogTag:Thu Sep 16 09:28:10 2004 Balachandran Natarajan <bala@dre.vanderbilt.edu>
-rw-r--r-- | TAO/ChangeLog | 30 | ||||
-rw-r--r-- | TAO/orbsvcs/orbsvcs/PortableGroup/MIOP.cpp | 21 | ||||
-rw-r--r-- | TAO/orbsvcs/orbsvcs/PortableGroup/MIOP.h | 49 | ||||
-rw-r--r-- | TAO/orbsvcs/orbsvcs/PortableGroup/PortableGroup_Loader.cpp | 21 | ||||
-rw-r--r-- | TAO/orbsvcs/tests/Miop/McastHello/README | 16 | ||||
-rw-r--r-- | TAO/orbsvcs/tests/Miop/McastHello/server.conf | 4 | ||||
-rw-r--r-- | TAO/orbsvcs/tests/Miop/McastHello/server.cpp | 3 |
7 files changed, 136 insertions, 8 deletions
diff --git a/TAO/ChangeLog b/TAO/ChangeLog index 2bf24d39054..b52d4d0c3f9 100644 --- a/TAO/ChangeLog +++ b/TAO/ChangeLog @@ -1,3 +1,33 @@ +Thu Sep 16 09:28:10 2004 Balachandran Natarajan <bala@dre.vanderbilt.edu> + + * orbsvcs/orbsvcs/PortableGroup/MIOP.cpp: + * orbsvcs/orbsvcs/PortableGroup/MIOP.h: + + New file that has a magic static constructor, which when added + to the application source will load UIPMC protocl factory for + static builds. + + * orbsvcs/orbsvcs/PortableGroup/PortableGroup_Loader.cpp: + + Cosmetic fixes. + + * orbsvcs/tests/Miop/McastHello/server.conf: + + Commented out the dynamic parts of the service + configurator. Just retain the static directives. + + * orbsvcs/tests/Miop/McastHello/server.cpp: + + #included MIOP.h + + * orbsvcs/tests/Miop/McastHello/README: + + Updated the file with info on static and dynamic library + configuration of MIOP. + + Thanks to Rob Boyer <RBOYER at euphonix dot com> for motivating + this change. + Thu Sep 16 10:55:12 UTC 2004 Johnny Willemsen <jwillemsen@remedy.nl> * tao/RTCORBA/RTCORBA.pidl: diff --git a/TAO/orbsvcs/orbsvcs/PortableGroup/MIOP.cpp b/TAO/orbsvcs/orbsvcs/PortableGroup/MIOP.cpp new file mode 100644 index 00000000000..41daec0ca8b --- /dev/null +++ b/TAO/orbsvcs/orbsvcs/PortableGroup/MIOP.cpp @@ -0,0 +1,21 @@ +#include "MIOP.h" +#include "UIPMC_Factory.h" +#include "ace/Service_Config.h" +#include "PortableGroup_Loader.h" + +ACE_RCSID (PortableGroup, + UIPMC_Factory, + "$Id$") + +namespace TAO +{ + /*static*/ int + MIOP_Loader::Initializer (void) + { + /*ACE_Service_Config::process_directive ( + ace_svc_desc_TAO_PortableGroup_Loader); + */ + return ACE_Service_Config::process_directive ( + ace_svc_desc_TAO_UIPMC_Protocol_Factory); + } +} diff --git a/TAO/orbsvcs/orbsvcs/PortableGroup/MIOP.h b/TAO/orbsvcs/orbsvcs/PortableGroup/MIOP.h new file mode 100644 index 00000000000..09d81723188 --- /dev/null +++ b/TAO/orbsvcs/orbsvcs/PortableGroup/MIOP.h @@ -0,0 +1,49 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file MIOP.h + * + * $Id$ + * + * @author Bala Natarajan + */ +//============================================================================= +#ifndef TAO_MIOP_H +#define TAO_MIOP_H +#include /**/ "ace/pre.h" + +#include "portablegroup_export.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +namespace TAO +{ + + class TAO_PortableGroup_Export MIOP_Loader + { + public: + /// Used to force the insertion of UIPMC_Factory in the service + /// configurator. + static int Initializer (void); + }; + +#if defined(ACE_HAS_BROKEN_STATIC_CONSTRUCTORS) + +typedef int (*Module_Initializer) (void); + +static Module_Initializer +Requires_MIOP_Initializer = &MIOP_Loader::Initializer; + +#else + +static int +Requires_MIOP_Initializer = MIOP_Loader::Initializer (); + +#endif /* ACE_HAS_BROKEN_STATIC_CONSTRUCTORS */ +} + +#include /**/ "ace/post.h" +#endif /*TAO_MIOP_H*/ diff --git a/TAO/orbsvcs/orbsvcs/PortableGroup/PortableGroup_Loader.cpp b/TAO/orbsvcs/orbsvcs/PortableGroup/PortableGroup_Loader.cpp index f632dcd0e42..5b1be7f6b8b 100644 --- a/TAO/orbsvcs/orbsvcs/PortableGroup/PortableGroup_Loader.cpp +++ b/TAO/orbsvcs/orbsvcs/PortableGroup/PortableGroup_Loader.cpp @@ -4,10 +4,11 @@ #include "PortableGroup_Loader.h" #include "PortableGroup_ORBInitializer.h" +#include "ace/Dynamic_Service.h" #include "tao/ORB_Core.h" -ACE_RCSID (PortableGroup, - PortableGroup_Loader, +ACE_RCSID (PortableGroup, + PortableGroup_Loader, "$Id$") TAO_PortableGroup_Loader::TAO_PortableGroup_Loader (void) @@ -18,8 +19,9 @@ int TAO_PortableGroup_Loader::init (int /*argc*/, char* /*argv*/ []) { - ACE_TRACE ("TAO_PortableGroup_Loader::init"); + ACE_DEBUG ((LM_DEBUG, " BIGGER DEAL AMBA \n")); + ACE_TRACE ("TAO_PortableGroup_Loader::init"); // Register the ORB initializer. ACE_TRY_NEW_ENV { @@ -56,10 +58,17 @@ TAO_PortableGroup_Loader::init (int /*argc*/, int TAO_PortableGroup_Loader::Initializer (void) { - ACE_Service_Config::static_svcs ()-> - insert (&ace_svc_desc_TAO_PortableGroup_Loader); + ACE_Service_Config::process_directive (ace_svc_desc_TAO_PortableGroup_Loader); + TAO_PortableGroup_Loader *tmp = + ACE_Dynamic_Service<TAO_PortableGroup_Loader>::instance ( + "PortableGroup_Loader"); - return 0; + if (tmp != 0) + { + return tmp->init (0, 0); + } + + return -1; } ACE_STATIC_SVC_DEFINE (TAO_PortableGroup_Loader, diff --git a/TAO/orbsvcs/tests/Miop/McastHello/README b/TAO/orbsvcs/tests/Miop/McastHello/README index d96228dc866..405dcc094cd 100644 --- a/TAO/orbsvcs/tests/Miop/McastHello/README +++ b/TAO/orbsvcs/tests/Miop/McastHello/README @@ -15,4 +15,20 @@ $ ./run_test.pl the script returns 0 if the test was successful. +The test has some unique features that should be noted by +users. Firstly, server.cpp includes MIOP.h, which has some magic for +loading MIOP protocol in static builds. Secondly, the server.conf has +a directive for loading the right protocol factory. Both of them are +required for static builds in addition to linking with the +TAO_PortableGroup library. + +However for dynamic builds things are different + +. One need not include MIOP.h. Including MIOP.h will require linking + in the TAO_PortableGroup library + +. The entries in the svc.conf should have dynamic directives. In + server.conf you would be required to remove commented parts and run + the test. + */ diff --git a/TAO/orbsvcs/tests/Miop/McastHello/server.conf b/TAO/orbsvcs/tests/Miop/McastHello/server.conf index 38dd6e5896c..d509909846c 100644 --- a/TAO/orbsvcs/tests/Miop/McastHello/server.conf +++ b/TAO/orbsvcs/tests/Miop/McastHello/server.conf @@ -1,4 +1,4 @@ -dynamic UIPMC_Factory Service_Object * TAO_PortableGroup:_make_TAO_UIPMC_Protocol_Factory() "" +#dynamic UIPMC_Factory Service_Object * TAO_PortableGroup:_make_TAO_UIPMC_Protocol_Factory() "" static Resource_Factory "-ORBProtocolFactory IIOP_Factory -ORBProtocolFactory UIPMC_Factory" #static PortableGroup_Loader "" -dynamic PortableGroup_Loader Service_Object * TAO_PortableGroup:_make_TAO_PortableGroup_Loader() ""
\ No newline at end of file +#dynamic PortableGroup_Loader Service_Object * TAO_PortableGroup:_make_TAO_PortableGroup_Loader() "" diff --git a/TAO/orbsvcs/tests/Miop/McastHello/server.cpp b/TAO/orbsvcs/tests/Miop/McastHello/server.cpp index 711a9f53f1c..c71f26760f2 100644 --- a/TAO/orbsvcs/tests/Miop/McastHello/server.cpp +++ b/TAO/orbsvcs/tests/Miop/McastHello/server.cpp @@ -3,6 +3,7 @@ #include "McastHello.h" #include "ace/Get_Opt.h" #include "ace/OS_NS_stdio.h" +#include "orbsvcs/PortableGroup/MIOP.h" ACE_RCSID (McastHello, server, @@ -78,6 +79,8 @@ main (int argc, char *argv[]) // Get the group IOR. CORBA::String_var ior = CORBA::string_dup (group_ior); + + CORBA::Object_var group1 = orb->string_to_object (ior.in () ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; |