blob: d0823781b4c6fca9c370f63cb488151348e39af7 (
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
|
// $Id$
#include "ace/Task.h"
#include "tao/TAO.h"
#include "tao/default_resource.h"
#include "Time_Date_i.h"
#include "Alt_Resource_Factory.h"
class Alt_Resource_Factory_Export My_Resource_Factory : public TAO_Default_Resource_Factory
{
// = TITLE
// Illustrates how to select the appropriate <ACE_Reactor>.
//
// = DESCRIPTION
// If we're running in a single-threaded configuration this will
// be the <ACE_Reactor::instance> singleton. Otherwise, it'll be
// the ORB's own default <ACE_Reactor>, which is defined by the
// <TAO_Default_Resource_Factory>.
public:
virtual ACE_Reactor *get_reactor (void);
// Return the <ACE_Reactor> that will be utilized by the ORB.
};
ACE_FACTORY_DECLARE (Alt_Resource_Factory, My_Resource_Factory)
class ACE_Svc_Export DLL_ORB : public ACE_Task_Base
{
// = TITLE
// Define a class that dynamically links an ORB into a server
// process via the <ACE_Service_Configurator>.
public:
virtual int init (int argc, char *argv[]);
// Initialize the <TAO_ORB_Manager>.
virtual int fini (void);
// Shutdown the <TAO_ORB_Manager>.
virtual int svc (void);
// Concurrency hook.
TAO_ORB_Manager orb_manager_;
// ORB manager.
};
class ACE_Svc_Export Time_Date_Servant : public ACE_Service_Object
{
// = TITLE
// Define a class that dynamically links the Time_Date service
// into a server process via the <ACE_Service_Configurator>. Note
// that this assumes the ORB has been linked previously.
public:
virtual int init (int argc, char *argv[]);
// Initialize the <Time_Date> servant.
int parse_args (int argc, char *argv[]);
// Parse the "command-line" arguments.
private:
Time_Date_i servant_;
// Servant for the <Time_Date> object.
FILE *ior_output_file_;
// File where the IOR of the server object is stored.
const char *orb_;
// Name of the ORB we're linking dynamically.
};
// The following Factory is used by the <ACE_Service_Config> and
// dll_orb.conf file to dynamically initialize the state of the
// Time_Date service.
ACE_SVC_FACTORY_DECLARE (DLL_ORB)
ACE_SVC_FACTORY_DECLARE (Time_Date_Servant)
|