summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpradeep <pradeep@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1999-12-13 10:37:39 +0000
committerpradeep <pradeep@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1999-12-13 10:37:39 +0000
commitf00367f6f4873fc8076c9b54ec683171cf2db59f (patch)
treebeff4652bc35d6429e5af770acfc30e9e3ec312c
parent9ba24b9e784071846fba99eabe3b95ca11e79bee (diff)
downloadATCD-f00367f6f4873fc8076c9b54ec683171cf2db59f.tar.gz
*** empty log message ***
-rw-r--r--TAO/orbsvcs/Notify_Service/Notify_Service.cpp178
-rw-r--r--TAO/orbsvcs/Notify_Service/Notify_Service.h82
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Notify_ConsumerAdmin_i.cpp221
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Notify_ConsumerAdmin_i.h6
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Notify_Dispatcher.cpp43
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Notify_Dispatcher.h23
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Notify_EventChannel_i.cpp21
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Notify_EventChannel_i.h5
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Notify_FilterAdmin_i.cpp124
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Notify_FilterAdmin_i.h41
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Notify_FilterFactory_i.cpp13
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Notify_Filter_i.cpp9
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Notify_ProxyConsumer_i.h5
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Notify_ProxyPushConsumer_i.cpp11
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Notify_ProxyPushConsumer_i.h2
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Notify_ProxyPushSupplier_i.cpp13
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Notify_ProxyPushSupplier_i.h6
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Notify_ProxySupplier_i.h4
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Notify_StructuredProxyPushConsumer_i.cpp67
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Notify_StructuredProxyPushConsumer_i.h76
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Notify_StructuredProxyPushSupplier_i.cpp97
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Notify_StructuredProxyPushSupplier_i.h97
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Notify_StructuredPushConsumer.cpp131
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Notify_StructuredPushConsumer.h93
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Notify_SupplierAdmin_i.cpp106
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Notify_SupplierAdmin_i.h6
26 files changed, 1273 insertions, 207 deletions
diff --git a/TAO/orbsvcs/Notify_Service/Notify_Service.cpp b/TAO/orbsvcs/Notify_Service/Notify_Service.cpp
new file mode 100644
index 00000000000..ba81065bd43
--- /dev/null
+++ b/TAO/orbsvcs/Notify_Service/Notify_Service.cpp
@@ -0,0 +1,178 @@
+// $Id$
+
+#include "ace/Get_Opt.h"
+#include "Notify_Service.h"
+
+Notify_Service::Notify_Service (void)
+ : notify_factory_name_ ("NotifyEventChannelFactory")
+{
+ // No-Op.
+}
+
+Notify_Service::~Notify_Service (void)
+{
+ // No-Op.
+}
+
+void
+Notify_Service::init_ORB (int& argc, char *argv [],
+ CORBA::Environment &ACE_TRY_ENV)
+{
+ this->orb_ = CORBA::ORB_init (argc,
+ argv,
+ "",
+ ACE_TRY_ENV);
+ ACE_CHECK;
+
+ CORBA::Object_var poa_object =
+ this->orb_->resolve_initial_references("RootPOA",
+ ACE_TRY_ENV);
+ ACE_CHECK;
+
+ this->poa_ =
+ PortableServer::POA::_narrow (poa_object.in (),
+ ACE_TRY_ENV);
+ ACE_CHECK;
+
+ PortableServer::POAManager_var poa_manager =
+ this->poa_->the_POAManager (ACE_TRY_ENV);
+ ACE_CHECK;
+
+ poa_manager->activate (ACE_TRY_ENV);
+ ACE_CHECK;
+}
+
+void
+Notify_Service::startup (int argc, char *argv[],
+ CORBA::Environment &ACE_TRY_ENV)
+{
+ ACE_DEBUG ((LM_DEBUG,
+ "\nStarting up the Notification Service...\n"));
+
+ // initalize the ORB.
+ this->init_ORB (argc, argv,
+ ACE_TRY_ENV);
+ ACE_CHECK;
+
+ // Resolve the naming service.
+ this->resolve_naming_service (ACE_TRY_ENV);
+ ACE_CHECK;
+
+ // Activate the factory
+ obj
+ = this->notify_factory_.get_refx (ACE_TRY_ENV);
+ ACE_CHECK;
+ ACE_ASSERT (!CORBA::is_nil (obj.in ()));
+
+ CORBA::String_var str =
+ this->orb_->object_to_string (obj.in (), ACE_TRY_ENV);
+
+ ACE_DEBUG ((LM_DEBUG,
+ "The Notification Event Channel Factory IOR is <%s>\n",
+ str.in ()));
+
+ // Register the Factory
+ ACE_ASSERT(!CORBA::is_nil (this->naming_.in ()));
+
+ CosNaming::Name name (1);
+ name.length (1);
+ name[0].id = CORBA::string_dup (this->notify_factory_name_);
+
+ this->naming_->rebind (name,
+ obj.in (),
+ ACE_TRY_ENV);
+ ACE_CHECK;
+
+ ACE_DEBUG ((LM_DEBUG,
+ "Registered with the naming service as: %s\n",
+ this->notify_factory_name_));
+}
+
+void
+Notify_Service::resolve_naming_service (CORBA::Environment &ACE_TRY_ENV)
+{
+ CORBA::Object_var naming_obj =
+ this->orb_->resolve_initial_references ("NameService",
+ ACE_TRY_ENV);
+ ACE_CHECK;
+
+ // Need to check return value for errors.
+ if (CORBA::is_nil (naming_obj.in ()))
+ ACE_THROW (CORBA::UNKNOWN ());
+
+ this->naming_ =
+ CosNaming::NamingContext::_narrow (naming_obj.in (),
+ ACE_TRY_ENV);
+ ACE_CHECK;
+}
+
+int
+Notify_Service::run (void)
+{
+ ACE_DEBUG ((LM_DEBUG, "%s: Running the Notification Service\n",
+ __FILE__));
+ if (this->orb_->run () == -1)
+ ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "run"), 1);
+
+ return 0;
+}
+
+void
+Notify_Service::shutdown (CORBA::Environment &ACE_TRY_ENV)
+{
+ // Deactivate.
+ PortableServer::ObjectId_var oid =
+ this->poa_->servant_to_id (&this->notify_factory_,
+ ACE_TRY_ENV);
+ ACE_CHECK;
+
+ // deactivate from the poa.
+ this->poa_->deactivate_object (oid.in (),
+ ACE_TRY_ENV);
+ ACE_CHECK;
+
+ // Unbind from the naming service.
+ CosNaming::Name name (1);
+ name.length (1);
+ name[0].id = CORBA::string_dup (this->notify_factory_name_);
+
+ this->naming_->unbind (name,
+ ACE_TRY_ENV);
+
+ // shutdown the ORB.
+ if (!CORBA::is_nil (this->orb_.in ()))
+ this->orb_->shutdown ();
+}
+
+int
+main (int argc, char *argv[])
+{
+ Notify_Service service;
+
+ ACE_TRY_NEW_ENV
+ {
+ service.startup (argc,
+ argv,
+ ACE_TRY_ENV);
+ ACE_TRY_CHECK;
+
+ if (service.run () == -1)
+ {
+ service.shutdown ();
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Failed to run the Notification Service.\n"),
+ 1);
+ }
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "Failed to start the Notification Service\n");
+ return 1;
+ }
+ ACE_ENDTRY;
+
+ service.shutdown ();
+
+ return 0;
+}
diff --git a/TAO/orbsvcs/Notify_Service/Notify_Service.h b/TAO/orbsvcs/Notify_Service/Notify_Service.h
new file mode 100644
index 00000000000..c69b2289acc
--- /dev/null
+++ b/TAO/orbsvcs/Notify_Service/Notify_Service.h
@@ -0,0 +1,82 @@
+/* -*- C++ -*- */
+// $Id$
+// ============================================================================
+//
+// = FILENAME
+// Notify_Service.h
+//
+// = AUTHOR
+// Pradeep Gore <pradeep@cs.wustl.edu>
+//
+// = DESCRIPTION
+// Notification Service front end.
+//
+// ============================================================================
+
+#ifndef NOTIFY_SERVICE_H
+#define NOTIFY_SERVICE_H
+
+#include "orbsvcs/CosNamingC.h"
+#include "orbsvcs/CosNotifyChannelAdminC.h"
+#include "orbsvcs/Notify/Notify_EventChannelFactory_i.h"
+
+class Notify_Service
+{
+ // = TITLE
+ // Notify_Service
+ //
+ // = DESCRIPTION
+ // Implementation of the Notification Service front end.
+
+ public:
+ // = Initialization and termination methods.
+ Notify_Service (void);
+ // Constructor.
+
+ virtual ~Notify_Service (void);
+ // Destructor.
+
+ int parse_args (int argc, char *argv []);
+ // Parses the command line arguments.
+
+ void startup (int argc, char *argv[],
+ CORBA::Environment &ACE_TRY_ENV);
+ // Initializes the Service.
+ // Returns 0 on success, -1 on error.
+
+ int run (void);
+ // run the Service.
+ // Returns 0 on success, -1 on error.
+
+ void shutdown (CORBA::Environment &ACE_TRY_ENV =
+ TAO_default_environment ());
+ // Shutdown the Service.
+ // Returns 0 on success, -1 on error.
+
+ CosNotifyChannelAdmin::EventChannelFactory_var obj;
+ // temp hack.
+protected:
+ void init_ORB (int& argc, char *argv [],
+ CORBA::Environment &ACE_TRY_ENV);
+ // initialize the ORB.
+
+ void resolve_naming_service (CORBA::Environment &ACE_TRY_ENV);
+ // Resolve the naming service.
+
+ // = Data members
+ const char* notify_factory_name_;
+ // The Factory name.
+
+ TAO_Notify_EventChannelFactory_i notify_factory_;
+ // The Factory.
+
+ CORBA::ORB_var orb_;
+ // The ORB that we use.
+
+ PortableServer::POA_var poa_;
+ // Reference to the root poa.
+
+ CosNaming::NamingContext_var naming_;
+ // A naming context.
+};
+#endif /* NOTIFY_SERVICE_H */
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Notify_ConsumerAdmin_i.cpp b/TAO/orbsvcs/orbsvcs/Notify/Notify_ConsumerAdmin_i.cpp
index 5b069fb27ef..785a0628157 100644
--- a/TAO/orbsvcs/orbsvcs/Notify/Notify_ConsumerAdmin_i.cpp
+++ b/TAO/orbsvcs/orbsvcs/Notify/Notify_ConsumerAdmin_i.cpp
@@ -1,8 +1,10 @@
/* -*- C++ -*- $Id$ */
-#include "orbsvcs/orbsvcs/Notify/Notify_ConsumerAdmin_i.h"
-#include "orbsvcs/orbsvcs/Notify/Notify_ProxyPushSupplier_i.h"
#include "ace/Auto_Ptr.h"
+#include "Notify_ConsumerAdmin_i.h"
+#include "Notify_ProxyPushSupplier_i.h"
+#include "Notify_StructuredProxyPushSupplier_i.h"
+#include "Notify_EventChannel_i.h"
// Implementation skeleton constructor
TAO_Notify_ConsumerAdmin_i::TAO_Notify_ConsumerAdmin_i (TAO_Notify_EventChannel_i& myChannel)
@@ -18,8 +20,11 @@ TAO_Notify_ConsumerAdmin_i::~TAO_Notify_ConsumerAdmin_i (void)
void
TAO_Notify_ConsumerAdmin_i::init (CORBA::Environment &ACE_TRY_ENV)
{
- dispatcher_ = auto_ptr<TAO_Notify_Dispatcher>(TAO_Notify_Dispatcher::create (ACE_TRY_ENV));
+ dispatcher_ =
+ auto_ptr<TAO_Notify_Dispatcher>(TAO_Notify_Dispatcher::
+ create (ACE_TRY_ENV));
ACE_CHECK;
+ dispatcher_->set_FilterAdmin (this);
}
TAO_Notify_Dispatcher&
@@ -44,23 +49,25 @@ CosNotifyChannelAdmin::AdminID TAO_Notify_ConsumerAdmin_i::MyID (
ACE_THROW_SPEC ((
CORBA::SystemException
))
+{
+ //Add your implementation here
+ return 0;
+}
- {
- //Add your implementation here
- return 0;
- }
-
-CosNotifyChannelAdmin::EventChannel_ptr TAO_Notify_ConsumerAdmin_i::MyChannel (
+CosNotifyChannelAdmin::EventChannel_ptr
+TAO_Notify_ConsumerAdmin_i::MyChannel (
CORBA::Environment &ACE_TRY_ENV
)
ACE_THROW_SPEC ((
CORBA::SystemException
))
+{
+ CosNotifyChannelAdmin::EventChannel_var ec =
+ myChannel_.get_ref (ACE_TRY_ENV);
+ ACE_CHECK_RETURN (0);
- {
- //Add your implementation here
- return 0;
- }
+ return ec._retn ();
+}
CosNotifyChannelAdmin::InterFilterGroupOperator TAO_Notify_ConsumerAdmin_i::MyOperator (
CORBA::Environment &ACE_TRY_ENV
@@ -68,11 +75,10 @@ CosNotifyChannelAdmin::InterFilterGroupOperator TAO_Notify_ConsumerAdmin_i::MyOp
ACE_THROW_SPEC ((
CORBA::SystemException
))
-
- {
- //Add your implementation here
- return myOperator_;
- }
+{
+ //Add your implementation here
+ return myOperator_;
+}
CosNotifyFilter::MappingFilter_ptr TAO_Notify_ConsumerAdmin_i::priority_filter (
CORBA::Environment &ACE_TRY_ENV
@@ -80,11 +86,10 @@ CosNotifyFilter::MappingFilter_ptr TAO_Notify_ConsumerAdmin_i::priority_filter (
ACE_THROW_SPEC ((
CORBA::SystemException
))
-
- {
- //Add your implementation here
- return 0;
- }
+{
+ //Add your implementation here
+ return 0;
+}
void TAO_Notify_ConsumerAdmin_i::priority_filter (
CosNotifyFilter::MappingFilter_ptr priority_filter,
@@ -93,10 +98,9 @@ void TAO_Notify_ConsumerAdmin_i::priority_filter (
ACE_THROW_SPEC ((
CORBA::SystemException
))
-
- {
- //Add your implementation here
- }
+{
+ //Add your implementation here
+}
CosNotifyFilter::MappingFilter_ptr TAO_Notify_ConsumerAdmin_i::lifetime_filter (
CORBA::Environment &ACE_TRY_ENV
@@ -104,11 +108,10 @@ CosNotifyFilter::MappingFilter_ptr TAO_Notify_ConsumerAdmin_i::lifetime_filter (
ACE_THROW_SPEC ((
CORBA::SystemException
))
-
- {
- //Add your implementation here
- return 0;
- }
+{
+ //Add your implementation here
+ return 0;
+}
void TAO_Notify_ConsumerAdmin_i::lifetime_filter (
CosNotifyFilter::MappingFilter_ptr lifetime_filter,
@@ -117,10 +120,9 @@ void TAO_Notify_ConsumerAdmin_i::lifetime_filter (
ACE_THROW_SPEC ((
CORBA::SystemException
))
-
- {
- //Add your implementation here
- }
+{
+ //Add your implementation here
+}
CosNotifyChannelAdmin::ProxyIDSeq * TAO_Notify_ConsumerAdmin_i::pull_suppliers (
CORBA::Environment &ACE_TRY_ENV
@@ -128,11 +130,10 @@ CosNotifyChannelAdmin::ProxyIDSeq * TAO_Notify_ConsumerAdmin_i::pull_suppliers (
ACE_THROW_SPEC ((
CORBA::SystemException
))
-
- {
- //Add your implementation here
- return 0;
- }
+{
+ //Add your implementation here
+ return 0;
+}
CosNotifyChannelAdmin::ProxyIDSeq* TAO_Notify_ConsumerAdmin_i::push_suppliers (
CORBA::Environment &ACE_TRY_ENV
@@ -140,11 +141,10 @@ CosNotifyChannelAdmin::ProxyIDSeq* TAO_Notify_ConsumerAdmin_i::push_suppliers (
ACE_THROW_SPEC ((
CORBA::SystemException
))
-
- {
- //Add your implementation here
+{
+ //Add your implementation here
return 0;
- }
+}
CosNotifyChannelAdmin::ProxySupplier_ptr TAO_Notify_ConsumerAdmin_i::get_proxy_supplier (
CosNotifyChannelAdmin::ProxyID proxy_id,
@@ -154,13 +154,13 @@ CosNotifyChannelAdmin::ProxySupplier_ptr TAO_Notify_ConsumerAdmin_i::get_proxy_s
CORBA::SystemException,
CosNotifyChannelAdmin::ProxyNotFound
))
+{
+ //Add your implementation here
+ return 0;
+}
- {
- //Add your implementation here
- return 0;
- }
-
-CosNotifyChannelAdmin::ProxySupplier_ptr TAO_Notify_ConsumerAdmin_i::obtain_notification_pull_supplier (
+CosNotifyChannelAdmin::ProxySupplier_ptr
+TAO_Notify_ConsumerAdmin_i::obtain_notification_pull_supplier (
CosNotifyChannelAdmin::ClientType ctype,
CosNotifyChannelAdmin::ProxyID_out proxy_id,
CORBA::Environment &ACE_TRY_ENV
@@ -169,11 +169,10 @@ CosNotifyChannelAdmin::ProxySupplier_ptr TAO_Notify_ConsumerAdmin_i::obtain_noti
CORBA::SystemException,
CosNotifyChannelAdmin::AdminLimitExceeded
))
-
- {
- //Add your implementation here
- return 0;
- }
+{
+ //Add your implementation here
+ return 0;
+}
CosNotifyChannelAdmin::ProxySupplier_ptr
TAO_Notify_ConsumerAdmin_i::obtain_notification_push_supplier (
@@ -184,57 +183,66 @@ TAO_Notify_ConsumerAdmin_i::obtain_notification_push_supplier (
ACE_THROW_SPEC ((
CORBA::SystemException,
CosNotifyChannelAdmin::AdminLimitExceeded
- ))
- {
- //Add your implementation here
- CosNotifyChannelAdmin::ProxySupplier_var proxysupplier_ret;
- CORBA::Object_var obj;
+ ))
+{
+ //Add your implementation here
+ TAO_Notify_ProxySupplier_i* proxysupplier;
- switch (ctype)
+ switch (ctype)
+ {
+ case CosNotifyChannelAdmin::ANY_EVENT:
{
- case CosNotifyChannelAdmin::ANY_EVENT:
- {
- TAO_Notify_ProxyPushSupplier_i* proxypushsupplier;
- ACE_NEW_THROW_EX (proxypushsupplier,
- TAO_Notify_ProxyPushSupplier_i (*this),
- CORBA::NO_MEMORY ());
- auto_ptr <TAO_Notify_ProxyPushSupplier_i>
- auto_proxypushsupp (proxypushsupplier);
-
- proxypushsupplier->init (ACE_TRY_ENV);
- ACE_CHECK_RETURN (CosNotifyChannelAdmin::ProxySupplier::_nil ());
-
- dispatcher_->add_dispatcher (*proxypushsupplier);
- // @@ check ret val.
-
- obj = proxypushsupplier->get_ref (ACE_TRY_ENV);
- ACE_CHECK_RETURN (CosNotifyChannelAdmin::ProxySupplier::_nil ());
-
- proxysupplier_ret =
- CosNotifyChannelAdmin::ProxySupplier::_narrow (obj.in (),
- ACE_TRY_ENV);
- ACE_CHECK_RETURN (CosNotifyChannelAdmin::ProxySupplier::_nil ());
- obj._retn (); // giveup ownership.
-
- proxy_id = proxy_supplier_ids.get ();
-
- if (proxypushsupplier_map_.bind (proxy_id,
- proxypushsupplier) == -1)
- ACE_THROW_RETURN (CORBA::INTERNAL (),
- CosNotifyChannelAdmin::ProxySupplier::_nil ());
- auto_proxypushsupp.release ();
- }
- break;
- case CosNotifyChannelAdmin::STRUCTURED_EVENT:
- break;
- case CosNotifyChannelAdmin::SEQUENCE_EVENT:
- break;
- default:
- break;
+ ACE_NEW_THROW_EX (proxysupplier,
+ TAO_Notify_ProxyPushSupplier_i (*this),
+ CORBA::NO_MEMORY ());
+
+ }
+ break;
+ case CosNotifyChannelAdmin::STRUCTURED_EVENT:
+ {
+ ACE_NEW_THROW_EX (proxysupplier,
+ TAO_Notify_StructuredProxyPushSupplier_i (*this),
+ CORBA::NO_MEMORY ());
}
+ break;
+
+ case CosNotifyChannelAdmin::SEQUENCE_EVENT:
+ default:
+ ACE_THROW_RETURN (CORBA::BAD_PARAM (),
+ CosNotifyChannelAdmin::ProxySupplier::_nil ());
+ break;
+ }
+
+ CosNotifyChannelAdmin::ProxySupplier_var proxysupplier_ret;
+
+ auto_ptr <TAO_Notify_ProxySupplier_i> auto_proxysupp (proxysupplier);
+
+ proxysupplier->init (ACE_TRY_ENV);
+ ACE_CHECK_RETURN (CosNotifyChannelAdmin::ProxySupplier::_nil ());
+
+ dispatcher_->add_dispatcher (*proxysupplier);
+ // @@ check ret val.
- return proxysupplier_ret._retn ();
- }
+ CORBA::Object_var obj =
+ proxysupplier->get_ref (ACE_TRY_ENV);
+ ACE_CHECK_RETURN (CosNotifyChannelAdmin::ProxySupplier::_nil ());
+
+ proxysupplier_ret =
+ CosNotifyChannelAdmin::ProxySupplier::_narrow (obj.in (),
+ ACE_TRY_ENV);
+ ACE_CHECK_RETURN (CosNotifyChannelAdmin::ProxySupplier::_nil ());
+ obj._retn (); // giveup ownership.
+
+ proxy_id = proxy_supplier_ids.get ();
+
+ if (proxysupplier_map_.bind (proxy_id,
+ proxysupplier) == -1)
+ ACE_THROW_RETURN (CORBA::INTERNAL (),
+ CosNotifyChannelAdmin::ProxySupplier::_nil ());
+ auto_proxysupp.release (); // all o.k., let go!
+
+ return proxysupplier_ret._retn ();
+}
void TAO_Notify_ConsumerAdmin_i::destroy (
CORBA::Environment &ACE_TRY_ENV
@@ -242,10 +250,9 @@ void TAO_Notify_ConsumerAdmin_i::destroy (
ACE_THROW_SPEC ((
CORBA::SystemException
))
-
- {
- //Add your implementation here
- }
+{
+ //Add your implementation here
+}
CosEventChannelAdmin::ProxyPushSupplier_ptr
TAO_Notify_ConsumerAdmin_i::obtain_push_supplier (
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Notify_ConsumerAdmin_i.h b/TAO/orbsvcs/orbsvcs/Notify/Notify_ConsumerAdmin_i.h
index b6e808c5fbb..9eefa44e933 100644
--- a/TAO/orbsvcs/orbsvcs/Notify/Notify_ConsumerAdmin_i.h
+++ b/TAO/orbsvcs/orbsvcs/Notify/Notify_ConsumerAdmin_i.h
@@ -27,7 +27,7 @@
#include "Notify_Dispatcher.h"
class TAO_Notify_EventChannel_i;
-class TAO_Notify_ProxyPushSupplier_i;
+class TAO_Notify_ProxySupplier_i;
class TAO_Notify_ConsumerAdmin_i :
public virtual POA_CosNotifyChannelAdmin::ConsumerAdmin,
@@ -188,9 +188,9 @@ protected:
// Id generator for proxy suppliers.
ACE_Hash_Map_Manager <CosNotifyChannelAdmin::ProxyID,
- TAO_Notify_ProxyPushSupplier_i*,
+ TAO_Notify_ProxySupplier_i*,
ACE_SYNCH_MUTEX>
- proxypushsupplier_map_;
+ proxysupplier_map_;
auto_ptr<TAO_Notify_Dispatcher> dispatcher_;
//
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Notify_Dispatcher.cpp b/TAO/orbsvcs/orbsvcs/Notify/Notify_Dispatcher.cpp
index 886ae0b6145..96701da9693 100644
--- a/TAO/orbsvcs/orbsvcs/Notify/Notify_Dispatcher.cpp
+++ b/TAO/orbsvcs/orbsvcs/Notify/Notify_Dispatcher.cpp
@@ -3,6 +3,16 @@
#include "Notify_Dispatcher.h"
#include "ace/CORBA_macros.h"
#include "orbsvcs/orbsvcs/CosNotifyCommC.h" // i get some errors with env otherwise
+#include "Notify_FilterAdmin_i.h"
+
+TAO_Notify_Dispatcher::TAO_Notify_Dispatcher (void)
+ :filter_admin_ (0)
+{
+}
+
+TAO_Notify_Dispatcher::~TAO_Notify_Dispatcher ()
+{
+}
TAO_Notify_Dispatcher*
TAO_Notify_Dispatcher::create (CORBA::Environment &ACE_TRY_ENV)
@@ -19,6 +29,12 @@ TAO_Notify_Dispatcher::create (CORBA::Environment &ACE_TRY_ENV)
return dispatcher;
}
+void
+TAO_Notify_Dispatcher::set_FilterAdmin (TAO_Notify_FilterAdmin_i* filter_admin)
+{
+ filter_admin_ = filter_admin;
+}
+
int
TAO_Notify_Dispatcher::add_dispatcher (TAO_Notify_Dispatcher& dispatcher)
{
@@ -48,3 +64,30 @@ Notify_Reactive_Dispatcher::dispatch_event (const CORBA::Any & data,
ACE_CHECK;
}
}
+
+void
+Notify_Reactive_Dispatcher::dispatch_event (
+ const CosNotification::StructuredEvent& event,
+ CORBA::Environment &ACE_TRY_ENV)
+{
+ if (filter_admin_ != 0)
+ {
+ CORBA::Boolean truth =
+ filter_admin_->match_structured (event, ACE_TRY_ENV);
+ ACE_CHECK;
+
+ if (truth == 0)
+ return; // don't propogate the event further out.
+ }
+
+ DISPATCHER_SET_ITER iter (contained_);
+ TAO_Notify_Dispatcher **p_dispatcher;
+
+ for (iter.first ();iter.done () != 1;iter.advance ())
+ {
+ if (iter.next (p_dispatcher) == 0)
+ break;
+ (*p_dispatcher)->dispatch_event (event, ACE_TRY_ENV);
+ ACE_CHECK;
+ }
+}
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Notify_Dispatcher.h b/TAO/orbsvcs/orbsvcs/Notify/Notify_Dispatcher.h
index 379095b3928..7165ea95d00 100644
--- a/TAO/orbsvcs/orbsvcs/Notify/Notify_Dispatcher.h
+++ b/TAO/orbsvcs/orbsvcs/Notify/Notify_Dispatcher.h
@@ -21,6 +21,9 @@
#include "ace/Containers.h"
#include "tao/corbafwd.h"
+#include "orbsvcs/orbsvcs/CosNotifyCommC.h"
+
+class TAO_Notify_FilterAdmin_i;
class TAO_Notify_Dispatcher
{
@@ -33,12 +36,25 @@ class TAO_Notify_Dispatcher
// contained Dispatchers.
public:
+ // = Initialization and termination
+ TAO_Notify_Dispatcher (void);
+ // Constructor
+
+ ~TAO_Notify_Dispatcher (void);
+ // Destructor
+
static TAO_Notify_Dispatcher* create (CORBA::Environment &ACE_TRY_ENV);
// Factory method to create dispatchers of various types.
+ void set_FilterAdmin (TAO_Notify_FilterAdmin_i* filter_admin);
+ // Set the filter admin for this dispatcher.
+
+ // = Clients of this class should call these methods to dispatch events.
virtual void dispatch_event (const CORBA::Any & data,
CORBA::Environment &ACE_TRY_ENV) = 0;
- // Clients of this class should call this method to dispatch events.
+
+ virtual void dispatch_event (const CosNotification::StructuredEvent& event,
+ CORBA::Environment &ACE_TRY_ENV) = 0;
int add_dispatcher (TAO_Notify_Dispatcher& dispatcher);
// Add a dispatcher to an internal list of event recipients.
@@ -47,6 +63,8 @@ class TAO_Notify_Dispatcher
//Remove a dispatcher from the internal list.
protected:
+ TAO_Notify_FilterAdmin_i* filter_admin_;
+
typedef ACE_Unbounded_Set<TAO_Notify_Dispatcher*> DISPATCHER_SET;
typedef ACE_Unbounded_Set_Iterator<TAO_Notify_Dispatcher*>
DISPATCHER_SET_ITER;
@@ -64,6 +82,9 @@ class Notify_Reactive_Dispatcher : public TAO_Notify_Dispatcher
//
virtual void dispatch_event (const CORBA::Any & data,
CORBA::Environment &ACE_TRY_ENV);
+
+ virtual void dispatch_event (const CosNotification::StructuredEvent& event,
+ CORBA::Environment &ACE_TRY_ENV);
};
#endif /* NOTIFY_DISPATCHER_H_ */
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Notify_EventChannel_i.cpp b/TAO/orbsvcs/orbsvcs/Notify/Notify_EventChannel_i.cpp
index bd39951ac7d..b363fb78e83 100644
--- a/TAO/orbsvcs/orbsvcs/Notify/Notify_EventChannel_i.cpp
+++ b/TAO/orbsvcs/orbsvcs/Notify/Notify_EventChannel_i.cpp
@@ -4,6 +4,7 @@
#include "orbsvcs/orbsvcs/Notify/Notify_SupplierAdmin_i.h"
#include "orbsvcs/orbsvcs/Notify/Notify_ConsumerAdmin_i.h"
#include "orbsvcs/orbsvcs/Notify/Notify_EventChannelFactory_i.h"
+#include "orbsvcs/orbsvcs/Notify/Notify_FilterFactory_i.h"
// Implementation skeleton constructor
TAO_Notify_EventChannel_i::TAO_Notify_EventChannel_i (TAO_Notify_EventChannelFactory_i& my_factory)
@@ -20,7 +21,17 @@ void
TAO_Notify_EventChannel_i::init (CORBA::Environment &ACE_TRY_ENV)
{
// TODO: init data members
- dispatcher_ = auto_ptr<TAO_Notify_Dispatcher>(TAO_Notify_Dispatcher::create (ACE_TRY_ENV));
+ dispatcher_ =
+ auto_ptr<TAO_Notify_Dispatcher>(TAO_Notify_Dispatcher::create (ACE_TRY_ENV));
+ ACE_CHECK;
+
+ TAO_Notify_FilterFactory_i* filter_factory_i;
+ ACE_NEW_THROW_EX (filter_factory_i,
+ TAO_Notify_FilterFactory_i (),
+ CORBA::NO_MEMORY ());
+
+ this->filter_factory_ =
+ filter_factory_i->get_ref (ACE_TRY_ENV);
ACE_CHECK;
}
@@ -68,15 +79,13 @@ CosNotifyChannelAdmin::SupplierAdmin_ptr TAO_Notify_EventChannel_i::default_supp
CosNotifyFilter::FilterFactory_ptr
TAO_Notify_EventChannel_i::default_filter_factory (
- CORBA::Environment &ACE_TRY_ENV
- )
+ CORBA::Environment &ACE_TRY_ENV
+ )
ACE_THROW_SPEC ((
CORBA::SystemException
))
-
{
- //Add your implementation here
- return 0;
+ return CosNotifyFilter::FilterFactory::_duplicate (filter_factory_.in ());
}
CosNotifyChannelAdmin::ConsumerAdmin_ptr
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Notify_EventChannel_i.h b/TAO/orbsvcs/orbsvcs/Notify/Notify_EventChannel_i.h
index 60592d4cad2..cdf3eedd4fe 100644
--- a/TAO/orbsvcs/orbsvcs/Notify/Notify_EventChannel_i.h
+++ b/TAO/orbsvcs/orbsvcs/Notify/Notify_EventChannel_i.h
@@ -23,7 +23,7 @@
#pragma once
#endif /* ACE_LACKS_PRAGMA_ONCE */
-#include <ace/Hash_Map_Manager.h>
+#include "ace/Hash_Map_Manager.h"
#include "orbsvcs/orbsvcs/CosNotifyChannelAdminS.h"
#include "orbsvcs/orbsvcs/Notify/Notify_QoSAdmin_i.h"
#include "orbsvcs/orbsvcs/Notify/ID_Pool_T.h"
@@ -201,6 +201,9 @@ virtual void set_admin (
auto_ptr<TAO_Notify_Dispatcher> dispatcher_;
//
+
+ CosNotifyFilter::FilterFactory_var filter_factory_;
+ // The default filter factory
};
#endif /* NOTIFY_EVENTCHANNEL_I_H_ */
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Notify_FilterAdmin_i.cpp b/TAO/orbsvcs/orbsvcs/Notify/Notify_FilterAdmin_i.cpp
index 8612f08abb9..3a8065e405c 100644
--- a/TAO/orbsvcs/orbsvcs/Notify/Notify_FilterAdmin_i.cpp
+++ b/TAO/orbsvcs/orbsvcs/Notify/Notify_FilterAdmin_i.cpp
@@ -3,26 +3,90 @@
// Implementation skeleton constructor
TAO_Notify_FilterAdmin_i::TAO_Notify_FilterAdmin_i (void)
- {
- }
+{
+}
// Implementation skeleton destructor
TAO_Notify_FilterAdmin_i::~TAO_Notify_FilterAdmin_i (void)
- {
- }
+{
+}
+
+CORBA::Boolean
+TAO_Notify_FilterAdmin_i::match (
+ const CORBA::Any& filterable_data,
+ CORBA::Environment &ACE_TRY_ENV
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException,
+ CosNotifyFilter::UnsupportedFilterableData
+ ))
+{
+ // @@ TODO: later!
+ return 1; // lies, all lies
+}
+
+CORBA::Boolean
+TAO_Notify_FilterAdmin_i::match_structured (
+ const CosNotification::StructuredEvent& filterable_data,
+ CORBA::Environment &ACE_TRY_ENV
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException,
+ CosNotifyFilter::UnsupportedFilterableData
+ ))
+{
+ // If no filter is active, treat it as a '*' i.e, let all events pass.
+ if (filter_list_.current_size () == 0)
+ return 1;
+
+ // We want to return true if atleast one constraint matches.
+ FILTER_LIST_ITER iter (filter_list_);
+ FILTER_ENTRY *entry;
+ CORBA::Boolean ret_val = 0;
+
+ for (; iter.done () == 0; iter.advance ())
+ {
+ if (iter.next (entry) != 0)
+ {
+ ret_val = entry->int_id_->match_structured (filterable_data,
+ ACE_TRY_ENV);
+ ACE_CHECK_RETURN (0);
-CosNotifyFilter::FilterID TAO_Notify_FilterAdmin_i::add_filter (
+ if (ret_val == 1)
+ return 1;
+ }
+ }
+
+ return 0;
+}
+
+CosNotifyFilter::FilterID
+TAO_Notify_FilterAdmin_i::add_filter (
CosNotifyFilter::Filter_ptr new_filter,
CORBA::Environment &ACE_TRY_ENV
)
ACE_THROW_SPEC ((
CORBA::SystemException
))
+{
+ if (CORBA::is_nil (new_filter))
+ ACE_THROW_RETURN (CORBA::BAD_PARAM (), 0);
+
+ CosNotifyFilter::FilterID new_id = filter_ids_.get ();
- {
- //Add your implementation here
- return 0;
- }
+ CosNotifyFilter::Filter_var new_filter_var =
+ CosNotifyFilter::Filter::_duplicate (new_filter);
+
+ if (filter_list_.bind (new_id, new_filter_var) == -1)
+ {
+ filter_ids_.put (new_id); // return the id to the pool
+
+ ACE_THROW_RETURN (CORBA::INTERNAL (),
+ 0);
+ }
+ else
+ return new_id;
+}
void TAO_Notify_FilterAdmin_i::remove_filter (
CosNotifyFilter::FilterID filter,
@@ -32,44 +96,50 @@ void TAO_Notify_FilterAdmin_i::remove_filter (
CORBA::SystemException,
CosNotifyFilter::FilterNotFound
))
+{
+ if (filter_list_.unbind (filter) == -1)
+ ACE_THROW (CosNotifyFilter::FilterNotFound ());
+}
- {
- //Add your implementation here
- }
-
-CosNotifyFilter::Filter_ptr TAO_Notify_FilterAdmin_i::get_filter (
+CosNotifyFilter::Filter_ptr
+TAO_Notify_FilterAdmin_i::get_filter (
CosNotifyFilter::FilterID filter,
CORBA::Environment &ACE_TRY_ENV
)
ACE_THROW_SPEC ((
CORBA::SystemException,
CosNotifyFilter::FilterNotFound
- ))
+ ))
+{
+ CosNotifyFilter::Filter_var filter_var;
- {
- //Add your implementation here
- return 0;
- }
+ if (filter_list_.find (filter,
+ filter_var) == -1)
+ ACE_THROW_RETURN (CosNotifyFilter::FilterNotFound (),
+ 0);
+
+ return CosNotifyFilter::Filter::_duplicate (filter_var.in ());
+}
-CosNotifyFilter::FilterIDSeq * TAO_Notify_FilterAdmin_i::get_all_filters (
+CosNotifyFilter::FilterIDSeq*
+TAO_Notify_FilterAdmin_i::get_all_filters (
CORBA::Environment &ACE_TRY_ENV
)
ACE_THROW_SPEC ((
CORBA::SystemException
))
+{
+ //Add your implementation here
+ return 0;
+}
- {
- //Add your implementation here
- return 0;
- }
-
-void TAO_Notify_FilterAdmin_i::remove_all_filters (
+void
+TAO_Notify_FilterAdmin_i::remove_all_filters (
CORBA::Environment &ACE_TRY_ENV
)
ACE_THROW_SPEC ((
CORBA::SystemException
))
-
{
//Add your implementation here
}
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Notify_FilterAdmin_i.h b/TAO/orbsvcs/orbsvcs/Notify/Notify_FilterAdmin_i.h
index fdb0f717ad5..6b7f663a84e 100644
--- a/TAO/orbsvcs/orbsvcs/Notify/Notify_FilterAdmin_i.h
+++ b/TAO/orbsvcs/orbsvcs/Notify/Notify_FilterAdmin_i.h
@@ -19,7 +19,9 @@
#ifndef NOTIFY_FILTERADMIN_H
#define NOTIFY_FILTERADMIN_H
+#include "ace/Hash_Map_Manager.h"
#include "orbsvcs/orbsvcs/CosNotifyFilterS.h"
+#include "orbsvcs/orbsvcs/Notify/ID_Pool_T.h"
class TAO_Notify_FilterAdmin_i :
public virtual POA_CosNotifyFilter::FilterAdmin
@@ -37,6 +39,26 @@ public:
virtual ~TAO_Notify_FilterAdmin_i (void);
// Destructor
+ // = match operation on all the filters
+ CORBA::Boolean match (
+ const CORBA::Any & filterable_data,
+ CORBA::Environment &ACE_TRY_ENV
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException,
+ CosNotifyFilter::UnsupportedFilterableData
+ ));
+
+ CORBA::Boolean match_structured (
+ const CosNotification::StructuredEvent & filterable_data,
+ CORBA::Environment &ACE_TRY_ENV
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException,
+ CosNotifyFilter::UnsupportedFilterableData
+ ));
+ // see if any of the filters match.
+
virtual CosNotifyFilter::FilterID add_filter (
CosNotifyFilter::Filter_ptr new_filter,
CORBA::Environment &ACE_TRY_ENV
@@ -77,6 +99,25 @@ public:
CORBA::SystemException
));
+private:
+ ACE_Hash_Map_Manager <CosNotifyFilter::FilterID,
+ CosNotifyFilter::Filter_var,
+ ACE_SYNCH_MUTEX>
+ filter_list_;
+ // List of filters
+
+ typedef
+ ACE_Hash_Map_Iterator <CosNotifyFilter::FilterID,
+ CosNotifyFilter::Filter_var,
+ ACE_SYNCH_MUTEX>
+ FILTER_LIST_ITER;
+
+ typedef ACE_Hash_Map_Entry<CosNotifyFilter::FilterID,
+ CosNotifyFilter::Filter_var>
+ FILTER_ENTRY;
+
+ ID_Pool<CosNotifyFilter::FilterID> filter_ids_;
+ // Id generator for proxy suppliers
};
#endif /* NOTIFY_FILTERADMIN_H */
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Notify_FilterFactory_i.cpp b/TAO/orbsvcs/orbsvcs/Notify/Notify_FilterFactory_i.cpp
index a8a38893e98..1e65fdf58f8 100644
--- a/TAO/orbsvcs/orbsvcs/Notify/Notify_FilterFactory_i.cpp
+++ b/TAO/orbsvcs/orbsvcs/Notify/Notify_FilterFactory_i.cpp
@@ -13,6 +13,17 @@ TAO_Notify_FilterFactory_i::~TAO_Notify_FilterFactory_i (void)
{
}
+CosNotifyFilter::FilterFactory_ptr
+TAO_Notify_FilterFactory_i::get_ref (CORBA::Environment &ACE_TRY_ENV)
+{
+ CosNotifyFilter::FilterFactory_var filterfactory;
+
+ filterfactory = _this (ACE_TRY_ENV);
+ ACE_CHECK_RETURN (CosNotifyFilter::FilterFactory::_nil ());
+
+ return filterfactory._retn ();
+}
+
CosNotifyFilter::Filter_ptr
TAO_Notify_FilterFactory_i::create_filter (
const char *constraint_grammar,
@@ -33,7 +44,7 @@ TAO_Notify_FilterFactory_i::create_filter (
TAO_Notify_Filter_i,
CORBA::NO_MEMORY ());
- return filter->get_ref (ACE_TRY_ENV);
+ return CosNotifyFilter::Filter::_duplicate (filter->get_ref (ACE_TRY_ENV));
}
CosNotifyFilter::MappingFilter_ptr
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Notify_Filter_i.cpp b/TAO/orbsvcs/orbsvcs/Notify/Notify_Filter_i.cpp
index 942a49d3c80..e26f73ff8b0 100644
--- a/TAO/orbsvcs/orbsvcs/Notify/Notify_Filter_i.cpp
+++ b/TAO/orbsvcs/orbsvcs/Notify/Notify_Filter_i.cpp
@@ -109,18 +109,23 @@ TAO_Notify_Filter_i::add_constraints (
CosNotifyFilter::InvalidConstraint
))
{
+ int constraint_length = constraint_list.length ();
+
+ ACE_DEBUG ((LM_DEBUG, "constraint_length = %d\n", constraint_length));
// create the list that goes out.
CosNotifyFilter::ConstraintInfoSeq* infoseq;
ACE_NEW_THROW_EX (infoseq,
- CosNotifyFilter::ConstraintInfoSeq (constraint_list.length ()),
+ CosNotifyFilter::ConstraintInfoSeq (constraint_length),
CORBA::NO_MEMORY ());
ACE_CHECK_RETURN (0);
+ infoseq->length (constraint_length);
+
auto_ptr<CosNotifyFilter::ConstraintInfoSeq> auto_infoseq (infoseq);
// populate infoseq
for (int pop_index = 0;
- pop_index < constraint_list.length ();
+ pop_index < constraint_length;
++pop_index)
{
(*infoseq)[pop_index].constraint_expression =
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Notify_ProxyConsumer_i.h b/TAO/orbsvcs/orbsvcs/Notify/Notify_ProxyConsumer_i.h
index c086e8372d4..7190ea91af7 100644
--- a/TAO/orbsvcs/orbsvcs/Notify/Notify_ProxyConsumer_i.h
+++ b/TAO/orbsvcs/orbsvcs/Notify/Notify_ProxyConsumer_i.h
@@ -43,7 +43,10 @@ public:
//Destructor
virtual ~TAO_Notify_ProxyConsumer_i (void);
- void init (CORBA::Environment &ACE_TRY_ENV);
+ virtual void init (CORBA::Environment &ACE_TRY_ENV);
+ //
+
+ virtual CosNotifyChannelAdmin::ProxyConsumer_ptr get_ref (CORBA::Environment &ACE_TRY_ENV) = 0;
//
virtual CosNotifyChannelAdmin::ProxyType MyType (
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Notify_ProxyPushConsumer_i.cpp b/TAO/orbsvcs/orbsvcs/Notify/Notify_ProxyPushConsumer_i.cpp
index 440b7728468..63e1fbe5d91 100644
--- a/TAO/orbsvcs/orbsvcs/Notify/Notify_ProxyPushConsumer_i.cpp
+++ b/TAO/orbsvcs/orbsvcs/Notify/Notify_ProxyPushConsumer_i.cpp
@@ -1,6 +1,6 @@
/* -*- C++ -*- $Id$ */
-#include "orbsvcs/orbsvcs/Notify/Notify_ProxyPushConsumer_i.h"
+#include "Notify_ProxyPushConsumer_i.h"
#include "Notify_SupplierAdmin_i.h"
// Implementation skeleton constructor
@@ -12,10 +12,10 @@ TAO_Notify_ProxyPushConsumer_i::TAO_Notify_ProxyPushConsumer_i
// Implementation skeleton destructor
TAO_Notify_ProxyPushConsumer_i::~TAO_Notify_ProxyPushConsumer_i (void)
- {
- }
+{
+}
-CosNotifyChannelAdmin::ProxyPushConsumer_ptr
+CosNotifyChannelAdmin::ProxyConsumer_ptr
TAO_Notify_ProxyPushConsumer_i::get_ref (CORBA::Environment &ACE_TRY_ENV)
{
return _this (ACE_TRY_ENV);
@@ -53,5 +53,4 @@ TAO_Notify_ProxyPushConsumer_i::disconnect_push_consumer
CORBA::SystemException
))
{
-
- }
+}
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Notify_ProxyPushConsumer_i.h b/TAO/orbsvcs/orbsvcs/Notify/Notify_ProxyPushConsumer_i.h
index 27e16440d93..aa0010851ad 100644
--- a/TAO/orbsvcs/orbsvcs/Notify/Notify_ProxyPushConsumer_i.h
+++ b/TAO/orbsvcs/orbsvcs/Notify/Notify_ProxyPushConsumer_i.h
@@ -41,7 +41,7 @@ public:
virtual ~TAO_Notify_ProxyPushConsumer_i (void);
// Destructor
- CosNotifyChannelAdmin::ProxyPushConsumer_ptr get_ref (CORBA::Environment &ACE_TRY_ENV);
+ CosNotifyChannelAdmin::ProxyConsumer_ptr get_ref (CORBA::Environment &ACE_TRY_ENV);
virtual void connect_any_push_supplier (
CosEventComm::PushSupplier_ptr push_supplier,
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Notify_ProxyPushSupplier_i.cpp b/TAO/orbsvcs/orbsvcs/Notify/Notify_ProxyPushSupplier_i.cpp
index 62c413ae5a0..9f605abc9b5 100644
--- a/TAO/orbsvcs/orbsvcs/Notify/Notify_ProxyPushSupplier_i.cpp
+++ b/TAO/orbsvcs/orbsvcs/Notify/Notify_ProxyPushSupplier_i.cpp
@@ -22,7 +22,18 @@ TAO_Notify_ProxyPushSupplier_i::dispatch_event (const CORBA::Any & data,
ACE_CHECK;
}
-CosNotifyChannelAdmin::ProxyPushSupplier_ptr
+void
+TAO_Notify_ProxyPushSupplier_i::dispatch_event
+(const CosNotification::StructuredEvent& event,
+ CORBA::Environment &ACE_TRY_ENV)
+{
+ // check if it passes filter, disconnected etc.
+ // pass the any data.
+ push_consumer_->push (event.remainder_of_body, ACE_TRY_ENV);
+ ACE_CHECK;
+}
+
+CosNotifyChannelAdmin::ProxySupplier_ptr
TAO_Notify_ProxyPushSupplier_i::get_ref (CORBA::Environment &ACE_TRY_ENV)
{
return _this (ACE_TRY_ENV);
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Notify_ProxyPushSupplier_i.h b/TAO/orbsvcs/orbsvcs/Notify/Notify_ProxyPushSupplier_i.h
index 5462d7e0eeb..2bf9f0235d9 100644
--- a/TAO/orbsvcs/orbsvcs/Notify/Notify_ProxyPushSupplier_i.h
+++ b/TAO/orbsvcs/orbsvcs/Notify/Notify_ProxyPushSupplier_i.h
@@ -46,7 +46,11 @@ public:
CORBA::Environment &ACE_TRY_ENV);
//
- CosNotifyChannelAdmin::ProxyPushSupplier_ptr get_ref (CORBA::Environment &ACE_TRY_ENV);
+ virtual void dispatch_event (const CosNotification::StructuredEvent& event,
+ CORBA::Environment &ACE_TRY_ENV);
+ //
+
+ virtual CosNotifyChannelAdmin::ProxySupplier_ptr get_ref (CORBA::Environment &ACE_TRY_ENV);
virtual void connect_any_push_consumer (
CosEventComm::PushConsumer_ptr push_consumer,
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Notify_ProxySupplier_i.h b/TAO/orbsvcs/orbsvcs/Notify/Notify_ProxySupplier_i.h
index 77d30f0721f..c3386441a18 100644
--- a/TAO/orbsvcs/orbsvcs/Notify/Notify_ProxySupplier_i.h
+++ b/TAO/orbsvcs/orbsvcs/Notify/Notify_ProxySupplier_i.h
@@ -46,9 +46,11 @@ public:
//Destructor
virtual ~TAO_Notify_ProxySupplier_i (void);
- void init (CORBA::Environment &ACE_TRY_ENV);
+ virtual void init (CORBA::Environment &ACE_TRY_ENV);
//
+ virtual CosNotifyChannelAdmin::ProxySupplier_ptr get_ref (CORBA::Environment &ACE_TRY_ENV) = 0;
+
virtual CosNotifyChannelAdmin::ProxyType MyType (
CORBA::Environment &ACE_TRY_ENV
)
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Notify_StructuredProxyPushConsumer_i.cpp b/TAO/orbsvcs/orbsvcs/Notify/Notify_StructuredProxyPushConsumer_i.cpp
new file mode 100644
index 00000000000..52cde616a2a
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/Notify_StructuredProxyPushConsumer_i.cpp
@@ -0,0 +1,67 @@
+/* -*- C++ -*- $Id$ */
+
+#include "Notify_StructuredProxyPushConsumer_i.h"
+#include "Notify_SupplierAdmin_i.h"
+#include "Notify_Dispatcher.h"
+
+TAO_Notify_StructuredProxyPushConsumer_i::TAO_Notify_StructuredProxyPushConsumer_i (TAO_Notify_SupplierAdmin_i &supplieradmin)
+ :TAO_Notify_ProxyConsumer_i (supplieradmin)
+{
+}
+
+TAO_Notify_StructuredProxyPushConsumer_i::~TAO_Notify_StructuredProxyPushConsumer_i (void)
+{
+}
+
+CosNotifyChannelAdmin::ProxyConsumer_ptr
+TAO_Notify_StructuredProxyPushConsumer_i::get_ref (CORBA::Environment &ACE_TRY_ENV)
+{
+ return _this (ACE_TRY_ENV);
+}
+
+void
+TAO_Notify_StructuredProxyPushConsumer_i::connect_structured_push_supplier (
+ CosNotifyComm::StructuredPushSupplier_ptr push_supplier,
+ CORBA::Environment &ACE_TRY_ENV
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException,
+ CosEventChannelAdmin::AlreadyConnected
+ ))
+{
+ //@@ incomplete
+ push_supplier_ =
+ CosNotifyComm::StructuredPushSupplier::_duplicate (push_supplier);
+}
+
+void
+TAO_Notify_StructuredProxyPushConsumer_i::push_structured_event (
+ const CosNotification::StructuredEvent& event,
+ CORBA::Environment &ACE_TRY_ENV
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException,
+ CosEventComm::Disconnected
+ ))
+{
+ //@@ Filtering comes here.
+ CORBA::Boolean truth =
+ this->match_structured (event, ACE_TRY_ENV);
+ ACE_CHECK;
+
+ if (truth == 0)
+ return; // don't propogate the event further out.
+
+ myadmin_.get_dispatcher ().dispatch_event (event, ACE_TRY_ENV);
+ ACE_CHECK;
+}
+
+void
+TAO_Notify_StructuredProxyPushConsumer_i::disconnect_structured_push_consumer (
+ CORBA::Environment &ACE_TRY_ENV
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ))
+{
+}
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Notify_StructuredProxyPushConsumer_i.h b/TAO/orbsvcs/orbsvcs/Notify/Notify_StructuredProxyPushConsumer_i.h
new file mode 100644
index 00000000000..9e77c92ac4c
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/Notify_StructuredProxyPushConsumer_i.h
@@ -0,0 +1,76 @@
+/* -*- C++ -*- */
+// $Id$
+// ==========================================================================
+//
+// = LIBRARY
+// orbsvcs
+//
+// = FILENAME
+// TAO_Notify_StructuredProxyPushConsumer_i.h
+//
+// = DESCRIPTION
+//
+//
+// = AUTHOR
+// Pradeep Gore <pradeep@cs.wustl.edu>
+//
+// ==========================================================================
+
+#ifndef NOTIFY_STRUCTUREDPROXYPUSHCONSUMER_I_H
+#define NOTIFY_STRUCTUREDPROXYPUSHCONSUMER_I_H
+
+#include "orbsvcs/orbsvcs/CosNotifyChannelAdminS.h"
+#include "orbsvcs/orbsvcs/Notify/Notify_ProxyConsumer_i.h"
+#include "orbsvcs/orbsvcs/Notify/NotifyPublish_i.h"
+
+class TAO_Notify_StructuredProxyPushConsumer_i :
+public virtual POA_CosNotifyChannelAdmin::StructuredProxyPushConsumer,
+ public virtual TAO_Notify_ProxyConsumer_i,
+ public virtual TAO_NotifyPublish_i
+{
+ // = TITLE
+ // TAO_Notify_StructuredProxyPushConsumer_i
+ // = DESCRIPTION
+ //
+ //
+
+public:
+ TAO_Notify_StructuredProxyPushConsumer_i (TAO_Notify_SupplierAdmin_i &supplieradmin);
+ // Constructor
+
+ virtual ~TAO_Notify_StructuredProxyPushConsumer_i (void);
+ // Destructor
+
+ virtual CosNotifyChannelAdmin::ProxyConsumer_ptr get_ref (CORBA::Environment &ACE_TRY_ENV);
+ //
+
+ virtual void connect_structured_push_supplier (
+ CosNotifyComm::StructuredPushSupplier_ptr push_supplier,
+ CORBA::Environment &ACE_TRY_ENV
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException,
+ CosEventChannelAdmin::AlreadyConnected
+ ));
+
+ virtual void push_structured_event (
+ const CosNotification::StructuredEvent & notification,
+ CORBA::Environment &ACE_TRY_ENV
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException,
+ CosEventComm::Disconnected
+ ));
+
+virtual void disconnect_structured_push_consumer (
+ CORBA::Environment &ACE_TRY_ENV
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ));
+
+ protected:
+ CosNotifyComm::StructuredPushSupplier_var push_supplier_;
+ //
+};
+#endif /* NOTIFY_STRUCTUREDPROXYPUSHCONSUMER_I_H */
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Notify_StructuredProxyPushSupplier_i.cpp b/TAO/orbsvcs/orbsvcs/Notify/Notify_StructuredProxyPushSupplier_i.cpp
new file mode 100644
index 00000000000..ac3d99f3e6c
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/Notify_StructuredProxyPushSupplier_i.cpp
@@ -0,0 +1,97 @@
+/* -*- C++ -*- $Id$ */
+
+#include "Notify_StructuredProxyPushSupplier_i.h"
+
+TAO_Notify_StructuredProxyPushSupplier_i::TAO_Notify_StructuredProxyPushSupplier_i
+(TAO_Notify_ConsumerAdmin_i &consumeradmin)
+ :TAO_Notify_ProxySupplier_i (consumeradmin)
+{
+}
+
+// Implementation skeleton destructor
+TAO_Notify_StructuredProxyPushSupplier_i::~TAO_Notify_StructuredProxyPushSupplier_i (void)
+{
+}
+
+CosNotifyChannelAdmin::ProxySupplier_ptr
+TAO_Notify_StructuredProxyPushSupplier_i::get_ref (CORBA::Environment &ACE_TRY_ENV)
+{
+ return _this (ACE_TRY_ENV);
+}
+
+void
+TAO_Notify_StructuredProxyPushSupplier_i::dispatch_event
+(const CORBA::Any & data,
+ CORBA::Environment &ACE_TRY_ENV)
+{
+ CosNotification::StructuredEvent event;
+ event.remainder_of_body = data;
+
+ push_consumer_->push_structured_event (event, ACE_TRY_ENV);
+ ACE_CHECK;
+}
+
+void
+TAO_Notify_StructuredProxyPushSupplier_i::dispatch_event
+(const CosNotification::StructuredEvent& event,
+ CORBA::Environment &ACE_TRY_ENV)
+{
+ //@@ check if it passes filter, disconnected etc.
+ CORBA::Boolean truth =
+ this->match_structured (event, ACE_TRY_ENV);
+ ACE_CHECK;
+
+ if (truth == 0)
+ return; // don't propogate the event further out.
+
+ push_consumer_->push_structured_event (event, ACE_TRY_ENV);
+ ACE_CHECK;
+}
+
+void
+TAO_Notify_StructuredProxyPushSupplier_i::connect_structured_push_consumer (
+ CosNotifyComm::StructuredPushConsumer_ptr push_consumer,
+ CORBA::Environment &ACE_TRY_ENV
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException,
+ CosEventChannelAdmin::AlreadyConnected,
+ CosEventChannelAdmin::TypeError
+ ))
+{
+ push_consumer_ =
+ CosNotifyComm::StructuredPushConsumer::_duplicate (push_consumer);
+}
+
+void
+TAO_Notify_StructuredProxyPushSupplier_i::disconnect_structured_push_supplier
+(CORBA::Environment &ACE_TRY_ENV)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ))
+{
+}
+
+void
+TAO_Notify_StructuredProxyPushSupplier_i::suspend_connection (
+ CORBA::Environment &ACE_TRY_ENV
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException,
+ CosNotifyChannelAdmin::ConnectionAlreadyInactive,
+ CosNotifyChannelAdmin::NotConnected
+ ))
+{
+}
+
+void
+TAO_Notify_StructuredProxyPushSupplier_i:: resume_connection (
+ CORBA::Environment &ACE_TRY_ENV
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException,
+ CosNotifyChannelAdmin::ConnectionAlreadyActive,
+ CosNotifyChannelAdmin::NotConnected
+ ))
+{
+}
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Notify_StructuredProxyPushSupplier_i.h b/TAO/orbsvcs/orbsvcs/Notify/Notify_StructuredProxyPushSupplier_i.h
new file mode 100644
index 00000000000..a277745f093
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/Notify_StructuredProxyPushSupplier_i.h
@@ -0,0 +1,97 @@
+/* -*- C++ -*- */
+// $Id$
+// ==========================================================================
+//
+// = LIBRARY
+// orbsvcs
+//
+// = FILENAME
+// Notify_StructuredProxyPushSupplier_i.h
+//
+// = DESCRIPTION
+//
+//
+// = AUTHOR
+// Pradeep Gore <pradeep@cs.wustl.edu>
+//
+// ==========================================================================
+#ifndef NOTIFY_STRUCTUREDPROXYPUSHSUPPLIER_I_H
+#define NOTIFY_STRUCTUREDPROXYPUSHSUPPLIER_I_H
+
+#include "orbsvcs/orbsvcs/CosNotifyChannelAdminS.h"
+#include "orbsvcs/orbsvcs/Notify/Notify_ProxySupplier_i.h"
+#include "orbsvcs/orbsvcs/Notify/NotifySubscribe_i.h"
+
+class TAO_Notify_ConsumerAdmin_i;
+
+class TAO_Notify_StructuredProxyPushSupplier_i :
+public virtual POA_CosNotifyChannelAdmin::StructuredProxyPushSupplier,
+ public virtual TAO_Notify_ProxySupplier_i,
+ public virtual TAO_NotifySubscribe_i
+{
+ // = TITLE
+ // TAO_Notify_StructuredProxyPushSupplier_i
+ // = DESCRIPTION
+ //
+ //
+
+ public:
+ //Constructor
+ TAO_Notify_StructuredProxyPushSupplier_i (TAO_Notify_ConsumerAdmin_i &consumeradmin);
+
+ //Destructor
+ virtual ~TAO_Notify_StructuredProxyPushSupplier_i (void);
+
+ virtual void dispatch_event (const CORBA::Any & data,
+ CORBA::Environment &ACE_TRY_ENV);
+ //
+
+ virtual void dispatch_event (const CosNotification::StructuredEvent& event,
+ CORBA::Environment &ACE_TRY_ENV);
+
+ CosNotifyChannelAdmin::ProxySupplier_ptr get_ref (CORBA::Environment &ACE_TRY_ENV);
+ // convert to object ref.
+
+ virtual void connect_structured_push_consumer
+ (
+ CosNotifyComm::StructuredPushConsumer_ptr push_consumer,
+ CORBA::Environment &ACE_TRY_ENV
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException,
+ CosEventChannelAdmin::AlreadyConnected,
+ CosEventChannelAdmin::TypeError
+ ));
+
+ virtual void suspend_connection (
+ CORBA::Environment &ACE_TRY_ENV
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException,
+ CosNotifyChannelAdmin::ConnectionAlreadyInactive,
+ CosNotifyChannelAdmin::NotConnected
+ ));
+
+ virtual void resume_connection (
+ CORBA::Environment &ACE_TRY_ENV
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException,
+ CosNotifyChannelAdmin::ConnectionAlreadyActive,
+ CosNotifyChannelAdmin::NotConnected
+ ));
+
+ // = CosNotifyComm::StructuredPushSupplier method
+ virtual void disconnect_structured_push_supplier (
+ CORBA::Environment &ACE_TRY_ENV
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ));
+
+ protected:
+ CosNotifyComm::StructuredPushConsumer_var push_consumer_;
+ // The consumer that we are connected with.
+};
+
+#endif /* NOTIFY_STRUCTUREDPROXYPUSHSUPPLIER_I_H */
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Notify_StructuredPushConsumer.cpp b/TAO/orbsvcs/orbsvcs/Notify/Notify_StructuredPushConsumer.cpp
new file mode 100644
index 00000000000..a9584266ae4
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/Notify_StructuredPushConsumer.cpp
@@ -0,0 +1,131 @@
+/* -*- C++ -*- $Id$ */
+#include "Notify_StructuredPushConsumer.h"
+
+TAO_Notify_StructuredPushConsumer::TAO_Notify_StructuredPushConsumer (void)
+{
+}
+
+TAO_Notify_StructuredPushConsumer::~TAO_Notify_StructuredPushConsumer (void)
+{
+}
+
+CosNotifyComm::StructuredPushConsumer_ptr
+TAO_Notify_StructuredPushConsumer::get_ref (void)
+{
+ return _this ();
+}
+
+void
+TAO_Notify_StructuredPushConsumer::open (CosNotifyChannelAdmin::ConsumerAdmin_ptr consumer_admin, CORBA::Environment& ACE_TRY_ENV)
+{
+ consumer_admin_ =
+ CosNotifyChannelAdmin::ConsumerAdmin::_duplicate (consumer_admin);
+}
+
+void
+TAO_Notify_StructuredPushConsumer::close (CORBA::Environment &ACE_TRY_ENV)
+{
+ this->disconnect (ACE_TRY_ENV);
+ ACE_CHECK;
+
+ this->consumer_admin_ =
+ CosNotifyChannelAdmin::ConsumerAdmin::_nil ();
+}
+
+void
+TAO_Notify_StructuredPushConsumer::connect (CORBA::Environment &ACE_TRY_ENV)
+{
+ if (CORBA::is_nil (this->consumer_admin_.in ()))
+ return;
+
+ CosNotifyComm::StructuredPushConsumer_var objref =
+ this->_this (ACE_TRY_ENV);
+ ACE_CHECK;
+
+ CosNotifyChannelAdmin::ProxySupplier_var proxysupplier =
+ consumer_admin_->obtain_notification_push_supplier
+ (CosNotifyChannelAdmin::STRUCTURED_EVENT,
+ consumeradmin_proxy_id_,
+ ACE_TRY_ENV);
+ ACE_CHECK;
+
+ ACE_ASSERT (!CORBA::is_nil (proxysupplier.in ()));
+
+ // narrow
+ this->supplier_proxy_ =
+ CosNotifyChannelAdmin::StructuredProxyPushSupplier::
+ _narrow (proxysupplier.in (),
+ ACE_TRY_ENV);
+ ACE_CHECK;
+ ACE_ASSERT (!CORBA::is_nil (supplier_proxy_.in ()));
+
+ supplier_proxy_->connect_structured_push_consumer (objref.in (),
+ ACE_TRY_ENV);
+ ACE_CHECK;
+}
+
+void
+TAO_Notify_StructuredPushConsumer::disconnect (CORBA::Environment &ACE_TRY_ENV)
+{
+ if (CORBA::is_nil (this->supplier_proxy_.in ()))
+ return;
+
+ this->supplier_proxy_->disconnect_structured_push_supplier(ACE_TRY_ENV);
+ ACE_CHECK;
+
+ this->supplier_proxy_ =
+ CosNotifyChannelAdmin::StructuredProxyPushSupplier::_nil ();
+}
+
+void
+TAO_Notify_StructuredPushConsumer::offer_change (
+ const CosNotification::EventTypeSeq & added,
+ const CosNotification::EventTypeSeq & removed,
+ CORBA::Environment &ACE_TRY_ENV
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException,
+ CosNotifyComm::InvalidEventType
+ ))
+{
+}
+
+/*
+void
+TAO_Notify_StructuredPushConsumer::push_structured_event (
+ const CosNotification::StructuredEvent & notification,
+ CORBA::Environment &ACE_TRY_ENV
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException,
+ CosEventComm::Disconnected
+ ))
+{
+ ACE_DEBUG ((LM_DEBUG,
+ "in TAO_Notify_StructuredPushConsumer::push\n"));
+}
+*/
+
+void
+TAO_Notify_StructuredPushConsumer::disconnect_structured_push_consumer (
+ CORBA::Environment &ACE_TRY_ENV
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ))
+{
+ // Deactivate this object.
+
+ PortableServer::POA_var poa =
+ this->_default_POA (ACE_TRY_ENV);
+ ACE_CHECK;
+
+ PortableServer::ObjectId_var id =
+ poa->servant_to_id (this,
+ ACE_TRY_ENV);
+ ACE_CHECK;
+
+ poa->deactivate_object (id.in (),
+ ACE_TRY_ENV);
+ ACE_CHECK;
+}
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Notify_StructuredPushConsumer.h b/TAO/orbsvcs/orbsvcs/Notify/Notify_StructuredPushConsumer.h
new file mode 100644
index 00000000000..b5ea3c2f215
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/Notify_StructuredPushConsumer.h
@@ -0,0 +1,93 @@
+/* -*- C++ -*- */
+// $Id$
+// ==========================================================================
+//
+// = LIBRARY
+// orbsvcs
+//
+// = FILENAME
+// Notify_StructuredPushConsumer.h
+//
+// = DESCRIPTION
+// This class is to be used by clients of the Notification Service.
+//
+// = AUTHOR
+// Pradeep Gore <pradeep@cs.wustl.edu>
+//
+// ==========================================================================
+
+#ifndef NOTIFY_STRUCTUREDPUSHCONSUMER_H
+#define NOTIFY_STRUCTUREDPUSHCONSUMER_H
+
+#include "orbsvcs/orbsvcs/CosNotifyChannelAdminS.h"
+
+class TAO_Notify_StructuredPushConsumer : public POA_CosNotifyComm::StructuredPushConsumer
+{
+ // = TITLE
+ // Notify_StructuredPushConsumer
+ // = DESCRIPTION
+ //
+ //
+ public:
+ // = Initialization and Termination code
+ TAO_Notify_StructuredPushConsumer (void);
+ // Constructor.
+
+ ~TAO_Notify_StructuredPushConsumer (void);
+ // Destructor
+
+ CosNotifyComm::StructuredPushConsumer_ptr get_ref (void);
+ // Convert to obj ref.
+
+ virtual void open (CosNotifyChannelAdmin::ConsumerAdmin_ptr consumer_admin,
+ CORBA::Environment& ACE_TRY_ENV);
+ // This method connects the consumer to the EC.
+
+ virtual void close (CORBA::Environment &ACE_TRY_ENV);
+ // Disconnect from the EC.
+
+ virtual void connect (CORBA::Environment &ACE_TRY_ENV);
+ // Connect the CosECConsumer to the EventChannel.
+ // Creates a new proxy supplier and connects to it.
+
+ virtual void disconnect (CORBA::Environment &ACE_TRY_ENV);
+ // Disconnect from the supplier.
+
+ // = NotifyPublish method
+ virtual void offer_change (
+ const CosNotification::EventTypeSeq & added,
+ const CosNotification::EventTypeSeq & removed,
+ CORBA::Environment &ACE_TRY_ENV
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException,
+ CosNotifyComm::InvalidEventType
+ ));
+
+ // = StructuredPushSupplier methods
+ virtual void push_structured_event (
+ const CosNotification::StructuredEvent & notification,
+ CORBA::Environment &ACE_TRY_ENV
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException,
+ CosEventComm::Disconnected
+ )) = 0;
+
+ virtual void disconnect_structured_push_consumer (
+ CORBA::Environment &ACE_TRY_ENV
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ));
+ protected:
+ CosNotifyChannelAdmin::ConsumerAdmin_var consumer_admin_;
+ // The consumeradmin that we get our proxy supplier from.
+
+ CosNotifyChannelAdmin::ProxyID consumeradmin_proxy_id_;
+ // The proxy's id.
+
+ CosNotifyChannelAdmin::StructuredProxyPushSupplier_var supplier_proxy_;
+ // The proxy that we are connected to.
+};
+#endif /* NOTIFY_STRUCTUREDPUSHCONSUMER_H */
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Notify_SupplierAdmin_i.cpp b/TAO/orbsvcs/orbsvcs/Notify/Notify_SupplierAdmin_i.cpp
index 294f9a08c55..af86fc1e42a 100644
--- a/TAO/orbsvcs/orbsvcs/Notify/Notify_SupplierAdmin_i.cpp
+++ b/TAO/orbsvcs/orbsvcs/Notify/Notify_SupplierAdmin_i.cpp
@@ -1,8 +1,9 @@
/* -*- C++ -*- $Id$ */
#include "ace/Auto_Ptr.h"
-#include "orbsvcs/orbsvcs/Notify/Notify_SupplierAdmin_i.h"
-#include "orbsvcs/orbsvcs/Notify/Notify_ProxyPushConsumer_i.h"
+#include "Notify_SupplierAdmin_i.h"
+#include "Notify_ProxyPushConsumer_i.h"
+#include "Notify_StructuredProxyPushConsumer_i.h"
#include "Notify_EventChannel_i.h"
// Implementation skeleton constructor
@@ -25,10 +26,12 @@ TAO_Notify_SupplierAdmin_i::get_dispatcher (void)
void
TAO_Notify_SupplierAdmin_i::init (CORBA::Environment &ACE_TRY_ENV)
{
-
- dispatcher_ = auto_ptr<TAO_Notify_Dispatcher>(TAO_Notify_Dispatcher::create (ACE_TRY_ENV));
+ dispatcher_ =
+ auto_ptr<TAO_Notify_Dispatcher>(TAO_Notify_Dispatcher::
+ create (ACE_TRY_ENV));
ACE_CHECK;
+ dispatcher_->set_FilterAdmin (this);
dispatcher_->add_dispatcher (myChannel_.get_dispatcher ());
}
@@ -49,15 +52,19 @@ CosNotifyChannelAdmin::AdminID TAO_Notify_SupplierAdmin_i::MyID (
return 0;
}
-CosNotifyChannelAdmin::EventChannel_ptr TAO_Notify_SupplierAdmin_i::MyChannel (
+CosNotifyChannelAdmin::EventChannel_ptr
+TAO_Notify_SupplierAdmin_i::MyChannel (
CORBA::Environment &ACE_TRY_ENV
)
ACE_THROW_SPEC ((
CORBA::SystemException
))
{
- //Add your implementation here
- return 0;
+ CosNotifyChannelAdmin::EventChannel_var ec =
+ myChannel_.get_ref (ACE_TRY_ENV);
+ ACE_CHECK_RETURN (0);
+
+ return ec._retn ();
}
CosNotifyChannelAdmin::InterFilterGroupOperator TAO_Notify_SupplierAdmin_i::MyOperator (
@@ -131,49 +138,58 @@ TAO_Notify_SupplierAdmin_i::obtain_notification_push_consumer (
CORBA::SystemException,
CosNotifyChannelAdmin::AdminLimitExceeded
))
- {
- //Add your implementation here
- CosNotifyChannelAdmin::ProxyConsumer_var proxyconsumer_ret;
- CORBA::Object_var obj;
+{
+ //Add your implementation here
+ TAO_Notify_ProxyConsumer_i* proxyconsumer;
- switch (ctype)
+ switch (ctype)
+ {
+ case CosNotifyChannelAdmin::ANY_EVENT:
+ {
+ ACE_NEW_THROW_EX (proxyconsumer,
+ TAO_Notify_ProxyPushConsumer_i (*this),
+ CORBA::NO_MEMORY ());
+ }
+ break;
+ case CosNotifyChannelAdmin::STRUCTURED_EVENT:
{
- case CosNotifyChannelAdmin::ANY_EVENT:
- {
- TAO_Notify_ProxyPushConsumer_i* proxypushconsumer;
- ACE_NEW_THROW_EX (proxypushconsumer,
- TAO_Notify_ProxyPushConsumer_i (*this),
- CORBA::NO_MEMORY ());
- auto_ptr <TAO_Notify_ProxyPushConsumer_i> auto_proxypushcons;
-
- obj = proxypushconsumer->get_ref (ACE_TRY_ENV);
- ACE_CHECK_RETURN (CosNotifyChannelAdmin::ProxyConsumer::_nil ());
-
- proxyconsumer_ret =
- CosNotifyChannelAdmin::ProxyConsumer::_narrow (obj.in (),
- ACE_TRY_ENV);
- ACE_CHECK_RETURN (CosNotifyChannelAdmin::ProxyConsumer::_nil ());
- obj._retn (); // giveup ownership.
-
- proxy_id = proxy_consumer_ids.get ();
-
- if (proxypushconsumer_map_.bind (proxy_id,
- proxypushconsumer) == -1)
- ACE_THROW_RETURN (CORBA::INTERNAL (),
- CosNotifyChannelAdmin::ProxyConsumer::_nil ());
- auto_proxypushcons.release ();
- }
- break;
- case CosNotifyChannelAdmin::STRUCTURED_EVENT:
- break;
- case CosNotifyChannelAdmin::SEQUENCE_EVENT:
- break;
- default:
- break;
+ ACE_NEW_THROW_EX (proxyconsumer,
+ TAO_Notify_StructuredProxyPushConsumer_i (*this),
+ CORBA::NO_MEMORY ());
}
+ break;
+
+ case CosNotifyChannelAdmin::SEQUENCE_EVENT:
+ default:
+ ACE_THROW_RETURN (CORBA::BAD_PARAM (),
+ CosNotifyChannelAdmin::ProxyConsumer::_nil ());
+ break;
+ }
+
+ CosNotifyChannelAdmin::ProxyConsumer_var proxyconsumer_ret;
+ CORBA::Object_var obj;
+
+ auto_ptr <TAO_Notify_ProxyConsumer_i> auto_proxycons (proxyconsumer);
+
+ obj = proxyconsumer->get_ref (ACE_TRY_ENV);
+ ACE_CHECK_RETURN (CosNotifyChannelAdmin::ProxyConsumer::_nil ());
+
+ proxyconsumer_ret =
+ CosNotifyChannelAdmin::ProxyConsumer::_narrow (obj.in (),
+ ACE_TRY_ENV);
+ ACE_CHECK_RETURN (CosNotifyChannelAdmin::ProxyConsumer::_nil ());
+ obj._retn (); // giveup ownership.
+
+ proxy_id = proxy_consumer_ids.get ();
+
+ if (proxyconsumer_map_.bind (proxy_id,
+ proxyconsumer) == -1)
+ ACE_THROW_RETURN (CORBA::INTERNAL (),
+ CosNotifyChannelAdmin::ProxyConsumer::_nil ());
+ auto_proxycons.release ();
return proxyconsumer_ret._retn ();
- }
+}
void TAO_Notify_SupplierAdmin_i::destroy (
CORBA::Environment &ACE_TRY_ENV
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Notify_SupplierAdmin_i.h b/TAO/orbsvcs/orbsvcs/Notify/Notify_SupplierAdmin_i.h
index e4c7c26e49d..ca8bdfd0f54 100644
--- a/TAO/orbsvcs/orbsvcs/Notify/Notify_SupplierAdmin_i.h
+++ b/TAO/orbsvcs/orbsvcs/Notify/Notify_SupplierAdmin_i.h
@@ -30,7 +30,7 @@
#include "Notify_Dispatcher.h"
class TAO_Notify_EventChannel_i;
-class TAO_Notify_ProxyPushConsumer_i;
+class TAO_Notify_ProxyConsumer_i;
class TAO_Notify_SupplierAdmin_i :
public virtual POA_CosNotifyChannelAdmin::SupplierAdmin,
@@ -160,9 +160,9 @@ protected:
// Id generator for proxy suppliers.
ACE_Hash_Map_Manager <CosNotifyChannelAdmin::ProxyID,
- TAO_Notify_ProxyPushConsumer_i*,
+ TAO_Notify_ProxyConsumer_i*,
ACE_SYNCH_MUTEX>
- proxypushconsumer_map_;
+ proxyconsumer_map_;
auto_ptr<TAO_Notify_Dispatcher> dispatcher_;
//