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

it_bus/servant.h

00001 #ifndef _IT_BUS_SERVANT_H_
00002 #define _IT_BUS_SERVANT_H_
00003 
00004 // @Copyright 2002 IONA Technologies, Plc. All Rights Reserved.
00005 //
00006 
00007 #include <it_bus/api_defines.h>
00008 #include <it_bus/operation.h>
00009 #include <it_bus/port.h>
00010 #include <it_bus/bus.h>
00011 #include <it_bus/string_map.h>
00012 #include <it_ts/mutex.h>
00013 #include <it_bus/logging_defs.h>
00014 
00015 namespace IT_Bus
00016 {
00023     class IT_BUS_API Servant
00024     {
00025       public:
00031         IT_EXPLICIT Servant(
00032             Bus_ptr bus
00033         );
00034 
00038         virtual ~Servant();
00039 
00053         virtual void dispatch(
00054             ServerOperation & server_operation
00055         ) = 0;
00056 
00080         virtual void 
00081         asynchronous_exception(
00082             IT_Bus::Exception& e
00083         );
00084         
00091         virtual Bus_ptr 
00092         get_bus() const;
00093         
00104         virtual void 
00105         activated(
00106             Port&
00107         );
00108         
00119         virtual void 
00120         deactivated(
00121             Port&
00122         );
00123         
00132         virtual Servant*
00133         clone() const;
00134 
00143         virtual void
00144         destroy(
00145             Servant* servant
00146         ) const ;
00147         
00148       protected:
00149         Bus_var m_bus;          
00150         IT_DECLARE_BUS_LOGGER_MEM
00151         
00152       private:
00153         Servant();
00154     };
00155     
00169     class IT_BUS_API WrapperServant : public IT_Bus::Servant
00170     {
00171       public:
00172         IT_EXPLICIT WrapperServant(
00173             IT_Bus::Servant& servant
00174         );
00175         
00176         virtual void 
00177         activated(
00178             Port&
00179         );
00180         
00181         virtual void 
00182         deactivated(
00183             Port&
00184         );
00185         
00186       protected:
00187         IT_Bus::Servant& m_servant;
00188     };
00189 
00190     class PerThreadServantImpl;
00191 
00196     class IT_BUS_API PerThreadServant : public IT_Bus::WrapperServant
00197     {
00198       public:
00204         IT_EXPLICIT PerThreadServant(
00205             IT_Bus::Servant& servant
00206         );
00207 
00211         virtual ~PerThreadServant();
00212 
00213         virtual void dispatch(
00214             ServerOperation & server_operation
00215         );
00216 
00217       private:
00218         PerThreadServantImpl* m_impl;
00219     };
00220 
00227     class IT_BUS_API PerInvocationServant : public IT_Bus::WrapperServant
00228     {
00229       public:
00235         PerInvocationServant(
00236             IT_Bus::Servant& servant
00237         );
00238         
00239         virtual void dispatch(
00240             ServerOperation & server_operation
00241         );
00242     };
00243 
00248     class IT_BUS_API SerializedServant : public IT_Bus::WrapperServant
00249     {
00250       public:
00256         SerializedServant(
00257             IT_Bus::Servant& servant
00258         );
00259         
00260         virtual void dispatch(
00261             ServerOperation & server_operation
00262         );
00263         
00264       private:
00265         IT_Mutex m_mutex;
00266     };   
00267 }
00268 
00269 #endif  

Generated on Wed Mar 22 12:23:07 2006 for Artix by  doxygen 1.3.9.1