diff options
Diffstat (limited to 'trunk/TAO/examples/POA/Forwarding/Servant_Activator.h')
-rw-r--r-- | trunk/TAO/examples/POA/Forwarding/Servant_Activator.h | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/trunk/TAO/examples/POA/Forwarding/Servant_Activator.h b/trunk/TAO/examples/POA/Forwarding/Servant_Activator.h new file mode 100644 index 00000000000..7b559180569 --- /dev/null +++ b/trunk/TAO/examples/POA/Forwarding/Servant_Activator.h @@ -0,0 +1,65 @@ +// -*- C++ -*- +// $Id$ + +// ================================================================ +// +// = LIBRARY +// TAO/examples/POA/Forwarding +// +// = FILENAME +// Servant_Activator.h +// +// = DESCRIPTION +// Defines a ServantActivator class, used with a POA having a +// RETAIN policy +// +// = AUTHOR +// Irfan Pyarali +// Michael Kircher +// +// ================================================================ + +#ifndef SERVANT_ACTIVATOR_H +#define SERVANT_ACTIVATOR_H + +#include "tao/ORB.h" +#include "tao/PortableServer/PortableServer.h" +#include "tao/PortableServer/ServantActivatorC.h" +#include "tao/LocalObject.h" + +class ServantActivator : + public virtual PortableServer::ServantActivator, + public virtual TAO_Local_RefCounted_Object +{ + // = TITLE + // This class is used by a POA with USE_SERVANT_MANAGER and + // RETAIN policy. +public: + ServantActivator (CORBA::ORB_ptr orb, + CORBA::Object_ptr forward_to); + + virtual PortableServer::Servant incarnate (const PortableServer::ObjectId & oid, + PortableServer::POA_ptr adapter + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException, + PortableServer::ForwardRequest)); + + virtual void etherealize (const PortableServer::ObjectId & oid, + PortableServer::POA_ptr adapter, + PortableServer::Servant serv, + CORBA::Boolean cleanup_in_progress, + CORBA::Boolean remaining_activations + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + void forward_requests (ACE_ENV_SINGLE_ARG_DECL); + // Object should be forwarded from now on. + +private: + CORBA::ORB_var orb_; + + CORBA::Object_var forward_to_; + // Location to forward to +}; + +#endif /* SERVANT_ACTIVATOR_H */ |