summaryrefslogtreecommitdiff
path: root/TAO/orbsvcs/orbsvcs/Naming/FaultTolerant/FT_Storable_Naming_Context_Factory.cpp
blob: 648ec3a76542b3c05183141accf52c2553375197 (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
// -*- C++ -*-

//=============================================================================
/**
 * @file   FT_Storable_Naming_Context_Factory.cpp
 *
 * @author Kevin Stanley <stanleyk@ociweb.com>
 */
//=============================================================================

#include "orbsvcs/Naming/FaultTolerant/FT_Storable_Naming_Context_Factory.h"
#include "orbsvcs/Naming/FaultTolerant/FT_Storable_Naming_Context.h"

TAO_BEGIN_VERSIONED_NAMESPACE_DECL

/// Constructor.
TAO_FT_Storable_Naming_Context_Factory::
TAO_FT_Storable_Naming_Context_Factory (size_t hash_table_size,
                                        TAO_FT_Naming_Replication_Manager *rep)
  : TAO_Storable_Naming_Context_Factory (hash_table_size),
    replicator_ (rep)
{
}

  /// Destructor.  Does not deallocate the hash map: if an instance of
  /// this class goes out of scope, its hash_map remains in persistent storage.
TAO_FT_Storable_Naming_Context_Factory::~TAO_FT_Storable_Naming_Context_Factory ()
{
}


TAO_FT_Naming_Replication_Manager *
TAO_FT_Storable_Naming_Context_Factory::replicator ()
{
  return this->replicator_;
}

TAO_Storable_Naming_Context*
TAO_FT_Storable_Naming_Context_Factory::create_naming_context_impl (
  CORBA::ORB_ptr orb,
  PortableServer::POA_ptr poa,
  const char *poa_id,
  TAO::Storable_Factory *persistence_factory
                                                                    )
{
  // Construct the naming context, forwarding the map and counter
  // even if they are defaulted
  TAO_FT_Storable_Naming_Context *context_impl;
  ACE_NEW_THROW_EX (context_impl,
                    TAO_FT_Storable_Naming_Context (orb,
                                                    poa,
                                                    poa_id,
                                                    this,
                                                    persistence_factory),
                    CORBA::NO_MEMORY ());

  return context_impl;
}


TAO_END_VERSIONED_NAMESPACE_DECL