TAO_ORB_Core Class Reference

Encapsulates the state of an ORB. More...

#include <ORB_Core.h>

Collaboration diagram for TAO_ORB_Core:
Collaboration graph
[legend]

List of all members.

Public Types

typedef void(* Timeout_Hook )(TAO_ORB_Core *, TAO_Stub *, bool &, ACE_Time_Value &)
 Define the Timeout_Hook signature.
typedef void(* Sync_Scope_Hook )(TAO_ORB_Core *, TAO_Stub *, bool &, Messaging::SyncScope &)
typedef ACE_Array_Map
< ACE_CString, ACE_CString
InitRefMap

Public Member Functions

 TAO_ORB_Core (const char *id, ACE_Intrusive_Auto_Ptr< ACE_Service_Gestalt > g)
 Constructor.
TAO_ORB_Parametersorb_params (void)
 Accessor for the ORB parameters.
TAO_Connector_Registryconnector_registry (void)
 Get the connector registry.
TAO_Parser_Registryparser_registry (void)
 Get the IOR parser registry.
TAO::PolicyFactory_Registry_Adapter * policy_factory_registry (void)
TAO::ORBInitializer_Registry_Adapter * orbinitializer_registry (void)
TAO_ZIOP_Adapterziop_adapter () const
void ziop_adapter (TAO_ZIOP_Adapter *adapter)
TAO_Service_Context_Registryservice_context_registry (void)
TAO_ProtocolFactorySetprotocol_factories (void)
 Get the protocol factories.
CORBA::ORB_ptr orb (void)
 Get pointer to the ORB.
ACE_Reactorreactor (void)
 Wrappers that forward the request to the concurrency strategy.
ACE_Thread_Managerthr_mgr (void)
 Get the ACE_Thread_Manager.
CORBA::Object_ptr root_poa (void)
 Return the RootPOA, or try to load it if not initialized already.
TAO_Adapter_Registryadapter_registry (void)
 Get the adapter registry.
TAO_Adapterpoa_adapter (void)
TAO_Protocols_Hooksget_protocols_hooks (void)
 Gets the value of TAO_ORB_Core::protocols_hooks__.
TAO_Network_Priority_Protocols_Hooksget_network_priority_protocols_hooks (void)
 Gets the value of TAO_ORB_Core::network_priority_protocols_hooks__.
int is_collocated (const TAO_MProfile &mprofile)
ACE_Allocatoroutput_cdr_dblock_allocator (void)
ACE_Allocatoroutput_cdr_buffer_allocator (void)
ACE_Allocatoroutput_cdr_msgblock_allocator (void)
ACE_Allocatorinput_cdr_dblock_allocator (void)
ACE_Allocatorinput_cdr_buffer_allocator (void)
ACE_Allocatorinput_cdr_msgblock_allocator (void)
ACE_Allocatortransport_message_buffer_allocator (void)
ACE_Data_Blockcreate_input_cdr_data_block (size_t size)
ACE_Locklocking_strategy (void)
 Return the locking strategy used for the data blocks.
void call_timeout_hook (TAO_Stub *stub, bool &has_timeout, ACE_Time_Value &time_value)
 Invoke the timeout hook if present.
void set_timeout_hook (Timeout_Hook hook)
void connection_timeout (TAO_Stub *stub, bool &has_timeout, ACE_Time_Value &time_value)
 Invoke the timeout hook if present.
void call_sync_scope_hook (TAO_Stub *stub, bool &has_synchronization, Messaging::SyncScope &scope)
void set_sync_scope_hook (Sync_Scope_Hook hook)
TAO_ORB_Core_TSS_Resourcesget_tss_resources (void)
 Obtain the TSS resources of this orb.
void * get_tss_resource (size_t slot_id)
 Obtain the TSS resource in the given slot.
int set_tss_resource (size_t slot_id, void *)
int add_tss_cleanup_func (ACE_CLEANUP_FUNC cleanup, size_t &slot_id)
TAO_Cleanup_Func_Registrytss_cleanup_funcs (void)
 Return the underlying TSS cleanup function registry.
TAO_Leader_Followerleader_follower (void)
 Get access to the leader_follower class.
TAO_LF_Strategylf_strategy (void)
 Get access to the leader follower strategy.
TAO_Thread_Lane_Resourceslane_resources (void)
 Get access to the thread lane resources.
int run (ACE_Time_Value *tv, int perform_work)
 Run the event loop.
void shutdown (CORBA::Boolean wait_for_completion)
 End the event loop.
bool has_shutdown (void) const
 Get the shutdown flag value.
void destroy (void)
 Shutdown the ORB and free resources.
void check_shutdown (void)
 Check if ORB has shutdown. If it has, throw an exception.
int thread_per_connection_timeout (ACE_Time_Value &timeout) const
TAO_Stubcreate_stub_object (TAO_MProfile &mprofile, const char *type_id, CORBA::PolicyList *policy_list)
TAO_Stubcreate_stub (const char *repository_id, const TAO_MProfile &profiles)
CORBA::Object_ptr create_object (TAO_Stub *the_stub)
CORBA::Long initialize_object (TAO_Stub *the_stub, CORBA::Object_ptr obj)
CORBA::Long reinitialize_object (TAO_Stub *stub)
const char * orbid (void) const
 Return ORBid string.
CORBA::Boolean use_implrepo (void)
 Do we attempt to register with the Implementation Repository.
CORBA::Boolean imr_endpoints_in_ior (void)
 Do we put the ImR's endpoints into persistent object references we create.
CORBA::Object_ptr resolve_typecodefactory (void)
 Resolve the TypeCodeFactory DLL.
CORBA::Object_ptr resolve_poa_current (void)
 Resolve POA Current.
CORBA::Object_ptr resolve_codecfactory (void)
 Resolve the CodecFactory DLL.
CORBA::Object_ptr resolve_compression_manager (void)
 Resolve the Compression DLL.
CORBA::Object_ptr resolve_dynanyfactory (void)
 Resolve the Dynamic Any Factory.
CORBA::Object_ptr resolve_ior_manipulation (void)
 Resolve the IOR Manipulation reference for this ORB.
TAO_ZIOP_Adapterziop_adapter_i (void)
CORBA::Object_ptr resolve_ior_table (void)
 Resolve the IOR Table reference for this ORB.
CORBA::Object_ptr resolve_monitor (void)
 Resolve the Monitor reference for this ORB.
CORBA::Object_ptr resolve_rir (const char *name)
 Resolve an initial reference via the -ORBInitRef and.
const char * server_id (void) const
CORBA::ORB_ObjectIdList * list_initial_references (void)
 List all the service known by the ORB.
unsigned long _incr_refcnt (void)
 Reference counting...
unsigned long _decr_refcnt (void)
unsigned long _refcnt (void) const
int register_handle (ACE_HANDLE handle)
int remove_handle (ACE_HANDLE handle)
TAO_Valuetype_Adaptervaluetype_adapter (void)
 Return the valuetype adapter.
TAO_IORInterceptor_Adapterior_interceptor_adapter (void)
CORBA::Boolean bidir_giop_policy (void)
void bidir_giop_policy (CORBA::Boolean)
TAO_Object_Ref_Tableobject_ref_table (void)
TAO::ObjectKey_Table & object_key_table (void)
 Acceessor to the table that stores the object_keys.
TAO_Request_Dispatcherrequest_dispatcher (void)
 Return the current request dispatcher strategy.
void request_dispatcher (TAO_Request_Dispatcher *rd)
void load_policy_validators (TAO_Policy_Validator &validator)
TAO_Flushing_Strategyflushing_strategy (void)
 Return the flushing strategy.
TAO_Codeset_Managercodeset_manager (void)
 Get Code Set Manager.
InitRefMapinit_ref_map (void)
 Return a pointer to the -ORBInitRef map.
void set_default (const char *orb_id)
void not_default (const char *orb_id)
 Choose to be not a default ORB when there is more than one ORB.
CORBA::Boolean is_permanent_forward_condition (const CORBA::Object_ptr obj, const TAO_Service_Context &service_context)
ACE_Service_Gestaltconfiguration () const
 Configuration accessor method.
auto_ptr
< TAO_GIOP_Fragmentation_Strategy
fragmentation_strategy (TAO_Transport *transport)
 Get outgoing fragmentation strategy.
Access to Factories

These factories are not thread-specific, and are presented here in order to have one place to get useful information. Often, the instances to which the return pointers are stored in the Service Repository.



TAO_Resource_Factoryresource_factory (void)
 Returns pointer to the resource factory.
TAO::GUIResource_Factory * gui_resource_factory (void)
 Returns pointer to the factory for creating gui resources.
TAO_Client_Strategy_Factoryclient_factory (void)
 Returns pointer to the client factory.
TAO_Server_Strategy_Factoryserver_factory (void)
 Returns pointer to the server factory.
TAO_Protocols_Hooksprotocols_hooks (void)
 Returns pointer to the Protocols_Hooks.
TAO_Thread_Lane_Resources_Managerthread_lane_resources_manager (void)
 Returns a pointer to the Thread Lane Resources Manager.
TAO_Collocation_Resolvercollocation_resolver (void)
 Returns a pointer to the Collocation Resolver.
TAO_Stub_Factorystub_factory (void)
 Returns a pointer to the Stub factory.
TAO_Endpoint_Selector_Factoryendpoint_selector_factory (void)
 Returns a pointer to the endpoint selector factory.
ORB Core Service Hooks

These methods would represent the hooks in the ORB Core. These hooks would be used to call back on the services or other features that are dynamically loaded.



CORBA::Boolean service_profile_selection (const TAO_MProfile &mprofile, TAO_Profile *&profile)
CORBA::Boolean object_is_nil (CORBA::Object_ptr object)
TAO_Service_Callbacks::Profile_Equivalence is_profile_equivalent (const TAO_Profile *this_p, const TAO_Profile *that_p)
CORBA::ULong hash_service (TAO_Profile *this_p, CORBA::ULong max)
TAO_Fault_Tolerance_Servicefault_tolerance_service (void)
 Return a reference to the Fault Tolerant service object.
CORBA::Boolean ft_send_extended_sc (void)
TAO::Invocation_Status service_raise_comm_failure (IOP::ServiceContextList &clist, TAO_Profile *profile)
TAO::Invocation_Status service_raise_transient_failure (IOP::ServiceContextList &clist, TAO_Profile *profile)
Portable Interceptor Related Methods

These are support methods for interceptor registration and interceptor set (an array) access, in addition to PICurrent access.



void add_interceptor (PortableInterceptor::IORInterceptor_ptr interceptor)
 Register an IOR interceptor.

Static Public Member Functions

static void set_resource_factory (const char *resource_factory_name)
 Sets the value of TAO_ORB_Core::resource_factory_.
static void set_gui_resource_factory (TAO::GUIResource_Factory *gui_factory)
static void set_network_priority_protocols_hooks (const char *network_priority_protocols_hooks_name)
 Sets the value of TAO_ORB_Core::network_priority_protocols_hooks_.
static void dynamic_adapter_name (const char *name)
 Sets the value of TAO_ORB_Core::dynamic_adapter_name_.
static const char * dynamic_adapter_name (void)
 Gets the value of TAO_ORB_Core::dynamic_adapter_name_.
static void ifr_client_adapter_name (const char *name)
 Sets the value of TAO_ORB_Core::ifr_client_adapter_name_.
static const char * ifr_client_adapter_name (void)
 Gets the value of TAO_ORB_Core::ifr_client_adapter_name_.
static void typecodefactory_adapter_name (const char *name)
 Sets the value of TAO_ORB_Core::typecodefactory_adapter_name_.
static const char * typecodefactory_adapter_name (void)
 Gets the value of TAO_ORB_Core::typecodefactory_adapter_name_.
static void iorinterceptor_adapter_factory_name (const char *name)
 Sets the value of TAO_ORB_Core::iorinterceptor_adapter_factory_name_.
static const char * iorinterceptor_adapter_factory_name (void)
 Gets the value of TAO_ORB_Core::iorinterceptor_adapter_factory_name_.
static void valuetype_adapter_factory_name (const char *name)
 Sets the value of TAO_ORB_Core::valuetype_adapter_factory_name.
static const char * valuetype_adapter_factory_name (void)
 Gets the value of TAO_ORB_Core::valuetype_adapter_factory_name.
static void connection_timeout_hook (Timeout_Hook hook)
 Define the Timeout_Hook signature.

Public Attributes

TAO_Protocols_Hooksprotocols_hooks_
 Handle to the factory for protocols_hooks_..
TAO_Network_Priority_Protocols_Hooksnetwork_priority_protocols_hooks_
 Handle to the factory for network_priority_protocols_hooks_..

Protected Member Functions

 ~TAO_ORB_Core (void)
int init (int &argc, char *argv[])
int fini (void)
ACE_Data_Blockcreate_data_block_i (size_t size, ACE_Allocator *buffer_allocator, ACE_Allocator *dblock_allocator, ACE_Lock *lock)
 Routine that creates a ACE_Data_Block given the lock and allocators.
void resolve_typecodefactory_i (void)
 Obtain and cache the typecode factory object reference.
void resolve_poa_current_i (void)
 Obtain and cache the poa current.
void resolve_codecfactory_i (void)
 Obtain and cache the codec factory object reference.
void resolve_compression_manager_i (void)
 Obtain and cache the compression manager object reference.
void resolve_dynanyfactory_i (void)
 Obtain and cache the dynamic any factory object reference.
void resolve_iormanipulation_i (void)
 Obtain and cache the IORManipulation factory object reference.
void resolve_monitor_i (void)
 Obtain and cache the Monitor object reference.
void services_callbacks_init (void)
void destroy_interceptors (void)
int set_endpoint_helper (const ACE_CString &lane, const ACE_CString &endpoints)
TAO::PolicyFactory_Registry_Adapter * policy_factory_registry_i (void)
TAO::ORBInitializer_Registry_Adapter * orbinitializer_registry_i (void)
CORBA::Long initialize_object_i (TAO_Stub *the_stub, const TAO_MProfile &mprofile)
 Common code from initialize_object and reinitialize_object.
 ACE_TSS_TYPE (TAO_ORB_Core_TSS_Resources) tss_resources_
 This is where the tss resources for this ORB are stored.

Protected Attributes

TAO_SYNCH_MUTEX lock_
 Synchronize internal state...
TAO_Thread_Lane_Resources_Managerthread_lane_resources_manager_
TAO_Collocation_Resolvercollocation_resolver_
TAO_Stub_Factorystub_factory_
TAO_ProtocolFactorySetprotocol_factories_
CORBA::Object_ptr implrepo_service_
 The cached IOR for the Implementation Repository.
int use_implrepo_
 Flag for whether the implrepo support is enabled or not.
int imr_endpoints_in_ior_
 Flag for whether to put the ImR endpoints into our object refs.
CORBA::Object_ptr typecode_factory_
 The cached IOR for the TypeCodeFactory DLL.
CORBA::Object_ptr codec_factory_
 The cached IOR for the CodecFactory DLL.
CORBA::Object_ptr compression_manager_
 The cached IOR for the Compression DLL.
CORBA::Object_ptr dynany_factory_
 The cached object reference for the DynAnyFactory.
CORBA::Object_ptr ior_manip_factory_
 The cached object reference for the IORManipulataion.
CORBA::Object_ptr ior_table_
 The cached object reference for the IORTable.
CORBA::Object_ptr monitor_
 The cached object reference for the Monitor.
CORBA::ORB_ptr orb_
CORBA::Object_var root_poa_
TAO_ORB_Parameters orb_params_
 Parameters used by the ORB.
InitRefMap init_ref_map_
 Return InitRefMap to find if a particular object id is present.
TAO_Object_Ref_Table object_ref_table_
TAO::ObjectKey_Table object_key_table_
 Table that stores the object key instead of caching one per-profile.
char * orbid_
 The ORBid for this ORB.
TAO_Resource_Factoryresource_factory_
 Handle to the factory for resource information..
ACE_CString server_id_
 The server_id_ that was passed via -ORBServerId option.
TAO_Client_Strategy_Factoryclient_factory_
 Handle to the factory for Client-side strategies.
TAO_Server_Strategy_Factoryserver_factory_
 Handle to the factory for Server-side strategies.
CORBA::Boolean ft_send_extended_sc_
CORBA::Boolean opt_for_collocation_
CORBA::Boolean use_global_collocation_
CORBA::ULong collocation_strategy_
 Default collocation policy. This should never be ORB_CONTROL.
TAO_Request_Dispatcherrequest_dispatcher_
 The request dispatching strategy.
CORBA::Object_var poa_current_
TAO_Adapter_Registry adapter_registry_
 The list of Adapters used in this ORB.
TAO_Adapterpoa_adapter_
 An optimization for the POA.
ACE_Thread_Manager tm_
 The Thread Manager.
ACE_Lock_Adapter< TAO_SYNCH_MUTEX > data_block_lock_
 The data block reference counts are locked using this mutex.
TAO_Cleanup_Func_Registry tss_cleanup_funcs_
bool has_shutdown_
 Flag which denotes that the ORB has been shutdown.
TAO_SYNCH_MUTEX open_lock_
 Mutual exclusion for calling open.
TAO_Endpoint_Selector_Factoryendpoint_selector_factory_
ACE_Atomic_Op< TAO_SYNCH_MUTEX,
unsigned long > 
refcount_
 Number of outstanding references to this object.
TAO::PolicyFactory_Registry_Adapter * policy_factory_registry_
 Registry containing all registered policy factories.
TAO::ORBInitializer_Registry_Adapter * orbinitializer_registry_
 Registry containing all orb initializers.
TAO_Service_Context_Registry service_context_registry_
 Registry containing all service context handlers.
TAO_IORInterceptor_Adapterior_interceptor_adapter_
 IORInterceptor adapter.
TAO_Valuetype_Adaptervaluetype_adapter_
 Pointer to the valuetype adapter.
TAO_Parser_Registry parser_registry_
 The IOR parser registry.
TAO_BiDir_Adapterbidir_adapter_
 BiDirectional GIOP factory.
CORBA::Boolean bidir_giop_policy_
 Bir Dir GIOP policy value.
TAO_ZIOP_Adapterziop_adapter_
 ZIOP Adapter.
CORBA::Boolean ziop_enabled_
 ZIOP enabled or not.
TAO_Flushing_Strategyflushing_strategy_
 Hold the flushing strategy.
TAO_Codeset_Managercodeset_manager_
 Code Set Manager, received from the Resource Factory.
ACE_Intrusive_Auto_Ptr
< ACE_Service_Gestalt
config_
 ORB's service configuration.
Sync_Scope_Hook sync_scope_hook_
 The hook to be set for the SyncScopePolicy.
Timeout_Hook timeout_hook_
 The hook to be set for the RelativeRoundtripTimeoutPolicy.
Service Level Hooks



TAO_Fault_Tolerance_Service ft_service_
 Fault Tolerant service hook.

Private Member Functions

void resolve_ior_table_i (void)
 Obtain and cache the dynamic any factory object reference.
CORBA::Boolean is_collocation_enabled (TAO_ORB_Core *other_orb, const TAO_MProfile &mp)

Private Attributes

bool use_local_memory_pool_

Friends

class TAO_ORB_Core_Auto_Ptr
CORBA::ORB_ptr CORBA::ORB_init (int &, ACE_TCHAR *argv[], const char *)

Collocation Strategies



enum  { ORB_CONTROL, THRU_POA, DIRECT }
static TAO::Collocation_Strategy collocation_strategy (CORBA::Object_ptr object)



int thread_per_connection_use_timeout_
 The value of the timeout if the flag above is not zero.
ACE_Time_Value thread_per_connection_timeout_
 The value of the timeout if the flag above is not zero.
CORBA::Object_ptr poa_current (void)
 Accessor to the POA current.
void optimize_collocation_objects (CORBA::Boolean opt)
 Set/get the collocation flags.
CORBA::Boolean optimize_collocation_objects (void) const
 The value of the timeout if the flag above is not zero.
void use_global_collocation (CORBA::Boolean opt)
 The value of the timeout if the flag above is not zero.
CORBA::Boolean use_global_collocation (void) const
 The value of the timeout if the flag above is not zero.
CORBA::ULong get_collocation_strategy (void) const
 The value of the timeout if the flag above is not zero.
CORBA::Environmentdefault_environment (void) const
void default_environment (CORBA::Environment *)
 The value of the timeout if the flag above is not zero.
CORBA::Object_ptr implrepo_service (void)
 Set/Get the IOR of the Implementation Repository service.
void implrepo_service (const CORBA::Object_ptr ir)
 The value of the timeout if the flag above is not zero.
 TAO_ORB_Core (const TAO_ORB_Core &)
 The ORB Core should not be copied.
void operator= (const TAO_ORB_Core &)
 The value of the timeout if the flag above is not zero.

Detailed Description

Encapsulates the state of an ORB.

This is the implementation class for the CORBA::ORB interface. The class also encapsulates the access to the ORB resources and its state.

Some resources can be TSS or global, those resources are always accessed through a TSS interface, but are allocated using the Resource_Factory. If the resource is really global the Resource_Factory will simply return a pointer to the global instance.

Definition at line 160 of file ORB_Core.h.


Member Typedef Documentation

Definition at line 861 of file ORB_Core.h.

typedef void(* TAO_ORB_Core::Sync_Scope_Hook)(TAO_ORB_Core *, TAO_Stub *, bool &, Messaging::SyncScope &)

Definition at line 533 of file ORB_Core.h.

Define the Timeout_Hook signature.

Definition at line 474 of file ORB_Core.h.


Member Enumeration Documentation

anonymous enum

This method returns the right collocation strategy, if any, to be used to perform a method invocation on the given object.

Note:
No-Collocation is a special case of collocation.
Enumerator:
ORB_CONTROL 

Indicate object should refer to ORB for either one of the following strategies.

THRU_POA 

Collocated calls will go thru POA.

DIRECT 

Collocated calls invoke operation on Servant directly.

Definition at line 230 of file ORB_Core.h.

00231   {
00232     /// Indicate object should refer to ORB for either one of the
00233     /// following strategies.
00234     ORB_CONTROL,
00235 
00236     /// Collocated calls will go thru POA.
00237     THRU_POA,
00238 
00239     /// Collocated calls invoke operation on Servant directly.
00240     DIRECT
00241   };


Constructor & Destructor Documentation

TAO_ORB_Core::TAO_ORB_Core ( const char *  id,
ACE_Intrusive_Auto_Ptr< ACE_Service_Gestalt g 
)

Constructor.

Definition at line 186 of file ORB_Core.cpp.

00188   : protocols_hooks_ (0),
00189     network_priority_protocols_hooks_ (0),
00190 #if TAO_USE_LOCAL_MEMORY_POOL == 1
00191     use_local_memory_pool_ (true),
00192 #else
00193     use_local_memory_pool_ (false),
00194 #endif
00195     lock_ (),
00196     thread_lane_resources_manager_ (0),
00197     collocation_resolver_ (0),
00198     stub_factory_ (0),
00199     protocol_factories_ (0),
00200     implrepo_service_ (CORBA::Object::_nil ()),
00201     use_implrepo_ (0),
00202     imr_endpoints_in_ior_ (1),
00203     typecode_factory_ (CORBA::Object::_nil ()),
00204     codec_factory_ (CORBA::Object::_nil ()),
00205     compression_manager_ (CORBA::Object::_nil ()),
00206     dynany_factory_ (CORBA::Object::_nil ()),
00207     ior_manip_factory_ (CORBA::Object::_nil ()),
00208     ior_table_ (CORBA::Object::_nil ()),
00209     monitor_ (CORBA::Object::_nil ()),
00210     orb_ (CORBA::ORB::_nil ()),
00211     root_poa_ (),
00212     orb_params_ (),
00213     init_ref_map_ (TAO_DEFAULT_OBJECT_REF_TABLE_SIZE),
00214     object_ref_table_ (),
00215     object_key_table_ (),
00216     orbid_ (ACE_OS::strdup (orbid ? orbid : "")),
00217     resource_factory_ (0),
00218     client_factory_ (0),
00219     server_factory_ (0),
00220     ft_send_extended_sc_ (false),
00221     opt_for_collocation_ (true),
00222     use_global_collocation_ (true),
00223     collocation_strategy_ (THRU_POA),
00224 
00225 #if (TAO_HAS_CORBA_MESSAGING == 1)
00226 
00227     policy_manager_ (0),
00228     default_policies_ (0),
00229     policy_current_ (0),
00230 
00231 #endif /* TAO_HAS_CORBA_MESSAGING == 1 */
00232 
00233     poa_current_ (),
00234     adapter_registry_ (this),
00235     poa_adapter_ (0),
00236     tm_ (),
00237     tss_cleanup_funcs_ (),
00238     tss_resources_ (),
00239     has_shutdown_ (true),  // Start the ORB in a  "shutdown" state.  Only
00240                            // after CORBA::ORB_init() is called will the
00241                            // ORB no longer be shutdown.  This does not
00242                            // mean that the ORB can be reinitialized.  It
00243                            // can only be initialized once.
00244     thread_per_connection_use_timeout_ (1),
00245     open_lock_ (),
00246     endpoint_selector_factory_ (0),
00247 #if (TAO_HAS_BUFFERING_CONSTRAINT_POLICY == 1)
00248     eager_transport_queueing_strategy_ (0),
00249     delayed_transport_queueing_strategy_ (0),
00250     flush_transport_queueing_strategy_ (0),
00251 #endif /* TAO_HAS_BUFFERING_CONSTRAINT_POLICY == 1 */
00252     refcount_ (1),
00253     policy_factory_registry_ (0),
00254     orbinitializer_registry_ (0),
00255 #if (TAO_HAS_INTERCEPTORS == 1)
00256     pi_current_ (CORBA::Object::_nil ()),
00257     client_request_interceptor_adapter_ (0),
00258     server_request_interceptor_adapter_ (0),
00259 #endif  /* TAO_HAS_INTERCEPTORS == 1 */
00260     ior_interceptor_adapter_ (0),
00261     valuetype_adapter_ (0),
00262     parser_registry_ (),
00263     bidir_adapter_ (0),
00264     bidir_giop_policy_ (0),
00265     ziop_adapter_ (0),
00266     ziop_enabled_ (false),
00267     flushing_strategy_ (0),
00268     codeset_manager_ (0),
00269     config_ (gestalt),
00270     sync_scope_hook_ (0),
00271     timeout_hook_ (0)
00272 {
00273 #if (TAO_HAS_BUFFERING_CONSTRAINT_POLICY == 1)
00274 
00275   ACE_NEW (this->flush_transport_queueing_strategy_,
00276            TAO::Flush_Transport_Queueing_Strategy);
00277 
00278 #endif /* TAO_HAS_BUFFERING_CONSTRAINT_POLICY == 1 */
00279 
00280 #if (TAO_HAS_CORBA_MESSAGING == 1)
00281 
00282   ACE_NEW (this->policy_manager_,
00283            TAO_Policy_Manager);
00284 
00285   ACE_NEW (this->default_policies_,
00286            TAO_Policy_Set (TAO_POLICY_ORB_SCOPE));
00287 
00288   ACE_NEW (this->policy_current_,
00289            TAO_Policy_Current);
00290 
00291 #endif /* TAO_HAS_CORBA_MESSAGING == 1 */
00292 
00293   // Initialize the default request dispatcher.
00294   ACE_NEW (this->request_dispatcher_,
00295            TAO_Request_Dispatcher);
00296 
00297 }

TAO_ORB_Core::~TAO_ORB_Core ( void   )  [protected]

Destructor is protected since the ORB Core is a reference counted object.

Definition at line 299 of file ORB_Core.cpp.

00300 {
00301   delete this->thread_lane_resources_manager_;
00302 
00303   delete this->flushing_strategy_;
00304 
00305   ACE_OS::free (this->orbid_);
00306 
00307 #if (TAO_HAS_BUFFERING_CONSTRAINT_POLICY == 1)
00308 
00309   delete this->eager_transport_queueing_strategy_;
00310   delete this->delayed_transport_queueing_strategy_;
00311   delete this->flush_transport_queueing_strategy_;
00312 
00313 #endif /* TAO_HAS_BUFFERING_CONSTRAINT_POLICY == 1 */
00314 
00315 #if (TAO_HAS_CORBA_MESSAGING == 1)
00316 
00317   ::CORBA::release (this->policy_manager_);
00318   delete this->default_policies_;
00319   ::CORBA::release (this->policy_current_);
00320 
00321 #endif /* TAO_HAS_CORBA_MESSAGING == 1 */
00322 
00323   delete this->request_dispatcher_;
00324 
00325   delete this->policy_factory_registry_;
00326 
00327   // Don't delete, is a process wide singleton shared by all orbs
00328   orbinitializer_registry_ = 0;
00329 
00330   ::CORBA::release (this->orb_);
00331 
00332   delete this->codeset_manager_;
00333   this->codeset_manager_ = 0;
00334 
00335   // This will destroy the service repository for this core
00336   (void) TAO::ORB::close_services (this->config_);
00337 
00338 }

TAO_ORB_Core::TAO_ORB_Core ( const TAO_ORB_Core  )  [private]

The ORB Core should not be copied.


Member Function Documentation

unsigned long TAO_ORB_Core::_decr_refcnt ( void   ) 

Definition at line 29 of file ORB_Core.inl.

00030 {
00031   unsigned long const count = --this->refcount_;
00032   if (count != 0)
00033     return count;
00034 
00035   this->fini ();
00036   return 0;
00037 }

unsigned long TAO_ORB_Core::_incr_refcnt ( void   ) 

Reference counting...

Definition at line 17 of file ORB_Core.inl.

00018 {
00019   return this->refcount_++;
00020 }

unsigned long TAO_ORB_Core::_refcnt ( void   )  const

Definition at line 23 of file ORB_Core.inl.

00024 {
00025   return this->refcount_.value ();
00026 }

TAO_ORB_Core::ACE_TSS_TYPE ( TAO_ORB_Core_TSS_Resources   )  [protected]

This is where the tss resources for this ORB are stored.

TAO_Adapter_Registry & TAO_ORB_Core::adapter_registry ( void   ) 

Get the adapter registry.

Definition at line 172 of file ORB_Core.inl.

00173 {
00174   return this->adapter_registry_;
00175 }

void TAO_ORB_Core::add_interceptor ( PortableInterceptor::IORInterceptor_ptr  interceptor  ) 

Register an IOR interceptor.

Definition at line 3216 of file ORB_Core.cpp.

03218 {
03219   if (this->ior_interceptor_adapter ())
03220     {
03221       this->ior_interceptor_adapter_->add_interceptor (interceptor);
03222     }
03223   else
03224     {
03225       ACE_ERROR ((LM_ERROR,
03226                   ACE_TEXT ("TAO (%P|%t) - %p\n"),
03227                   ACE_TEXT ("ERROR: ORB Core unable to find the ")
03228                   ACE_TEXT ("IORInterceptor Adapter Factory instance")));
03229 
03230       throw ::CORBA::INTERNAL ();
03231     }
03232 }

int TAO_ORB_Core::add_tss_cleanup_func ( ACE_CLEANUP_FUNC  cleanup,
size_t &  slot_id 
)

Register a TSS cleanup function. The slot ID for the corresponding ORB core TSS resource is returned by the reference argument. This method return 0 on success, and -1 on failure.

Definition at line 3015 of file ORB_Core.cpp.

03016 {
03017   return this->tss_cleanup_funcs_.register_cleanup_function (cleanup, slot_id);
03018 }

void TAO_ORB_Core::bidir_giop_policy ( CORBA::Boolean  val  ) 

Definition at line 55 of file ORB_Core.inl.

00056 {
00057   this->bidir_giop_policy_ = val;
00058 }

CORBA::Boolean TAO_ORB_Core::bidir_giop_policy ( void   ) 

Set and Get methods to indicate whether a BiDir IIOP policy has been set in the POA.

Note:
At present, the value will be true even if one of the POA's is set with the Bi Dir GIOP policy.

Definition at line 49 of file ORB_Core.inl.

00050 {
00051   return this->bidir_giop_policy_;
00052 }

void TAO_ORB_Core::call_sync_scope_hook ( TAO_Stub stub,
bool &  has_synchronization,
Messaging::SyncScope &  scope 
)

Definition at line 2965 of file ORB_Core.cpp.

02968 {
02969   Sync_Scope_Hook sync_scope_hook = this->sync_scope_hook_;
02970 
02971   if (sync_scope_hook == 0)
02972     {
02973       has_synchronization = false;
02974       return;
02975     }
02976 
02977   (*sync_scope_hook) (this, stub, has_synchronization, scope);
02978 }

void TAO_ORB_Core::call_timeout_hook ( TAO_Stub stub,
bool &  has_timeout,
ACE_Time_Value time_value 
)

Invoke the timeout hook if present.

The timeout hook is used to determine if the timeout policy is set and with what value. If the ORB is compiled without support for Messaging this feature does not take effect

Parameters:
has_timeout returns 0 if there is no timeout policy set.
time_value returns the timeout value in effect for the object, thread and current ORB.

Definition at line 3021 of file ORB_Core.cpp.

03024 {
03025   Timeout_Hook timeout_hook = this->timeout_hook_;
03026 
03027   if (timeout_hook == 0)
03028     {
03029       has_timeout = false;
03030       return;
03031     }
03032   (*timeout_hook) (this, stub, has_timeout, time_value);
03033 }

void TAO_ORB_Core::check_shutdown ( void   ) 

Check if ORB has shutdown. If it has, throw an exception.

Definition at line 2354 of file ORB_Core.cpp.

02355 {
02356   if (this->has_shutdown ())
02357     {
02358       // As defined by the CORBA 2.3 specification, throw a
02359       // CORBA::BAD_INV_ORDER exception with minor code 4 if the ORB
02360       // has shutdown by the time an ORB function is called.
02361 
02362       throw ::CORBA::BAD_INV_ORDER (CORBA::OMGVMCID | 4, CORBA::COMPLETED_NO);
02363     }
02364 }

TAO_Client_Strategy_Factory * TAO_ORB_Core::client_factory ( void   ) 

Returns pointer to the client factory.

Definition at line 1805 of file ORB_Core.cpp.

01806 {
01807   if (this->client_factory_ == 0)
01808     {
01809       // Look in the service repository for an instance.
01810       this->client_factory_ =
01811         ACE_Dynamic_Service<TAO_Client_Strategy_Factory>::instance
01812           (this->configuration (),
01813            ACE_TEXT ("Client_Strategy_Factory"));
01814     }
01815 
01816   return this->client_factory_;
01817 }

TAO_Codeset_Manager * TAO_ORB_Core::codeset_manager ( void   ) 

Get Code Set Manager.

Definition at line 429 of file ORB_Core.inl.

00430 {
00431   if (this->orb_params()->negotiate_codesets() == 0)
00432     return 0;
00433   if (this->codeset_manager_ == 0)
00434     {
00435       // This causes a factory to be loaded which will call
00436       // the codeset_manager setter in this thread.
00437       this->codeset_manager_ =
00438         this->resource_factory()->codeset_manager();
00439       if (this->codeset_manager_ == 0)
00440         this->orb_params()->negotiate_codesets(false);
00441     }
00442   return this->codeset_manager_;
00443 }

TAO_Collocation_Resolver & TAO_ORB_Core::collocation_resolver ( void   ) 

Returns a pointer to the Collocation Resolver.

Definition at line 1618 of file ORB_Core.cpp.

01619 {
01620   // Check if there is a cached reference.
01621   if (this->collocation_resolver_ != 0)
01622     return *this->collocation_resolver_;
01623 
01624   // If not, lookup it up.
01625   this->collocation_resolver_ =
01626     ACE_Dynamic_Service<TAO_Collocation_Resolver>::instance
01627       (this->configuration (),
01628        ACE_TEXT_CHAR_TO_TCHAR (this->orb_params ()->collocation_resolver_name ()));
01629 
01630   return *this->collocation_resolver_;
01631 }

TAO::Collocation_Strategy TAO_ORB_Core::collocation_strategy ( CORBA::Object_ptr  object  )  [static]

This method returns the right collocation strategy, if any, to be used to perform a method invocation on the given object.

Note:
No-Collocation is a special case of collocation.

Definition at line 3501 of file ORB_Core.cpp.

