NebulaStream  0.6.213
NebulaStream is a data and application management framework for the internet of things
NES::jni::JVM Class Referencefinal

#include <JNI.hpp>

Public Member Functions

 JVM ()
 
void init ()
 Initialized the Java Virtual Machine with specific options and a classpath. More...
 
JVMaddOption (const std::string &options)
 Adds a option to the JVM. Throws an exception if the JVM is already started. More...
 
JVMaddClasspath (const std::string &classPath)
 Appends a classpath to the JVM before initialization. More...
 
bool isInitialized ()
 Indicates if the JVM was already initialized. More...
 

Static Public Member Functions

static JVMget ()
 Returns an instance to a JVM, which may or may not be initialized yet. More...
 

Detailed Description

When the application's entry point is in C++ rather than in Java, it will need to spin up its own instance of the Java Virtual Machine (JVM) before it can initialize the Java Native Interface. Vm is used to create and destroy a running JVM instance. The JVM is stored in a global static variable. So it can be initialized exactly once. Any further initialization causes an exception. Before creation, the addOption and addClasspath methods can be used, to configure the JVM instance.

As only ever one JVM instance can be created, it is shared by different users. For instance, for the execution of UDFs or as a compilation backend.

Constructor & Destructor Documentation

◆ JVM()

NES::jni::JVM::JVM ( )
inline

Member Function Documentation

◆ addClasspath()

JVM& NES::jni::JVM::addClasspath ( const std::string &  classPath)

Appends a classpath to the JVM before initialization.

Parameters
classPath
Returns
JVM

◆ addOption()

JVM& NES::jni::JVM::addOption ( const std::string &  options)

Adds a option to the JVM. Throws an exception if the JVM is already started.

Parameters
options
Returns
JVM

◆ get()

static JVM& NES::jni::JVM::get ( )
static

Returns an instance to a JVM, which may or may not be initialized yet.

Returns
JVM.

◆ init()

void NES::jni::JVM::init ( )

Initialized the Java Virtual Machine with specific options and a classpath.

◆ isInitialized()

bool NES::jni::JVM::isInitialized ( )

Indicates if the JVM was already initialized.

Returns
bool

The documentation for this class was generated from the following file: