Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

# TAO_PG_ObjectGroupManager Class Reference

PortableGroup::ObjectGroupManager implementation. More...

`#include <PG_ObjectGroupManager.h>`

Collaboration diagram for TAO_PG_ObjectGroupManager:

[legend]
List of all members.

## Public Member Functions
| TAO_PG_ObjectGroupManager (void)
| Constructor.
| ~TAO_PG_ObjectGroupManager (void)
| Destructor.
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) throw (CORBA::SystemException, PortableGroup::MemberAlreadyPresent, PortableGroup::NoFactory)
| TAO-specific member addition method.
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.
PortableGroup::Properties * | get_properties (PortableGroup::ObjectGroup_ptr object_group) throw (CORBA::SystemException, PortableGroup::ObjectGroupNotFound)
char * | type_id (PortableGroup::ObjectGroup_ptr object_group)
| Return the type_id for the given object group.
PortableGroup::ObjectGroup_ptr | object_group (const PortableServer::ObjectId &oid)
| Return the object group associated with the given ObjectId.
CORBA::ULong | member_count (PortableGroup::ObjectGroup_ptr group) throw (CORBA::SystemException, PortableGroup::ObjectGroupNotFound)
| Return the number of members in the given object group.
void | poa (PortableServer::POA_ptr p)
void | generic_factory (TAO_PG_GenericFactory *generic_factory)
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) throw (CORBA::SystemException, PortableGroup::ObjectGroupNotFound, PortableGroup::MemberAlreadyPresent, PortableGroup::NoFactory, PortableGroup::ObjectNotCreated, PortableGroup::InvalidCriteria, PortableGroup::CannotMeetCriteria)
| Create a member and add it to the given object group.
virtual PortableGroup::ObjectGroup_ptr | add_member (PortableGroup::ObjectGroup_ptr object_group, const PortableGroup::Location &the_location, CORBA::Object_ptr member) throw (CORBA::SystemException, PortableGroup::ObjectGroupNotFound, PortableGroup::MemberAlreadyPresent, PortableGroup::ObjectNotAdded)
| Add an existing object to the ObjectGroup.
virtual PortableGroup::ObjectGroup_ptr | remove_member (PortableGroup::ObjectGroup_ptr object_group, const PortableGroup::Location &the_location) throw (CORBA::SystemException, PortableGroup::ObjectGroupNotFound, PortableGroup::MemberNotFound)
virtual PortableGroup::Locations * | locations_of_members (PortableGroup::ObjectGroup_ptr object_group) throw (CORBA::SystemException, PortableGroup::ObjectGroupNotFound)
| Return the locations of the members in the given ObjectGroup.
virtual PortableGroup::ObjectGroups * | groups_at_location (const PortableGroup::Location &the_location) throw (CORBA::SystemException)
| Return the locations of the members in the given ObjectGroup.
virtual PortableGroup::ObjectGroupId | get_object_group_id (PortableGroup::ObjectGroup_ptr object_group) throw (CORBA::SystemException, PortableGroup::ObjectGroupNotFound)
virtual PortableGroup::ObjectGroup_ptr | get_object_group_ref (PortableGroup::ObjectGroup_ptr object_group) throw (CORBA::SystemException, PortableGroup::ObjectGroupNotFound)
| Does this method make sense for load balanced objects?
virtual CORBA::Object_ptr | get_member_ref (PortableGroup::ObjectGroup_ptr object_group, const PortableGroup::Location &loc) throw (CORBA::SystemException, PortableGroup::ObjectGroupNotFound, PortableGroup::MemberNotFound)
virtual PortableGroup::ObjectGroup_ptr | get_object_group_ref_from_id (PortableGroup::ObjectGroupId group_id) throw ( CORBA::SystemException , PortableGroup::ObjectGroupNotFound )
## 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) throw (CORBA::SystemException, PortableGroup::ObjectGroupNotFound, PortableGroup::MemberAlreadyPresent, PortableGroup::ObjectNotAdded)
TAO_PG_ObjectGroup_Map_Entry * | get_group_entry (PortableGroup::ObjectGroup_ptr object_group) throw (CORBA::SystemException, PortableGroup::ObjectGroupNotFound)
CORBA::Boolean | member_already_present (const TAO_PG_ObjectGroup_Array &groups, TAO_PG_ObjectGroup_Map_Entry *group_entry)
size_t | get_object_group_position (const TAO_PG_ObjectGroup_Array &groups, TAO_PG_ObjectGroup_Map_Entry *group_entry)
| get the position of the object_group_map_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.
## Private Attributes
PortableServer::POA_var | poa_
| Reference to the POA that created the object group references.
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.

## Detailed Description

PortableGroup::ObjectGroupManager implementation.

The ObjectGroupManager provides the interface necessary to facilitate application-controlled object group membership.

## Constructor & Destructor Documentation

TAO_BEGIN_VERSIONED_NAMESPACE_DECL TAO_PG_ObjectGroupManager::TAO_PG_ObjectGroupManager | ( | void |  | ) |

| Constructor.

TAO_PG_ObjectGroupManager::~TAO_PG_ObjectGroupManager | ( | void |  | ) |

| Destructor.

## Member Function Documentation

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
| ) | throw (CORBA::SystemException, PortableGroup::MemberAlreadyPresent, PortableGroup::NoFactory)

| 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.

PortableGroup::ObjectGroup_ptr TAO_PG_ObjectGroupManager::add_member | ( | PortableGroup::ObjectGroup_ptr | object_group,
|  | const PortableGroup::Location & | the_location,
|  | CORBA::Object_ptr | member
| ) | throw (CORBA::SystemException, PortableGroup::ObjectGroupNotFound, PortableGroup::MemberAlreadyPresent, PortableGroup::ObjectNotAdded)`[virtual]`

| Add an existing object to the ObjectGroup.

PortableGroup::ObjectGroup_ptr TAO_PG_ObjectGroupManager::add_member_i | ( | PortableGroup::ObjectGroup_ptr | object_group,
|  | const PortableGroup::Location & | the_location,
|  | CORBA::Object_ptr | member,
|  | const CORBA::Boolean | check_type_id
| ) | throw (CORBA::SystemException, PortableGroup::ObjectGroupNotFound, PortableGroup::MemberAlreadyPresent, PortableGroup::ObjectNotAdded)`[protected]`

| Underlying and non-locking implementation of the add_member() and _tao_add_member() methods in this class.

PortableGroup::ObjectGroup_ptr TAO_PG_ObjectGroupManager::create_member | ( | PortableGroup::ObjectGroup_ptr | object_group,
|  | const PortableGroup::Location & | the_location,
|  | const char * | type_id,
|  | const PortableGroup::Criteria & | the_criteria
| ) | throw (CORBA::SystemException, PortableGroup::ObjectGroupNotFound, PortableGroup::MemberAlreadyPresent, PortableGroup::NoFactory, PortableGroup::ObjectNotCreated, PortableGroup::InvalidCriteria, PortableGroup::CannotMeetCriteria)`[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
| ) |

| Note: This method is used mainly by the GenericFactory::create_object() method.

void TAO_PG_ObjectGroupManager::destroy_object_group | ( | const PortableServer::ObjectId & | oid | ) |

| Destroy the object group corresponding to the given ObjectId. Note: This method is used mainly by the GenericFactory::delete_object() method.

void TAO_PG_ObjectGroupManager::generic_factory | ( | TAO_PG_GenericFactory * | generic_factory | ) |

| 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.

TAO_PG_ObjectGroup_Map_Entry* TAO_PG_ObjectGroupManager::get_group_entry | ( | PortableGroup::ObjectGroup_ptr | object_group | ) | throw (CORBA::SystemException, PortableGroup::ObjectGroupNotFound)`[protected]`

| Obtain the ObjectGroup hash map entry corresponding to the given ObjectGroup reference.

CORBA::Object_ptr TAO_PG_ObjectGroupManager::get_member_ref | ( | PortableGroup::ObjectGroup_ptr | object_group,
|  | const PortableGroup::Location & | loc
| ) | throw (CORBA::SystemException, PortableGroup::ObjectGroupNotFound, PortableGroup::MemberNotFound)`[virtual]`

| Return the reference corresponding to the member of a given ObjectGroup at the given location.

PortableGroup::ObjectGroupId TAO_PG_ObjectGroupManager::get_object_group_id | ( | PortableGroup::ObjectGroup_ptr | object_group | ) | throw (CORBA::SystemException, PortableGroup::ObjectGroupNotFound)`[virtual]`

| Return the ObjectGroupId for the given ObjectGroup. Note: Does this method make sense for load balanced objects?

size_t TAO_PG_ObjectGroupManager::get_object_group_position | ( | const TAO_PG_ObjectGroup_Array & | groups,
|  | TAO_PG_ObjectGroup_Map_Entry * | group_entry
| ) | `[protected]`

| get the position of the object_group_map_entry

PortableGroup::ObjectGroup_ptr TAO_PG_ObjectGroupManager::get_object_group_ref | ( | PortableGroup::ObjectGroup_ptr | object_group | ) | throw (CORBA::SystemException, PortableGroup::ObjectGroupNotFound)`[virtual]`

| Does this method make sense for load balanced objects?

PortableGroup::ObjectGroup_ptr TAO_PG_ObjectGroupManager::get_object_group_ref_from_id | ( | PortableGroup::ObjectGroupId | group_id | ) | throw ( CORBA::SystemException , PortableGroup::ObjectGroupNotFound )`[virtual]`

| TAO-specific extension. Return the ObjectGroup reference for the given ObjectGroupId.

PortableGroup::Properties * TAO_PG_ObjectGroupManager::get_properties | ( | PortableGroup::ObjectGroup_ptr | object_group | ) | throw (CORBA::SystemException, PortableGroup::ObjectGroupNotFound)

| Return the properties set when the object group was created, and the dynamic properties that may have overridden them.

PortableGroup::ObjectGroups * TAO_PG_ObjectGroupManager::groups_at_location | ( | const PortableGroup::Location & | the_location | ) | throw (CORBA::SystemException)`[virtual]`

| Return the locations of the members in the given ObjectGroup.

PortableGroup::Locations * TAO_PG_ObjectGroupManager::locations_of_members | ( | PortableGroup::ObjectGroup_ptr | object_group | ) | throw (CORBA::SystemException, PortableGroup::ObjectGroupNotFound)`[virtual]`

| Return the locations of the members in the given ObjectGroup.

CORBA::Boolean TAO_PG_ObjectGroupManager::member_already_present | ( | const TAO_PG_ObjectGroup_Array & | groups,
|  | TAO_PG_ObjectGroup_Map_Entry * | group_entry
| ) | `[protected]`

| 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 | ) | throw (CORBA::SystemException, PortableGroup::ObjectGroupNotFound)

| Return the number of members in the given object group.

PortableGroup::ObjectGroup_ptr TAO_PG_ObjectGroupManager::object_group | ( | const PortableServer::ObjectId & | oid | ) |

| Return the object group associated with the given ObjectId. Returns: Returns PortableGroup::ObjectGroup::_nil() if no object group corresponding to the given ObjectId exists.

void TAO_PG_ObjectGroupManager::poa | ( | PortableServer::POA_ptr | p | ) |

| Set the POA to use when converting object group references to ObjectIds.

PortableGroup::ObjectGroup_ptr TAO_PG_ObjectGroupManager::remove_member | ( | PortableGroup::ObjectGroup_ptr | object_group,
|  | const PortableGroup::Location & | the_location
| ) | throw (CORBA::SystemException, PortableGroup::ObjectGroupNotFound, PortableGroup::MemberNotFound)`[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.

CORBA::Boolean TAO_PG_ObjectGroupManager::valid_type_id | ( | PortableGroup::ObjectGroup_ptr | object_group,
|  | TAO_PG_ObjectGroup_Map_Entry * | group_entry,
|  | CORBA::Object_ptr | member
| ) | `[protected]`

| Verify that the member type_id matches the object group type_id. Todo: Strategize this -- e.g. strict type checking.

## Member Data Documentation

TAO_PG_GenericFactory* TAO_PG_ObjectGroupManager::generic_factory_`[private]`

| Pointer to the TAO_PG_GenericFactory class responsible for object group creation/destruction.

TAO_PG_Location_Map TAO_PG_ObjectGroupManager::location_map_`[private]`

| Map that contains list of all members at a given location, in addition to the load monitor at that location.

TAO_SYNCH_MUTEX TAO_PG_ObjectGroupManager::lock_`[private]`

| Lock used to synchronize access to the underlying tables.

TAO_PG_ObjectGroup_Map TAO_PG_ObjectGroupManager::object_group_map_`[private]`

| The underlying table that contains all object group information.

PortableServer::POA_var TAO_PG_ObjectGroupManager::poa_`[private]`

| Reference to the POA that created the object group references.

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

- PG_ObjectGroupManager.h
- PG_ObjectGroupManager.cpp