Class Service

All Implemented Interfaces:
com.yahoo.config.ConfigInstance.Producer, ConfigProducer, NetworkPortRequestor, Service, Serializable

public class Service extends AbstractService
An application specific generic service
Author:
vegardh
See Also:
  • Constructor Details

  • Method Details

    • getPortCount

      public int getPortCount()
      Description copied from interface: NetworkPortRequestor
      Returns the number of ports needed by this service. User-defined ports for container http servers should not be counted, as those ports are required to be outside Vespa's port range.
    • allocatePorts

      public void allocatePorts(int start, PortAllocBridge from)
      Description copied from interface: NetworkPortRequestor
      allocate the ports you need
    • getStartupCommand

      public String getStartupCommand()
      Description copied from class: AbstractService
      Must be overridden by services that should be started by config-sentinel. The returned value will be used in config-sentinel configuration. Returns null by default.
      Specified by:
      getStartupCommand in interface Service
      Overrides:
      getStartupCommand in class AbstractService
      Returns:
      null by default.
    • getIndex

      protected int getIndex(HostResource host)
      Different services are represented using same class here, so we must take service name into account too
      Overrides:
      getIndex in class AbstractService
      Parameters:
      host - a host
      Returns:
      the index of the host
    • getServiceType

      public String getServiceType()
      Description copied from class: AbstractService
      Returns the type of service. This is the class name without the package prefix by default, never null
      Specified by:
      getServiceType in interface NetworkPortRequestor
      Overrides:
      getServiceType in class AbstractService