|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface ServiceLocator
This is the entry point for clients of the Service Locator. To access the
Service Locator clients have to first connect to the
Service 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 session timeout
parameter.
The Service Locator provides the following operations.
ServiceLocator.PostConnectAction should be
set that registers all
endpoints again and so marks them as live.
| Nested Class Summary | |
|---|---|
static interface |
ServiceLocator.PostConnectAction
Callback interface to define actions that must be executed after a successful connect or reconnect. |
| Method Summary | |
|---|---|
void |
connect()
Establish a connection to the Service Locator. |
void |
disconnect()
Disconnects from a Service Locator server. |
SLEndpoint |
getEndpoint(QName serviceName,
String endpoint)
Return the complete endpoint information for the given endpoint registered for the given service. |
List<String> |
getEndpointNames(QName serviceName)
For the given service return all endpoints that currently registered at the Service Locator Service. |
List<SLEndpoint> |
getEndpoints(QName serviceName)
Return the complete endpoint informations for all endpoints registered for the given service. |
List<QName> |
getServices()
Return all services for which endpoints are registered at the Service Locator Service. |
List<String> |
lookup(QName serviceName)
For the given service return all endpoints that are currently registered at the Service Locator. |
List<String> |
lookup(QName serviceName,
SLPropertiesMatcher matcher)
For the given service return all endpoints that are currently registered at the Service Locator and where the custom properties match the given matcher. |
void |
register(Endpoint eprProvider)
For a given service register the endpoint as defined in the given EndpointProvider. |
void |
register(Endpoint eprProvider,
boolean persistent)
For a given service register the endpoint as defined in the given EndpointProvider. |
void |
register(QName serviceName,
String endpoint)
For a given service register the endpoint of a concrete provider of this service. |
void |
register(QName serviceName,
String endpoint,
boolean persistent)
|
void |
register(QName serviceName,
String endpoint,
SLProperties properties)
For a given service register the endpoint of a concrete provider of this service. |
void |
register(QName serviceName,
String endpoint,
SLProperties properties,
boolean persistent)
|
void |
removeEndpoint(QName serviceName,
String endpoint)
Remove the given endpoint from the list of endpoints of the given service. |
void |
setPostConnectAction(ServiceLocator.PostConnectAction postConnectAction)
Specify the action to be be executed after the Service Locator has connected to the server. |
void |
unregister(Endpoint epProvider)
For a given service unregister a previously registered endpoint. |
void |
unregister(QName serviceName,
String endpoint)
For a given service unregister a previously registered endpoint. |
| Method Detail |
|---|
void connect()
throws InterruptedException,
ServiceLocatorException
ServiceLocator.PostConnectAction is run. If the session
to the server expires because the server could not be reached within the
specified time, a reconnect is
automatically executed as soon as the server can be reached again.
Because after a session time out all registered endpoints are removed it
is important to specify a ServiceLocator.PostConnectAction that re-registers all
endpoints.
InterruptedException - the current Thread was interrupted when waiting
for a successful connection to the ServiceLocator
ServiceLocatorException - the connect operation failed
void disconnect()
throws InterruptedException,
ServiceLocatorException
connect again.
InterruptedException - the current Thread was interrupted when waiting
for the disconnect to happen
ServiceLocatorException
void register(QName serviceName,
String endpoint)
throws ServiceLocatorException,
InterruptedException
The endpoint is categorized as being a SOAP / HTTP endpoint.
serviceName - the name of the service the endpoint is registered for, must
not be nullendpoint - the endpoint to register, must not be null
ServiceLocatorException - the server returned an error
InterruptedException - the current Thread was interrupted when waiting
for a response of the ServiceLocator
void register(QName serviceName,
String endpoint,
boolean persistent)
throws ServiceLocatorException,
InterruptedException
serviceName - endpoint - presistent -
ServiceLocatorException
InterruptedException
void register(QName serviceName,
String endpoint,
SLProperties properties)
throws ServiceLocatorException,
InterruptedException
serviceName - the name of the service the endpoint is registered for, must
not be nullendpoint - the endpoint to register, must not be nullproperties - custom properties of the endpoint that can be used as
additional selection criteria when doing a lookup.
ServiceLocatorException - the server returned an error
InterruptedException - the current Thread was interrupted when waiting
for a response of the ServiceLocator
void register(QName serviceName,
String endpoint,
SLProperties properties,
boolean persistent)
throws ServiceLocatorException,
InterruptedException
serviceName - endpoint - properties - persistent -
ServiceLocatorException
InterruptedException
void register(Endpoint eprProvider)
throws ServiceLocatorException,
InterruptedException
EndpointProvider. The endpoint is marked as live as long as this client is connected and the
session on the server is valid.
eprProvider - provides all the necessary information to register an endpoint like name of the service
for which to register the endpoint, the endpoint URL, must not be null.
ServiceLocatorException - the server returned an error
InterruptedException - the current Thread was interrupted when waiting for a response of the
ServiceLocator
void register(Endpoint eprProvider,
boolean persistent)
throws ServiceLocatorException,
InterruptedException
EndpointProvider. If the given persistent flag is not set the endpoint is marked as live as long
as this client is connected and the session on the server is valid. Otherwise it is marked live
independent of the sesion state.
eprProvider - provides all the necessary information to register an endpoint like name of the service
for which to register the endpoint, the endpoint URL, must not be null.persistent - iff true the endpoint is marked live until it is explicitly unregistered.
ServiceLocatorException - the server returned an error
InterruptedException - the current Thread was interrupted when waiting for a response of the
ServiceLocator
void unregister(QName serviceName,
String endpoint)
throws ServiceLocatorException,
InterruptedException
serviceName - the name of the service the endpoint is unregistered for, must
not be nullendpoint - the endpoint to unregister, must not be null
ServiceLocatorException - the server returned an error
InterruptedException - the current Thread was interrupted when waiting
for a response of the ServiceLocator
void unregister(Endpoint epProvider)
throws ServiceLocatorException,
InterruptedException
eprProvider - provides all the necessary information to unregister an endpoint like name of the service
for which to register the endpoint and the endpoint URL, must not be null.
ServiceLocatorException - the server returned an error
InterruptedException - the current Thread was interrupted when waiting for a response of the
ServiceLocator
void removeEndpoint(QName serviceName,
String endpoint)
throws ServiceLocatorException,
InterruptedException
getEndpoint(serviceName) the given endpoint will not be contained in the returned
list. In case no service with the given name exists or the given endpoint is not registered
with the service the state of the Service Locator remians unchanged.
- Parameters:
serviceName - the name of the service the endpoint is removed from, must not
be nullendpoint - the endpoint to remove, must not be null
- Throws:
ServiceLocatorException - the server returned an error
InterruptedException - the current Thread was interrupted when waiting
for a response of the ServiceLocator
List<QName> getServices()
throws InterruptedException,
ServiceLocatorException
ServiceLocatorException - the server returned an error
InterruptedException - the current Thread was interrupted when waiting
for a response of the ServiceLocator
SLEndpoint getEndpoint(QName serviceName,
String endpoint)
throws ServiceLocatorException,
InterruptedException
serviceName - the name of the service for which the endpoint is registered,
must not be nullendpoint - the endpoint for which to return the information, must not be
null
null if the
endpoint was not registered before
ServiceLocatorException - the server returned an error
InterruptedException - the current Thread was interrupted when waiting
for a response of the ServiceLocator
List<SLEndpoint> getEndpoints(QName serviceName)
throws ServiceLocatorException,
InterruptedException
serviceName - the name of the service for which the endpoints ares
registered, must not be null
ServiceLocatorException - the server returned an error
InterruptedException - the current Thread was interrupted when waiting
for a response of the ServiceLocator
List<String> getEndpointNames(QName serviceName)
throws ServiceLocatorException,
InterruptedException
serviceName - the name of the service for which to get the endpoints, must
not be null
ServiceLocatorException - the server returned an error
InterruptedException - the current Thread was interrupted when waiting
for a response of the ServiceLocator
List<String> lookup(QName serviceName)
throws ServiceLocatorException,
InterruptedException
serviceName - the name of the service for which to get the endpoints, must
not be null
ServiceLocatorException - the server returned an error
InterruptedException - the current Thread was interrupted when waiting
for a response of the ServiceLocator
List<String> lookup(QName serviceName,
SLPropertiesMatcher matcher)
throws ServiceLocatorException,
InterruptedException
serviceName - the name of the service for which to get the endpoints, must
not be nullmatcher - custom properties of the endpoints returned match the
criterias specified by this matcher
ServiceLocatorException - the server returned an error
InterruptedException - the current Thread was interrupted when waiting
for a response of the ServiceLocatorvoid setPostConnectAction(ServiceLocator.PostConnectAction postConnectAction)
postConnectAction - the action to be executed, must not be null.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||