Main Page Namespace List Class Hierarchy Alphabetical List Compound List File List Namespace Members Compound Members File Members Related Pages

# TAO_PG_GenericFactory Class Reference

PortableGroup::GenericFactory implementation used by the load balancer when creating object groups. More...

`#include <PG_GenericFactory.h>`

Inheritance diagram for TAO_PG_GenericFactory:

[legend]
Collaboration diagram for TAO_PG_GenericFactory:

[legend]
List of all members.

## Public Methods
| TAO_PG_GenericFactory (TAO_PG_ObjectGroupManager &object_group_map, TAO_PG_PropertyManager &property_manager)
| Constructor. More...
| ~TAO_PG_GenericFactory (void)
| Destructor. More...
void | poa (PortableServer::POA_ptr p)
| Set the POA to use when creating object references. More...
void | delete_object_i (TAO_PG_Factory_Set &factory_set, CORBA::Boolean ignore_exceptions ACE_ENV_ARG_DECL)
| Call delete_object() on all factories use to create members in a given object group. More...
void | delete_member (CORBA::ULong group_id, const PortableGroup::Location &location ACE_ENV_ARG_DECL)
| If the member corresponding to the given group ID and location was created by the infrastructure, call delete_object() on the remote GenericFactory that created it. More...
void | check_minimum_number_members (PortableGroup::ObjectGroup_ptr object_group, CORBA::ULong group_id, const char *type_id ACE_ENV_ARG_DECL)
| Verify that the MinimumNumberMembers criterion is satisfied. More...
PortableGroup::GenericFactory::FactoryCreationId * | create_member (PortableGroup::ObjectGroup_ptr object_group, const PortableGroup::FactoryInfo &factory_info, const char *type_id, const CORBA::Boolean propagate_member_already_present ACE_ENV_ARG_DECL) throw (CORBA::SystemException, PortableGroup::NoFactory, PortableGroup::ObjectNotCreated, PortableGroup::InvalidCriteria, PortableGroup::InvalidProperty, PortableGroup::CannotMeetCriteria, PortableGroup::MemberAlreadyPresent)
| Create a new object group member using the supplied FactoryInfo and RepositoryId and add it to the given object group. More...
TAO_LoadBalancer::GenericFactory methods
virtual CORBA::Object_ptr | create_object (const char *type_id, const PortableGroup::Criteria &the_criteria, PortableGroup::GenericFactory::FactoryCreationId_out factory_creation_id ACE_ENV_ARG_DECL_WITH_DEFAULTS) throw (CORBA::SystemException, PortableGroup::NoFactory, PortableGroup::ObjectNotCreated, PortableGroup::InvalidCriteria, PortableGroup::InvalidProperty, PortableGroup::CannotMeetCriteria)
virtual void | delete_object (const PortableGroup::GenericFactory::FactoryCreationId &factory_creation_id ACE_ENV_ARG_DECL_WITH_DEFAULTS) throw (CORBA::SystemException, PortableGroup::ObjectNotFound)
## Private Methods
void | populate_object_group (PortableGroup::ObjectGroup_ptr object_group, const char *type_id, const PortableGroup::FactoryInfos &factory_infos, const PortableGroup::InitialNumberMembersValue initial_number_members, TAO_PG_Factory_Set &factory_set ACE_ENV_ARG_DECL)
| Populate the object group being created. Called when the infrastructure-controlled membership style is used for the object group being created. More...
void | get_ObjectId (CORBA::ULong fcid, PortableServer::ObjectId_out oid)
| Get a new ObjectId to be used when creating a new ObjectGroup. More...
void | process_criteria (const char *type_id, const PortableGroup::Criteria &criteria, PortableGroup::MembershipStyleValue &membership_style, PortableGroup::FactoriesValue *&factory_infos, PortableGroup::InitialNumberMembersValue &initial_number_members, PortableGroup::MinimumNumberMembersValue &minimum_number_members ACE_ENV_ARG_DECL)
| Process criteria to be applied to the object group being created. More...
## Private Attributes
PortableServer::POA_var | poa_
| Reference to the POA used to create object group references. More...
TAO_PG_ObjectGroupManager & | object_group_manager_
| Reference to the ObjectGroup map. More...
TAO_PG_PropertyManager & | property_manager_
| Reference to the PropertyManager. More...
TAO_PG_Factory_Map | factory_map_
| Table that maps FactoryCreationId to TAO_PG_Factory_Set. More...
CORBA::ULong | next_fcid_
| The FactoryCreationId that will be assigned to the next object group that is created. More...
TAO_SYNCH_MUTEX | lock_
| Lock used to synchronize access to the factory creation id index (i.e. next_fcid_). More...

