summaryrefslogtreecommitdiff
path: root/TAO/orbsvcs/orbsvcs/Log/RTEventLogFactory_i.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'TAO/orbsvcs/orbsvcs/Log/RTEventLogFactory_i.cpp')
-rw-r--r--TAO/orbsvcs/orbsvcs/Log/RTEventLogFactory_i.cpp34
1 files changed, 14 insertions, 20 deletions
diff --git a/TAO/orbsvcs/orbsvcs/Log/RTEventLogFactory_i.cpp b/TAO/orbsvcs/orbsvcs/Log/RTEventLogFactory_i.cpp
index 022ff15dfb6..3766c63094f 100644
--- a/TAO/orbsvcs/orbsvcs/Log/RTEventLogFactory_i.cpp
+++ b/TAO/orbsvcs/orbsvcs/Log/RTEventLogFactory_i.cpp
@@ -18,10 +18,6 @@
#include "ace/Auto_Ptr.h"
-#if ! defined (__ACE_INLINE__)
-#include "orbsvcs/Event/EC_ConsumerAdmin.i"
-#endif /* __ACE_INLINE__ */
-
ACE_RCSID (Log,
RTEventLogFactory_i,
"$Id$")
@@ -124,7 +120,7 @@ TAO_RTEventLogFactory_i::init (PortableServer::POA_ptr poa,
this->consumer_admin_ = this->event_channel_->for_consumers(ACE_ENV_SINGLE_ARG_PARAMETER);
- ACE_NEW_THROW_EX (this->notifier_,
+ ACE_NEW_THROW_EX (this->notifier_,
TAO_RTEventLogNotification(this->event_channel_.in ()),
CORBA::NO_MEMORY ());
return 0;
@@ -160,12 +156,12 @@ TAO_RTEventLogFactory_i::activate (PortableServer::POA_ptr poa
return v_return._retn ();
}
-RTEventLogAdmin::EventLog_ptr
+RTEventLogAdmin::EventLog_ptr
TAO_RTEventLogFactory_i::create (
DsLogAdmin::LogFullActionType full_action,
CORBA::ULongLong max_rec_size,
const DsLogAdmin::CapacityAlarmThresholdList & thresholds,
- DsLogAdmin::LogId_out id
+ DsLogAdmin::LogId_out id_out
ACE_ENV_ARG_DECL
)
ACE_THROW_SPEC ((
@@ -174,11 +170,14 @@ TAO_RTEventLogFactory_i::create (
DsLogAdmin::InvalidThreshold
))
{
- // Get an id for this Log.
- this->max_id_++;
+ DsLogAdmin::LogId id;
+
+ // Get an unused/unique id for this Log.
+ while (hash_map_.find ((id = this->next_id_++)) == 0)
+ ;
RTEventLogAdmin::EventLog_ptr eventlog =
- this->create_with_id (this->max_id_,
+ this->create_with_id (id,
full_action,
max_rec_size,
thresholds
@@ -186,17 +185,12 @@ TAO_RTEventLogFactory_i::create (
ACE_CHECK_RETURN (RTEventLogAdmin::EventLog::_nil ());
// Set the id to return..
- id = this->max_id_;
-
- // Store the id in the LogIdList.
- CORBA::ULong len = logid_list_.length();
- logid_list_.length(len+1);
- logid_list_[len] = id;
+ id_out = id;
return eventlog;
}
-RTEventLogAdmin::EventLog_ptr
+RTEventLogAdmin::EventLog_ptr
TAO_RTEventLogFactory_i::create_with_id (
DsLogAdmin::LogId id,
DsLogAdmin::LogFullActionType full_action,
@@ -230,14 +224,14 @@ TAO_RTEventLogFactory_i::create_with_id (
this->notifier_,
id,
full_action,
- max_size
+ max_size
),
CORBA::NO_MEMORY ());
ACE_CHECK_RETURN (event_log._retn ());
PortableServer::ServantBase_var safe_event_log_i = event_log_i;
- // Transfer ownership to POA.
+ // Transfer ownership to POA.
event_log_i->init (ACE_ENV_SINGLE_ARG_PARAMETER);
ACE_CHECK_RETURN (event_log._retn ());
@@ -261,7 +255,7 @@ TAO_RTEventLogFactory_i::create_with_id (
return event_log._retn ();
}
-RtecEventChannelAdmin::ProxyPushSupplier_ptr
+RtecEventChannelAdmin::ProxyPushSupplier_ptr
TAO_RTEventLogFactory_i::obtain_push_supplier (
ACE_ENV_SINGLE_ARG_DECL_NOT_USED
)