OmniEvents
ProxyPullConsumer.h
Go to the documentation of this file.
1// Package : omniEvents
2// ProxyPullCOnsumer.h Created : 2003/12/04
3// Author : Alex Tingle
4//
5// Copyright (C) 2003-2005 Alex Tingle.
6//
7// This file is part of the omniEvents application.
8//
9// omniEvents is free software; you can redistribute it and/or
10// modify it under the terms of the GNU Lesser General Public
11// License as published by the Free Software Foundation; either
12// version 2.1 of the License, or (at your option) any later version.
13//
14// omniEvents is distributed in the hope that it will be useful,
15// but WITHOUT ANY WARRANTY; without even the implied warranty of
16// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17// Lesser General Public License for more details.
18//
19// You should have received a copy of the GNU Lesser General Public
20// License along with this library; if not, write to the Free Software
21// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22//
23
24#ifndef OMNIEVENTS__PROXYPULLCONSUMER_H
25#define OMNIEVENTS__PROXYPULLCONSUMER_H
26
27#ifdef HAVE_CONFIG_H
28# include "config.h"
29#endif
30
31#include <list>
32
33#ifdef HAVE_IOSTREAM
34# include <iostream>
35#else
36# include <iostream.h>
37#endif
38
39#include "ProxyManager.h"
40
41#include "CosEventChannelAdmin.hh"
42
43#ifdef HAVE_STD_IOSTREAM
44using namespace std;
45#endif
46
47namespace OmniEvents {
48
50: public ProxyManager,
51 public PortableServer::RefCountServantBase
52{
53public: // CORBA interface methods
54 PortableServer::Servant incarnate(
55 const PortableServer::ObjectId& oid,
56 PortableServer::POA_ptr poa
57 );
58public:
60 PortableServer::POA_ptr parentPoa,
62 );
65 CosEventChannelAdmin::ProxyPullConsumer_ptr createObject();
66
77 void collect();
78
83 void triggerRequest();
84
86 void disconnect();
87
88private:
90};
91
92
101: public virtual POA_CosEventChannelAdmin::ProxyPullConsumer,
102 public Proxy
103{
104public: // CORBA interface methods
105 void connect_pull_supplier(CosEventComm::PullSupplier_ptr pullSupplier);
107public:
108 ProxyPullConsumer_i(PortableServer::POA_ptr poa, list<CORBA::Any*>& q);
110
112 void collect();
114 void triggerRequest();
115
116 void reincarnate(const string& oid, const PersistNode& node);
117 void output(ostream& os);
118private:
119 CosEventComm::PullSupplier_var _target;
121
123 enum Mode { Pull=0, TryPull=1 };
125
130};
131
132}; // end namespace OmniEvents
133
134#endif // OMNIEVENTS__PROXYPULLCONSUMER_H
#define OMNIEVENTS__DEBUG_REF_COUNTS__DECL
Declares debug versions of _add/remove_ref().
Definition Servant.h:68
T::_ptr_type createNarrowedReference(PortableServer::POA_ptr poa, const char *repositoryId)
Helper method that creates a new CORBA object and then narrows it to the appropriate type.
Definition Servant.h:96
Base class for ServantActivator classes that manage Proxy servants.
Base class for three of the four Proxy servants.
void disconnect()
Send disconnect_pull_supplier() to all connected PullSuppliers.
void triggerRequest()
For each connected proxy, if there is no request in progress, send a new request to the current opera...
void collect()
Collects events that have arrived at connected proxies.
PortableServer::Servant incarnate(const PortableServer::ObjectId &oid, PortableServer::POA_ptr poa)
OMNIEVENTS__DEBUG_REF_COUNTS__DECL CosEventChannelAdmin::ProxyPullConsumer_ptr createObject()
Implementation of the ProxyPullConsumer interface.
void output(ostream &os)
Save this object's state to a stream.
Mode
This proxy can call out in either pull() or try_pull() mode.
CosEventComm::PullSupplier_var _target
int _exceptionCount
Only when two consecutive exceptions have been received from each mode, do we consider the connection...
void connect_pull_supplier(CosEventComm::PullSupplier_ptr pullSupplier)
void reincarnate(const string &oid, const PersistNode &node)
Re-create a servant from information saved in the log file.
void triggerRequest()
When _req is NIL, sends out a new pull() or try_pull() call.
void collect()
Collects responses since the last trigger.