summaryrefslogtreecommitdiff
path: root/TAO/orbsvcs/orbsvcs/CosEvent/CEC_EventChannel.h
diff options
context:
space:
mode:
Diffstat (limited to 'TAO/orbsvcs/orbsvcs/CosEvent/CEC_EventChannel.h')
-rw-r--r--TAO/orbsvcs/orbsvcs/CosEvent/CEC_EventChannel.h235
1 files changed, 121 insertions, 114 deletions
diff --git a/TAO/orbsvcs/orbsvcs/CosEvent/CEC_EventChannel.h b/TAO/orbsvcs/orbsvcs/CosEvent/CEC_EventChannel.h
index fc7f05dc14d..07919e370c2 100644
--- a/TAO/orbsvcs/orbsvcs/CosEvent/CEC_EventChannel.h
+++ b/TAO/orbsvcs/orbsvcs/CosEvent/CEC_EventChannel.h
@@ -1,22 +1,19 @@
/* -*- C++ -*- */
-// $Id$
-//
-// ============================================================================
-//
-// = LIBRARY
-// ORBSVCS Cos Event Channel
-//
-// = FILENAME
-// CEC_EventChannel
-//
-// = AUTHOR
-// Carlos O'Ryan (coryan@cs.wustl.edu)
-//
-// = DESCRIPTION
-// A new implementation of the COS Event Channel.
-// This version does not rely on the RTEC in its implementation.
-//
-// ============================================================================
+//=============================================================================
+/**
+ * @file CEC_EventChannel
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan (coryan@cs.wustl.edu)
+ *
+ * A new implementation of the COS Event Channel.
+ * This version does not rely on the RTEC in its implementation.
+ *
+ *
+ */
+//=============================================================================
+
#ifndef TAO_CEC_EVENTCHANNEL_H
#define TAO_CEC_EVENTCHANNEL_H
@@ -32,149 +29,159 @@
#include "CEC_Defaults.h"
#include "event_export.h"
+/**
+ * @class TAO_CEC_EventChannel_Attributes
+ *
+ * @brief Defines the construction time attributes for the Event
+ * Channel.
+ *
+ * The event channel implementation is controlled by two
+ * mechanisms:
+ * The CEC_Factory that provides the strategies for the EC
+ * implementation.
+ * The EC attributes that define constants and values required
+ * by the EC construction.
+ * This class encapsulates those constants and values, providing
+ * an easy mechanism to extend the attributes without requiring
+ * changes in the EC constructor.
+ */
class TAO_Event_Export TAO_CEC_EventChannel_Attributes
{
- // = TITLE
- // Defines the construction time attributes for the Event
- // Channel.
- //
- // = DESCRIPTION
- // The event channel implementation is controlled by two
- // mechanisms:
- // The CEC_Factory that provides the strategies for the EC
- // implementation.
- // The EC attributes that define constants and values required
- // by the EC construction.
- // This class encapsulates those constants and values, providing
- // an easy mechanism to extend the attributes without requiring
- // changes in the EC constructor.
- //
public:
+ /**
+ * The basic constructor.
+ * The attributes listed as arguments are *required* by the EC, and
+ * no appropiate defaults are available for them.
+ */
TAO_CEC_EventChannel_Attributes (PortableServer::POA_ptr supplier_poa,
PortableServer::POA_ptr consumer_poa);
- // The basic constructor.
- // The attributes listed as arguments are *required* by the EC, and
- // no appropiate defaults are available for them.
// Most fields are public, there is no need to protect them, in fact
// the user should be able to set any values she wants.
+ /// Can consumers or suppliers invoke connect_push_* multiple times?
int consumer_reconnect;
int supplier_reconnect;
- // Can consumers or suppliers invoke connect_push_* multiple times?
+ /**
+ * It not zero the event channel will send disconnect callbacks when
+ * a disconnect method is called on a Proxy. In other words, if a
+ * consumer calls disconnect_push_supplier() on its proxy the EC
+ * will invoke disconnect_push_consumer() on the consumer. A
+ * similar thing is done for suppliers.
+ * It is a matter of debate what the spec requires for the regular
+ * event service.
+ */
int disconnect_callbacks;
- // It not zero the event channel will send disconnect callbacks when
- // a disconnect method is called on a Proxy. In other words, if a
- // consumer calls disconnect_push_supplier() on its proxy the EC
- // will invoke disconnect_push_consumer() on the consumer. A
- // similar thing is done for suppliers.
- // It is a matter of debate what the spec requires for the regular
- // event service.
+ /// Flags for the Consumer Admin
int busy_hwm;
int max_write_delay;
- // Flags for the Consumer Admin
private:
+ /// Only the EC can read the private fields.
friend class TAO_CEC_EventChannel;
- // Only the EC can read the private fields.
+ /// The POAs
PortableServer::POA_ptr supplier_poa;
PortableServer::POA_ptr consumer_poa;
- // The POAs
};
+/**
+ * @class TAO_CEC_EventChannel
+ *
+ * @brief The CosEventChannelAdmin::EventChannel implementation.
+ *
+ * This class is the Mediator between all the classes in the EC
+ * implementation, its main task is to redirect the messages to
+ * the right components, to hold and manage the lifetime of the
+ * long lived objects (Timer_Module, SupplierAdmin,
+ * ConsumerAdmin and Dispatching) and to provide a simpler
+ * interface to the CEC_Factory.
+ */
class TAO_Event_Export TAO_CEC_EventChannel : public POA_CosEventChannelAdmin::EventChannel
{
- // = TITLE
- // The CosEventChannelAdmin::EventChannel implementation.
- //
- // = DESCRIPTION
- // This class is the Mediator between all the classes in the EC
- // implementation, its main task is to redirect the messages to
- // the right components, to hold and manage the lifetime of the
- // long lived objects (Timer_Module, SupplierAdmin,
- // ConsumerAdmin and Dispatching) and to provide a simpler
- // interface to the CEC_Factory.
- //
public:
+ /**
+ * constructor
+ * If <own_factory> is not 0 it assumes ownership of the factory.
+ * If the factory is <nil> it uses the Service_Configurator to load
+ * the Factory, if not found it uses TAO_CEC_Default_Resource_Factory
+ */
TAO_CEC_EventChannel (const TAO_CEC_EventChannel_Attributes& attributes,
TAO_CEC_Factory* factory = 0,
int own_factory = 0);
- // constructor
- // If <own_factory> is not 0 it assumes ownership of the factory.
- // If the factory is <nil> it uses the Service_Configurator to load
- // the Factory, if not found it uses TAO_CEC_Default_Resource_Factory
+ /// destructor
virtual ~TAO_CEC_EventChannel (void);
- // destructor
+ /// Start the internal threads (if any), etc.
+ /// After this call the EC can be used.
virtual void activate (CORBA::Environment &env = TAO_default_environment ());
- // Start the internal threads (if any), etc.
- // After this call the EC can be used.
+ /// Shutdown any internal threads, cleanup all the internal
+ /// structures, flush all the messages, etc.
virtual void shutdown (CORBA::Environment &env = TAO_default_environment ());
- // Shutdown any internal threads, cleanup all the internal
- // structures, flush all the messages, etc.
+ /// Access the dispatching module....
TAO_CEC_Dispatching* dispatching (void) const;
- // Access the dispatching module....
+ /// Access the consumer admin implementation.
TAO_CEC_ConsumerAdmin* consumer_admin (void) const;
- // Access the consumer admin implementation.
+ /// Access the supplier admin implementation.
TAO_CEC_SupplierAdmin* supplier_admin (void) const;
- // Access the supplier admin implementation.
+ /// Access the consumer control strategy.
TAO_CEC_ConsumerControl* consumer_control (void) const;
- // Access the consumer control strategy.
+ /// Access the supplier control strategy.
TAO_CEC_SupplierControl* supplier_control (void) const;
- // Access the supplier control strategy.
// = The factory methods, they delegate on the CEC_Factory.
+ /// Create and destroy a ProxyPushSupplier
void create_proxy (TAO_CEC_ProxyPushSupplier*&);
void destroy_proxy (TAO_CEC_ProxyPushSupplier*);
- // Create and destroy a ProxyPushSupplier
+ /// Create and destroy a ProxyPullSupplier
void create_proxy (TAO_CEC_ProxyPullSupplier*&);
void destroy_proxy (TAO_CEC_ProxyPullSupplier*);
- // Create and destroy a ProxyPullSupplier
+ /// Create and destroy a ProxyPushConsumer
void create_proxy (TAO_CEC_ProxyPushConsumer*&);
void destroy_proxy (TAO_CEC_ProxyPushConsumer*);
- // Create and destroy a ProxyPushConsumer
+ /// Create and destroy a ProxyPushConsumer
void create_proxy (TAO_CEC_ProxyPullConsumer*&);
void destroy_proxy (TAO_CEC_ProxyPullConsumer*);
- // Create and destroy a ProxyPushConsumer
+ /// Create and destroy a the collections used to store
+ /// Proxy*Suppliers
void create_proxy_collection (TAO_CEC_ProxyPushSupplier_Collection*&);
void destroy_proxy_collection (TAO_CEC_ProxyPushSupplier_Collection*);
void create_proxy_collection (TAO_CEC_ProxyPullSupplier_Collection*&);
void destroy_proxy_collection (TAO_CEC_ProxyPullSupplier_Collection*);
- // Create and destroy a the collections used to store
- // Proxy*Suppliers
+ /// Create and destroy a the collections used to store
+ /// Proxy*Consumers
void create_proxy_collection (TAO_CEC_ProxyPushConsumer_Collection*&);
void destroy_proxy_collection (TAO_CEC_ProxyPushConsumer_Collection*);
void create_proxy_collection (TAO_CEC_ProxyPullConsumer_Collection*&);
void destroy_proxy_collection (TAO_CEC_ProxyPullConsumer_Collection*);
- // Create and destroy a the collections used to store
- // Proxy*Consumers
+ /// Access the supplier and consumer POAs from the factory.
PortableServer::POA_ptr supplier_poa (void);
PortableServer::POA_ptr consumer_poa (void);
- // Access the supplier and consumer POAs from the factory.
+ /// Locking strategies for the ProxyPushConsumer and
+ /// ProxyPushSupplier objects
ACE_Lock* create_consumer_lock (void);
void destroy_consumer_lock (ACE_Lock*);
ACE_Lock* create_supplier_lock (void);
void destroy_supplier_lock (ACE_Lock*);
- // Locking strategies for the ProxyPushConsumer and
- // ProxyPushSupplier objects
+ /// Used to inform the EC that a Consumer has connected or
+ /// disconnected from it.
virtual void connected (TAO_CEC_ProxyPushConsumer*,
CORBA::Environment&);
virtual void reconnected (TAO_CEC_ProxyPushConsumer*,
@@ -187,9 +194,9 @@ public:
CORBA::Environment&);
virtual void disconnected (TAO_CEC_ProxyPullConsumer*,
CORBA::Environment&);
- // Used to inform the EC that a Consumer has connected or
- // disconnected from it.
+ /// Used to inform the EC that a Supplier has connected or
+ /// disconnected from it.
virtual void connected (TAO_CEC_ProxyPushSupplier*,
CORBA::Environment&);
virtual void reconnected (TAO_CEC_ProxyPushSupplier*,
@@ -202,86 +209,86 @@ public:
CORBA::Environment&);
virtual void disconnected (TAO_CEC_ProxyPullSupplier*,
CORBA::Environment&);
- // Used to inform the EC that a Supplier has connected or
- // disconnected from it.
// Simple flags to control the EC behavior, set by the application
// at construction time.
+ /// Can the consumers reconnect to the EC?
int consumer_reconnect (void) const;
- // Can the consumers reconnect to the EC?
+ /// Can the suppliers reconnect to the EC?
int supplier_reconnect (void) const;
- // Can the suppliers reconnect to the EC?
+ /// Should we send callback disconnect messages when a proxy is
+ /// disconnected by the client
int disconnect_callbacks (void) const;
- // Should we send callback disconnect messages when a proxy is
- // disconnected by the client
+ /// Control the concurrency of the delayed connect/disconnect
+ /// operations.
int busy_hwm (void) const;
int max_write_delay (void) const;
- // Control the concurrency of the delayed connect/disconnect
- // operations.
// = The CosEventChannelAdmin::EventChannel methods...
+ /// The default implementation is:
+ /// this->consumer_admin ()->_this (env);
virtual CosEventChannelAdmin::ConsumerAdmin_ptr
for_consumers (CORBA::Environment& env)
ACE_THROW_SPEC ((CORBA::SystemException));
- // The default implementation is:
- // this->consumer_admin ()->_this (env);
+ /// The default implementation is:
+ /// this->supplier_admin ()->_this (env);
virtual CosEventChannelAdmin::SupplierAdmin_ptr
for_suppliers (CORBA::Environment& env)
ACE_THROW_SPEC ((CORBA::SystemException));
- // The default implementation is:
- // this->supplier_admin ()->_this (env);
+ /// Commit suicide.
virtual void destroy (CORBA::Environment &env)
ACE_THROW_SPEC ((CORBA::SystemException));
- // Commit suicide.
private:
+ /// The POAs used to activate "supplier-side" and "consumer-side"
+ /// objects.
PortableServer::POA_var supplier_poa_;
PortableServer::POA_var consumer_poa_;
- // The POAs used to activate "supplier-side" and "consumer-side"
- // objects.
+ /**
+ * This is the abstract factory that creates all the objects that
+ * compose an event channel, the event channel simply acts as a
+ * Mediator among them.
+ */
TAO_CEC_Factory *factory_;
- // This is the abstract factory that creates all the objects that
- // compose an event channel, the event channel simply acts as a
- // Mediator among them.
+ /// Flag that indicates if we own the factory.
int own_factory_;
- // Flag that indicates if we own the factory.
+ /// The dispatching "module"
TAO_CEC_Dispatching *dispatching_;
- // The dispatching "module"
+ /// The pulling strategy
TAO_CEC_Pulling_Strategy *pulling_strategy_;
- // The pulling strategy
+ /// The ConsumerAdmin implementation
TAO_CEC_ConsumerAdmin *consumer_admin_;
- // The ConsumerAdmin implementation
+ /// The SupplierAdmin implementation
TAO_CEC_SupplierAdmin *supplier_admin_;
- // The SupplierAdmin implementation
+ /// Consumer/Supplier reconnection flags
int consumer_reconnect_;
int supplier_reconnect_;
- // Consumer/Supplier reconnection flags
+ /// If not zero we send callbacks when a proxy is disconnected
int disconnect_callbacks_;
- // If not zero we send callbacks when a proxy is disconnected
+ /// Control the level of concurrency in the supplier sets with
+ /// delayed operations
int busy_hwm_;
int max_write_delay_;
- // Control the level of concurrency in the supplier sets with
- // delayed operations
+ /// Strategies to disconnect misbehaving or destroyed consumers and
+ /// suppliers
TAO_CEC_ConsumerControl *consumer_control_;
TAO_CEC_SupplierControl *supplier_control_;
- // Strategies to disconnect misbehaving or destroyed consumers and
- // suppliers
};
#if defined (__ACE_INLINE__)