summaryrefslogtreecommitdiff
path: root/TAO/orbsvcs/orbsvcs/Notify/CosNotify_Service.h
blob: fd29b69d2a820c6ad2ac13d24395fb0bc094d06b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
/* -*- C++ -*- */
/**
 *  @file CosNotify_Service.h
 *
 *  $Id$
 *
 *  @author Pradeep Gore <pradeep@oomworks.com>
 *
 *
 */

#ifndef TAO_NS_COSNOTIFY_SERVICE_H
#define TAO_NS_COSNOTIFY_SERVICE_H
#include "ace/pre.h"

#include "notify_export.h"

#if !defined (ACE_LACKS_PRAGMA_ONCE)
# pragma once
#endif /* ACE_LACKS_PRAGMA_ONCE */

#include "Service.h"

class TAO_NS_Factory;
class TAO_NS_Builder;
class TAO_NS_Properties;
class TAO_NS_EventChannelFactory;

/**
 * @class TAO_NS_CosNotify_Service
 *
 * @brief A service object for creating the  Notify Service Factory.
 *
 */
class TAO_Notify_Export TAO_NS_CosNotify_Service : public TAO_NS_Service
{
public:
  /// Constuctor
  TAO_NS_CosNotify_Service (void);

  /// Destructor
  virtual ~TAO_NS_CosNotify_Service ();

  /// = Service_Object virtual method overloads.
  virtual int init (int argc, char *argv[]);
  virtual int fini (void);

  /// Init
  virtual void init (CORBA::ORB_ptr orb ACE_ENV_ARG_DECL);

  /// Create the Channel Factory.
  virtual CosNotifyChannelAdmin::EventChannelFactory_ptr create (PortableServer::POA_ptr default_POA ACE_ENV_ARG_DECL);

  /// Called by the factory when it is destroyed.
  virtual void remove (TAO_NS_EventChannelFactory* ecf ACE_ENV_ARG_DECL);

protected:
  /// Init the data members
  virtual void init_i (CORBA::ORB_ptr orb ACE_ENV_ARG_DECL);

  /// Create the Factory for Notify objects.
  virtual void init_factory (ACE_ENV_SINGLE_ARG_DECL);

  /// Create the Builder for Notify objects.
  virtual void init_builder (ACE_ENV_SINGLE_ARG_DECL);

  /// Apply ORB Scheduling policy to main thread and set its priority to the lowest available.
  void init_main_thread (CORBA::ORB_ptr orb ACE_ENV_ARG_DECL);

  /// Set thread options on <qos>.
  void set_threads (CosNotification::QoSProperties &qos, int threads);

  /// Service component for object factory operations.
  TAO_NS_Factory* factory_;

  /// Service component for building NS participants.
  TAO_NS_Builder* builder_;
};

//ACE_STATIC_SVC_DECLARE (TAO_NS_CosNotify_Service)
ACE_FACTORY_DECLARE (TAO_Notify, TAO_NS_CosNotify_Service)

ACE_STATIC_SVC_DECLARE (TAO_Notify_Default_EMO_Factory_OLD)

#if defined (__ACE_INLINE__)
#include "CosNotify_Service.inl"
#endif /* __ACE_INLINE__ */

#include "ace/post.h"
#endif /* TAO_NS_COSNOTIFY_SERVICE_H */