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__PROXYMANAGER_H
00025 #define OMNIEVENTS__PROXYMANAGER_H
00026
00027 #ifdef HAVE_CONFIG_H
00028 # include "config.h"
00029 #endif
00030
00031 #include <set>
00032 #include <string>
00033
00034 #ifdef HAVE_IOSTREAM
00035 # include <iostream>
00036 #else
00037 # include <iostream.h>
00038 #endif
00039
00040 #include "Servant.h"
00041
00042 #ifdef HAVE_STD_IOSTREAM
00043 using namespace std;
00044 #endif
00045
00046 namespace OmniEvents {
00047
00048 class Proxy;
00049 class PersistNode;
00050
00057 class ProxyManager
00058 : public virtual POA_PortableServer::ServantActivator,
00059 public Servant
00060 {
00061 public:
00063 void etherealize(
00064 const PortableServer::ObjectId& oid,
00065 PortableServer::POA_ptr adapter,
00066 PortableServer::Servant serv,
00067 CORBA::Boolean cleanup_in_progress,
00068 CORBA::Boolean remaining_activations
00069 );
00070
00071 public:
00073 void reincarnate(const PersistNode& node);
00075 void output(ostream& os);
00076
00077 protected:
00079 ProxyManager(PortableServer::POA_ptr poa);
00080 virtual ~ProxyManager();
00081
00087 void activate(const char* name);
00088
00090 set<Proxy*> _servants;
00095 PortableServer::POA_var _managedPoa;
00096 };
00097
00098
00104 class Proxy
00105 : public virtual PortableServer::ServantBase,
00106 public Servant
00107 {
00108 public:
00109 virtual ~Proxy();
00111 virtual void reincarnate(const string& oid, const PersistNode& node)=0;
00113 virtual void output(ostream &os)=0;
00114 protected:
00115 Proxy(PortableServer::POA_ptr poa);
00116
00118 void keyOutput(ostream& os, const char* name);
00120 void eraseKey(const char* name);
00122 void basicOutput(
00123 ostream& os, const char* name,
00124 CORBA::Object_ptr target=CORBA::Object::_nil(),
00125 const char* extraAttributes=NULL
00126 );
00127
00128 CORBA::Request_var _req;
00129 private:
00130 Proxy(const Proxy&);
00131 };
00132
00133
00134 };
00135
00136 #endif // OMNIEVENTS__PROXYMANAGER_H