RT_Notify_Service.cpp

Go to the documentation of this file.
00001 // RT_Notify_Service.cpp,v 1.10 2006/03/14 06:14:34 jtc Exp
00002 
00003 #include "orbsvcs/Notify/RT_Notify_Service.h"
00004 
00005 ACE_RCSID(RT_Notify, TAO_Notify_RT_Notify_Service, "RT_Notify_Service.cpp,v 1.10 2006/03/14 06:14:34 jtc Exp")
00006 
00007 #include "ace/Dynamic_Service.h"
00008 #include "orbsvcs/Notify/Properties.h"
00009 #include "orbsvcs/Notify/RT_Properties.h"
00010 #include "orbsvcs/Notify/RT_Factory.h"
00011 #include "orbsvcs/Notify/RT_Builder.h"
00012 
00013 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
00014 
00015 TAO_RT_Notify_Service::TAO_RT_Notify_Service (void)
00016 {
00017 }
00018 
00019 TAO_RT_Notify_Service::~TAO_RT_Notify_Service ()
00020 {
00021 }
00022 
00023 void
00024 TAO_RT_Notify_Service::init_service (CORBA::ORB_ptr orb ACE_ENV_ARG_DECL)
00025 {
00026   ACE_DEBUG ((LM_DEBUG, "Loading the Real-Time Notification Service...\n"));
00027 
00028   this->init_i (orb ACE_ENV_ARG_PARAMETER);
00029   ACE_CHECK;
00030 }
00031 
00032 void
00033 TAO_RT_Notify_Service::init_i (CORBA::ORB_ptr orb ACE_ENV_ARG_DECL)
00034 {
00035   //Init the base class.
00036   TAO_CosNotify_Service::init_i (orb ACE_ENV_ARG_PARAMETER);
00037   ACE_CHECK;
00038 
00039   TAO_Notify_RT_Properties* properties = TAO_Notify_RT_PROPERTIES::instance();
00040 
00041   // Resolve RTORB
00042   CORBA::Object_var object =
00043     orb->resolve_initial_references ("RTORB"
00044                                       ACE_ENV_ARG_PARAMETER);
00045   ACE_CHECK;
00046 
00047   RTCORBA::RTORB_var rt_orb =
00048     RTCORBA::RTORB::_narrow (object.in ()
00049                              ACE_ENV_ARG_PARAMETER);
00050   ACE_CHECK;
00051 
00052   // Resolve RTCurrent
00053   object =
00054     orb->resolve_initial_references ("RTCurrent"
00055                                      ACE_ENV_ARG_PARAMETER);
00056   ACE_CHECK;
00057 
00058   RTCORBA::Current_var current =
00059     RTCORBA::Current::_narrow (object.in ()
00060                                ACE_ENV_ARG_PARAMETER);
00061   ACE_CHECK;
00062 
00063  /// Set the properties
00064   properties->rt_orb (rt_orb.in ());
00065   properties->current (current.in ());
00066 }
00067 
00068 TAO_Notify_Factory*
00069 TAO_RT_Notify_Service::create_factory (ACE_ENV_SINGLE_ARG_DECL)
00070 {
00071   TAO_Notify_Factory* factory =
00072     ACE_Dynamic_Service<TAO_Notify_Factory>::instance ("TAO_Notify_Factory");
00073 
00074   if (factory == 0)
00075     {
00076       ACE_NEW_THROW_EX (factory,
00077                         TAO_Notify_RT_Factory (),
00078                         CORBA::NO_MEMORY ());
00079       ACE_CHECK_RETURN(0);
00080     }
00081   return factory;
00082 }
00083 
00084 TAO_Notify_Builder*
00085 TAO_RT_Notify_Service::create_builder (ACE_ENV_SINGLE_ARG_DECL)
00086 {
00087   TAO_Notify_Builder* builder = 0;
00088   ACE_NEW_THROW_EX (builder,
00089                     TAO_Notify_RT_Builder (),
00090                     CORBA::NO_MEMORY ());
00091   ACE_CHECK_RETURN(0);
00092 
00093   return builder;
00094 }
00095 
00096 TAO_END_VERSIONED_NAMESPACE_DECL
00097 
00098 ACE_FACTORY_DEFINE (TAO_RT_Notify,TAO_RT_Notify_Service)

Generated on Thu Nov 9 13:24:16 2006 for TAO_CosNotification by doxygen 1.3.6