public class DefaultServiceManager extends Object implements ServiceManager
ServiceManager.| Constructor and Description |
|---|
DefaultServiceManager(String accountId,
co.cask.cdap.test.internal.DefaultApplicationManager.ProgramId serviceId,
AppFabricClient appFabricClient,
org.apache.twill.discovery.DiscoveryServiceClient discoveryServiceClient,
DefaultApplicationManager applicationManager) |
| Modifier and Type | Method and Description |
|---|---|
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 runnableName,
int instances)
Changes the number of runnable instances.
|
void |
stop()
Stops the running service.
|
public DefaultServiceManager(String accountId, co.cask.cdap.test.internal.DefaultApplicationManager.ProgramId serviceId, AppFabricClient appFabricClient, org.apache.twill.discovery.DiscoveryServiceClient discoveryServiceClient, DefaultApplicationManager applicationManager)
public void setRunnableInstances(String runnableName, int instances)
ServiceManagersetRunnableInstances in interface ServiceManagerrunnableName - Name of the runnable (can be either handler or worker).instances - Number of instances to change to.public int getRunnableInstances(String runnableName)
ServiceManagergetRunnableInstances in interface ServiceManagerrunnableName - Name of the runnable (can be either handler or worker).public void stop()
ServiceManagerstop in interface ServiceManagerpublic boolean isRunning()
ServiceManagerisRunning in interface ServiceManagerpublic URL getServiceURL()
ServiceManagergetServiceURL in interface ServiceManagernull if the service is not availablepublic URL getServiceURL(long timeout, TimeUnit timeoutUnit)
ServiceManagergetServiceURL in interface ServiceManagertimeout - how long to wait before giving up, in unit of timeoutUnittimeoutUnit - a TimeUnit to interpret the value of timeoutnull if the service is not availableCopyright © 2015 Cask Data, Inc. Licensed under the Apache License, Version 2.0.