summaryrefslogtreecommitdiff
path: root/TAO/orbsvcs/orbsvcs/FtRtEvent/Utils/FTEC_Gateway.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'TAO/orbsvcs/orbsvcs/FtRtEvent/Utils/FTEC_Gateway.cpp')
-rw-r--r--TAO/orbsvcs/orbsvcs/FtRtEvent/Utils/FTEC_Gateway.cpp127
1 files changed, 66 insertions, 61 deletions
diff --git a/TAO/orbsvcs/orbsvcs/FtRtEvent/Utils/FTEC_Gateway.cpp b/TAO/orbsvcs/orbsvcs/FtRtEvent/Utils/FTEC_Gateway.cpp
index 16daa60e23c..98fd1608b38 100644
--- a/TAO/orbsvcs/orbsvcs/FtRtEvent/Utils/FTEC_Gateway.cpp
+++ b/TAO/orbsvcs/orbsvcs/FtRtEvent/Utils/FTEC_Gateway.cpp
@@ -138,67 +138,72 @@ FTEC_Gateway::~FTEC_Gateway()
RtecEventChannelAdmin::EventChannel_ptr
FTEC_Gateway::activate(PortableServer::POA_ptr poa ACE_ENV_ARG_DECL)
{
- PortableServer::IdUniquenessPolicy_var id_uniqueness_policy =
- poa->create_id_uniqueness_policy(PortableServer::MULTIPLE_ID
- ACE_ENV_ARG_PARAMETER);
- ACE_CHECK_RETURN(0);
-
- PortableServer::LifespanPolicy_var lifespan =
- poa->create_lifespan_policy(PortableServer::PERSISTENT
- ACE_ENV_ARG_PARAMETER);
- ACE_CHECK_RETURN(0);
-
- // create a USER_ID IdAssignmentPolicy object
- PortableServer::IdAssignmentPolicy_var assign =
- poa->create_id_assignment_policy(PortableServer::USER_ID
- ACE_ENV_ARG_PARAMETER);
- ACE_CHECK_RETURN(0);
-
- CORBA::PolicyList policy_list;
- policy_list.length(3);
-
- policy_list[0] = PortableServer::IdUniquenessPolicy::_duplicate(
- id_uniqueness_policy.in());
- ACE_CHECK_RETURN(0);
- policy_list[1]=
- PortableServer::LifespanPolicy::_duplicate(lifespan.in());
- ACE_CHECK_RETURN(0);
- policy_list[2]=
- PortableServer::IdAssignmentPolicy::_duplicate(assign.in());
- ACE_CHECK_RETURN(0);
-
- PortableServer::POAManager_var mgr = poa->the_POAManager(ACE_ENV_SINGLE_ARG_PARAMETER);
-
- impl_->poa = poa->create_POA("gateway_poa", mgr.in(), policy_list
- ACE_ENV_ARG_PARAMETER);
- ACE_CHECK_RETURN(0);
-
- id_uniqueness_policy->destroy();
- lifespan->destroy();
- assign->destroy();
-
- PortableServer::ObjectId oid;
- oid.length(16);
- UUID::create(oid.get_buffer());
-
- RtecEventChannelAdmin::EventChannel_var gateway;
-
- activate_object_with_id(gateway.out(), impl_->poa, this, oid ACE_ENV_ARG_PARAMETER);
- ACE_CHECK_RETURN(0);
- ++oid[9];
- activate_object_with_id(impl_->consumer_admin.out(),
- impl_->poa,
- &impl_->consumer_admin_servant,
- oid ACE_ENV_ARG_PARAMETER);
- ACE_CHECK_RETURN(0);
- ++oid[9];
- activate_object_with_id(impl_->supplier_admin.out(),
- impl_->poa,
- &impl_->supplier_admin_servant,
- oid ACE_ENV_ARG_PARAMETER);
- ACE_CHECK_RETURN(0);
-
- return gateway._retn();
+ // preallocation connections
+ CORBA::PolicyList_var pols;
+ impl_->ftec->_validate_connection (pols.out () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN(0);
+
+ PortableServer::IdUniquenessPolicy_var id_uniqueness_policy =
+ poa->create_id_uniqueness_policy(PortableServer::MULTIPLE_ID
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN(0);
+
+ PortableServer::LifespanPolicy_var lifespan =
+ poa->create_lifespan_policy(PortableServer::PERSISTENT
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN(0);
+
+ // create a USER_ID IdAssignmentPolicy object
+ PortableServer::IdAssignmentPolicy_var assign =
+ poa->create_id_assignment_policy(PortableServer::USER_ID
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN(0);
+
+ CORBA::PolicyList policy_list;
+ policy_list.length(3);
+
+ policy_list[0] = PortableServer::IdUniquenessPolicy::_duplicate(
+ id_uniqueness_policy.in());
+ ACE_CHECK_RETURN(0);
+ policy_list[1]=
+ PortableServer::LifespanPolicy::_duplicate(lifespan.in());
+ ACE_CHECK_RETURN(0);
+ policy_list[2]=
+ PortableServer::IdAssignmentPolicy::_duplicate(assign.in());
+ ACE_CHECK_RETURN(0);
+
+ PortableServer::POAManager_var mgr = poa->the_POAManager(ACE_ENV_SINGLE_ARG_PARAMETER);
+
+ impl_->poa = poa->create_POA("gateway_poa", mgr.in(), policy_list
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN(0);
+
+ id_uniqueness_policy->destroy();
+ lifespan->destroy();
+ assign->destroy();
+
+ PortableServer::ObjectId oid;
+ oid.length(16);
+ UUID::create(oid.get_buffer());
+
+ RtecEventChannelAdmin::EventChannel_var gateway;
+
+ activate_object_with_id(gateway.out(), impl_->poa, this, oid ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN(0);
+ ++oid[9];
+ activate_object_with_id(impl_->consumer_admin.out(),
+ impl_->poa,
+ &impl_->consumer_admin_servant,
+ oid ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN(0);
+ ++oid[9];
+ activate_object_with_id(impl_->supplier_admin.out(),
+ impl_->poa,
+ &impl_->supplier_admin_servant,
+ oid ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN(0);
+
+ return gateway._retn();
}
//= The RtecEventChannelAdmin::EventChannel methods