42 const PortableServer::ObjectId& oid,
43 PortableServer::POA_ptr adapter,
44 PortableServer::Servant serv,
45 CORBA::Boolean cleanup_in_progress,
46 CORBA::Boolean remaining_activations
49 auto_ptr<Proxy> narrowed(
dynamic_cast<Proxy*
>(serv) );
50 assert(narrowed.get()!=NULL);
51 set<Proxy*>::iterator pos =
_servants.find(narrowed.get());
55 DB(1,
"\t\teh? - POA attempted to etherealize unknown servant.");
63 for(map<string,PersistNode*>::const_iterator i=node.
_child.begin();
67 assert(i->second!=NULL);
68 PortableServer::Servant serv =
69 this->incarnate(PortableServer::ObjectId(),
_managedPoa);
76 catch(CORBA::BAD_PARAM& ex)
79 DB(5,
"Failed to reincarnate proxy: "<<i->first.c_str());
99 _managedPoa(PortableServer::POA::_nil())
105 using namespace PortableServer;
116 CORBA::PolicyList policies;
118 policies[0]=
_poa->create_lifespan_policy(PERSISTENT);
119 policies[1]=
_poa->create_id_assignment_policy(USER_ID);
120 policies[2]=
_poa->create_implicit_activation_policy(NO_IMPLICIT_ACTIVATION);
121 policies[3]=
_poa->create_request_processing_policy(USE_SERVANT_MANAGER);
122 policies[4]=
_poa->create_thread_policy(SINGLE_THREAD_MODEL);
127 CORBA::String_var parentName =
_poa->the_name();
128 string poaName =string(parentName.in())+
"."+name;
129 POAManager_var parentManager =
_poa->the_POAManager();
130 _managedPoa=
_poa->create_POA(poaName.c_str(),parentManager.in(),policies);
132 catch(POA::AdapterAlreadyExists& ex)
134 DB(0,
"ProxyManager::ProxyManager() - POA::AdapterAlreadyExists")
136 catch(POA::InvalidPolicy& ex)
138 DB(0,
"ProxyManager::ProxyManager() - POA::InvalidPolicy: "<<ex.index)
142 for(CORBA::ULong i=0; i<policies.length(); ++i)
143 policies[i]->destroy();
145 string oidStr =string(name)+
"Manager";
147 PortableServer::ServantManager_var manager(_this());
165 if(!CORBA::is_nil(
_req))
168 _req=CORBA::Request::_nil();
174 _req(CORBA::Request::_nil())
181 PortableServer::POA_var parentPoa=
_poa->the_parent();
182 CORBA::String_var channelName=parentPoa->the_name();
184 PortableServer::ObjectId_var oid=
_poa->servant_to_id(
this);
185 CORBA::String_var oidStr =PortableServer::ObjectId_to_string(oid.in());
186 os<<
"ecf/"<<channelName.in()<<
"/"<<name<<
"/"<<oidStr.in();
204 CORBA::Object_ptr target,
205 const char* extraAttributes
209 if(!CORBA::is_nil(target))
211 CORBA::String_var iorstr =
Orb::inst().
_orb->object_to_string(target);
212 os<<
" IOR="<<iorstr.in();
static bool exists()
Library code may create Event Service objects without the need for persistency.
Obtains an output stream to the active persistancy logfile, and locks it for exclusive access.
void deferredRequest(CORBA::Request_ptr req, Callback *callback=NULL)
Adopts the request and then stores it in _deferredRequests.
map< string, PersistNode * > _child
ProxyManager(PortableServer::POA_ptr poa)
void activate(const char *name)
Creates the Proxy-type's POA, and registers this object as its ServantManager.
set< Proxy * > _servants
The set of all active Proxies in this object's _managedPoa.
void reincarnate(const PersistNode &node)
Re-create servants from information saved in the log file.
PortableServer::POA_var _managedPoa
The POA owned & managed by this object.
void output(ostream &os)
Save this object's state to a stream.
void etherealize(const PortableServer::ObjectId &oid, PortableServer::POA_ptr adapter, PortableServer::Servant serv, CORBA::Boolean cleanup_in_progress, CORBA::Boolean remaining_activations)
Implements etherealize() method from ServantActivator interface.
Base class for three of the four Proxy servants.
void basicOutput(ostream &os, const char *name, CORBA::Object_ptr target=CORBA::Object::_nil(), const char *extraAttributes=NULL)
Helper method for constructing persistency output.
virtual void output(ostream &os)=0
Save this object's state to a stream.
virtual void reincarnate(const string &oid, const PersistNode &node)=0
Re-create a servant from information saved in the log file.
Proxy(PortableServer::POA_ptr poa)
void eraseKey(const char *name)
Helper method for constructing persistency output.
void keyOutput(ostream &os, const char *name)
Helper method for constructing persistency output.
PortableServer::POA_var _poa
void activateObjectWithId(const char *oidStr)
Calls activate_object_with_id() to activate this servant in its POA.