dxFeed Graal Native SDK 3.14.0-rc2
Loading...
Searching...
No Matches
Javac

Java helper types and functions that every other header uses: object handles, lists, strings, executors, time zones, time periods and formats, authorization tokens. More...

Data Structures

struct  dxfg_java_object_handler
 The handle of a Java object: the reference by which the C code refers to an object that lives in Java. More...
struct  dxfg_java_object_t
 A handle of a Java object with the same layout as dxfg_java_object_handler. More...
struct  dxfg_list
 The common layout of the lists of the SDK: the number of elements and the array of pointers to them. More...
struct  dxfg_java_object_handler_list
 A list of handles of Java objects. More...
struct  dxfg_string_list
 A list of strings. More...
struct  dxfg_executor_t
 A handle of a Java Executor object; release it with dxfg_JavaObjectHandler_release(). More...
struct  dxfg_input_stream_t
 A handle of a Java InputStream object; release it with dxfg_JavaObjectHandler_release(). More...
struct  dxfg_time_period_t
 A handle of a Java TimePeriod object; release it with dxfg_JavaObjectHandler_release(). More...
struct  dxfg_time_format_t
 A handle of a Java TimeFormat object; release it with dxfg_JavaObjectHandler_release(). More...
struct  dxfg_time_zone_t
 A handle of a Java TimeZone object; release it with dxfg_JavaObjectHandler_release(). More...
struct  dxfg_auth_token_t
 A handle of a Java AuthToken object; release it with dxfg_JavaObjectHandler_release(). More...

Typedefs

typedef struct dxfg_java_object_handler dxfg_java_object_handler
 The handle of a Java object: the reference by which the C code refers to an object that lives in Java.
typedef struct dxfg_java_object_t dxfg_java_object_t
 A handle of a Java object with the same layout as dxfg_java_object_handler.
typedef struct dxfg_list dxfg_list
 The common layout of the lists of the SDK: the number of elements and the array of pointers to them.
typedef struct dxfg_java_object_handler_list dxfg_java_object_handler_list
 A list of handles of Java objects.
typedef struct dxfg_string_list dxfg_string_list
 A list of strings.
typedef struct dxfg_executor_t dxfg_executor_t
 A handle of a Java Executor object; release it with dxfg_JavaObjectHandler_release().
typedef struct dxfg_input_stream_t dxfg_input_stream_t
 A handle of a Java InputStream object; release it with dxfg_JavaObjectHandler_release().
typedef struct dxfg_time_period_t dxfg_time_period_t
 A handle of a Java TimePeriod object; release it with dxfg_JavaObjectHandler_release().
typedef struct dxfg_time_format_t dxfg_time_format_t
 A handle of a Java TimeFormat object; release it with dxfg_JavaObjectHandler_release().
typedef struct dxfg_time_zone_t dxfg_time_zone_t
 A handle of a Java TimeZone object; release it with dxfg_JavaObjectHandler_release().
typedef struct dxfg_auth_token_t dxfg_auth_token_t
 A handle of a Java AuthToken object; release it with dxfg_JavaObjectHandler_release().
typedef enum dxfg_rounding_mode_t dxfg_rounding_mode_t
 The rounding behavior of numerical operations that can discard precision (java.math.RoundingMode), e.g. of dxfg_PriceIncrements_roundPrice3().
typedef void(*) dxfg_finalize_function(graal_isolatethread_t *thread, void *user_data)
 The function registered by dxfg_Object_finalize(): called after the Java object has been garbage collected.

Enumerations

enum  dxfg_rounding_mode_t {
  DXFG_ROUNDING_MODE_UP = 0 , DXFG_ROUNDING_MODE_DOWN , DXFG_ROUNDING_MODE_CEILING , DXFG_ROUNDING_MODE_FLOOR ,
  DXFG_ROUNDING_MODE_HALF_UP , DXFG_ROUNDING_MODE_HALF_DOWN , DXFG_ROUNDING_MODE_HALF_EVEN , DXFG_ROUNDING_MODE_UNNECESSARY
}
 The rounding behavior of numerical operations that can discard precision (java.math.RoundingMode), e.g. of dxfg_PriceIncrements_roundPrice3(). More...

Functions

int32_t dxfg_Object_finalize (graal_isolatethread_t *thread, dxfg_java_object_handler *handler, dxfg_finalize_function finalize, void *user_data)
int32_t dxfg_JavaObjectHandler_release (graal_isolatethread_t *thread, dxfg_java_object_handler *handler)
int32_t dxfg_NativeListener_deactivate (graal_isolatethread_t *thread, dxfg_java_object_handler *listener)
int32_t dxfg_JavaObjectHandler_clone (graal_isolatethread_t *thread, dxfg_java_object_handler *javaObjectHandler, dxfg_java_object_handler **javaObjectHandlerClone)
int32_t dxfg_JavaObjectHandler_array_release (graal_isolatethread_t *thread, const dxfg_java_object_handler **handlersArray, int32_t size)
int32_t dxfg_Object_new (graal_isolatethread_t *thread, DXFG_OUT dxfg_java_object_handler **object)
const char * dxfg_Object_toString (graal_isolatethread_t *thread, dxfg_java_object_handler *object)
int32_t dxfg_Object_equals (graal_isolatethread_t *thread, dxfg_java_object_handler *object, dxfg_java_object_handler *other)
int32_t dxfg_Object_hashCode (graal_isolatethread_t *thread, dxfg_java_object_handler *object)
int32_t dxfg_Comparable_compareTo (graal_isolatethread_t *thread, dxfg_java_object_handler *object, dxfg_java_object_handler *other)
int32_t dxfg_CList_JavaObjectHandler_release (graal_isolatethread_t *thread, dxfg_java_object_handler_list *list)
int32_t dxfg_String_release (graal_isolatethread_t *thread, const char *string)
int32_t dxfg_CList_String_release (graal_isolatethread_t *thread, dxfg_string_list *stringList)
dxfg_executor_t * dxfg_Executors_newFixedThreadPool (graal_isolatethread_t *thread, int nThreads, const char *nameThreads)
dxfg_executor_t * dxfg_Executors_newScheduledThreadPool (graal_isolatethread_t *thread, int nThreads, const char *nameThreads)
dxfg_executor_t * dxfg_ExecutorBaseOnConcurrentLinkedQueue_new (graal_isolatethread_t *thread)
int32_t dxfg_ExecutorBaseOnConcurrentLinkedQueue_processAllPendingTasks (graal_isolatethread_t *thread, dxfg_executor_t *executor)
dxfg_input_stream_t * dxfg_ByteArrayInputStream_new (graal_isolatethread_t *thread, const char *bytes, int32_t size)
int32_t dxfg_gc (graal_isolatethread_t *thread)
dxfg_java_object_handler * dxfg_throw_exception (graal_isolatethread_t *thread)
dxfg_time_zone_t * dxfg_TimeZone_getTimeZone (graal_isolatethread_t *thread, const char *ID)
dxfg_time_zone_t * dxfg_TimeZone_getDefault (graal_isolatethread_t *thread)
const char * dxfg_TimeZone_getID (graal_isolatethread_t *thread, dxfg_time_zone_t *timeZone)
const char * dxfg_TimeZone_getDisplayName (graal_isolatethread_t *thread, dxfg_time_zone_t *timeZone)
const char * dxfg_TimeZone_getDisplayName2 (graal_isolatethread_t *thread, dxfg_time_zone_t *timeZone, int32_t daylight, int32_t style)
int32_t dxfg_TimeZone_getDSTSavings (graal_isolatethread_t *thread, dxfg_time_zone_t *timeZone)
int32_t dxfg_TimeZone_useDaylightTime (graal_isolatethread_t *thread, dxfg_time_zone_t *timeZone)
int32_t dxfg_TimeZone_observesDaylightTime (graal_isolatethread_t *thread, dxfg_time_zone_t *timeZone)
int32_t dxfg_TimeZone_getOffset (graal_isolatethread_t *thread, dxfg_time_zone_t *timeZone, int64_t date)
int32_t dxfg_TimeZone_getOffset2 (graal_isolatethread_t *thread, dxfg_time_zone_t *timeZone, int32_t era, int32_t year, int32_t month, int32_t day, int32_t dayOfWeek, int32_t milliseconds)
int32_t dxfg_TimeZone_getRawOffset (graal_isolatethread_t *thread, dxfg_time_zone_t *timeZone)
int32_t dxfg_TimeZone_hasSameRules (graal_isolatethread_t *thread, dxfg_time_zone_t *timeZone, dxfg_time_zone_t *other)
int32_t dxfg_TimeZone_inDaylightTime (graal_isolatethread_t *thread, dxfg_time_zone_t *timeZone, int64_t date)
int32_t dxfg_TimeZone_setID (graal_isolatethread_t *thread, dxfg_time_zone_t *timeZone, const char *ID)
int32_t dxfg_TimeZone_setRawOffset (graal_isolatethread_t *thread, dxfg_time_zone_t *timeZone, int32_t offsetMillis)
dxfg_time_period_t * dxfg_TimePeriod_ZERO (graal_isolatethread_t *thread)
dxfg_time_period_t * dxfg_TimePeriod_UNLIMITED (graal_isolatethread_t *thread)
dxfg_time_period_t * dxfg_TimePeriod_valueOf (graal_isolatethread_t *thread, int64_t value)
dxfg_time_period_t * dxfg_TimePeriod_valueOf2 (graal_isolatethread_t *thread, const char *value)
int64_t dxfg_TimePeriod_getTime (graal_isolatethread_t *thread, dxfg_time_period_t *timePeriod)
int32_t dxfg_TimePeriod_getSeconds (graal_isolatethread_t *thread, dxfg_time_period_t *timePeriod)
int64_t dxfg_TimePeriod_getNanos (graal_isolatethread_t *thread, dxfg_time_period_t *timePeriod)
dxfg_time_format_t * dxfg_TimeFormat_DEFAULT (graal_isolatethread_t *thread)
dxfg_time_format_t * dxfg_TimeFormat_GMT (graal_isolatethread_t *thread)
dxfg_time_format_t * dxfg_TimeFormat_getInstance (graal_isolatethread_t *thread, dxfg_time_zone_t *timeZone)
dxfg_time_format_t * dxfg_TimeFormat_withTimeZone (graal_isolatethread_t *thread, dxfg_time_format_t *timeFormat)
dxfg_time_format_t * dxfg_TimeFormat_withMillis (graal_isolatethread_t *thread, dxfg_time_format_t *timeFormat)
dxfg_time_format_t * dxfg_TimeFormat_asFullIso (graal_isolatethread_t *thread, dxfg_time_format_t *timeFormat)
int64_t dxfg_TimeFormat_parse (graal_isolatethread_t *thread, dxfg_time_format_t *timeFormat, const char *value)
const char * dxfg_TimeFormat_format (graal_isolatethread_t *thread, dxfg_time_format_t *timeFormat, int64_t value)
dxfg_time_zone_t * dxfg_TimeFormat_getTimeZone (graal_isolatethread_t *thread, dxfg_time_format_t *timeFormat)
dxfg_auth_token_t * dxfg_AuthToken_valueOf (graal_isolatethread_t *thread, const char *string)
dxfg_auth_token_t * dxfg_AuthToken_createBasicToken (graal_isolatethread_t *thread, const char *userPassword)
dxfg_auth_token_t * dxfg_AuthToken_createBasicToken2 (graal_isolatethread_t *thread, const char *user, const char *password)
dxfg_auth_token_t * dxfg_AuthToken_createBasicTokenOrNull (graal_isolatethread_t *thread, const char *user, const char *password)
dxfg_auth_token_t * dxfg_AuthToken_createBearerToken (graal_isolatethread_t *thread, const char *token)
dxfg_auth_token_t * dxfg_AuthToken_createBearerTokenOrNull (graal_isolatethread_t *thread, const char *token)
dxfg_auth_token_t * dxfg_AuthToken_createCustomToken (graal_isolatethread_t *thread, const char *scheme, const char *value)
const char * dxfg_AuthToken_getHttpAuthorization (graal_isolatethread_t *thread, dxfg_auth_token_t *authToken)
const char * dxfg_AuthToken_getUser (graal_isolatethread_t *thread, dxfg_auth_token_t *authToken)
const char * dxfg_AuthToken_getPassword (graal_isolatethread_t *thread, dxfg_auth_token_t *authToken)
const char * dxfg_AuthToken_getScheme (graal_isolatethread_t *thread, dxfg_auth_token_t *authToken)
const char * dxfg_AuthToken_getValue (graal_isolatethread_t *thread, dxfg_auth_token_t *authToken)

