MCPcopy Create free account
hub / github.com/apache/nifi-minifi-cpp / newInstance

Method newInstance

extensions/jni/jvm/JavaClass.h:85–97  ·  view source on GitHub ↗

* Call empty constructor * @param env if supplied * @return jobject that is a global reference. */

Source from the content-addressed store, hash-verified

83 * @return jobject that is a global reference.
84 */
85 JNIEXPORT
86 jobject newInstance(JNIEnv *env) {
87 std::string instanceName = "(L" + name_ + ";)V";
88 JNIEnv *lenv = env;
89
90 ThrowIf(lenv);
91
92 auto rezobj = lenv->NewObject(class_ref_, cnstrctr);
93
94 ThrowIf(lenv);
95
96 return lenv->NewGlobalRef(rezobj);
97 }
98
99 jmethodID getClassMethod(JNIEnv *env, const std::string &methodName, const std::string &type) {
100 jmethodID mid = env->GetMethodID(class_ref_, methodName.c_str(), type.c_str());

Calls 1

ThrowIfFunction · 0.85

Tested by

no test coverage detected