TAO_CosNaming  2.1.8
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
TAO_Persistent_Naming_Context Class Reference

This class plays a role of a 'ConcreteImplementor' in the Bridge pattern architecture of the CosNaming::NamingContext implementation. More...

#include <Persistent_Naming_Context.h>

Inheritance diagram for TAO_Persistent_Naming_Context:
Inheritance graph
Collaboration diagram for TAO_Persistent_Naming_Context:
Collaboration graph

Public Types

typedef
TAO_Persistent_Bindings_Map::HASH_MAP 
HASH_MAP
 Underlying data structure - typedef for ease of use. More...
 

Public Member Functions

int init (size_t hash_table_size=ACE_DEFAULT_MAP_SIZE)
 
 TAO_Persistent_Naming_Context (PortableServer::POA_ptr poa, const char *poa_id, TAO_Persistent_Context_Index *context_index, HASH_MAP *map=0, ACE_UINT32 *counter=0)
 
virtual ~TAO_Persistent_Naming_Context (void)
 Destructor. More...
 
virtual
CosNaming::NamingContext_ptr 
new_context (void)
 
virtual void list (CORBA::ULong how_many, CosNaming::BindingList_out &bl, CosNaming::BindingIterator_out &bi)
 
- Public Member Functions inherited from TAO_Hash_Naming_Context
 TAO_Hash_Naming_Context (PortableServer::POA_ptr poa, const char *poa_id)
 Constructor. More...
 
void interface (TAO_Naming_Context *i)
 Set our <interface_> pointer. More...
 
virtual ~TAO_Hash_Naming_Context (void)
 Destructor. More...
 
TAO_Naming_Contextinterface (void)
 Get the pointer to our <interface>. More...
 
int root (void)
 
int destroyed (void)
 
virtual void bind (const CosNaming::Name &n, CORBA::Object_ptr obj)
 
virtual void rebind (const CosNaming::Name &n, CORBA::Object_ptr obj)
 
virtual void bind_context (const CosNaming::Name &n, CosNaming::NamingContext_ptr nc)
 
virtual void rebind_context (const CosNaming::Name &n, CosNaming::NamingContext_ptr nc)
 
virtual CORBA::Object_ptr resolve (const CosNaming::Name &n)
 
virtual void unbind (const CosNaming::Name &n)
 
virtual
CosNaming::NamingContext_ptr 
bind_new_context (const CosNaming::Name &n)
 
virtual void destroy (void)
 
virtual PortableServer::POA_ptr _default_POA (void)
 Returns the Default POA of this Servant object. More...
 
- Public Member Functions inherited from TAO_Naming_Context_Impl
virtual ~TAO_Naming_Context_Impl (void)
 Destructor. More...
 
virtual void stale (bool value)
 
virtual bool stale (void)
 

Static Public Member Functions

static CosNaming::NamingContext_ptr make_new_context (PortableServer::POA_ptr poa, const char *poa_id, size_t context_size, TAO_Persistent_Context_Index *ind)
 

Protected Member Functions

void set_cleanup_level (int level)
 
- Protected Member Functions inherited from TAO_Hash_Naming_Context
CosNaming::NamingContext_ptr get_context (const CosNaming::Name &name)
 

Protected Attributes

ACE_UINT32 * counter_
 
TAO_Persistent_Bindings_Mappersistent_context_
 
TAO_Persistent_Context_Indexindex_
 
- Protected Attributes inherited from TAO_Hash_Naming_Context
TAO_Bindings_Mapcontext_
 
TAO_Naming_Contextinterface_
 
TAO_SYNCH_RECURSIVE_MUTEX lock_
 Lock used to serialize access to the underlying data structure. More...
 
int destroyed_
 
PortableServer::POA_var poa_
 POA we are registered with. More...
 
ACE_CString poa_id_
 

Detailed Description

