Package com.zeroc.Ice
Interface ServantLocator
public interface ServantLocator
A servant locator is called by an object adapter to
locate a servant that is not found in its active servant map.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic classHolds the result of operation locate. -
Method Summary
Modifier and TypeMethodDescriptionvoiddeactivate(String category) Called when the object adapter in which this servant locator is installed is destroyed.voidCalled by the object adapter after a request has been made.Called before a request is dispatched if a servant cannot be found in the object adapter's active servant map.
-
Method Details
-
locate
Called before a request is dispatched if a servant cannot be found in the object adapter's active servant map. Note that the object adapter does not automatically insert the returned servant into its active servant map. This must be done by the servant locator implementation, if this is desired.locatecan throw any user exception. If it does, that exception is marshaled back to the client. If the Slice definition for the corresponding operation includes that user exception, the client receives that user exception; otherwise, the client receivesUnknownUserException. Iflocatethrows any exception, the Ice run time does not callfinished.If you call
locatefrom your own code, you must also callfinishedwhen you have finished using the servant, provided thatlocatereturned a non-null servant; otherwise, you will get undefined behavior if you use servant locators such as the Freeze Evictor.- Parameters:
curr- Information about the current operation for which a servant is required.- Returns:
- An instance of ServantLocator.LocateResult.
- Throws:
UserException- The implementation can raise a UserException and the run time will marshal it as the result of the invocation.- See Also:
-
finished
Called by the object adapter after a request has been made. This operation is only called iflocatewas called prior to the request and returned a non-null servant. This operation can be used for cleanup purposes after a request.finishedcan throw any user exception. If it does, that exception is marshaled back to the client. If the Slice definition for the corresponding operation includes that user exception, the client receives that user exception; otherwise, the client receivesUnknownUserException. If both the operation andfinishedthrow an exception, the exception thrown byfinishedis marshaled back to the client.- Parameters:
curr- Information about the current operation call for which a servant was located bylocate.servant- The servant that was returned bylocate.cookie- The cookie that was returned bylocate.- Throws:
UserException- The implementation can raise a UserException and the run time will marshal it as the result of the invocation.- See Also:
-
deactivate
Called when the object adapter in which this servant locator is installed is destroyed.- Parameters:
category- Indicates for which category the servant locator is being deactivated.- See Also:
-