Go Back   ZeroC Forums > Help Center

Reply
 
LinkBack Thread Tools Rate Thread Display Modes
  #1 (permalink)  
Old 03-06-2008
zaoliu zaoliu is offline
Registered User
 
Name: Zao Liu
Organization: HI5
Project: Performance test
 
Join Date: Mar 2008
Posts: 14
Can a Servant implement both dynamic and static invocations

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.
Reply With Quote
  #2 (permalink)  
Old 03-06-2008
mes's Avatar
mes mes is offline
ZeroC Staff
 
Name: Mark Spruiell
Organization: ZeroC, Inc.
Project: Ice Developer
 
Join Date: Feb 2003
Location: California
Posts: 971
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,
Mark
Reply With Quote
  #3 (permalink)  
Old 03-07-2008
aozarov aozarov is offline
Registered User
 
Name: Arie Ozarov
Organization: hi5 Networks
Project: SOA
 
Join Date: Mar 2008
Posts: 39
Thanks, but I am not sure I fully understand how to do that.
1. How can I determine that from the Ice.Current
2. Isn't that too late? That is done in the Servant/Skeleton that was dispatched, no?
Reply With Quote
  #4 (permalink)  
Old 03-07-2008
mes's Avatar
mes mes is offline
ZeroC Staff
 
Name: Mark Spruiell
Organization: ZeroC, Inc.
Project: Ice Developer
 
Join Date: Feb 2003
Location: California
Posts: 971
Quote:
Originally Posted by aozarov View Post
1. How can I determine that from the Ice.Current
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.

Quote:
2. Isn't that too late? That is done in the Servant/Skeleton that was dispatched, no?
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.

Take care,
Mark
Reply With Quote
  #5 (permalink)  
Old 03-07-2008
aozarov aozarov is offline
Registered User
 
Name: Arie Ozarov
Organization: hi5 Networks
Project: SOA
 
Join Date: Mar 2008
Posts: 39
Ok, thanks.
I see now. Assuming you are referring to Ice.LocatorPrx do you have any examples of changing the clients/proxy locator?
Can it delegate to the default locator (e.g. after renaming the object identity)?
Reply With Quote
  #6 (permalink)  
Old 03-07-2008
mes's Avatar
mes mes is offline
ZeroC Staff
 
Name: Mark Spruiell
Organization: ZeroC, Inc.
Project: Ice Developer
 
Join Date: Feb 2003
Location: California
Posts: 971
Hi,

Locators and servant locators are two different concepts. You can read about servant locators here.

Take care,
Mark
Reply With Quote
  #7 (permalink)  
Old 03-07-2008
aozarov aozarov is offline
Registered User
 
Name: Arie Ozarov
Organization: hi5 Networks
Project: SOA
 
Join Date: Mar 2008
Posts: 39
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?
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Object* add(Object servant, Identity id),can the servant be static object? russule Help Center 2 06-23-2007 08:19 AM
Unable to implement servant location in Ice for Python cmellon Help Center 1 01-04-2007 04:20 PM
Are client invocations dispatched in the calling thread? rhochmuth Help Center 5 02-06-2006 11:26 AM
A question about collocated invocations. OrNot Help Center 4 06-17-2005 12:08 PM
Help with servant implement minifat Help Center 6 08-18-2004 10:10 PM


All times are GMT -4. The time now is 08:23 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.0.0
(c) 2008 ZeroC, Inc.