summaryrefslogtreecommitdiff
path: root/ACE/TAO/orbsvcs/orbsvcs/Concurrency/Concurrency_Utils.h
blob: bd2b7173f376a58e43814b106ba947283041b0a8 (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
// -*- C++ -*-

//=============================================================================
/**
 *  @file    Concurrency_Utils.h
 *
 *  $Id$
 *
 *    This class implements a Concurrency Server wrapper class which
 *    holds a number of lock sets.  The server must run in the
 *    thread per request concurrency model in order to let the
 *    clients block on the semaphores.
 *
 *
 *  @author Torben Worm <tworm@cs.wustl.edu>
 */
//=============================================================================


#ifndef _CONCURRENCY_SERVER_H
#define _CONCURRENCY_SERVER_H

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

#include "orbsvcs/CosConcurrencyControlC.h"
#include "orbsvcs/Concurrency/CC_LockSetFactory.h"
#include "orbsvcs/Concurrency/concurrency_serv_export.h"


TAO_BEGIN_VERSIONED_NAMESPACE_DECL

/**
 * @class TAO_Concurrency_Server
 *
 * @brief Defines a wrapper class for the implementation of the
 * concurrency server.
 *
 * This class takes an orb and Poa reference and activates the
 * concurrency service lock set factory object under them.
 */
class TAO_Concurrency_Serv_Export TAO_Concurrency_Server
{
public:
  // = Initialization and termination methods.
  ///Default constructor.
  TAO_Concurrency_Server (void);

  /// Takes the POA under which to register the Concurrency Service
  /// implementation object.
  TAO_Concurrency_Server (CORBA::ORB_ptr orb,
                          PortableServer::POA_ptr poa);

  /// Destructor.
  ~TAO_Concurrency_Server (void);

  /// Initialize the concurrency server under the given ORB and POA.
  CORBA::Object_ptr init (CORBA::ORB_ptr orb,
                          PortableServer::POA_ptr poa);

  /// Cleanup resources.
  int fini (void);

  /// Get the lock set factory.
  CC_LockSetFactory *GetLockSetFactory (void);

private:
  /// This is the lock set factory activated under the POA.
  CC_LockSetFactory lock_set_factory_;

  /// The POA which the lock set factory servant was registered.
  PortableServer::POA_var poa_;
};

TAO_END_VERSIONED_NAMESPACE_DECL

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