## Detailed Description

PortableGroup::GenericFactory implementation used by the load balancer when creating object groups.

This GenericFactory creates an object group reference for given set of replicas. Those replicas will be created by this GenericFactory if the "infrastructure-controlled" membership style is configured.

## Constructor & Destructor Documentation

TAO_PG_GenericFactory::TAO_PG_GenericFactory | ( | TAO_PG_ObjectGroupManager & | object_group_manager,
|  | TAO_PG_PropertyManager & | property_manager
| ) |

| Constructor.

TAO_PG_GenericFactory::~TAO_PG_GenericFactory | ( | void |  | ) |

| Destructor.

## Member Function Documentation

void TAO_PG_GenericFactory::check_minimum_number_members | ( | PortableGroup::ObjectGroup_ptr | object_group,
|  | CORBA::ULong | group_id,
|  | const char *type_id | ACE_ENV_ARG_DECL
| ) |

| Verify that the MinimumNumberMembers criterion is satisfied. If the current number of members in the given object group is less than the MinimumNumberMembers criterion in effect for that group, the infrastructure will attempt create and add more members to the group by invoking any unused application-supplied GenericFactorys.

PortableGroup::GenericFactory::FactoryCreationId * TAO_PG_GenericFactory::create_member | ( | PortableGroup::ObjectGroup_ptr | object_group,
|  | const PortableGroup::FactoryInfo & | factory_info,
|  | const char * | type_id,
|  | const CORBA::Boolean propagate_member_already_present | ACE_ENV_ARG_DECL
| ) | throw (CORBA::SystemException, PortableGroup::NoFactory, PortableGroup::ObjectNotCreated, PortableGroup::InvalidCriteria, PortableGroup::InvalidProperty, PortableGroup::CannotMeetCriteria, PortableGroup::MemberAlreadyPresent)

| Create a new object group member using the supplied FactoryInfo and RepositoryId and add it to the given object group. Note: This method is only used by the infrastructure.

CORBA::Object_ptr TAO_PG_GenericFactory::create_object | ( | const char * | type_id,
|  | const PortableGroup::Criteria & | the_criteria,
|  | PortableGroup::GenericFactory::FactoryCreationId_out factory_creation_id | ACE_ENV_ARG_DECL
| ) | throw (CORBA::SystemException, PortableGroup::NoFactory, PortableGroup::ObjectNotCreated, PortableGroup::InvalidCriteria, PortableGroup::InvalidProperty, PortableGroup::CannotMeetCriteria)`[virtual]`

| Create an object of the specified type that adheres to the restrictions defined by the provided Criteria. The out FactoryCreationId parameter may be passed to the delete_object() method to delete the object.

void TAO_PG_GenericFactory::delete_member | ( | CORBA::ULong | group_id,
|  | const PortableGroup::Location &location | ACE_ENV_ARG_DECL
| ) |

| If the member corresponding to the given group ID and location was created by the infrastructure, call delete_object() on the remote GenericFactory that created it. This method is only used by the TAO_PG_ObjectGroupManager class when ObjectGroupManager::remove_member() is explicitly called.

void TAO_PG_GenericFactory::delete_object | ( | const PortableGroup::GenericFactory::FactoryCreationId &factory_creation_id | ACE_ENV_ARG_DECL | ) | throw (CORBA::SystemException, PortableGroup::ObjectNotFound)`[virtual]`

