summaryrefslogtreecommitdiff
path: root/TAO/orbsvcs/orbsvcs/Notify/Notify_Default_POA_Factory.h
blob: 3953733fefdf7026f58498b8f2d1c8b2c9063248 (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
91
92
93
94
95
96
97
98
99
100
101
102
/* -*- C++ -*- */
// $Id$
//
// ============================================================================
//
// = LIBRARY
//   ORBSVCS Notification
//
// = FILENAME
//   Notify_Default_POA_Factory.h
//
// = DESCRIPTION
//   Default factory for POA objects.
//
// = AUTHOR
//   Pradeep Gore <pradeep@cs.wustl.edu>
//
// ============================================================================

#ifndef TAO_NOTIFY_DEFAULT_POA_FACTORY_H
#define TAO_NOTIFY_DEFAULT_POA_FACTORY_H

#include "ace/pre.h"
#include "Notify_POA_Factory.h"

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

class TAO_Notify_Export TAO_Notify_Default_POA_Factory : public TAO_Notify_POA_Factory
{
public:
  // = TITLE
  //   TAO_Notify_Default_POA_Factory
  //
  // = DESCRIPTION
  //   Default factory for POA objects.
  //
  TAO_Notify_Default_POA_Factory (void);
  ~TAO_Notify_Default_POA_Factory ();

  static int init_svc (void);
  // Helper function to register the default factory into the service
  // configurator.

  // = The Service_Object entry points
  virtual int init (int argc, char* argv[]);
  virtual int fini (void);

  PortableServer::POA_ptr create_event_channel_POA (PortableServer::POA_ptr parent_poa, CORBA::Environment &ACE_TRY_ENV);
  // Create the POA to activate Event Channels in.

  PortableServer::POA_ptr create_supplier_admin_POA (PortableServer::POA_ptr parent_poa, CORBA::Long new_poa_id, CORBA::Environment &ACE_TRY_ENV);
  // Create the POA to activate SA's in.

  PortableServer::POA_ptr create_consumer_admin_POA (PortableServer::POA_ptr parent_poa, CORBA::Long new_poa_id, CORBA::Environment &ACE_TRY_ENV);
  // Create the POA to activate CA's in.

  PortableServer::POA_ptr create_proxy_pushconsumer_POA (PortableServer::POA_ptr parent_poa, CORBA::Long new_poa_id, CORBA::Environment &ACE_TRY_ENV);
  // Create the POA to activate proxy push consumers in.

  PortableServer::POA_ptr create_proxy_pushsupplier_POA (PortableServer::POA_ptr parent_poa, CORBA::Long new_poa_id, CORBA::Environment &ACE_TRY_ENV);
  // Create the POA to activate proxy push suppliers in.

  // = Object activation and POA methods
  CORBA::Object_ptr activate_object_with_id (CORBA::Long id, PortableServer::POA_ptr poa,PortableServer::Servant servant, CORBA::Environment &ACE_TRY_ENV);
  // Converts <id> to an ObjectId and registers with the POA <poa>.

  CORBA::Object_ptr activate_object (PortableServer::POA_ptr poa,PortableServer::Servant servant, CORBA::Environment &ACE_TRY_ENV);
  // Registers with the POA <poa>.

  CORBA::Object_ptr servant_to_reference (PortableServer::POA_ptr poa,PortableServer::Servant servant, CORBA::Environment &ACE_TRY_ENV);
  // Registers with the POA <poa>.

  CORBA::Object_ptr id_to_reference (CORBA::Long id, PortableServer::POA_ptr poa, CORBA::Environment &ACE_TRY_ENV);
  // Look for the Object with id <id> in <poa>.

  void destroy_POA (PortableServer::POA_ptr poa, CORBA::Environment &ACE_TRY_ENV);
  // Destroy the <poa>

  void deactivate_object (CORBA::Object_ptr obj, PortableServer::POA_ptr poa, CORBA::Environment &ACE_TRY_ENV);
  // Deactivate the object.

  void deactivate_object (PortableServer::Servant servant, PortableServer::POA_ptr, CORBA::Environment &ACE_TRY_ENV);
  // Deactivate the object.

protected:
  // = Helper methods

  PortableServer::ObjectId* long_to_ObjectId (const CORBA::Long id);
  // Converts a CORBA::Long to an ObjectId

  PortableServer::POA_ptr create_generic_childPOA_i (const char* child_poa_name, PortableServer::POA_ptr parent_poa, CORBA::Environment &ACE_TRY_ENV);
  // Create the POA with the most generic policies required of our POA's.

};

ACE_STATIC_SVC_DECLARE (TAO_Notify_Default_POA_Factory)
ACE_FACTORY_DECLARE (TAO_Notify,TAO_Notify_Default_POA_Factory)

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