vertx.embed.platform documentation
Functions for running Vert.x embedded with a platform manager.
deploy-module
(deploy-module platform-manager module-name & {:keys [config instances ha? handler], :or {config {}, instances 1}})
Deploys the module with the given name to platform-manager.
Takes the following keyword arguments [default]:
:config A configuration map for the module [{}]
:ha? If true then the module is enabled for ha and will
failover to any other vert.x instances with the
same group in the cluster [false]
:handler Either be a two-arity fn that will be passed
the exception-map (if any) and module id from the
result of the deploy call, or a
org.vertx.java.core.Handler that will be
called with the AsyncResult object that wraps
the exception and id [nil]
:instances The number of instances of the module to
deploy [1]deploy-module-from-classpath
(deploy-module-from-classpath platform-manager module-name & {:keys [classpath config instances handler], :or {config {}, instances 1}})
Deploys a module from the classpath to platform-manager.
The classpath must contain a single mod.json and the resources for
that module only.
Takes the following keyword arguments [default]:
:classpath The classpath to use for the verticle as a
sequence of URLs ['()]
:config A configuration map for the module [{}]
:handler Either be a two-arity fn that will be passed
the exception-map (if any) and module id from the
result of the deploy call, or a
org.vertx.java.core.Handler that will be
called with the AsyncResult object that wraps
the exception and id [nil]
:instances The number of instances of the module to
deploy [1]deploy-module-from-zip
(deploy-module-from-zip platform-manager zip-file-path & {:keys [config instances handler], :or {config {}, instances 1}})
Deploys the module from the given zip file to platform-manager.
The zip must contain a valid Vert.x module. Vert.x will
automatically install the module from the zip into the local mods
dir or the system mods dir (if it's a system module), or VERTX_MODS
if set, and then deploy the module.
Takes the following keyword arguments [default]:
:config A configuration map for the module [{}]
:ha? If true then the module is enabled for ha and will
failover to any other vert.x instances with the
same group in the cluster [false]
:handler Either be a two-arity fn that will be passed
the exception-map (if any) and module id from the
result of the deploy call, or a
org.vertx.java.core.Handler that will be
called with the AsyncResult object that wraps
the exception and id [nil]
:instances The number of instances of the module to
deploy [1]deploy-verticle
(deploy-verticle platform-manager main & {:keys [config classpath instances includes handler], :or {config {}, instances 1}})
Deploys the verticle with the given main file path using platform-manager.
main must be on the effective classpath.
Takes the following keyword arguments [default]:
:classpath The classpath to use for the verticle as a
sequence of URLs ['()]
:config A configuration map for the verticle [{}]
:handler Either be a two-arity fn that will be passed
the exception (if any) and verticle id from the
result of the deploy call, or a
org.vertx.java.core.Handler that will be
called with the AsyncResult object that wraps
the exception and id [nil]
:includes A sequence of modules to include [nil]
:instances The number of instances of the verticle to
deploy [1]deploy-worker-verticle
(deploy-worker-verticle platform-manager main & {:keys [classpath config instances includes multi-threaded? handler], :or {config {}, instances 1}})
Deploys the worker verticle with the given main file path using platform-manager.
main must be on the effective classpath.
Takes the following keyword arguments [default]:
:classpath The classpath to use for the verticle as a
sequence of URLs ['()]
:config A configuration map for the verticle [{}]
:handler Either be a two-arity fn that will be passed
the exception-map (if any) and verticle id from the
result of the deploy call, or a
org.vertx.java.core.Handler that will be
called with the AsyncResult object that wraps
the exception and id [nil]
:includes A sequence of modules to include [nil]
:instances The number of instances of the verticle to
deploy [1]
:multi-threaded? When true, the verticle will be accessed
by multiple threads concurrently [false]install-module
(install-module platform-manager module-name)(install-module platform-manager module-name handler)
Downloads and installs the named module locally.
handler can either be a single-arity fn that will be passed the
exception (if any) from the result of the install call, or a
org.vertx.java.core.Handler that will be called with the
AsyncResult object that wraps the exception.
instances
(instances platform-manager)
Returns a map of deployment ids to number of instances.
make-fat-jar
(make-fat-jar platform-manager module-name output-dir)(make-fat-jar platform-manager module-name output-dir handler)
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. e.g.: java -jar mymod~1.0-fat.jar
handler can either be a single-arity fn that will be passed the
exception (if any) from the result of the call, or a
org.vertx.java.core.Handler that will be called with the
AsyncResult object that wraps the exception.
on-exit
(on-exit platform-manager handler)
Register a handler that will be called when the platform exits.
handler can either be a zero-arity fn or a Handler instance.
pull-in-dependencies
(pull-in-dependencies platform-manager module-name)(pull-in-dependencies platform-manager module-name handler)
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. This allows a self contained module to be created.
handler can either be a single-arity fn that will be passed the
exception (if any) from the result of the call, or a
org.vertx.java.core.Handler that will be called with the
AsyncResult object that wraps the exception.
undeploy
(undeploy platform-manager id)(undeploy platform-manager id handler)
Undeploys the deployment identified by id from platform-manager.
handler can either be a single-arity fn that will be passed the
exception (if any) from the result of the undeploy call, or a
org.vertx.java.core.Handler that will be called with the
AsyncResult object that wraps the exception.
undeploy-all
(undeploy-all platform-manager)(undeploy-all platform-manager handler)
Undeploys the all deployments from platform-manager.
handler can either be a single-arity fn that will be passed the
exception (if any) from the result of the undeploy call, or a
org.vertx.java.core.Handler that will be called with the
AsyncResult object that wraps the exception.
uninstall-module
(uninstall-module platform-manager module-name)(uninstall-module platform-manager module-name handler)
Removes the module from the local installation.
handler can either be a single-arity fn that will be passed the
exception (if any) from the result of the uninstall call, or a
org.vertx.java.core.Handler that will be called with the
AsyncResult object that wraps the exception.