public class Nodejs extends Object
| Constructor and Description |
|---|
Nodejs()
Creates a new
Nodejs and use the java.io.tmpdir as base dir. |
Nodejs(File basedir)
Creates a new
Nodejs. |
Nodejs(File basedir,
ClassLoader loader)
Creates a new
Nodejs. |
| Modifier and Type | Method and Description |
|---|---|
Path |
deploy(String library) |
void |
exec(String library)
Unpack and execute a nodejs library.
|
void |
exec(String library,
org.jooby.funzy.Throwing.Consumer<com.eclipsesource.v8.V8> callback)
Unpack and execute a nodejs library.
|
Nodejs |
overwrite(boolean overwrite)
Force to unpack library files every
exec(String) call. |
void |
release()
Release nodejs and v8 resources.
|
static void |
run(File basedir,
org.jooby.funzy.Throwing.Consumer<Nodejs> callback)
Execute the given nodejs callback and automatically release v8 and nodejs resources.
|
static void |
run(org.jooby.funzy.Throwing.Consumer<Nodejs> callback)
Execute the given nodejs callback and automatically release v8 and nodejs resources.
|
public Nodejs(File basedir, ClassLoader loader)
Nodejs.basedir - Base dir where to deploy a library.loader - Class loader to use.public Nodejs(File basedir)
Nodejs.basedir - Base dir where to deploy a library.public Nodejs()
Nodejs and use the java.io.tmpdir as base dir.public Nodejs overwrite(boolean overwrite)
exec(String) call. This is useful for development
and testing. By default files are unpacked just once (overwrite = false).overwrite - True, to force overwrite.public void exec(String library) throws Throwable
library - Library to unpack and execute this library.Throwable - If something goes wrong.public void exec(String library, org.jooby.funzy.Throwing.Consumer<com.eclipsesource.v8.V8> callback) throws Throwable
library - Library to unpack and execute this library.Throwable - If something goes wrong.public void release()
public static void run(org.jooby.funzy.Throwing.Consumer<Nodejs> callback)
callback - Nodejs callback.Copyright © 2017. All rights reserved.