View Single Post
  #1 (permalink)  
Old 03-28-2004
Jonathan Jonathan is offline
Registered User
 
 
Join Date: Dec 2003
Posts: 5
Question Self access problem

A simple interface as below:
Code:
interface Hello
{
	string say();
};
and its implementation has been registered as a global object "hello" during initialization:
Code:
	Ice::ObjectPtr object = new HelloI();
	Ice::ObjectPrx obj = _adapter->add(object, Ice::stringToIdentity("hello"));
	IcePack::AdminPrx admin = IcePack::AdminPrx::checkedCast(
		communicator->stringToProxy("IcePack/Admin")
	);
	admin->addObjectWithType(obj, "::Hello");
The problem is, inside the implemetation of Hello::say, cannot I access the "hello" object? The following code could not run.
Code:
::std::string
HelloI::say(const Ice::Current& current)
{
	// thread blocked here
	HelloPrx hello = HelloPrx::checkedCast(
		current.adapter->getCommunicator()->stringToProxy("hello")
	);
	return "hi";
}
What's wrong?

Last edited by Jonathan : 03-29-2004 at 10:08 AM.
Reply With Quote