dxFeed Graal Native SDK 3.9.0
Loading...
Searching...
No Matches
Endpoint

Topics

 Builder

Data Structures

struct  dxfg_endpoint_t
 The DXEndpoint. Javadoc. More...
struct  dxfg_endpoint_builder_t
 The DXEndpoint.Builder. Javadoc. More...
struct  dxfg_endpoint_state_change_listener_t
 The PropertyChangeListener. Javadoc. More...

Typedefs

typedef struct dxfg_feed_t dxfg_feed_t
 Forward declarations.
typedef struct dxfg_publisher_t dxfg_publisher_t
typedef struct dxfg_event_clazz_list_t dxfg_event_clazz_list_t
typedef struct dxfg_endpoint_t dxfg_endpoint_t
 The DXEndpoint. Javadoc.
typedef struct dxfg_endpoint_builder_t dxfg_endpoint_builder_t
 The DXEndpoint.Builder. Javadoc.
typedef struct dxfg_endpoint_state_change_listener_t dxfg_endpoint_state_change_listener_t
 The PropertyChangeListener. Javadoc.
typedef enum dxfg_endpoint_role_t dxfg_endpoint_role_t
 List of endpoint roles. Javadoc.
typedef enum dxfg_endpoint_state_t dxfg_endpoint_state_t
 List of endpoint states. Javadoc.
typedef void(*) dxfg_endpoint_state_change_listener_func(graal_isolatethread_t *thread, dxfg_endpoint_state_t old_state, dxfg_endpoint_state_t new_state, void *user_data)
 Function pointer to the endpoint state change listener.

Enumerations

enum  dxfg_endpoint_role_t {
  DXFG_ENDPOINT_ROLE_FEED = 0 , DXFG_ENDPOINT_ROLE_ON_DEMAND_FEED , DXFG_ENDPOINT_ROLE_STREAM_FEED , DXFG_ENDPOINT_ROLE_PUBLISHER ,
  DXFG_ENDPOINT_ROLE_STREAM_PUBLISHER , DXFG_ENDPOINT_ROLE_LOCAL_HUB
}
 List of endpoint roles. Javadoc. More...
enum  dxfg_endpoint_state_t { DXFG_ENDPOINT_STATE_NOT_CONNECTED = 0 , DXFG_ENDPOINT_STATE_CONNECTING , DXFG_ENDPOINT_STATE_CONNECTED , DXFG_ENDPOINT_STATE_CLOSED }
 List of endpoint states. Javadoc. More...

Functions

dxfg_endpoint_t * dxfg_DXEndpoint_getInstance (graal_isolatethread_t *thread)
dxfg_endpoint_t * dxfg_DXEndpoint_getInstance2 (graal_isolatethread_t *thread, dxfg_endpoint_role_t role)
dxfg_endpoint_t * dxfg_DXEndpoint_create (graal_isolatethread_t *thread)
dxfg_endpoint_t * dxfg_DXEndpoint_create2 (graal_isolatethread_t *thread, dxfg_endpoint_role_t role)
int32_t dxfg_DXEndpoint_close (graal_isolatethread_t *thread, dxfg_endpoint_t *endpoint)
int32_t dxfg_DXEndpoint_closeAndAwaitTermination (graal_isolatethread_t *thread, dxfg_endpoint_t *endpoint)
dxfg_endpoint_role_t dxfg_DXEndpoint_getRole (graal_isolatethread_t *thread, dxfg_endpoint_t *endpoint)
int32_t dxfg_DXEndpoint_user (graal_isolatethread_t *thread, dxfg_endpoint_t *endpoint, const char *user)
int32_t dxfg_DXEndpoint_password (graal_isolatethread_t *thread, dxfg_endpoint_t *endpoint, const char *password)
int32_t dxfg_DXEndpoint_connect (graal_isolatethread_t *thread, dxfg_endpoint_t *endpoint, const char *address)
int32_t dxfg_DXEndpoint_reconnect (graal_isolatethread_t *thread, dxfg_endpoint_t *endpoint)
int32_t dxfg_DXEndpoint_disconnect (graal_isolatethread_t *thread, dxfg_endpoint_t *endpoint)
int32_t dxfg_DXEndpoint_disconnectAndClear (graal_isolatethread_t *thread, dxfg_endpoint_t *endpoint)
int32_t dxfg_DXEndpoint_awaitProcessed (graal_isolatethread_t *thread, dxfg_endpoint_t *endpoint)
int32_t dxfg_DXEndpoint_awaitNotConnected (graal_isolatethread_t *thread, dxfg_endpoint_t *endpoint)
dxfg_endpoint_state_t dxfg_DXEndpoint_getState (graal_isolatethread_t *thread, dxfg_endpoint_t *endpoint)
int32_t dxfg_DXEndpoint_addStateChangeListener (graal_isolatethread_t *thread, dxfg_endpoint_t *endpoint, dxfg_endpoint_state_change_listener_t *listener)
int32_t dxfg_DXEndpoint_removeStateChangeListener (graal_isolatethread_t *thread, dxfg_endpoint_t *endpoint, dxfg_endpoint_state_change_listener_t *listener)
dxfg_feed_t * dxfg_DXEndpoint_getFeed (graal_isolatethread_t *thread, dxfg_endpoint_t *endpoint)
dxfg_publisher_t * dxfg_DXEndpoint_getPublisher (graal_isolatethread_t *thread, dxfg_endpoint_t *endpoint)
int32_t dxfg_DXEndpoint_executor (graal_isolatethread_t *thread, dxfg_endpoint_t *endpoint, dxfg_executor_t *executor)
dxfg_event_clazz_list_t * dxfg_DXEndpoint_getEventTypes (graal_isolatethread_t *thread, dxfg_endpoint_t *endpoint)
dxfg_endpoint_state_change_listener_t * dxfg_PropertyChangeListener_new (graal_isolatethread_t *thread, dxfg_endpoint_state_change_listener_func user_func, void *user_data)

