TAO_PortableGroup
2.2.1
|
PortableGroup::ObjectGroupManager implementation. More...
#include <PG_ObjectGroupManager.h>
Public Member Functions | |
TAO_PG_ObjectGroupManager (void) | |
Constructor. More... | |
~TAO_PG_ObjectGroupManager (void) | |
Destructor. More... | |
PortableGroup::ObjectGroup_ptr | _tao_add_member (PortableGroup::ObjectGroup_ptr object_group, const PortableGroup::Location &the_location, CORBA::Object_ptr member, const char *type_id, const CORBA::Boolean propagate_member_already_present) |
TAO-specific member addition method. More... | |
PortableGroup::ObjectGroup_ptr | create_object_group (CORBA::ULong group_id, const PortableServer::ObjectId &oid, const char *type_id, const PortableGroup::Criteria &the_criteria) |
void | destroy_object_group (const PortableServer::ObjectId &oid) |
Destroy the object group corresponding to the given ObjectId. More... | |
PortableGroup::Properties * | get_properties (PortableGroup::ObjectGroup_ptr object_group) |
char * | type_id (PortableGroup::ObjectGroup_ptr object_group) |
Return the type_id for the given object group. More... | |
PortableGroup::ObjectGroup_ptr | object_group (const PortableServer::ObjectId &oid) |
Return the object group associated with the given ObjectId. More... | |
CORBA::ULong | member_count (PortableGroup::ObjectGroup_ptr group) |
Return the number of members in the given object group. More... | |
void | poa (PortableServer::POA_ptr p) |
void | generic_factory (TAO_PG_GenericFactory *generic_factory) |
size_t | member_count (const PortableServer::ObjectId &oid, bool is_active) |
Get active or inactive member count in a group. More... | |
bool | is_alive (const PortableServer::ObjectId &oid, CORBA::Object_ptr member) |
Verify if the member is active from local cache. More... | |
void | remove_inactive_members () |
Remove the inactive members. More... | |
void | validate_members (CORBA::ORB_ptr orb, const TimeBase::TimeT &timeout) |
Validate all active members. More... | |
PortableGroup::ObjectGroupManager methods | |
Methods required by the PortableGroup::ObjectGroupManager interface. | |
virtual PortableGroup::ObjectGroup_ptr | create_member (PortableGroup::ObjectGroup_ptr object_group, const PortableGroup::Location &the_location, const char *type_id, const PortableGroup::Criteria &the_criteria) |
Create a member and add it to the given object group. More... | |
virtual PortableGroup::ObjectGroup_ptr | add_member (PortableGroup::ObjectGroup_ptr object_group, const PortableGroup::Location &the_location, CORBA::Object_ptr member) |
Add an existing object to the ObjectGroup. More... | |
virtual PortableGroup::ObjectGroup_ptr | remove_member (PortableGroup::ObjectGroup_ptr object_group, const PortableGroup::Location &the_location) |
virtual PortableGroup::Locations * | locations_of_members (PortableGroup::ObjectGroup_ptr object_group) |
Return the locations of the members in the given ObjectGroup. More... | |
virtual PortableGroup::ObjectGroups * | groups_at_location (const PortableGroup::Location &the_location) |
Return the locations of the members in the given ObjectGroup. More... | |
virtual PortableGroup::ObjectGroupId | get_object_group_id (PortableGroup::ObjectGroup_ptr object_group) |
virtual PortableGroup::ObjectGroup_ptr | get_object_group_ref (PortableGroup::ObjectGroup_ptr object_group) |
virtual CORBA::Object_ptr | get_member_ref (PortableGroup::ObjectGroup_ptr object_group, const PortableGroup::Location &loc) |
virtual PortableGroup::ObjectGroup_ptr | get_object_group_ref_from_id (PortableGroup::ObjectGroupId group_id) |
Protected Member Functions | |
PortableGroup::ObjectGroup_ptr | add_member_i (PortableGroup::ObjectGroup_ptr object_group, const PortableGroup::Location &the_location, CORBA::Object_ptr member, const CORBA::Boolean check_type_id) |
TAO_PG_ObjectGroup_Map_Entry * | get_group_entry (PortableGroup::ObjectGroup_ptr object_group) |
CORBA::Boolean | member_already_present (const TAO_PG_ObjectGroup_Array &groups, TAO_PG_ObjectGroup_Map_Entry *group_entry) |
int | get_object_group_position (const TAO_PG_ObjectGroup_Array &groups, TAO_PG_ObjectGroup_Map_Entry *group_entry) |
CORBA::Boolean | valid_type_id (PortableGroup::ObjectGroup_ptr object_group, TAO_PG_ObjectGroup_Map_Entry *group_entry, CORBA::Object_ptr member) |
Verify that the member type_id matches the object group type_id. More... | |
int | remove_group_from_location_map (TAO_PG_ObjectGroup_Map_Entry *group_entry) |
size_t | remove_entry_from_groups (int to_be_removed, TAO_PG_ObjectGroup_Array *groups) |
Remove the entry from the group array and return the new size. More... | |
Private Member Functions | |
TAO_PG_MemberInfo_Set | get_members (bool is_alive) |
Help function to get active or inactive member infos. More... | |
bool | ping (CORBA::ORB_ptr orb, CORBA::Object_var &obj, const TimeBase::TimeT &tt) |
Ping the remote to verify the connections. More... | |
Private Attributes | |
PortableServer::POA_var | poa_ |
Reference to the POA that created the object group references. More... | |
TAO_PG_ObjectGroup_Map | object_group_map_ |
TAO_PG_Location_Map | location_map_ |
TAO_PG_GenericFactory * | generic_factory_ |
TAO_SYNCH_MUTEX | lock_ |
Lock used to synchronize access to the underlying tables. More... | |
TAO_PG_MemberInfo_Set | inactive_members_ |
The list of inactive members. More... | |
PortableGroup::ObjectGroupManager implementation.
The ObjectGroupManager provides the interface necessary to facilitate application-controlled object group membership.
TAO_PG_ObjectGroupManager::TAO_PG_ObjectGroupManager | ( | void | ) |
Constructor.
TAO_PG_ObjectGroupManager::~TAO_PG_ObjectGroupManager | ( | void | ) |
Destructor.
PortableGroup::ObjectGroup_ptr TAO_PG_ObjectGroupManager::_tao_add_member | ( | PortableGroup::ObjectGroup_ptr | object_group, |
const PortableGroup::Location & | the_location, | ||
CORBA::Object_ptr | member, | ||
const char * | type_id, | ||
const CORBA::Boolean | propagate_member_already_present | ||
) |
TAO-specific member addition method.
This method is meant to be invoked by TAO's GenericFactory implementation. It is designed to allow only certain exceptions to be propagated to the caller, and to prevent redundant remote RepositoryId checking.
|
virtual |
Add an existing object to the ObjectGroup.
|
protected |
Underlying and non-locking implementation of the add_member() and _tao_add_member() methods in this class.
|
virtual |
Create a member and add it to the given object group.
PortableGroup::ObjectGroup_ptr TAO_PG_ObjectGroupManager::create_object_group | ( | CORBA::ULong | group_id, |
const PortableServer::ObjectId & | oid, | ||
const char * | type_id, | ||
const PortableGroup::Criteria & | the_criteria | ||
) |
Create object group hash map entry that represents an actual ObjectGroup.
void TAO_PG_ObjectGroupManager::destroy_object_group | ( | const PortableServer::ObjectId & | oid | ) |
Destroy the object group corresponding to the given ObjectId.
void TAO_PG_ObjectGroupManager::generic_factory | ( | TAO_PG_GenericFactory * | generic_factory | ) |
Set the pointer to the GenericFactory associated with this ObjectGroupManager. The TAO_PG_GenericFactory will only be used when ObjectGroupManager::remove_member() is explicitly called so that the infrastructure may be given an opportunity to clean up any object group members it may have created.
|
protected |
Obtain the ObjectGroup hash map entry corresponding to the given ObjectGroup reference.
|
virtual |
Return the reference corresponding to the member of a given ObjectGroup at the given location.
|
private |
Help function to get active or inactive member infos.
|
virtual |
Return the ObjectGroupId for the given ObjectGroup.
|
protected |
get the position of the object_group_map_entry -1 indicate group is not found.
|
virtual |
|
virtual |
TAO-specific extension. Return the ObjectGroup reference for the given ObjectGroupId.
PortableGroup::Properties * TAO_PG_ObjectGroupManager::get_properties | ( | PortableGroup::ObjectGroup_ptr | object_group | ) |
Return the properties set when the object group was created, and the dynamic properties that may have overridden them.
|
virtual |
Return the locations of the members in the given ObjectGroup.
bool TAO_PG_ObjectGroupManager::is_alive | ( | const PortableServer::ObjectId & | oid, |
CORBA::Object_ptr | member | ||
) |
Verify if the member is active from local cache.
|
virtual |
Return the locations of the members in the given ObjectGroup.
|
protected |
Check if a member resides at the location to which the group array belongs to. A member is actually represented by the object group to which it belongs. In this implementation, a pointer to a object group hash map entry is associated with a given a location.
CORBA::ULong TAO_PG_ObjectGroupManager::member_count | ( | PortableGroup::ObjectGroup_ptr | group | ) |
Return the number of members in the given object group.
size_t TAO_PG_ObjectGroupManager::member_count | ( | const PortableServer::ObjectId & | oid, |
bool | is_active | ||
) |
Get active or inactive member count in a group.
PortableGroup::ObjectGroup_ptr TAO_PG_ObjectGroupManager::object_group | ( | const PortableServer::ObjectId & | oid | ) |
Return the object group associated with the given ObjectId.
|
private |
Ping the remote to verify the connections.
void TAO_PG_ObjectGroupManager::poa | ( | PortableServer::POA_ptr | p | ) |
Set the POA to use when converting object group references to ObjectIds.
|
protected |
Remove the entry from the group array and return the new size.
|
protected |
Remove references to the object group from location map. There may be multiple of them.
void TAO_PG_ObjectGroupManager::remove_inactive_members | ( | ) |
Remove the inactive members.
|
virtual |
Remove an object at a specific location from the given ObjectGroup. Deletion of application created objects must be deleted by the application. Objects created by the infrastructure (load balancer) will be deleted by the infrastructure.
char * TAO_PG_ObjectGroupManager::type_id | ( | PortableGroup::ObjectGroup_ptr | object_group | ) |
Return the type_id for the given object group.
|
protected |
Verify that the member type_id matches the object group type_id.
void TAO_PG_ObjectGroupManager::validate_members | ( | CORBA::ORB_ptr | orb, |
const TimeBase::TimeT & | timeout | ||
) |
Validate all active members.
Get list of active member info.
Ping each member in the list and add ping failed member to inactive member list.
Mark the members as inactive in internal group maps.
keep a copy of inactive member for removing.
|
private |
Pointer to the TAO_PG_GenericFactory class responsible for object group creation/destruction.
|
private |
The list of inactive members.
|
private |
Map that contains list of all members at a given location, in addition to the load monitor at that location.
|
private |
Lock used to synchronize access to the underlying tables.
|
private |
The underlying table that contains all object group information.
|
private |
Reference to the POA that created the object group references.