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__PROXYPUSHSUPPLIER_H
00025 #define OMNIEVENTS__PROXYPUSHSUPPLIER_H
00026
00027 #ifdef HAVE_CONFIG_H
00028 # include "config.h"
00029 #endif
00030
00031 #ifdef HAVE_IOSTREAM
00032 # include <iostream>
00033 #else
00034 # include <iostream.h>
00035 #endif
00036
00037 #include "ProxyManager.h"
00038 #include "EventQueue.h"
00039
00040 #include "CosEventChannelAdmin.hh"
00041
00042 #ifdef HAVE_STD_IOSTREAM
00043 using namespace std;
00044 #endif
00045
00046 namespace OmniEvents {
00047
00048 class ProxyPushSupplierManager
00049 : public ProxyManager,
00050 public omni_thread
00051 {
00052 public:
00053 PortableServer::Servant incarnate(
00054 const PortableServer::ObjectId& oid,
00055 PortableServer::POA_ptr poa
00056 );
00058 void etherealize(
00059 const PortableServer::ObjectId& oid,
00060 PortableServer::POA_ptr adapter,
00061 PortableServer::Servant serv,
00062 CORBA::Boolean cleanup_in_progress,
00063 CORBA::Boolean remaining_activations
00064 );
00065 public:
00066 ProxyPushSupplierManager(PortableServer::POA_ptr parentPoa,EventQueue& q);
00067 CosEventChannelAdmin::ProxyPushSupplier_ptr createObject();
00068 void* run_undetached(void*);
00069
00070 omni_mutex _lock;
00071 omni_condition _condition;
00072 private:
00073 EventQueue& _queue;
00074 omni_mutex _conditionLock;
00075 bool _shutdownRequested;
00076 };
00077
00078
00079 class ProxyPushSupplier_i
00080 : public virtual POA_CosEventChannelAdmin::ProxyPushSupplier,
00081 public Proxy,
00082 public EventQueue::Reader
00083 {
00084 public:
00085 void connect_push_consumer(CosEventComm::PushConsumer_ptr pushConsumer);
00086 void disconnect_push_supplier();
00087 public:
00088 ProxyPushSupplier_i(PortableServer::POA_ptr poa, EventQueue& q);
00089 bool trigger();
00090 void reincarnate(const OEP_prxy& prxy);
00091 void output(ostream &os);
00092 private:
00093 CosEventComm::PushConsumer::_var_type _target;
00094 };
00095
00096
00097 };
00098
00099 #endif // OMNIEVENTS__PROXYPUSHSUPPLIER_H