Detailed Description

Typedef Documentation

◆ dxfg_endpoint_builder_t

typedef struct dxfg_endpoint_builder_t dxfg_endpoint_builder_t

The DXEndpoint.Builder. Javadoc.

◆ dxfg_endpoint_role_t

List of endpoint roles. Javadoc.

◆ dxfg_endpoint_state_change_listener_func

typedef void(*) dxfg_endpoint_state_change_listener_func(graal_isolatethread_t *thread, dxfg_endpoint_state_t old_state, dxfg_endpoint_state_t new_state, void *user_data)

Function pointer to the endpoint state change listener.

Parameters
[in]threadThe pointer to a run-time data structure for the thread.
[in]old_stateThe old endpoint state.
[in]new_stateThe new endpoint state.
[in,out]user_dataThe pointer to user data.

◆ dxfg_endpoint_state_change_listener_t

typedef struct dxfg_endpoint_state_change_listener_t dxfg_endpoint_state_change_listener_t

The PropertyChangeListener. Javadoc.

◆ dxfg_endpoint_state_t

List of endpoint states. Javadoc.

◆ dxfg_endpoint_t

typedef struct dxfg_endpoint_t dxfg_endpoint_t

The DXEndpoint. Javadoc.

◆ dxfg_event_clazz_list_t

typedef struct dxfg_event_clazz_list_t dxfg_event_clazz_list_t

◆ dxfg_feed_t

typedef struct dxfg_feed_t dxfg_feed_t

Forward declarations.

◆ dxfg_publisher_t

typedef struct dxfg_publisher_t dxfg_publisher_t

Enumeration Type Documentation

◆ dxfg_endpoint_role_t

List of endpoint roles. Javadoc.

Enumerator
DXFG_ENDPOINT_ROLE_FEED 
DXFG_ENDPOINT_ROLE_ON_DEMAND_FEED 
DXFG_ENDPOINT_ROLE_STREAM_FEED 
DXFG_ENDPOINT_ROLE_PUBLISHER 
DXFG_ENDPOINT_ROLE_STREAM_PUBLISHER 
DXFG_ENDPOINT_ROLE_LOCAL_HUB 

◆ dxfg_endpoint_state_t

List of endpoint states. Javadoc.

Enumerator
DXFG_ENDPOINT_STATE_NOT_CONNECTED 
DXFG_ENDPOINT_STATE_CONNECTING 
DXFG_ENDPOINT_STATE_CONNECTED 
DXFG_ENDPOINT_STATE_CLOSED 

Function Documentation

◆ dxfg_DXEndpoint_addStateChangeListener()

int32_t dxfg_DXEndpoint_addStateChangeListener ( graal_isolatethread_t * thread,
dxfg_endpoint_t * endpoint,
dxfg_endpoint_state_change_listener_t * listener )

Adds the state change listener (see dxfg_PropertyChangeListener_new()).

The state changes are delivered by a single task on the endpoint's executor that reports the change from the last reported state to the current one, so the fast changes are coalesced (e.g. DXFG_ENDPOINT_STATE_NOT_CONNECTED -> DXFG_ENDPOINT_STATE_CONNECTED without DXFG_ENDPOINT_STATE_CONNECTING). A notification may come after dxfg_DXEndpoint_close() or dxfg_DXEndpoint_removeStateChangeListener() returns.

Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]endpointThe endpoint.
[in]listenerThe listener.
Returns
DXFG_EXECUTE_SUCCESSFULLY (0) on success or DXFG_EXECUTE_FAIL (-1) on error. Use dxfg_get_and_clear_thread_exception_t() to get the exception.

