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

Functions

dxfg_endpoint_builder_t * dxfg_DXEndpoint_newBuilder (graal_isolatethread_t *thread)
int32_t dxfg_DXEndpoint_Builder_withRole (graal_isolatethread_t *thread, dxfg_endpoint_builder_t *builder, dxfg_endpoint_role_t role)
int32_t dxfg_DXEndpoint_Builder_withName (graal_isolatethread_t *thread, dxfg_endpoint_builder_t *builder, const char *name)
int32_t dxfg_DXEndpoint_Builder_withProperty (graal_isolatethread_t *thread, dxfg_endpoint_builder_t *builder, const char *key, const char *value)
int32_t dxfg_DXEndpoint_Builder_withProperties (graal_isolatethread_t *thread, dxfg_endpoint_builder_t *builder, const char *file_path)
int32_t dxfg_DXEndpoint_Builder_withExecutor (graal_isolatethread_t *thread, dxfg_endpoint_builder_t *builder, dxfg_executor_t *executor)
int32_t dxfg_DXEndpoint_Builder_supportsProperty (graal_isolatethread_t *thread, dxfg_endpoint_builder_t *builder, const char *key)
dxfg_endpoint_t * dxfg_DXEndpoint_Builder_build (graal_isolatethread_t *thread, dxfg_endpoint_builder_t *builder)

Detailed Description

The recommended way to create an endpoint: the builder allows to set the role, the name and the properties (see DXEndpoint.Builder). Every dxfg_DXEndpoint_Builder_build() call creates a new endpoint.

Function Documentation

◆ dxfg_DXEndpoint_Builder_build()

dxfg_endpoint_t * dxfg_DXEndpoint_Builder_build ( graal_isolatethread_t * thread,
dxfg_endpoint_builder_t * builder )

Builds a new endpoint with the builder's settings.

Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]builderThe builder.
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() (releasing the handle does not close the endpoint).

◆ dxfg_DXEndpoint_Builder_supportsProperty()

int32_t dxfg_DXEndpoint_Builder_supportsProperty ( graal_isolatethread_t * thread,
dxfg_endpoint_builder_t * builder,
const char * key )

◆ dxfg_DXEndpoint_Builder_withExecutor()

int32_t dxfg_DXEndpoint_Builder_withExecutor ( graal_isolatethread_t * thread,
dxfg_endpoint_builder_t * builder,
dxfg_executor_t * executor )

Sets the executor of the notifications of the endpoints built by this builder: event processing, state changes, etc. (DXEndpoint.Builder.withExecutor(executor)). Use it instead of the deprecated dxfg_DXEndpoint_executor().

By default, the endpoint uses a thread pool with the size equal to the number of available processors (the dxfeed.threadPoolSize property for the feed roles and dxpublisher.threadPoolSize for the publisher). The executor must not reject the submitted tasks.

Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]builderThe builder.
[in]executorThe executor (e.g. from dxfg_Executors_newFixedThreadPool()) or NULL to use the default one. The builder does not take the handle: free it with dxfg_JavaObjectHandler_release() when it is no longer needed.
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_Builder_withName()

int32_t dxfg_DXEndpoint_Builder_withName ( graal_isolatethread_t * thread,
dxfg_endpoint_builder_t * builder,
const char * name )

◆ dxfg_DXEndpoint_Builder_withProperties()

int32_t dxfg_DXEndpoint_Builder_withProperties ( graal_isolatethread_t * thread,
dxfg_endpoint_builder_t * builder,
const char * file_path )

◆ dxfg_DXEndpoint_Builder_withProperty()

int32_t dxfg_DXEndpoint_Builder_withProperty ( graal_isolatethread_t * thread,
dxfg_endpoint_builder_t * builder,
const char * key,
const char * value )

◆ dxfg_DXEndpoint_Builder_withRole()

int32_t dxfg_DXEndpoint_Builder_withRole ( graal_isolatethread_t * thread,
dxfg_endpoint_builder_t * builder,
dxfg_endpoint_role_t role )

◆ dxfg_DXEndpoint_newBuilder()

dxfg_endpoint_builder_t * dxfg_DXEndpoint_newBuilder ( graal_isolatethread_t * thread)

Creates a new endpoint builder.

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