io.vertx.core

## Class DeploymentOptions

- java.lang.Object
- - io.vertx.core.DeploymentOptions

-     public class DeploymentOptions
      extends Object

  Options for configuring a verticle deployment.

  Author:
    Tim Fox

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static boolean` | `DEFAULT_HA`
    `static int` | `DEFAULT_INSTANCES`
    `static String` | `DEFAULT_ISOLATION_GROUP`
    `static boolean` | `DEFAULT_MULTI_THREADED`
    `static boolean` | `DEFAULT_WORKER`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `DeploymentOptions()` Default constructor
    `DeploymentOptions(DeploymentOptions other)` Copy constructor
    `DeploymentOptions(JsonObject json)` Constructor for creating a instance from JSON

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `equals(Object o)`
    `void` | `fromJson(JsonObject json)` Initialise the fields of this instance from the specified JSON
    `JsonObject` | `getConfig()` Get the JSON configuration that will be passed to the verticle(s) when deployed.
    `List<String>` | `getExtraClasspath()` Get any extra classpath to be used when deploying the verticle.
    `int` | `getInstances()` Get the number of instances that should be deployed.
    `List<String>` | `getIsolatedClasses()` Get the list of isolated class names, the names can be a Java class fully qualified name such as 'com.mycompany.myproject.engine.MyClass' or a wildcard matching such as `com.mycompany.myproject.*`.
    `String` | `getIsolationGroup()` Get the isolation group that will be used when deploying the verticle(s)
    `long` | `getMaxWorkerExecuteTime()` Get the value of max worker execute time, in ns.
    `String` | `getWorkerPoolName()`
    `int` | `getWorkerPoolSize()` Get the maximum number of worker threads to be used by the worker pool when the verticle is deployed with a `setWorkerPoolName(java.lang.String)`.
    `int` | `hashCode()`
    `boolean` | `isHa()` Will the verticle(s) be deployed as HA (highly available) ?
    `boolean` | `isMultiThreaded()` Should the verticle(s) be deployed as a multi-threaded worker verticle?
    `boolean` | `isWorker()` Should the verticle(s) be deployed as a worker verticle?
    `DeploymentOptions` | `setConfig(JsonObject config)` Set the JSON configuration that will be passed to the verticle(s) when it's deployed
    `DeploymentOptions` | `setExtraClasspath(List<String> extraClasspath)` Set any extra classpath to be used when deploying the verticle.
    `DeploymentOptions` | `setHa(boolean ha)` Set whether the verticle(s) will be deployed as HA.
    `DeploymentOptions` | `setInstances(int instances)` Set the number of instances that should be deployed.
    `DeploymentOptions` | `setIsolatedClasses(List<String> isolatedClasses)` Set the isolated class names.
    `DeploymentOptions` | `setIsolationGroup(String isolationGroup)` Set the isolation group that will be used when deploying the verticle(s)
    `DeploymentOptions` | `setMaxWorkerExecuteTime(long maxWorkerExecuteTime)` Sets the value of max worker execute time, in ns.
    `DeploymentOptions` | `setMultiThreaded(boolean multiThreaded)` Set whether the verticle(s) should be deployed as a multi-threaded worker verticle
    `DeploymentOptions` | `setWorker(boolean worker)` Set whether the verticle(s) should be deployed as a worker verticle
    `DeploymentOptions` | `setWorkerPoolName(String workerPoolName)` Set the worker pool name to use for this verticle.
    `DeploymentOptions` | `setWorkerPoolSize(int workerPoolSize)` Set the maximum number of worker threads to be used by the Vert.x instance.
    `JsonObject` | `toJson()` Convert this to JSON

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### DEFAULT_WORKER

          public static final boolean DEFAULT_WORKER

      See Also:
        Constant Field Values

    - #### DEFAULT_MULTI_THREADED

          public static final boolean DEFAULT_MULTI_THREADED

      See Also:
        Constant Field Values

    - #### DEFAULT_ISOLATION_GROUP

          public static final String DEFAULT_ISOLATION_GROUP

    - #### DEFAULT_HA

          public static final boolean DEFAULT_HA

      See Also:
        Constant Field Values

    - #### DEFAULT_INSTANCES

          public static final int DEFAULT_INSTANCES

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### DeploymentOptions

          public DeploymentOptions()

      Default constructor

    - #### DeploymentOptions

          public DeploymentOptions(DeploymentOptions other)

      Copy constructor
      Parameters:
        `other` - the instance to copy

    - #### DeploymentOptions

          public DeploymentOptions(JsonObject json)

      Constructor for creating a instance from JSON
      Parameters:
        `json` - the JSON

  - ### Method Detail

    - #### fromJson

          public void fromJson(JsonObject json)

      Initialise the fields of this instance from the specified JSON
      Parameters:
        `json` - the JSON

    - #### getConfig

          public JsonObject getConfig()

      Get the JSON configuration that will be passed to the verticle(s) when deployed.
      Returns:
        the JSON config

    - #### setConfig

          public DeploymentOptions setConfig(JsonObject config)

      Set the JSON configuration that will be passed to the verticle(s) when it's deployed
      Parameters:
        `config` - the JSON config
      Returns:
        a reference to this, so the API can be used fluently

    - #### isWorker

          public boolean isWorker()

      Should the verticle(s) be deployed as a worker verticle?
      Returns:
        true if will be deployed as worker, false otherwise

    - #### setWorker

          public DeploymentOptions setWorker(boolean worker)

      Set whether the verticle(s) should be deployed as a worker verticle
      Parameters:
        `worker` - true for worker, false otherwise
      Returns:
        a reference to this, so the API can be used fluently

    - #### isMultiThreaded

          public boolean isMultiThreaded()

      Should the verticle(s) be deployed as a multi-threaded worker verticle?

      Ignored if `isWorker()` is not true.

      Returns:
        true if will be deployed as multi-threaded worker, false otherwise

    - #### setMultiThreaded

          public DeploymentOptions setMultiThreaded(boolean multiThreaded)

      Set whether the verticle(s) should be deployed as a multi-threaded worker verticle
      Parameters:
        `multiThreaded` - true for multi-threaded worker, false otherwise
      Returns:
        a reference to this, so the API can be used fluently

    - #### getIsolationGroup

          public String getIsolationGroup()

      Get the isolation group that will be used when deploying the verticle(s)
      Returns:
        the isolation group

    - #### setIsolationGroup

          public DeploymentOptions setIsolationGroup(String isolationGroup)

      Set the isolation group that will be used when deploying the verticle(s)
      Parameters:
        `isolationGroup` - - the isolation group
      Returns:
        a reference to this, so the API can be used fluently

    - #### isHa

          public boolean isHa()

      Will the verticle(s) be deployed as HA (highly available) ?
      Returns:
        true if HA, false otherwise

    - #### setHa

          public DeploymentOptions setHa(boolean ha)

      Set whether the verticle(s) will be deployed as HA.
      Parameters:
        `ha` - true if to be deployed as HA, false otherwise
      Returns:
        a reference to this, so the API can be used fluently

    - #### getExtraClasspath

          public List<String> getExtraClasspath()

      Get any extra classpath to be used when deploying the verticle.

      Ignored if no isolation group is set.

      Returns:
        any extra classpath

    - #### setExtraClasspath

          public DeploymentOptions setExtraClasspath(List<String> extraClasspath)

      Set any extra classpath to be used when deploying the verticle.

      Ignored if no isolation group is set.

      Returns:
        a reference to this, so the API can be used fluently

    - #### getInstances

          public int getInstances()

      Get the number of instances that should be deployed.
      Returns:
        the number of instances

    - #### setInstances

          public DeploymentOptions setInstances(int instances)

      Set the number of instances that should be deployed.
      Parameters:
        `instances` - the number of instances
      Returns:
        a reference to this, so the API can be used fluently

    - #### getIsolatedClasses

          public List<String> getIsolatedClasses()

      Get the list of isolated class names, the names can be a Java class fully qualified name such as 'com.mycompany.myproject.engine.MyClass' or a wildcard matching such as `com.mycompany.myproject.*`.
      Returns:
        the list of isolated classes

    - #### setIsolatedClasses

          public DeploymentOptions setIsolatedClasses(List<String> isolatedClasses)

      Set the isolated class names.
      Parameters:
        `isolatedClasses` - the list of isolated class names
      Returns:
        a reference to this, so the API can be used fluently

    - #### getWorkerPoolName

          public String getWorkerPoolName()

      Returns:
        the worker pool name

    - #### setWorkerPoolName

          public DeploymentOptions setWorkerPoolName(String workerPoolName)

      Set the worker pool name to use for this verticle. When no name is set, the Vert.x worker pool will be used, when a name is set, the verticle will use a named worker pool.
      Parameters:
        `workerPoolName` - the worker pool name
      Returns:
        a reference to this, so the API can be used fluently

    - #### getWorkerPoolSize

          public int getWorkerPoolSize()

      Get the maximum number of worker threads to be used by the worker pool when the verticle is deployed with a `setWorkerPoolName(java.lang.String)`. When the verticle does not use a named worker pool, this option has no effect.

      Worker threads are used for running blocking code and worker verticles.

      Returns:
        the maximum number of worker threads

    - #### setWorkerPoolSize

          public DeploymentOptions setWorkerPoolSize(int workerPoolSize)

      Set the maximum number of worker threads to be used by the Vert.x instance.
      Parameters:
        `workerPoolSize` - the number of threads
      Returns:
        a reference to this, so the API can be used fluently

    - #### getMaxWorkerExecuteTime

          public long getMaxWorkerExecuteTime()

      Get the value of max worker execute time, in ns.

      Vert.x will automatically log a warning if it detects that worker threads haven't returned within this time.

      This can be used to detect where the user is blocking a worker thread for too long. Although worker threads can be blocked longer than event loop threads, they shouldn't be blocked for long periods of time.

      Returns:
        The value of max worker execute time, in ms.

    - #### setMaxWorkerExecuteTime

          public DeploymentOptions setMaxWorkerExecuteTime(long maxWorkerExecuteTime)

      Sets the value of max worker execute time, in ns.
      Parameters:
        `maxWorkerExecuteTime` - the value of max worker execute time, in ms.
      Returns:
        a reference to this, so the API can be used fluently

    - #### toJson

          public JsonObject toJson()

      Convert this to JSON
      Returns:
        the JSON

    - #### equals

          public boolean equals(Object o)

      Overrides:
        `equals` in class `Object`

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `Object`

Copyright © 2016. All rights reserved.