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 IJavetClosableclose in interface java.lang.AutoCloseableJavetExceptionprotected void close(boolean forceClose)
throws JavetException
forceClose - the force closeJavetException - the javet exceptionpublic JavetEngineConfig getConfig()
IJavetEnginegetConfig in interface IJavetEngine<R extends V8Runtime>@CheckReturnValue public V8Guard getGuard()
IJavetEnginegetGuard in interface IJavetEngine<R extends V8Runtime>@CheckReturnValue public V8Guard getGuard(long timeoutMillis)
IJavetEnginegetGuard 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
IJavetEnginegetV8Runtime in interface IJavetEngine<R extends V8Runtime>JavetException - the javet exceptionpublic boolean isActive()
IJavetEngineisActive in interface IJavetEngine<R extends V8Runtime>public boolean isClosed()
IJavetClosableisClosed in interface IJavetClosablepublic void resetContext()
throws JavetException
IJavetEngineresetContext in interface IJavetEngine<R extends V8Runtime>JavetException - the javet exceptionpublic void resetIsolate()
throws JavetException
IJavetEngineresetIsolate in interface IJavetEngine<R extends V8Runtime>JavetException - the javet exceptionpublic void sendGCNotification()
IJavetEnginesendGCNotification in interface IJavetEngine<R extends V8Runtime>protected void setActive(boolean active)
active - the activeprotected void touchLastActiveZonedDateTime()