MCPcopy Create free account
hub / github.com/SoarGroup/Soar / GetEnv

Method GetEnv

Core/ClientSMLSWIG/Java/JavaCallbackByHand.h:148–165  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

146 }
147
148 JNIEnv* GetEnv()
149 {
150 // We have several options here to get the JNIEnv*.
151 // 1) We use the one we were passed originally in the registration call: m_JavaEnv
152 // 2) We call m_JavaVM->GetEnv((void**)&penv, JNI_VERSION_1_4) ;
153 // 3) We call m_JavaVM->AttachCurrentThread((void**)&penv, 0) ;
154 // I think we need to use the 3rd form if we wish to support callbacks on a different thread.
155 JNIEnv* penv ;
156 int result = m_JavaVM->AttachCurrentThread((void**)&penv, 0) ;
157
158 // Error attaching to the VM
159 if (result < 0)
160 {
161 return 0 ;
162 }
163
164 return penv ;
165 }
166
167 // We need to clean up the global references that we created earlier
168 ~JavaCallbackData()

Callers 12

RunEventHandlerFunction · 0.80
ProductionEventHandlerFunction · 0.80
PrintEventHandlerFunction · 0.80
XMLEventHandlerFunction · 0.80
OutputEventHandlerFunction · 0.80
SystemEventHandlerFunction · 0.80
UpdateEventHandlerFunction · 0.80
StringEventHandlerFunction · 0.80
RhsEventHandlerFunction · 0.80
ClientMessageHandlerFunction · 0.80
AgentEventHandlerFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected