TAO_Notify_AdminProperties Class Reference

The AdminProperties per EventChannel. More...

#include <AdminProperties.h>

Inheritance diagram for TAO_Notify_AdminProperties:

Inheritance graph
[legend]
Collaboration diagram for TAO_Notify_AdminProperties:

Collaboration graph
[legend]
List of all members.

Public Types

typedef ACE_Strong_Bound_Ptr<
TAO_Notify_AdminProperties,
TAO_SYNCH_MUTEX
Ptr

Public Member Functions

 TAO_Notify_AdminProperties (void)
 Constructor.
virtual ~TAO_Notify_AdminProperties ()
 Destructor.
int init (const CosNotification::PropertySeq &prop_seq)
 Init.
void init ()
 finish initialization after values are set by topology load
const TAO_Notify_Property_Longmax_global_queue_length (void) const
const TAO_Notify_Property_Longmax_consumers (void) const
const TAO_Notify_Property_Longmax_suppliers (void) const
const TAO_Notify_Property_Booleanreject_new_events (void) const
TAO_Notify_Property_Longmax_global_queue_length (void)
TAO_Notify_Property_Longmax_consumers (void)
TAO_Notify_Property_Longmax_suppliers (void)
TAO_Notify_Property_Booleanreject_new_events (void)
CORBA::Longglobal_queue_length (void)
TAO_SYNCH_MUTEXglobal_queue_lock (void)
TAO_SYNCH_CONDITIONglobal_queue_not_full (void)
TAO_Notify_Atomic_Property_Longconsumers (void)
TAO_Notify_Atomic_Property_Longsuppliers (void)
CORBA::Boolean queue_full (void)
 Returns true if Queue is full.

Protected Attributes

TAO_Notify_Property_Long max_global_queue_length_
TAO_Notify_Property_Long max_consumers_
TAO_Notify_Property_Long max_suppliers_
TAO_Notify_Property_Boolean reject_new_events_
 Reject any new event.
CORBA::Long global_queue_length_
TAO_SYNCH_MUTEX global_queue_lock_
 Global queue lock used to serialize access to all queues.
TAO_SYNCH_CONDITION global_queue_not_full_
 The condition that the queue_length_ is not at max.
TAO_Notify_Atomic_Property_Long consumers_
TAO_Notify_Atomic_Property_Long suppliers_

Detailed Description

The AdminProperties per EventChannel.

Definition at line 42 of file AdminProperties.h.


Member Typedef Documentation

typedef ACE_Strong_Bound_Ptr<TAO_Notify_AdminProperties, TAO_SYNCH_MUTEX> TAO_Notify_AdminProperties::Ptr

Definition at line 46 of file AdminProperties.h.


Constructor & Destructor Documentation

TAO_BEGIN_VERSIONED_NAMESPACE_DECL TAO_Notify_AdminProperties::TAO_Notify_AdminProperties ( void   ) 

Constructor.

Definition at line 17 of file AdminProperties.cpp.

TAO_Notify_AdminProperties::~TAO_Notify_AdminProperties (  )  [virtual]

Destructor.

Definition at line 27 of file AdminProperties.cpp.

00028 {
00029 }


Member Function Documentation

ACE_INLINE TAO_Notify_Atomic_Property_Long & TAO_Notify_AdminProperties::consumers ( void   ) 

Definition at line 74 of file AdminProperties.inl.

References consumers_.

Referenced by TAO_Notify_ProxySupplier::connect(), and TAO_Notify_ProxySupplier::disconnect().

00075 {
00076   return this->consumers_;
00077 }

ACE_INLINE CORBA::Long & TAO_Notify_AdminProperties::global_queue_length ( void   ) 

Definition at line 56 of file AdminProperties.inl.

References global_queue_length_.

00057 {
00058   return this->global_queue_length_;
00059 }

ACE_INLINE TAO_SYNCH_MUTEX & TAO_Notify_AdminProperties::global_queue_lock ( void   ) 

Definition at line 62 of file AdminProperties.inl.

References global_queue_lock_.

00063 {
00064   return this->global_queue_lock_;
00065 }

ACE_INLINE TAO_SYNCH_CONDITION & TAO_Notify_AdminProperties::global_queue_not_full ( void   ) 

Definition at line 68 of file AdminProperties.inl.

References global_queue_not_full_.

00069 {
00070   return this->global_queue_not_full_;
00071 }

void TAO_Notify_AdminProperties::init (  ) 

finish initialization after values are set by topology load

Definition at line 49 of file AdminProperties.cpp.

References ACE_ASSERT, TAO_Notify_PropertySeq::add(), max_consumers_, max_global_queue_length_, max_suppliers_, and TAO_Notify_PropertyBase_T< TYPE >::value().

00050 {
00051   // This method should only be called once, (during topo load)
00052   ACE_ASSERT(this->size() == 0);
00053 
00054   if (this->max_global_queue_length_.is_valid())
00055   {
00056     CORBA::Any a;
00057     a <<= this->max_global_queue_length_.value();
00058     this->add(this->max_global_queue_length_.name(), a);
00059   }
00060   if (this->max_consumers_.is_valid())
00061   {
00062     CORBA::Any a;
00063     a <<= this->max_consumers_.value();
00064     this->add(this->max_consumers_.name(), a);
00065   }
00066   if (this->max_suppliers_.is_valid())
00067   {
00068     CORBA::Any a;
00069     a <<= this->max_suppliers_.value();
00070     this->add(this->max_suppliers_.name(), a);
00071   }
00072   if (this->reject_new_events_.is_valid())
00073   {
00074     CORBA::Any a;
00075     a <<= CORBA::Any::from_boolean(this->reject_new_events_.value());
00076     this->add(this->reject_new_events_.name(), a);
00077   }
00078 }

int TAO_Notify_AdminProperties::init ( const CosNotification::PropertySeq prop_seq  ) 

Init.

Reimplemented from TAO_Notify_PropertySeq.

Definition at line 32 of file AdminProperties.cpp.

References TAO_Notify_PropertySeq::init(), max_consumers_, max_global_queue_length_, max_suppliers_, reject_new_events_, TAO_Notify_Property_Boolean::set(), and TAO_Notify_Property_T< TYPE >::set().

Referenced by TAO_Notify_EventChannel::load_attrs(), and TAO_Notify_EventChannel::set_admin().

00033 {
00034   if (TAO_Notify_PropertySeq::init (prop_seq) != 0)
00035     return -1;
00036 
00037   this->max_global_queue_length_.set (*this);
00038   this->max_consumers_.set (*this);
00039   this->max_suppliers_.set (*this);
00040   this->reject_new_events_.set (*this);
00041 
00042   //@@ check if unsupported property was set.
00043   // This will happen when number of successfull inits != numbers of items bound in map_.
00044 
00045   return 0;
00046 }

ACE_INLINE TAO_Notify_Property_Long & TAO_Notify_AdminProperties::max_consumers ( void   ) 

Definition at line 26 of file AdminProperties.inl.

References max_consumers_.

00027 {
00028   return this->max_consumers_;
00029 }

ACE_INLINE const TAO_Notify_Property_Long & TAO_Notify_AdminProperties::max_consumers ( void   )  const

Definition at line 20 of file AdminProperties.inl.

References max_consumers_.

Referenced by TAO_Notify_ProxySupplier::connect().

00021 {
00022   return this->max_consumers_;
00023 }

ACE_INLINE TAO_Notify_Property_Long & TAO_Notify_AdminProperties::max_global_queue_length ( void   ) 

Definition at line 14 of file AdminProperties.inl.

References max_global_queue_length_.

00015 {
00016   return this->max_global_queue_length_;
00017 }

TAO_BEGIN_VERSIONED_NAMESPACE_DECL ACE_INLINE const TAO_Notify_Property_Long & TAO_Notify_AdminProperties::max_global_queue_length ( void   )  const

Definition at line 8 of file AdminProperties.inl.

References max_global_queue_length_.

00009 {
00010   return this->max_global_queue_length_;
00011 }

ACE_INLINE TAO_Notify_Property_Long & TAO_Notify_AdminProperties::max_suppliers ( void   ) 

Definition at line 38 of file AdminProperties.inl.

References max_suppliers_.

00039 {
00040   return this->max_suppliers_;
00041 }

ACE_INLINE const TAO_Notify_Property_Long & TAO_Notify_AdminProperties::max_suppliers ( void   )  const

Definition at line 32 of file AdminProperties.inl.

References max_suppliers_.

Referenced by TAO_Notify_ProxyConsumer::connect().

00033 {
00034   return this->max_suppliers_;
00035 }

CORBA::Boolean TAO_Notify_AdminProperties::queue_full ( void   ) 

Returns true if Queue is full.

Definition at line 81 of file AdminProperties.cpp.

References ACE_GUARD_RETURN, and TAO_SYNCH_MUTEX.

Referenced by TAO_Notify_ProxyPushConsumer::push(), TAO_Notify_CosEC_ProxyPushConsumer::push(), TAO_Notify_StructuredProxyPushConsumer::push_structured_event(), and TAO_Notify_SequenceProxyPushConsumer::push_structured_events().

00082 {
00083   ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, ace_mon, this->global_queue_lock_, 1);
00084 
00085   if (this->max_global_queue_length () == 0)
00086     return 0;
00087   else
00088     if (this->global_queue_length_ >= this->max_global_queue_length ().value ())
00089       return 1;
00090 
00091   return 0;
00092 }

ACE_INLINE TAO_Notify_Property_Boolean & TAO_Notify_AdminProperties::reject_new_events ( void   ) 

Definition at line 50 of file AdminProperties.inl.

References reject_new_events_.

00051 {
00052   return this->reject_new_events_;
00053 }

ACE_INLINE const TAO_Notify_Property_Boolean & TAO_Notify_AdminProperties::reject_new_events ( void   )  const

Definition at line 44 of file AdminProperties.inl.

References reject_new_events_.

00045 {
00046   return this->reject_new_events_;
00047 }

ACE_INLINE TAO_Notify_Atomic_Property_Long & TAO_Notify_AdminProperties::suppliers ( void   ) 

Definition at line 80 of file AdminProperties.inl.

References suppliers_.

Referenced by TAO_Notify_ProxyConsumer::connect(), and TAO_Notify_ProxyConsumer::disconnect().

00081 {
00082   return this->suppliers_;
00083 }


Member Data Documentation

TAO_Notify_Atomic_Property_Long TAO_Notify_AdminProperties::consumers_ [protected]

These are used to count the number of consumers and suppliers connected to the system.

Definition at line 120 of file AdminProperties.h.

Referenced by consumers().

CORBA::Long TAO_Notify_AdminProperties::global_queue_length_ [protected]

This is used to count the queue length across all buffers in the Notify Service to enforce the "MaxQueueLength" property.

Definition at line 110 of file AdminProperties.h.

Referenced by global_queue_length().

TAO_SYNCH_MUTEX TAO_Notify_AdminProperties::global_queue_lock_ [protected]

Global queue lock used to serialize access to all queues.

Definition at line 113 of file AdminProperties.h.

Referenced by global_queue_lock().

TAO_SYNCH_CONDITION TAO_Notify_AdminProperties::global_queue_not_full_ [protected]

The condition that the queue_length_ is not at max.

Definition at line 116 of file AdminProperties.h.

Referenced by global_queue_not_full().

TAO_Notify_Property_Long TAO_Notify_AdminProperties::max_consumers_ [protected]

The maximum number of consumers that can be connected to the channel at any given time.

Definition at line 98 of file AdminProperties.h.

Referenced by init(), and max_consumers().

TAO_Notify_Property_Long TAO_Notify_AdminProperties::max_global_queue_length_ [protected]

The maximum number of events that will be queued by the channel before the channel begins discarding events or rejecting new events upon receipt of each new event.

Definition at line 94 of file AdminProperties.h.

Referenced by init(), and max_global_queue_length().

TAO_Notify_Property_Long TAO_Notify_AdminProperties::max_suppliers_ [protected]

The maximum number of suppliers that can be connected to the channel at any given time.

Definition at line 102 of file AdminProperties.h.

Referenced by init(), and max_suppliers().

TAO_Notify_Property_Boolean TAO_Notify_AdminProperties::reject_new_events_ [protected]

Reject any new event.

Definition at line 105 of file AdminProperties.h.

Referenced by init(), and reject_new_events().

TAO_Notify_Atomic_Property_Long TAO_Notify_AdminProperties::suppliers_ [protected]

Definition at line 121 of file AdminProperties.h.

Referenced by suppliers().


The documentation for this class was generated from the following files:
Generated on Tue Feb 2 17:46:15 2010 for TAO_CosNotification by  doxygen 1.4.7