| Delete the object corresponding to the provided FactoryCreationId. If the object is actually an ObjectGroup, then all members within the ObjectGroup will be deleted. Afterward, the ObjectGroup itself will be deleted.

void TAO_PG_GenericFactory::delete_object_i | ( | TAO_PG_Factory_Set & | factory_set,
|  | CORBA::Boolean ignore_exceptions | ACE_ENV_ARG_DECL
| ) |

| Call delete_object() on all factories use to create members in a given object group. If ignore_exceptions is true, any exception returned from the delete_object() call on the remote factory will be ignored in order to allow other objects to be deleted via other registered factories.

void TAO_PG_GenericFactory::get_ObjectId | ( | CORBA::ULong | fcid,
|  | PortableServer::ObjectId_out | oid
| ) | `[private]`

| Get a new ObjectId to be used when creating a new ObjectGroup. An ObjectId created by this method will never be reused within the scope of a given ReplicationManager. A value suitable for use in a map association <ext_id> is also returned.

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

| Set the POA to use when creating object references.

void TAO_PG_GenericFactory::populate_object_group | ( | PortableGroup::ObjectGroup_ptr | object_group,
|  | const char * | type_id,
|  | const PortableGroup::FactoryInfos & | factory_infos,
|  | const PortableGroup::InitialNumberMembersValue | initial_number_members,
|  | TAO_PG_Factory_Set &factory_set | ACE_ENV_ARG_DECL
| ) | `[private]`

| Populate the object group being created. Called when the infrastructure-controlled membership style is used for the object group being created.

void TAO_PG_GenericFactory::process_criteria | ( | const char * | type_id,
|  | const PortableGroup::Criteria & | criteria,
|  | PortableGroup::MembershipStyleValue & | membership_style,
|  | PortableGroup::FactoriesValue *& | factory_infos,
|  | PortableGroup::InitialNumberMembersValue & | initial_number_members,
|  | PortableGroup::MinimumNumberMembersValue &minimum_number_members | ACE_ENV_ARG_DECL
| ) | `[private]`

| Process criteria to be applied to the object group being created. Only the MemberShipStyle, Factories, InitialNumberMembers and MinimumNumberMembers criteria/properties are defined by the PortableGroup IDL. Other services that implement the GenericFactory interface, such as load balancing and fault tolerance, may choose to support more. The extracted criteria are object group-specific. In particular, they are the object group creation time criteria.

## Member Data Documentation

TAO_PG_Factory_Map TAO_PG_GenericFactory::factory_map_`[private]`

| Table that maps FactoryCreationId to TAO_PG_Factory_Set. The TAO_PG_Factory_Set corresponding to a given FactoryCreationId contains the information necessary to clean up objects (members) that were created by the infrastructure, i.e. this GenericFactory. For example, this GenericFactory will invoke other application defined GenericFactorys when creating new object group members. The information returned from those application defined GenericFactorys is stored in a TAO_PG_Factory_Set, and thus this table.

TAO_SYNCH_MUTEX TAO_PG_GenericFactory::lock_`[private]`

| Lock used to synchronize access to the factory creation id index (i.e. next_fcid_).

CORBA::ULong TAO_PG_GenericFactory::next_fcid_`[private]`

| The FactoryCreationId that will be assigned to the next object group that is created. Value that is used when assigning a FactoryCreationId to the factory that was used to create a given ObjectGroup. The FactoryCreationId is typically comprised of this value in addition to another value that makes it unique to a given Load Balancer.

TAO_PG_ObjectGroupManager& TAO_PG_GenericFactory::object_group_manager_`[private]`

| Reference to the ObjectGroup map.

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

| Reference to the POA used to create object group references.

TAO_PG_PropertyManager& TAO_PG_GenericFactory::property_manager_`[private]`

| Reference to the PropertyManager.

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

- PG_GenericFactory.h
- PG_GenericFactory.cpp