summaryrefslogtreecommitdiff
path: root/TAO/orbsvcs/orbsvcs/Notify/Notify_EventChannelFactory_i.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'TAO/orbsvcs/orbsvcs/Notify/Notify_EventChannelFactory_i.cpp')
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Notify_EventChannelFactory_i.cpp41
1 files changed, 41 insertions, 0 deletions
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Notify_EventChannelFactory_i.cpp b/TAO/orbsvcs/orbsvcs/Notify/Notify_EventChannelFactory_i.cpp
new file mode 100644
index 00000000000..2bc881f15a7
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/Notify_EventChannelFactory_i.cpp
@@ -0,0 +1,41 @@
+// $Id$
+
+#include "orbsvcs/Notify/Notify_EventChannelFactory_i.h"
+
+#include "orbsvcs/Notify/Service.h"
+#include "ace/Dynamic_Service.h"
+#include "tao/PortableServer/Root_POA.h"
+#include "tao/ORB_Core.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+CosNotifyChannelAdmin::EventChannelFactory_ptr
+TAO_Notify_EventChannelFactory_i::create (PortableServer::POA_ptr default_POA ACE_ENV_ARG_DECL)
+{
+ CosNotifyChannelAdmin::EventChannelFactory_var notify_factory;
+
+ TAO_Notify_Service* notify_service = ACE_Dynamic_Service<TAO_Notify_Service>::instance (TAO_COS_NOTIFICATION_SERVICE_NAME);
+
+ if (notify_service == 0)
+ {
+ ACE_DEBUG ((LM_DEBUG, "Service not found! check conf. file\n"));
+ return notify_factory._retn ();
+ }
+
+ TAO_Root_POA *poa = dynamic_cast <TAO_Root_POA*> (default_POA);
+
+ if (poa == 0)
+ return notify_factory._retn ();
+
+ CORBA::ORB_ptr orb = poa->orb_core ().orb () ;
+
+ notify_service->init_service (orb ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (notify_factory._retn ());
+
+ notify_factory = notify_service->create (default_POA ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (notify_factory._retn ());
+
+ return notify_factory._retn ();
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL