Lines Matching full:env
38 …d s_destroy_connection_callback_data(struct connection_callback_data *callback_data, JNIEnv *env) { in s_destroy_connection_callback_data() argument
39 if (callback_data == NULL || env == NULL) { in s_destroy_connection_callback_data()
44 (*env)->DeleteGlobalRef(env, callback_data->java_connection_handler); in s_destroy_connection_callback_data()
57 /********** JNI ENV ACQUIRE **********/ in s_on_connection_setup()
58 JNIEnv *env = aws_jni_acquire_thread_env(callback_data->jvm); in s_on_connection_setup() local
59 if (env == NULL) { in s_on_connection_setup()
64 (*env)->CallVoidMethod( in s_on_connection_setup()
65 env, in s_on_connection_setup()
71 if (aws_jni_check_and_clear_exception(env) && !error_code) { in s_on_connection_setup()
77 s_destroy_connection_callback_data(callback_data, env); in s_on_connection_setup()
80 aws_jni_release_thread_env(jvm, env); in s_on_connection_setup()
81 /********** JNI ENV RELEASE **********/ in s_on_connection_setup()
92 /********** JNI ENV ACQUIRE **********/ in s_on_connection_shutdown()
93 JNIEnv *env = aws_jni_acquire_thread_env(callback_data->jvm); in s_on_connection_shutdown() local
94 if (env == NULL) { in s_on_connection_shutdown()
99 (*env)->CallVoidMethod( in s_on_connection_shutdown()
100 env, in s_on_connection_shutdown()
104 aws_jni_check_and_clear_exception(env); in s_on_connection_shutdown()
107 s_destroy_connection_callback_data(callback_data, env); in s_on_connection_shutdown()
109 aws_jni_release_thread_env(jvm, env); in s_on_connection_shutdown()
110 /********** JNI ENV RELEASE **********/ in s_on_connection_shutdown()
121 /********** JNI ENV ACQUIRE **********/ in s_connection_protocol_message()
122 JNIEnv *env = aws_jni_acquire_thread_env(callback_data->jvm); in s_connection_protocol_message() local
123 if (env == NULL) { in s_connection_protocol_message()
129 aws_jni_get_allocator(), env, message_args->headers, message_args->headers_count); in s_connection_protocol_message()
132 jbyteArray payload_byte_array = aws_jni_byte_array_from_cursor(env, &payload_cur); in s_connection_protocol_message()
134 (*env)->CallVoidMethod( in s_connection_protocol_message()
135 env, in s_connection_protocol_message()
143 (*env)->DeleteLocalRef(env, payload_byte_array); in s_connection_protocol_message()
144 (*env)->DeleteLocalRef(env, headers_array); in s_connection_protocol_message()
145 aws_jni_check_and_clear_exception(env); in s_connection_protocol_message()
147 aws_jni_release_thread_env(callback_data->jvm, env); in s_connection_protocol_message()
148 /********** JNI ENV RELEASE **********/ in s_connection_protocol_message()
153 JNIEnv *env, in Java_software_amazon_awssdk_crt_eventstream_ClientConnection_clientConnect() argument
162 aws_cache_jni_ids(env); in Java_software_amazon_awssdk_crt_eventstream_ClientConnection_clientConnect()
169 … aws_jni_throw_runtime_exception(env, "ClientConnection.clientConnect: Invalid ClientBootstrap"); in Java_software_amazon_awssdk_crt_eventstream_ClientConnection_clientConnect()
174 … aws_jni_throw_runtime_exception(env, "ClientConnection.clientConnect: Invalid SocketOptions"); in Java_software_amazon_awssdk_crt_eventstream_ClientConnection_clientConnect()
196 jint jvmresult = (*env)->GetJavaVM(env, &callback_data->jvm); in Java_software_amazon_awssdk_crt_eventstream_ClientConnection_clientConnect()
198 aws_jni_throw_runtime_exception(env, "ClientConnection.clientConnect: Unable to get JVM"); in Java_software_amazon_awssdk_crt_eventstream_ClientConnection_clientConnect()
202 … callback_data->java_connection_handler = (*env)->NewGlobalRef(env, jni_client_connection_handler); in Java_software_amazon_awssdk_crt_eventstream_ClientConnection_clientConnect()
204 …aws_jni_throw_runtime_exception(env, "ClientConnection.clientConnect: Unable to create global ref"… in Java_software_amazon_awssdk_crt_eventstream_ClientConnection_clientConnect()
208 const size_t host_name_len = (*env)->GetArrayLength(env, jni_host_name); in Java_software_amazon_awssdk_crt_eventstream_ClientConnection_clientConnect()
209 jbyte *host_name = (*env)->GetPrimitiveArrayCritical(env, jni_host_name, NULL); in Java_software_amazon_awssdk_crt_eventstream_ClientConnection_clientConnect()
211 (*env)->ReleasePrimitiveArrayCritical(env, jni_host_name, host_name, 0); in Java_software_amazon_awssdk_crt_eventstream_ClientConnection_clientConnect()
214 … aws_jni_throw_runtime_exception(env, "ServerListener.server_listener_new: Unable to allocate"); in Java_software_amazon_awssdk_crt_eventstream_ClientConnection_clientConnect()
245 s_destroy_connection_callback_data(callback_data, env); in Java_software_amazon_awssdk_crt_eventstream_ClientConnection_clientConnect()
256 JNIEnv *env, in Java_software_amazon_awssdk_crt_eventstream_ClientConnection_isClientConnectionOpen() argument
259 (void)env; in Java_software_amazon_awssdk_crt_eventstream_ClientConnection_isClientConnectionOpen()
261 aws_cache_jni_ids(env); in Java_software_amazon_awssdk_crt_eventstream_ClientConnection_isClientConnectionOpen()
274 JNIEnv *env, in Java_software_amazon_awssdk_crt_eventstream_ClientConnection_closeClientConnection() argument
278 (void)env; in Java_software_amazon_awssdk_crt_eventstream_ClientConnection_closeClientConnection()
280 aws_cache_jni_ids(env); in Java_software_amazon_awssdk_crt_eventstream_ClientConnection_closeClientConnection()
293 JNIEnv *env, in Java_software_amazon_awssdk_crt_eventstream_ClientConnection_acquireClientConnection() argument
296 (void)env; in Java_software_amazon_awssdk_crt_eventstream_ClientConnection_acquireClientConnection()
298 aws_cache_jni_ids(env); in Java_software_amazon_awssdk_crt_eventstream_ClientConnection_acquireClientConnection()
311 JNIEnv *env, in Java_software_amazon_awssdk_crt_eventstream_ClientConnection_releaseClientConnection() argument
314 (void)env; in Java_software_amazon_awssdk_crt_eventstream_ClientConnection_releaseClientConnection()
316 aws_cache_jni_ids(env); in Java_software_amazon_awssdk_crt_eventstream_ClientConnection_releaseClientConnection()
332 static void s_destroy_message_flush_callback_args(JNIEnv *env, struct message_flush_callback_args *… in s_destroy_message_flush_callback_args() argument
338 (*env)->DeleteGlobalRef(env, callback_args->callback); in s_destroy_message_flush_callback_args()
347 /********** JNI ENV ACQUIRE **********/ in s_message_flush_fn()
348 JNIEnv *env = aws_jni_acquire_thread_env(callback_data->jvm); in s_message_flush_fn() local
349 if (env == NULL) { in s_message_flush_fn()
354 (*env)->CallVoidMethod( in s_message_flush_fn()
355 … env, callback_data->callback, event_stream_server_message_flush_properties.callback, error_code); in s_message_flush_fn()
356 aws_jni_check_and_clear_exception(env); in s_message_flush_fn()
359 s_destroy_message_flush_callback_args(env, callback_data); in s_message_flush_fn()
361 aws_jni_release_thread_env(jvm, env); in s_message_flush_fn()
362 /********** JNI ENV RELEASE **********/ in s_message_flush_fn()
367 JNIEnv *env, in Java_software_amazon_awssdk_crt_eventstream_ClientConnection_sendProtocolMessage() argument
376 aws_cache_jni_ids(env); in Java_software_amazon_awssdk_crt_eventstream_ClientConnection_sendProtocolMessage()
386 …&marshalled_message, aws_jni_get_allocator(), env, headers, payload, NULL, message_flags, message_… in Java_software_amazon_awssdk_crt_eventstream_ClientConnection_sendProtocolMessage()
397 … aws_jni_throw_runtime_exception(env, "ClientConnection.sendProtocolMessage: allocation failed."); in Java_software_amazon_awssdk_crt_eventstream_ClientConnection_sendProtocolMessage()
401 jint jvmresult = (*env)->GetJavaVM(env, &callback_data->jvm); in Java_software_amazon_awssdk_crt_eventstream_ClientConnection_sendProtocolMessage()
403 … aws_jni_throw_runtime_exception(env, "ClientConnection.sendProtocolMessage: Unable to get JVM"); in Java_software_amazon_awssdk_crt_eventstream_ClientConnection_sendProtocolMessage()
407 callback_data->callback = (*env)->NewGlobalRef(env, callback); in Java_software_amazon_awssdk_crt_eventstream_ClientConnection_sendProtocolMessage()
411 … aws_jni_throw_runtime_exception(env, "ClientConnection.sendProtocolMessage: send message failed"); in Java_software_amazon_awssdk_crt_eventstream_ClientConnection_sendProtocolMessage()
421 s_destroy_message_flush_callback_args(env, callback_data); in Java_software_amazon_awssdk_crt_eventstream_ClientConnection_sendProtocolMessage()
433 static void s_client_continuation_data_destroy(JNIEnv *env, struct continuation_callback_data *call… in s_client_continuation_data_destroy() argument
439 (*env)->DeleteGlobalRef(env, callback_data->java_continuation_handler); in s_client_continuation_data_destroy()
443 (*env)->DeleteGlobalRef(env, callback_data->java_continuation); in s_client_continuation_data_destroy()
457 /********** JNI ENV ACQUIRE **********/ in s_stream_continuation()
458 JNIEnv *env = aws_jni_acquire_thread_env(callback_data->jvm); in s_stream_continuation() local
459 if (env == NULL) { in s_stream_continuation()
465 aws_jni_get_allocator(), env, message_args->headers, message_args->headers_count); in s_stream_continuation()
468 jbyteArray payload_byte_array = aws_jni_byte_array_from_cursor(env, &payload_cur); in s_stream_continuation()
470 (*env)->CallVoidMethod( in s_stream_continuation()
471 env, in s_stream_continuation()
479 (*env)->DeleteLocalRef(env, payload_byte_array); in s_stream_continuation()
480 (*env)->DeleteLocalRef(env, headers_array); in s_stream_continuation()
482 aws_jni_check_and_clear_exception(env); in s_stream_continuation()
484 aws_jni_release_thread_env(callback_data->jvm, env); in s_stream_continuation()
485 /********** JNI ENV RELEASE **********/ in s_stream_continuation()
494 /********** JNI ENV ACQUIRE **********/ in s_stream_continuation_closed()
495 JNIEnv *env = aws_jni_acquire_thread_env(continuation_callback_data->jvm); in s_stream_continuation_closed() local
496 if (env == NULL) { in s_stream_continuation_closed()
501 (*env)->CallVoidMethod( in s_stream_continuation_closed()
502 env, in s_stream_continuation_closed()
506 aws_jni_check_and_clear_exception(env); in s_stream_continuation_closed()
509 s_client_continuation_data_destroy(env, continuation_callback_data); in s_stream_continuation_closed()
510 aws_jni_release_thread_env(jvm, env); in s_stream_continuation_closed()
511 /********** JNI ENV RELEASE **********/ in s_stream_continuation_closed()
516 JNIEnv *env, in Java_software_amazon_awssdk_crt_eventstream_ClientConnection_newClientStream() argument
521 aws_cache_jni_ids(env); in Java_software_amazon_awssdk_crt_eventstream_ClientConnection_newClientStream()
534 jint jvmresult = (*env)->GetJavaVM(env, &continuation_callback_data->jvm); in Java_software_amazon_awssdk_crt_eventstream_ClientConnection_newClientStream()
536 aws_jni_throw_runtime_exception(env, "ClientConnection.newClientStream: Unable to get JVM"); in Java_software_amazon_awssdk_crt_eventstream_ClientConnection_newClientStream()
540 …continuation_callback_data->java_continuation_handler = (*env)->NewGlobalRef(env, continuation_han… in Java_software_amazon_awssdk_crt_eventstream_ClientConnection_newClientStream()
542 …aws_jni_throw_runtime_exception(env, "ClientConnection.newClientStream: Unable to create reference… in Java_software_amazon_awssdk_crt_eventstream_ClientConnection_newClientStream()
556 … aws_jni_throw_runtime_exception(env, "ClientConnection.newClientStream: Unable to create stream"); in Java_software_amazon_awssdk_crt_eventstream_ClientConnection_newClientStream()
563 s_client_continuation_data_destroy(env, continuation_callback_data); in Java_software_amazon_awssdk_crt_eventstream_ClientConnection_newClientStream()
569 JNIEnv *env, in Java_software_amazon_awssdk_crt_eventstream_ClientConnectionContinuation_activateContinuation() argument
580 aws_cache_jni_ids(env); in Java_software_amazon_awssdk_crt_eventstream_ClientConnectionContinuation_activateContinuation()
592 continuation_callback_data->java_continuation = (*env)->NewGlobalRef(env, continuation); in Java_software_amazon_awssdk_crt_eventstream_ClientConnectionContinuation_activateContinuation()
596 env, "ClientConnectionContinuation.activateContinuation: Unable to create reference"); in Java_software_amazon_awssdk_crt_eventstream_ClientConnectionContinuation_activateContinuation()
604 env, in Java_software_amazon_awssdk_crt_eventstream_ClientConnectionContinuation_activateContinuation()
616 …aws_jni_throw_runtime_exception(env, "ClientConnectionContinuation.activateContinuation: allocatio… in Java_software_amazon_awssdk_crt_eventstream_ClientConnectionContinuation_activateContinuation()
620 jint jvmresult = (*env)->GetJavaVM(env, &callback_data->jvm); in Java_software_amazon_awssdk_crt_eventstream_ClientConnectionContinuation_activateContinuation()
622 …aws_jni_throw_runtime_exception(env, "ClientConnectionContinuation.activateContinuation: Unable to… in Java_software_amazon_awssdk_crt_eventstream_ClientConnectionContinuation_activateContinuation()
626 callback_data->callback = (*env)->NewGlobalRef(env, callback); in Java_software_amazon_awssdk_crt_eventstream_ClientConnectionContinuation_activateContinuation()
629 env, "ClientConnectionContinuation.activateContinuation: make global ref failed"); in Java_software_amazon_awssdk_crt_eventstream_ClientConnectionContinuation_activateContinuation()
641 …aws_jni_throw_runtime_exception(env, "ClientConnectionContinuation.activateContinuation: send mess… in Java_software_amazon_awssdk_crt_eventstream_ClientConnectionContinuation_activateContinuation()
652 s_destroy_message_flush_callback_args(env, callback_data); in Java_software_amazon_awssdk_crt_eventstream_ClientConnectionContinuation_activateContinuation()
660 JNIEnv *env, in Java_software_amazon_awssdk_crt_eventstream_ClientConnectionContinuation_sendContinuationMessage() argument
669 aws_cache_jni_ids(env); in Java_software_amazon_awssdk_crt_eventstream_ClientConnectionContinuation_sendContinuationMessage()
680 …&marshalled_message, aws_jni_get_allocator(), env, headers, payload, NULL, message_flags, message_… in Java_software_amazon_awssdk_crt_eventstream_ClientConnectionContinuation_sendContinuationMessage()
692 env, "ClientConnectionContinuation.sendContinuationMessage: allocation failed."); in Java_software_amazon_awssdk_crt_eventstream_ClientConnectionContinuation_sendContinuationMessage()
696 jint jvmresult = (*env)->GetJavaVM(env, &callback_data->jvm); in Java_software_amazon_awssdk_crt_eventstream_ClientConnectionContinuation_sendContinuationMessage()
698 …aws_jni_throw_runtime_exception(env, "ClientConnectionContinuation.sendContinuationMessage: Unable… in Java_software_amazon_awssdk_crt_eventstream_ClientConnectionContinuation_sendContinuationMessage()
702 callback_data->callback = (*env)->NewGlobalRef(env, callback); in Java_software_amazon_awssdk_crt_eventstream_ClientConnectionContinuation_sendContinuationMessage()
705 env, "ClientConnectionContinuation.sendContinuationMessage: make global ref failed"); in Java_software_amazon_awssdk_crt_eventstream_ClientConnectionContinuation_sendContinuationMessage()
712 env, "ClientConnectionContinuation.sendContinuationMessage: send message failed"); in Java_software_amazon_awssdk_crt_eventstream_ClientConnectionContinuation_sendContinuationMessage()
722 s_destroy_message_flush_callback_args(env, callback_data); in Java_software_amazon_awssdk_crt_eventstream_ClientConnectionContinuation_sendContinuationMessage()
730 JNIEnv *env, in Java_software_amazon_awssdk_crt_eventstream_ClientConnectionContinuation_releaseContinuation() argument
733 (void)env; in Java_software_amazon_awssdk_crt_eventstream_ClientConnectionContinuation_releaseContinuation()
735 aws_cache_jni_ids(env); in Java_software_amazon_awssdk_crt_eventstream_ClientConnectionContinuation_releaseContinuation()