|
dxFeed Graal Native SDK 3.13.0
|
The builder of endpoints (Java DXEndpoint.Builder). More...
Functions | |
| dxfg_endpoint_builder_t * | dxfg_DXEndpoint_newBuilder (graal_isolatethread_t *thread) |
| Creates a new endpoint builder. | |
| int32_t | dxfg_DXEndpoint_Builder_withRole (graal_isolatethread_t *thread, dxfg_endpoint_builder_t *builder, dxfg_endpoint_role_t role) |
| Sets the role of the endpoints built by the builder. | |
| int32_t | dxfg_DXEndpoint_Builder_withName (graal_isolatethread_t *thread, dxfg_endpoint_builder_t *builder, const char *name) |
| Sets the name of the endpoints built by the builder. | |
| int32_t | dxfg_DXEndpoint_Builder_withProperty (graal_isolatethread_t *thread, dxfg_endpoint_builder_t *builder, const char *key, const char *value) |
| Sets a property of the endpoints built by the builder. | |
| int32_t | dxfg_DXEndpoint_Builder_withProperties (graal_isolatethread_t *thread, dxfg_endpoint_builder_t *builder, const char *file_path) |
| Sets the properties of the endpoints built by the builder from a properties file. | |
| 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. | |
| int32_t | dxfg_DXEndpoint_Builder_supportsProperty (graal_isolatethread_t *thread, dxfg_endpoint_builder_t *builder, const char *key) |
| Checks whether the builder supports a property. | |
| 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. | |
The builder of endpoints (Java DXEndpoint.Builder).
The recommended way to create an endpoint: the builder allows to set the role, the name, the executor and the properties (see DXEndpoint.Builder). Every dxfg_DXEndpoint_Builder_build() call creates a new endpoint.
| 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.
Every call builds a new endpoint. An endpoint with the role DXFG_ENDPOINT_ROLE_FEED or DXFG_ENDPOINT_ROLE_PUBLISHER connects automatically on creation if dxfeed.address (feed) or dxpublisher.address (publisher) is set; the endpoints of the other roles do not.
Java: DXEndpoint.Builder.build().
| [in] | thread | The current GraalVM Isolate's thread. |
| [in] | builder | The builder. |
| int32_t dxfg_DXEndpoint_Builder_supportsProperty | ( | graal_isolatethread_t * | thread, |
| dxfg_endpoint_builder_t * | builder, | ||
| const char * | key ) |
Checks whether the builder supports a property.
The properties that are not supported are ignored by dxfg_DXEndpoint_Builder_withProperty().
Java: DXEndpoint.Builder.supportsProperty(String).
| [in] | thread | The current GraalVM Isolate's thread. |
| [in] | builder | The builder. |
| [in] | key | The name of the property, a NUL-terminated UTF-8 string. |
| 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.
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.
Java: DXEndpoint.Builder.withExecutor(Executor).
| [in] | thread | The current GraalVM Isolate's thread. |
| [in] | builder | The builder. |
| [in] | executor | The 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. |
| int32_t dxfg_DXEndpoint_Builder_withName | ( | graal_isolatethread_t * | thread, |
| dxfg_endpoint_builder_t * | builder, | ||
| const char * | name ) |
Sets the name of the endpoints built by the builder.
The name distinguishes several endpoints in the same process in the logs and other diagnostics. It is the same as dxfg_DXEndpoint_Builder_withProperty() with the key name. A short name that describes the role of the endpoint in the application is recommended.
Java: DXEndpoint.Builder.withName(String).
| [in] | thread | The current GraalVM Isolate's thread. |
| [in] | builder | The builder. |
| [in] | name | The name, a NUL-terminated UTF-8 string; the SDK copies it. |
| int32_t dxfg_DXEndpoint_Builder_withProperties | ( | graal_isolatethread_t * | thread, |
| dxfg_endpoint_builder_t * | builder, | ||
| const char * | file_path ) |
Sets the properties of the endpoints built by the builder from a properties file.
The file is read in the format of a Java properties file (java.util.Properties.load) and every property that the builder supports is set as by dxfg_DXEndpoint_Builder_withProperty(). The unsupported properties are ignored. An error is reported if the file cannot be read.
Java: DXEndpoint.Builder.withProperties(Properties).
| [in] | thread | The current GraalVM Isolate's thread. |
| [in] | builder | The builder. |
| [in] | file_path | The path of the properties file, a NUL-terminated UTF-8 string; the SDK copies it. |
| int32_t dxfg_DXEndpoint_Builder_withProperty | ( | graal_isolatethread_t * | thread, |
| dxfg_endpoint_builder_t * | builder, | ||
| const char * | key, | ||
| const char * | value ) |
Sets a property of the endpoints built by the builder.
A property that the builder does not support is ignored: check it with dxfg_DXEndpoint_Builder_supportsProperty(). A property that is set here takes precedence over the same property from the properties file and from the system properties (see dxfg_system_set_property()).
Java: DXEndpoint.Builder.withProperty(String, String).
| [in] | thread | The current GraalVM Isolate's thread. |
| [in] | builder | The builder. |
| [in] | key | The name of the property, a NUL-terminated UTF-8 string; the SDK copies it. |
| [in] | value | The value of the property, a NUL-terminated UTF-8 string; the SDK copies it. |
| int32_t dxfg_DXEndpoint_Builder_withRole | ( | graal_isolatethread_t * | thread, |
| dxfg_endpoint_builder_t * | builder, | ||
| dxfg_endpoint_role_t | role ) |
Sets the role of the endpoints built by the builder.
The default role is DXFG_ENDPOINT_ROLE_FEED.
Java: DXEndpoint.Builder.withRole(DXEndpoint.Role).
| [in] | thread | The current GraalVM Isolate's thread. |
| [in] | builder | The builder. |
| [in] | role | The role of the endpoints. |
| dxfg_endpoint_builder_t * dxfg_DXEndpoint_newBuilder | ( | graal_isolatethread_t * | thread | ) |
Creates a new endpoint builder.
The builder has the DXFG_ENDPOINT_ROLE_FEED role and the default executor until they are changed.
Java: DXEndpoint.newBuilder().
| [in] | thread | The current GraalVM Isolate's thread. |