Interface IServiceBuilder


public interface IServiceBuilder
Since:
Mar 8, 2006
  • Method Details

    • create

      Creates and returns an INativeService object.
      Returns:
      INativeService object
      Throws:
      NativeCommException - on failure
    • id

      String id()
      Returns the unique id of the NativeService.
      Returns:
      unique id of the NativeService
    • id

      Sets the unique id of the NativeService.
      Parameters:
      id - unique id to set
      Returns:
      the IServiceBuilder
    • maxConnections

      int maxConnections()
      Returns the maximum connection pool size
      Returns:
      the maximum connection pool size
    • maxConnections

      IServiceBuilder maxConnections(int maxConnections)
      Sets the maximum connection pool size
      Parameters:
      maxConnections - maximum connection pool size
      Returns:
      the IServiceBuilder
    • maxRequests

      int maxRequests()
      Returns the maximum number of requests per process.
      Returns:
      the maximum number of requests per process (0 == unlimited)
    • maxRequests

      IServiceBuilder maxRequests(int maxRequests)
      Sets the maximum number of requests per process.
      Parameters:
      maxRequests - maximum number of requests per process (0 == unlimited)
      Returns:
      the IServiceBuilder
    • arguments

      String[] arguments()
      Returns the arguments to be passed to the native process.
      Returns:
      arguments to be passed to the native process.
    • arguments

      IServiceBuilder arguments(String[] args)
      Sets the arguments to be passed to the native process.
      Parameters:
      args - to be passed to the native process
      Returns:
      the IServiceBuilder
    • environment

      Map<String,String> environment()
      Returns a rereference to this ServiceBuilders environment map. Key/value pairs added to the returned map a passed to the native process via environment variables.
      Returns:
      reference to this ServiceConfigs environment map
    • library

      String library()
      Returns the path of the NativeService library to load.
      Returns:
      path of the NativeService library to load.
    • library

      IServiceBuilder library(String library)
      Sets the path of the NativeService library to load.
      Parameters:
      library - path of the NativeService library to load
      Returns:
      the IServiceBuilder
    • library

      IServiceBuilder library(File library)
      Sets the path of the NativeService library to load.
      Parameters:
      library - path of the NativeService library to load
      Returns:
      the ServiceBuilder
    • directory

      File directory()
      Returns the working directory of the native process.
      Returns:
      the working directory of the native process; null if default is used)
    • directory

      IServiceBuilder directory(File directory)
      Sets the working directory of the native process.
      Parameters:
      directory - working directory of the native process; if null, the parent directory of the library is used
      Returns:
      the IServiceBuilder
    • command

      String command()
      Returns the native executable to launch.
      Returns:
      the native executable to launch; if null, the default NativeComm host is used
    • command

      IServiceBuilder command(String command)
      Sets the native executable to launch.
      Parameters:
      command - native executable to launch; if null, the default NativeComm host is used
      Returns:
      the IServiceBuilder
    • command

      IServiceBuilder command(File command)
      Sets the native executable to launch.
      Parameters:
      command - native executable to launch; if null, the default NativeComm host is used
      Returns:
      the IServiceBuilder
    • connectionsPerProcess

      int connectionsPerProcess()
      Returns the number of connections established per process.
      Returns:
      number of connections established per process
    • connectionsPerProcess

      IServiceBuilder connectionsPerProcess(int connectionsPerProcess)
      Sets the number of connections established per process.
      Parameters:
      connectionsPerProcess - number of connections established per process
      Returns:
      the IServiceBuilder
    • logDir

      File logDir()
      Returns the service log directory.
      Returns:
      the service log directory; if null the working directory is used
    • logDir

      IServiceBuilder logDir(File logdir)
      Sets the service log directory.
      Parameters:
      logdir - the service log directory; if null the working directory is used
      Returns:
      the IServiceBuilder
    • tmpDir

      File tmpDir()
      Returns the service temp directory.
      Returns:
      the service temp directory; if null the default temp path is inherited
    • tmpDir

      IServiceBuilder tmpDir(File tmpDir)
      Sets the service temp directory.
      Parameters:
      tmpDir - the service temp directory; if null the default temp path is inherited
      Returns:
      the IServiceBuilder
    • launchTimeout

      int launchTimeout()
      Maximum time to wait for a spawned child process' connection. If a spawned child process fails to connect to the parent within the specified maximum timespan, it is forcefully killed and the launch is considered failed.
      Returns:
      maximum time to wait for a spawned child process' connection.
    • launchTimeout

      IServiceBuilder launchTimeout(int timeout)
      Sets the maximum time to wait for a spawned child process' connection.
      Parameters:
      timeout - maximum time to wait for a spawned child process' connection.
      Returns:
      the IServiceBuilder
      See Also:
    • terminationTimeout

      int terminationTimeout()
      Maximum time to wait for a spawned child process' graceful termination. If a spawned child process fails to quit within the specified maximum timespan after its' connections to the parent are closed, it is forcefully killed.
      Returns:
      maximum time to wait for a spawned child process' graceful termination.
    • terminationTimeout

      IServiceBuilder terminationTimeout(int timeout)
      Sets the maximum time to wait for a spawned child process' graceful termination.
      Parameters:
      timeout - maximum time to wait for a spawned child process' graceful termination.
      Returns:
      the IServiceBuilder
      See Also:
    • debugPort

      int debugPort()
      Returns TCP port to listen on for debug connection.
      Returns:
      TCP port to listen on for debug connection; 0 if not debugging
    • debugPort

      IServiceBuilder debugPort(int port)
      Sets the TCP port to listen on for debug connection.
      Parameters:
      port - TCP port to listen on for debug connection; 0 if not debugging
      Returns:
      the IServiceBuilder
    • loggerName

      IServiceBuilder loggerName(String loggerName)
      Logger name (i.e. class name of NComm service user). Set this to activate log streaming from native processes to java side (unified log).
      Parameters:
      loggerName - - logger name (i.e. class name of NComm service user).
      Returns:
      the IServiceBuilder
    • loggerName

      String loggerName()
      Returns the Logger name (i.e. class name of NComm service user).
      Returns:
      the Logger name
    • processLauncherHook

      IProcessLauncherHook processLauncherHook()
      Returns:
      the IProcessLauncherHook.
    • processLauncherHook

      IServiceBuilder processLauncherHook(IProcessLauncherHook hook)
      Set the IProcessLauncherHook instance or null.
      Parameters:
      hook - - IProcessLauncherHook instance or null.
      Returns:
      the IServiceBuilder