This is the entry point for clients of the Service Locator. To access the Service Locator clients have to first {@link #connect() connect} to theService Locator to get a session assigned at the server. Once the connection is established the client will periodically send heart beats to the server to keep the session alive. The session gets invalidated if the client is destroyed, disconnected, or fails to successfully send the heart beat for a period of time defined by the {@link #setSessionTimeout(int) session timeoutparameter}.
The Service Locator provides the following operations.
- Register an endpoint for a specific service. If registered as non persistent an endpoint is marked live as long as the session of this client is alive or it is explicitly unregistered. If registered as persistent the endpoint is marked live until the endpoint is explicitly unregistered.
- Unregister an endpoint for a specific service. The endpoint is marked as non live, but still in the list of all endpoints for a service.
- Remove an endpoint for a specific service. The endpoint is removed from the list of endpoints for the given service.
- Look up all live endpoints for a specific service that were registered before by other clients.
- All services for which an endpoint was ever registered can be retrieved.
- For a specific service all endpoints that were ever registered can be retrieved whether they are currently live or not.
To ensure that all available endpoints are re-registered when the client reconnects after a session expired a {@link PostConnectAction} should be{@link #setPostConnectAction(PostConnectAction) set} that registers allendpoints again and so marks them as live.