◆ dxfg_DXEndpoint_awaitNotConnected()

int32_t dxfg_DXEndpoint_awaitNotConnected ( graal_isolatethread_t * thread,
dxfg_endpoint_t * endpoint )

◆ dxfg_DXEndpoint_awaitProcessed()

int32_t dxfg_DXEndpoint_awaitProcessed ( graal_isolatethread_t * thread,
dxfg_endpoint_t * endpoint )

◆ dxfg_DXEndpoint_close()

int32_t dxfg_DXEndpoint_close ( graal_isolatethread_t * thread,
dxfg_endpoint_t * endpoint )

Closes the endpoint: disconnects it and releases its resources. The endpoint cannot be used after that.

The function does not wait for the notifications that are already scheduled: a state change listener (including the change to DXFG_ENDPOINT_STATE_CLOSED) or an event listener may still be called after it returns. Use dxfg_DXEndpoint_closeAndAwaitTermination() to wait for them, or dxfg_JavaObjectHandler_release() of the listener to stop its calls (see dxfg_JavaObjectHandler_release()).

Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]endpointThe endpoint.
Returns
DXFG_EXECUTE_SUCCESSFULLY (0) on success or DXFG_EXECUTE_FAIL (-1) on error. Use dxfg_get_and_clear_thread_exception_t() to get the exception.

◆ dxfg_DXEndpoint_closeAndAwaitTermination()

int32_t dxfg_DXEndpoint_closeAndAwaitTermination ( graal_isolatethread_t * thread,
dxfg_endpoint_t * endpoint )

Closes the endpoint and waits until all the data processing and the scheduled notifications are completed (DXEndpoint.closeAndAwaitTermination()). Do not call it from a listener of this endpoint: it would wait for the notification that is calling it.

Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]endpointThe endpoint.
Returns
DXFG_EXECUTE_SUCCESSFULLY (0) on success or DXFG_EXECUTE_FAIL (-1) on error. Use dxfg_get_and_clear_thread_exception_t() to get the exception.

◆ dxfg_DXEndpoint_connect()

int32_t dxfg_DXEndpoint_connect ( graal_isolatethread_t * thread,
dxfg_endpoint_t * endpoint,
const char * address )

◆ dxfg_DXEndpoint_create()

dxfg_endpoint_t * dxfg_DXEndpoint_create ( graal_isolatethread_t * thread)

Creates a new endpoint with the DXFG_ENDPOINT_ROLE_FEED role (DXEndpoint.create()).

Parameters
[in]threadThe current GraalVM Isolate's thread.
Returns
The new endpoint or NULL on error. Use dxfg_get_and_clear_thread_exception_t() to get the exception. The caller owns the endpoint: close it with dxfg_DXEndpoint_close() or dxfg_DXEndpoint_closeAndAwaitTermination() and free its handle with dxfg_JavaObjectHandler_release().

◆ dxfg_DXEndpoint_create2()

dxfg_endpoint_t * dxfg_DXEndpoint_create2 ( graal_isolatethread_t * thread,
dxfg_endpoint_role_t role )

Creates a new endpoint with the given role (DXEndpoint.create(role)).

Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]roleThe role of the endpoint.
Returns
The new endpoint or NULL on error. Use dxfg_get_and_clear_thread_exception_t() to get the exception. The caller owns the endpoint: close it with dxfg_DXEndpoint_close() or dxfg_DXEndpoint_closeAndAwaitTermination() and free its handle with dxfg_JavaObjectHandler_release().

◆ dxfg_DXEndpoint_disconnect()

int32_t dxfg_DXEndpoint_disconnect ( graal_isolatethread_t * thread,
dxfg_endpoint_t * endpoint )

◆ dxfg_DXEndpoint_disconnectAndClear()

int32_t dxfg_DXEndpoint_disconnectAndClear ( graal_isolatethread_t * thread,
dxfg_endpoint_t * endpoint )

◆ dxfg_DXEndpoint_executor()

int32_t dxfg_DXEndpoint_executor ( graal_isolatethread_t * thread,
dxfg_endpoint_t * endpoint,
dxfg_executor_t * executor )

Changes the executor of the endpoint's notifications (DXEndpoint.executor(executor)).

Call it before dxfg_DXEndpoint_getFeed() (and before the other functions that use the endpoint's feed, e.g. dxfg_OnDemandService_getInstance2()). Otherwise, the feed keeps using the default executor, which is shut down, and the last events requests (dxfg_DXFeed_getLastEventPromise(), etc.) never complete (a RejectedExecutionException is logged).

Deprecated
Use dxfg_DXEndpoint_Builder_withExecutor(). The first call logs a deprecation warning.
Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]endpointThe endpoint.
[in]executorThe executor.
Returns
DXFG_EXECUTE_SUCCESSFULLY (0) on success or DXFG_EXECUTE_FAIL (-1) on error. Use dxfg_get_and_clear_thread_exception_t() to get the exception.

