00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014 #ifndef TAO_PG_GENERIC_FACTORY_H
00015 #define TAO_PG_GENERIC_FACTORY_H
00016
00017 #include "ace/pre.h"
00018
00019 #include "ace/config-all.h"
00020
00021 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00022 #pragma once
00023 #endif
00024
00025 #include "orbsvcs/PortableGroup/PG_Factory_Map.h"
00026 #include "orbsvcs/PortableGroup/portablegroup_export.h"
00027 #include "tao/PortableServer/PortableServerC.h"
00028 #include "orbsvcs/PortableGroupC.h"
00029 #include "ace/Null_Mutex.h"
00030
00031 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
00032
00033
00034 class TAO_PG_ObjectGroupManager;
00035 class TAO_PG_PropertyManager;
00036
00037 struct TAO_PG_ObjectGroup_Map_Entry;
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050 class TAO_PortableGroup_Export TAO_PG_GenericFactory
00051 : public virtual PortableGroup::GenericFactory
00052 {
00053 public:
00054
00055
00056 TAO_PG_GenericFactory (TAO_PG_ObjectGroupManager & object_group_map,
00057 TAO_PG_PropertyManager & property_manager);
00058
00059
00060 ~TAO_PG_GenericFactory (void);
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073 virtual CORBA::Object_ptr create_object (
00074 const char * type_id,
00075 const PortableGroup::Criteria & the_criteria,
00076 PortableGroup::GenericFactory::FactoryCreationId_out
00077 factory_creation_id
00078 ACE_ENV_ARG_DECL_WITH_DEFAULTS)
00079 ACE_THROW_SPEC ((CORBA::SystemException,
00080 PortableGroup::NoFactory,
00081 PortableGroup::ObjectNotCreated,
00082 PortableGroup::InvalidCriteria,
00083 PortableGroup::InvalidProperty,
00084 PortableGroup::CannotMeetCriteria));
00085
00086
00087
00088
00089
00090
00091
00092 virtual void delete_object (
00093 const PortableGroup::GenericFactory::FactoryCreationId &
00094 factory_creation_id
00095 ACE_ENV_ARG_DECL_WITH_DEFAULTS)
00096 ACE_THROW_SPEC ((CORBA::SystemException,
00097 PortableGroup::ObjectNotFound));
00098
00099
00100
00101
00102 void poa (PortableServer::POA_ptr p);
00103
00104
00105
00106
00107
00108
00109
00110
00111
00112 void delete_object_i (TAO_PG_Factory_Set & factory_set,
00113 CORBA::Boolean ignore_exceptions
00114 ACE_ENV_ARG_DECL);
00115
00116
00117
00118
00119
00120
00121
00122
00123 void delete_member (CORBA::ULong group_id,
00124 const PortableGroup::Location & location
00125 ACE_ENV_ARG_DECL);
00126
00127
00128
00129
00130
00131
00132
00133
00134
00135 void check_minimum_number_members (
00136 PortableGroup::ObjectGroup_ptr object_group,
00137 CORBA::ULong group_id,
00138 const char * type_id
00139 ACE_ENV_ARG_DECL);
00140
00141
00142
00143
00144
00145
00146 PortableGroup::GenericFactory::FactoryCreationId * create_member (
00147 PortableGroup::ObjectGroup_ptr object_group,
00148 const PortableGroup::FactoryInfo & factory_info,
00149 const char * type_id,
00150 const CORBA::Boolean propagate_member_already_present
00151 ACE_ENV_ARG_DECL)
00152 ACE_THROW_SPEC ((CORBA::SystemException,
00153 PortableGroup::NoFactory,
00154 PortableGroup::ObjectNotCreated,
00155 PortableGroup::InvalidCriteria,
00156 PortableGroup::InvalidProperty,
00157 PortableGroup::CannotMeetCriteria,
00158 PortableGroup::MemberAlreadyPresent));
00159
00160 private:
00161
00162
00163
00164
00165 void populate_object_group (
00166 PortableGroup::ObjectGroup_ptr object_group,
00167 const char * type_id,
00168 const PortableGroup::FactoryInfos &factory_infos,
00169 PortableGroup::InitialNumberMembersValue initial_number_members,
00170 TAO_PG_Factory_Set & factory_set
00171 ACE_ENV_ARG_DECL);
00172
00173
00174
00175
00176
00177
00178
00179 void get_ObjectId (CORBA::ULong fcid,
00180 PortableServer::ObjectId_out oid);
00181
00182
00183
00184
00185
00186
00187
00188
00189
00190
00191
00192
00193
00194 void process_criteria (
00195 const char * type_id,
00196 const PortableGroup::Criteria & criteria,
00197 PortableGroup::MembershipStyleValue & membership_style,
00198 PortableGroup::FactoriesValue & factory_infos,
00199 PortableGroup::InitialNumberMembersValue & initial_number_members,
00200 PortableGroup::MinimumNumberMembersValue & minimum_number_members
00201 ACE_ENV_ARG_DECL);
00202
00203 private:
00204
00205
00206 PortableServer::POA_var poa_;
00207
00208
00209 TAO_PG_ObjectGroupManager & object_group_manager_;
00210
00211
00212 TAO_PG_PropertyManager & property_manager_;
00213
00214
00215
00216
00217
00218
00219
00220
00221
00222
00223
00224
00225 TAO_PG_Factory_Map factory_map_;
00226
00227
00228
00229
00230
00231
00232
00233
00234
00235
00236 CORBA::ULong next_fcid_;
00237
00238
00239
00240 TAO_SYNCH_MUTEX lock_;
00241
00242 };
00243
00244 TAO_END_VERSIONED_NAMESPACE_DECL
00245
00246 #include "ace/post.h"
00247
00248 #endif