03502 {
03503   TAO_Stub *stub = object->_stubobj ();
03504   if (!CORBA::is_nil (stub->servant_orb_var ().in ()) &&
03505       stub->servant_orb_var ()->orb_core () != 0)
03506     {
03507       TAO_ORB_Core *orb_core = stub->servant_orb_var ()->orb_core ();
03508 
03509       if (orb_core->collocation_resolver ().is_collocated (object))
03510         {
03511           switch (orb_core->get_collocation_strategy ())
03512             {
03513             case THRU_POA:
03514               return TAO::TAO_CS_THRU_POA_STRATEGY;
03515 
03516             case DIRECT:
03517               {
03518                 /////////////////////////////////////////////////////////////
03519                 // If the servant is null and you are collocated this means
03520                 // that the POA policy NON-RETAIN is set, and with that policy
03521                 // using the DIRECT collocation strategy is just insane.
03522                 /////////////////////////////////////////////////////////////
03523                 ACE_ASSERT (object->_servant () != 0);
03524                 return TAO::TAO_CS_DIRECT_STRATEGY;
03525               }
03526             }
03527         }
03528     }
03529 
03530   // In this case the Object is a client.
03531   return TAO::TAO_CS_REMOTE_STRATEGY;
03532 }

ACE_Service_Gestalt * TAO_ORB_Core::configuration ( void   )  const

Configuration accessor method.

Definition at line 11 of file ORB_Core.inl.

00012 {
00013   return this->config_.get ();
00014 }

void TAO_ORB_Core::connection_timeout ( TAO_Stub stub,
bool &  has_timeout,
ACE_Time_Value time_value 
)

Invoke the timeout hook if present.

The timeout hook is used to determine if the timeout policy is set and with what value. If the ORB is compiled without support for Messaging this feature does not take effect

Parameters:
has_timeout returns 0 if there is no timeout policy set.
time_value returns the timeout value in effect for the object, thread and current ORB.

Definition at line 3036 of file ORB_Core.cpp.

03039 {
03040   Timeout_Hook connection_timeout_hook =
03041     TAO_ORB_Core_Static_Resources::instance ()->connection_timeout_hook_;
03042 
03043   if (connection_timeout_hook == 0)
03044     {
03045       has_timeout = false;
03046       return;
03047     }
03048 
03049   (*connection_timeout_hook) (this, stub, has_timeout, time_value);
03050 
03051   Timeout_Hook alt_connection_timeout_hook =
03052     TAO_ORB_Core_Static_Resources::instance ()->alt_connection_timeout_hook_;
03053 
03054   if (alt_connection_timeout_hook == 0)
03055     return;
03056 
03057   if (!has_timeout || time_value == ACE_Time_Value::zero )
03058     {
03059       (*alt_connection_timeout_hook) (this, stub, has_timeout,time_value);
03060       return;
03061     }
03062 
03063   // At this point, both the primary and alternate hooks are defined, and
03064   // the primary did indeed set a value
03065   ACE_Time_Value tv1;
03066   bool ht1;
03067   (*alt_connection_timeout_hook) (this, stub, ht1,tv1);
03068   if (ht1 && tv1 > ACE_Time_Value::zero && tv1 < time_value)
03069     time_value = tv1;
03070 }

void TAO_ORB_Core::connection_timeout_hook ( Timeout_Hook  hook  )  [static]

Define the Timeout_Hook signature.

The connection timeout hook was originally defined to allow the TAO Messaging code to be factored out of the core TAO library and placed in to an optional library. Since then, a new invocation endpoint selector, the optimised connection endpoint selector (see Strategies/OC_Endpoint_Selector.h) reused this connection timeout hook. However, this set up a problem when both the Messaging library and OCES are being used in the same application.

The solution was to add a new connection timeout hook attribute (see alt_connection_timeout_hook_ below). This method now checks to see if the connection timeout hook is already set, and if so assigns the supplied hook value to the alternate connection timeout hook. This functionality has a side-effect of assuming that hooks are NEVER unloaded or actively replaced. IOW, no one will call this method with a 0 or some other pointer value to replace an existing hook.

If such functionality as unloading a hook pointer is required, then this method must be extended to give some kind of identity for the hook. Additional changes to the definition of the hook will also be necessary to support such identity and manipulation.

Definition at line 3073 of file ORB_Core.cpp.

03074 {
03075   // Saving the hook pointer so that we can use it later when needed.
03076   // For now there are only two entry points that may supply a connection
03077   // timeout hook. But there might be future entry points, so this should
03078   // probably be addressed by a more sophisticated mechanism.
03079 
03080 #define TOCSRi TAO_ORB_Core_Static_Resources::instance ()
03081 
03082   // A consern was raised that since this function is called by two
03083   // different initializers there may be a race condition that might
03084   // require a lock. We are not using a lock at this time because of
03085   // two callers, one happens only during service directive processing
03086   // and the other only during ORB Initialization time. The former
03087   // happens when the OC_Endpoint_Selector_Factory is loaded, the
03088   // latter is part of the messaging library. The messaging library
03089   // calls this function as part of pre_init processing, and this call
03090   // happes for every ORB instance. This was the case before these The
03091   // latter call occurs when the messaging library is loaded. The
03092   // redundant calls occured then as well. Second, it isn't clear how
03093   // a lock in this static method would react in the face of windows
03094   // dlls, shared memory segments, etc. Therefore we are continuing to
03095   // keep this code lockless as it always was, assuming no
03096   // simultanious overwrite will occur.
03097 
03098   if (TOCSRi->connection_timeout_hook_ == 0)
03099     {
03100       if (TAO_debug_level > 2)
03101         {
03102           ACE_DEBUG ((LM_DEBUG,
03103                       ACE_TEXT("TAO (%P|%t) - Setting primary connection ")
03104                       ACE_TEXT("timeout hook\n")));
03105         }
03106       TOCSRi->connection_timeout_hook_ = hook;
03107     }
03108   else if (TOCSRi->connection_timeout_hook_ != hook &&
03109            TOCSRi->alt_connection_timeout_hook_ == 0)
03110     {
03111       if (TAO_debug_level > 2)
03112         {
03113           ACE_DEBUG ((LM_DEBUG,
03114                       ACE_TEXT("TAO (%P|%t) - Setting alternate connection ")
03115                       ACE_TEXT("timeout hook\n")));
03116         }
03117       TOCSRi->alt_connection_timeout_hook_ = hook;
03118     }
03119   else
03120     if (TAO_debug_level > 2)
03121       {
03122         ACE_DEBUG ((LM_DEBUG,
03123                     ACE_TEXT ("TAO (%P|%t) - Not overwriting alternate ")
03124                     ACE_TEXT ("connection timeout hook. It is %@"),
03125                     TOCSRi->alt_connection_timeout_hook_));
03126       }
03127 
03128 #undef TOCSRi
03129 }

TAO_Connector_Registry * TAO_ORB_Core::connector_registry ( void   ) 

Get the connector registry.

Definition at line 2911 of file ORB_Core.cpp.

02912 {
02913   TAO_Connector_Registry *conn =
02914     this->lane_resources ().connector_registry ();
02915 
02916   return conn;
02917 }

ACE_Data_Block * TAO_ORB_Core::create_data_block_i ( size_t  size,
ACE_Allocator buffer_allocator,
ACE_Allocator dblock_allocator,
ACE_Lock lock 
) [protected]

Routine that creates a ACE_Data_Block given the lock and allocators.

Definition at line 2887 of file ORB_Core.cpp.

02891 {
02892   ACE_Data_Block *nb = 0;
02893 
02894   ACE_NEW_MALLOC_RETURN (
02895                          nb,
02896                          static_cast<ACE_Data_Block*> (
02897                            dblock_allocator->malloc (sizeof (ACE_Data_Block))),
02898                          ACE_Data_Block (size,
02899                                          ACE_Message_Block::MB_DATA,
02900                                          0,
02901                                          buffer_allocator,
02902                                          lock_strategy,
02903                                          0,
02904                                          dblock_allocator),
02905                          0);
02906 
02907   return nb;
02908 }

ACE_Data_Block * TAO_ORB_Core::create_input_cdr_data_block ( size_t  size  ) 

The Message Blocks used for input CDRs must have appropiate locking strategies.

Definition at line 2863 of file ORB_Core.cpp.

02864 {
02865 
02866   ACE_Allocator *dblock_allocator = 0;
02867   ACE_Allocator *buffer_allocator = 0;
02868 
02869   dblock_allocator =
02870     this->input_cdr_dblock_allocator ();
02871   buffer_allocator =
02872     this->input_cdr_buffer_allocator ();
02873 
02874   ACE_Lock* lock_strategy = 0;
02875   if (this->resource_factory ()->use_locked_data_blocks ())
02876     {
02877       lock_strategy = &this->data_block_lock_;
02878     }
02879 
02880   return this->create_data_block_i (size,
02881                                     buffer_allocator,
02882                                     dblock_allocator,
02883                                     lock_strategy);
02884 }

CORBA::Object_ptr TAO_ORB_Core::create_object ( TAO_Stub the_stub  ) 

Create a new object, use the adapter registry to create a collocated object, if not possible then create a regular object.

Definition at line 1979 of file ORB_Core.cpp.

01980 {
01981   // @@ What about forwarding.  With this approach we are never forwarded
01982   //    when we use collocation!
01983   const TAO_MProfile &mprofile = stub->base_profiles ();
01984 
01985   // @@ We should thow CORBA::NO_MEMORY in platforms with exceptions,
01986   // but we are stuck in platforms without exceptions!
01987   TAO_ORB_Core_Auto_Ptr collocated_orb_core;
01988   CORBA::Object_ptr x = 0;
01989 
01990   {
01991     // Lock the ORB_Table against concurrent modification while we
01992     // iterate through the ORBs.
01993     ACE_GUARD_RETURN (TAO_SYNCH_MUTEX,
01994                       guard,
01995                       TAO::ORB_Table::instance()->lock (),
01996                       CORBA::Object::_nil ());
01997 
01998     TAO::ORB_Table * const table = TAO::ORB_Table::instance ();
01999     TAO::ORB_Table::iterator const end = table->end ();
02000     for (TAO::ORB_Table::iterator i = table->begin (); i != end; ++i)
02001       {
02002         ::TAO_ORB_Core * const other_core = (*i).second.core ();
02003 
02004         if (this->is_collocation_enabled (other_core, mprofile))
02005           {
02006             other_core->_incr_refcnt();
02007              TAO_ORB_Core_Auto_Ptr tmp_auto_ptr (other_core);
02008              collocated_orb_core = tmp_auto_ptr;
02009             break;
02010           }
02011       }
02012   }
02013 
02014   if (collocated_orb_core.get ())
02015     {
02016       x = collocated_orb_core.get ()->adapter_registry ().create_collocated_object (stub, mprofile);
02017     }
02018 
02019 
02020   if (!x)
02021     {
02022       // The constructor sets the proxy broker as the
02023       // Remote one.
02024       ACE_NEW_RETURN (x,
02025                       CORBA::Object (stub, 0),
02026                       0);
02027     }
02028 
02029   return x;
02030 }

TAO_Stub * TAO_ORB_Core::create_stub ( const char *  repository_id,
const TAO_MProfile profiles 
)

Factory method that create the "right" Stub depending on wheather RTCORBA is loaded or not. The factory used to create the stub, is loaded at ORB initialization, and its type depends on the fact that RTCORBA is being used or not.

Definition at line 1904 of file ORB_Core.cpp.

01906 {
01907   TAO_Stub *retval =
01908     this->stub_factory ()->create_stub (repository_id, profiles, this);
01909   return retval;
01910 }

TAO_Stub * TAO_ORB_Core::create_stub_object ( TAO_MProfile mprofile,
const char *  type_id,
CORBA::PolicyList *  policy_list 
)

Makes sure that the ORB is open and then creates a TAO_Stub based on the endpoint.

Initialize a TAO_Stub object with the mprofile thats passed.

Definition at line 1922 of file ORB_Core.cpp.

01925 {
01926   // Add the Polices contained in "policy_list" to each profile so
01927   // that those policies will be exposed to the client in the IOR.  In
01928   // particular each CORBA::Policy has to be converted in to
01929   // Messaging::PolicyValue, and then all the Messaging::PolicyValue
01930   // should be embedded inside a Messaging::PolicyValueSeq which
01931   // became in turns the "body" of the IOP::TaggedComponent. This
01932   // conversion is a responsability of the CORBA::Profile class.  (See
01933   // orbos\98-05-05.pdf Section 5.4)
01934   if (policy_list->length () != 0)
01935     {
01936       TAO_Profile * profile = 0;
01937 
01938       CORBA::ULong const count = mprofile.profile_count ();
01939       for (CORBA::ULong i = 0; i < count; ++i)
01940         {
01941           // Get the ith profile
01942           profile = mprofile.get_profile (i);
01943           profile->policies (policy_list);
01944         }
01945     }
01946 
01947   /// Initialize a TAO_Stub object with the mprofile thats passed.
01948   TAO_Stub *stub = this->create_stub (type_id, mprofile);
01949 
01950   stub->base_profiles ().policy_list (policy_list);
01951 
01952   return stub;
01953 }

void TAO_ORB_Core::default_environment ( CORBA::Environment env  ) 

The value of the timeout if the flag above is not zero.

Definition at line 3210 of file ORB_Core.cpp.

03211 {
03212   TAO_TSS_Resources::instance ()->default_environment_ = env;
03213 }

CORBA::Environment * TAO_ORB_Core::default_environment ( void   )  const

The thread has a default environment to simplify porting between platforms that support native C++ exceptions and those that don't. This is a TSS resource (always), but with a twist: if the user creates a new environment the old one is "pushed" (actually the new one remembers it), eventually the new environment destructor pops itself from the stack and we recover the old environment.

This means that if the user create a new environment and somebody calls a function using the default one the exception will still be received in the environment created by the user. The only drawback is that environments life time must nest properly, this shouldn't be a problem because environments are usually created on the stack, but, the spec allows their creation on the heap and/or as class members; we need to investigate the tradeoffs and take a decision.

Definition at line 3204 of file ORB_Core.cpp.

03205 {
03206   return TAO_TSS_Resources::instance ()->default_environment_;
03207 }

void TAO_ORB_Core::destroy ( void   ) 

Shutdown the ORB and free resources.

Definition at line 2327 of file ORB_Core.cpp.

02328 {
02329   // All destroy() should do is (a) call shutdown() and (b) unbind()
02330   // from the ORB table.  Nothing else should really be added to this
02331   // method.  Everything else should go to the shutdown() method.
02332   // Remember when the ORB Core is finally removed from the ORB table,
02333   // the reference count goes to zero and fini() is called.  fini()
02334   // calls shutdown() and does not call destroy() since destroy() will
02335   // try to unbind from the ORB table again.  Additional code should
02336   // not be added to destroy() since there is no guarantee that
02337   // orb->destroy() will ever be called by the user.  Since TAO
02338   // guarantees that shutdown() will be called, all cleanup code
02339   // should go there.
02340   //
02341 
02342   // Shutdown the ORB and block until the shutdown is complete.
02343   this->shutdown (1);
02344 
02345   // Invoke Interceptor::destroy() on all registered interceptors.
02346   this->destroy_interceptors ();
02347 
02348   // Now remove it from the ORB table so that it's ORBid may be
02349   // reused.
02350   TAO::ORB_Table::instance ()->unbind (this->orbid_);
02351 }

void TAO_ORB_Core::destroy_interceptors ( void   )  [protected]

Helper method that invokes Interceptor::destroy() on all registered interceptors when ORB::destroy() is called. Prevents exceptions from propagating up the call chain.

Definition at line 2367 of file ORB_Core.cpp.

02368 {
02369   try
02370     {
02371       ACE_GUARD (TAO_SYNCH_MUTEX, monitor, this->lock_);
02372 
02373 #if TAO_HAS_INTERCEPTORS == 1
02374       if (this->client_request_interceptor_adapter_ != 0)
02375         {
02376           this->client_request_interceptor_adapter_->destroy_interceptors ();
02377 
02378           delete this->client_request_interceptor_adapter_;
02379           this->client_request_interceptor_adapter_ = 0;
02380         }
02381 
02382       if (this->server_request_interceptor_adapter_ != 0)
02383         {
02384           this->server_request_interceptor_adapter_->destroy_interceptors ();
02385 
02386           delete this->server_request_interceptor_adapter_;
02387           this->server_request_interceptor_adapter_ = 0;
02388         }
02389 
02390 #endif  /* TAO_HAS_INTERCEPTORS == 1 */
02391 
02392       if (this->ior_interceptor_adapter_ != 0)
02393         {
02394           this->ior_interceptor_adapter_->destroy_interceptors ();
02395 
02396           this->ior_interceptor_adapter_ = 0;
02397         }
02398 
02399     }
02400   catch (...)
02401     {
02402       // .. catch all the exceptions..
02403       if (TAO_debug_level > 3)
02404         {
02405           ACE_DEBUG ((LM_DEBUG,
02406                       ACE_TEXT ("TAO (%P|%t) - Exception in TAO_ORB_Core")
02407                       ACE_TEXT ("::destroy_interceptors ()\n")));
02408         }
02409     }
02410 
02411   return;
02412 }

const char * TAO_ORB_Core::dynamic_adapter_name ( void   )  [static]

Gets the value of TAO_ORB_Core::dynamic_adapter_name_.

Definition at line 1514 of file ORB_Core.cpp.

void TAO_ORB_Core::dynamic_adapter_name ( const char *  name  )  [static]

Sets the value of TAO_ORB_Core::dynamic_adapter_name_.

Definition at line 1508 of file ORB_Core.cpp.

TAO_Endpoint_Selector_Factory * TAO_ORB_Core::endpoint_selector_factory ( void   ) 

Returns a pointer to the endpoint selector factory.

Definition at line 1731 of file ORB_Core.cpp.

01732 {
01733   // Check if there is a cached reference.
01734   if (this->endpoint_selector_factory_ != 0)
01735     return this->endpoint_selector_factory_;
01736 
01737   // If not, look in the service repository for an instance.
01738   const char* endpoint_selector_factory_name =
01739     this->orb_params ()->endpoint_selector_factory_name ();
01740 
01741   this->endpoint_selector_factory_ =
01742     ACE_Dynamic_Service<TAO_Endpoint_Selector_Factory>::instance
01743       (this->configuration (),
01744        ACE_TEXT_CHAR_TO_TCHAR (endpoint_selector_factory_name));
01745 
01746   return this->endpoint_selector_factory_;
01747 }

TAO_Fault_Tolerance_Service & TAO_ORB_Core::fault_tolerance_service ( void   ) 

Return a reference to the Fault Tolerant service object.

Definition at line 148 of file ORB_Core.inl.

00149 {
00150   return this->ft_service_;
00151 }

int TAO_ORB_Core::fini ( void   )  [protected]

Final termination hook, typically called by CORBA::ORB's destructor.

Definition at line 1423 of file ORB_Core.cpp.

01424 {
01425   try
01426     {
01427       // Shutdown the ORB and block until the shutdown is complete.
01428       this->shutdown (1);
01429     }
01430   catch (const ::CORBA::Exception& ex)
01431     {
01432       ACE_CString message =
01433         "Exception caught in trying to shutdown ";
01434       message += this->orbid_;
01435       message += "\n";
01436 
01437       ex._tao_print_exception (message.c_str ());
01438     }
01439 
01440   // Wait for any server threads, ignoring any failures.
01441   (void) this->thr_mgr ()->wait ();
01442 
01443   ::CORBA::release (this->typecode_factory_);
01444 
01445   ::CORBA::release (this->codec_factory_);
01446 
01447   ::CORBA::release (this->dynany_factory_);
01448 
01449   ::CORBA::release (this->ior_manip_factory_);
01450 
01451   ::CORBA::release (this->ior_table_);
01452 
01453   ::CORBA::release (this->monitor_);
01454 
01455   if (TAO_debug_level > 2)
01456     {
01457       ACE_DEBUG ((LM_DEBUG,
01458                   ACE_TEXT ("TAO (%P|%t) - Destroying ORB <%C>\n"),
01459                   this->orbid_));
01460     }
01461 
01462   // Finalize lane resources.
01463   //
01464   // @@ Do not call this->thread_lane_resources_manager().finalize().
01465   // this->thread_lane_manager_resources() can seg fault if the
01466   // factory method it invokes returns a zero pointer, which can
01467   // easily occur if the ORB is partially initialized due to a Service
01468   // Configurator initialization failure.  Instead check if the
01469   // cached pointer is non-zero and then finalize.
01470   //
01471   // @todo Fix potential seg fault in
01472   //       TAO_ORB_Core::thread_lane_resources_manager().
01473   if (this->thread_lane_resources_manager_ != 0)
01474     this->thread_lane_resources_manager_->finalize ();
01475 
01476   // Destroy the object_key table
01477   this->object_key_table_.destroy ();
01478 
01479   delete this;
01480 
01481   return 0;
01482 }

TAO_Flushing_Strategy * TAO_ORB_Core::flushing_strategy ( void   ) 

Return the flushing strategy.

The flushing strategy is created by the resource factory, and it is used by the ORB to control the mechanism used to flush the outgoing data queues. The flushing strategies are stateless, therefore, there is only one per ORB.

Definition at line 73 of file ORB_Core.inl.

00074 {
00075   return this->flushing_strategy_;
00076 }

auto_ptr< TAO_GIOP_Fragmentation_Strategy > TAO_ORB_Core::fragmentation_strategy ( TAO_Transport transport  ) 

Get outgoing fragmentation strategy.

Definition at line 2920 of file ORB_Core.cpp.

02921 {
02922   return
02923     this->resource_factory ()->create_fragmentation_strategy (
02924       transport,
02925       this->orb_params_.max_message_size ());
02926 }

CORBA::Boolean TAO_ORB_Core::ft_send_extended_sc ( void   ) 

Transmit the entire TAG_FT_GROUP component data from a server IOGR as a FT_GROUP_VERSION tagged service context on requests to that IOGR instead of just the group version.

Definition at line 154 of file ORB_Core.inl.

00155 {
00156   return this->ft_send_extended_sc_;
00157 }

CORBA::ULong TAO_ORB_Core::get_collocation_strategy ( void   )  const

The value of the timeout if the flag above is not zero.

Definition at line 228 of file ORB_Core.inl.

00229 {
00230   return this->collocation_strategy_;
00231 }

TAO_Network_Priority_Protocols_Hooks * TAO_ORB_Core::get_network_priority_protocols_hooks ( void   ) 

Gets the value of TAO_ORB_Core::network_priority_protocols_hooks__.

Definition at line 85 of file ORB_Core.inl.

00086 {
00087   return this->network_priority_protocols_hooks_;
00088 }

TAO_Protocols_Hooks * TAO_ORB_Core::get_protocols_hooks ( void   ) 

Gets the value of TAO_ORB_Core::protocols_hooks__.

Definition at line 79 of file ORB_Core.inl.

00080 {
00081   return this->protocols_hooks_;
00082 }

void * TAO_ORB_Core::get_tss_resource ( size_t  slot_id  ) 

Obtain the TSS resource in the given slot.

Definition at line 275 of file ORB_Core.inl.

00276 {
00277   TAO_ORB_Core_TSS_Resources *tss_resources =
00278     this->get_tss_resources ();
00279 
00280   if (slot_id >= tss_resources->ts_objects_.size ())
00281     return 0;
00282 
00283   return tss_resources->ts_objects_[slot_id];
00284 }

TAO_ORB_Core_TSS_Resources * TAO_ORB_Core::get_tss_resources ( void   ) 

Obtain the TSS resources of this orb.

Definition at line 269 of file ORB_Core.inl.

00270 {
00271   return ACE_TSS_GET (&this->tss_resources_,TAO_ORB_Core_TSS_Resources);
00272 }

TAO::GUIResource_Factory * TAO_ORB_Core::gui_resource_factory ( void   ) 

Returns pointer to the factory for creating gui resources.

Definition at line 1589 of file ORB_Core.cpp.

01590 {
01591   return TAO_TSS_Resources::instance ()->gui_resource_factory_;
01592 }

bool TAO_ORB_Core::has_shutdown ( void   )  const

Get the shutdown flag value.

Definition at line 334 of file ORB_Core.inl.

00335 {
00336   return this->has_shutdown_;
00337 }

CORBA::ULong TAO_ORB_Core::hash_service ( TAO_Profile this_p,
CORBA::ULong  max 
)

Hook for the services to determine the <hash> value of a profile. For details on how this is used please see the FT service

Definition at line 137 of file ORB_Core.inl.

00138 {
00139   if (this->ft_service_.service_callback ())
00140     {
00141       return this->ft_service_.service_callback ()->hash_ft (p, m);
00142     }
00143 
00144   return 0;
00145 }

const char * TAO_ORB_Core::ifr_client_adapter_name ( void   )  [static]

Gets the value of TAO_ORB_Core::ifr_client_adapter_name_.

Definition at line 1526 of file ORB_Core.cpp.

void TAO_ORB_Core::ifr_client_adapter_name ( const char *  name  )  [static]

Sets the value of TAO_ORB_Core::ifr_client_adapter_name_.

Definition at line 1520 of file ORB_Core.cpp.

void TAO_ORB_Core::implrepo_service ( const CORBA::Object_ptr  ir  ) 

The value of the timeout if the flag above is not zero.

Definition at line 353 of file ORB_Core.inl.

00354 {
00355   this->implrepo_service_ = ir;
00356 }

CORBA::Object_ptr TAO_ORB_Core::implrepo_service ( void   ) 

Set/Get the IOR of the Implementation Repository service.

Definition at line 2935 of file ORB_Core.cpp.

02936 {
02937   if (!this->use_implrepo_)
02938     return CORBA::Object::_nil ();
02939 
02940   if (CORBA::is_nil (this->implrepo_service_))
02941     {
02942 
02943       try
02944         {
02945           CORBA::Object_var temp =
02946             this->orb_->resolve_initial_references ("ImplRepoService");
02947 
02948           ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, ace_mon, this->lock_, CORBA::Object::_nil ());
02949 
02950           // @@ Worry about assigning a different IOR? (brunsch)
02951           this->implrepo_service_ = temp._retn ();
02952         }
02953       catch (const ::CORBA::Exception&)
02954         {
02955           // Just make sure that we have a null pointer.  Ignore the exception
02956           // anyway.
02957           this->implrepo_service_ = CORBA::Object::_nil ();
02958         }
02959     }
02960 
02961   return CORBA::Object::_duplicate (this->implrepo_service_);
02962 }

CORBA::Boolean TAO_ORB_Core::imr_endpoints_in_ior ( void   ) 

Do we put the ImR's endpoints into persistent object references we create.

Definition at line 365 of file ORB_Core.inl.

00366 {
00367   return imr_endpoints_in_ior_;
00368 }

int TAO_ORB_Core::init ( int &  argc,
char *  argv[] 
) [protected]

Initialize the guts of the ORB Core. It is intended that this be called by <CORBA::ORB_init>.

Definition at line 341 of file ORB_Core.cpp.

00342 {
00343   // Right now, this code expects to begin parsing in argv[1] rather
00344   // than argv[0].  I don't think that's wise.  I think we need to
00345   // change that convention to argv[0] and let the initializing code
00346   // make any necessary shifts.
00347   //
00348   // Parse arguments to the ORB.  Typically the ORB is passed
00349   // arguments straight from the command line, so we will simply pass
00350   // through them and respond to the ones we understand and ignore
00351   // those we don't.
00352   //
00353   // In some instances, we may actually build another vector of
00354   // arguments and stash it for use initializing other components such
00355   // as the RootPOA.
00356 
00357   bool use_ior = true;
00358   int cdr_tradeoff = ACE_DEFAULT_CDR_MEMCPY_TRADEOFF;
00359 
00360   // The following things should be changed to use the ACE_Env_Value<>
00361   // template sometime.
00362 
00363   // Name Service port use for Multicast
00364   unsigned short ns_port = 0;
00365 
00366   // Trading Service port used for Multicast
00367   unsigned short ts_port = 0;
00368 
00369   // Implementation Repository Service port #.
00370   unsigned short ir_port = 0;
00371 
00372   // Buffer sizes for kernel socket buffers
00373   // @@ should be a default defined for each protocol implementation?
00374   //    since we may have protocols loaded which use shared memory of
00375   //    some form, fredk
00376   int rcv_sock_size = -1;
00377   int snd_sock_size = -1;
00378 
00379   // Use TCP_NODELAY.
00380   int nodelay = 1;
00381 
00382   // Use SO_KEEPALIVE (default 0).
00383   int so_keepalive = 0;
00384 
00385   // Use SO_DONTROUTE (default 0)
00386   int so_dontroute = 0;
00387 
00388   // Number of hops for a datagram sent through socket.
00389   int ip_hoplimit = -1;
00390 
00391   // Use IP_MILTICAST_LOOP (default 1).
00392   int ip_multicastloop = 1;
00393 
00394   // Use dotted decimal addresses
00395   // @@ This option will be treated as a suggestion to each loaded
00396   //    protocol to use a character representation for the numeric
00397   //    address, otherwise use a logical name. fredk
00398 #if (TAO_USE_DOTTED_DECIMAL_ADDRESSES == 1)
00399   int dotted_decimal_addresses = 1;
00400 #else
00401   int dotted_decimal_addresses = 0;
00402 #endif /* TAO_USE_DOTTED_DECIMAL_ADDRESSES */
00403 
00404   // Disable looking up the host name for incoming connections.
00405   int no_server_side_name_lookups = 0;
00406 
00407 #if defined (TAO_STD_PROFILE_COMPONENTS)
00408   bool std_profile_components = true;
00409 #else
00410   bool std_profile_components = false;
00411 #endif /* TAO_STD_PROFILE_COMPONENTS */
00412 
00413   int linger = TAO_SO_LINGER;
00414   time_t accept_error_delay = TAO_ACCEPT_ERROR_DELAY;
00415   bool use_parallel_connects = TAO_USE_PARALLEL_CONNECT;
00416 
00417   // Copy command line parameter not to use original.
00418   ACE_Argv_Type_Converter command_line (argc, argv);
00419 
00420   ACE_Arg_Shifter arg_shifter (command_line.get_argc (),
00421                                command_line.get_TCHAR_argv ());
00422 
00423   ACE_GUARD_RETURN (TAO_SYNCH_MUTEX,
00424                     monitor,
00425                     this->lock_,
00426                     -1);
00427 
00428 #if (TAO_NEGOTIATE_CODESETS == 1)
00429   bool negotiate_codesets = true;
00430 #else
00431   bool negotiate_codesets = false;
00432 #endif /* TAO_NEGOTIATE_CODESETS */
00433 
00434   // Pick up the value of the use_implrepo_ flag from an environment variable
00435   // called "TAO_USE_IMR". Do it here so that it can be overridden by
00436   // the "-ORBUseIMR" command line argument.
00437   //
00438   char* const use_IMR_env_var_value = ACE_OS::getenv  ("TAO_USE_IMR") ;
00439   if  (use_IMR_env_var_value != 0)
00440     {
00441       this->use_implrepo_ = ACE_OS::atoi  (use_IMR_env_var_value) ;
00442     }
00443 
00444 
00445   while (arg_shifter.is_anything_left ())
00446     {
00447       const ACE_TCHAR *current_arg = 0;
00448 
00449       ////////////////////////////////////////////////////////////////
00450       // begin with the 'parameterless' flags                       //
00451       ////////////////////////////////////////////////////////////////
00452       if (0 != (current_arg = arg_shifter.get_the_parameter
00453                 (ACE_TEXT("-ORBDottedDecimalAddresses"))))
00454         {
00455           // Use dotted decimal addresses
00456           // @@ this should be renamed.  See above comment. fredk
00457           dotted_decimal_addresses =
00458             ACE_OS::atoi (current_arg);
00459 
00460           arg_shifter.consume_arg ();
00461         }
00462       else if (0 != (current_arg = arg_shifter.get_the_parameter
00463                 (ACE_TEXT("-ORBNoServerSideNameLookups"))))
00464         {
00465           // Don't look up the host name for incoming connections
00466           no_server_side_name_lookups =
00467             ACE_OS::atoi (current_arg);
00468 
00469           arg_shifter.consume_arg ();
00470         }
00471       else if (0 != (current_arg = arg_shifter.get_the_parameter
00472                 (ACE_TEXT("-ORBNameServicePort"))))
00473         {
00474           // Specify the port number for the NameService.
00475           // Unrelated to ORB Protocols, this is used for multicast.
00476 
00477           ns_port = static_cast <CORBA::UShort> (ACE_OS::atoi (current_arg));
00478 
00479           arg_shifter.consume_arg ();
00480         }
00481       else if (0 != (current_arg = arg_shifter.get_the_parameter
00482                 (ACE_TEXT("-ORBMulticastDiscoveryEndpoint"))))
00483         {
00484           // Specify mcast address:port@network_interface for the
00485           // Naming Service Multicast Discovery Protocol.
00486           // If there is no colon, its only the port no.
00487           // If there is a '@' also, it means that the network
00488           // interface name is specified.
00489           this->orb_params ()->mcast_discovery_endpoint (
00490             ACE_TEXT_ALWAYS_CHAR(current_arg));
00491 
00492           arg_shifter.consume_arg ();
00493         }
00494       else if (0 != (current_arg = arg_shifter.get_the_parameter
00495                 (ACE_TEXT("-ORBNodelay"))))
00496         {
00497           // Use TCP_NODELAY or not.
00498           nodelay =
00499             ACE_OS::atoi (current_arg);
00500 
00501           arg_shifter.consume_arg ();
00502         }
00503       else if (0 != (current_arg = arg_shifter.get_the_parameter
00504                 (ACE_TEXT("-ORBKeepalive"))))
00505         {
00506           // Use SO_KEEPALIVE or not.
00507           so_keepalive =
00508             ACE_OS::atoi (current_arg);
00509 
00510           arg_shifter.consume_arg ();
00511         }
00512       else if (0 != (current_arg = arg_shifter.get_the_parameter
00513                 (ACE_TEXT("-ORBDontRoute"))))
00514         {
00515           // Use SO_DONTROUTE or not.
00516           so_dontroute =
00517             ACE_OS::atoi (current_arg);
00518 
00519           arg_shifter.consume_arg ();
00520         }
00521       else if (0 != (current_arg = arg_shifter.get_the_parameter
00522                 (ACE_TEXT("-ORBIPHopLimit"))))
00523         {
00524           // Number of IP hops.
00525           ip_hoplimit =
00526             ACE_OS::atoi (current_arg);
00527 
00528           arg_shifter.consume_arg ();
00529         }
00530       else if (0 != (current_arg = arg_shifter.get_the_parameter
00531                 (ACE_TEXT("-ORBIPMulticastLoop"))))
00532         {
00533           // Use IP_MULTICAST_LOOP or not.
00534           ip_multicastloop =
00535             ACE_OS::atoi (current_arg);
00536 
00537           arg_shifter.consume_arg ();
00538         }
00539       else if (0 != (current_arg = arg_shifter.get_the_parameter
00540                 (ACE_TEXT("-ORBTradingServicePort"))))
00541         {
00542           // Specify the port number for the TradingService.
00543 
00544           ts_port = static_cast <CORBA::UShort> (ACE_OS::atoi (current_arg));
00545 
00546           arg_shifter.consume_arg ();
00547         }
00548       else if (0 != (current_arg = arg_shifter.get_the_parameter
00549                 (ACE_TEXT("-ORBImplRepoServicePort"))))
00550         {
00551           // Specify the multicast port number for the Implementation
00552           // Repository.
00553           ir_port = static_cast <CORBA::UShort> (ACE_OS::atoi (current_arg));
00554 
00555           arg_shifter.consume_arg ();
00556         }
00557       else if (0 != (current_arg = arg_shifter.get_the_parameter
00558                 (ACE_TEXT("-ORBRcvSock"))))
00559         {
00560           // @@ All protocol implementation may not use sockets, so
00561           //    this can either be a generic I/O Buffer size or
00562           //    Buffer info can be a per protocol specification, fredk
00563 
00564           // Specify the size of the socket's receive buffer
00565 
00566           rcv_sock_size = ACE_OS::atoi (current_arg);
00567 
00568           arg_shifter.consume_arg ();
00569         }
00570       else if (0 != (current_arg = arg_shifter.get_the_parameter
00571                 (ACE_TEXT("-ORBSndSock"))))
00572         {
00573           // @@ All protocol implementation may not use sockets, so
00574           //    this can either be a generic I/O Buffer size or
00575           //    Buffer info can be a per protocol specification, fredk
00576 
00577           // Specify the size of the socket's send buffer
00578           snd_sock_size = ACE_OS::atoi (current_arg);
00579 
00580           arg_shifter.consume_arg ();
00581         }
00582       else if (0 != (current_arg = arg_shifter.get_the_parameter
00583                 (ACE_TEXT("-ORBObjRefStyle"))))
00584         {
00585           // Specifies the style of printed objrefs: URL or IOR
00586           //
00587           // BEGIN COMMENTS FROM IIOP-1.4 On Win32, we should be
00588           // collecting information from the Registry such as what
00589           // ORBs are configured, specific configuration details like
00590           // whether they generate IOR or URL style stringified
00591           // objrefs and which addresses they listen to (e.g. allowing
00592           // multihomed hosts to implement firewalls), user-meaningful
00593           // orb names (they will normally indicate domains), and
00594           // more.
00595           //
00596           // On UNIX, we should collect that from some private config
00597           // file.
00598           //
00599           // Instead, this just treats the "internet" ORB name
00600           // specially and makes it always use URL-style stringified
00601           // objrefs, where the hostname and TCP port number are
00602           // explicit (and the whole objref is readable by mortals).
00603           // BEGIN COMMENTS FROM IIOP-1.4
00604           const ACE_TCHAR *opt = current_arg;
00605           if (ACE_OS::strcasecmp (opt, ACE_TEXT("URL")) == 0)
00606             use_ior = false;
00607           else if (ACE_OS::strcasecmp (opt, ACE_TEXT("IOR")) == 0)
00608             use_ior = true;
00609 
00610           arg_shifter.consume_arg ();
00611         }
00612       else if (0 != (current_arg = arg_shifter.get_the_parameter
00613                 (ACE_TEXT("-ORBCollocationStrategy"))))
00614         {
00615           // Specify which collocation policy we want to use.
00616           const ACE_TCHAR *opt = current_arg;
00617           if (ACE_OS::strcasecmp (opt, ACE_TEXT("thru_poa")) == 0)
00618             this->collocation_strategy_ = THRU_POA;
00619           else if (ACE_OS::strcasecmp (opt, ACE_TEXT("direct")) == 0)
00620             this->collocation_strategy_ = DIRECT;
00621 
00622           arg_shifter.consume_arg ();
00623         }
00624       else if (0 != (current_arg = arg_shifter.get_the_parameter
00625                 (ACE_TEXT("-ORBCollocation"))))
00626         {
00627           // Specify whether we want to optimize against collocation
00628           // objects.  Valid arguments are: "global", "no", and "per-orb".
00629           // Default is global.
00630 
00631           const ACE_TCHAR *opt = current_arg;
00632           if (ACE_OS::strcasecmp (opt, ACE_TEXT("global")) == 0)
00633             {
00634               this->opt_for_collocation_ = true;
00635               this->use_global_collocation_ = true;
00636             }
00637           else if (ACE_OS::strcasecmp (opt, ACE_TEXT("NO")) == 0)
00638             {
00639               this->opt_for_collocation_ = false;
00640               this->use_global_collocation_ = false;
00641             }
00642           else if (ACE_OS::strcasecmp (opt, ACE_TEXT("per-orb")) == 0)
00643             {
00644               this->opt_for_collocation_ = true;
00645               this->use_global_collocation_ = false;
00646             }
00647           else
00648             {
00649               ACE_DEBUG ((LM_WARNING,
00650                           ACE_TEXT ("WARNING: Unknown option to ")
00651                           ACE_TEXT ("'-ORBCollocation': %s\n"), opt));
00652             }
00653 
00654           arg_shifter.consume_arg ();
00655         }
00656       else if (0 != (current_arg = arg_shifter.get_the_parameter
00657                 (ACE_TEXT("-ORBPreferredInterfaces"))))
00658         {
00659           if (this->orb_params ()->preferred_interfaces (
00660                 ACE_TEXT_ALWAYS_CHAR (current_arg)) == false)
00661             throw ::CORBA::INTERNAL (
00662               CORBA::SystemException::_tao_minor_code (
00663                 TAO_ORB_CORE_INIT_LOCATION_CODE,
00664                 0),
00665               CORBA::COMPLETED_NO);
00666 
00667           arg_shifter.consume_arg ();
00668         }
00669       else if (0 != (current_arg = arg_shifter.get_the_parameter
00670                 (ACE_TEXT("-ORBEnforcePreferredInterfaces"))))
00671         {
00672           int enforce_pref_interfaces = ACE_OS::atoi (current_arg);
00673           if (enforce_pref_interfaces)
00674             this->orb_params ()->enforce_pref_interfaces (false);
00675           else
00676             this->orb_params ()->enforce_pref_interfaces (true);
00677 
00678           arg_shifter.consume_arg ();
00679         }
00680 #if defined (ACE_HAS_IPV6)
00681       else if (0 != (current_arg = arg_shifter.get_the_parameter
00682                 (ACE_TEXT("-ORBPreferIPV6Interfaces"))))
00683         {
00684           int prefer_ipv6_interfaces = ACE_OS::atoi (current_arg);
00685           if (prefer_ipv6_interfaces)
00686             this->orb_params ()->prefer_ipv6_interfaces (true);
00687           else
00688             this->orb_params ()->prefer_ipv6_interfaces (false);
00689 
00690           arg_shifter.consume_arg ();
00691         }
00692       else if (0 != (current_arg = arg_shifter.get_the_parameter
00693                 (ACE_TEXT("-ORBConnectIPV6Only"))))
00694         {
00695           int connect_ipv6_only = ACE_OS::atoi (current_arg);
00696           if (connect_ipv6_only)
00697             this->orb_params ()->connect_ipv6_only (true);
00698           else
00699             this->orb_params ()->connect_ipv6_only (false);
00700 
00701           arg_shifter.consume_arg ();
00702         }
00703       else if ((current_arg = arg_shifter.get_the_parameter
00704                 (ACE_TEXT("-ORBUseIPV6LinkLocal"))))
00705         {
00706           int use_ipv6_link_local = ACE_OS::atoi (current_arg);
00707           if (use_ipv6_link_local)
00708             this->orb_params ()->use_ipv6_link_local (true);
00709           else
00710             this->orb_params ()->use_ipv6_link_local (false);
00711 
00712           arg_shifter.consume_arg ();
00713         }
00714 #endif /* ACE_HAS_IPV6 */
00715       else if (0 != (current_arg = arg_shifter.get_the_parameter
00716                 (ACE_TEXT("-ORBCDRTradeoff"))))
00717         {
00718           cdr_tradeoff = ACE_OS::atoi (current_arg);
00719 
00720           arg_shifter.consume_arg ();
00721         }
00722 
00723       // A new <ObjectID>:<IOR> mapping has been specified. This will be
00724       // used by the resolve_initial_references ().
00725 
00726       else if (0 != (current_arg = arg_shifter.get_the_parameter
00727                 (ACE_TEXT("-ORBInitRef"))))
00728         {
00729           const ACE_TCHAR *pos = ACE_OS::strchr (current_arg, '=');
00730           if (pos == 0)
00731             {
00732               ACE_ERROR ((LM_ERROR,
00733                           ACE_TEXT ("Invalid ORBInitRef argument '%s'")
00734                           ACE_TEXT ("format is ObjectID=IOR\n"),
00735                           current_arg));
00736               throw ::CORBA::INTERNAL (
00737                 CORBA::SystemException::_tao_minor_code (
00738                   TAO_ORB_CORE_INIT_LOCATION_CODE,
00739                   0),
00740                 CORBA::COMPLETED_NO);
00741             }
00742           ACE_CString object_id (ACE_TEXT_ALWAYS_CHAR(current_arg),
00743                                  pos - current_arg);
00744           ACE_CString IOR (ACE_TEXT_ALWAYS_CHAR(pos + 1));
00745           if (!this->init_ref_map_.insert (
00746                  std::make_pair (InitRefMap::key_type (object_id),
00747                                  InitRefMap::data_type (IOR))).second)
00748             {
00749               ACE_ERROR ((LM_ERROR,
00750                           ACE_TEXT ("Duplicate -ORBInitRef ")
00751                           ACE_TEXT ("argument '%s'\n"),
00752                           current_arg));
00753               throw ::CORBA::INTERNAL (
00754                 CORBA::SystemException::_tao_minor_code (
00755                   TAO_ORB_CORE_INIT_LOCATION_CODE,
00756                   0),
00757                 CORBA::COMPLETED_NO);
00758             }
00759           arg_shifter.consume_arg ();
00760         }
00761       else if (0 != (current_arg = arg_shifter.get_the_parameter
00762                 (ACE_TEXT("-ORBDefaultInitRef"))))
00763         {
00764           // Set the list of prefixes from -ORBDefaultInitRef.
00765           this->orb_params ()->default_init_ref
00766             (ACE_TEXT_ALWAYS_CHAR(current_arg));
00767 
00768           arg_shifter.consume_arg ();
00769         }
00770       else if (0 != (current_arg = arg_shifter.get_the_parameter
00771                 (ACE_TEXT("-ORBStdProfileComponents"))))
00772         {
00773           std_profile_components =
00774             ACE_OS::atoi (current_arg);
00775           arg_shifter.consume_arg ();
00776         }
00777       else if (0 != (current_arg = arg_shifter.get_the_parameter
00778                 (ACE_TEXT("-ORBAMICollocation"))))
00779         {
00780           int ami_collocation = ACE_OS::atoi (current_arg);
00781           if (ami_collocation)
00782             this->orb_params ()->ami_collication (true);
00783           else
00784             this->orb_params ()->ami_collication (false);
00785 
00786           arg_shifter.consume_arg ();
00787         }
00788       else if (0 != (current_arg = arg_shifter.get_the_parameter
00789                 (ACE_TEXT("-ORBResources"))))
00790         {
00791           ACE_DEBUG ((LM_WARNING,
00792                       ACE_TEXT ("\"-ORBResources\" has been ")
00793                       ACE_TEXT ("deprecated.\n")));
00794 
00795           arg_shifter.consume_arg ();
00796         }
00797       else if (0 != (current_arg = arg_shifter.get_the_parameter
00798                 (ACE_TEXT("-ORBLogFile"))))
00799         {
00800           // redirect all ACE_DEBUG and ACE_ERROR output to a file
00801           // USAGE: -ORBLogFile <file>
00802           // default: if <file> is present     = append
00803           //          if <file> is not present = create
00804 
00805           const ACE_TCHAR *file_name = current_arg;
00806           arg_shifter.consume_arg ();
00807 
00808           // would rather use ACE_OSTREAM_TYPE out here..
00809           // but need ACE_FSTREAM_TYPE to call ->open(...)
00810           // and haven't found such a macro to rep FILE* and/or fstream*
00811 
00812 #if defined (ACE_LACKS_IOSTREAM_TOTALLY)
00813 
00814           FILE* output_stream = ACE_OS::fopen (file_name, ACE_TEXT ("a"));
00815 
00816           ACE_LOG_MSG->msg_ostream (output_stream, 1);
00817 
00818 #else /* ! ACE_LACKS_IOSTREAM_TOTALLY */
00819 
00820           ofstream* output_stream = 0;
00821 
00822           //
00823           // note: we are allocating dynamic memory here....but
00824           // I assume it will persist for the life of the program
00825           //
00826 
00827           ACE_NEW_THROW_EX (output_stream,
00828                             ofstream (),
00829                             CORBA::NO_MEMORY (
00830                               CORBA::SystemException::_tao_minor_code (
00831                                 TAO_ORB_CORE_INIT_LOCATION_CODE,
00832                                 ENOMEM),
00833                               CORBA::COMPLETED_NO));
00834 
00835           output_stream->open (ACE_TEXT_ALWAYS_CHAR (file_name),
00836                                ios::out | ios::app);
00837 
00838           if (!output_stream->bad ())
00839             {
00840               ACE_LOG_MSG->msg_ostream (output_stream, 1);
00841             }
00842 
00843 #endif /* ACE_LACKS_IOSTREAM_TOTALLY */
00844 
00845           ACE_LOG_MSG->clr_flags (ACE_Log_Msg::STDERR | ACE_Log_Msg::LOGGER);
00846           ACE_LOG_MSG->set_flags (ACE_Log_Msg::OSTREAM);
00847 
00848         }
00849       else if (0 != (current_arg = arg_shifter.get_the_parameter
00850                 (ACE_TEXT("-ORBVerboseLogging"))))
00851         {
00852           unsigned long const verbose_logging = ACE_OS::atoi (current_arg);
00853 
00854           arg_shifter.consume_arg ();
00855 
00856           typedef void (ACE_Log_Msg::*PTMF)(u_long);
00857           PTMF flagop = &ACE_Log_Msg::set_flags;
00858           u_long value;
00859 
00860           switch (verbose_logging)
00861             {
00862             case 0:
00863               flagop = &ACE_Log_Msg::clr_flags;
00864               value = ACE_Log_Msg::VERBOSE | ACE_Log_Msg::VERBOSE_LITE;
00865               break;
00866             case 1:
00867               value = ACE_Log_Msg::VERBOSE_LITE; break;
00868             default:
00869               value = ACE_Log_Msg::VERBOSE; break;
00870             }
00871 
00872           (ACE_LOG_MSG->*flagop)(value);
00873         }
00874       else if (0 != (current_arg = arg_shifter.get_the_parameter
00875                 (ACE_TEXT("-ORBUseIMR"))))
00876         {
00877           // Use IR or not.
00878           this->use_implrepo_ = ACE_OS::atoi (current_arg);
00879 
00880           arg_shifter.consume_arg ();
00881         }
00882       else if (0 != (current_arg = arg_shifter.get_the_parameter
00883                 (ACE_TEXT("-ORBIMREndpointsInIOR"))))
00884         {
00885           this->imr_endpoints_in_ior_ = ACE_OS::atoi (current_arg);
00886 
00887           arg_shifter.consume_arg ();
00888         }
00889       else if (0 != (current_arg = arg_shifter.get_the_parameter
00890                 (ACE_TEXT("-ORBid"))))
00891         {
00892           // The ORBid is actually set in ORB_init(), and then passed
00893           // to the TAO_ORB_Core() constructor.  However, in the case
00894           // where the ORBid third argument to ORB_init() is not zero,
00895           // any "-ORBid" arguments in the argv argument list are
00896           // supposed to be ignored, according to the CORBA spec.  As
00897           // such, "-ORBid" must be removed from the argument list
00898           // since ORB_init() must remove all "-ORB" option
00899           // arguments.
00900 
00901           // We obtain a lock on the ORB table when setting the
00902           // ORBid.  For this reason we should *not* set the ORBid
00903           // here.  CORBA::ORB_init() does all of the proper locking
00904           // and setting.
00905 
00906           arg_shifter.consume_arg ();
00907         }
00908       else if (0 != (current_arg = arg_shifter.get_the_parameter
00909                 (ACE_TEXT("-ORBServerId"))))
00910         {
00911           // The this->server_id_ is to uniquely identify a server to
00912           // an IMR.
00913           // Fill in later.
00914           this->server_id_.set(ACE_TEXT_ALWAYS_CHAR(current_arg));
00915 
00916           arg_shifter.consume_arg ();
00917         }
00918       else if (0 != (current_arg = arg_shifter.get_the_parameter
00919                (ACE_TEXT("-ORBLingerTimeout"))))
00920         {
00921           linger = ACE_OS::atoi (current_arg);
00922 
00923           arg_shifter.consume_arg ();
00924         }
00925       else if (0 != (current_arg = arg_shifter.get_the_parameter
00926                (ACE_TEXT("-ORBAcceptErrorDelay"))))
00927         {
00928           accept_error_delay = ACE_OS::atoi (current_arg);
00929 
00930           arg_shifter.consume_arg ();
00931         }
00932       else if (0 != (current_arg = arg_shifter.get_the_parameter
00933                 (ACE_TEXT("-ORBEndpoint"))))
00934         {
00935           // Each "endpoint" is of the form:
00936           //
00937           //   protocol://V.v@addr1,addr2,...,addrN
00938           //
00939           // or:
00940           //
00941           //   protocol://addr1,addr2,...,addrN
00942           //
00943           // where "V.v" is an optional protocol version for each
00944           // addr.  All endpoint strings should be of the above
00945           // form(s).
00946           //
00947           // Multiple sets of endpoint may be seperated by a semi-colon `;'.
00948           // For example:
00949           //
00950           //   corbaloc:space:2001,1.2@odyssey:2010;uiop://foo,bar
00951           //
00952           // All endpoint strings should be of the above form(s).
00953 
00954           this->set_endpoint_helper (TAO_DEFAULT_LANE,
00955                                      ACE_TEXT_ALWAYS_CHAR (current_arg));
00956 
00957           arg_shifter.consume_arg ();
00958         }
00959       else if (0 != (current_arg = arg_shifter.get_the_parameter
00960                 (ACE_TEXT("-ORBListenEndpoints"))))
00961         {
00962           // This option is similar to the -ORBEndPoint option. May be
00963           // ORBEndpoint option will be deprecated in future. But, for
00964           // now, I (Priyanka) am leaving so that both options can be
00965           // used.
00966 
00967           this->set_endpoint_helper (TAO_DEFAULT_LANE,
00968                                      ACE_TEXT_ALWAYS_CHAR (current_arg));
00969 
00970           arg_shifter.consume_arg ();
00971         }
00972       else if ((0 != (current_arg = arg_shifter.get_the_parameter
00973                 (ACE_TEXT("-ORBLaneEndpoint")))) ||
00974                (0 != (current_arg = arg_shifter.get_the_parameter
00975                 (ACE_TEXT("-ORBLaneListenEndpoints")))))
00976         {
00977           // This option is similar to the -ORBEndPoint option but
00978           // specifies endpoints for each lane.
00979 
00980           if (arg_shifter.is_option_next ())
00981             return -1;
00982 
00983           ACE_CString lane (ACE_TEXT_ALWAYS_CHAR (current_arg));
00984           arg_shifter.consume_arg ();
00985 
00986           if (arg_shifter.is_option_next ())
00987             return -1;
00988 
00989           ACE_CString endpoints (ACE_TEXT_ALWAYS_CHAR
00990                                   (arg_shifter.get_current ()));
00991           arg_shifter.consume_arg ();
00992 
00993           this->set_endpoint_helper (lane, endpoints);
00994         }
00995       else if (0 != (current_arg = arg_shifter.get_the_parameter
00996                 (ACE_TEXT("-ORBNoProprietaryActivation"))))
00997         {
00998           // This option can be used to set to not use any proprietary
00999           // activation framework. The only TAO proprietary activation
01000           // framework is IMR. So, by setting this option in TAO, the
01001           // IMR shouldnt be used .. even if the ORBUseIMR option is
01002           // set.
01003           // Fill in later
01004           // @@ To do later: Priyanka.
01005 
01006           throw ::CORBA::NO_IMPLEMENT ();
01007         }
01008        else if (0 != (current_arg = arg_shifter.get_the_parameter
01009                  (ACE_TEXT("-ORBUseSharedProfile"))))
01010          {
01011            this->orb_params ()->shared_profile (ACE_OS::atoi (current_arg));
01012 
01013            arg_shifter.consume_arg ();
01014          }
01015        else if (0 != (current_arg = arg_shifter.get_the_parameter
01016                  (ACE_TEXT("-ORBNegotiateCodesets"))))
01017          {
01018            negotiate_codesets = (ACE_OS::atoi (current_arg));
01019 
01020            arg_shifter.consume_arg ();
01021          }
01022        else if (0 != (current_arg = arg_shifter.get_the_parameter
01023                  (ACE_TEXT("-ORBUseParallelConnects"))))
01024          {
01025            use_parallel_connects = ACE_OS::atoi (current_arg);
01026            arg_shifter.consume_arg ();
01027          }
01028        else if (0 != (current_arg = arg_shifter.get_the_parameter
01029                  (ACE_TEXT("-ORBParallelConnectDelay"))))
01030          {
01031            this->orb_params ()->parallel_connect_delay
01032              (ACE_OS::atoi (current_arg));
01033            arg_shifter.consume_arg ();
01034          }
01035       else if (0 != (current_arg = arg_shifter.get_the_parameter
01036                 (ACE_TEXT("-ORBSingleReadOptimization"))))
01037         {
01038           this->orb_params ()->single_read_optimization
01039             (ACE_OS::atoi (current_arg));
01040 
01041           arg_shifter.consume_arg ();
01042         }
01043       else if (0 != (current_arg = arg_shifter.get_the_parameter
01044                 (ACE_TEXT("-ORBDisableRTCollocation"))))
01045         {
01046           int disable_rt_collocation = ACE_OS::atoi (current_arg);
01047           if (disable_rt_collocation)
01048             this->orb_params ()->disable_rt_collocation_resolver (true);
01049           else
01050             this->orb_params ()->disable_rt_collocation_resolver (false);
01051 
01052           arg_shifter.consume_arg ();
01053         }
01054       else if (0 != (current_arg = arg_shifter.get_the_parameter
01055                 (ACE_TEXT("-ORBUseLocalMemoryPool"))))
01056         {
01057           this->use_local_memory_pool_ = (0 != ACE_OS::atoi (current_arg));
01058 
01059           arg_shifter.consume_arg ();
01060         }
01061       else if (0 != (current_arg = arg_shifter.get_the_parameter
01062                 (ACE_TEXT("-ORBMaxMessageSize"))))
01063         {
01064           this->orb_params_.max_message_size (ACE_OS::atoi (current_arg));
01065 
01066           arg_shifter.consume_arg ();
01067         }
01068       else if (0 != (current_arg = arg_shifter.get_the_parameter
01069                 (ACE_TEXT("-ORBFTSendFullGroupTC"))))
01070         {
01071           this->ft_send_extended_sc_ = ACE_OS::atoi (current_arg);
01072 
01073           arg_shifter.consume_arg ();
01074         }
01075       else if (0 != (current_arg = arg_shifter.get_the_parameter
01076                 (ACE_TEXT("-ORBForwardInvocationOnObjectNotExist"))))
01077         {
01078           int forward = ACE_OS::atoi (current_arg);
01079           if (forward)
01080             this->orb_params_.forward_invocation_on_object_not_exist (true);
01081           else
01082             this->orb_params_.forward_invocation_on_object_not_exist (false);
01083 
01084           arg_shifter.consume_arg ();
01085         }
01086       else if (0 != (current_arg = arg_shifter.get_the_parameter
01087                 (ACE_TEXT("-ORBForwardOnceOnObjectNotExist"))))
01088         {
01089           int forward = ACE_OS::atoi (current_arg);
01090           if (forward)
01091             this->orb_params_.forward_once_exception (TAO::FOE_OBJECT_NOT_EXIST);
01092 
01093           arg_shifter.consume_arg ();
01094         }
01095       else if (0 != (current_arg = arg_shifter.get_the_parameter
01096                 (ACE_TEXT("-ORBForwardOnceOnCommFailure"))))
01097         {
01098           int forward = ACE_OS::atoi (current_arg);
01099           if (forward)
01100             this->orb_params_.forward_once_exception (TAO::FOE_COMM_FAILURE);
01101 
01102           arg_shifter.consume_arg ();
01103         }
01104       else if (0 != (current_arg = arg_shifter.get_the_parameter
01105                 (ACE_TEXT("-ORBForwardOnceOnTransient"))))
01106         {
01107           int forward = ACE_OS::atoi (current_arg);
01108           if (forward)
01109             this->orb_params_.forward_once_exception (TAO::FOE_TRANSIENT);
01110 
01111           arg_shifter.consume_arg ();
01112         }
01113       else if (0 != (current_arg = arg_shifter.get_the_parameter
01114                 (ACE_TEXT("-ORBForwardOnceOnInvObjref"))))
01115         {
01116           int forward = ACE_OS::atoi (current_arg);
01117           if (forward)
01118             this->orb_params_.forward_once_exception (TAO::FOE_INV_OBJREF);
01119 
01120           arg_shifter.consume_arg ();
01121         }
01122 
01123       ////////////////////////////////////////////////////////////////
01124       // catch any unknown -ORB args                                //
01125       ////////////////////////////////////////////////////////////////
01126       else if (arg_shifter.cur_arg_strncasecmp (ACE_TEXT("-ORB")) != -1)
01127         {
01128           if (TAO_debug_level > 0)
01129             {
01130               current_arg = arg_shifter.get_current ();
01131               ACE_ERROR ((LM_ERROR,
01132                           ACE_TEXT ("ERROR: Unknown \"-ORB\" option ")
01133                           ACE_TEXT ("<%s>.\n"),
01134                           ((current_arg == 0) ? ACE_TEXT("<NULL>")
01135                                               : current_arg)));
01136             }
01137 
01138           throw ::CORBA::BAD_PARAM (
01139             CORBA::SystemException::_tao_minor_code (
01140               TAO_ORB_CORE_INIT_LOCATION_CODE,
01141               EINVAL),
01142             CORBA::COMPLETED_NO);
01143         }
01144 
01145       ////////////////////////////////////////////////////////////////
01146       // ok, we can't interpret this argument, move to next argument//
01147       ////////////////////////////////////////////////////////////////
01148       else
01149         {
01150           // Any arguments that don't match are ignored so that the
01151           // caller can still use them.
01152           arg_shifter.ignore_arg ();
01153         }
01154     }
01155 
01156   const char *env_endpoint =
01157     ACE_OS::getenv ("TAO_ORBENDPOINT");
01158 
01159   if (env_endpoint != 0)
01160     {
01161       int result =
01162         this->orb_params ()->add_endpoints (TAO_DEFAULT_LANE, env_endpoint);
01163 
01164       if (result != 0)
01165         {
01166           if (TAO_debug_level > 0)
01167             {
01168               ACE_ERROR ((LM_ERROR,
01169                           ACE_TEXT ("ERROR: Environment variable ")
01170                           ACE_TEXT ("TAO_ORBENDPOINT set to invalid value ")
01171                           ACE_TEXT ("<%C>.\n"),
01172                           env_endpoint));
01173             }
01174 
01175           throw ::CORBA::BAD_PARAM (
01176             CORBA::SystemException::_tao_minor_code (
01177               TAO_ORB_CORE_INIT_LOCATION_CODE,
01178               EINVAL),
01179             CORBA::COMPLETED_NO);
01180         }
01181     }
01182 
01183 #if defined (SIGPIPE) && !defined (ACE_LACKS_UNIX_SIGNALS)
01184   // There's really no way to deal with this in a portable manner, so
01185   // we just have to suck it up and get preprocessor conditional and
01186   // ugly.
01187   //
01188   // Impractical to have each call to the ORB protect against the
01189   // implementation artifact of potential writes to dead connections,
01190   // as it'd be way expensive.  Do it here; who cares about SIGPIPE in
01191   // these kinds of applications, anyway?
01192   (void) ACE_OS::signal (SIGPIPE, (ACE_SignalHandler) SIG_IGN);
01193 #endif /* SIGPIPE */
01194 
01195   // Calling the open method here so that the svc.conf file is
01196   // opened and TAO_default_resource_factory::init () is called by the
01197   // time this method is called.
01198   this->parser_registry_.open (this);
01199 
01200   // Initialize the pointers to resources in the ORB Core instance,
01201   // e.g., reactor, connector, etc.  Must do this after we open
01202   // services because we'll load the factory from there.
01203   TAO_Resource_Factory *trf = this->resource_factory ();
01204 
01205   if (trf == 0)
01206     {
01207       ACE_ERROR ((LM_ERROR,
01208                   ACE_TEXT ("TAO (%P|%t) - %p\n"),
01209                   ACE_TEXT ("ORB Core unable to find a ")
01210                   ACE_TEXT ("Resource Factory instance")));
01211       throw ::CORBA::INTERNAL (
01212         CORBA::SystemException::_tao_minor_code (
01213           TAO_ORB_CORE_INIT_LOCATION_CODE,
01214           0),
01215         CORBA::COMPLETED_NO);
01216     }
01217 
01218   // Set whether or not to use the local memory pool for the cdr allocators.
01219 
01220   trf->use_local_memory_pool (this->use_local_memory_pool_);
01221 
01222   // @@ ????
01223   // Make sure the reactor is initialized...
01224   ACE_Reactor *reactor = this->reactor ();
01225   if (reactor == 0)
01226     {
01227       ACE_ERROR ((LM_ERROR,
01228                   ACE_TEXT ("TAO (%P|%t) - %p\n"),
01229                   ACE_TEXT ("ORB Core unable to initialize reactor")));
01230       throw ::CORBA::INITIALIZE (
01231         CORBA::SystemException::_tao_minor_code (
01232           TAO_ORB_CORE_INIT_LOCATION_CODE,
01233           0),
01234         CORBA::COMPLETED_NO);
01235     }
01236 
01237   TAO_Server_Strategy_Factory *ssf = this->server_factory ();
01238 
01239   if (ssf == 0)
01240     {
01241       ACE_ERROR ((LM_ERROR,
01242                   ACE_TEXT ("TAO (%P|%t) - %p\n"),
01243                   ACE_TEXT ("ORB Core unable to find a ")
01244                   ACE_TEXT ("Server Strategy Factory instance")));
01245       throw ::CORBA::INTERNAL (
01246         CORBA::SystemException::_tao_minor_code (
01247           TAO_ORB_CORE_INIT_LOCATION_CODE,
01248           0),
01249         CORBA::COMPLETED_NO);
01250     }
01251 
01252   ssf->open (this);
01253 
01254   // Open the ObjectKey_Table
01255   (void) this->object_key_table_.init (this);
01256 
01257   // Obtain the timeout value for the thread-per-connection model
01258   this->thread_per_connection_use_timeout_ =
01259     ssf->thread_per_connection_timeout (this->thread_per_connection_timeout_);
01260 
01261   if (thread_per_connection_use_timeout_ == -1)
01262     {
01263       if (ACE_OS::strcasecmp (TAO_DEFAULT_THREAD_PER_CONNECTION_TIMEOUT,
01264                               "INFINITE") == 0)
01265         {
01266           this->thread_per_connection_use_timeout_ = 0;
01267         }
01268       else
01269         {
01270           this->thread_per_connection_use_timeout_ = 1;
01271           int milliseconds =
01272             ACE_OS::atoi (TAO_DEFAULT_THREAD_PER_CONNECTION_TIMEOUT);
01273           // Use a temporary to obtain automatic normalization.
01274           this->thread_per_connection_timeout_ =
01275             ACE_Time_Value (0, 1000 * milliseconds);
01276         }
01277     }
01278   if (this->thread_per_connection_use_timeout_ == 0)
01279     {
01280       // Do not wait for the server threads because they may block
01281       // forever.
01282       this->tm_.wait_on_exit (0);
01283     }
01284 
01285   // Initialize the "ORB" pseudo-object now.
01286   this->orb_ = CORBA::ORB::_tao_make_ORB (this);
01287 
01288   // This should probably move into the ORB Core someday rather then
01289   // being done at this level.
01290   this->orb_->_use_omg_ior_format (use_ior);
01291 
01292   // Set all kinds of orb parameters whose setting needed to be
01293   // deferred until after the service config entries had been
01294   // determined.
01295 
01296   this->orb_params ()->service_port (TAO::MCAST_NAMESERVICE, ns_port);
01297 
01298   if (ns_port != 0)
01299     {
01300       static char const mcast_fmt[] = "mcast://:%d::";
01301       static size_t const PORT_BUF_SIZE = 256;
01302 
01303       char def_init_ref[PORT_BUF_SIZE] = { 0 };
01304 
01305       ACE_OS::snprintf (def_init_ref,
01306                         PORT_BUF_SIZE,
01307                         mcast_fmt,
01308                         ns_port);
01309 
01310       this->orb_params ()->default_init_ref (def_init_ref);
01311     }
01312 
01313   this->orb_params ()->service_port (TAO::MCAST_TRADINGSERVICE, ts_port);
01314   this->orb_params ()->service_port (TAO::MCAST_IMPLREPOSERVICE, ir_port);
01315 
01316   this->orb_params ()->use_dotted_decimal_addresses (dotted_decimal_addresses);
01317   // When caching incoming transports don't use the host name if
01318   // -ORBDottedDecimalAddresses or -ORBNoServerSideNameLookups is true.
01319   this->orb_params ()->cache_incoming_by_dotted_decimal_address
01320                                             (no_server_side_name_lookups
01321                                              || dotted_decimal_addresses);
01322 
01323   this->orb_params ()->use_parallel_connects
01324     (use_parallel_connects != 0);
01325 
01326   this->orb_params ()->linger (linger);
01327   this->orb_params ()->accept_error_delay (accept_error_delay);
01328   this->orb_params ()->nodelay (nodelay);
01329   this->orb_params ()->sock_keepalive (so_keepalive);
01330   this->orb_params ()->sock_dontroute (so_dontroute);
01331   this->orb_params ()->ip_hoplimit (ip_hoplimit);
01332   this->orb_params ()->ip_multicastloop (ip_multicastloop);
01333   if (rcv_sock_size >= 0)
01334     this->orb_params ()->sock_rcvbuf_size (rcv_sock_size);
01335   if (snd_sock_size >= 0)
01336     this->orb_params ()->sock_sndbuf_size (snd_sock_size);
01337   if (cdr_tradeoff >= 0)
01338     this->orb_params ()->cdr_memcpy_tradeoff (cdr_tradeoff);
01339 
01340   this->orb_params ()->std_profile_components (std_profile_components);
01341 
01342   this->orb_params ()->negotiate_codesets (negotiate_codesets);
01343 
01344   if (this->codeset_manager())
01345     this->codeset_manager_->open(*this);
01346   else
01347     if  (TAO_debug_level > 0)
01348         ACE_DEBUG ((LM_DEBUG,
01349                     ACE_TEXT("TAO (%P|%t) - ORB_Core: ")
01350                     ACE_TEXT("Codeset Manager not available\n")));
01351 
01352   // Set up the pluggable protocol infrastructure.  First get a
01353   // pointer to the protocol factories set, then obtain pointers to
01354   // all factories loaded by the service configurator.
01355   // Load all protocol factories!
01356   if (trf->init_protocol_factories () == -1)
01357     throw ::CORBA::INITIALIZE (
01358       CORBA::SystemException::_tao_minor_code (
01359         TAO_ORB_CORE_INIT_LOCATION_CODE,
01360         0),
01361       CORBA::COMPLETED_NO);
01362 
01363   // init the ORB core's pointer
01364   this->protocol_factories_ = trf->get_protocol_factories ();
01365 
01366   // Initialize the flushing strategy
01367   this->flushing_strategy_ = trf->create_flushing_strategy ();
01368 
01369   // Look in the service repository for an instance of the Protocol Hooks.
01370   const char *protocols_hooks_name = this->orb_params ()->protocols_hooks_name ();
01371 
01372   this->protocols_hooks_ =
01373     ACE_Dynamic_Service<TAO_Protocols_Hooks>::instance
01374     (this->configuration (),
01375      ACE_TEXT_CHAR_TO_TCHAR (protocols_hooks_name));
01376 
01377   if (this->protocols_hooks_ != 0)
01378     {
01379       // Initialize the protocols hooks instance.
01380       this->protocols_hooks_->init_hooks (this);
01381     }
01382 
01383   // If available, allow the Adapter Factory to setup.
01384   ACE_Service_Object *adapter_factory =
01385     ACE_Dynamic_Service<ACE_Service_Object>::instance (
01386       this->configuration (),
01387       this->orb_params ()->poa_factory_name ());
01388 
01389   if (adapter_factory != 0)
01390     {
01391       adapter_factory->init (0, 0);
01392     }
01393 
01394   // Look in the service repository for an instance of the
01395   // Network Priority Protocol Hooks.
01396   const ACE_CString &network_priority_protocols_hooks_name =
01397      TAO_ORB_Core_Static_Resources::instance ()->
01398        network_priority_protocols_hooks_name_;
01399 
01400   this->network_priority_protocols_hooks_ =
01401     ACE_Dynamic_Service<TAO_Network_Priority_Protocols_Hooks>::instance
01402     (this->configuration (),
01403      ACE_TEXT_CHAR_TO_TCHAR (network_priority_protocols_hooks_name.c_str()));
01404 
01405   if (this->network_priority_protocols_hooks_ != 0)
01406     {
01407       // Initialize the protocols hooks instance.
01408       this->network_priority_protocols_hooks_->init_hooks (this);
01409     }
01410 
01411   // As a last step perform initializations of the service callbacks
01412   this->services_callbacks_init ();
01413 
01414   // The ORB has been initialized, meaning that the ORB is no longer
01415   // in the shutdown state.
01416   this->has_shutdown_ = false;
01417 
01418   return 0;
01419 }

TAO_ORB_Core::InitRefMap * TAO_ORB_Core::init_ref_map ( void   ) 

Return a pointer to the -ORBInitRef map.

Definition at line 184 of file ORB_Core.inl.

00185 {
00186   return &this->init_ref_map_;
00187 }

CORBA::Long TAO_ORB_Core::initialize_object ( TAO_Stub the_stub,
CORBA::Object_ptr  obj 
)

Initialize a new object, use the adapter registry to initialize a collocated object, if not possible then initialize a regular object. NOTE: Why would this method be required? The answer is if the user decides to use lazy initialization of CORBA object, then this is the route that we have to take to do the initialization.

Definition at line 2033 of file ORB_Core.cpp.

02034 {
02035   // @@ What about forwarding.  With this approach we are never forwarded
02036   //    when we use collocation!
02037   const TAO_MProfile &mprofile =
02038     stub->base_profiles ();
02039 
02040   return initialize_object_i (stub, mprofile);
02041 }

CORBA::Long TAO_ORB_Core::initialize_object_i ( TAO_Stub the_stub,
const TAO_MProfile mprofile 
) [protected]

Common code from initialize_object and reinitialize_object.

Definition at line 2052 of file ORB_Core.cpp.

02054 {
02055   CORBA::Long retval = 0;
02056   TAO_ORB_Core_Auto_Ptr collocated_orb_core;
02057 
02058   {
02059     // Lock the ORB_Table against concurrent modification while we
02060     // iterate through the ORBs.
02061     ACE_MT (ACE_GUARD_RETURN (TAO_SYNCH_MUTEX,
02062                               guard,
02063                               TAO::ORB_Table::instance()->lock (),
02064                               0));
02065 
02066     TAO::ORB_Table * const table = TAO::ORB_Table::instance ();
02067     TAO::ORB_Table::iterator const end = table->end ();
02068     for (TAO::ORB_Table::iterator i = table->begin (); i != end; ++i)
02069       {
02070         TAO_ORB_Core * const other_core = (*i).second.core ();
02071 
02072         if (this->is_collocation_enabled (other_core,
02073                                           mprofile))
02074           {
02075             other_core->_incr_refcnt ();
02076             TAO_ORB_Core_Auto_Ptr tmp_auto_ptr (other_core);
02077             collocated_orb_core = tmp_auto_ptr;
02078             break;
02079           }
02080       }
02081   }
02082 
02083   if (collocated_orb_core.get ())
02084     {
02085       retval = collocated_orb_core.get ()->adapter_registry ().initialize_collocated_object (stub);
02086     }
02087 
02088   return retval;
02089 }

ACE_Allocator * TAO_ORB_Core::input_cdr_buffer_allocator ( void   ) 

This allocator is always global and has no locks. It is intended for allocating the buffers used in *incoming* CDR streams.

Definition at line 2823 of file ORB_Core.cpp.

02824 {
02825   return this->lane_resources ().input_cdr_buffer_allocator ();
02826 }

ACE_Allocator * TAO_ORB_Core::input_cdr_dblock_allocator ( void   ) 

This allocator is global, may or may not have locks. It is intended for allocating the ACE_Data_Blocks used in *incoming* CDR streams.

Definition at line 2817 of file ORB_Core.cpp.

02818 {
02819   return this->lane_resources ().input_cdr_dblock_allocator ();
02820 }

ACE_Allocator * TAO_ORB_Core::input_cdr_msgblock_allocator ( void   ) 

This allocator is always global and has no locks. It is intended for allocating the buffers used in *incoming* CDR streams.

Definition at line 2829 of file ORB_Core.cpp.

02830 {
02831   return this->lane_resources ().input_cdr_msgblock_allocator ();
02832 }

TAO_IORInterceptor_Adapter * TAO_ORB_Core::ior_interceptor_adapter ( void   ) 

Get the IOR Interceptor adapter. If not created, this method will try to create one.

Definition at line 3235 of file ORB_Core.cpp.

03236 {
03237   if (this->ior_interceptor_adapter_ == 0)
03238     {
03239       ACE_GUARD_RETURN (TAO_SYNCH_MUTEX,
03240                         ace_mon,
03241                         this->lock_,
03242                         0);
03243 
03244       if (this->ior_interceptor_adapter_ == 0)
03245         {
03246           try
03247             {
03248               TAO_IORInterceptor_Adapter_Factory * ior_ap_factory =
03249                 ACE_Dynamic_Service<TAO_IORInterceptor_Adapter_Factory>::instance
03250                   (this->configuration (),
03251                    ACE_TEXT_CHAR_TO_TCHAR (TAO_ORB_Core::iorinterceptor_adapter_factory_name ()));
03252 
03253               if (ior_ap_factory)
03254                 {
03255                   this->ior_interceptor_adapter_ = ior_ap_factory->create ();
03256                 }
03257             }
03258           catch (const ::CORBA::Exception& ex)
03259             {
03260               ex._tao_print_exception (
03261                 "Cannot initialize the ior_interceptor_adapter\n");
03262             }
03263         }
03264     }
03265 
03266   return this->ior_interceptor_adapter_;
03267 }

const char * TAO_ORB_Core::iorinterceptor_adapter_factory_name ( void   )  [static]

Gets the value of TAO_ORB_Core::iorinterceptor_adapter_factory_name_.

Definition at line 1550 of file ORB_Core.cpp.

void TAO_ORB_Core::iorinterceptor_adapter_factory_name ( const char *  name  )  [static]

Sets the value of TAO_ORB_Core::iorinterceptor_adapter_factory_name_.

Definition at line 1544 of file ORB_Core.cpp.

int TAO_ORB_Core::is_collocated ( const TAO_MProfile mprofile  ) 

See if we have a collocated address, if yes, return the POA associated with the address.

Definition at line 2116 of file ORB_Core.cpp.

02117 {
02118   // @@ Lots of issues arise when dealing with collocation.  What about
02119   //    forwarding or what if this is a multi-profile IOR where the order is
02120   //    significant and only one of the profiles is collocated.  For example
02121   //    when using a multiple servers for fault tolerance.  For now, we just
02122   //    look through all profiles and if any are colocated then we assume
02123   //    the object is collocated.
02124   // @@ Note, if collocated we can not be forwarded!
02125   //    Also, acceptor_registry_->is_collocated (...) will check the
02126   //    address (ORB Host) but not the object_key.  This should be checked
02127   //    also.
02128 
02129   return this->thread_lane_resources_manager ().is_collocated (mprofile);
02130 }

CORBA::Boolean TAO_ORB_Core::is_collocation_enabled ( TAO_ORB_Core other_orb,
const TAO_MProfile mp 
) [private]

Checks to see whether collocation optimizations have to be applied on objects in the other_orb

Definition at line 2092 of file ORB_Core.cpp.

02094 {
02095   TAO_MProfile mp_temp;
02096 
02097   TAO_Profile* profile = 0;
02098   if (this->service_profile_selection(mp, profile) && profile)
02099   {
02100     mp_temp.add_profile(profile);
02101   }
02102 
02103   if (!orb_core->optimize_collocation_objects ())
02104     return 0;
02105 
02106   if (!orb_core->use_global_collocation () && orb_core != this)
02107     return 0;
02108 
02109   if (!orb_core->is_collocated (profile ? mp_temp : mp))
02110     return 0;
02111 
02112   return 1;
02113 }

CORBA::Boolean TAO_ORB_Core::is_permanent_forward_condition ( const CORBA::Object_ptr  obj,
const TAO_Service_Context service_context 
)

Verify condition for permanent forward is given, both parameters must provide group attributes.

Definition at line 627 of file ORB_Core.inl.

00629 {
00630   const TAO_Service_Callbacks *service_callback =
00631       this->fault_tolerance_service ().service_callback ();
00632 
00633   // Since forward location is allowed to be nil then check for it.
00634   CORBA::Boolean const permanent_forward_condition =
00635       service_callback && obj &&
00636       service_callback->is_permanent_forward_condition (obj,
00637                                                         service_context);
00638 
00639   return permanent_forward_condition;
00640 }

TAO_Service_Callbacks::Profile_Equivalence TAO_ORB_Core::is_profile_equivalent ( const TAO_Profile this_p,
const TAO_Profile that_p 
)

Hook for the services to determine whether the profiles are equivalent or not. For details on how this is used please see the FT service

Definition at line 120 of file ORB_Core.inl.

00122 {
00123   TAO_Service_Callbacks::Profile_Equivalence retval
00124     = TAO_Service_Callbacks::DONT_KNOW;
00125 
00126   if (this->ft_service_.service_callback ())
00127     {
00128       retval =
00129         this->ft_service_.service_callback ()->is_profile_equivalent (this_p,
00130                                                                       that_p);
00131     }
00132 
00133   return retval;
00134 }

TAO_Thread_Lane_Resources & TAO_ORB_Core::lane_resources ( void   ) 

Get access to the thread lane resources.

Definition at line 2415 of file ORB_Core.cpp.

02416 {
02417   return this->thread_lane_resources_manager ().lane_resources ();
02418 }

TAO_Leader_Follower & TAO_ORB_Core::leader_follower ( void   ) 

Get access to the leader_follower class.

Definition at line 2135 of file ORB_Core.cpp.

02136 {
02137   return this->lane_resources ().leader_follower ();
02138 }

TAO_LF_Strategy & TAO_ORB_Core::lf_strategy ( void   ) 

Get access to the leader follower strategy.

Definition at line 2141 of file ORB_Core.cpp.

02142 {
02143   return this->thread_lane_resources_manager ().lf_strategy ();
02144 }

CORBA::ORB::ObjectIdList * TAO_ORB_Core::list_initial_references ( void   ) 

List all the service known by the ORB.

Definition at line 2759 of file ORB_Core.cpp.

02760 {
02761   // Unsupported initial services should NOT be included in the below list!
02762   static const char *initial_services[] = { TAO_LIST_OF_INITIAL_SERVICES };
02763   // Make sure the "terminating" zero is the last array element so
02764   // that there is a stop condition when iterating through the list.
02765 
02766   static const size_t initial_services_size =
02767     sizeof (initial_services) / sizeof (initial_services[0]);
02768 
02769   const size_t total_size =
02770     initial_services_size
02771     + this->init_ref_map_.size ()
02772     + this->object_ref_table_.current_size ();
02773 
02774   CORBA::ORB::ObjectIdList *tmp = 0;
02775 
02776   ACE_NEW_THROW_EX (tmp,
02777                     CORBA::ORB::ObjectIdList (
02778                       static_cast<CORBA::ULong> (total_size)),
02779                     CORBA::NO_MEMORY ());
02780 
02781   CORBA::ORB::ObjectIdList_var list (tmp);
02782   list->length (static_cast<CORBA::ULong> (total_size));
02783 
02784   CORBA::ULong index = 0;
02785   // Index for ObjectIdList members.
02786 
02787   // Iterate over the registered initial references.
02788   for (index = 0; index < initial_services_size; ++index)
02789     list[index] = initial_services[index];
02790 
02791   // Now iterate over the initial references created by the user and
02792   // add them to the sequence.
02793 
02794   // References registered via
02795   // ORBInitInfo::register_initial_reference().
02796   TAO_Object_Ref_Table::iterator const obj_ref_end =
02797     this->object_ref_table_.end ();
02798 
02799   for (TAO_Object_Ref_Table::iterator i = this->object_ref_table_.begin ();
02800        i != obj_ref_end;
02801        ++i, ++index)
02802     list[index] = CORBA::string_dup ((*i).first.in ());
02803 
02804   // References registered via INS.
02805   InitRefMap::iterator const end = this->init_ref_map_.end ();
02806 
02807   for (InitRefMap::iterator j = this-> init_ref_map_.begin ();
02808        j != end;
02809        ++j, ++index)
02810     list[index] = (*j).first.c_str ();
02811 
02812   return list._retn ();
02813 }

void TAO_ORB_Core::load_policy_validators ( TAO_Policy_Validator validator  ) 

Call the libraries to handover the validators if they havent registered yet with the list of validators.

Definition at line 1956 of file ORB_Core.cpp.

01957 {
01958   if (this->bidir_adapter_ == 0)
01959     {
01960       this->bidir_adapter_ =
01961         ACE_Dynamic_Service<TAO_BiDir_Adapter>::instance
01962           (this->configuration (), ACE_TEXT ("BiDirGIOP_Loader"));
01963     }
01964 
01965   // Call the BiDir library if it has been loaded
01966   if (this->bidir_adapter_)
01967     {
01968       this->bidir_adapter_->load_policy_validators (validator);
01969     }
01970 
01971   // Call the ZIOP library if it has been loaded
01972   if (this->ziop_adapter_)
01973     {
01974       this->ziop_adapter_->load_policy_validators (validator);
01975     }
01976 }

ACE_Lock * TAO_ORB_Core::locking_strategy ( void   ) 

Return the locking strategy used for the data blocks.

Definition at line 40 of file ORB_Core.inl.

00041 {
00042   if (this->resource_factory ()->use_locked_data_blocks ())
00043     return &this->data_block_lock_;
00044 
00045   return 0;
00046 }

void TAO_ORB_Core::not_default ( const char *  orb_id  ) 

Choose to be not a default ORB when there is more than one ORB.

Definition at line 197 of file ORB_Core.inl.

00198 {
00199   TAO::ORB_Table * const table = TAO::ORB_Table::instance ();
00200   table->not_default (orb_id);
00201 }

CORBA::Boolean TAO_ORB_Core::object_is_nil ( CORBA::Object_ptr  object  ) 

The loaded service would determine if the CORBA::Object_ptr is actually nil or not. This would be useful to accomodate new enhanced definitions as defined by the service specification.

Definition at line 108 of file ORB_Core.inl.

00109 {
00110   CORBA::Boolean retval = false;
00111   if (this->ft_service_.service_callback ())
00112     {
00113       retval = this->ft_service_.service_callback ()->object_is_nil (obj);
00114     }
00115   return retval;
00116 }

TAO::ObjectKey_Table & TAO_ORB_Core::object_key_table ( void   ) 

Acceessor to the table that stores the object_keys.

Definition at line 67 of file ORB_Core.inl.

00068 {
00069   return this->object_key_table_;
00070 }

TAO_Object_Ref_Table & TAO_ORB_Core::object_ref_table ( void   ) 

Return the table that maps object key/name to de-stringified object reference. It is needed for supporting local objects in the resolve_initial_references() mechanism.

Definition at line 61 of file ORB_Core.inl.

00062 {
00063   return this->object_ref_table_;
00064 }

void TAO_ORB_Core::operator= ( const TAO_ORB_Core  )  [private]

The value of the timeout if the flag above is not zero.

CORBA::Boolean TAO_ORB_Core::optimize_collocation_objects ( void   )  const

The value of the timeout if the flag above is not zero.

Definition at line 210 of file ORB_Core.inl.

00211 {
00212   return this->opt_for_collocation_;
00213 }

void TAO_ORB_Core::optimize_collocation_objects ( CORBA::Boolean  opt  ) 

Set/get the collocation flags.

Definition at line 204 of file ORB_Core.inl.

00205 {
00206   this->opt_for_collocation_ = opt;
00207 }

CORBA::ORB_ptr TAO_ORB_Core::orb ( void   ) 

Get pointer to the ORB.

Definition at line 166 of file ORB_Core.inl.

00167 {
00168   return this->orb_;
00169 }

TAO_ORB_Parameters * TAO_ORB_Core::orb_params ( void   ) 

Accessor for the ORB parameters.

Definition at line 234 of file ORB_Core.inl.

00235 {
00236   return &(this->orb_params_);
00237 }

const char * TAO_ORB_Core::orbid ( void   )  const

Return ORBid string.

Definition at line 347 of file ORB_Core.inl.

00348 {
00349   return this->orbid_;
00350 }

TAO::ORBInitializer_Registry_Adapter * TAO_ORB_Core::orbinitializer_registry ( void   ) 

Return pointer to the orb initializer registry associated with this ORB core. Tries to load the PI library if it is not loaded yet

Definition at line 458 of file ORB_Core.inl.

00459 {
00460   ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, mon, this->lock_,
00461                     0);
00462   if (orbinitializer_registry_ == 0)
00463     {
00464       return this->orbinitializer_registry_i ();
00465     }
00466   return this->orbinitializer_registry_;
00467 }

TAO::ORBInitializer_Registry_Adapter * TAO_ORB_Core::orbinitializer_registry_i ( void   )  [protected]

Return pointer to the orb initializer registry associated with this ORB core.

Definition at line 1680 of file ORB_Core.cpp.

01681 {
01682   // @todo The ORBInitializer_Registry is supposed to be a singleton.
01683 
01684   // If not, lookup it up.
01685   this->orbinitializer_registry_ =
01686     ACE_Dynamic_Service<TAO::ORBInitializer_Registry_Adapter>::instance
01687       (this->configuration (),
01688        ACE_TEXT ("ORBInitializer_Registry"));
01689 
01690 #if !defined (TAO_AS_STATIC_LIBS) && !(defined (ACE_VXWORKS) && !defined (__RTP__))
01691       // In case we build shared, try to load the PI Client library, in a
01692       // static build we just can't do this, so don't try it, lower layers
01693       // output an error then.
01694   if (this->orbinitializer_registry_ == 0)
01695     {
01696       this->configuration ()->process_directive (
01697         ACE_DYNAMIC_SERVICE_DIRECTIVE ("ORBInitializer_Registry",
01698                                        "TAO_PI",
01699                                        "_make_ORBInitializer_Registry",
01700                                        ""));
01701       this->orbinitializer_registry_ =
01702         ACE_Dynamic_Service<TAO::ORBInitializer_Registry_Adapter>::instance
01703           (this->configuration (),
01704            ACE_TEXT ("ORBInitializer_Registry"));
01705     }
01706 #endif /* !TAO_AS_STATIC_LIBS && !(ACE_VXWORKS && !__RTP__) */
01707 
01708   return this->orbinitializer_registry_;
01709 }

