R
- the type parameterpublic class JavetEngine<R extends V8Runtime> extends java.lang.Object implements IJavetEngine<R>
Modifier and Type | Field and Description |
---|---|
protected boolean |
active
The Active.
|
protected IJavetEnginePool<R> |
iJavetEnginePool
The Javet engine pool.
|
protected int |
index
The Index.
|
protected JavetEngineUsage |
usage
The Usage.
|
protected R |
v8Runtime
The V8 runtime.
|
Constructor and Description |
---|
JavetEngine(IJavetEnginePool<R> iJavetEnginePool,
R v8Runtime)
Instantiates a new Javet engine.
|
Modifier and Type | Method and Description |
---|---|
void |
close() |
protected void |
close(boolean forceClose)
Close.
|
JavetEngineConfig |
getConfig()
Gets config.
|
V8Guard |
getGuard()
Gets guard.
|
V8Guard |
getGuard(long timeoutMillis)
Gets guard.
|
int |
getIndex()
Gets index.
|
protected JavetEngineUsage |
getUsage()
Gets usage.
|
protected java.time.ZonedDateTime |
getUTCNow()
Gets UTC now.
|
R |
getV8Runtime()
Gets V8 runtime.
|
boolean |
isActive()
Is active boolean.
|
boolean |
isClosed()
Is closed.
|
void |
resetContext()
Reset context.
|
void |
resetIsolate()
Reset isolate.
|
void |
sendGCNotification()
Send GC notification.
|
protected void |
setActive(boolean active)
Sets active.
|
protected void |
touchLastActiveZonedDateTime()
Touch last active zoned date time.
|
protected volatile boolean active
protected IJavetEnginePool<R extends V8Runtime> iJavetEnginePool
protected int index
protected JavetEngineUsage usage
public JavetEngine(IJavetEnginePool<R> iJavetEnginePool, R v8Runtime)
iJavetEnginePool
- the javet engine poolv8Runtime
- the V8 runtimepublic void close() throws JavetException
close
in interface IJavetClosable
close
in interface java.lang.AutoCloseable
JavetException
protected void close(boolean forceClose) throws JavetException
forceClose
- the force closeJavetException
- the javet exceptionpublic JavetEngineConfig getConfig()
IJavetEngine
getConfig
in interface IJavetEngine<R extends V8Runtime>
@CheckReturnValue public V8Guard getGuard()
IJavetEngine
getGuard
in interface IJavetEngine<R extends V8Runtime>
@CheckReturnValue public V8Guard getGuard(long timeoutMillis)
IJavetEngine
getGuard
in interface IJavetEngine<R extends V8Runtime>
timeoutMillis
- the timeout millispublic int getIndex()
protected java.time.ZonedDateTime getUTCNow()
protected JavetEngineUsage getUsage()
public R getV8Runtime() throws JavetException
IJavetEngine
getV8Runtime
in interface IJavetEngine<R extends V8Runtime>
JavetException
- the javet exceptionpublic boolean isActive()
IJavetEngine
isActive
in interface IJavetEngine<R extends V8Runtime>
public boolean isClosed()
IJavetClosable
isClosed
in interface IJavetClosable
public void resetContext() throws JavetException
IJavetEngine
resetContext
in interface IJavetEngine<R extends V8Runtime>
JavetException
- the javet exceptionpublic void resetIsolate() throws JavetException
IJavetEngine
resetIsolate
in interface IJavetEngine<R extends V8Runtime>
JavetException
- the javet exceptionpublic void sendGCNotification()
IJavetEngine
sendGCNotification
in interface IJavetEngine<R extends V8Runtime>
protected void setActive(boolean active)
active
- the activeprotected void touchLastActiveZonedDateTime()