Detailed Description

Java helper types and functions that every other header uses: object handles, lists, strings, executors, time zones, time periods and formats, authorization tokens.

This group is the reference for the ownership rules of the C API:

Typedef Documentation

◆ dxfg_auth_token_t

typedef struct dxfg_auth_token_t dxfg_auth_token_t

A handle of a Java AuthToken object; release it with dxfg_JavaObjectHandler_release().

An authorization token: an authorization scheme (e.g. "Basic" or "Bearer") and its value. Create it with dxfg_AuthToken_valueOf() or one of the dxfg_AuthToken_create*() functions.

◆ dxfg_executor_t

typedef struct dxfg_executor_t dxfg_executor_t

A handle of a Java Executor object; release it with dxfg_JavaObjectHandler_release().

An executor runs the tasks that the SDK gives it, e.g. the calls of the listeners of a subscription or a model. Create it with dxfg_Executors_newFixedThreadPool(), dxfg_Executors_newScheduledThreadPool() or dxfg_ExecutorBaseOnConcurrentLinkedQueue_new().

https://docs.oracle.com/en/java/javase/22/docs/api/java.base/java/util/concurrent/Executor.html

◆ dxfg_finalize_function

typedef void(*) dxfg_finalize_function(graal_isolatethread_t *thread, void *user_data)

The function registered by dxfg_Object_finalize(): called after the Java object has been garbage collected.

It is called by a daemon Java thread of the SDK, not by the thread that registered it. The calls are made one after another on that thread, so a function that blocks delays the other ones. A registration is called once. The SDK does not use the user data and does not free it.

Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]user_dataThe pointer that was passed to dxfg_Object_finalize().

◆ dxfg_input_stream_t

typedef struct dxfg_input_stream_t dxfg_input_stream_t

A handle of a Java InputStream object; release it with dxfg_JavaObjectHandler_release().

A stream of bytes that the SDK reads, e.g. the instrument profile readers. Create it with dxfg_ByteArrayInputStream_new().

https://docs.oracle.com/en/java/javase/22/docs/api/java.base/java/io/InputStream.html

◆ dxfg_java_object_handler

typedef struct dxfg_java_object_handler dxfg_java_object_handler

The handle of a Java object: the reference by which the C code refers to an object that lives in Java.

The handle is allocated by the SDK and owned by the caller: release it with dxfg_JavaObjectHandler_release(), which frees the structure and drops the reference to the Java object. As long as any handle of an object exists, the object is not garbage collected. Use dxfg_JavaObjectHandler_clone() to get another handle of the same object.

The typed handle structures (e.g. dxfg_executor_t, dxfg_time_zone_t) consist of this structure only (the field handler), so a pointer to a typed handle is passed to the functions that take a dxfg_java_object_handler * as &typed->handler (or by a cast).

Use dxfg_Object_toString() to get the string representation of the object, dxfg_Object_equals() to compare objects and dxfg_Object_hashCode() to get the hash code.

◆ dxfg_java_object_handler_list

typedef struct dxfg_java_object_handler_list dxfg_java_object_handler_list

A list of handles of Java objects.

A list that a function returns is allocated by the SDK: release it with dxfg_CList_JavaObjectHandler_release(), which releases every handle of the list, frees the array of the elements and the list itself. A list that is passed to a function is only read by the SDK: the caller keeps its ownership.

◆ dxfg_java_object_t

typedef struct dxfg_java_object_t dxfg_java_object_t

A handle of a Java object with the same layout as dxfg_java_object_handler.

No function of this API takes it: the functions use dxfg_java_object_handler.

◆ dxfg_list

typedef struct dxfg_list dxfg_list

The common layout of the lists of the SDK: the number of elements and the array of pointers to them.

The concrete list types (dxfg_string_list, dxfg_java_object_handler_list, ...) have their own element types and their own release functions; there is no function that frees a dxfg_list as such.

◆ dxfg_rounding_mode_t

The rounding behavior of numerical operations that can discard precision (java.math.RoundingMode), e.g. of dxfg_PriceIncrements_roundPrice3().

Specifies a rounding behavior for numerical operations capable of discarding precision. Each rounding mode indicates how the least significant returned digit of a rounded result is to be calculated. If fewer digits are returned than the digits needed to represent the exact numerical result, the discarded digits will be referred to as the discarded fraction regardless the digits' contribution to the value of the number. In other words, considered as a numerical value, the discarded fraction could have an absolute value greater than one.

https://docs.oracle.com/en/java/javase/22/docs/api/java.base/java/math/RoundingMode.html

◆ dxfg_string_list

typedef struct dxfg_string_list dxfg_string_list

A list of strings.

A list that a function returns is allocated by the SDK: release it with dxfg_CList_String_release(), which frees every string, the array of the strings and the list itself. A list that is passed to a function is only read by the SDK: the caller keeps its ownership.

◆ dxfg_time_format_t

typedef struct dxfg_time_format_t dxfg_time_format_t

A handle of a Java TimeFormat object; release it with dxfg_JavaObjectHandler_release().

A parser and a formatter of dates and times in an ISO-compatible format for a time zone. Create it with dxfg_TimeFormat_DEFAULT(), dxfg_TimeFormat_GMT() or dxfg_TimeFormat_getInstance().

◆ dxfg_time_period_t

typedef struct dxfg_time_period_t dxfg_time_period_t

A handle of a Java TimePeriod object; release it with dxfg_JavaObjectHandler_release().

A period of time with a precision of milliseconds that is never negative. Create it with dxfg_TimePeriod_ZERO(), dxfg_TimePeriod_UNLIMITED() or dxfg_TimePeriod_valueOf().

◆ dxfg_time_zone_t

Enumeration Type Documentation

◆ dxfg_rounding_mode_t

The rounding behavior of numerical operations that can discard precision (java.math.RoundingMode), e.g. of dxfg_PriceIncrements_roundPrice3().

Specifies a rounding behavior for numerical operations capable of discarding precision. Each rounding mode indicates how the least significant returned digit of a rounded result is to be calculated. If fewer digits are returned than the digits needed to represent the exact numerical result, the discarded digits will be referred to as the discarded fraction regardless the digits' contribution to the value of the number. In other words, considered as a numerical value, the discarded fraction could have an absolute value greater than one.

https://docs.oracle.com/en/java/javase/22/docs/api/java.base/java/math/RoundingMode.html

Enumerator
DXFG_ROUNDING_MODE_UP 

Rounding mode to round away from zero. Always increments the digit prior to a non-zero discarded fraction. Note that this rounding mode never decreases the magnitude of the calculated value.

Example:

Rounding mode UP Examples
Input NumberInput rounded to one digit
with DXFG_ROUNDING_MODE_UP rounding
5.56
2.53
1.62
1.12
1.01
-1.0-1
-1.1-2
-1.6-2
-2.5-3
-5.5-6
DXFG_ROUNDING_MODE_DOWN 

Rounding mode to round towards zero. Never increments the digit prior to a discarded fraction (i.e., truncates). Note that this rounding mode never increases the magnitude of the calculated value.

Example:

Rounding mode DOWN Examples
Input NumberInput rounded to one digit
with DXFG_ROUNDING_MODE_DOWN rounding
5.55
2.52
1.61
1.11
1.01
-1.0-1
-1.1-1
-1.6-1
-2.5-2
-5.5-5
DXFG_ROUNDING_MODE_CEILING 

Rounding mode to round towards positive infinity. If the result is positive, behaves as for DXFG_ROUNDING_MODE_UP; if negative, behaves as for DXFG_ROUNDING_MODE_DOWN. Note that this rounding mode never decreases the calculated value.

Example:

Rounding mode CEILING Examples
Input NumberInput rounded to one digit
with DXFG_ROUNDING_MODE_CEILING rounding
5.56
2.53
1.62
1.12
1.01
-1.0-1
-1.1-1
-1.6-1
-2.5-2
-5.5-5
DXFG_ROUNDING_MODE_FLOOR 

Rounding mode to round towards negative infinity. If the result is positive, behave as for DXFG_ROUNDING_MODE_DOWN; if negative, behave as for DXFG_ROUNDING_MODE_UP. Note that this rounding mode never increases the calculated value.

Example:

Rounding mode FLOOR Examples
Input NumberInput rounded to one digit
with DXFG_ROUNDING_MODE_FLOOR rounding
5.55
2.52
1.61
1.11
1.01
-1.0-1
-1.1-2
-1.6-2
-2.5-3
-5.5-6
DXFG_ROUNDING_MODE_HALF_UP 

Rounding mode to round towards "nearest neighbor" unless both neighbors are equidistant, in which case round up. Behaves as for DXFG_ROUNDING_MODE_UP if the discarded fraction is <= 0.5; otherwise, behaves as for DXFG_ROUNDING_MODE_DOWN. Note that this is the rounding mode commonly taught at school.

Example:

Rounding mode HALF_UP Examples
Input NumberInput rounded to one digit
with DXFG_ROUNDING_MODE_HALF_UP rounding
5.56
2.53
1.62
1.11
1.01
-1.0-1
-1.1-1
-1.6-2
-2.5-3
-5.5-6
DXFG_ROUNDING_MODE_HALF_DOWN 

Rounding mode to round towards "nearest neighbor" unless both neighbors are equidistant, in which case round down. Behaves as for DXFG_ROUNDING_MODE_UP if the discarded fraction is > 0.5; otherwise, behaves as for DXFG_ROUNDING_MODE_DOWN.

Example:

Rounding mode HALF_DOWN Examples
Input NumberInput rounded to one digit
with DXFG_ROUNDING_MODE_HALF_DOWN rounding
5.55
2.52
1.62
1.11
1.01
-1.0-1
-1.1-1
-1.6-2
-2.5-2
-5.5-5
DXFG_ROUNDING_MODE_HALF_EVEN 

Rounding mode to round towards the "nearest neighbor" unless both neighbors are equidistant, in which case, round towards the even neighbor. Behaves as for DXFG_ROUNDING_MODE_HALF_UP if the digit to the left of the discarded fraction is odd; behaves as for DXFG_ROUNDING_MODE_HALF_DOWN if it's even. Note that this is the rounding mode that statistically minimizes cumulative error when applied repeatedly over a sequence of calculations. It is sometimes known as "Banker's rounding" and is chiefly used in the USA. This rounding mode is analogous to the rounding policy used for float and double arithmetic in Java.

Example:

Rounding mode HALF_EVEN Examples
Input NumberInput rounded to one digit
with DXFG_ROUNDING_MODE_HALF_EVEN rounding
5.56
2.52
1.62
1.11
1.01
-1.0-1
-1.1-1
-1.6-2
-2.5-2
-5.5-6
DXFG_ROUNDING_MODE_UNNECESSARY 

Rounding mode to assert that the requested operation has an exact result, hence no rounding is necessary. If this rounding mode is specified on an operation that yields an inexact result, a Java ArithmeticException is thrown.

Example:

Rounding mode UNNECESSARY Examples
Input NumberInput rounded to one digit
with DXFG_ROUNDING_MODE_UNNECESSARY rounding
5.5throw ArithmeticException
2.5throw ArithmeticException
1.6throw ArithmeticException
1.1throw ArithmeticException
1.01
-1.0-1
-1.1throw ArithmeticException
-1.6throw ArithmeticException
-2.5throw ArithmeticException
-5.5throw ArithmeticException

Function Documentation

◆ dxfg_AuthToken_createBasicToken()

dxfg_auth_token_t * dxfg_AuthToken_createBasicToken ( graal_isolatethread_t * thread,
const char * userPassword )

Creates the "Basic" authorization token (RFC 2617) from the string user:password. The user name and the password can be empty.

Deprecated
Use dxfg_v4_AuthToken_createBasicToken().
Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]userPasswordThe string user:password; a string without a colon or NULL is an error.
Returns
The token (release it with dxfg_JavaObjectHandler_release()), or NULL on error. Use dxfg_get_and_clear_thread_exception_t() to get the exception.

Java: AuthToken.createBasicToken(String).

◆ dxfg_AuthToken_createBasicToken2()

dxfg_auth_token_t * dxfg_AuthToken_createBasicToken2 ( graal_isolatethread_t * thread,
const char * user,
const char * password )

Creates the "Basic" authorization token (RFC 2617) from the user name and the password. They can be empty.

Deprecated
Use dxfg_v4_AuthToken_createBasicTokenWithUserAndPassword().
Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]userThe user name; NULL is an error.
[in]passwordThe password; NULL is an error.
Returns
The token (release it with dxfg_JavaObjectHandler_release()), or NULL on error. Use dxfg_get_and_clear_thread_exception_t() to get the exception.

Java: AuthToken.createBasicToken(String, String).

◆ dxfg_AuthToken_createBasicTokenOrNull()

dxfg_auth_token_t * dxfg_AuthToken_createBasicTokenOrNull ( graal_isolatethread_t * thread,
const char * user,
const char * password )

Creates the "Basic" authorization token (RFC 2617) from the user name and the password, or returns NULL if both of them are NULL or empty (it is not an error). A NULL user name or password is taken as empty.

Deprecated
Use dxfg_v4_AuthToken_createBasicTokenOrNull().
Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]userThe user name.
[in]passwordThe password.
Returns
The token (release it with dxfg_JavaObjectHandler_release()), or NULL if the user name and the password are both NULL or empty, or on error. Use dxfg_get_and_clear_thread_exception_t() to get the exception.

Java: AuthToken.createBasicTokenOrNull(String, String).

◆ dxfg_AuthToken_createBearerToken()

dxfg_auth_token_t * dxfg_AuthToken_createBearerToken ( graal_isolatethread_t * thread,
const char * token )

Creates the "Bearer" authorization token (RFC 6750) from the access token.

Deprecated
Use dxfg_v4_AuthToken_createBearerToken().
Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]tokenThe access token; NULL or an empty string is an error.
Returns
The token (release it with dxfg_JavaObjectHandler_release()), or NULL on error. Use dxfg_get_and_clear_thread_exception_t() to get the exception.

Java: AuthToken.createBearerToken(String).

◆ dxfg_AuthToken_createBearerTokenOrNull()

dxfg_auth_token_t * dxfg_AuthToken_createBearerTokenOrNull ( graal_isolatethread_t * thread,
const char * token )

Creates the "Bearer" authorization token (RFC 6750) from the access token, or returns NULL if the access token is NULL or empty (it is not an error).

Deprecated
Use dxfg_v4_AuthToken_createBearerTokenOrNull().
Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]tokenThe access token.
Returns
The token (release it with dxfg_JavaObjectHandler_release()), or NULL if the access token is NULL or empty, or on error. Use dxfg_get_and_clear_thread_exception_t() to get the exception.

Java: AuthToken.createBearerTokenOrNull(String).

◆ dxfg_AuthToken_createCustomToken()

dxfg_auth_token_t * dxfg_AuthToken_createCustomToken ( graal_isolatethread_t * thread,
const char * scheme,
const char * value )

Creates the authorization token with a custom scheme and value.

Deprecated
Use dxfg_v4_AuthToken_createCustomToken().
Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]schemeThe scheme; NULL or an empty string is an error.
[in]valueThe value; NULL or an empty string is an error.
Returns
The token (release it with dxfg_JavaObjectHandler_release()), or NULL on error. Use dxfg_get_and_clear_thread_exception_t() to get the exception.

Java: AuthToken.createCustomToken(String, String).

◆ dxfg_AuthToken_getHttpAuthorization()

const char * dxfg_AuthToken_getHttpAuthorization ( graal_isolatethread_t * thread,
dxfg_auth_token_t * authToken )

Returns the value of the HTTP authorization header: the scheme and the value separated by a space.

Deprecated
Use dxfg_v4_AuthToken_getHttpAuthorization().
Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]authTokenThe token.
Returns
The string (release it with dxfg_String_release()), or NULL on error. Use dxfg_get_and_clear_thread_exception_t() to get the exception.

Java: AuthToken.getHttpAuthorization().

◆ dxfg_AuthToken_getPassword()

const char * dxfg_AuthToken_getPassword ( graal_isolatethread_t * thread,
dxfg_auth_token_t * authToken )

Returns the password of the token.

Deprecated
Use dxfg_v4_AuthToken_getPassword().
Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]authTokenThe token.
Returns
The password (release it with dxfg_String_release()), or NULL if the token has no password (it is not a "Basic" token), or on error. Use dxfg_get_and_clear_thread_exception_t() to get the exception.

Java: AuthToken.getPassword().

◆ dxfg_AuthToken_getScheme()

const char * dxfg_AuthToken_getScheme ( graal_isolatethread_t * thread,
dxfg_auth_token_t * authToken )

Returns the authorization scheme of the token, e.g. "Basic" or "Bearer".

Deprecated
Use dxfg_v4_AuthToken_getScheme().
Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]authTokenThe token.
Returns
The scheme (release it with dxfg_String_release()), or NULL on error. Use dxfg_get_and_clear_thread_exception_t() to get the exception.

Java: AuthToken.getScheme().

◆ dxfg_AuthToken_getUser()

const char * dxfg_AuthToken_getUser ( graal_isolatethread_t * thread,
dxfg_auth_token_t * authToken )

Returns the user name of the token.

Deprecated
Use dxfg_v4_AuthToken_getUser().
Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]authTokenThe token.
Returns
The user name (release it with dxfg_String_release()), or NULL if the token has no user name (it is not a "Basic" token), or on error. Use dxfg_get_and_clear_thread_exception_t() to get the exception.

Java: AuthToken.getUser().

◆ dxfg_AuthToken_getValue()

const char * dxfg_AuthToken_getValue ( graal_isolatethread_t * thread,
dxfg_auth_token_t * authToken )

Returns the value of the token: the access token of the "Bearer" scheme (RFC 6750) or the Base64-encoded user:password of the "Basic" scheme (RFC 2617).

Deprecated
Use dxfg_v4_AuthToken_getValue().
Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]authTokenThe token.
Returns
The value (release it with dxfg_String_release()), or NULL on error. Use dxfg_get_and_clear_thread_exception_t() to get the exception.

Java: AuthToken.getValue().

◆ dxfg_AuthToken_valueOf()

dxfg_auth_token_t * dxfg_AuthToken_valueOf ( graal_isolatethread_t * thread,
const char * string )

Creates the authorization token from the string of the scheme and the value separated by a space, e.g. Bearer <token> or Basic <Base64 of user:password>. The value of the "Basic" scheme must be the Base64-encoded user:password.

Deprecated
Use dxfg_v4_AuthToken_valueOf().
Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]stringThe string; NULL is an error.
Returns
The token (release it with dxfg_JavaObjectHandler_release()), or NULL on error (e.g. the string is malformed). Use dxfg_get_and_clear_thread_exception_t() to get the exception.

Java: AuthToken.valueOf(String).

◆ dxfg_ByteArrayInputStream_new()

dxfg_input_stream_t * dxfg_ByteArrayInputStream_new ( graal_isolatethread_t * thread,
const char * bytes,
int32_t size )

Creates an input stream that reads the bytes of the memory block. The bytes are copied: the caller keeps the memory block and may free it after the function returns.

Deprecated
Use dxfg_v4_ByteArrayInputStream_new().
Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]bytesThe bytes of the stream; must point to at least size bytes.
[in]sizeThe number of bytes; must not be negative.
Returns
The input stream (release it with dxfg_JavaObjectHandler_release()), or NULL on error. Use dxfg_get_and_clear_thread_exception_t() to get the exception.

Java: ByteArrayInputStream(byte[]).

◆ dxfg_CList_JavaObjectHandler_release()

int32_t dxfg_CList_JavaObjectHandler_release ( graal_isolatethread_t * thread,
dxfg_java_object_handler_list * list )

Releases a list of handles that a function returned: releases every handle of the list, frees the array of the elements and the list itself.

Deprecated
Use dxfg_v4_java_object_handler_list_release().
Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]listThe list to release. If it is NULL, nothing is done.
Returns
DXFG_EXECUTE_SUCCESSFULLY (0) on successful function execution or DXFG_EXECUTE_FAIL (-1) on error. Use dxfg_get_and_clear_thread_exception_t() to determine if an exception was thrown.

◆ dxfg_CList_String_release()

int32_t dxfg_CList_String_release ( graal_isolatethread_t * thread,
dxfg_string_list * stringList )

Releases a list of strings that a function returned: frees every string of the list, the array of the strings and the list itself.

Deprecated
Use dxfg_v4_string_list_release().
Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]stringListThe list to release. If it is NULL, nothing is done.
Returns
DXFG_EXECUTE_SUCCESSFULLY (0) on successful function execution or DXFG_EXECUTE_FAIL (-1) on error. Use dxfg_get_and_clear_thread_exception_t() to determine if an exception was thrown.

◆ dxfg_Comparable_compareTo()

int32_t dxfg_Comparable_compareTo ( graal_isolatethread_t * thread,
dxfg_java_object_handler * object,
dxfg_java_object_handler * other )

Compares the Java objects by their natural order. The objects must implement the Java Comparable interface and be comparable to each other, otherwise the function fails. The handles of the same object are equal; a NULL handle is less than a non-NULL handle.

Deprecated
Use dxfg_v4_Comparable_compareTo().
Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]objectThe handle of the first object.
[in]otherThe handle of the second object.
Returns
A negative value if the first object is less than the second one, 0 if they are equal, a positive value if it is greater, or INT32_MIN (-2147483648) on error. Use dxfg_get_and_clear_thread_exception_t() to determine if an exception was thrown.

Java: Comparable.compareTo(Object).

◆ dxfg_ExecutorBaseOnConcurrentLinkedQueue_new()

dxfg_executor_t * dxfg_ExecutorBaseOnConcurrentLinkedQueue_new ( graal_isolatethread_t * thread)

Creates an executor that does not run the tasks by itself: a submitted task is added to a queue and runs when dxfg_ExecutorBaseOnConcurrentLinkedQueue_processAllPendingTasks() is called, on the thread that calls it. Use it to have the calls of the listeners made on a thread of your own.

Deprecated
Use dxfg_v4_ExecutorBaseOnConcurrentLinkedQueue_new().
Parameters
[in]threadThe current GraalVM Isolate's thread.
Returns
The executor (release it with dxfg_JavaObjectHandler_release()), or NULL on error. Use dxfg_get_and_clear_thread_exception_t() to get the exception.

◆ dxfg_ExecutorBaseOnConcurrentLinkedQueue_processAllPendingTasks()

int32_t dxfg_ExecutorBaseOnConcurrentLinkedQueue_processAllPendingTasks ( graal_isolatethread_t * thread,
dxfg_executor_t * executor )

Runs the tasks that are in the queue of the executor, on the calling thread, until the queue is empty (the tasks added by the running tasks are run as well). If a task throws an exception, the function fails and the rest of the tasks stay in the queue.

Deprecated
Use dxfg_v4_ExecutorBaseOnConcurrentLinkedQueue_processAllPendingTasks().
Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]executorThe executor created by dxfg_ExecutorBaseOnConcurrentLinkedQueue_new(); any other executor makes the function fail.
Returns
DXFG_EXECUTE_SUCCESSFULLY (0) on successful function execution or DXFG_EXECUTE_FAIL (-1) on error. Use dxfg_get_and_clear_thread_exception_t() to determine if an exception was thrown.

◆ dxfg_Executors_newFixedThreadPool()

dxfg_executor_t * dxfg_Executors_newFixedThreadPool ( graal_isolatethread_t * thread,
int nThreads,
const char * nameThreads )

Creates an executor with a fixed number of threads that runs the submitted tasks. The threads are daemon threads. The SDK has no function that shuts the executor down.

Read the "Threads and locks" section of https://docs.dxfeed.com/dxfeed/api/com/dxfeed/api/DXFeedSubscription.html for how the executor is used by the listeners.

Deprecated
Use dxfg_v4_Executors_newFixedThreadPool().
Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]nThreadsThe number of threads of the pool; must be positive.
[in]nameThreadsThe prefix of the names of the threads: they are named <nameThreads>-1, <nameThreads>-2, and so on.
Returns
The executor (release it with dxfg_JavaObjectHandler_release()), or NULL on error. Use dxfg_get_and_clear_thread_exception_t() to get the exception.

Java: Executors.newFixedThreadPool(int, ThreadFactory).

◆ dxfg_Executors_newScheduledThreadPool()

dxfg_executor_t * dxfg_Executors_newScheduledThreadPool ( graal_isolatethread_t * thread,
int nThreads,
const char * nameThreads )

Creates an executor that runs the submitted tasks, also with a delay or periodically. The threads are daemon threads. The SDK has no function that shuts the executor down.

See dxfg_Executors_newFixedThreadPool() for how the listeners use the executor.

Deprecated
Use dxfg_v4_Executors_newScheduledThreadPool().
Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]nThreadsThe number of threads to keep in the pool, even if they are idle; must not be negative.
[in]nameThreadsThe prefix of the names of the threads: they are named <nameThreads>-1, <nameThreads>-2, and so on.
Returns
The executor (release it with dxfg_JavaObjectHandler_release()), or NULL on error. Use dxfg_get_and_clear_thread_exception_t() to get the exception.

Java: Executors.newScheduledThreadPool(int, ThreadFactory).

◆ dxfg_gc()

int32_t dxfg_gc ( graal_isolatethread_t * thread)

Requests a garbage collection. It is only for testing, e.g. of the functions registered by dxfg_Object_finalize().

Deprecated
Use dxfg_v4_gc().
Parameters
[in]threadThe current GraalVM Isolate's thread.
Returns
DXFG_EXECUTE_SUCCESSFULLY (0) on successful function execution or DXFG_EXECUTE_FAIL (-1) on error. Use dxfg_get_and_clear_thread_exception_t() to determine if an exception was thrown.

Java: System.gc().

◆ dxfg_JavaObjectHandler_array_release()

int32_t dxfg_JavaObjectHandler_array_release ( graal_isolatethread_t * thread,
const dxfg_java_object_handler ** handlersArray,
int32_t size )

Releases an array of handles (or simple structures containing only a handle) that a function returned as one block of consecutive structures: releases every handle of the array and frees the memory of the array.

Sample:

// dxfg_cfi_value_t *values = {};
// int32_t size = {};
dxfg_JavaObjectHandler_array_release(isolate_thread, (const dxfg_java_object_handler **)values, size);
int32_t dxfg_JavaObjectHandler_array_release(graal_isolatethread_t *thread, const dxfg_java_object_handler **handlersArray, int32_t size)
The handle of a Java object: the reference by which the C code refers to an object that lives in Java...
Definition dxfg_javac.h:60
Deprecated
Use dxfg_v4_JavaObjectHandler_array_release().
Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]handlersArrayThe array of handles. If it is NULL or size is 0, nothing is done.
[in]sizeThe number of handles in the array.
Returns
DXFG_EXECUTE_SUCCESSFULLY (0) on successful function execution or DXFG_EXECUTE_FAIL (-1) on error. Use dxfg_get_and_clear_thread_exception_t() to determine if an exception was thrown.

◆ dxfg_JavaObjectHandler_clone()

int32_t dxfg_JavaObjectHandler_clone ( graal_isolatethread_t * thread,
dxfg_java_object_handler * javaObjectHandler,
dxfg_java_object_handler ** javaObjectHandlerClone )

Creates another handle of the Java object: allocates the memory of the new handle structure. Both handles refer to the same object and are released independently: the object stays alive until all of its handles are released.

Sample:

dxfg_cfi_value_t *values = {};
int32_t size = 0;
dxfg_cfi_value_t *clone_of_options_cfi_value = {};
// ...
dxfg_CFI_decipher(isolate_thread, cfi, &values, &size);
for (int32_t i = 0; i < size; i++) {
// ...
dxfg_cfi_value_t *cfi_value = (dxfg_cfi_value_t *)(&values[i].handler);
// ...
isolate_thread,
(dxfg_java_object_handler **)(&clone_of_options_cfi_value));
}
int32_t dxfg_CFI_decipher(graal_isolatethread_t *thread, dxfg_cfi_t *cfi, DXFG_OUT dxfg_cfi_value_t **values, DXFG_OUT int32_t *size)
int32_t dxfg_JavaObjectHandler_clone(graal_isolatethread_t *thread, dxfg_java_object_handler *javaObjectHandler, dxfg_java_object_handler **javaObjectHandlerClone)
Definition dxfg_glossary.h:109
Deprecated
Use dxfg_v4_JavaObjectHandler_clone().
Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]javaObjectHandlerThe handle to clone; it stays valid.
[out]javaObjectHandlerCloneThe pointer to which the pointer to the new handle is written; must not be NULL.
Returns
DXFG_EXECUTE_SUCCESSFULLY (0) on successful function execution or DXFG_EXECUTE_FAIL (-1) on error. Use dxfg_get_and_clear_thread_exception_t() to determine if an exception was thrown. Use dxfg_JavaObjectHandler_release() to free the object clone handle.

◆ dxfg_JavaObjectHandler_release()

int32_t dxfg_JavaObjectHandler_release ( graal_isolatethread_t * thread,
dxfg_java_object_handler * handler )

Frees the memory of the handle structure and releases the reference to the Java object. Do not use the handle after that. Passing NULL does nothing.

If the handle is the last handle (see dxfg_JavaObjectHandler_clone()) of a listener created by a dxfg_*Listener_new function, the listener is deactivated (see dxfg_NativeListener_deactivate()): the function waits for the listener's callbacks that are in progress on other threads and after it returns the listener's function is not called anymore, so its user data can be freed. Remove the listener (e.g. dxfg_DXFeedSubscription_removeEventListener()) before releasing it, otherwise it stays added and does nothing.

Do not hold the locks that the listener's function may take while releasing the listener: it may deadlock. Releasing a listener from its own callback is allowed (the function does not wait for that call).

Deprecated
Use dxfg_v4_JavaObjectHandler_release().
Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]handlerThe handle to release (e.g. &executor->handler for a dxfg_executor_t).
Returns
DXFG_EXECUTE_SUCCESSFULLY (0) on successful function execution or DXFG_EXECUTE_FAIL (-1) on error. Use dxfg_get_and_clear_thread_exception_t() to determine if an exception was thrown.

◆ dxfg_NativeListener_deactivate()

int32_t dxfg_NativeListener_deactivate ( graal_isolatethread_t * thread,
dxfg_java_object_handler * listener )

Deactivates a listener created by a dxfg_*Listener_new function (e.g. dxfg_DXFeedEventListener_new(), dxfg_PropertyChangeListener_new()) regardless of the number of its handles: waits for the listener's callbacks that are in progress on other threads, after that the listener's function is not called anymore, so its user data can be freed. The listener stays added where it was added, but does nothing, and cannot be activated again.

Releasing the last handle of the listener with dxfg_JavaObjectHandler_release() deactivates it as well. Do not hold the locks that the listener's function may take while deactivating the listener: it may deadlock. Deactivating a listener from its own callback is allowed (the function does not wait for that call).

Deprecated
Use dxfg_v4_NativeListener_deactivate().
Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]listenerThe listener handle.
Returns
DXFG_EXECUTE_SUCCESSFULLY (0) on successful function execution or DXFG_EXECUTE_FAIL (-1) on error (e.g. the object is not a listener created by a dxfg_*Listener_new function). Use dxfg_get_and_clear_thread_exception_t() to determine if an exception was thrown.

◆ dxfg_Object_equals()

int32_t dxfg_Object_equals ( graal_isolatethread_t * thread,
dxfg_java_object_handler * object,
dxfg_java_object_handler * other )

Checks whether the Java objects are equal: the handles of the same object, and the handles of the objects that are equal in the sense of the Java equals method of the first object. Two NULL handles are equal, a NULL handle and a non-NULL handle are not.

Deprecated
Use dxfg_v4_Object_equals().
Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]objectThe handle of the first object.
[in]otherThe handle of the second object.
Returns
1 if the objects are equal, 0 if they are not, or INT32_MIN (-2147483648) on error. Use dxfg_get_and_clear_thread_exception_t() to determine if an exception was thrown.

Java: Objects.equals(Object, Object).

◆ dxfg_Object_finalize()

int32_t dxfg_Object_finalize ( graal_isolatethread_t * thread,
dxfg_java_object_handler * handler,
dxfg_finalize_function finalize,
void * user_data )

Registers a function that is called with the user data after the Java object is garbage collected.

The Java object is not collected while a handle of it exists, so the function is called after all the handles of the object have been released and nothing else in Java refers to the object. The collected objects are checked about once a second. The function is called by a daemon Java thread of the SDK (see dxfg_finalize_function), once for each registration.

It does not stop the callbacks of a listener: see dxfg_NativeListener_deactivate() for that.

Deprecated
Use dxfg_v4_Object_finalize().
Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]handlerThe handle of the object to watch.
[in]finalizeThe function to call.
[in]user_dataThe user data to pass to the function; the SDK does not free it.
Returns
DXFG_EXECUTE_SUCCESSFULLY (0) on successful function execution or DXFG_EXECUTE_FAIL (-1) on error. Use dxfg_get_and_clear_thread_exception_t() to determine if an exception was thrown.

◆ dxfg_Object_hashCode()

int32_t dxfg_Object_hashCode ( graal_isolatethread_t * thread,
dxfg_java_object_handler * object )

Returns the hash code of the Java object: the result of its Java hashCode method, or 0 for a NULL handle.

Deprecated
Use dxfg_v4_Object_hashCode().
Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]objectThe handle of the object.
Returns
The hash code, or INT32_MIN (-2147483648) on error. INT32_MIN can also be a hash code: use dxfg_get_and_clear_thread_exception_t() to determine if an exception was thrown.

Java: Objects.hashCode(Object).

◆ dxfg_Object_new()

int32_t dxfg_Object_new ( graal_isolatethread_t * thread,
DXFG_OUT dxfg_java_object_handler ** object )

Creates a new Java Object.

Deprecated
Use dxfg_v4_Object_new().
Parameters
[in]threadThe current GraalVM Isolate's thread.
[out]objectThe pointer to which the pointer to the handle of the new object is written; must not be NULL.
Returns
DXFG_EXECUTE_SUCCESSFULLY (0) on successful function execution or DXFG_EXECUTE_FAIL (-1) on error. Use dxfg_get_and_clear_thread_exception_t() to determine if an exception was thrown. Use dxfg_JavaObjectHandler_release() to free the object handle.

Java: Object().

◆ dxfg_Object_toString()

const char * dxfg_Object_toString ( graal_isolatethread_t * thread,
dxfg_java_object_handler * object )

Returns the string representation of the Java object. It works for the handle of any Java object, including the typed handles (e.g. dxfg_time_zone_t, dxfg_auth_token_t).

Deprecated
Use dxfg_v4_Object_toString().
Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]objectThe handle of the object. A NULL handle is an error.
Returns
The UTF-8 string, NUL-terminated (release it with dxfg_String_release()), or NULL on error. Use dxfg_get_and_clear_thread_exception_t() to get the exception.

Java: Object.toString().

◆ dxfg_String_release()

int32_t dxfg_String_release ( graal_isolatethread_t * thread,
const char * string )

Frees a string that a function returned (e.g. dxfg_Object_toString()). Do not pass a string that is a field of a structure, such as a string of an event: it is freed with the structure.

Deprecated
Use dxfg_v4_String_release().
Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]stringThe string to free. If it is NULL, nothing is done.
Returns
DXFG_EXECUTE_SUCCESSFULLY (0) on successful function execution or DXFG_EXECUTE_FAIL (-1) on error. Use dxfg_get_and_clear_thread_exception_t() to determine if an exception was thrown.

◆ dxfg_throw_exception()

dxfg_java_object_handler * dxfg_throw_exception ( graal_isolatethread_t * thread)

Always fails: throws a Java exception (a RuntimeException "recursion" with a cause "cause", thrown several calls deep, so that its stack trace has several frames). It is only for testing of dxfg_get_and_clear_thread_exception_t().

Deprecated
Use dxfg_v4_throw_exception().
Parameters
[in]threadThe current GraalVM Isolate's thread.
Returns
Always NULL. Use dxfg_get_and_clear_thread_exception_t() to get the exception.

◆ dxfg_TimeFormat_asFullIso()

dxfg_time_format_t * dxfg_TimeFormat_asFullIso ( graal_isolatethread_t * thread,
dxfg_time_format_t * timeFormat )

Returns the time format that produces the full ISO8601 string of yyyy-MM-dd'T'HH:mm:ss.SSSX.

Deprecated
Use dxfg_v4_TimeFormat_asFullIso().
Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]timeFormatThe time format.
Returns
The time format (release it with dxfg_JavaObjectHandler_release()), or NULL on error. Use dxfg_get_and_clear_thread_exception_t() to get the exception.

Java: TimeFormat.asFullIso().

◆ dxfg_TimeFormat_DEFAULT()

dxfg_time_format_t * dxfg_TimeFormat_DEFAULT ( graal_isolatethread_t * thread)

Returns the time format of the default time zone of the Java virtual machine.

Deprecated
Use dxfg_v4_TimeFormat_DEFAULT().
Parameters
[in]threadThe current GraalVM Isolate's thread.
Returns
The time format (release it with dxfg_JavaObjectHandler_release()), or NULL on error. Use dxfg_get_and_clear_thread_exception_t() to get the exception.

Java: TimeFormat.DEFAULT.

◆ dxfg_TimeFormat_format()

const char * dxfg_TimeFormat_format ( graal_isolatethread_t * thread,
dxfg_time_format_t * timeFormat,
int64_t value )

Converts the time to a string like yyyyMMdd-HHmmss in the time zone of the time format. The time zone (RFC 822, e.g. +0300) and the milliseconds (.sss) are included if the format was obtained with dxfg_TimeFormat_withTimeZone() and dxfg_TimeFormat_withMillis(). The time 0 is formatted as "0". If the year of the time is outside of 0001 to 9999, the result is the decimal number of the milliseconds.

Deprecated
Use dxfg_v4_TimeFormat_format().
Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]timeFormatThe time format.
[in]valueThe time: the number of milliseconds since 1970-01-01T00:00:00Z.
Returns
The string (release it with dxfg_String_release()), or NULL on error. Use dxfg_get_and_clear_thread_exception_t() to get the exception.

Java: TimeFormat.format(long).

◆ dxfg_TimeFormat_getInstance()

dxfg_time_format_t * dxfg_TimeFormat_getInstance ( graal_isolatethread_t * thread,
dxfg_time_zone_t * timeZone )

Returns the time format of the time zone. The format keeps a copy of the time zone: later changes of the time zone do not affect it.

Deprecated
Use dxfg_v4_TimeFormat_getInstance().
Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]timeZoneThe time zone; NULL is an error.
Returns
The time format (release it with dxfg_JavaObjectHandler_release()), or NULL on error. Use dxfg_get_and_clear_thread_exception_t() to get the exception.

Java: TimeFormat.getInstance(TimeZone).

◆ dxfg_TimeFormat_getTimeZone()

dxfg_time_zone_t * dxfg_TimeFormat_getTimeZone ( graal_isolatethread_t * thread,
dxfg_time_format_t * timeFormat )

Returns the time zone of the time format.

Deprecated
Use dxfg_v4_TimeFormat_getTimeZone().
Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]timeFormatThe time format.
Returns
A copy of the time zone (release it with dxfg_JavaObjectHandler_release()), or NULL on error. Use dxfg_get_and_clear_thread_exception_t() to get the exception.

Java: TimeFormat.getTimeZone().

◆ dxfg_TimeFormat_GMT()

dxfg_time_format_t * dxfg_TimeFormat_GMT ( graal_isolatethread_t * thread)

Returns the time format of the GMT time zone.

Deprecated
Use dxfg_v4_TimeFormat_GMT().
Parameters
[in]threadThe current GraalVM Isolate's thread.
Returns
The time format (release it with dxfg_JavaObjectHandler_release()), or NULL on error. Use dxfg_get_and_clear_thread_exception_t() to get the exception.

Java: TimeFormat.GMT.

◆ dxfg_TimeFormat_parse()

int64_t dxfg_TimeFormat_parse ( graal_isolatethread_t * thread,
dxfg_time_format_t * timeFormat,
const char * value )

Parses the date and the time from the string in an ISO 8601 format. The string can be:

  • 0: the zero time;
  • -<time period>: the current time minus the time period (see dxfg_TimePeriod_valueOf2());
  • a number of milliseconds since 1970-01-01T00:00:00Z: at least 9 digits;
  • <date>[(T|t|-| )<time>][<time zone>] or [T|t]<time>[<time zone>]: the date is yyyy-MM-dd or yyyyMMdd, the time is HH:mm:ss[.sss], HHmmss[.sss], HH:mm, HHmm or HH (a missing time is 00:00:00, a missing date is the current date), the time zone is [+-]HH:mm, [+-]HHmm, [+-]HH, Z or a name of a time zone. A string without a time zone is in the time zone of the time format.
Deprecated
Use dxfg_v4_TimeFormat_parse().
Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]timeFormatThe time format.
[in]valueThe string to parse; NULL is an error.
Returns
The number of milliseconds since 1970-01-01T00:00:00Z, or -1 on error. -1 is also the time of 1969-12-31T23:59:59.999Z: use dxfg_get_and_clear_thread_exception_t() to determine if an exception was thrown.

Java: TimeFormat.parse(String).

◆ dxfg_TimeFormat_withMillis()

dxfg_time_format_t * dxfg_TimeFormat_withMillis ( graal_isolatethread_t * thread,
dxfg_time_format_t * timeFormat )

Returns the time format that also includes the milliseconds into the string of dxfg_TimeFormat_format().

Deprecated
Use dxfg_v4_TimeFormat_withMillis().
Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]timeFormatThe time format.
Returns
The time format (release it with dxfg_JavaObjectHandler_release()), or NULL on error. Use dxfg_get_and_clear_thread_exception_t() to get the exception.

Java: TimeFormat.withMillis().

◆ dxfg_TimeFormat_withTimeZone()

dxfg_time_format_t * dxfg_TimeFormat_withTimeZone ( graal_isolatethread_t * thread,
dxfg_time_format_t * timeFormat )

Returns the time format that also includes the time zone into the string of dxfg_TimeFormat_format().

Deprecated
Use dxfg_v4_TimeFormat_withTimeZone().
Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]timeFormatThe time format.
Returns
The time format (release it with dxfg_JavaObjectHandler_release()), or NULL on error. Use dxfg_get_and_clear_thread_exception_t() to get the exception.

Java: TimeFormat.withTimeZone().

◆ dxfg_TimePeriod_getNanos()

int64_t dxfg_TimePeriod_getNanos ( graal_isolatethread_t * thread,
dxfg_time_period_t * timePeriod )

Returns the time period in nanoseconds. A period longer than about 292 years, e.g. dxfg_TimePeriod_UNLIMITED(), overflows int64_t and gives a wrong value, which may be negative (-1000000 for the unlimited period); use dxfg_TimePeriod_getTime() for such periods.

Deprecated
Use dxfg_v4_TimePeriod_getNanos().
Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]timePeriodThe time period.
Returns
The time period in nanoseconds, or -1 on error. Use dxfg_get_and_clear_thread_exception_t() to determine if an exception was thrown.

Java: TimePeriod.getNanos().

◆ dxfg_TimePeriod_getSeconds()

int32_t dxfg_TimePeriod_getSeconds ( graal_isolatethread_t * thread,
dxfg_time_period_t * timePeriod )

Returns the time period in whole seconds (rounded down). A period longer than about 68 years, e.g. dxfg_TimePeriod_UNLIMITED(), does not fit into int32_t: the result is truncated to its lower 32 bits.

Deprecated
Use dxfg_v4_TimePeriod_getSeconds().
Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]timePeriodThe time period.
Returns
The time period in seconds, or INT32_MIN (-2147483648) on error. Use dxfg_get_and_clear_thread_exception_t() to determine if an exception was thrown.

Java: TimePeriod.getSeconds().

◆ dxfg_TimePeriod_getTime()

int64_t dxfg_TimePeriod_getTime ( graal_isolatethread_t * thread,
dxfg_time_period_t * timePeriod )

Returns the time period in milliseconds.

Deprecated
Use dxfg_v4_TimePeriod_getTime().
Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]timePeriodThe time period.
Returns
The time period in milliseconds, or -1 on error (a time period is never negative). Use dxfg_get_and_clear_thread_exception_t() to determine if an exception was thrown.

Java: TimePeriod.getTime().

◆ dxfg_TimePeriod_UNLIMITED()

dxfg_time_period_t * dxfg_TimePeriod_UNLIMITED ( graal_isolatethread_t * thread)

Returns the time period of "infinity": its time is the maximum value of int64_t milliseconds.

Deprecated
Use dxfg_v4_TimePeriod_UNLIMITED().
Parameters
[in]threadThe current GraalVM Isolate's thread.
Returns
The time period (release it with dxfg_JavaObjectHandler_release()), or NULL on error. Use dxfg_get_and_clear_thread_exception_t() to get the exception.

Java: TimePeriod.UNLIMITED.

◆ dxfg_TimePeriod_valueOf()

dxfg_time_period_t * dxfg_TimePeriod_valueOf ( graal_isolatethread_t * thread,
int64_t value )

Returns the time period of the given number of milliseconds.

Deprecated
Use dxfg_v4_TimePeriod_valueOf().
Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]valueThe value in milliseconds; a negative value is an error.
Returns
The time period (release it with dxfg_JavaObjectHandler_release()), or NULL on error. Use dxfg_get_and_clear_thread_exception_t() to get the exception.

Java: TimePeriod.valueOf(long).

◆ dxfg_TimePeriod_valueOf2()

dxfg_time_period_t * dxfg_TimePeriod_valueOf2 ( graal_isolatethread_t * thread,
const char * value )

Returns the time period that the string represents. The string is an ISO8601 duration with these simplifications: the letters are case insensitive; the letters "P" and "T" can be omitted; the letter "S" can be omitted, then the last number is the seconds; the seconds can be fractional (milliseconds precision); an omitted part is zero; the string "inf" is the unlimited period.

Deprecated
Use dxfg_v4_TimePeriod_valueOfString().
Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]valueThe string, e.g. "PT1H30M", "1d" or "0.5".
Returns
The time period (release it with dxfg_JavaObjectHandler_release()), or NULL on error (e.g. the string cannot be parsed). Use dxfg_get_and_clear_thread_exception_t() to get the exception.

Java: TimePeriod.valueOf(String).

◆ dxfg_TimePeriod_ZERO()

dxfg_time_period_t * dxfg_TimePeriod_ZERO ( graal_isolatethread_t * thread)

Returns the time period of zero.

Deprecated
Use dxfg_v4_TimePeriod_ZERO().
Parameters
[in]threadThe current GraalVM Isolate's thread.
Returns
The time period (release it with dxfg_JavaObjectHandler_release()), or NULL on error. Use dxfg_get_and_clear_thread_exception_t() to get the exception.

Java: TimePeriod.ZERO.

◆ dxfg_TimeZone_getDefault()

dxfg_time_zone_t * dxfg_TimeZone_getDefault ( graal_isolatethread_t * thread)

Returns the default time zone of the Java virtual machine.

Deprecated
Use dxfg_v4_TimeZone_getDefault().
Parameters
[in]threadThe current GraalVM Isolate's thread.
Returns
The time zone (release it with dxfg_JavaObjectHandler_release()), or NULL on error. Use dxfg_get_and_clear_thread_exception_t() to get the exception.

Java: TimeZone.getDefault().

◆ dxfg_TimeZone_getDisplayName()

const char * dxfg_TimeZone_getDisplayName ( graal_isolatethread_t * thread,
dxfg_time_zone_t * timeZone )

Returns the long name of the time zone (for the standard time) in the default locale of the Java virtual machine.

Deprecated
Use dxfg_v4_TimeZone_getDisplayName().
Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]timeZoneThe time zone.
Returns
The name (release it with dxfg_String_release()), or NULL on error. Use dxfg_get_and_clear_thread_exception_t() to get the exception.

Java: TimeZone.getDisplayName().

◆ dxfg_TimeZone_getDisplayName2()

const char * dxfg_TimeZone_getDisplayName2 ( graal_isolatethread_t * thread,
dxfg_time_zone_t * timeZone,
int32_t daylight,
int32_t style )

Returns the name of the time zone in the default locale of the Java virtual machine, for the standard or the daylight saving time, in the long or the short style.

Deprecated
Use dxfg_v4_TimeZone_getDisplayNameWithStyle().
Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]timeZoneThe time zone.
[in]daylight1 for the name of the daylight saving time, any other value for the name of the standard time.
[in]style0 for the short name (TimeZone.SHORT), 1 for the long name (TimeZone.LONG); any other value is an error.
Returns
The name (release it with dxfg_String_release()), or NULL on error. Use dxfg_get_and_clear_thread_exception_t() to get the exception.

Java: TimeZone.getDisplayName(boolean, int).

◆ dxfg_TimeZone_getDSTSavings()

int32_t dxfg_TimeZone_getDSTSavings ( graal_isolatethread_t * thread,
dxfg_time_zone_t * timeZone )

Returns the amount of time to be added to the local standard time to get the local wall clock time, in milliseconds. It is 0 if the time zone does not observe the daylight saving time.

Deprecated
Use dxfg_v4_TimeZone_getDSTSavings().
Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]timeZoneThe time zone.
Returns
The savings in milliseconds, or INT32_MIN (-2147483648) on error. Use dxfg_get_and_clear_thread_exception_t() to determine if an exception was thrown.

Java: TimeZone.getDSTSavings().

◆ dxfg_TimeZone_getID()

const char * dxfg_TimeZone_getID ( graal_isolatethread_t * thread,
dxfg_time_zone_t * timeZone )

Returns the ID of the time zone.

Deprecated
Use dxfg_v4_TimeZone_getID().
Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]timeZoneThe time zone.
Returns
The ID (release it with dxfg_String_release()), or NULL on error. Use dxfg_get_and_clear_thread_exception_t() to get the exception.

Java: TimeZone.getID().

◆ dxfg_TimeZone_getOffset()

int32_t dxfg_TimeZone_getOffset ( graal_isolatethread_t * thread,
dxfg_time_zone_t * timeZone,
int64_t date )

Returns the offset of the time zone from UTC at the date, in milliseconds. If the daylight saving time is in effect at the date, the offset includes the saving.

Deprecated
Use dxfg_v4_TimeZone_getOffset().
Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]timeZoneThe time zone.
[in]dateThe date: the number of milliseconds since 1970-01-01T00:00:00Z.
Returns
The offset in milliseconds, or INT32_MIN (-2147483648) on error. Use dxfg_get_and_clear_thread_exception_t() to determine if an exception was thrown.

Java: TimeZone.getOffset(long).

◆ dxfg_TimeZone_getOffset2()

int32_t dxfg_TimeZone_getOffset2 ( graal_isolatethread_t * thread,
dxfg_time_zone_t * timeZone,
int32_t era,
int32_t year,
int32_t month,
int32_t day,
int32_t dayOfWeek,
int32_t milliseconds )

Returns the offset of the time zone from UTC at the local date, in milliseconds, adjusted for the daylight saving time.

Deprecated
Use dxfg_v4_TimeZone_getOffsetByCalendarFields().
Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]timeZoneThe time zone.
[in]eraThe era of the date: 1 for AD (GregorianCalendar.AD) or 0 for BC (GregorianCalendar.BC).
[in]yearThe year in the era.
[in]monthThe month of the year, 0-based: 0 for January.
[in]dayThe day of the month.
[in]dayOfWeekThe day of the week: 1 for Sunday (Calendar.SUNDAY) to 7 for Saturday.
[in]millisecondsThe milliseconds in the day, in the standard local time.
Returns
The offset in milliseconds, or INT32_MIN (-2147483648) on error (e.g. a parameter is out of range). Use dxfg_get_and_clear_thread_exception_t() to determine if an exception was thrown.

Java: TimeZone.getOffset(int, int, int, int, int, int).

◆ dxfg_TimeZone_getRawOffset()

int32_t dxfg_TimeZone_getRawOffset ( graal_isolatethread_t * thread,
dxfg_time_zone_t * timeZone )

Returns the offset of the time zone from UTC, in milliseconds, that does not include the daylight saving time.

Deprecated
Use dxfg_v4_TimeZone_getRawOffset().
Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]timeZoneThe time zone.
Returns
The raw offset in milliseconds, or INT32_MIN (-2147483648) on error. Use dxfg_get_and_clear_thread_exception_t() to determine if an exception was thrown.

Java: TimeZone.getRawOffset().

◆ dxfg_TimeZone_getTimeZone()

dxfg_time_zone_t * dxfg_TimeZone_getTimeZone ( graal_isolatethread_t * thread,
const char * ID )

Returns the time zone for the ID. If the ID is not known, the result is the GMT zone.

Deprecated
Use dxfg_v4_TimeZone_getTimeZone().
Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]IDThe ID of the time zone, e.g. "America/New_York" or "GMT+03:00".
Returns
The time zone (release it with dxfg_JavaObjectHandler_release()), or NULL on error. Use dxfg_get_and_clear_thread_exception_t() to get the exception.

Java: TimeZone.getTimeZone(String).

◆ dxfg_TimeZone_hasSameRules()

int32_t dxfg_TimeZone_hasSameRules ( graal_isolatethread_t * thread,
dxfg_time_zone_t * timeZone,
dxfg_time_zone_t * other )

Checks whether the time zone has the same rules and offset as the other time zone (they may differ only in the ID).

Deprecated
Use dxfg_v4_TimeZone_hasSameRules().
Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]timeZoneThe time zone.
[in]otherThe other time zone.
Returns
1 if the rules are the same, 0 if they are not (also if other is NULL), or INT32_MIN (-2147483648) on error. Use dxfg_get_and_clear_thread_exception_t() to determine if an exception was thrown.

Java: TimeZone.hasSameRules(TimeZone).

◆ dxfg_TimeZone_inDaylightTime()

int32_t dxfg_TimeZone_inDaylightTime ( graal_isolatethread_t * thread,
dxfg_time_zone_t * timeZone,
int64_t date )

Checks whether the date is in the daylight saving time of the time zone.

Deprecated
Use dxfg_v4_TimeZone_inDaylightTime().
Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]timeZoneThe time zone.
[in]dateThe date: the number of milliseconds since 1970-01-01T00:00:00Z.
Returns
1 if the date is in the daylight saving time, 0 if it is not, or INT32_MIN (-2147483648) on error. Use dxfg_get_and_clear_thread_exception_t() to determine if an exception was thrown.

Java: TimeZone.inDaylightTime(Date).

◆ dxfg_TimeZone_observesDaylightTime()

int32_t dxfg_TimeZone_observesDaylightTime ( graal_isolatethread_t * thread,
dxfg_time_zone_t * timeZone )

Checks whether the time zone is currently in the daylight saving time, or a transition from the standard time to the daylight saving time occurs at any future time.

Deprecated
Use dxfg_v4_TimeZone_observesDaylightTime().
Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]timeZoneThe time zone.
Returns
1 if the time zone observes the daylight saving time, 0 if it does not, or INT32_MIN (-2147483648) on error. Use dxfg_get_and_clear_thread_exception_t() to determine if an exception was thrown.

Java: TimeZone.observesDaylightTime().

◆ dxfg_TimeZone_setID()

int32_t dxfg_TimeZone_setID ( graal_isolatethread_t * thread,
dxfg_time_zone_t * timeZone,
const char * ID )

Sets the ID of the time zone. It changes the Java object, so all the handles of the time zone see the new ID.

Deprecated
Use dxfg_v4_TimeZone_setID().
Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]timeZoneThe time zone.
[in]IDThe new ID.
Returns
DXFG_EXECUTE_SUCCESSFULLY (0) on successful function execution or INT32_MIN (-2147483648), not DXFG_EXECUTE_FAIL, on error. Use dxfg_get_and_clear_thread_exception_t() to determine if an exception was thrown.

Java: TimeZone.setID(String).

◆ dxfg_TimeZone_setRawOffset()

int32_t dxfg_TimeZone_setRawOffset ( graal_isolatethread_t * thread,
dxfg_time_zone_t * timeZone,
int32_t offsetMillis )

Sets the offset of the time zone from UTC that does not include the daylight saving time. It changes the Java object, so all the handles of the time zone see the new offset.

Deprecated
Use dxfg_v4_TimeZone_setRawOffset().
Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]timeZoneThe time zone.
[in]offsetMillisThe raw offset in milliseconds.
Returns
DXFG_EXECUTE_SUCCESSFULLY (0) on successful function execution or INT32_MIN (-2147483648), not DXFG_EXECUTE_FAIL, on error. Use dxfg_get_and_clear_thread_exception_t() to determine if an exception was thrown.

Java: TimeZone.setRawOffset(int).

◆ dxfg_TimeZone_useDaylightTime()

int32_t dxfg_TimeZone_useDaylightTime ( graal_isolatethread_t * thread,
dxfg_time_zone_t * timeZone )

Checks whether the time zone uses the daylight saving time.

Deprecated
Use dxfg_v4_TimeZone_useDaylightTime().
Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]timeZoneThe time zone.
Returns
1 if the time zone uses the daylight saving time, 0 if it does not, or INT32_MIN (-2147483648) on error. Use dxfg_get_and_clear_thread_exception_t() to determine if an exception was thrown.

Java: TimeZone.useDaylightTime().