+ /* get the C string from the java string */
+ if (jname == nullptr) {
+ jxbt_throw_null(env, "No VM can have a null name");
+ return nullptr;
+ }
+ jstring_wrapper name(env, jname);
+ /* get the VM by name (VMs are just special hosts, unfortunately) */
+ auto const* host = sg_host_by_name(name);
+
+ if (not host) { /* invalid name */
+ jxbt_throw_host_not_found(env, name);
+ return nullptr;
+ }
+
+ return static_cast<jobject>(host->extension(JAVA_HOST_LEVEL));