Overview | Package | Class | Deprecated | Index | Help
| Groovy Documentation
| FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.vertx.groovy.deploy
[Groovy] Class Container

    java.lang.Object
      org.vertx.groovy.deploy.Container

    class Container

This class represents the container in which a verticle runs.

An instance of this class will be created by the system and made available to a running Verticle. It contains methods to programmatically deploy other verticles, undeploy verticles, get the configuration for a verticle and get the logger for a verticle.

Authors:
  Tim Fox

Constructor Summary
`Container(java.lang.Object jContainer)`

Method Summary
`void` | `deployModule(java.lang.String moduleName)` Deploy a module programmatically
`void` | `deployModule(java.lang.String moduleName, groovy.lang.Closure doneHandler)` Deploy a module programmatically
`void` | `deployModule(java.lang.String moduleName, int instances)` Deploy a module programmatically
`void` | `deployModule(java.lang.String moduleName, java.util.Map config)` Deploy a module programmatically
`void` | `deployModule(java.lang.String moduleName, java.util.Map config, int instances)` Deploy a module programmatically
`void` | `deployModule(java.lang.String moduleName, java.util.Map config, int instances, groovy.lang.Closure doneHandler)` Deploy a module programmatically
`void` | `deployVerticle(java.lang.String main)` Deploy a verticle programmatically
`void` | `deployVerticle(java.lang.String main, groovy.lang.Closure doneHandler)` Deploy a verticle programmatically
`void` | `deployVerticle(java.lang.String main, int instances)` Deploy a verticle programmatically
`void` | `deployVerticle(java.lang.String main, java.util.Map config)` Deploy a verticle programmatically
`void` | `deployVerticle(java.lang.String main, java.util.Map config, int instances)` Deploy a verticle programmatically
`void` | `deployVerticle(java.lang.String main, java.util.Map config, int instances, groovy.lang.Closure doneHandler)` Deploy a verticle programmatically
`java.lang.String` | `deployWorkerVerticle(java.lang.String main)` Deploy a worker verticle programmatically
`void` | `deployWorkerVerticle(java.lang.String main, groovy.lang.Closure doneHandler)` Deploy a worker verticle programmatically
`void` | `deployWorkerVerticle(java.lang.String main, int instances)` Deploy a worker verticle programmatically
`void` | `deployWorkerVerticle(java.lang.String main, java.util.Map config)` Deploy a worker verticle programmatically
`void` | `deployWorkerVerticle(java.lang.String main, java.util.Map config, int instances)` Deploy a worker verticle programmatically
`void` | `deployWorkerVerticle(java.lang.String main, java.util.Map config, int instances, groovy.lang.Closure doneHandler)` Deploy a worker verticle programmatically
`void` | `exit()` Cause the container to exit
`java.util.Map` | `getConfig()` Get the verticle configuration
`java.util.Map` | `getEnv()` Get an umodifiable map of system, environment variables.
`Logger` | `getLogger()` Get the verticle logger
`void` | `undeployModule(java.lang.String deploymentID)` Undeploy a module
`void` | `undeployModule(java.lang.String deploymentID, groovy.lang.Closure doneHandler)` Undeploy a module
`void` | `undeployVerticle(java.lang.String deploymentID)` Undeploy a verticle
`void` | `undeployVerticle(java.lang.String deploymentID, groovy.lang.Closure doneHandler)` Undeploy a verticle

Methods inherited from class java.lang.Object
java.lang.Object#wait(long, int), java.lang.Object#wait(long), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll()

Constructor Detail

### Container

    Container(java.lang.Object jContainer)

Method Detail

### deployModule

    void deployModule(java.lang.String moduleName)

  Deploy a module programmatically
  Parameters:
    `moduleName` - The main of the module

### deployModule

    void deployModule(java.lang.String moduleName, groovy.lang.Closure doneHandler)

  Deploy a module programmatically
  Parameters:
    `moduleName` - The main of the module
    `doneHandler` - The handler will be called when deployment is complete

### deployModule

    void deployModule(java.lang.String moduleName, int instances)

  Deploy a module programmatically
  Parameters:
    `moduleName` - The main of the module
    `instances` - The number of instances to deploy (defaults to 1)

### deployModule

    void deployModule(java.lang.String moduleName, java.util.Map config)

  Deploy a module programmatically
  Parameters:
    `moduleName` - The main of the module
    `config` - JSON config to provide to the module

### deployModule

    void deployModule(java.lang.String moduleName, java.util.Map config, int instances)

  Deploy a module programmatically
  Parameters:
    `moduleName` - The main of the module
    `config` - JSON config to provide to the module
    `instances` - The number of instances to deploy (defaults to 1)

### deployModule

    void deployModule(java.lang.String moduleName, java.util.Map config, int instances, groovy.lang.Closure doneHandler)

  Deploy a module programmatically
  Parameters:
    `moduleName` - The main of the module
    `config` - JSON config to provide to the module
    `instances` - The number of instances to deploy (defaults to 1)
    `doneHandler` - The handler will be called passing in the unique deployment id when deployment is complete

### deployVerticle

    void deployVerticle(java.lang.String main)

  Deploy a verticle programmatically
  Parameters:
    `main` - The main of the verticle

### deployVerticle

    void deployVerticle(java.lang.String main, groovy.lang.Closure doneHandler)

  Deploy a verticle programmatically
  Parameters:
    `main` - The main of the verticle
    `doneHandler` - The handler will be called when deployment is complete

### deployVerticle

    void deployVerticle(java.lang.String main, int instances)

  Deploy a verticle programmatically
  Parameters:
    `main` - The main of the verticle
    `instances` - The number of instances to deploy (defaults to 1)

### deployVerticle

    void deployVerticle(java.lang.String main, java.util.Map config)

  Deploy a verticle programmatically
  Parameters:
    `main` - The main of the verticle
    `config` - JSON config to provide to the verticle

### deployVerticle

    void deployVerticle(java.lang.String main, java.util.Map config, int instances)

  Deploy a verticle programmatically
  Parameters:
    `main` - The main of the verticle
    `config` - JSON config to provide to the verticle
    `instances` - The number of instances to deploy (defaults to 1)

### deployVerticle

    void deployVerticle(java.lang.String main, java.util.Map config, int instances, groovy.lang.Closure doneHandler)

  Deploy a verticle programmatically
  Parameters:
    `main` - The main of the verticle
    `config` - JSON config to provide to the verticle
    `instances` - The number of instances to deploy (defaults to 1)
    `doneHandler` - The handler will be called passing in the unique deployment id when deployment is complete

### deployWorkerVerticle

    java.lang.String deployWorkerVerticle(java.lang.String main)

  Deploy a worker verticle programmatically
  Parameters:
    `main` - The main of the verticle
  Returns:
    Unique deployment id

### deployWorkerVerticle

    void deployWorkerVerticle(java.lang.String main, groovy.lang.Closure doneHandler)

  Deploy a worker verticle programmatically
  Parameters:
    `main` - The main of the verticle
    `doneHandler` - The handler will be called passing in the unique deployment id when deployment is complete

### deployWorkerVerticle

    void deployWorkerVerticle(java.lang.String main, int instances)

  Deploy a worker verticle programmatically
  Parameters:
    `main` - The main of the verticle
    `instances` - The number of instances to deploy (defaults to 1)

### deployWorkerVerticle

    void deployWorkerVerticle(java.lang.String main, java.util.Map config)

  Deploy a worker verticle programmatically
  Parameters:
    `main` - The main of the verticle
    `config` - JSON config to provide to the verticle

### deployWorkerVerticle

    void deployWorkerVerticle(java.lang.String main, java.util.Map config, int instances)

  Deploy a worker verticle programmatically
  Parameters:
    `main` - The main of the verticle
    `config` - JSON config to provide to the verticle
    `instances` - The number of instances to deploy (defaults to 1)

### deployWorkerVerticle

    void deployWorkerVerticle(java.lang.String main, java.util.Map config, int instances, groovy.lang.Closure doneHandler)

  Deploy a worker verticle programmatically
  Parameters:
    `main` - The main of the verticle
    `config` - JSON config to provide to the verticle
    `instances` - The number of instances to deploy (defaults to 1)
    `doneHandler` - The handler will be called passing in the unique deployment id when deployment is complete

### exit

    void exit()

  Cause the container to exit

### getConfig

    java.util.Map getConfig()

  Get the verticle configuration
  Returns:
    a java.util.Map representing the JSON configuration

### getEnv

    java.util.Map getEnv()

  Get an umodifiable map of system, environment variables.
  Returns:
    The map

### getLogger

    Logger getLogger()

  Get the verticle logger
  Returns:
    The logger

### undeployModule

    void undeployModule(java.lang.String deploymentID)

  Undeploy a module
  Parameters:
    `deploymentID` - The deployment ID

### undeployModule

    void undeployModule(java.lang.String deploymentID, groovy.lang.Closure doneHandler)

  Undeploy a module
  Parameters:
    `deploymentID` - The deployment ID
    `doneHandler` - The handler will be called when undeployment is complete

### undeployVerticle

    void undeployVerticle(java.lang.String deploymentID)

  Undeploy a verticle
  Parameters:
    `deploymentID` - The deployment ID

### undeployVerticle

    void undeployVerticle(java.lang.String deploymentID, groovy.lang.Closure doneHandler)

  Undeploy a verticle
  Parameters:
    `deploymentID` - The deployment ID
    `doneHandler` - The handler will be called when undeployment is complete

Groovy Documentation