00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef OMNIEVENTS__PROXYPULLCONSUMER_H
00025 #define OMNIEVENTS__PROXYPULLCONSUMER_H
00026
00027 #ifdef HAVE_CONFIG_H
00028 # include "config.h"
00029 #endif
00030
00031 #include <list>
00032
00033 #ifdef HAVE_IOSTREAM
00034 # include <iostream>
00035 #else
00036 # include <iostream.h>
00037 #endif
00038
00039 #include "ProxyManager.h"
00040
00041 #include "CosEventChannelAdmin.hh"
00042
00043 #ifdef HAVE_STD_IOSTREAM
00044 using namespace std;
00045 #endif
00046
00047 namespace OmniEvents {
00048
00049 class ProxyPullConsumerManager
00050 : public ProxyManager,
00051 public PortableServer::RefCountServantBase
00052 {
00053 public:
00054 PortableServer::Servant incarnate(
00055 const PortableServer::ObjectId& oid,
00056 PortableServer::POA_ptr poa
00057 );
00058 public:
00059 ProxyPullConsumerManager(
00060 PortableServer::POA_ptr parentPoa,
00061 list<CORBA::Any*>& q
00062 );
00063 ~ProxyPullConsumerManager();
00064 CosEventChannelAdmin::ProxyPullConsumer_ptr createObject();
00065
00076 void collect();
00077
00082 void triggerRequest();
00083
00085 void disconnect();
00086
00087 private:
00088 list<CORBA::Any*>& _queue;
00089 };
00090
00091
00099 class ProxyPullConsumer_i
00100 : public virtual POA_CosEventChannelAdmin::ProxyPullConsumer,
00101 public Proxy
00102 {
00103 public:
00104 void connect_pull_supplier(CosEventComm::PullSupplier_ptr pullSupplier);
00105 void disconnect_pull_consumer();
00106 public:
00107 ProxyPullConsumer_i(PortableServer::POA_ptr poa, list<CORBA::Any*>& q);
00108 ~ProxyPullConsumer_i();
00109
00111 void collect();
00113 void triggerRequest();
00114
00115 void reincarnate(const string& oid, const PersistNode& node);
00116 void output(ostream& os);
00117 private:
00118 CosEventComm::PullSupplier_var _target;
00119 list<CORBA::Any*>& _queue;
00120
00122 enum Mode { Pull=0, TryPull=1 };
00123 Mode _mode;
00124
00128 int _exceptionCount;
00129 };
00130
00131 };
00132
00133 #endif // OMNIEVENTS__PROXYPULLCONSUMER_H