Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  

ProxyManager.h

Go to the documentation of this file.
00001 //                            Package   : omniEvents
00002 // ProxyManager.h             Created   : 2003/12/04
00003 //                            Author    : Alex Tingle
00004 //
00005 //    Copyright (C) 2003 Alex Tingle.
00006 //
00007 //    This file is part of the omniEvents application.
00008 //
00009 //    omniEvents is free software; you can redistribute it and/or
00010 //    modify it under the terms of the GNU Lesser General Public
00011 //    License as published by the Free Software Foundation; either
00012 //    version 2.1 of the License, or (at your option) any later version.
00013 //
00014 //    omniEvents is distributed in the hope that it will be useful,
00015 //    but WITHOUT ANY WARRANTY; without even the implied warranty of
00016 //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00017 //    Lesser General Public License for more details.
00018 //
00019 //    You should have received a copy of the GNU Lesser General Public
00020 //    License along with this library; if not, write to the Free Software
00021 //    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
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 #include "oep_types.h"
00042 
00043 #include <omniORB4/CORBA.h>
00044 
00045 #ifdef HAVE_STD_IOSTREAM
00046 using namespace std;
00047 #endif
00048 
00049 namespace OmniEvents {
00050 
00051 class Proxy;
00052 
00059 class ProxyManager
00060 : public virtual POA_PortableServer::ServantActivator,
00061   public Servant
00062 {
00063 public: // CORBA interface methods
00065   void etherealize(
00066     const PortableServer::ObjectId& oid,
00067     PortableServer::POA_ptr         adapter,
00068     PortableServer::Servant         serv,
00069     CORBA::Boolean                  cleanup_in_progress,
00070     CORBA::Boolean                  remaining_activations
00071   );
00072 
00073 public:
00075   void reincarnate(const OepPrxyList& pdat);
00077   void output(ostream& os);
00078 
00079 protected:
00084   ProxyManager(PortableServer::POA_ptr poa, const char* name);
00085   virtual ~ProxyManager();
00086 
00088   set<Proxy*>             _servants;
00093   PortableServer::POA_var _managedPoa;
00094 };
00095 
00096 
00102 class Proxy
00103 : public virtual PortableServer::ServantBase,
00104   public Servant
00105 {
00106 public:
00107   virtual ~Proxy();
00109   virtual void reincarnate(const OEP_prxy& prxy)=0;
00111   virtual void output(ostream &os)=0;
00112 protected:
00113   Proxy(PortableServer::POA_ptr poa);
00114 
00119   bool gotException();
00120  
00121   CORBA::Request_var _req;
00122 private:
00123   Proxy(const Proxy&); // NO IMPLEMENTATION
00124 };
00125 
00126 
00127 }; // end namespace OmniEvents
00128 
00129 #endif // OMNIEVENTS__PROXYMANAGER_H

Generated on Fri Dec 12 10:53:02 2003 for OmniEvents by doxygen1.2.15