This class plays a role of a 'ConcreteImplementor' in the Bridge pattern architecture of the CosNaming::NamingContext implementation.

This class provides a persistent implementation of the NamingContext functionality, i.e., the state is preserved across process boundaries. Derives from TAO_Hash_Naming_Context and uses TAO_Persistent_Bindings_Map to store name to object bindings.

Member Typedef Documentation

Underlying data structure - typedef for ease of use.

Constructor & Destructor Documentation

TAO_Persistent_Naming_Context::TAO_Persistent_Naming_Context ( PortableServer::POA_ptr  poa,
const char *  poa_id,
TAO_Persistent_Context_Index context_index,
HASH_MAP map = 0,
ACE_UINT32 *  counter = 0 
)

Constructor that takes in preallocated data structure and takes ownership of it. This constructor is for 'recreating' servants from persistent state. If no map is provided, it MUST be followed up by <init> to allocate the underlying data structure from persistent storage!

TAO_Persistent_Naming_Context::~TAO_Persistent_Naming_Context ( void  )
virtual

Destructor.

Member Function Documentation

int TAO_Persistent_Naming_Context::init ( size_t  hash_table_size = ACE_DEFAULT_MAP_SIZE)

Allocate the underlying data structure from persistent storage. Returns 0 on success and -1 on failure.

void TAO_Persistent_Naming_Context::list ( CORBA::ULong  how_many,
CosNaming::BindingList_out &  bl,
CosNaming::BindingIterator_out &  bi 
)
virtual

Returns at most the requested number of bindings <how_many> in <bl>. If the naming context contains additional bindings, they are returned with a BindingIterator. In the naming context does not contain any additional bindings <bi> returned as null.

Implements TAO_Naming_Context_Impl.

CosNaming::NamingContext_ptr TAO_Persistent_Naming_Context::make_new_context ( PortableServer::POA_ptr  poa,
const char *  poa_id,
size_t  context_size,
TAO_Persistent_Context_Index ind 
)
static

This utility method factors out the code needed to create a new Persistent Naming Context servant and activate it under the specified POA with the specified id. This function is static so that the code can be used, both from inside the class (e.g., <new_context>), and from outside (e.g., Naming_Utils.cpp).

CosNaming::NamingContext_ptr TAO_Persistent_Naming_Context::new_context ( void  )
virtual

This operation returns a new naming context implemented by the same naming server in which the operation was invoked. The context is not bound.

Implements TAO_Naming_Context_Impl.

void TAO_Persistent_Naming_Context::set_cleanup_level ( int  level)
protected

Set <destroyed_> flag (inherited from TAO_Hash_Naming_Context) to <level>. Legal values for <destroyed_> are 0, 1, and 2. The values specify the extent of cleanup that should take place in the context's destructor: '0' - no cleanup (e.g., if the context goes out of scope, but it's state is to remain in persistent storage); '1' - free up the underlying data structure in persistent storage (e.g., if the initialization of this context was only partially completed due to some failures, and we need to roll back); '2' - free up the underlying data structure, and deregister this naming context from its <index_> (e.g., if the context had <destroy> method invoked and needs to be completely removed from existence).

Member Data Documentation

ACE_UINT32* TAO_Persistent_Naming_Context::counter_
protected

Counter used for generation of POA ids for children Naming Contexts.

TAO_Persistent_Context_Index* TAO_Persistent_Naming_Context::index_
protected

A pointer to the index object of this naming service: it keeps track of all the naming contexts created. Every time we make a new context or destroy one, we need to make an entry there. Also, we get the allocator needed to initialize us from this guy.

TAO_Persistent_Bindings_Map* TAO_Persistent_Naming_Context::persistent_context_
protected

A pointer to the underlying data structure used to store name bindings. While our superclass (TAO_Hash_Naming_Context) also maintains a pointer to the data structure, keeping this pointer around saves us from the need to downcast when invoking non-virtual methods.


The documentation for this class was generated from the following files: