Public Member Functions | Protected Attributes | Private Member Functions

TAO_RT_Thread_Lane_Resources_Manager Class Reference

Manager for thread lane resources. More...

#include <RT_Thread_Lane_Resources_Manager.h>

Inheritance diagram for TAO_RT_Thread_Lane_Resources_Manager:
Inheritance graph
[legend]
Collaboration diagram for TAO_RT_Thread_Lane_Resources_Manager:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 TAO_RT_Thread_Lane_Resources_Manager (TAO_ORB_Core &orb_core)
 Constructor.
 ~TAO_RT_Thread_Lane_Resources_Manager (void)
 Destructor.
void finalize (void)
 Finalize resources.
int open_default_resources (void)
 Open default resources.
void shutdown_reactor (void)
 Shutdown reactor.
void close_all_transports (void)
int is_collocated (const TAO_MProfile &mprofile)
 Does mprofile belong to us?

Protected Attributes

TAO_Thread_Lane_Resourcesdefault_lane_resources_
 Default lane resources.
TAO_Thread_Pool_Managertp_manager_
 Thread Pool Manager.

Private Member Functions

void operator= (const TAO_RT_Thread_Lane_Resources_Manager &)
 TAO_RT_Thread_Lane_Resources_Manager (const TAO_RT_Thread_Lane_Resources_Manager &)

Accessors



TAO_Thread_Lane_Resourceslane_resources (void)
TAO_Thread_Lane_Resourcesdefault_lane_resources (void)
TAO_Thread_Pool_Managertp_manager (void)

Detailed Description

Manager for thread lane resources.

Definition at line 41 of file RT_Thread_Lane_Resources_Manager.h.


Constructor & Destructor Documentation

TAO_RT_Thread_Lane_Resources_Manager::TAO_RT_Thread_Lane_Resources_Manager ( TAO_ORB_Core orb_core  ) 

Constructor.

Definition at line 21 of file RT_Thread_Lane_Resources_Manager.cpp.

  : TAO_Thread_Lane_Resources_Manager (orb_core),
    default_lane_resources_ (0),
    tp_manager_ (0)
{
  // Create the default resources.
  ACE_NEW (this->default_lane_resources_,
           TAO_Thread_Lane_Resources (orb_core));

  // Create the thread-pool manager.
  ACE_NEW (this->tp_manager_,
           TAO_Thread_Pool_Manager (orb_core));

}

TAO_RT_Thread_Lane_Resources_Manager::~TAO_RT_Thread_Lane_Resources_Manager ( void   ) 

Destructor.

Definition at line 36 of file RT_Thread_Lane_Resources_Manager.cpp.

{
  // Delete the default resources.
  delete this->default_lane_resources_;

  // Delete the thread-pool manager.
  delete this->tp_manager_;
}

TAO_RT_Thread_Lane_Resources_Manager::TAO_RT_Thread_Lane_Resources_Manager ( const TAO_RT_Thread_Lane_Resources_Manager  )  [private]

Member Function Documentation

void TAO_RT_Thread_Lane_Resources_Manager::close_all_transports ( void   )  [virtual]

Certain ORB policies such as dropping replies on shutdown would need cleanup of transports to wake threads up.

Implements TAO_Thread_Lane_Resources_Manager.

Definition at line 85 of file RT_Thread_Lane_Resources_Manager.cpp.

{
  // Shutdown default reactors.
  this->default_lane_resources_->close_all_transports ();
}

TAO_Thread_Lane_Resources & TAO_RT_Thread_Lane_Resources_Manager::default_lane_resources ( void   )  [virtual]

Implements TAO_Thread_Lane_Resources_Manager.

Definition at line 123 of file RT_Thread_Lane_Resources_Manager.cpp.

{
  return *this->default_lane_resources_;
}

void TAO_RT_Thread_Lane_Resources_Manager::finalize ( void   )  [virtual]

Finalize resources.

Implements TAO_Thread_Lane_Resources_Manager.

Definition at line 65 of file RT_Thread_Lane_Resources_Manager.cpp.

{
  // Finalize resources managed by the thread-pool manager.
  this->tp_manager_->finalize ();

  // Finalize default resources.
  this->default_lane_resources_->finalize ();
}

int TAO_RT_Thread_Lane_Resources_Manager::is_collocated ( const TAO_MProfile mprofile  )  [virtual]

Does mprofile belong to us?

Implements TAO_Thread_Lane_Resources_Manager.

Definition at line 92 of file RT_Thread_Lane_Resources_Manager.cpp.

{
  int result =
    this->default_lane_resources_->is_collocated (mprofile);

  if (result)
    return result;

  return this->tp_manager_->is_collocated (mprofile);
}

TAO_Thread_Lane_Resources & TAO_RT_Thread_Lane_Resources_Manager::lane_resources ( void   )  [virtual]

Implements TAO_Thread_Lane_Resources_Manager.

Definition at line 104 of file RT_Thread_Lane_Resources_Manager.cpp.

{
  // Get the ORB_Core's TSS resources.
  TAO_ORB_Core_TSS_Resources &tss =
    *this->orb_core_->get_tss_resources ();

  // Get the lane for this thread.
  TAO_Thread_Lane *lane =
    static_cast <TAO_Thread_Lane *> (tss.lane_);

  // If we have a valid lane, use that lane's resources.
  if (lane)
    return lane->resources ();
  else
    // Otherwise, return the default resources.
    return *this->default_lane_resources_;
}

int TAO_RT_Thread_Lane_Resources_Manager::open_default_resources ( void   )  [virtual]

Open default resources.

Implements TAO_Thread_Lane_Resources_Manager.

Definition at line 46 of file RT_Thread_Lane_Resources_Manager.cpp.

{
  TAO_ORB_Parameters *params =
    this->orb_core_->orb_params ();

  TAO_EndpointSet endpoint_set;

  params->get_endpoint_set (TAO_DEFAULT_LANE, endpoint_set);

  bool ignore_address = false;

  int const result =
    this->default_lane_resources_->open_acceptor_registry (endpoint_set,
                                                           ignore_address);

  return result;
}

void TAO_RT_Thread_Lane_Resources_Manager::operator= ( const TAO_RT_Thread_Lane_Resources_Manager  )  [private]
void TAO_RT_Thread_Lane_Resources_Manager::shutdown_reactor ( void   )  [virtual]

Shutdown reactor.

Implements TAO_Thread_Lane_Resources_Manager.

Definition at line 75 of file RT_Thread_Lane_Resources_Manager.cpp.

{
  // Shutdown default reactors.
  this->default_lane_resources_->shutdown_reactor ();

  // Shutdown reactors managed by the thread-pool manager.
  this->tp_manager_->shutdown_reactor ();
}

TAO_Thread_Pool_Manager & TAO_RT_Thread_Lane_Resources_Manager::tp_manager ( void   ) 

Definition at line 129 of file RT_Thread_Lane_Resources_Manager.cpp.

{
  return *this->tp_manager_;
}


Member Data Documentation

Default lane resources.

Definition at line 86 of file RT_Thread_Lane_Resources_Manager.h.

Thread Pool Manager.

Definition at line 89 of file RT_Thread_Lane_Resources_Manager.h.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines