public interface PlatformManager
It's the role of a PlatformManager to deploy and undeploy modules and verticles. It's also used to install modules, and for various other tasks.
The Platform Manager basically represents the Vert.x container in which verticles and modules run.
The Platform Manager is used by the Vert.x CLI to run/install/etc modules and verticles but you could also use it if you want to embed the entire Vert.x container in an application, or write some other tool (e.g. a build tool, or a test tool) which needs to do stuff with the container.
Modifier and Type | Method and Description |
---|---|
void |
createModuleLink(java.lang.String moduleName,
Handler<AsyncResult<java.lang.Void>> doneHandler) |
void |
deployModule(java.lang.String moduleName,
JsonObject config,
int instances,
boolean ha,
Handler<AsyncResult<java.lang.String>> doneHandler)
Deploy a module
|
void |
deployModule(java.lang.String moduleName,
JsonObject config,
int instances,
Handler<AsyncResult<java.lang.String>> doneHandler)
Deploy a module
|
void |
deployModuleFromClasspath(java.lang.String moduleName,
JsonObject config,
int instances,
java.net.URL[] classpath,
Handler<AsyncResult<java.lang.String>> doneHandler)
Deploy a module from the classpath.
|
void |
deployModuleFromZip(java.lang.String zipFileName,
JsonObject config,
int instances,
Handler<AsyncResult<java.lang.String>> doneHandler)
Deploy a module from a zip file.
|
void |
deployVerticle(java.lang.String main,
JsonObject config,
java.net.URL[] classpath,
int instances,
java.lang.String includes,
Handler<AsyncResult<java.lang.String>> doneHandler)
Deploy a verticle
|
void |
deployWorkerVerticle(boolean multiThreaded,
java.lang.String main,
JsonObject config,
java.net.URL[] classpath,
int instances,
java.lang.String includes,
Handler<AsyncResult<java.lang.String>> doneHandler)
Deploy a worker verticle
|
void |
installModule(java.lang.String moduleName,
Handler<AsyncResult<java.lang.Void>> doneHandler)
Install a module into the filesystem
Vert.x will search in the configured repos to locate the module
|
java.util.Map<java.lang.String,java.lang.Integer> |
listInstances()
List all deployments, with deployment ID and number of instances
|
void |
makeFatJar(java.lang.String moduleName,
java.lang.String outputDirectory,
Handler<AsyncResult<java.lang.Void>> doneHandler)
Create a fat executable jar which includes the Vert.x binaries and the module so it can be run
directly with java without having to pre-install Vert.x.
|
void |
pullInDependencies(java.lang.String moduleName,
Handler<AsyncResult<java.lang.Void>> doneHandler)
Pull in all the dependencies (the 'includes' and the 'deploys' fields in mod.json) and copy them into an
internal mods directory in the module.
|
void |
registerExitHandler(Handler<java.lang.Void> handler)
Register a handler that will be called when the platform exits because of a verticle calling container.exit()
|
void |
stop()
Stop the platform manager
|
void |
undeploy(java.lang.String deploymentID,
Handler<AsyncResult<java.lang.Void>> doneHandler)
Undeploy a deployment
|
void |
undeployAll(Handler<AsyncResult<java.lang.Void>> doneHandler)
Undeploy all verticles and modules
|
void |
uninstallModule(java.lang.String moduleName,
Handler<AsyncResult<java.lang.Void>> doneHandler)
Uninstall a module from the filesystem
|
Vertx |
vertx() |
void deployVerticle(java.lang.String main, JsonObject config, java.net.URL[] classpath, int instances, java.lang.String includes, Handler<AsyncResult<java.lang.String>> doneHandler)
main
- The main, e.g. app.js, foo.rb, org.mycompany.MyMain, etcconfig
- Any JSON config to pass to the verticle, or null if noneclasspath
- The classpath for the verticleinstances
- The number of instances to deployincludes
- Comma separated list of modules to include, or null if nonedoneHandler
- Handler will be called with deploymentID when deployed, or null if it fails to deployvoid deployWorkerVerticle(boolean multiThreaded, java.lang.String main, JsonObject config, java.net.URL[] classpath, int instances, java.lang.String includes, Handler<AsyncResult<java.lang.String>> doneHandler)
multiThreaded
- Is it a multi-threaded worker verticle?main
- The main, e.g. app.js, foo.rb, org.mycompany.MyMain, etcconfig
- Any JSON config to pass to the verticle, or null if noneclasspath
- The classpath for the verticleinstances
- The number of instances to deployincludes
- Comma separated list of modules to include, or null if nonedoneHandler
- Handler will be called with deploymentID when deployed, or null if it fails to deployvoid deployModule(java.lang.String moduleName, JsonObject config, int instances, Handler<AsyncResult<java.lang.String>> doneHandler)
moduleName
- The name of the module to deployconfig
- Any JSON config to pass to the verticle, or null if noneinstances
- The number of instances to deploydoneHandler
- Handler will be called with deploymentID when deployed, or null if it fails to deployvoid deployModule(java.lang.String moduleName, JsonObject config, int instances, boolean ha, Handler<AsyncResult<java.lang.String>> doneHandler)
moduleName
- The name of the module to deployconfig
- Any JSON config to pass to the verticle, or null if noneinstances
- The number of instances to deployha
- If true then the module is enabled for ha and will failover to any other vert.x instances
with the same group in the clusterdoneHandler
- Handler will be called with deploymentID when deployed, or null if it fails to deployvoid deployModuleFromZip(java.lang.String zipFileName, JsonObject config, int instances, Handler<AsyncResult<java.lang.String>> doneHandler)
zipFileName
- The name of the zip file that contains the moduleconfig
- Any JSON config to pass to the verticle, or null if noneinstances
- The number of instances to deploydoneHandler
- Handler will be called with deploymentID when deployed, or null if it fails to deployvoid deployModuleFromClasspath(java.lang.String moduleName, JsonObject config, int instances, java.net.URL[] classpath, Handler<AsyncResult<java.lang.String>> doneHandler)
moduleName
- The name of the module to deployconfig
- Any JSON config to pass to the verticle, or null if noneinstances
- The number of instances to deployclasspath
- Array of URLS corresponding to the classpath for the moduledoneHandler
- Handler will be called with deploymentID when deployed, or null if it fails to deployvoid undeploy(java.lang.String deploymentID, Handler<AsyncResult<java.lang.Void>> doneHandler)
deploymentID
- The ID of the deployment to undeploy, as given in the doneHandler when deployingdoneHandler
- The done handler will be called when deployment is complete or failsvoid undeployAll(Handler<AsyncResult<java.lang.Void>> doneHandler)
doneHandler
- The done handler will be called when completejava.util.Map<java.lang.String,java.lang.Integer> listInstances()
void installModule(java.lang.String moduleName, Handler<AsyncResult<java.lang.Void>> doneHandler)
moduleName
- The name of the modulevoid uninstallModule(java.lang.String moduleName, Handler<AsyncResult<java.lang.Void>> doneHandler)
moduleName
- void pullInDependencies(java.lang.String moduleName, Handler<AsyncResult<java.lang.Void>> doneHandler)
moduleName
- The name of the modulevoid makeFatJar(java.lang.String moduleName, java.lang.String outputDirectory, Handler<AsyncResult<java.lang.Void>> doneHandler)
moduleName
- The name of the module to create the fat jar foroutputDirectory
- Directory in which to place the jardoneHandler
- Handler that will be called on completionvoid createModuleLink(java.lang.String moduleName, Handler<AsyncResult<java.lang.Void>> doneHandler)
void registerExitHandler(Handler<java.lang.Void> handler)
handler
- The handlerVertx vertx()
void stop()