◆ dxfg_DXEndpoint_getEventTypes()

dxfg_event_clazz_list_t * dxfg_DXEndpoint_getEventTypes ( graal_isolatethread_t * thread,
dxfg_endpoint_t * endpoint )

Returns a set of all event types supported by this endpoint and the current version of the dxFeed Native Graal SDK (all other event types will be filtered out).

Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]endpointThe endpoint.
Returns
A set of supported event types. Use dxfg_CList_EventClazz_release() to free the list's handle.

◆ dxfg_DXEndpoint_getFeed()

dxfg_feed_t * dxfg_DXEndpoint_getFeed ( graal_isolatethread_t * thread,
dxfg_endpoint_t * endpoint )

◆ dxfg_DXEndpoint_getInstance()

dxfg_endpoint_t * dxfg_DXEndpoint_getInstance ( graal_isolatethread_t * thread)

Returns the default application-wide singleton endpoint with the DXFG_ENDPOINT_ROLE_FEED role (DXEndpoint.getInstance()), the same one that dxfg_DXFeed_getInstance() uses. It is configured by the system properties (see dxfg_system_set_property()) when it is first used.

All callers share this endpoint: closing it closes it for everyone in the process.

Parameters
[in]threadThe current GraalVM Isolate's thread.
Returns
The endpoint or NULL on error. Use dxfg_get_and_clear_thread_exception_t() to get the exception. Use dxfg_JavaObjectHandler_release() to free the handle.

◆ dxfg_DXEndpoint_getInstance2()

dxfg_endpoint_t * dxfg_DXEndpoint_getInstance2 ( graal_isolatethread_t * thread,
dxfg_endpoint_role_t role )

Creates a new endpoint with the given role on every call, the same as dxfg_DXEndpoint_create2().

Unlike the Java DXEndpoint.getInstance(role), this function does not return a singleton. Prefer dxfg_DXEndpoint_newBuilder() (or dxfg_DXEndpoint_create2()) in the new code.

Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]roleThe role of the endpoint.
Returns
The new endpoint or NULL on error. Use dxfg_get_and_clear_thread_exception_t() to get the exception. The caller owns the endpoint: close it with dxfg_DXEndpoint_close() or dxfg_DXEndpoint_closeAndAwaitTermination() and free its handle with dxfg_JavaObjectHandler_release().

◆ dxfg_DXEndpoint_getPublisher()

dxfg_publisher_t * dxfg_DXEndpoint_getPublisher ( graal_isolatethread_t * thread,
dxfg_endpoint_t * endpoint )

◆ dxfg_DXEndpoint_getRole()

dxfg_endpoint_role_t dxfg_DXEndpoint_getRole ( graal_isolatethread_t * thread,
dxfg_endpoint_t * endpoint )

◆ dxfg_DXEndpoint_getState()

dxfg_endpoint_state_t dxfg_DXEndpoint_getState ( graal_isolatethread_t * thread,
dxfg_endpoint_t * endpoint )

◆ dxfg_DXEndpoint_password()

int32_t dxfg_DXEndpoint_password ( graal_isolatethread_t * thread,
dxfg_endpoint_t * endpoint,
const char * password )

◆ dxfg_DXEndpoint_reconnect()

int32_t dxfg_DXEndpoint_reconnect ( graal_isolatethread_t * thread,
dxfg_endpoint_t * endpoint )

◆ dxfg_DXEndpoint_removeStateChangeListener()

int32_t dxfg_DXEndpoint_removeStateChangeListener ( graal_isolatethread_t * thread,
dxfg_endpoint_t * endpoint,
dxfg_endpoint_state_change_listener_t * listener )

◆ dxfg_DXEndpoint_user()

int32_t dxfg_DXEndpoint_user ( graal_isolatethread_t * thread,
dxfg_endpoint_t * endpoint,
const char * user )

◆ dxfg_PropertyChangeListener_new()

dxfg_endpoint_state_change_listener_t * dxfg_PropertyChangeListener_new ( graal_isolatethread_t * thread,
dxfg_endpoint_state_change_listener_func user_func,
void * user_data )

Creates a new endpoint state change listener.

Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]user_funcThe function to call on the state changes (see dxfg_DXEndpoint_addStateChangeListener()).
[in]user_dataThe user data to pass to the function.
Returns
The listener or NULL on error. Use dxfg_get_and_clear_thread_exception_t() to get the exception. Releasing the last handle of the listener with dxfg_JavaObjectHandler_release() (or dxfg_NativeListener_deactivate()) stops the calls of the function: the user data can be freed after that.