Archived
This forum has been archived. Please start a new discussion on GitHub.
Can a Servant implement both dynamic and static invocations
zaoliu
in Help Center
From the docs it seems that a Servant that want to use Dynamic Invocation needs to extend Ice.Blobject but than, using Java, it will not be able to extends the class generated from Slice.
0
Comments
-
Hi,
You are correct, a single servant cannot handle both dynamic and static invocations. If you can determine from the information in Ice.Current whether a request should be handled by a Blobject servant or a regular servant, you can use a servant locator to route a request to the proper servant.
Hope that helps,
Mark0 -
Ice.Current contains information such as the name of the operation and the identity of the Ice object. If you can decide based on this information whether the request should be dispatched using a dynamic or static servant, then you can use a servant locator for this purpose.aozarov wrote: »1. How can I determine that from the Ice.Current
No, the purpose of a servant locator is to supply a servant for each incoming request. The servant locator is provided with the Ice.Current object that will eventually be passed to the servant returned by the locator.2. Isn't that too late? That is done in the Servant/Skeleton that was dispatched, no?
Take care,
Mark0 -
Hi,
Locators and servant locators are two different concepts. You can read about servant locators here.
Take care,
Mark0 -
Thanks, I was aware of that but thought you were referring to client side interception. Assuming you were actually referring to server side interception by using the ServantLocator I can clearly see how it can work.
BTW, Any reason not to make any generated Skeleton extends Blobject instead of extending directly ObjectImpl and considering the ice_invoke method (which can throw "not support" exception as default implementation?0
