blob: 3bc639cebcec4f78b44427437d65cd32a3f05bcb (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
|
/* -*- C++ -*- */
// ============================================================================
/**
* @file Notify_Supplier.h
*
* $Id$
*
* An example of using the Notify_Logging_Service.
*
*
*
* @author D A Hanvey (d.hanvey@qub.ac.uk)
*/
// ============================================================================
#ifndef NOTIFY_SUPPLIER_H
#define NOTIFY_SUPPLIER_H
#include "orbsvcs/CosNotifyChannelAdminS.h"
#include "orbsvcs/DsNotifyLogAdminC.h"
#include "orbsvcs/CosNamingC.h"
#include "orbsvcs/CosNotifyCommS.h"
class Filter_StructuredPushSupplier;
#if !defined (ACE_LACKS_PRAGMA_ONCE)
# pragma once
#endif /* ACE_LACKS_PRAGMA_ONCE */
class Supplier
{
// = TITLE
// Simple supplier object
//
// = DESCRIPTION
// This class is a supplier of events.
//
public:
Supplier (void);
// Constructor
~Supplier ();
// Destructor.
int run (int argc, char* argv[]);
// Run the test
private:
// = Data Members
CORBA::ORB_var orb_;
// The ORB that we use.
CosNaming::NamingContext_var naming_context_;
// Handle to the name service.
DsNotifyLogAdmin::NotifyLogFactory_var notify_log_factory_;
// The notify log factory from the Log Service.
DsNotifyLogAdmin::NotifyLog_var notify_log_;
Filter_StructuredPushSupplier* supplier_1;
CosNotifyChannelAdmin::SupplierAdmin_var supplier_admin_;
};
class Filter_StructuredPushSupplier
: public POA_CosNotifyComm::StructuredPushSupplier
{
// = TITLE
// Filter_StructuredPushSupplier
//
// = DESCRIPTION
// Supplier for the filter example.
//
public:
// = Initialization and Termination code
Filter_StructuredPushSupplier (void);
// Constructor.
void connect (CosNotifyChannelAdmin::SupplierAdmin_ptr supplier_admin
ACE_ENV_ARG_DECL);
// Connect the Supplier to the EventChannel.
// Creates a new proxy supplier and connects to it.
void disconnect (void);
// Disconnect from the supplier.
virtual void send_event (const CosNotification::StructuredEvent& event
ACE_ENV_ARG_DECL);
// Send one event.
protected:
// = Data members
CosNotifyChannelAdmin::StructuredProxyPushConsumer_var proxy_consumer_;
// The proxy that we are connected to.
CosNotifyChannelAdmin::ProxyID proxy_consumer_id_;
// This supplier's id.
// = Protected Methods
virtual ~Filter_StructuredPushSupplier ();
// Destructor
// = NotifySubscribe
virtual void subscription_change (
const CosNotification::EventTypeSeq & added,
const CosNotification::EventTypeSeq & removed
ACE_ENV_ARG_DECL
)
ACE_THROW_SPEC ((
CORBA::SystemException,
CosNotifyComm::InvalidEventType
));
// = StructuredPushSupplier method
virtual void disconnect_structured_push_supplier (
ACE_ENV_SINGLE_ARG_DECL
)
ACE_THROW_SPEC ((
CORBA::SystemException
));
};
#endif /* NOTIFY_SUPPLIER_H */
|