org.talend.esb.servicelocator.client.internal
Interface ServiceLocatorBackend

All Known Implementing Classes:
ZKBackend

public interface ServiceLocatorBackend


Method Summary
 RootNode connect()
          Establish a connection to the Service Locator.
 void disconnect()
          Disconnects from a Service Locator server.
 boolean isConnected()
           
 void setPostConnectAction(ServiceLocator.PostConnectAction postConnectAction)
          Specify the action to be be executed after the Service Locator has connected to the server.
 

Method Detail

connect

RootNode connect()
                 throws InterruptedException,
                        ServiceLocatorException
Establish a connection to the Service Locator. After successful connection the specified 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.

Throws:
InterruptedException - the current Thread was interrupted when waiting for a successful connection to the ServiceLocator
ServiceLocatorException - the connect operation failed

disconnect

void disconnect()
                throws InterruptedException,
                       ServiceLocatorException
Disconnects from a Service Locator server. All endpoints that were registered before are removed from the server. To be able to communicate with a Service Locator server again the client has to connect again.

Throws:
InterruptedException - the current Thread was interrupted when waiting for the disconnect to happen
ServiceLocatorException

isConnected

boolean isConnected()

setPostConnectAction

void setPostConnectAction(ServiceLocator.PostConnectAction postConnectAction)
Specify the action to be be executed after the Service Locator has connected to the server.

Parameters:
postConnectAction - the action to be executed, must not be null.


Copyright © 2011–2014 Talend Inc.. All rights reserved.