RT_Notify_Service.cpp

Go to the documentation of this file.
00001 // $Id: RT_Notify_Service.cpp 76589 2007-01-25 18:04:11Z elliott_c $
00002 
00003 #include "orbsvcs/Notify/RT_Notify_Service.h"
00004 
00005 ACE_RCSID(RT_Notify, TAO_Notify_RT_Notify_Service, "$Id: RT_Notify_Service.cpp 76589 2007-01-25 18:04:11Z elliott_c $")
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)
00025 {
00026   ACE_DEBUG ((LM_DEBUG, "Loading the Real-Time Notification Service...\n"));
00027 
00028   this->init_i (orb);
00029 }
00030 
00031 void
00032 TAO_RT_Notify_Service::init_i (CORBA::ORB_ptr orb)
00033 {
00034   //Init the base class.
00035   TAO_CosNotify_Service::init_i (orb);
00036 
00037   TAO_Notify_RT_Properties* properties = TAO_Notify_RT_PROPERTIES::instance();
00038 
00039   // Resolve RTORB
00040   CORBA::Object_var object =
00041     orb->resolve_initial_references ("RTORB");
00042 
00043   RTCORBA::RTORB_var rt_orb =
00044     RTCORBA::RTORB::_narrow (object.in ());
00045 
00046   // Resolve RTCurrent
00047   object =
00048     orb->resolve_initial_references ("RTCurrent");
00049 
00050   RTCORBA::Current_var current =
00051     RTCORBA::Current::_narrow (object.in ());
00052 
00053  /// Set the properties
00054   properties->rt_orb (rt_orb.in ());
00055   properties->current (current.in ());
00056 }
00057 
00058 TAO_Notify_Factory*
00059 TAO_RT_Notify_Service::create_factory (void)
00060 {
00061   TAO_Notify_Factory* factory =
00062     ACE_Dynamic_Service<TAO_Notify_Factory>::instance ("TAO_Notify_Factory");
00063 
00064   if (factory == 0)
00065     {
00066       ACE_NEW_THROW_EX (factory,
00067                         TAO_Notify_RT_Factory (),
00068                         CORBA::NO_MEMORY ());
00069     }
00070   return factory;
00071 }
00072 
00073 TAO_Notify_Builder*
00074 TAO_RT_Notify_Service::create_builder (void)
00075 {
00076   TAO_Notify_Builder* builder = 0;
00077   ACE_NEW_THROW_EX (builder,
00078                     TAO_Notify_RT_Builder (),
00079                     CORBA::NO_MEMORY ());
00080 
00081   return builder;
00082 }
00083 
00084 TAO_END_VERSIONED_NAMESPACE_DECL
00085 
00086 ACE_FACTORY_DEFINE (TAO_RT_Notify,TAO_RT_Notify_Service)

Generated on Tue Feb 2 17:45:29 2010 for TAO_CosNotification by  doxygen 1.4.7