summaryrefslogtreecommitdiff
path: root/TAO/orbsvcs/orbsvcs/Log/NotifyLog_i.cpp
diff options
context:
space:
mode:
authorWilliam R. Otte <wotte@dre.vanderbilt.edu>2006-07-24 15:50:11 +0000
committerWilliam R. Otte <wotte@dre.vanderbilt.edu>2006-07-24 15:50:11 +0000
commit6b846cf03c0bcbd8c276cb0af61a181e5f98eaae (patch)
treeda50d054f9c761c3f6a5923f6979e93306c56d68 /TAO/orbsvcs/orbsvcs/Log/NotifyLog_i.cpp
parent0e555b9150d38e3b3473ba325b56db2642e6352b (diff)
downloadATCD-6b846cf03c0bcbd8c276cb0af61a181e5f98eaae.tar.gz
Repo restructuring
Diffstat (limited to 'TAO/orbsvcs/orbsvcs/Log/NotifyLog_i.cpp')
-rw-r--r--TAO/orbsvcs/orbsvcs/Log/NotifyLog_i.cpp371
1 files changed, 0 insertions, 371 deletions
diff --git a/TAO/orbsvcs/orbsvcs/Log/NotifyLog_i.cpp b/TAO/orbsvcs/orbsvcs/Log/NotifyLog_i.cpp
deleted file mode 100644
index db13c800447..00000000000
--- a/TAO/orbsvcs/orbsvcs/Log/NotifyLog_i.cpp
+++ /dev/null
@@ -1,371 +0,0 @@
-#include "orbsvcs/Log/NotifyLog_i.h"
-#include "orbsvcs/Log/LogMgr_i.h"
-#include "orbsvcs/Log/LogNotification.h"
-
-ACE_RCSID (Log,
- NotifyLog_i,
- "$Id$")
-
-#define CA_FILTER "threshold > 10"
-#define TCL_GRAMMAR "TCL"
-
-TAO_BEGIN_VERSIONED_NAMESPACE_DECL
-
-TAO_NotifyLog_i::TAO_NotifyLog_i (CORBA::ORB_ptr orb,
- PortableServer::POA_ptr poa,
- TAO_LogMgr_i &logmgr_i,
- DsLogAdmin::LogMgr_ptr factory,
- CosNotifyChannelAdmin::EventChannelFactory_ptr ecf,
- TAO_LogNotification *log_notifier,
- DsLogAdmin::LogId id)
- : TAO_Log_i (orb, logmgr_i, factory, id, log_notifier),
- notify_factory_ (CosNotifyChannelAdmin::EventChannelFactory::_duplicate (ecf)),
- poa_ (PortableServer::POA::_duplicate (poa))
-{
- ACE_DECLARE_NEW_CORBA_ENV;
-
- CosNotifyChannelAdmin::ChannelID channel_id;
-
- CosNotification::QoSProperties initial_qos;
- CosNotification::AdminProperties initial_admin;
-
-
- ACE_ASSERT (!CORBA::is_nil (this->notify_factory_.in ()));
-
- this->event_channel_ =
- this->notify_factory_->create_channel (initial_qos,
- initial_admin,
- channel_id
- ACE_ENV_ARG_PARAMETER);
-}
-
-TAO_NotifyLog_i::~TAO_NotifyLog_i ()
-{
- this->event_channel_->destroy ();
-}
-
-DsLogAdmin::Log_ptr
-TAO_NotifyLog_i::copy (DsLogAdmin::LogId &id ACE_ENV_ARG_DECL)
- ACE_THROW_SPEC ((
- CORBA::SystemException
- ))
-{
- DsNotifyLogAdmin::NotifyLogFactory_var notifyLogFactory =
- DsNotifyLogAdmin::NotifyLogFactory::_narrow (factory_.in () ACE_ENV_ARG_PARAMETER);
- ACE_CHECK_RETURN (DsLogAdmin::Log::_nil ());
-
- CosNotification::QoSProperties* qos = get_qos (ACE_ENV_SINGLE_ARG_PARAMETER);
- ACE_CHECK_RETURN (DsLogAdmin::Log::_nil ());
-
- CosNotification::AdminProperties* admin = get_admin (ACE_ENV_SINGLE_ARG_PARAMETER);
- ACE_CHECK_RETURN (DsLogAdmin::Log::_nil ());
-
- DsNotifyLogAdmin::NotifyLog_var log =
- notifyLogFactory->create (DsLogAdmin::halt, 0, thresholds_, static_cast<const CosNotification::QoSProperties> (*qos),
- static_cast<const CosNotification::AdminProperties> (*admin), id);
-
- this->copy_attributes (log.in () ACE_ENV_ARG_PARAMETER);
- ACE_CHECK_RETURN (DsLogAdmin::Log::_nil ());
-
- return log._retn ();
-}
-
-DsLogAdmin::Log_ptr
-TAO_NotifyLog_i::copy_with_id (DsLogAdmin::LogId id ACE_ENV_ARG_DECL)
- ACE_THROW_SPEC ((
- CORBA::SystemException
- ))
-{
- DsNotifyLogAdmin::NotifyLogFactory_var notifyLogFactory =
- DsNotifyLogAdmin::NotifyLogFactory::_narrow (factory_.in () ACE_ENV_ARG_PARAMETER);
- ACE_CHECK_RETURN (DsLogAdmin::Log::_nil ());
-
- CosNotification::QoSProperties* qos = get_qos (ACE_ENV_SINGLE_ARG_PARAMETER);
- ACE_CHECK_RETURN (DsLogAdmin::Log::_nil ());
-
- CosNotification::AdminProperties* admin = get_admin (ACE_ENV_SINGLE_ARG_PARAMETER);
- ACE_CHECK_RETURN (DsLogAdmin::Log::_nil ());
-
- DsNotifyLogAdmin::NotifyLog_var log =
- notifyLogFactory->create_with_id (id, DsLogAdmin::halt, 0, thresholds_, static_cast<const CosNotification::QoSProperties> (*qos),
- static_cast<const CosNotification::AdminProperties> (*admin));
-
- this->copy_attributes (log.in () ACE_ENV_ARG_PARAMETER);
- ACE_CHECK_RETURN (DsLogAdmin::Log::_nil ());
-
- return log._retn ();
-}
-
-
-void
-TAO_NotifyLog_i::destroy (ACE_ENV_SINGLE_ARG_DECL)
- ACE_THROW_SPEC ((CORBA::SystemException))
-{
- notifier_->object_deletion (logid_ ACE_ENV_ARG_PARAMETER);
- ACE_CHECK;
-
- // Remove ourselves from the list of logs.
- this->logmgr_i_.remove (this->logid_
- ACE_ENV_ARG_PARAMETER);
- ACE_CHECK;
-
- // Deregister with POA.
- PortableServer::ObjectId_var id =
- this->poa_->servant_to_id (this
- ACE_ENV_ARG_PARAMETER);
- ACE_CHECK;
-
- this->poa_->deactivate_object (id.in ()
- ACE_ENV_ARG_PARAMETER);
- ACE_CHECK;
-}
-
-void
-TAO_NotifyLog_i::activate (ACE_ENV_SINGLE_ARG_DECL)
-{
-
- CosNotifyChannelAdmin::AdminID adminid = 0;
- CosNotifyChannelAdmin::InterFilterGroupOperator ifgop =
- CosNotifyChannelAdmin::OR_OP;
-
- this->consumer_admin_ =
- this->event_channel_->new_for_consumers (ifgop, adminid ACE_ENV_ARG_PARAMETER);
- ACE_CHECK;
-
- ACE_ASSERT (!CORBA::is_nil (consumer_admin_.in ()));
-
- CosNotifyFilter::FilterFactory_var ffact =
- this->event_channel_->default_filter_factory (ACE_ENV_SINGLE_ARG_PARAMETER);
- ACE_CHECK;
-
- // setup a filter at the consumer admin
- CosNotifyFilter::Filter_var ca_filter =
- ffact->create_filter (TCL_GRAMMAR ACE_ENV_ARG_PARAMETER);
- ACE_CHECK;
-
- ACE_ASSERT (!CORBA::is_nil (ca_filter.in ()));
-
- CosNotifyFilter::ConstraintExpSeq constraint_list (1);
- constraint_list.length (1);
-
- constraint_list[0].event_types.length (0);
- constraint_list[0].constraint_expr = CORBA::string_dup (CA_FILTER);
-
- ca_filter->add_constraints (constraint_list ACE_ENV_ARG_PARAMETER);
- ACE_CHECK;
-
- consumer_admin_->add_filter (ca_filter.in () ACE_ENV_ARG_PARAMETER);
- ACE_CHECK;
-
- // Setup the CA to receive all type of events
- CosNotification::EventTypeSeq added(1);
- CosNotification::EventTypeSeq removed (0);
- added.length (1);
- removed.length (0);
-
- added[0].domain_name = CORBA::string_dup ("*");
- added[0].type_name = CORBA::string_dup ("*");
-
- this->consumer_admin_->subscription_change (added, removed ACE_ENV_ARG_PARAMETER);
- ACE_CHECK;
-
- ACE_NEW_THROW_EX (this->my_log_consumer_,
- TAO_Notify_LogConsumer (this),
- CORBA::NO_MEMORY ());
-
- this->my_log_consumer_->connect (this->consumer_admin_.in () ACE_ENV_ARG_PARAMETER);
-}
-
-//IDL to C++
-CosNotifyFilter::Filter_ptr
-TAO_NotifyLog_i::get_filter (ACE_ENV_SINGLE_ARG_DECL)
- ACE_THROW_SPEC ((
- CORBA::SystemException
- ))
-{
- //TODO: need to add impl
- ACE_THROW_RETURN (CORBA::NO_IMPLEMENT (), 0);
-}
-
-void
-TAO_NotifyLog_i::set_filter (CosNotifyFilter::Filter_ptr /* filter */
- ACE_ENV_ARG_DECL)
- ACE_THROW_SPEC ((
- CORBA::SystemException
- ))
-{
- ACE_THROW (CORBA::NO_IMPLEMENT ());
-
- //TODO: need to add impl
-}
-
-CosNotifyChannelAdmin::EventChannelFactory_ptr
-TAO_NotifyLog_i::MyFactory (ACE_ENV_SINGLE_ARG_DECL)
- ACE_THROW_SPEC ((
- CORBA::SystemException
- ))
-{
- //TODO: need to add impl
- ACE_THROW_RETURN (CORBA::NO_IMPLEMENT (), 0);
-}
-
-CosNotifyChannelAdmin::ConsumerAdmin_ptr
-TAO_NotifyLog_i::default_consumer_admin (ACE_ENV_SINGLE_ARG_DECL)
- ACE_THROW_SPEC ((
- CORBA::SystemException
- ))
-{
- return this->event_channel_->default_consumer_admin (ACE_ENV_SINGLE_ARG_PARAMETER);
-}
-
-CosNotifyChannelAdmin::SupplierAdmin_ptr
-TAO_NotifyLog_i::default_supplier_admin (ACE_ENV_SINGLE_ARG_DECL)
- ACE_THROW_SPEC ((
- CORBA::SystemException
- ))
-{
- return this->event_channel_->default_supplier_admin (ACE_ENV_SINGLE_ARG_PARAMETER);
-}
-
-CosNotifyFilter::FilterFactory_ptr
-TAO_NotifyLog_i::default_filter_factory (ACE_ENV_SINGLE_ARG_DECL)
- ACE_THROW_SPEC ((
- CORBA::SystemException
- ))
-{
- return this->event_channel_->default_filter_factory (ACE_ENV_SINGLE_ARG_PARAMETER);
-}
-
-CosNotifyChannelAdmin::ConsumerAdmin_ptr
-TAO_NotifyLog_i::new_for_consumers (CosNotifyChannelAdmin::InterFilterGroupOperator op,
- CosNotifyChannelAdmin::AdminID& id ACE_ENV_ARG_DECL)
- ACE_THROW_SPEC ((
- CORBA::SystemException
- ))
-{
- return this->event_channel_->new_for_consumers (op,id ACE_ENV_ARG_PARAMETER);
-}
-
-CosNotifyChannelAdmin::SupplierAdmin_ptr
-TAO_NotifyLog_i::new_for_suppliers (CosNotifyChannelAdmin::InterFilterGroupOperator op,
- CosNotifyChannelAdmin::AdminID& id ACE_ENV_ARG_DECL)
- ACE_THROW_SPEC ((
- CORBA::SystemException
- ))
-{
- return this->event_channel_->new_for_suppliers (op,id ACE_ENV_ARG_PARAMETER);
-}
-
-CosNotifyChannelAdmin::ConsumerAdmin_ptr
-TAO_NotifyLog_i::get_consumeradmin (CosNotifyChannelAdmin::AdminID id ACE_ENV_ARG_DECL)
- ACE_THROW_SPEC ((
- CosNotifyChannelAdmin::AdminNotFound,
- CORBA::SystemException
- ))
-{
- return this->event_channel_->get_consumeradmin (id ACE_ENV_ARG_PARAMETER);
-}
-
-CosNotifyChannelAdmin::SupplierAdmin_ptr
-TAO_NotifyLog_i::get_supplieradmin (CosNotifyChannelAdmin::AdminID id ACE_ENV_ARG_DECL)
- ACE_THROW_SPEC ((
- CosNotifyChannelAdmin::AdminNotFound,
- CORBA::SystemException
- ))
-{
- return this->event_channel_->get_supplieradmin (id ACE_ENV_ARG_PARAMETER);
-}
-
-CosNotifyChannelAdmin::AdminIDSeq*
-TAO_NotifyLog_i::get_all_consumeradmins (ACE_ENV_SINGLE_ARG_DECL)
- ACE_THROW_SPEC ((
- CORBA::SystemException
- ))
-{
- return this->event_channel_->get_all_consumeradmins (ACE_ENV_SINGLE_ARG_PARAMETER);
-}
-
-CosNotifyChannelAdmin::AdminIDSeq*
-TAO_NotifyLog_i::get_all_supplieradmins (ACE_ENV_SINGLE_ARG_DECL)
- ACE_THROW_SPEC ((
- CORBA::SystemException
- ))
-{
- return this->event_channel_->get_all_supplieradmins (ACE_ENV_SINGLE_ARG_PARAMETER);
-}
-
-CosNotification::AdminProperties*
-TAO_NotifyLog_i::get_admin (ACE_ENV_SINGLE_ARG_DECL)
- ACE_THROW_SPEC ((
- CORBA::SystemException
- ))
-{
- return this->event_channel_->get_admin (ACE_ENV_SINGLE_ARG_PARAMETER);
-}
-
-void
-TAO_NotifyLog_i::set_admin (const CosNotification::AdminProperties& admin ACE_ENV_ARG_DECL)
- ACE_THROW_SPEC ((
- CosNotification::UnsupportedAdmin,
- CORBA::SystemException
- ))
-{
- this->event_channel_->set_admin (admin ACE_ENV_ARG_PARAMETER);
-}
-
-CosNotification::QoSProperties*
-TAO_NotifyLog_i::get_qos (ACE_ENV_SINGLE_ARG_DECL)
- ACE_THROW_SPEC ((
- CORBA::SystemException
- ))
-{
- //need to add merging of QoS from Log_i and EventChannel_i
- ACE_THROW_RETURN (CORBA::NO_IMPLEMENT (), 0);
-}
-
-void
-TAO_NotifyLog_i::set_qos (const CosNotification::QoSProperties& /* qos */
- ACE_ENV_ARG_DECL)
- ACE_THROW_SPEC ((
- CosNotification::UnsupportedQoS,
- CORBA::SystemException
- ))
-{
- ACE_THROW (CORBA::NO_IMPLEMENT ());
- //TODO: need to add later
-}
-
-void
-TAO_NotifyLog_i::validate_qos (
- const CosNotification::QoSProperties& /* required_qos */,
- CosNotification::NamedPropertyRangeSeq_out /* available_qos */
- ACE_ENV_ARG_DECL)
- ACE_THROW_SPEC ((CosNotification::UnsupportedQoS,
- CORBA::SystemException))
-{
- ACE_THROW (CORBA::NO_IMPLEMENT ());
-
- //TODO: need to add later
-}
-
-CosEventChannelAdmin::ConsumerAdmin_ptr
-TAO_NotifyLog_i::for_consumers (ACE_ENV_SINGLE_ARG_DECL)
- ACE_THROW_SPEC ((
- CORBA::SystemException
- ))
-{
- return this->event_channel_->for_consumers(ACE_ENV_SINGLE_ARG_PARAMETER);
-}
-
-CosEventChannelAdmin::SupplierAdmin_ptr
-TAO_NotifyLog_i::for_suppliers (
- ACE_ENV_SINGLE_ARG_DECL
- )
- ACE_THROW_SPEC ((
- CORBA::SystemException
- ))
-{
- return this->event_channel_->for_suppliers(ACE_ENV_SINGLE_ARG_PARAMETER);
-}
-
-TAO_END_VERSIONED_NAMESPACE_DECL