public NativeLogger() { super(LoggerJNI.create()); try { globalRef = NativeDB.DBJNI.NewGlobalRef(this); if( globalRef==0 ) { throw new RuntimeException("jni call failed: NewGlobalRef"); } LoggerJNI struct = new LoggerJNI(); struct.log_method = NativeDB.DBJNI.GetMethodID(this.getClass(), "log", "(Ljava/lang/String;)V"); if( struct.log_method ==0 ) { throw new RuntimeException("jni call failed: GetMethodID"); } struct.target = globalRef; LoggerJNI.memmove(self, struct, LoggerJNI.SIZEOF); } catch (RuntimeException e) { delete(); throw e; } }
public NativeLogger() { super(LoggerJNI.create()); try { globalRef = NativeDB.DBJNI.NewGlobalRef(this); if( globalRef==0 ) { throw new RuntimeException("jni call failed: NewGlobalRef"); } LoggerJNI struct = new LoggerJNI(); struct.log_method = NativeDB.DBJNI.GetMethodID(this.getClass(), "log", "(Ljava/lang/String;)V"); if( struct.log_method ==0 ) { throw new RuntimeException("jni call failed: GetMethodID"); } struct.target = globalRef; LoggerJNI.memmove(self, struct, LoggerJNI.SIZEOF); } catch (RuntimeException e) { delete(); throw e; } }
public NativeLogger() { super(LoggerJNI.create()); try { globalRef = NativeDB.DBJNI.NewGlobalRef(this); if( globalRef==0 ) { throw new RuntimeException("jni call failed: NewGlobalRef"); } LoggerJNI struct = new LoggerJNI(); struct.log_method = NativeDB.DBJNI.GetMethodID(this.getClass(), "log", "(Ljava/lang/String;)V"); if( struct.log_method ==0 ) { throw new RuntimeException("jni call failed: GetMethodID"); } struct.target = globalRef; LoggerJNI.memmove(self, struct, LoggerJNI.SIZEOF); } catch (RuntimeException e) { delete(); throw e; } }