TAO_CosNaming 4.0.1
Loading...
Searching...
No Matches
Classes | Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | List of all members
TAO_Naming_Server Class Reference

Defines a wrapper class that holds the root Naming Context. More...

#include <Naming_Server.h>

Collaboration diagram for TAO_Naming_Server:
Collaboration graph
[legend]

Classes

struct  IOR_Bundle
 

Public Member Functions

 TAO_Naming_Server (size_t bsize=1)
 Default constructor.
 
 TAO_Naming_Server (CORBA::ORB_ptr orb, PortableServer::POA_ptr poa, size_t context_size=ACE_DEFAULT_MAP_SIZE, ACE_Time_Value *timeout=0, bool resolve_for_existing_naming_service=true, const ACE_TCHAR *persistence_location=0, void *base_addr=TAO_NAMING_BASE_ADDR, int enable_multicast=1, int use_storable_context=0, int round_trip_timeout=0, int use_round_trip_timeout=0, size_t bsize=1)
 
int init (CORBA::ORB_ptr orb, PortableServer::POA_ptr poa, size_t context_size=ACE_DEFAULT_MAP_SIZE, ACE_Time_Value *timeout=0, bool resolve_for_existing_naming_service=true, const ACE_TCHAR *persistence_location=0, void *base_addr=TAO_NAMING_BASE_ADDR, int enable_multicast=1, int use_storable_context=0, int round_trip_timeout=0, int use_round_trip_timeout=0)
 
virtual int init_with_orb (int argc, ACE_TCHAR *argv[], CORBA::ORB_ptr orb)
 
virtual int fini ()
 Destroy the child POA created in init_with_orb.
 
virtual ~TAO_Naming_Server ()
 Destructor.
 
char * naming_service_ior ()
 Returns the IOR of the naming service.
 
CosNaming::NamingContext_ptr operator-> () const
 Returns a <NamingContext_ptr> for the root Naming Context.
 

Protected Types

enum  Base_IOR_Indexes { ROOT = 0 }
 

Protected Member Functions

void assign (size_t ndx, bool take, CORBA::Object_ptr obj)
 
int write (size_t ndx) const
 
virtual int init_new_naming (CORBA::ORB_ptr orb, PortableServer::POA_ptr root_poa, const ACE_TCHAR *persistence_location, void *base_addr, size_t context_size, int enable_multicast, int use_storable_context, int round_trip_timeout=0, int use_round_trip_timeout=0)
 
virtual int parse_args (int argc, ACE_TCHAR *argv[])
 parses the arguments.
 
int write_ior_to_file (const char *ior_string, const char *file_name)
 Write the provided ior_string to the file. Return 0 if success.
 
virtual TAO_Storable_Naming_Context_Factorystorable_naming_context_factory (size_t context_size)
 
virtual TAO_Persistent_Naming_Context_Factorypersistent_naming_context_factory ()
 
IOR_Bundlebundle_at (size_t ndx)
 
const IOR_Bundlebundle_at (size_t ndx) const
 

Protected Attributes

TAO_IOR_Multicast * ior_multicast_
 The ior_multicast event handler.
 
CORBA::ORB_var orb_
 The ORB.
 
PortableServer::POA_var root_poa_
 The Root POA.
 
PortableServer::POA_var ns_poa_
 The Naming Service POA.
 
const ACE_TCHARpid_file_name_
 File to output the process id.
 
IOR_Bundleiors_
 
size_t bundle_size_
 
size_t context_size_
 
int multicast_
 If not zero multicast is enabled.
 
TAO_Persistent_Context_Indexcontext_index_
 
const ACE_TCHARpersistence_dir_
 
void * base_address_
 
int use_storable_context_
 If not zero use flat file persistence.
 
int use_servant_activator_
 
TAO_Storable_Naming_Context_Activatorservant_activator_
 
int use_redundancy_
 
int round_trip_timeout_
 If not zero use round trip timeout policy set to value specified.
 
int use_round_trip_timeout_
 

Detailed Description

Defines a wrapper class that holds the root Naming Context.

This class either finds an existing Naming Service (if the <resolve_for_existing_naming_service> flag is set) or creates one (if resolve_for_existing_naming_service flag isn't set or Naming Service was not found). This class also defines the operator-> so that <NamingContext> functions like <bind>, <unbind> .. can be called directly on a <TAO_Naming_Server> object, and be forwareded to the root Naming Context. This class is intended to simplify programs that want to play the role of a Naming Service server. To simplify programs that want to play the role of Naming Service clients, use <TAO_Naming_Client>. If a Naming Service is created locally, a TAO_IOR_Multicast event handler is created and installed on the ORB's reactor. This event handler allows other clients on the network to discover and use this Naming Service. Event handler listens on a multicast port for messages from clients looking for a Naming Service, and sends back the ior of the root Naming Context. For more information on how this bootstraping through a multicast process works, check out orbsvcs/orbsvcs/TAO_IOR_Multicast.*, implementation of <resolve_initial_references>, and orbsvcs/Naming/README.

Member Enumeration Documentation

◆ Base_IOR_Indexes

Enumerator
ROOT 

Constructor & Destructor Documentation

◆ TAO_Naming_Server() [1/2]

TAO_Naming_Server::TAO_Naming_Server ( size_t bsize = 1)

Default constructor.

◆ TAO_Naming_Server() [2/2]

TAO_Naming_Server::TAO_Naming_Server ( CORBA::ORB_ptr orb,
PortableServer::POA_ptr poa,
size_t context_size = ACE_DEFAULT_MAP_SIZE,
ACE_Time_Value * timeout = 0,
bool resolve_for_existing_naming_service = true,
const ACE_TCHAR * persistence_location = 0,
void * base_addr = TAO_NAMING_BASE_ADDR,
int enable_multicast = 1,
int use_storable_context = 0,
int round_trip_timeout = 0,
int use_round_trip_timeout = 0,
size_t bsize = 1 )

Constructor. Attempts to find an existing Naming Service if resolve_for_existing_naming_service is set to true. If it is false, or no Naming Service was found during a timeout period, create the Naming Service in this process. If creating the Naming Service locally, make the root context of size <context_size>, register it under the <poa>, and make the Naming Service persistent if <persistence_location> is not 0. (<persistence_location> specifies name of the file to use for persistent storage, <base_addr> specifies the address used for memory mapping <persistent_location> file). If <enable_multicast> is not zero then the service will respond to multicast location queries.

◆ ~TAO_Naming_Server()

TAO_Naming_Server::~TAO_Naming_Server ( )
virtual

Destructor.

Member Function Documentation

◆ assign()

void TAO_Naming_Server::assign ( size_t ndx,
bool take,
CORBA::Object_ptr obj )
protected

◆ bundle_at() [1/2]

TAO_Naming_Server::IOR_Bundle * TAO_Naming_Server::bundle_at ( size_t ndx)
protected

◆ bundle_at() [2/2]

const TAO_Naming_Server::IOR_Bundle * TAO_Naming_Server::bundle_at ( size_t ndx) const
protected

◆ fini()

int TAO_Naming_Server::fini ( )
virtual

Destroy the child POA created in init_with_orb.

◆ init()

int TAO_Naming_Server::init ( CORBA::ORB_ptr orb,
PortableServer::POA_ptr poa,
size_t context_size = ACE_DEFAULT_MAP_SIZE,
ACE_Time_Value * timeout = 0,
bool resolve_for_existing_naming_service = true,
const ACE_TCHAR * persistence_location = 0,
void * base_addr = TAO_NAMING_BASE_ADDR,
int enable_multicast = 1,
int use_storable_context = 0,
int round_trip_timeout = 0,
int use_round_trip_timeout = 0 )

Initializer. Attempts to find an existing Naming Service if resolve_for_existing_naming_service is set to true. If it is false, or no Naming Service was found during a <timeout> period, create the Naming Service in this process. If creating the Naming Service locally, make the root context of size <context_size>, register it under the <poa>, and make the Naming Service persistent if <persistence_location> is not 0. (<persistence_location> specifies name of the file to use for persistent storage, <base_addr> specifies the address used for memory mapping <persistent_location> file). If <enable_multicast> is not zero then the service will respond to multicast location queries.

◆ init_new_naming()

int TAO_Naming_Server::init_new_naming ( CORBA::ORB_ptr orb,
PortableServer::POA_ptr root_poa,
const ACE_TCHAR * persistence_location,
void * base_addr,
size_t context_size,
int enable_multicast,
int use_storable_context,
int round_trip_timeout = 0,
int use_round_trip_timeout = 0 )
protectedvirtual

Helper method: create Naming Service locally. Can be specialized to refine how Naming Service components are created and initialized Make the root context of size context_size, register it under the root_poa, and make the Naming Service persistent if <persistence_location> is not 0. (<persistence_location> specifies name of the file to use for persistent storage). If <enable_multicast> is not zero then the service will respond to multicast location queries.

◆ init_with_orb()

int TAO_Naming_Server::init_with_orb ( int argc,
ACE_TCHAR * argv[],
CORBA::ORB_ptr orb )
virtual

Initialize the Naming Service with the command line arguments and the ORB.

◆ naming_service_ior()

char * TAO_Naming_Server::naming_service_ior ( )

Returns the IOR of the naming service.

◆ operator->()

CosNaming::NamingContext_ptr TAO_Naming_Server::operator-> ( ) const

Returns a <NamingContext_ptr> for the root Naming Context.

◆ parse_args()

int TAO_Naming_Server::parse_args ( int argc,
ACE_TCHAR * argv[] )
protectedvirtual

parses the arguments.

◆ persistent_naming_context_factory()

TAO_Persistent_Naming_Context_Factory * TAO_Naming_Server::persistent_naming_context_factory ( )
protectedvirtual

◆ storable_naming_context_factory()

TAO_Storable_Naming_Context_Factory * TAO_Naming_Server::storable_naming_context_factory ( size_t context_size)
protectedvirtual

◆ write()

int TAO_Naming_Server::write ( size_t ndx) const
protected

◆ write_ior_to_file()

int TAO_Naming_Server::write_ior_to_file ( const char * ior_string,
const char * file_name )
protected

Write the provided ior_string to the file. Return 0 if success.

Member Data Documentation

◆ base_address_

void* TAO_Naming_Server::base_address_
protected

Address to be used for memory mapping Naming Service state file, identified by the <persistence_file_name_>.

◆ bundle_size_

size_t TAO_Naming_Server::bundle_size_
protected

◆ context_index_

TAO_Persistent_Context_Index* TAO_Naming_Server::context_index_
protected

Pointer to the object used to create/initialize the Naming Service when local persistent Naming Service is desired.

◆ context_size_

size_t TAO_Naming_Server::context_size_
protected

Size of the hash_table allocated upon the creation of the Naming Service context (if one is created). Note: all the contexts created under the given context will use the same size for their initial hash table allocations.

◆ ior_multicast_

TAO_IOR_Multicast* TAO_Naming_Server::ior_multicast_
protected

The ior_multicast event handler.

◆ iors_

IOR_Bundle* TAO_Naming_Server::iors_
protected

Although this class only manages the root context info the FT class adds primary/backup IORs for the root context as well as IORs for LB groups as well.

◆ multicast_

int TAO_Naming_Server::multicast_
protected

If not zero multicast is enabled.

◆ ns_poa_

PortableServer::POA_var TAO_Naming_Server::ns_poa_
protected

The Naming Service POA.

◆ orb_

CORBA::ORB_var TAO_Naming_Server::orb_
protected

The ORB.

◆ persistence_dir_

const ACE_TCHAR* TAO_Naming_Server::persistence_dir_
protected

Path to the file to be used to store/read in Naming Service persistent state.

◆ pid_file_name_

const ACE_TCHAR* TAO_Naming_Server::pid_file_name_
protected

File to output the process id.

◆ root_poa_

PortableServer::POA_var TAO_Naming_Server::root_poa_
protected

The Root POA.

◆ round_trip_timeout_

int TAO_Naming_Server::round_trip_timeout_
protected

If not zero use round trip timeout policy set to value specified.

◆ servant_activator_

TAO_Storable_Naming_Context_Activator* TAO_Naming_Server::servant_activator_
protected

Need to retain the servant activator between calls to init_with_orb() and init_new_naming().

◆ use_redundancy_

int TAO_Naming_Server::use_redundancy_
protected

If not zero support redundant naming servers.

◆ use_round_trip_timeout_

int TAO_Naming_Server::use_round_trip_timeout_
protected

◆ use_servant_activator_

int TAO_Naming_Server::use_servant_activator_
protected

If not zero use servant activator that uses flat file persistence.

◆ use_storable_context_

int TAO_Naming_Server::use_storable_context_
protected

If not zero use flat file persistence.


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