JNICCC::~JNICCC() { JNIEnv* env = AttachToJVM(_javaVM); if(_objCCC) env->DeleteGlobalRef(_objCCC); }
void JNICCC::close(){ CCC::close(); if(_objCCC){ JNIEnv* env = AttachToJVM(_javaVM); env->CallVoidMethod(_objCCC, _methodClose); } }
void JNICCC::init(){ CCC::init(); if(_objCCC){ JNIEnv* env = AttachToJVM(_javaVM); env->CallVoidMethod(_objCCC, _methodInit); } }
void JNICCC::onTimeout(){ CCC::onTimeout(); if(_objCCC){ JNIEnv* env = AttachToJVM(_javaVM); env->CallVoidMethod(_objCCC, _methodTimeout); } }
void JNICCC::onACK(const int32_t& ack){ CCC::onACK(ack); if(_objCCC){ JNIEnv* env = AttachToJVM(_javaVM); env->CallVoidMethod(_objCCC, _methodOnACK, ack); } }
JNICCCFactory::~JNICCCFactory(){ JNIEnv* env = AttachToJVM(); if(_factoryUDT != NULL){ env->DeleteLocalRef(_factoryUDT); } }
CCCVirtualFactory* JNICCCFactory::clone(){ JNIEnv* env = AttachToJVM(); jobject objFactoryUDT = env->CallObjectMethod(_factoryUDT,_udt_clsFactoryInterfaceUDT_cloneFactory); return new JNICCCFactory(env,objFactoryUDT); }
CCC* JNICCCFactory::create(){ JNIEnv* env = AttachToJVM(); jobject objCCC = env->CallObjectMethod(_factoryUDT,_udt_clsFactoryInterfaceUDT_create); if(objCCC==NULL && !env->ExceptionCheck() ){ UDT_ThrowExceptionUDT_Message(env, 0, "failed to allocate CCC class via com.barchart.udt.FactoryInterfaceUDT"); } return reinterpret_cast<CCC*> ((intptr_t) env->GetLongField(objCCC,udt_clsCCC_fld_nativeHandleID)); }