Merge pull request #1551 from DOCGroup/plm_jira_333
[ACE_TAO.git] / TAO / orbsvcs / examples / Log / Notify / Notify_Supplier.h
blobf2557c33a1728ed5c1f9adf597063cf9b488a4cb
1 /* -*- C++ -*- */
3 // ============================================================================
4 /**
5 * @file Notify_Supplier.h
7 * An example of using the Notify_Logging_Service.
9 * @author D A Hanvey (d.hanvey@qub.ac.uk)
11 // ============================================================================
13 #ifndef NOTIFY_SUPPLIER_H
14 #define NOTIFY_SUPPLIER_H
16 #include "orbsvcs/CosNotifyChannelAdminS.h"
17 #include "orbsvcs/DsNotifyLogAdminC.h"
18 #include "orbsvcs/CosNamingC.h"
19 #include "orbsvcs/CosNotifyCommS.h"
22 class Filter_StructuredPushSupplier;
24 #if !defined (ACE_LACKS_PRAGMA_ONCE)
25 # pragma once
26 #endif /* ACE_LACKS_PRAGMA_ONCE */
28 class Supplier
30 // = TITLE
31 // Simple supplier object
33 // = DESCRIPTION
34 // This class is a supplier of events.
36 public:
37 Supplier (void);
38 // Constructor
40 ~Supplier ();
41 // Destructor.
43 int run (int argc, ACE_TCHAR* argv[]);
44 // Run the test
46 private:
48 // = Data Members
49 CORBA::ORB_var orb_;
50 // The ORB that we use.
52 CosNaming::NamingContext_var naming_context_;
53 // Handle to the name service.
55 DsNotifyLogAdmin::NotifyLogFactory_var notify_log_factory_;
56 // The notify log factory from the Log Service.
58 DsNotifyLogAdmin::NotifyLog_var notify_log_;
60 Filter_StructuredPushSupplier* supplier_1;
62 CosNotifyChannelAdmin::SupplierAdmin_var supplier_admin_;
65 class Filter_StructuredPushSupplier
66 : public POA_CosNotifyComm::StructuredPushSupplier
68 // = TITLE
69 // Filter_StructuredPushSupplier
71 // = DESCRIPTION
72 // Supplier for the filter example.
74 public:
75 Filter_StructuredPushSupplier (void);
76 // Constructor.
78 void connect (CosNotifyChannelAdmin::SupplierAdmin_ptr supplier_admin);
79 // Connect the Supplier to the EventChannel.
80 // Creates a new proxy supplier and connects to it.
82 void disconnect (void);
83 // Disconnect from the supplier.
85 virtual void send_event (const CosNotification::StructuredEvent& event);
86 // Send one event.
88 protected:
89 // = Data members
90 CosNotifyChannelAdmin::StructuredProxyPushConsumer_var proxy_consumer_;
91 // The proxy that we are connected to.
93 CosNotifyChannelAdmin::ProxyID proxy_consumer_id_;
94 // This supplier's id.
96 // = Protected Methods
97 virtual ~Filter_StructuredPushSupplier ();
98 // Destructor
100 // = NotifySubscribe
101 virtual void subscription_change (
102 const CosNotification::EventTypeSeq & added,
103 const CosNotification::EventTypeSeq & removed);
105 // = StructuredPushSupplier method
106 virtual void disconnect_structured_push_supplier ();
110 #endif /* NOTIFY_SUPPLIER_H */