summaryrefslogtreecommitdiff
path: root/TAO/orbsvcs/Concurrency_Service/Concurrency_Service.h
blob: 133b1c752e87a1386004efdff90d5581b8e3d63c (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
// $Id$

// ============================================================================
//
// = LIBRARY
//    orbsvcs/Concurrency_Service/Concurency_Service
//
// = FILENAME
//    Concurrency_Service.h
//
// = DESCRIPTION
//      This class implements a subset of the functionality of the
//      CORBA Concurrency Service.
//
// = AUTHORS
//    Torben Worm <tworm@cs.wustl.edu>
//
// ============================================================================

#ifndef _CONCURRENCY_SERVICE_H
#define _CONCURRENCY_SERVICE_H

#include "ace/Get_Opt.h"

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

#include "ace/Log_Msg.h"
#include "tao/PortableServer/ORB_Manager.h"
#include "orbsvcs/Concurrency/Concurrency_Utils.h"
#include "orbsvcs/Naming/Naming_Server.h"

class Concurrency_Service : public TAO_ORB_Manager
{
  // = TITLE
  //   Defines a class that encapsulates the implementation of the
  //   concurrency service.
  // = DESCRIPTION
  //   This class uses the TAO_ORB_Manager, the TAO_Naming_Server, and
  //   the TAO_Concurrency_Server classes to implement a server for
  //   the concurrency service.
public:
  // = Initialization and termination methods.
  Concurrency_Service (void);
  // Default Constructor.

  Concurrency_Service (int argc,
                       ACE_TCHAR **argv
                       ACE_ENV_ARG_DECL);
  // Constructor taking the command-line arguments.

  ~Concurrency_Service (void);
  // Destructor.

  int init (int argc,
            ACE_TCHAR **argv
            ACE_ENV_ARG_DECL);
  // Initialize the Concurrency Service with the arguments.

  int run (ACE_ENV_SINGLE_ARG_DECL);
  // Run the Concurrency_Service.

private:
  int parse_args (int argc, ACE_TCHAR** argv);
  // Parses the commandline arguments.

  int init_naming_service (ACE_ENV_SINGLE_ARG_DECL);
  // Initialize the name server and register the concurency server
  // factory with it. Maybe later it will be convinient to register
  // the individual lock sets with the naming service. At present the
  // clients must keep track of the reference and pass 'by hand'

  int use_naming_service_;
  // Flag to tell wheter the naming service will be used.

  FILE *ior_output_file_;
  // File to output the concurrency server IOR.

  TAO_ORB_Manager orb_manager_;
  // The ORB manager

  TAO_Naming_Server my_name_server_;
  // An instance of the name server used for registering the factory
  // objects.

  TAO_Concurrency_Server my_concurrency_server_;
  // An instance of the concurrency server.

  CosConcurrencyControl::LockSetFactory_var lockset_factory_;
  // Factory var to register with the naming service.

  CosNaming::NamingContext_var concurrency_context_;
  // Naming context for the concurrency service.

  CosNaming::NamingContext_var naming_context_;
  // Naming context for the naming service.
};

#endif /* _CONCURRENCY_SERVICE_H */