co.cask.cdap.test
Interface ServiceManager

All Known Implementing Classes:
DefaultServiceManager

public interface ServiceManager

Managing the running Service in an application.


Method Summary
 int getRunnableInstances(String runnableName)
          Returns the number of runnable instances.
 URL getServiceURL()
          Used to discover the Service managed by this ServiceManager.
 URL getServiceURL(long timeout, TimeUnit timeoutUnit)
          Used to discover the Service managed by this ServiceManager which allows a custom timeout value to wait for the service to be available.
 boolean isRunning()
          Checks if Service is Running
 void setRunnableInstances(String runnable, int instances)
          Changes the number of runnable instances.
 void stop()
          Stops the running service.
 

Method Detail

setRunnableInstances

void setRunnableInstances(String runnable,
                          int instances)
Changes the number of runnable instances.

Parameters:
runnable - Name of the runnable (can be either handler or worker).
instances - Number of instances to change to.

getRunnableInstances

int getRunnableInstances(String runnableName)
Returns the number of runnable instances.

Parameters:
runnableName - Name of the runnable (can be either handler or worker).

stop

void stop()
Stops the running service.


isRunning

boolean isRunning()
Checks if Service is Running


getServiceURL

URL getServiceURL()
Used to discover the Service managed by this ServiceManager.

Returns:
URL of the Service or null if the service is not available

getServiceURL

URL getServiceURL(long timeout,
                  TimeUnit timeoutUnit)
Used to discover the Service managed by this ServiceManager which allows a custom timeout value to wait for the service to be available.

Parameters:
timeout - how long to wait before giving up, in unit of timeoutUnit
timeoutUnit - a TimeUnit to interpret the value of timeout
Returns:
URL of the service or null if the service is not available


Copyright © 2015 Cask Data, Inc. Licensed under the Apache License, Version 2.0.