ACE_Allocator * TAO_ORB_Core::output_cdr_buffer_allocator ( void   ) 

This allocator is always TSS and has no locks. It is intended for allocating the buffers used in *outgoing* CDR streams.

Definition at line 2842 of file ORB_Core.cpp.

02843 {
02844   return this->lane_resources ().output_cdr_buffer_allocator ();
02845 }

ACE_Allocator * TAO_ORB_Core::output_cdr_dblock_allocator ( void   ) 

This allocator is always TSS and has no locks. It is intended for allocating the ACE_Data_Blocks used in *outgoing* CDR streams.

Definition at line 2835 of file ORB_Core.cpp.

02836 {
02837 
02838   return this->lane_resources ().output_cdr_dblock_allocator ();
02839 }

ACE_Allocator * TAO_ORB_Core::output_cdr_msgblock_allocator ( void   ) 

This allocator is always TSS and has no locks. It is intended for allocating the ACE_Data_Blocks used in *outgoing* CDR streams.

Definition at line 2849 of file ORB_Core.cpp.

02850 {
02851   return this->lane_resources ().output_cdr_msgblock_allocator ();
02852 }

TAO_Parser_Registry * TAO_ORB_Core::parser_registry ( void   ) 

Get the IOR parser registry.

Definition at line 251 of file ORB_Core.inl.

00252 {
00253   return &this->parser_registry_;
00254 }

TAO_Adapter * TAO_ORB_Core::poa_adapter ( void   ) 

Get the adapter named "RootPOA" and cache the result, this is an optimization for the POA.

Definition at line 1889 of file ORB_Core.cpp.

01890 {
01891   if (this->poa_adapter_ == 0)
01892     {
01893       ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, ace_mon, this->lock_, 0);
01894       if (this->poa_adapter_ == 0)
01895         {
01896           this->poa_adapter_ =
01897             this->adapter_registry_.find_adapter ("RootPOA");
01898         }
01899     }
01900   return this->poa_adapter_;
01901 }

CORBA::Object_ptr TAO_ORB_Core::poa_current ( void   ) 

Accessor to the POA current.

Todo:
In the future this hook should change, instead of hardcoding the object we should add a "Resolver" to the ORB, so the "POACurrent" object returns a per-ORB object.
Similarly, each ORB should implement the TSS pattern to put the POA_Current_Impl in a void* slot. The current approach *does* decouple the POA from the ORB, but it cannot add new adapters or other components transparently.
TAO::PolicyFactory_Registry_Adapter * TAO_ORB_Core::policy_factory_registry ( void   ) 

Return pointer to the policy factory registry associated with this ORB core.

Definition at line 476 of file ORB_Core.inl.

00477 {
00478   ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, mon, this->lock_,
00479                     0);
00480   if (policy_factory_registry_ == 0)
00481     {
00482       return this->policy_factory_registry_i ();
00483     }
00484   return this->policy_factory_registry_;
00485 }

TAO::PolicyFactory_Registry_Adapter * TAO_ORB_Core::policy_factory_registry_i ( void   )  [protected]

Return pointer to the policy factory registry associated with this ORB core.

Definition at line 1634 of file ORB_Core.cpp.

01635 {
01636 
01637   TAO_PolicyFactory_Registry_Factory *loader =
01638     ACE_Dynamic_Service<TAO_PolicyFactory_Registry_Factory>::instance
01639       (this->configuration (),
01640        ACE_TEXT ("PolicyFactory_Loader"));
01641 
01642   if (loader == 0)
01643     {
01644       this->configuration ()->process_directive (
01645         ACE_DYNAMIC_SERVICE_DIRECTIVE("PolicyFactory_Loader",
01646                                       "TAO_PI",
01647                                       "_make_TAO_PolicyFactory_Loader",
01648                                       ""));
01649       loader =
01650         ACE_Dynamic_Service<TAO_PolicyFactory_Registry_Factory>::instance
01651           (this->configuration (),
01652            ACE_TEXT ("PolicyFactory_Loader"));
01653     }
01654 
01655   if (loader != 0)
01656     {
01657       this->policy_factory_registry_ =
01658         loader->create ();
01659     }
01660 
01661   return this->policy_factory_registry_;
01662 }

TAO_ProtocolFactorySet * TAO_ORB_Core::protocol_factories ( void   ) 

Get the protocol factories.

Definition at line 245 of file ORB_Core.inl.

00246 {
00247   return TAO_OC_RETRIEVE (protocol_factories);
00248 }

TAO_Protocols_Hooks* TAO_ORB_Core::protocols_hooks ( void   ) 

Returns pointer to the Protocols_Hooks.

ACE_Reactor * TAO_ORB_Core::reactor ( void   ) 

Wrappers that forward the request to the concurrency strategy.

Definition at line 2929 of file ORB_Core.cpp.

02930 {
02931   return this->leader_follower ().reactor ();
02932 }

int TAO_ORB_Core::register_handle ( ACE_HANDLE  handle  ) 

Register the handle of an open connection with the ORB Core handle set. This handle set will be used to explicitly remove corresponding event handlers from the reactor.

CORBA::Long TAO_ORB_Core::reinitialize_object ( TAO_Stub stub  ) 

Reinitialise a stub after the effective profile has changed. This will happen after a location forward has been received or if a location forward supplied new target subsequently fails.

Definition at line 2044 of file ORB_Core.cpp.

02045 {
02046   return initialize_object_i (stub, stub->forward_profiles ()
02047                                     ? *(stub->forward_profiles ())
02048                                     : stub->base_profiles ());
02049 }

int TAO_ORB_Core::remove_handle ( ACE_HANDLE  handle  ) 

Remove handle from the ORB Core's handle set so that it isn't included in the set that is passed to the reactor upon ORB destruction.

void TAO_ORB_Core::request_dispatcher ( TAO_Request_Dispatcher rd  ) 

Set a new request dispatcher. The ORB Core retains ownership of the request dispatcher once it gets it. Currently, this only gets called at initialization.

Definition at line 1913 of file ORB_Core.cpp.

01914 {
01915   // Assume ownership of the request dispatcher.
01916   TAO_Request_Dispatcher *tmp = this->request_dispatcher_;
01917   this->request_dispatcher_ = request_dispatcher;
01918   delete tmp;
01919 }

TAO_Request_Dispatcher * TAO_ORB_Core::request_dispatcher ( void   ) 

Return the current request dispatcher strategy.

Definition at line 178 of file ORB_Core.inl.

00179 {
00180   return this->request_dispatcher_;
00181 }

CORBA::Object_ptr TAO_ORB_Core::resolve_codecfactory ( void   ) 

Resolve the CodecFactory DLL.

Definition at line 399 of file ORB_Core.inl.

00400 {
00401   ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, mon, this->lock_,
00402                     CORBA::Object::_nil ());
00403   if (CORBA::is_nil (this->codec_factory_))
00404     {
00405       this->resolve_codecfactory_i ();
00406     }
00407   return CORBA::Object::_duplicate (this->codec_factory_);
00408 }

void TAO_ORB_Core::resolve_codecfactory_i ( void   )  [protected]

Obtain and cache the codec factory object reference.

Definition at line 2454 of file ORB_Core.cpp.

02455 {
02456   TAO_Object_Loader *loader =
02457     ACE_Dynamic_Service<TAO_Object_Loader>::instance
02458       (this->configuration (),
02459        ACE_TEXT ("CodecFactory_Loader"));
02460 
02461   if (loader == 0)
02462     {
02463       this->configuration()->process_directive
02464         (ACE_DYNAMIC_SERVICE_DIRECTIVE("CodecFactory",
02465                                        "TAO_CodecFactory",
02466                                        "_make_TAO_CodecFactory_Loader",
02467                                        ""));
02468       loader =
02469         ACE_Dynamic_Service<TAO_Object_Loader>::instance
02470           (this->configuration (), ACE_TEXT ("CodecFactory_Loader"));
02471     }
02472 
02473   if (loader != 0)
02474     {
02475       this->codec_factory_ =
02476         loader->create_object (this->orb_, 0, 0);
02477     }
02478 }

CORBA::Object_ptr TAO_ORB_Core::resolve_compression_manager ( void   ) 

Resolve the Compression DLL.

Definition at line 411 of file ORB_Core.inl.

00412 {
00413   ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, mon, this->lock_,
00414                     CORBA::Object::_nil ());
00415   if (CORBA::is_nil (this->compression_manager_))
00416     {
00417       this->resolve_compression_manager_i ();
00418     }
00419   return CORBA::Object::_duplicate (this->compression_manager_);
00420 }

void TAO_ORB_Core::resolve_compression_manager_i ( void   )  [protected]

Obtain and cache the compression manager object reference.

Definition at line 2481 of file ORB_Core.cpp.

02482 {
02483   TAO_Object_Loader *loader =
02484     ACE_Dynamic_Service<TAO_Object_Loader>::instance
02485       (this->configuration (),
02486        ACE_TEXT ("Compression_Loader"));
02487 
02488   if (loader == 0)
02489     {
02490       this->configuration()->process_directive
02491         (ACE_DYNAMIC_SERVICE_DIRECTIVE("Compression",
02492                                        "TAO_Compression",
02493                                        "_make_TAO_Compression_Loader",
02494                                        ""));
02495       loader =
02496         ACE_Dynamic_Service<TAO_Object_Loader>::instance
02497           (this->configuration (), ACE_TEXT ("Compression_Loader"));
02498     }
02499 
02500   if (loader != 0)
02501     {
02502       this->compression_manager_ = loader->create_object (this->orb_, 0, 0);
02503     }
02504 }

CORBA::Object_ptr TAO_ORB_Core::resolve_dynanyfactory ( void   ) 

Resolve the Dynamic Any Factory.

Definition at line 488 of file ORB_Core.inl.

00489 {
00490   ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, mon, this->lock_,
00491                     CORBA::Object::_nil ());
00492   if (CORBA::is_nil (this->dynany_factory_))
00493     {
00494       this->resolve_dynanyfactory_i ();
00495     }
00496   return CORBA::Object::_duplicate (this->dynany_factory_);
00497 }

void TAO_ORB_Core::resolve_dynanyfactory_i ( void   )  [protected]

Obtain and cache the dynamic any factory object reference.

Definition at line 2567 of file ORB_Core.cpp.

02568 {
02569   TAO_Object_Loader *loader =
02570     ACE_Dynamic_Service<TAO_Object_Loader>::instance
02571       (this->configuration (),
02572        ACE_TEXT ("DynamicAny_Loader"));
02573 
02574   if (loader == 0)
02575     {
02576       this->configuration ()->process_directive
02577         (ACE_DYNAMIC_SERVICE_DIRECTIVE("DynamicAny_Loader",
02578                                        "TAO_DynamicAny",
02579                                        "_make_TAO_DynamicAny_Loader",
02580                                        ""));
02581       loader =
02582         ACE_Dynamic_Service<TAO_Object_Loader>::instance
02583         (this->configuration (),
02584          ACE_TEXT ("DynamicAny_Loader"));
02585     }
02586 
02587   if (loader != 0)
02588     {
02589       this->dynany_factory_ = loader->create_object (this->orb_, 0, 0);
02590     }
02591 }

CORBA::Object_ptr TAO_ORB_Core::resolve_ior_manipulation ( void   ) 

Resolve the IOR Manipulation reference for this ORB.

Definition at line 500 of file ORB_Core.inl.

00501 {
00502   ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, mon, this->lock_,
00503                     CORBA::Object::_nil ());
00504   if (CORBA::is_nil (this->ior_manip_factory_))
00505     {
00506       this->resolve_iormanipulation_i ();
00507     }
00508   return CORBA::Object::_duplicate (this->ior_manip_factory_);
00509 }

CORBA::Object_ptr TAO_ORB_Core::resolve_ior_table ( void   ) 

Resolve the IOR Table reference for this ORB.

Definition at line 512 of file ORB_Core.inl.

00513 {
00514   ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, mon, this->lock_,
00515                     CORBA::Object::_nil ());
00516   if (CORBA::is_nil (this->ior_table_))
00517     {
00518       this->resolve_ior_table_i ();
00519     }
00520   return CORBA::Object::_duplicate (this->ior_table_);
00521 }

void TAO_ORB_Core::resolve_ior_table_i ( void   )  [private]

Obtain and cache the dynamic any factory object reference.

Definition at line 2620 of file ORB_Core.cpp.

02621 {
02622   TAO_Adapter_Factory *factory =
02623     ACE_Dynamic_Service<TAO_Adapter_Factory>::instance
02624       (this->configuration (),
02625        ACE_TEXT ("TAO_IORTable"));
02626 
02627   if (factory == 0)
02628     {
02629       this->configuration ()->process_directive
02630         (ACE_DYNAMIC_SERVICE_DIRECTIVE("TAO_IORTable",
02631                                        "TAO_IORTable",
02632                                        "_make_TAO_Table_Adapter_Factory",
02633                                        ""));
02634       factory =
02635         ACE_Dynamic_Service<TAO_Adapter_Factory>::instance
02636           (this->configuration (), ACE_TEXT ("TAO_IORTable"));
02637     }
02638 
02639   if (factory != 0)
02640     {
02641       ACE_Auto_Ptr <TAO_Adapter> iortable_adapter (factory->create (this));
02642       iortable_adapter->open ();
02643 
02644       CORBA::Object_var tmp_root = iortable_adapter->root ();
02645 
02646       this->adapter_registry_.insert (iortable_adapter.get ());
02647 
02648       // It is now (exception) safe to release ownership from the auto pointers
02649       this->ior_table_= tmp_root._retn ();
02650       iortable_adapter.release ();
02651     }
02652 }

void TAO_ORB_Core::resolve_iormanipulation_i ( void   )  [protected]

Obtain and cache the IORManipulation factory object reference.

Definition at line 2594 of file ORB_Core.cpp.

02595 {
02596   TAO_Object_Loader *loader =
02597     ACE_Dynamic_Service<TAO_Object_Loader>::instance
02598       (this->configuration (),
02599        ACE_TEXT ("IORManip_Loader"));
02600 
02601   if (loader == 0)
02602     {
02603       this->configuration()->process_directive
02604         (ACE_DYNAMIC_SERVICE_DIRECTIVE("IORManip_Loader",
02605                                        "TAO_IORManip",
02606                                        "_make_TAO_IORManip_Loader",
02607                                        ""));
02608       loader =
02609         ACE_Dynamic_Service<TAO_Object_Loader>::instance
02610           (this->configuration (), ACE_TEXT ("IORManip_Loader"));
02611     }
02612 
02613   if (loader != 0)
02614     {
02615       this->ior_manip_factory_ = loader->create_object (this->orb_, 0, 0);
02616     }
02617 }

CORBA::Object_ptr TAO_ORB_Core::resolve_monitor ( void   ) 

Resolve the Monitor reference for this ORB.

Definition at line 524 of file ORB_Core.inl.

00525 {
00526   ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, mon, this->lock_,
00527                     CORBA::Object::_nil ());
00528   if (CORBA::is_nil (this->monitor_))
00529     {
00530       this->resolve_monitor_i ();
00531     }
00532   return CORBA::Object::_duplicate (this->monitor_);
00533 }

void TAO_ORB_Core::resolve_monitor_i ( void   )  [protected]

Obtain and cache the Monitor object reference.

Definition at line 2655 of file ORB_Core.cpp.

02656 {
02657   TAO_Object_Loader *loader =
02658     ACE_Dynamic_Service<TAO_Object_Loader>::instance
02659       (this->configuration (),
02660        ACE_TEXT ("Monitor_Init"));
02661 
02662   if (loader == 0)
02663     {
02664       this->configuration ()->process_directive
02665         (ACE_DYNAMIC_SERVICE_DIRECTIVE("Monitor_Init",
02666                                        "TAO_Monitor",
02667                                        "_make_TAO_Monitor_Init",
02668                                        ""));
02669       loader =
02670         ACE_Dynamic_Service<TAO_Object_Loader>::instance
02671         (this->configuration (),
02672          ACE_TEXT ("Monitor_Init"));
02673     }
02674 
02675   if (loader != 0)
02676     {
02677       this->monitor_ = loader->create_object (this->orb_, 0, 0);
02678     }
02679 }

CORBA::Object_ptr TAO_ORB_Core::resolve_poa_current ( void   ) 

Resolve POA Current.

Definition at line 548 of file ORB_Core.inl.

00549 {
00550   ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, mon, this->lock_,
00551                     CORBA::Object::_nil ());
00552   if (CORBA::is_nil (this->poa_current_.in ()))
00553     {
00554       this->resolve_poa_current_i ();
00555     }
00556   return CORBA::Object::_duplicate (this->poa_current_.in ());
00557 }

void TAO_ORB_Core::resolve_poa_current_i ( void   )  [protected]

Obtain and cache the poa current.

Definition at line 2507 of file ORB_Core.cpp.

02508 {
02509   TAO_Object_Loader *loader =
02510     ACE_Dynamic_Service<TAO_Object_Loader>::instance
02511       (this->configuration(),
02512        ACE_TEXT ("TAO_POA_Current_Factory"));
02513 
02514   if (loader == 0)
02515     {
02516       this->configuration()->process_directive
02517         (ACE_DYNAMIC_SERVICE_DIRECTIVE("TAO_POA_Current_Factory",
02518                                        "TAO_PortableServer",
02519                                        "_make_TAO_POA_Current_Factory",
02520                                        ""));
02521       loader =
02522         ACE_Dynamic_Service<TAO_Object_Loader>::instance
02523           (this->configuration(), ACE_TEXT ("TAO_POA_Current_Factory"));
02524     }
02525 
02526   if (loader != 0)
02527     {
02528       this->poa_current_ = loader->create_object (this->orb_, 0, 0);
02529     }
02530 }

CORBA::Object_ptr TAO_ORB_Core::resolve_rir