summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwilson_d <wilson_d@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2004-10-19 16:01:33 +0000
committerwilson_d <wilson_d@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2004-10-19 16:01:33 +0000
commit3be9a18e65c1881adcbc6117a694105192ba69f8 (patch)
treea27a11f8e05a443899c71beab140db7b88f75440
parent47c697fb8eedd4baa48e6821593c239b97d999a5 (diff)
downloadATCD-3be9a18e65c1881adcbc6117a694105192ba69f8.tar.gz
ChangeLogTag: Tue Oct 19 10:43:28 2004 Dale Wilson <wilson_d@ociweb.com>
-rw-r--r--TAO/ChangeLog_pnotify78
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Any/AnyEvent.cpp53
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Any/AnyEvent.h20
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Consumer.cpp3
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Consumer.h5
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Consumer.inl37
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Event.cpp46
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Event.h45
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Event.inl12
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Method_Request_Dispatch.cpp16
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Method_Request_Dispatch.h39
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Method_Request_Dispatch_Base.cpp (renamed from TAO/orbsvcs/orbsvcs/Notify/Method_Request_Dispatch_T.inl)32
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Method_Request_Dispatch_Base.h67
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Method_Request_Dispatch_Base.inl2
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Method_Request_Dispatch_T.cpp27
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Method_Request_Dispatch_T.h73
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Method_Request_Lookup.cpp16
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Method_Request_Lookup.h30
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Method_Request_Lookup_Base.cpp (renamed from TAO/orbsvcs/orbsvcs/Notify/Method_Request_Lookup_T.inl)36
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Method_Request_Lookup_Base.h62
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Method_Request_Lookup_Base.inl2
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Method_Request_Lookup_T.cpp31
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Method_Request_Lookup_T.h68
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Proxy.h8
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Proxy.inl9
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/ProxySupplier.cpp29
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/ProxySupplier.h14
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Refcountable_Guard_T.h5
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Refcountable_Guard_T.inl18
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Sequence/SequencePushConsumer.cpp10
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Sequence/SequencePushConsumer.h2
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Structured/StructuredEvent.cpp32
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Structured/StructuredEvent.h16
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Structured/StructuredPushConsumer.cpp6
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Structured/StructuredPushConsumer.h3
35 files changed, 555 insertions, 397 deletions
diff --git a/TAO/ChangeLog_pnotify b/TAO/ChangeLog_pnotify
index c80fb2cb3b6..6583ba3a56d 100644
--- a/TAO/ChangeLog_pnotify
+++ b/TAO/ChangeLog_pnotify
@@ -1,3 +1,81 @@
+Tue Oct 19 10:43:28 2004 Dale Wilson <wilson_d@ociweb.com>
+
+ * orbsvcs/orbsvcs/Notify/Method_Request_Dispatch_T.h:
+ * orbsvcs/orbsvcs/Notify/Method_Request_Dispatch_T.inl:
+ * orbsvcs/orbsvcs/Notify/Method_Request_Dispatch_T.cpp:
+ * orbsvcs/orbsvcs/Notify/Method_Request_Lookup_T.h:
+ * orbsvcs/orbsvcs/Notify/Method_Request_Lookup_T.inl:
+ * orbsvcs/orbsvcs/Notify/Method_Request_Lookup_T.cpp:
+ Removed these files.
+ Replacing template-based with inheritence-based copy managament.
+ The problem with a template based approach (other than the
+ obscurity of overloading methods based on raw vs smart
+ pointer (some comments would have been nice!)) is the
+ source code explosion. Because the distinction
+ between Event * and Event_var is meaningful, every stage of the
+ process has to provide (at least) two methods to preserve this
+ distinction even when this stage doesn't care.
+ This became a problem in adding event persistence because it
+ meant that the event persistence stuff would also have to preserve
+ this "state-by-pointer-type" info.
+
+ * orbsvcs/orbsvcs/Notify/Method_Request_Dispatch_Base.h:
+ * orbsvcs/orbsvcs/Notify/Method_Request_Dispatch_Base.inl:
+ * orbsvcs/orbsvcs/Notify/Method_Request_Dispatch_Base.cpp:
+ * orbsvcs/orbsvcs/Notify/Method_Request_Lookup_Base.h:
+ * orbsvcs/orbsvcs/Notify/Method_Request_Lookup_Base.inl:
+ * orbsvcs/orbsvcs/Notify/Method_Request_Lookup_Base.cpp:
+ Added these files.
+
+
+ * orbsvcs/orbsvcs/Notify/Method_Request_Dispatch.h:
+ * orbsvcs/orbsvcs/Notify/Method_Request_Dispatch.cpp:
+ * orbsvcs/orbsvcs/Notify/Method_Request_Lookup.h:
+ * orbsvcs/orbsvcs/Notify/Method_Request_Lookup.cpp:
+ Now derived from *_Base rather than _T<x,x,x,x>
+
+
+ * orbsvcs/orbsvcs/Notify/Any/AnyEvent.h:
+ * orbsvcs/orbsvcs/Notify/Any/AnyEvent.cpp:
+ * orbsvcs/orbsvcs/Notify/Structured/StructuredEvent.h:
+ * orbsvcs/orbsvcs/Notify/Structured/StructuredEvent.cpp:
+ * orbsvcs/orbsvcs/Notify/Event.h:
+ * orbsvcs/orbsvcs/Notify/Event.inl:
+ * orbsvcs/orbsvcs/Notify/Event.cpp:
+ The distinction that the templates were attempting to preserve
+ was whether or not the event had been copied to the heap.
+ The goal was to keep the event on the stack as long as possible,
+ but make a copy on the heap when it became necessary to queue the
+ event for later processing or for another thread.
+
+ This is now handled by providing a virtual "Event::copy_on_heap" method.
+ A event on the stack makes a copy and returns a pointer to it.
+ A event on the heap just returns a pointer to itself.
+
+ * orbsvcs/orbsvcs/Notify/Refcountable_Guard_T.h:
+ * orbsvcs/orbsvcs/Notify/Refcountable_Guard_T.inl:
+ The pointer to events was based on Refcountable_Auto_Ptr which is
+ not smart enough to have two pointers to the same object unless one
+ was created from the other. Event was changed to be a Refcountable
+ object and Refcountable_Guard was extended to allow null pointers,
+ thereby allowing it to be contained in a collection. Asserts protect
+ null Refcountable_Guards from misuse.
+
+ * orbsvcs/orbsvcs/Notify/Consumer.h:
+ * orbsvcs/orbsvcs/Notify/Consumer.inl:
+ * orbsvcs/orbsvcs/Notify/Consumer.cpp:
+ * orbsvcs/orbsvcs/Notify/Proxy.h:
+ * orbsvcs/orbsvcs/Notify/Proxy.inl:
+ * orbsvcs/orbsvcs/Notify/ProxySupplier.h:
+ * orbsvcs/orbsvcs/Notify/ProxySupplier.cpp:
+ * orbsvcs/orbsvcs/Notify/Sequence/SequencePushConsumer.h:
+ * orbsvcs/orbsvcs/Notify/Sequence/SequencePushConsumer.cpp:
+ * orbsvcs/orbsvcs/Notify/Structured/StructuredPushConsumer.h:
+ * orbsvcs/orbsvcs/Notify/Structured/StructuredPushConsumer.cpp:
+ Eliminate overridden-by-pointer-type methods that are
+ no longer needed. Use copy_on_heap when necessary.
+
+
Mon Oct 18 15:21:49 2004 Dale Wilson <wilson_d@ociweb.com>
* orbsvcs/orbsvcs/Notify/Buffering_Strategy.h:
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Any/AnyEvent.cpp b/TAO/orbsvcs/orbsvcs/Notify/Any/AnyEvent.cpp
index c8c2464998c..7dc4fc893b2 100644
--- a/TAO/orbsvcs/orbsvcs/Notify/Any/AnyEvent.cpp
+++ b/TAO/orbsvcs/orbsvcs/Notify/Any/AnyEvent.cpp
@@ -22,18 +22,6 @@ TAO_Notify_AnyEvent_No_Copy::~TAO_Notify_AnyEvent_No_Copy ()
{
}
-TAO_Notify_Event*
-TAO_Notify_AnyEvent_No_Copy::copy (ACE_ENV_SINGLE_ARG_DECL) const
-{
- TAO_Notify_Event* copy;
-
- ACE_NEW_THROW_EX (copy,
- TAO_Notify_AnyEvent (*this->event_),
- CORBA::NO_MEMORY ());
-
- return copy;
-}
-
const TAO_Notify_EventType&
TAO_Notify_AnyEvent_No_Copy::type (void) const
{
@@ -98,6 +86,40 @@ TAO_Notify_AnyEvent_No_Copy::push_no_filtering (Event_Forwarder::ProxyPushSuppli
forwarder->forward_any_no_filtering (*this->event_ ACE_ENV_ARG_PARAMETER);
}
+void
+TAO_Notify_AnyEvent_No_Copy::marshal (TAO_OutputCDR & cdr) const
+{
+ static const ACE_CDR::Octet ANY_CODE = MARSHAL_ANY;
+ cdr.write_octet (ANY_CODE);
+ cdr << (*this->event_);
+}
+
+//static
+TAO_Notify_AnyEvent *
+TAO_Notify_AnyEvent_No_Copy::unmarshal (TAO_InputCDR & cdr)
+{
+ TAO_Notify_AnyEvent * event = 0;
+ CORBA::Any body;
+ if (cdr >> body)
+ {
+ event = new TAO_Notify_AnyEvent (body);
+ }
+ return event;
+}
+
+const TAO_Notify_Event *
+TAO_Notify_AnyEvent_No_Copy::copy_on_heap (ACE_ENV_SINGLE_ARG_PARAMETER) const
+{
+ TAO_Notify_Event* copy;
+
+ ACE_NEW_THROW_EX (copy,
+ TAO_Notify_AnyEvent (*this->event_),
+ CORBA::NO_MEMORY ());
+
+ return copy;
+}
+
+
/*****************************************************************************************************/
TAO_Notify_AnyEvent::TAO_Notify_AnyEvent (const CORBA::Any &event)
@@ -110,3 +132,10 @@ TAO_Notify_AnyEvent::TAO_Notify_AnyEvent (const CORBA::Any &event)
TAO_Notify_AnyEvent::~TAO_Notify_AnyEvent ()
{
}
+
+const TAO_Notify_Event *
+TAO_Notify_AnyEvent::copy_on_heap (ACE_ENV_SINGLE_ARG_PARAMETER) const
+{
+ return this;
+}
+
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Any/AnyEvent.h b/TAO/orbsvcs/orbsvcs/Notify/Any/AnyEvent.h
index d97e7bc2b7e..676607f134a 100644
--- a/TAO/orbsvcs/orbsvcs/Notify/Any/AnyEvent.h
+++ b/TAO/orbsvcs/orbsvcs/Notify/Any/AnyEvent.h
@@ -26,7 +26,7 @@
#include "orbsvcs/CosNotificationC.h"
class TAO_Notify_Consumer;
-
+class TAO_Notify_AnyEvent;
/**
* @class TAO_Notify_AnyEvent
*
@@ -43,9 +43,6 @@ public:
/// Destructor
~TAO_Notify_AnyEvent_No_Copy ();
- /// Copy the event.
- virtual TAO_Notify_Event* copy (ACE_ENV_SINGLE_ARG_DECL) const;
-
/// Get the event type.
virtual const TAO_Notify_EventType& type (void) const;
@@ -69,6 +66,18 @@ public:
/// Push event to the Event_Forwarder interface
virtual void push_no_filtering (Event_Forwarder::ProxyPushSupplier_ptr forwarder ACE_ENV_ARG_DECL) const;
+ /// marshal this event into a CDR buffer (for persistence)
+ virtual void marshal (TAO_OutputCDR & cdr) const;
+
+ /// unmarshal this event from a CDR buffer (for persistence)
+ /// \param code a code indicating what type of event to create.
+ /// \param cdr a CDR stream containing the marshalled data for the event.
+ /// \return the new event, or NULL if this is the wrong type of event.
+ static TAO_Notify_AnyEvent * unmarshal (TAO_InputCDR & cdr);
+
+ /// returns a copy of this event allocated from the heap
+ virtual const TAO_Notify_Event * copy_on_heap ()const;
+
protected:
/// Any Event
const CORBA::Any* event_;
@@ -94,6 +103,9 @@ public:
/// Destructor
~TAO_Notify_AnyEvent ();
+ /// return this
+ virtual const TAO_Notify_Event * copy_on_heap ()const;
+
protected:
/// Copy of the Event.
CORBA::Any any_copy_;
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Consumer.cpp b/TAO/orbsvcs/orbsvcs/Notify/Consumer.cpp
index 84506c169de..b606b81f20a 100644
--- a/TAO/orbsvcs/orbsvcs/Notify/Consumer.cpp
+++ b/TAO/orbsvcs/orbsvcs/Notify/Consumer.cpp
@@ -51,7 +51,8 @@ TAO_Notify_Consumer::dispatch_pending (ACE_ENV_SINGLE_ARG_DECL)
{
if (event_collection_copy.dequeue_head (event) == 0)
{
- proxy_supplier->push_no_filtering (event ACE_ENV_ARG_PARAMETER);
+ // push without filtering
+ proxy_supplier->push (event.get (), false ACE_ENV_ARG_PARAMETER);
}
}
}
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Consumer.h b/TAO/orbsvcs/orbsvcs/Notify/Consumer.h
index bac8a0cbded..3f8241ea871 100644
--- a/TAO/orbsvcs/orbsvcs/Notify/Consumer.h
+++ b/TAO/orbsvcs/orbsvcs/Notify/Consumer.h
@@ -54,9 +54,6 @@ public:
void push (const TAO_Notify_Event* event ACE_ENV_ARG_DECL);
/// Push <event> to this consumer.
- void push (const TAO_Notify_Event_var& event ACE_ENV_ARG_DECL);
-
- /// Push <event> to this consumer.
virtual void push (const CORBA::Any& event ACE_ENV_ARG_DECL) = 0;
/// Push <event> to this consumer.
@@ -84,7 +81,7 @@ protected:
virtual void push_i (const TAO_Notify_Event* event ACE_ENV_ARG_DECL) = 0;
/// Push Implementation.
- virtual void push_i (const TAO_Notify_Event_var& event ACE_ENV_ARG_DECL) = 0;
+// virtual int push_i (const TAO_Notify_Event_var& event ACE_ENV_ARG_DECL) = 0;
/// Get the shared Proxy Lock
TAO_SYNCH_MUTEX* proxy_lock (void);
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Consumer.inl b/TAO/orbsvcs/orbsvcs/Notify/Consumer.inl
index 77a5f12c554..64f9f0806de 100644
--- a/TAO/orbsvcs/orbsvcs/Notify/Consumer.inl
+++ b/TAO/orbsvcs/orbsvcs/Notify/Consumer.inl
@@ -27,46 +27,13 @@ TAO_Notify_Consumer::suspend (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
}
ACE_INLINE void
-TAO_Notify_Consumer::push (const TAO_Notify_Event_var &event ACE_ENV_ARG_DECL)
-{
- if (this->is_suspended_ == 1) // If we're suspended, queue for later delivery.
- {
- ACE_GUARD (TAO_SYNCH_MUTEX, ace_mon, *this->proxy_lock ());
-
- this->event_collection_->enqueue_head (event);
-
- return;
- }
-
- ACE_TRY
- {
- this->push_i (event ACE_ENV_ARG_PARAMETER);
- ACE_TRY_CHECK;
- }
- ACE_CATCH (CORBA::OBJECT_NOT_EXIST, not_exist)
- {
- this->handle_dispatch_exception (ACE_ENV_SINGLE_ARG_PARAMETER);
- ACE_TRY_CHECK;
- }
- ACE_CATCH (CORBA::SystemException, sysex)
- {
- this->handle_dispatch_exception (ACE_ENV_SINGLE_ARG_PARAMETER);
- ACE_TRY_CHECK;
- }
- ACE_CATCHANY
- {
- }
- ACE_ENDTRY;
-}
-
-ACE_INLINE void
TAO_Notify_Consumer::push (const TAO_Notify_Event* event ACE_ENV_ARG_DECL)
{
if (this->is_suspended_ == 1) // If we're suspended, queue for later delivery.
{
ACE_GUARD (TAO_SYNCH_MUTEX, ace_mon, *this->proxy_lock ());
-
- TAO_Notify_Event* event_copy = event->copy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ const TAO_Notify_Event* event_copy = event->copy_on_heap (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
TAO_Notify_Event_Copy_var event_var (event_copy);
this->event_collection_->enqueue_head (event_var);
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Event.cpp b/TAO/orbsvcs/orbsvcs/Notify/Event.cpp
index b731ccf5f4d..74c3c8ddbeb 100644
--- a/TAO/orbsvcs/orbsvcs/Notify/Event.cpp
+++ b/TAO/orbsvcs/orbsvcs/Notify/Event.cpp
@@ -6,16 +6,21 @@
#include "Event.inl"
#endif /* __ACE_INLINE__ */
-ACE_RCSID (Notify,
- TAO_Notify_Event,
+ACE_RCSID (Notify,
+ TAO_Notify_Event,
"$Id$")
#include "tao/debug.h"
+#include "tao/CDR.h"
#include "orbsvcs/CosNotificationC.h"
+// NOTE: unfortunately we must know about derived types to implement unmarshal
+#include "Any/AnyEvent.h"
+#include "Structured/StructuredEvent.h"
TAO_Notify_Event::TAO_Notify_Event (void)
:priority_ (CosNotification::Priority, CosNotification::DefaultPriority),
- timeout_ (CosNotification::Timeout)
+ timeout_ (CosNotification::Timeout),
+ reliable_ (false)
{
// if (TAO_debug_level > 0)
// ACE_DEBUG ((LM_DEBUG,"event:%x created\n", this ));
@@ -26,6 +31,11 @@ TAO_Notify_Event::~TAO_Notify_Event ()
// if (TAO_debug_level > 1)
// ACE_DEBUG ((LM_DEBUG,"event:%x destroyed\n", this ));
}
+void
+TAO_Notify_Event::release (void)
+{
+ delete this;
+}
void
TAO_Notify_Event::translate (const CORBA::Any& any, CosNotification::StructuredEvent& notification)
@@ -40,11 +50,37 @@ TAO_Notify_Event::translate (const CosNotification::StructuredEvent& notificatio
{
any <<= notification; // is the typecode set by this operation or do we need to set it explicity.
}
+/// Unmarshal an event from a CDR. (for persistence)
+//static
+TAO_Notify_Event *
+TAO_Notify_Event::unmarshal (TAO_InputCDR & cdr)
+{
+ TAO_Notify_Event * result = 0;
+ ACE_CDR::Octet code = 0;
+ if (cdr.read_octet (code))
+ {
+ switch (code)
+ {
+ case MARSHAL_ANY:
+ result = TAO_Notify_AnyEvent::unmarshal (cdr);
+ break;
+ case MARSHAL_STRUCTURED:
+ result = TAO_Notify_StructuredEvent::unmarshal (cdr);
+ break;
+ default:
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT ("(%P|%t) TAO_Notify_Event::unmarshal: unknown event code %d\n"),
+ code));
+ break;
+ }
+ }
+ return result;
+}
#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION)
template class ACE_Auto_Basic_Ptr<TAO_Notify_Event>;
-template class ACE_Refcounted_Auto_Ptr<const TAO_Notify_Event, TAO_SYNCH_MUTEX>;
+template TAO_Notify_Refcountable_Guard_T<TAO_Notify_Event>;
template class ACE_Unbounded_Queue<TAO_Notify_Event_var>;
template class ACE_Node<TAO_Notify_Event_var>;
template class ACE_Unbounded_Queue_Iterator<TAO_Notify_Event_var>;
@@ -52,7 +88,7 @@ template class ACE_Unbounded_Queue_Iterator<TAO_Notify_Event_var>;
#elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA)
#pragma instantiate ACE_Auto_Basic_Ptr<TAO_Notify_Event>
-#pragma instantiate ACE_Refcounted_Auto_Ptr<const TAO_Notify_Event, TAO_SYNCH_MUTEX>
+#pragma instantiate TAO_Notify_Refcountable_Guard_T<TAO_Notify_Event>;
#pragma instantiate ACE_Unbounded_Queue<TAO_Notify_Event_var>
#pragma instantiate ACE_Node<TAO_Notify_Event_var>
#pragma instantiate ACE_Unbounded_Queue_Iterator<TAO_Notify_Event_var>
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Event.h b/TAO/orbsvcs/orbsvcs/Notify/Event.h
index 66a8c40bff3..58f0a7c5ebb 100644
--- a/TAO/orbsvcs/orbsvcs/Notify/Event.h
+++ b/TAO/orbsvcs/orbsvcs/Notify/Event.h
@@ -9,8 +9,8 @@
*
*/
-#ifndef TAO_Notify_EVENT_H
-#define TAO_Notify_EVENT_H
+#ifndef TAO_NOTIFY_EVENT_H
+#define TAO_NOTIFY_EVENT_H
#include /**/ "ace/pre.h"
@@ -21,13 +21,16 @@
#endif /* ACE_LACKS_PRAGMA_ONCE */
#include "ace/Copy_Disabled.h"
-#include "ace/Refcounted_Auto_Ptr.h"
+
+#include "Refcountable.h"
+#include "Refcountable_Guard_T.h"
#include "orbsvcs/Event_ForwarderS.h"
#include "orbsvcs/CosNotifyFilterC.h"
#include "orbsvcs/CosNotificationC.h"
#include "Property.h"
+#include "Property_Boolean.h"
#include "Property_T.h"
class TAO_Notify_Consumer;
@@ -39,17 +42,20 @@ class TAO_Notify_EventType;
* @brief Base class abstraction for Events flowing through the EventChannel.
*
*/
-class TAO_Notify_Serv_Export TAO_Notify_Event : private ACE_Copy_Disabled
+class TAO_Notify_Serv_Export TAO_Notify_Event
+ : public TAO_Notify_Refcountable
+ , private ACE_Copy_Disabled
{
public:
+ // Codes to distinguish marshaled events in persistent storage
+ enum {MARSHAL_ANY=1,MARSHAL_STRUCTURED=2};
/// Constuctor
TAO_Notify_Event (void);
/// Destructor
virtual ~TAO_Notify_Event ();
- /// Copy the event.
- virtual TAO_Notify_Event* copy (ACE_ENV_SINGLE_ARG_DECL) const = 0;
+ virtual void release (void);
/// Translate Any to Structured
static void translate (const CORBA::Any& any, CosNotification::StructuredEvent& notification);
@@ -81,6 +87,17 @@ public:
/// Push event to the Event_Forwarder interface
virtual void push_no_filtering (Event_Forwarder::ProxyPushSupplier_ptr forwarder ACE_ENV_ARG_DECL) const = 0;
+ /// Return a pointer to a copy of this event on the heap
+ /// Originals should make a copy to return.
+ /// Copies may return "this".
+ virtual const TAO_Notify_Event * copy_on_heap () const = 0;
+
+ /// marshal this event into a CDR buffer (for persistence)
+ virtual void marshal (TAO_OutputCDR & cdr) const = 0;
+
+ /// Unmarshal an event from a CDR. (for persistence)
+ static TAO_Notify_Event * unmarshal (TAO_InputCDR & cdr);
+
///= Accessors
/// Priority
const TAO_Notify_Property_Short& priority (void) const;
@@ -88,6 +105,9 @@ public:
/// Timeout
const TAO_Notify_Property_Time& timeout (void) const;
+ /// Reliable
+ const TAO_Notify_Property_Boolean& reliable(void) const;
+
protected:
/// = QoS properties
@@ -96,9 +116,14 @@ protected:
/// Timeout.
TAO_Notify_Property_Time timeout_;
+
+ /// Reliability
+ TAO_Notify_Property_Boolean reliable_;
};
-typedef ACE_Refcounted_Auto_Ptr<const TAO_Notify_Event, TAO_SYNCH_MUTEX> TAO_Notify_Event_var_Base;
+//typedef ACE_Refcounted_Auto_Ptr<const TAO_Notify_Event, TAO_SYNCH_MUTEX> TAO_Notify_Event_var_Base;
+
+typedef TAO_Notify_Refcountable_Guard_T<TAO_Notify_Event> TAO_Notify_Event_var_Base;
/**
* @class TAO_Notify_Event_var
@@ -114,7 +139,7 @@ public:
protected:
/// Constructor
- TAO_Notify_Event_var (TAO_Notify_Event* event);
+ TAO_Notify_Event_var (const TAO_Notify_Event* event);
};
/**
@@ -130,7 +155,7 @@ public:
TAO_Notify_Event_Copy_var (void);
/// Constructor
- TAO_Notify_Event_Copy_var (TAO_Notify_Event* event);
+ TAO_Notify_Event_Copy_var (const TAO_Notify_Event* event);
};
typedef ACE_Unbounded_Queue<TAO_Notify_Event_var> TAO_Notify_Event_Collection;
@@ -141,4 +166,4 @@ typedef ACE_Unbounded_Queue<TAO_Notify_Event_var> TAO_Notify_Event_Collection;
#include /**/ "ace/post.h"
-#endif /* TAO_Notify_EVENT_H */
+#endif /* TAO_NOTIFY_EVENT_H */
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Event.inl b/TAO/orbsvcs/orbsvcs/Notify/Event.inl
index 02006440911..b83560f1181 100644
--- a/TAO/orbsvcs/orbsvcs/Notify/Event.inl
+++ b/TAO/orbsvcs/orbsvcs/Notify/Event.inl
@@ -12,6 +12,12 @@ TAO_Notify_Event::timeout (void) const
return this->timeout_;
}
+ACE_INLINE const TAO_Notify_Property_Boolean&
+TAO_Notify_Event::reliable (void) const
+{
+ return this->reliable_;
+}
+
/**********************************************************/
ACE_INLINE
@@ -21,8 +27,8 @@ TAO_Notify_Event_var::TAO_Notify_Event_var (void)
}
ACE_INLINE
-TAO_Notify_Event_var::TAO_Notify_Event_var (TAO_Notify_Event* event)
- : TAO_Notify_Event_var_Base (event)
+TAO_Notify_Event_var::TAO_Notify_Event_var (const TAO_Notify_Event* event)
+ : TAO_Notify_Event_var_Base (const_cast <TAO_Notify_Event *>(event))
{
}
@@ -35,7 +41,7 @@ TAO_Notify_Event_Copy_var::TAO_Notify_Event_Copy_var (void)
}
ACE_INLINE
-TAO_Notify_Event_Copy_var::TAO_Notify_Event_Copy_var (TAO_Notify_Event* event)
+TAO_Notify_Event_Copy_var::TAO_Notify_Event_Copy_var (const TAO_Notify_Event* event)
: TAO_Notify_Event_var (event)
{
}
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Dispatch.cpp b/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Dispatch.cpp
index 4322dbc6f29..9a642718e6d 100644
--- a/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Dispatch.cpp
+++ b/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Dispatch.cpp
@@ -15,7 +15,9 @@ ACE_RCSID(Notify, TAO_Notify_Method_Request_Dispatch, "$Id$")
#include "ConsumerAdmin.h"
TAO_Notify_Method_Request_Dispatch::TAO_Notify_Method_Request_Dispatch (const TAO_Notify_Event_var& event, TAO_Notify_ProxySupplier* proxy_supplier, CORBA::Boolean filtering)
- : TAO_Notify_Method_Request_Dispatch_Base (event, proxy_supplier, filtering)
+ : TAO_Notify_Method_Request_Dispatch_Base (event.get(), proxy_supplier, filtering)
+ , event_var_ (event)
+ , proxy_guard_ (proxy_supplier)
{
this->init (event);
}
@@ -33,7 +35,7 @@ TAO_Notify_Method_Request_Dispatch::execute (ACE_ENV_SINGLE_ARG_DECL)
/*********************************************************************************************************/
TAO_Notify_Method_Request_Dispatch_No_Copy::TAO_Notify_Method_Request_Dispatch_No_Copy (const TAO_Notify_Event* event, TAO_Notify_ProxySupplier* proxy_supplier, CORBA::Boolean filtering)
- : TAO_Notify_Method_Request_Dispatch_No_Copy_Base (event, proxy_supplier, filtering)
+ : TAO_Notify_Method_Request_Dispatch_Base (event, proxy_supplier, filtering)
{
}
@@ -52,7 +54,7 @@ TAO_Notify_Method_Request_Dispatch_No_Copy::copy (ACE_ENV_SINGLE_ARG_DECL)
{
TAO_Notify_Method_Request* request;
- TAO_Notify_Event* event_copy = this->event_->copy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ const TAO_Notify_Event * event_copy = this->event_->copy_on_heap (ACE_ENV_SINGLE_ARG_PARAMETER);
ACE_CHECK_RETURN (0);
TAO_Notify_Event_Copy_var event_var (event_copy);
@@ -67,7 +69,8 @@ TAO_Notify_Method_Request_Dispatch_No_Copy::copy (ACE_ENV_SINGLE_ARG_DECL)
/*********************************************************************************************************/
TAO_Notify_Method_Request_Dispatch_No_Copy_Ex::TAO_Notify_Method_Request_Dispatch_No_Copy_Ex (const TAO_Notify_Event_var& event, TAO_Notify_ProxySupplier* proxy_supplier, CORBA::Boolean filtering)
- : TAO_Notify_Method_Request_Dispatch_No_Copy_Ex_Base (event, proxy_supplier, filtering)
+ : TAO_Notify_Method_Request_Dispatch_Base (event.get (), proxy_supplier, filtering)
+ , event_var_ (event)
{
}
@@ -87,7 +90,10 @@ TAO_Notify_Method_Request_Dispatch_No_Copy_Ex::copy (ACE_ENV_SINGLE_ARG_DECL)
TAO_Notify_Method_Request* request;
ACE_NEW_THROW_EX (request,
- TAO_Notify_Method_Request_Dispatch (this->event_, this->proxy_supplier_, this->filtering_),
+ TAO_Notify_Method_Request_Dispatch (
+ this->event_var_,
+ this->proxy_supplier_,
+ this->filtering_),
CORBA::INTERNAL ());
return request;
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Dispatch.h b/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Dispatch.h
index 156dadf13e9..f4aaa24a238 100644
--- a/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Dispatch.h
+++ b/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Dispatch.h
@@ -21,7 +21,8 @@
#include "Method_Request.h"
#include "Refcountable.h"
-#include "Method_Request_Dispatch_T.h"
+//#include "Method_Request_Dispatch_T.h"
+#include "Method_Request_Dispatch_Base.h"
#include "ProxySupplier.h"
/**
@@ -31,13 +32,9 @@
*
*/
-typedef TAO_Notify_Method_Request_Dispatch_T<const TAO_Notify_Event_var
- , TAO_Notify_ProxySupplier_Guard
- , const TAO_Notify_Event_var&
- , TAO_Notify_ProxySupplier*> TAO_Notify_Method_Request_Dispatch_Base;
-
-class TAO_Notify_Serv_Export TAO_Notify_Method_Request_Dispatch : public TAO_Notify_Method_Request_Dispatch_Base
- , public TAO_Notify_Method_Request
+class TAO_Notify_Serv_Export TAO_Notify_Method_Request_Dispatch
+ : public TAO_Notify_Method_Request_Dispatch_Base
+ , public TAO_Notify_Method_Request
{
public:
/// Constuctor
@@ -48,6 +45,9 @@ public:
/// Execute the Request
virtual int execute (ACE_ENV_SINGLE_ARG_DECL);
+private:
+ const TAO_Notify_Event_var event_var_;
+ TAO_Notify_ProxySupplier_Guard proxy_guard_;
};
/*******************************************************************************************************/
@@ -58,14 +58,9 @@ public:
* @brief Dispatchs an event to a proxy supplier.
*
*/
-
-typedef TAO_Notify_Method_Request_Dispatch_T<const TAO_Notify_Event*
- , TAO_Notify_ProxySupplier*
- , const TAO_Notify_Event*
- , TAO_Notify_ProxySupplier*> TAO_Notify_Method_Request_Dispatch_No_Copy_Base;
-
-class TAO_Notify_Serv_Export TAO_Notify_Method_Request_Dispatch_No_Copy : public TAO_Notify_Method_Request_Dispatch_No_Copy_Base
- , public TAO_Notify_Method_Request_No_Copy
+class TAO_Notify_Serv_Export TAO_Notify_Method_Request_Dispatch_No_Copy
+ : public TAO_Notify_Method_Request_Dispatch_Base
+ , public TAO_Notify_Method_Request_No_Copy
{
public:
/// Constuctor
@@ -90,13 +85,9 @@ public:
*
*/
-typedef TAO_Notify_Method_Request_Dispatch_T<const TAO_Notify_Event_var&
- , TAO_Notify_ProxySupplier*
- , const TAO_Notify_Event_var&
- , TAO_Notify_ProxySupplier*> TAO_Notify_Method_Request_Dispatch_No_Copy_Ex_Base;
-
-class TAO_Notify_Serv_Export TAO_Notify_Method_Request_Dispatch_No_Copy_Ex : public TAO_Notify_Method_Request_Dispatch_No_Copy_Ex_Base
- , public TAO_Notify_Method_Request_No_Copy
+class TAO_Notify_Serv_Export TAO_Notify_Method_Request_Dispatch_No_Copy_Ex
+ : public TAO_Notify_Method_Request_Dispatch_Base
+ , public TAO_Notify_Method_Request_No_Copy
{
public:
/// Constuctor
@@ -110,6 +101,8 @@ public:
/// Create a copy of this object.
virtual TAO_Notify_Method_Request* copy (ACE_ENV_SINGLE_ARG_DECL);
+private:
+ const TAO_Notify_Event_var& event_var_;
};
#if defined (__ACE_INLINE__)
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Dispatch_T.inl b/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Dispatch_Base.cpp
index 948d2595e1a..b3c6f5d75bd 100644
--- a/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Dispatch_T.inl
+++ b/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Dispatch_Base.cpp
@@ -1,11 +1,36 @@
// $Id$
+#include "Method_Request_Dispatch_Base.h"
-#include "Admin.h"
+#if ! defined (__ACE_INLINE__)
+#include "Method_Request_Dispatch_Base.inl"
+#endif /* __ACE_INLINE__ */
+
+#include "ConsumerAdmin.h"
#include "Consumer.h"
+#include "ProxySupplier.h"
+
#include "tao/debug.h"
-template <class EVENT, class PROXY, class EVENT_PARAM, class PROXY_PARAM> ACE_INLINE int
-TAO_Notify_Method_Request_Dispatch_T<EVENT, PROXY, EVENT_PARAM, PROXY_PARAM>::execute_i (ACE_ENV_SINGLE_ARG_DECL)
+ACE_RCSID (Notify,
+ TAO_Notify_Method_Request_Dispatch_Base,
+ "$Id$")
+
+
+TAO_Notify_Method_Request_Dispatch_Base::TAO_Notify_Method_Request_Dispatch_Base (
+ const TAO_Notify_Event * event,
+ TAO_Notify_ProxySupplier* proxy_supplier,
+ bool filtering)
+ : event_ (event)
+ , proxy_supplier_ (proxy_supplier)
+ , filtering_ (filtering)
+{
+}
+
+TAO_Notify_Method_Request_Dispatch_Base::~TAO_Notify_Method_Request_Dispatch_Base ()
+{
+}
+
+TAO_Notify_Method_Request_Dispatch_Base::execute_i (ACE_ENV_SINGLE_ARG_DECL)
{
if (this->proxy_supplier_->has_shutdown ())
return 0; // If we were shutdown while waiting in the queue, return with no action.
@@ -13,7 +38,6 @@ TAO_Notify_Method_Request_Dispatch_T<EVENT, PROXY, EVENT_PARAM, PROXY_PARAM>::ex
if (this->filtering_ == 1)
{
TAO_Notify_Admin* parent = this->proxy_supplier_->consumer_admin ();
-
CORBA::Boolean val = this->proxy_supplier_->check_filters (this->event_,
parent->filter_admin (),
parent->filter_operator ()
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Dispatch_Base.h b/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Dispatch_Base.h
new file mode 100644
index 00000000000..6a20e2ff89f
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Dispatch_Base.h
@@ -0,0 +1,67 @@
+/* -*- C++ -*- */
+/**
+ * @file Method_Request_Dispatch_Base.h
+ *
+ * $Id$
+ *
+ * @author Pradeep Gore <pradeep@oomworks.com>
+ *
+ *
+ */
+
+#ifndef TAO_Notify_METHOD_REQUEST_DISPATCH_BASE_H
+#define TAO_Notify_METHOD_REQUEST_DISPATCH_BASE_H
+
+#include /**/ "ace/pre.h"
+
+#include "notify_serv_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "tao/Basic_Types.h"
+
+#include "ace/CORBA_macros.h"
+#include "ProxySupplier.h"
+
+class TAO_Notify_Event;
+
+/**
+ * @class TAO_Notify_Method_Request_Dispatch_Base
+ *
+ * @brief
+ *
+ */
+class TAO_Notify_Method_Request_Dispatch_Base
+{
+public:
+ /// Constuctor
+ TAO_Notify_Method_Request_Dispatch_Base (const TAO_Notify_Event *,
+ TAO_Notify_ProxySupplier* proxy,
+ bool filtering);
+
+ /// Destructor
+ virtual ~TAO_Notify_Method_Request_Dispatch_Base ();
+
+ /// Execute the dispatch operation.
+ int execute_i (ACE_ENV_SINGLE_ARG_DECL);
+
+protected:
+ /// The Event
+ const TAO_Notify_Event * event_;
+
+ /// The Proxy
+ TAO_Notify_ProxySupplier * proxy_supplier_;
+// TAO_Notify_ProxySupplier_Guard proxy_supplier_;
+ /// Flag is true if we want to do fintering else false.
+ bool filtering_;
+};
+
+#if defined (__ACE_INLINE__)
+#include "Method_Request_Dispatch_Base.inl"
+#endif /* __ACE_INLINE__ */
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_Notify_METHOD_REQUEST_DISPATCH_BASE_H */
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Dispatch_Base.inl b/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Dispatch_Base.inl
new file mode 100644
index 00000000000..74e88caa0c5
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Dispatch_Base.inl
@@ -0,0 +1,2 @@
+// $Id$
+
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Dispatch_T.cpp b/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Dispatch_T.cpp
deleted file mode 100644
index 4fc841ccc78..00000000000
--- a/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Dispatch_T.cpp
+++ /dev/null
@@ -1,27 +0,0 @@
-// $Id$
-#ifndef TAO_Notify_Method_Request_Dispatch_T_CPP
-#define TAO_Notify_Method_Request_Dispatch_T_CPP
-
-#include "Method_Request_Dispatch_T.h"
-
-#if ! defined (__ACE_INLINE__)
-#include "Method_Request_Dispatch_T.inl"
-#endif /* __ACE_INLINE__ */
-
-ACE_RCSID (Notify,
- TAO_Notify_Method_Request_Dispatch_T,
- "$Id$")
-
-
-template <class EVENT, class PROXY, class EVENT_PARAM, class PROXY_PARAM>
-TAO_Notify_Method_Request_Dispatch_T<EVENT, PROXY, EVENT_PARAM, PROXY_PARAM>::TAO_Notify_Method_Request_Dispatch_T (EVENT_PARAM event, PROXY_PARAM proxy_supplier, CORBA::Boolean filtering)
- :event_ (event), proxy_supplier_ (proxy_supplier), filtering_ (filtering)
-{
-}
-
-template <class EVENT, class PROXY, class EVENT_PARAM, class PROXY_PARAM>
-TAO_Notify_Method_Request_Dispatch_T<EVENT, PROXY, EVENT_PARAM, PROXY_PARAM>::~TAO_Notify_Method_Request_Dispatch_T ()
-{
-}
-
-#endif /* TAO_Notify_Method_Request_Dispatch_T_CPP */
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Dispatch_T.h b/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Dispatch_T.h
deleted file mode 100644
index 961db8c576b..00000000000
--- a/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Dispatch_T.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/* -*- C++ -*- */
-/**
- * @file Method_Request_Dispatch_T.h
- *
- * $Id$
- *
- * @author Pradeep Gore <pradeep@oomworks.com>
- *
- *
- */
-
-#ifndef TAO_Notify_METHOD_REQUEST_DISPATCH_T_H
-#define TAO_Notify_METHOD_REQUEST_DISPATCH_T_H
-
-#include /**/ "ace/pre.h"
-
-#include "notify_serv_export.h"
-
-#if !defined (ACE_LACKS_PRAGMA_ONCE)
-# pragma once
-#endif /* ACE_LACKS_PRAGMA_ONCE */
-
-#include "tao/Basic_Types.h"
-
-#include "ace/CORBA_macros.h"
-
-/**
- * @class TAO_Notify_Method_Request_Dispatch_T
- *
- * @brief
- *
- */
-template <class EVENT, class PROXY, class EVENT_PARAM, class PROXY_PARAM>
-class TAO_Notify_Method_Request_Dispatch_T
-{
-public:
- /// Constuctor
- TAO_Notify_Method_Request_Dispatch_T (EVENT_PARAM event,
- PROXY_PARAM proxy,
- CORBA::Boolean filtering);
-
- /// Destructor
- virtual ~TAO_Notify_Method_Request_Dispatch_T ();
-
- /// Execute the dispatch operation.
- int execute_i (ACE_ENV_SINGLE_ARG_DECL);
-
-protected:
- /// The Event
- EVENT event_;
-
- /// The Proxy
- PROXY proxy_supplier_;
-
- /// Flag is true if we want to do fintering else false.
- CORBA::Boolean filtering_;
-};
-
-#if defined (__ACE_INLINE__)
-#include "Method_Request_Dispatch_T.inl"
-#endif /* __ACE_INLINE__ */
-
-#if defined (ACE_TEMPLATES_REQUIRE_SOURCE)
-#include "Method_Request_Dispatch_T.cpp"
-#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */
-
-#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA)
-#pragma implementation ("Method_Request_Dispatch_T.cpp")
-#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */
-
-#include /**/ "ace/post.h"
-
-#endif /* TAO_Notify_METHOD_REQUEST_DISPATCH_T_H */
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Lookup.cpp b/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Lookup.cpp
index a99adabdb47..0423093cf12 100644
--- a/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Lookup.cpp
+++ b/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Lookup.cpp
@@ -16,8 +16,12 @@ ACE_RCSID(Notify, TAO_Notify_Method_Request_Lookup, "$Id$")
#include "Admin.h"
#include "SupplierAdmin.h"
-TAO_Notify_Method_Request_Lookup::TAO_Notify_Method_Request_Lookup (const TAO_Notify_Event_var& event, TAO_Notify_ProxyConsumer* proxy_consumer)
- : TAO_Notify_Method_Request_Lookup_Base (event, proxy_consumer)
+TAO_Notify_Method_Request_Lookup::TAO_Notify_Method_Request_Lookup (
+ const TAO_Notify_Event_var& event,
+ TAO_Notify_ProxyConsumer* proxy_consumer)
+ : TAO_Notify_Method_Request_Lookup_Base (event.get (), proxy_consumer)
+ , event_var_ (event)
+ , proxy_guard_ (proxy_consumer)
{
this->init (event);
}
@@ -34,8 +38,10 @@ TAO_Notify_Method_Request_Lookup::execute (ACE_ENV_SINGLE_ARG_DECL)
/******************************************************************************************************/
-TAO_Notify_Method_Request_Lookup_No_Copy::TAO_Notify_Method_Request_Lookup_No_Copy (const TAO_Notify_Event* event, TAO_Notify_ProxyConsumer* proxy_consumer)
- : TAO_Notify_Method_Request_Lookup_No_Copy_Base (event, proxy_consumer)
+TAO_Notify_Method_Request_Lookup_No_Copy::TAO_Notify_Method_Request_Lookup_No_Copy (
+ const TAO_Notify_Event* event,
+ TAO_Notify_ProxyConsumer* proxy_consumer)
+ : TAO_Notify_Method_Request_Lookup_Base (event, proxy_consumer)
{
}
@@ -54,7 +60,7 @@ TAO_Notify_Method_Request_Lookup_No_Copy::copy (ACE_ENV_SINGLE_ARG_DECL)
{
TAO_Notify_Method_Request* request;
- TAO_Notify_Event* event_copy = this->event_->copy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ const TAO_Notify_Event* event_copy = this->event_->copy_on_heap (ACE_ENV_SINGLE_ARG_PARAMETER);
ACE_CHECK_RETURN (0);
TAO_Notify_Event_Copy_var event_var (event_copy);
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Lookup.h b/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Lookup.h
index 42bb57b38e7..0329a89d2fb 100644
--- a/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Lookup.h
+++ b/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Lookup.h
@@ -23,14 +23,16 @@
#include "Method_Request.h"
#include "ProxyConsumer.h"
#include "Consumer_Map.h"
-#include "Method_Request_Lookup_T.h"
+//#include "Method_Request_Lookup_T.h"
+#include "Method_Request_Lookup_Base.h"
class TAO_Notify_ProxyConsumer;
-
+#if 0
typedef TAO_Notify_Method_Request_Lookup_T<const TAO_Notify_Event_var
, TAO_Notify_ProxyConsumer_Guard
, const TAO_Notify_Event_var&
, TAO_Notify_ProxyConsumer*> TAO_Notify_Method_Request_Lookup_Base;
+#endif
/**
* @class TAO_Notify_Method_Request_Lookup
@@ -38,26 +40,35 @@ typedef TAO_Notify_Method_Request_Lookup_T<const TAO_Notify_Event_var
* @brief Lookup command object looks up the event type of the given event in the consumer map and send the event to each proxysupplier.
*
*/
-class TAO_Notify_Serv_Export TAO_Notify_Method_Request_Lookup : public TAO_Notify_Method_Request_Lookup_Base
- , public TAO_Notify_Method_Request
+class TAO_Notify_Serv_Export TAO_Notify_Method_Request_Lookup
+ : public TAO_Notify_Method_Request_Lookup_Base
+ , public TAO_Notify_Method_Request
{
public:
/// Constuctor
- TAO_Notify_Method_Request_Lookup (const TAO_Notify_Event_var& event, TAO_Notify_ProxyConsumer* proxy_consumer);
+ TAO_Notify_Method_Request_Lookup (
+ const TAO_Notify_Event_var& event,
+ TAO_Notify_ProxyConsumer* proxy_consumer);
/// Destructor
~TAO_Notify_Method_Request_Lookup ();
/// Execute the Request
virtual int execute (ACE_ENV_SINGLE_ARG_DECL);
+
+private:
+ const TAO_Notify_Event_var event_var_;
+ TAO_Notify_ProxyConsumer_Guard proxy_guard_;
};
/*****************************************************************************************************************************/
+#if 0
typedef TAO_Notify_Method_Request_Lookup_T<const TAO_Notify_Event*
, TAO_Notify_ProxyConsumer*
, const TAO_Notify_Event*
, TAO_Notify_ProxyConsumer*> TAO_Notify_Method_Request_Lookup_No_Copy_Base;
+#endif
/**
* @class TAO_Notify_Method_Request_Lookup_No_Copy
@@ -65,12 +76,15 @@ typedef TAO_Notify_Method_Request_Lookup_T<const TAO_Notify_Event*
* @brief Lookup command object looks up the event type of the given event in the consumer map and send the event to each proxysupplier.
*
*/
-class TAO_Notify_Serv_Export TAO_Notify_Method_Request_Lookup_No_Copy : public TAO_Notify_Method_Request_Lookup_No_Copy_Base
- , public TAO_Notify_Method_Request_No_Copy
+class TAO_Notify_Serv_Export TAO_Notify_Method_Request_Lookup_No_Copy
+ : public TAO_Notify_Method_Request_Lookup_Base
+ , public TAO_Notify_Method_Request_No_Copy
{
public:
/// Constuctor
- TAO_Notify_Method_Request_Lookup_No_Copy (const TAO_Notify_Event* event, TAO_Notify_ProxyConsumer* proxy_consumer);
+ TAO_Notify_Method_Request_Lookup_No_Copy (
+ const TAO_Notify_Event* event,
+ TAO_Notify_ProxyConsumer* proxy_consumer);
/// Destructor
~TAO_Notify_Method_Request_Lookup_No_Copy ();
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Lookup_T.inl b/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Lookup_Base.cpp
index 4367a6ca8e8..cdc295a564c 100644
--- a/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Lookup_T.inl
+++ b/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Lookup_Base.cpp
@@ -1,15 +1,45 @@
// $Id$
+#include "Method_Request_Lookup_Base.h"
+
+#if ! defined (__ACE_INLINE__)
+#include "Method_Request_Lookup_Base.inl"
+#endif /* __ACE_INLINE__ */
+
+ACE_RCSID (Notify, TAO_Notify_Method_Request_Lookup_Base, "$Id$")
+
#include "tao/debug.h"
#include "Event_Manager.h"
+#include "ProxyConsumer.h"
+#include "SupplierAdmin.h"
+#include "Consumer_Map.h"
+
+TAO_Notify_Method_Request_Lookup_Base::TAO_Notify_Method_Request_Lookup_Base (
+ const TAO_Notify_Event * event,
+ TAO_Notify_ProxyConsumer * proxy)
+ : event_ (event)
+ , proxy_consumer_ (proxy)
+{
+}
+
+TAO_Notify_Method_Request_Lookup_Base::~TAO_Notify_Method_Request_Lookup_Base ()
+{
+}
+
+void
+TAO_Notify_Method_Request_Lookup_Base::work (
+ TAO_Notify_ProxySupplier* proxy_supplier
+ ACE_ENV_ARG_DECL)
+{
+ proxy_supplier->push (this->event_, true ACE_ENV_ARG_PARAMETER);
+}
-template <class EVENT, class PROXY, class EVENT_PARAM, class PROXY_PARAM> ACE_INLINE int
-TAO_Notify_Method_Request_Lookup_T<EVENT, PROXY, EVENT_PARAM, PROXY_PARAM>::execute_i (ACE_ENV_SINGLE_ARG_DECL)
+TAO_Notify_Method_Request_Lookup_Base::execute_i (ACE_ENV_SINGLE_ARG_DECL)
{
if (this->proxy_consumer_->has_shutdown ())
return 0; // If we were shutdown while waiting in the queue, return with no action.
- TAO_Notify_Admin* parent = this->proxy_consumer_->supplier_admin ();
+ TAO_Notify_SupplierAdmin* parent = this->proxy_consumer_->supplier_admin ();
CORBA::Boolean val = this->proxy_consumer_->check_filters (this->event_,
parent->filter_admin (),
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Lookup_Base.h b/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Lookup_Base.h
new file mode 100644
index 00000000000..55aebf3eabf
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Lookup_Base.h
@@ -0,0 +1,62 @@
+/* -*- C++ -*- */
+/**
+ * @file Method_Request_Lookup_Base.h
+ *
+ * $Id$
+ *
+ * @author Pradeep Gore <pradeep@oomworks.com>
+ *
+ *
+ */
+
+#ifndef TAO_Notify_METHOD_REQUEST_LOOKUP_BASE_H
+#define TAO_Notify_METHOD_REQUEST_LOOKUP_BASE_H
+#include /**/ "ace/pre.h"
+
+#include "notify_serv_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/ESF/ESF_Worker.h"
+#include "ProxySupplier.h"
+class TAO_Notify_Event;
+class TAO_Notify_ProxyConsumer;
+
+/**
+ * @class TAO_Notify_Method_Request_Lookup_Base
+ *
+ * @brief
+ *
+ */
+class TAO_Notify_Serv_Export TAO_Notify_Method_Request_Lookup_Base
+ : public TAO_ESF_Worker<TAO_Notify_ProxySupplier>
+{
+public:
+ /// Constuctor
+ TAO_Notify_Method_Request_Lookup_Base (const TAO_Notify_Event * event, TAO_Notify_ProxyConsumer * proxy);
+
+ /// Destructor
+ virtual ~TAO_Notify_Method_Request_Lookup_Base ();
+
+ /// Execute the dispatch operation.
+ int execute_i (ACE_ENV_SINGLE_ARG_DECL);
+
+protected:
+ ///= TAO_ESF_Worker method
+ virtual void work (TAO_Notify_ProxySupplier* proxy_supplier ACE_ENV_ARG_DECL);
+
+ /// The Event
+ const TAO_Notify_Event * event_;
+
+ /// The Proxy
+ TAO_Notify_ProxyConsumer* proxy_consumer_;
+};
+
+#if defined (__ACE_INLINE__)
+#include "Method_Request_Lookup_Base.inl"
+#endif /* __ACE_INLINE__ */
+
+#include /**/ "ace/post.h"
+#endif /* TAO_Notify_METHOD_REQUEST_LOOKUP_BASE_H */
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Lookup_Base.inl b/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Lookup_Base.inl
new file mode 100644
index 00000000000..74e88caa0c5
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Lookup_Base.inl
@@ -0,0 +1,2 @@
+// $Id$
+
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Lookup_T.cpp b/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Lookup_T.cpp
deleted file mode 100644
index 9492aba6155..00000000000
--- a/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Lookup_T.cpp
+++ /dev/null
@@ -1,31 +0,0 @@
-// $Id$
-#ifndef TAO_Notify_Method_Request_Lookup_T_CPP
-#define TAO_Notify_Method_Request_Lookup_T_CPP
-
-#include "Method_Request_Lookup_T.h"
-
-#if ! defined (__ACE_INLINE__)
-#include "Method_Request_Lookup_T.inl"
-#endif /* __ACE_INLINE__ */
-
-ACE_RCSID (Notify, TAO_Notify_Method_Request_Lookup_T, "$Id$")
-
-template <class EVENT, class PROXY, class EVENT_PARAM, class PROXY_PARAM>
-TAO_Notify_Method_Request_Lookup_T<EVENT, PROXY, EVENT_PARAM, PROXY_PARAM>::TAO_Notify_Method_Request_Lookup_T (EVENT_PARAM event, PROXY_PARAM proxy_consumer)
- :event_ (event), proxy_consumer_ (proxy_consumer)
-{
-}
-
-template <class EVENT, class PROXY, class EVENT_PARAM, class PROXY_PARAM>
-TAO_Notify_Method_Request_Lookup_T<EVENT, PROXY, EVENT_PARAM, PROXY_PARAM>::~TAO_Notify_Method_Request_Lookup_T ()
-{
-}
-
-
-template <class EVENT, class PROXY, class EVENT_PARAM, class PROXY_PARAM> void
-TAO_Notify_Method_Request_Lookup_T<EVENT, PROXY, EVENT_PARAM, PROXY_PARAM>::work (TAO_Notify_ProxySupplier* proxy_supplier ACE_ENV_ARG_DECL)
-{
- proxy_supplier->push (this->event_ ACE_ENV_ARG_PARAMETER);
-}
-
-#endif /* TAO_Notify_Method_Request_Lookup_T_CPP */
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Lookup_T.h b/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Lookup_T.h
deleted file mode 100644
index f9f830b5d3e..00000000000
--- a/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Lookup_T.h
+++ /dev/null
@@ -1,68 +0,0 @@
-/* -*- C++ -*- */
-/**
- * @file Method_Request_Lookup_T.h
- *
- * $Id$
- *
- * @author Pradeep Gore <pradeep@oomworks.com>
- *
- *
- */
-
-#ifndef TAO_Notify_METHOD_REQUEST_LOOKUP_T_H
-#define TAO_Notify_METHOD_REQUEST_LOOKUP_T_H
-#include /**/ "ace/pre.h"
-
-#include "notify_serv_export.h"
-
-#if !defined (ACE_LACKS_PRAGMA_ONCE)
-# pragma once
-#endif /* ACE_LACKS_PRAGMA_ONCE */
-
-#include "orbsvcs/ESF/ESF_Worker.h"
-#include "ProxySupplier.h"
-
-/**
- * @class TAO_Notify_Method_Request_Lookup_T
- *
- * @brief
- *
- */
-template <class EVENT, class PROXY, class EVENT_PARAM, class PROXY_PARAM>
-class TAO_Notify_Serv_Export TAO_Notify_Method_Request_Lookup_T : public TAO_ESF_Worker<TAO_Notify_ProxySupplier>
-{
-public:
- /// Constuctor
- TAO_Notify_Method_Request_Lookup_T (EVENT_PARAM event, PROXY_PARAM proxy);
-
- /// Destructor
- virtual ~TAO_Notify_Method_Request_Lookup_T ();
-
- /// Execute the dispatch operation.
- int execute_i (ACE_ENV_SINGLE_ARG_DECL);
-
-protected:
- ///= TAO_ESF_Worker method
- virtual void work (TAO_Notify_ProxySupplier* proxy_supplier ACE_ENV_ARG_DECL);
-
- /// The Event
- EVENT event_;
-
- /// The Proxy
- PROXY proxy_consumer_;
-};
-
-#if defined (__ACE_INLINE__)
-#include "Method_Request_Lookup_T.inl"
-#endif /* __ACE_INLINE__ */
-
-#if defined (ACE_TEMPLATES_REQUIRE_SOURCE)
-#include "Method_Request_Lookup_T.cpp"
-#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */
-
-#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA)
-#pragma implementation ("Method_Request_Lookup_T.cpp")
-#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */
-
-#include /**/ "ace/post.h"
-#endif /* TAO_Notify_METHOD_REQUEST_LOOKUP_T_H */
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Proxy.h b/TAO/orbsvcs/orbsvcs/Notify/Proxy.h
index 69015ddb0c2..e714e6e3a5c 100644
--- a/TAO/orbsvcs/orbsvcs/Notify/Proxy.h
+++ b/TAO/orbsvcs/orbsvcs/Notify/Proxy.h
@@ -75,14 +75,6 @@ public:
ACE_ENV_ARG_DECL
);
- /// Check if this event passes the admin and proxy filters.
- CORBA::Boolean check_filters (
- const TAO_Notify_Event_var &event,
- TAO_Notify_FilterAdmin& parent_filter_admin,
- CosNotifyChannelAdmin::InterFilterGroupOperator filter_operator
- ACE_ENV_ARG_DECL
- );
-
/// Inform this proxy that the following types are being advertised.
void types_changed (const TAO_Notify_EventTypeSeq& added,
const TAO_Notify_EventTypeSeq& removed
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Proxy.inl b/TAO/orbsvcs/orbsvcs/Notify/Proxy.inl
index e7bcc8907f5..ef84390455c 100644
--- a/TAO/orbsvcs/orbsvcs/Notify/Proxy.inl
+++ b/TAO/orbsvcs/orbsvcs/Notify/Proxy.inl
@@ -7,15 +7,6 @@ TAO_Notify_Proxy::updates_off (void)
}
ACE_INLINE CORBA::Boolean
-TAO_Notify_Proxy::check_filters (const TAO_Notify_Event_var &event
- , TAO_Notify_FilterAdmin& parent_filter_admin
- , CosNotifyChannelAdmin::InterFilterGroupOperator filter_operator
- ACE_ENV_ARG_DECL)
-{
- return this->check_filters (event.get (), parent_filter_admin, filter_operator ACE_ENV_ARG_PARAMETER);
-}
-
-ACE_INLINE CORBA::Boolean
TAO_Notify_Proxy::check_filters (const TAO_Notify_Event* event
, TAO_Notify_FilterAdmin& parent_filter_admin
, CosNotifyChannelAdmin::InterFilterGroupOperator filter_operator
diff --git a/TAO/orbsvcs/orbsvcs/Notify/ProxySupplier.cpp b/TAO/orbsvcs/orbsvcs/Notify/ProxySupplier.cpp
index 1b4049662c1..4352de38029 100644
--- a/TAO/orbsvcs/orbsvcs/Notify/ProxySupplier.cpp
+++ b/TAO/orbsvcs/orbsvcs/Notify/ProxySupplier.cpp
@@ -151,34 +151,9 @@ TAO_Notify_ProxySupplier::destroy (ACE_ENV_SINGLE_ARG_DECL)
}
void
-TAO_Notify_ProxySupplier::push (const TAO_Notify_Event* event ACE_ENV_ARG_DECL)
+TAO_Notify_ProxySupplier::push (const TAO_Notify_Event* event, bool filter ACE_ENV_ARG_DECL)
{
- TAO_Notify_Method_Request_Dispatch_No_Copy request (event, this, 1);
-
- this->worker_task ()->execute (request ACE_ENV_ARG_PARAMETER);
-}
-
-void
-TAO_Notify_ProxySupplier::push (const TAO_Notify_Event_var &event ACE_ENV_ARG_DECL)
-{
- TAO_Notify_Method_Request_Dispatch_No_Copy_Ex request (event, this, 1);
-
- this->worker_task ()->execute (request ACE_ENV_ARG_PARAMETER);
-}
-
-void
-TAO_Notify_ProxySupplier::push_no_filtering (const TAO_Notify_Event* event ACE_ENV_ARG_DECL)
-{
- TAO_Notify_Method_Request_Dispatch_No_Copy request (event, this, 0); // No filtering.
-
- this->worker_task ()->execute (request ACE_ENV_ARG_PARAMETER);
-}
-
-void
-TAO_Notify_ProxySupplier::push_no_filtering (const TAO_Notify_Event_var &event ACE_ENV_ARG_DECL)
-{
- TAO_Notify_Method_Request_Dispatch_No_Copy_Ex request (event, this, 0); // No filtering.
-
+ TAO_Notify_Method_Request_Dispatch_No_Copy request (event, this, filter);
this->worker_task ()->execute (request ACE_ENV_ARG_PARAMETER);
}
diff --git a/TAO/orbsvcs/orbsvcs/Notify/ProxySupplier.h b/TAO/orbsvcs/orbsvcs/Notify/ProxySupplier.h
index 903c476b5b1..8a317a08d36 100644
--- a/TAO/orbsvcs/orbsvcs/Notify/ProxySupplier.h
+++ b/TAO/orbsvcs/orbsvcs/Notify/ProxySupplier.h
@@ -57,16 +57,16 @@ public:
void disconnect (ACE_ENV_SINGLE_ARG_DECL);
/// Dispatch Event to consumer
- virtual void push (const TAO_Notify_Event* event ACE_ENV_ARG_DECL);
+ virtual void push (const TAO_Notify_Event* event, bool filter ACE_ENV_ARG_DECL);
- /// Dispatch Event to consumer
- virtual void push (const TAO_Notify_Event_var& event ACE_ENV_ARG_DECL);
+// /// Dispatch Event to consumer
+// virtual void push (const TAO_Notify_Event_var& event ACE_ENV_ARG_DECL);
- /// Dispatch Event to consumer, no filtering
- virtual void push_no_filtering (const TAO_Notify_Event* event ACE_ENV_ARG_DECL);
+// /// Dispatch Event to consumer, no filtering
+// virtual void push_no_filtering (const TAO_Notify_Event* event ACE_ENV_ARG_DECL);
- /// Dispatch Event to consumer, no filtering
- virtual void push_no_filtering (const TAO_Notify_Event_var& event ACE_ENV_ARG_DECL);
+// /// Dispatch Event to consumer, no filtering
+// virtual void push_no_filtering (const TAO_Notify_Event_var& event ACE_ENV_ARG_DECL);
/// Override TAO_Notify_Container_T::shutdown method
virtual int shutdown (ACE_ENV_SINGLE_ARG_DECL);
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Refcountable_Guard_T.h b/TAO/orbsvcs/orbsvcs/Notify/Refcountable_Guard_T.h
index ac1af0f4323..1354378dc62 100644
--- a/TAO/orbsvcs/orbsvcs/Notify/Refcountable_Guard_T.h
+++ b/TAO/orbsvcs/orbsvcs/Notify/Refcountable_Guard_T.h
@@ -31,12 +31,15 @@ class TAO_Notify_Refcountable_Guard_T
{
public:
/// Constuctor
- TAO_Notify_Refcountable_Guard_T (T* t);
+ TAO_Notify_Refcountable_Guard_T (T* t = 0);
/// Destructor
~TAO_Notify_Refcountable_Guard_T ();
/// Redirection operator
+ T * get (void) const;
+
+ /// Redirection operator
T *operator-> (void) const;
T &operator *() const;
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Refcountable_Guard_T.inl b/TAO/orbsvcs/orbsvcs/Notify/Refcountable_Guard_T.inl
index 5e16e7d04f1..2dedf719c60 100644
--- a/TAO/orbsvcs/orbsvcs/Notify/Refcountable_Guard_T.inl
+++ b/TAO/orbsvcs/orbsvcs/Notify/Refcountable_Guard_T.inl
@@ -4,23 +4,37 @@ template <class T> ACE_INLINE
TAO_Notify_Refcountable_Guard_T<T>::TAO_Notify_Refcountable_Guard_T (T *t)
: t_ (t)
{
- this->t_->_incr_refcnt ();
+ if (this->t_ != 0)
+ {
+ this->t_->_incr_refcnt ();
+ }
}
template <class T> ACE_INLINE
TAO_Notify_Refcountable_Guard_T<T>::~TAO_Notify_Refcountable_Guard_T ()
{
- this->t_->_decr_refcnt ();
+ if (this->t_ != 0)
+ {
+ this->t_->_decr_refcnt ();
+ }
+}
+
+template <class T> ACE_INLINE T*
+TAO_Notify_Refcountable_Guard_T<T>::get (void) const
+{
+ return this->t_;
}
template <class T> ACE_INLINE T*
TAO_Notify_Refcountable_Guard_T<T>::operator-> (void) const
{
+ ACE_ASSERT (this->t_ != 0);
return this->t_;
}
template <class T> ACE_INLINE T&
TAO_Notify_Refcountable_Guard_T<T>::operator *(void) const
{
+ ACE_ASSERT (this->t_ != 0);
return *this->t_;
}
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Sequence/SequencePushConsumer.cpp b/TAO/orbsvcs/orbsvcs/Notify/Sequence/SequencePushConsumer.cpp
index 1a6268aa7d7..de80034c7f7 100644
--- a/TAO/orbsvcs/orbsvcs/Notify/Sequence/SequencePushConsumer.cpp
+++ b/TAO/orbsvcs/orbsvcs/Notify/Sequence/SequencePushConsumer.cpp
@@ -107,21 +107,15 @@ TAO_Notify_SequencePushConsumer::cancel_timer (void)
void
TAO_Notify_SequencePushConsumer::push_i (const TAO_Notify_Event* event ACE_ENV_ARG_DECL)
{
- TAO_Notify_Event* copy = event->copy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ const TAO_Notify_Event * copy = event->copy_on_heap (ACE_ENV_SINGLE_ARG_PARAMETER);
ACE_CHECK;
TAO_Notify_Event_Copy_var copy_var (copy);
- this->push_i (copy_var ACE_ENV_ARG_PARAMETER);
-}
-
-void
-TAO_Notify_SequencePushConsumer::push_i (const TAO_Notify_Event_var& event ACE_ENV_ARG_DECL)
-{
TAO_Notify_Method_Request_Event* method_request;
ACE_NEW_THROW_EX (method_request,
- TAO_Notify_Method_Request_Event (event),
+ TAO_Notify_Method_Request_Event (copy_var),
CORBA::NO_MEMORY ());
int msg_count = this->buffering_strategy_->enqueue (*method_request);
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Sequence/SequencePushConsumer.h b/TAO/orbsvcs/orbsvcs/Notify/Sequence/SequencePushConsumer.h
index 8037ea6d403..d5b5db8fec0 100644
--- a/TAO/orbsvcs/orbsvcs/Notify/Sequence/SequencePushConsumer.h
+++ b/TAO/orbsvcs/orbsvcs/Notify/Sequence/SequencePushConsumer.h
@@ -59,7 +59,7 @@ public:
/// Push <event> to this consumer.
virtual void push_i (const TAO_Notify_Event* event ACE_ENV_ARG_DECL);
- virtual void push_i (const TAO_Notify_Event_var& event ACE_ENV_ARG_DECL);
+// virtual void push_i (const TAO_Notify_Event_var& event ACE_ENV_ARG_DECL);
/// Push <event> to this consumer.
virtual void push (const CORBA::Any& event ACE_ENV_ARG_DECL);
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Structured/StructuredEvent.cpp b/TAO/orbsvcs/orbsvcs/Notify/Structured/StructuredEvent.cpp
index 1ce4ede4465..24729ff5b5c 100644
--- a/TAO/orbsvcs/orbsvcs/Notify/Structured/StructuredEvent.cpp
+++ b/TAO/orbsvcs/orbsvcs/Notify/Structured/StructuredEvent.cpp
@@ -36,8 +36,29 @@ TAO_Notify_StructuredEvent_No_Copy::~TAO_Notify_StructuredEvent_No_Copy ()
{
}
-TAO_Notify_Event*
-TAO_Notify_StructuredEvent_No_Copy::copy (ACE_ENV_SINGLE_ARG_DECL) const
+void
+TAO_Notify_StructuredEvent_No_Copy::marshal (TAO_OutputCDR & cdr) const
+{
+ static const ACE_CDR::Octet STRUCTURED_CODE = MARSHAL_STRUCTURED;
+ cdr.write_octet (STRUCTURED_CODE);
+ cdr << (*this->notification_);
+}
+
+//static
+TAO_Notify_StructuredEvent *
+TAO_Notify_StructuredEvent_No_Copy::unmarshal (TAO_InputCDR & cdr)
+{
+ TAO_Notify_StructuredEvent * event = 0;
+ CosNotification::StructuredEvent body;
+ if (cdr >> body)
+ {
+ event = new TAO_Notify_StructuredEvent (body);
+ }
+ return event;
+}
+
+const TAO_Notify_Event *
+TAO_Notify_StructuredEvent_No_Copy::copy_on_heap (ACE_ENV_SINGLE_ARG_PARAMETER) const
{
TAO_Notify_Event* copy;
@@ -119,3 +140,10 @@ TAO_Notify_StructuredEvent::TAO_Notify_StructuredEvent (const CosNotification::S
TAO_Notify_StructuredEvent::~TAO_Notify_StructuredEvent ()
{
}
+
+const TAO_Notify_Event *
+TAO_Notify_StructuredEvent::copy_on_heap (ACE_ENV_SINGLE_ARG_PARAMETER)const
+{
+ return this;
+}
+
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Structured/StructuredEvent.h b/TAO/orbsvcs/orbsvcs/Notify/Structured/StructuredEvent.h
index d6edc36aa28..54b8061e409 100644
--- a/TAO/orbsvcs/orbsvcs/Notify/Structured/StructuredEvent.h
+++ b/TAO/orbsvcs/orbsvcs/Notify/Structured/StructuredEvent.h
@@ -22,6 +22,8 @@
#include "../EventType.h"
#include "orbsvcs/CosNotificationC.h"
+class TAO_Notify_StructuredEvent;
+
/**
* @class TAO_Notify_StructuredEvent_No_Copy
*
@@ -38,8 +40,11 @@ public:
/// Destructor
~TAO_Notify_StructuredEvent_No_Copy ();
- /// Copy the event.
- virtual TAO_Notify_Event* copy (ACE_ENV_SINGLE_ARG_DECL) const;
+ /// returns a copy of this event allocated on the heap
+ virtual const TAO_Notify_Event * copy_on_heap ()const;
+
+ /// marshal this event into a CDR buffer (for persistence)
+ virtual void marshal (TAO_OutputCDR & cdr) const;
CORBA::Boolean do_match (CosNotifyFilter::Filter_ptr filter ACE_ENV_ARG_DECL) const;
@@ -64,6 +69,10 @@ public:
/// Push event to the Event_Forwarder interface
virtual void push_no_filtering (Event_Forwarder::ProxyPushSupplier_ptr forwarder ACE_ENV_ARG_DECL) const;
+ /// unmarshal this event from a CDR buffer (for persistence)
+ /// \return the new event, or NULL if this is the wrong type of event.
+ static TAO_Notify_StructuredEvent * unmarshal (TAO_InputCDR & cdr);
+
protected:
/// Structured Event
const CosNotification::StructuredEvent* notification_;
@@ -89,6 +98,9 @@ public:
/// Destructor
~TAO_Notify_StructuredEvent ();
+ /// returns this
+ virtual const TAO_Notify_Event * copy_on_heap ()const;
+
protected:
/// Copy of the Event.
CosNotification::StructuredEvent notification_copy;
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Structured/StructuredPushConsumer.cpp b/TAO/orbsvcs/orbsvcs/Notify/Structured/StructuredPushConsumer.cpp
index cccd6095513..53e4bb3daad 100644
--- a/TAO/orbsvcs/orbsvcs/Notify/Structured/StructuredPushConsumer.cpp
+++ b/TAO/orbsvcs/orbsvcs/Notify/Structured/StructuredPushConsumer.cpp
@@ -43,12 +43,6 @@ TAO_Notify_StructuredPushConsumer::push_i (const TAO_Notify_Event* event ACE_ENV
}
void
-TAO_Notify_StructuredPushConsumer::push_i (const TAO_Notify_Event_var& event ACE_ENV_ARG_DECL)
-{
- event->push (this ACE_ENV_ARG_PARAMETER);
-}
-
-void
TAO_Notify_StructuredPushConsumer::push (const CORBA::Any& event ACE_ENV_ARG_DECL)
{
CosNotification::StructuredEvent notification;
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Structured/StructuredPushConsumer.h b/TAO/orbsvcs/orbsvcs/Notify/Structured/StructuredPushConsumer.h
index 9cb0c7d1288..4b704cfe0de 100644
--- a/TAO/orbsvcs/orbsvcs/Notify/Structured/StructuredPushConsumer.h
+++ b/TAO/orbsvcs/orbsvcs/Notify/Structured/StructuredPushConsumer.h
@@ -49,9 +49,6 @@ public:
virtual void push_i (const TAO_Notify_Event* event ACE_ENV_ARG_DECL);
/// Push <event> to this consumer.
- virtual void push_i (const TAO_Notify_Event_var& event ACE_ENV_ARG_DECL);
-
- /// Push <event> to this consumer.
virtual void push (const CORBA::Any& event ACE_ENV_ARG_DECL);
/// Push <event> to this consumer.