diff options
author | yamuna <yamuna@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2003-06-27 17:03:09 +0000 |
---|---|---|
committer | yamuna <yamuna@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2003-06-27 17:03:09 +0000 |
commit | 23d6c091e5c810b11052d9ebcdf934dfea1fe112 (patch) | |
tree | 8c837f7118cddc3576a59048f4c6a8ba7a58d479 | |
parent | 5c597a85abcc50838eeb7d727aaced881538c793 (diff) | |
download | ATCD-23d6c091e5c810b11052d9ebcdf934dfea1fe112.tar.gz |
ChangelogTag: Thu Jun 26 22:34:10 2003 Yamuna Krishnamurthy <yamuna@oomworks.com>
-rw-r--r-- | TAO/tao/RTScheduling/RTScheduler_Loader.cpp | 79 | ||||
-rw-r--r-- | TAO/tao/RTScheduling/RTScheduler_Loader.h | 50 |
2 files changed, 129 insertions, 0 deletions
diff --git a/TAO/tao/RTScheduling/RTScheduler_Loader.cpp b/TAO/tao/RTScheduling/RTScheduler_Loader.cpp new file mode 100644 index 00000000000..9609c705bd4 --- /dev/null +++ b/TAO/tao/RTScheduling/RTScheduler_Loader.cpp @@ -0,0 +1,79 @@ + +// $Id$ + +#include "RTScheduler_Loader.h" +#include "RTScheduler_Initializer.h" + +#include "tao/debug.h" +#include "tao/ORB_Core.h" +#include "tao/ORBInitializer_Registry.h" + +ACE_RCSID (TAO, RTScheduler_Loader, "$Id$") + + +TAO_RTScheduler_Loader::TAO_RTScheduler_Loader (void) +{ +} + +TAO_RTScheduler_Loader::~TAO_RTScheduler_Loader (void) +{ + +} + +int +TAO_RTScheduler_Loader::init (int /*argc*/, + ACE_TCHAR* /*argv*/[]) +{ + ACE_TRACE ("TAO_RTScheduler_Loader::init"); + + static int initialized = 0; + + // Only allow initialization once. + if (initialized) + return 0; + + initialized = 1; + + // Register the ORB initializer. + ACE_TRY_NEW_ENV + { + PortableInterceptor::ORBInitializer_ptr temp_orb_initializer = + PortableInterceptor::ORBInitializer::_nil (); + PortableInterceptor::ORBInitializer_var orb_initializer; + + /// Register the RTCORBA ORBInitializer. + ACE_NEW_THROW_EX (temp_orb_initializer, + TAO_RTScheduler_ORB_Initializer, + CORBA::NO_MEMORY ( + CORBA::SystemException::_tao_minor_code ( + TAO_DEFAULT_MINOR_CODE, + ENOMEM), + CORBA::COMPLETED_NO)); + ACE_TRY_CHECK; + orb_initializer = temp_orb_initializer; + + PortableInterceptor::register_orb_initializer (orb_initializer.in () + ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + } + ACE_CATCHANY + { + ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, + "Unexpected exception caught while initializing the RTScheduler:"); + return 1; + } + ACE_ENDTRY; + + return 0; +} + +///////////////////////////////////////////////////////////////////// + +ACE_FACTORY_DEFINE (TAO_RTScheduler, TAO_RTScheduler_Loader) +ACE_STATIC_SVC_DEFINE (TAO_RTScheduler_Loader, + ACE_TEXT ("RTScheduler_Loader"), + ACE_SVC_OBJ_T, + &ACE_SVC_NAME (TAO_RTScheduler_Loader), + ACE_Service_Type::DELETE_THIS + | ACE_Service_Type::DELETE_OBJ, + 0) diff --git a/TAO/tao/RTScheduling/RTScheduler_Loader.h b/TAO/tao/RTScheduling/RTScheduler_Loader.h new file mode 100644 index 00000000000..64d62f8c75b --- /dev/null +++ b/TAO/tao/RTScheduling/RTScheduler_Loader.h @@ -0,0 +1,50 @@ +/* -*- C++ -*- */ + +//============================================================================= +/** + * @file RTScheduler_Loader.h + * + * $Id$ + * + * Header file for Loading RTScheduler. + * + * + * @author Yamuna Krishnamurthy <yamuna@oomworks.com> + */ +//============================================================================= + +#ifndef TAO_RTSCHEDULER_LOADER_H +#define TAO_RTSCHEDULER_LOADER_H +#include "ace/pre.h" + +#include "rtscheduler_export.h" + + +#include "ace/Service_Object.h" +#include "ace/Service_Config.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +class TAO_ORB_Core; + +class TAO_RTScheduler_Export TAO_RTScheduler_Loader : public ACE_Service_Object +{ +public: + /// Constructor. + TAO_RTScheduler_Loader (void); + + /// Destructor. + virtual ~TAO_RTScheduler_Loader (void); + + /// Initialize the RTScheduler loader hooks. + virtual int init (int argc, + ACE_TCHAR* []); +}; + +ACE_STATIC_SVC_DECLARE_EXPORT (TAO_RTScheduler, TAO_RTScheduler_Loader) +ACE_FACTORY_DECLARE (TAO_RTScheduler, TAO_RTScheduler_Loader) + +#include "ace/post.h" +#endif /* TAO_RTSCHEDULER_LOADER_H */ |