Servant locators are provided for backward compatibility with earlier versions of Ice.
You should consider using a default servant instead (see ObjectAdapter.addDefaultServant(com.zeroc.Ice.Object, java.lang.String)).
For more advanced use cases, you can create a middleware (see ObjectAdapter.use(java.util.function.Function<com.zeroc.Ice.Object, com.zeroc.Ice.Object>)).
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic classHolds the result of callinglocate(com.zeroc.Ice.Current). -
Method Summary
Modifier and TypeMethodDescriptionvoiddeactivate(String category) Notifies this servant locator that the object adapter in which it's installed is being deactivated.voidNotifies this servant locator that the dispatch on the servant returned bylocate(com.zeroc.Ice.Current)is complete.Asks this servant locator to find and return a servant.
-
Method Details
-
locate
Asks this servant locator to find and return a servant.The caller (the object adapter) does not insert the returned servant into its Active Servant Map. This must be done by the servant locator implementation, if this is desired.
If you call
locatefrom your own code, you must also callfinished(com.zeroc.Ice.Current, com.zeroc.Ice.Object, java.lang.Object)when you have finished using the servant, provided thatlocatereturned a non-null servant.- Parameters:
curr- information about the incoming request for which a servant is required- Returns:
- an instance of
ServantLocator.LocateResultcontaining the located servant, ornullif no suitable servant was found - Throws:
UserException- The implementation can throw any exception, includingUserException. The Ice runtime will marshal this exception in the response.- See Also:
-
finished
Notifies this servant locator that the dispatch on the servant returned bylocate(com.zeroc.Ice.Current)is complete. The object adapter calls this method only whenlocate(com.zeroc.Ice.Current)returns a non-null servant.- Parameters:
curr- information about the incoming request for which a servant was locatedservant- the servant that was returned bylocate(com.zeroc.Ice.Current)cookie- the cookie that was returned bylocate(com.zeroc.Ice.Current)- Throws:
UserException- The implementation can throw any exception, includingUserException. The Ice runtime will marshal this exception in the response. If both the dispatch andfinishedthrow an exception, the exception thrown byfinishedprevails and is marshaled back to the client.
-
deactivate
Notifies this servant locator that the object adapter in which it's installed is being deactivated.- Parameters:
category- the category with which this servant locator was registered- See Also:
-