Class EConfigure


  • public final class EConfigure
    extends Object
    This immutable class contains eBus services, remote connection, dispatcher, and pause configuration. This configuration can be specified:

    NOTE:As of eBus release 6.0.0, Properites-based configuration is no longer supported. Please move to typesafe-based configuration.

    Please note that eBus configuration requires no service or connections to be specified. If this is the case, remote connections are neither accepted nor established and all messages flow between objects within the JVM.

    eBus release 4.7.0 supports secure TCP connections based on SSL/TLS using SSLContext. eBus release 6.0.0 supports secure UDP "connections" based on DTLS. These connection types are not supported using a configuration file as this would require placing sensitive information in an insecure manner. Therefore, creating secure TCP services and connections can only be done using the API.

    Dispatcher threads are instantiated on JVM start-up, the dispatcher configuration is taken from the properties file specified by the command line parameter -Dnet.sf.eBus.config.jsonFile=<typesafe json file path>. eBus loads the EClientDispatcher configuration from this properties file and creates the dispatcher threads according to this configuration. If no configuration file is specified or is incorrectly configured, eBus defaults to a single, blocking run queue. The run queue thread count equals Runtime.availableProcessors().

    The eBus configuration uses the following JSON properties. See typesafe project for a thorough explanation of typesafe JSON configuration file layout. As of eBus v. 5.1.0, eBus connections may be paused which is described in detail here.

    Top-level JSON Properties
    Property Required? Type Default Description
    services No Array of EConfigure.Service instances. No eBus services. Contains eBus services. May be an empty array.
    connections No Array of EConfigure.RemoteConnection instances. No eBus remote connections. Contains eBus remote connections. May be an empty array.
    multicast No Array of EConfigure.MulticastConnection instances. No eBus multicast notifications. Contains eBus multicast connections. May be an empty array.
    dispatchers No. Array of EConfigure.Dispatcher instances. Default eBus blocking dispatcher with Thread.NORM_PRIORITY and DEFAULT_QUANTUM and thread count based on the number of available processors. Contains eBus dispatcher definitions. May be an empty array.
    selectors No Array of ENetConfigure.SelectorInfo instances. Contains eBus NIO selector thread definitions. May be an empty array.
    See EConfigure.Dispatcher for information about two special, pre-defined Dispatcher types: EConfigure.DispatcherType.SWING and EConfigure.DispatcherType.JAVAFX which deliver eBus messages via the GUI thread.

    See the eBus overview section on connecting eBus applications for a detailed description in configuring eBus connections.

    Connection Pause

    eBus release 5.1.0 introduces the ability to automatically pause a connection when it has been idle or continuously connected for a given time. When paused, messages are kept on a backlog for later transmission when the connection is resumed. The message backlog queue size may be limited. Once the queue size reaches that limit, then messages are discarded based on the specified discard policy.

    The connection is resumed when the pause time is reached. This pause time is always used. Optionally a resume-on-backlog-size may also be set. When the backlog size reaches this size while paused, the connection is resumed even if the pause time is not yet reached.

    The connection pause time and maximum backlog size are negotiated between the two connection ends. The lesser pause time and backlog size values are used by both ends.

    This feature is added with an eye towards mobile devices which cannot support keeping connections up for an extended time due to battery limitations.

    eBus JSON Configuration

    eBus now supports typesafe JSON configuration. This represents a subset of JSON known as HOCON (Human-Optimized Config Object Notation). The following is an eBus configuration in HOCON. Going forward typesafe HOCON will be the preferred method for configuring eBus with java.util.Properties being deprecated.

    selectors : [
        {
            name : selector1
            type : "spin+park"
            isDefault : true
            priority : 7
            spinLimit : 1000000
            parkTime : 500ns
        }
    ]
    
    services : [
         {
            name : service1 // Defaults to TCP connection type.
            port : 12345
            addressFilter : [
                "127.0.0.1",
                "127.0.0.1:54321"
            ]
            serviceSelector : selector1
            connectionSelector : selector1
            byteOrder : LITTLE_ENDIAN
            inputBufferSize : 8192
            outputBufferSize : 65536
            messageQueueSize : 100
            canPause : true
    
            // Connection pause/resume configuration.
            pause : {
                pauseTime : 10m
                maxBacklogSize : 50
            }
        }
    ]
    
    connections : [
         {
            name : conn1
            host : "127.0.0.1"
            port : 12346
            bindPort : 0
            byteOrder : BIG_ENDIAN
            selector : selector1
            inputBufferSize : 8192
            outputBufferSize : 65536
            messageQueueSize : 100
            reconnect : true
            reconnectTime : 500ms
            canPause : true
    
            // Connection pause/resume configuration.
            pause : {
                pauseTime : 5m
                maxBacklogSize : 100
                discardPolicy : YOUNGEST_FIRST
                idleTime : 1m
                maxConnectTime : 2m
                resumeOnBacklogSize : 10
            }
        }
    ]
    
    dispatchers : [
        {
            name : d1
            runQueueType : "spin+park"
            spinLimit : 2500000
            parkTime : 500ns
            isDefault : true
            priority : 5
            quantum : 10000ns
            numberThreads : 4
        }
    ]
    Author:
    Charles Rapp
    See Also:
    ENetConfigure
    • Field Detail

      • JSON_FILE_ENV

        public static final String JSON_FILE_ENV
        Use -D to set system property "net.sf.eBus.config.jsonFile" to point to the eBus JSON configuration file. eBus will configure itself as per the file.
        See Also:
        Constant Field Values
      • DTLS_PROTOCOL_NAME

        public static final String DTLS_PROTOCOL_NAME
        Generic DTLS protocol name is "DTLS".
        See Also:
        Constant Field Values
      • NAME_KEY

        public static final String NAME_KEY
        Key "name" is used to extract the configuration object's name.
        See Also:
        Constant Field Values
      • SERVICES_KEY

        public static final String SERVICES_KEY
        The key "services" contains a comma-separated list of local service names.
        See Also:
        Constant Field Values
      • SERVICE_PREFIX

        public static final String SERVICE_PREFIX
        Service keys are prefixed by "eBus.service." and followed by the service name.
        See Also:
        Constant Field Values
      • CONNECTIONS_KEY

        public static final String CONNECTIONS_KEY
        The key "connections" contains a comma-separated list of remote connection names.
        See Also:
        Constant Field Values
      • CONNECTION_PREFIX

        public static final String CONNECTION_PREFIX
        Remote connection keys are prefixed by "eBus.connection." and followed by the connection name as found in CONNECTIONS_KEY.
        See Also:
        Constant Field Values
      • DISPATCHERS_KEY

        public static final String DISPATCHERS_KEY
        The key "dispatchers" contains a comma-separated list of unique, client dispatcher names.
        See Also:
        Constant Field Values
      • CONN_TYPE_KEY

        public static final String CONN_TYPE_KEY
        Both service and connection definitions use the "connectionType" to define the connection protocol type.
        See Also:
        Constant Field Values
      • PORT_KEY

        public static final String PORT_KEY
        Both the service and connection definitions use the "port" key suffix. Must be an integer > zero.
        See Also:
        Constant Field Values
      • INBUFFER_SIZE_KEY

        public static final String INBUFFER_SIZE_KEY
        Both the service and connection definitions use the "inputBufferSize" key suffix. Must be an integer > zero.
        See Also:
        Constant Field Values
      • OUTBUFFER_SIZE_KEY

        public static final String OUTBUFFER_SIZE_KEY
        Both the service and connection definitions use the "outputBufferSize" key suffix. Must be an integer > zero.
        See Also:
        Constant Field Values
      • MSG_QUEUE_SIZE_KEY

        public static final String MSG_QUEUE_SIZE_KEY
        Both the service and connection definitions use the "messageQueueSize" key suffix. Must be an integer > zero.
        See Also:
        Constant Field Values
      • SVC_SELECTOR_KEY

        public static final String SVC_SELECTOR_KEY
        The service definition uses the key suffix "serviceSelector" to define the selector used to monitor the service socket. Must be a known selector. If not specified, then defaults to AsyncChannel.defaultSelector.
        See Also:
        Constant Field Values
      • CONN_SELECTOR_KEY

        public static final String CONN_SELECTOR_KEY
        The service definition uses the key suffix "connectionSelector" to define the selector used to monitor TCP socket channels accepted by the service socket. Must be a known selector. If not specified, then defaults to AsyncChannel.defaultSelector.
        See Also:
        Constant Field Values
      • SELECTOR_KEY

        public static final String SELECTOR_KEY
        Both the service and connection definitions use the "selector" key suffix. Must be a known selector. If not specified, then defaults to AsyncChannel.defaultSelector.
        See Also:
        Constant Field Values
      • HOST_KEY

        public static final String HOST_KEY
        The connection definition uses the "host" key suffix. Must be either a valid host name or IP address in dotted notation.
        See Also:
        Constant Field Values
      • BIND_HOST_KEY

        public static final String BIND_HOST_KEY
        The connection definition uses the "bindHost" key suffix. Must be either a valid host name or IP address in dotted notation.
        See Also:
        Constant Field Values
      • BIND_PORT_KEY

        public static final String BIND_PORT_KEY
        The connection definition uses the "bindPort" key suffix. Must be an integer ≥ zero.
        See Also:
        Constant Field Values
      • RECONNECT_KEY

        public static final String RECONNECT_KEY
        The connection definition uses the "reconnect" key suffix. Must be a boolean.
        See Also:
        Constant Field Values
      • RECONNECT_DELAY_KEY

        public static final String RECONNECT_DELAY_KEY
        The connection definition uses the "reconnectTime" key suffix. Must be an integer ≥ zero.
        See Also:
        Constant Field Values
      • HB_DELAY_KEY

        public static final String HB_DELAY_KEY
        The connection definition uses the "heartbeatDelay" key suffix. Must be an integer ≥ zero.
        See Also:
        Constant Field Values
      • HB_REPLY_DELAY_KEY

        public static final String HB_REPLY_DELAY_KEY
        The connection definition uses the "heartbeatReplyDelay" key suffix. Must be an integer ≥ zero.
        See Also:
        Constant Field Values
      • FILTER_KEY

        public static final String FILTER_KEY
        The service definition uses the "addressFilter" key suffix. Must be a valid address filter list.
        See Also:
        Constant Field Values
      • DEFAULT_KEY

        public static final String DEFAULT_KEY
        The boolean "isDefault" property is used to specify when this dispatcher should be used as the default dispatcher. At most one dispatcher should be designated as the default dispatcher. If more than one is so designated, the subsequent .isDefault keys are ignored.

        If no user-defined dispatcher is marked as default, then a blocking, normal priority dispatcher named EClient.DEFAULT_DISPATCHER is used as the default dispatcher.

        The default value is false (not the default selector).

        See Also:
        Constant Field Values
      • TASK_QUEUE_CAPACITY_KEY

        public static final String TASK_QUEUE_CAPACITY_KEY
        eBus client task queue capacity "taskQueueCapacity" property is used to specify task queue maximum size for all eBus clients.

        Default value is DEFAULT_TASK_QUEUE_CAPACITY.

        See Also:
        Constant Field Values
      • THREAD_TYPE_KEY

        public static final String THREAD_TYPE_KEY
        The run queue "runQueueType" property is used to specify how the dispatcher thread acquires the next available EClient from the run queue by either blocking, spinning, spin+park, or spin+yield.

        The default value is DEFAULT_THREAD_TYPE.

        See Also:
        Constant Field Values
      • RUN_QUEUE_CAPACITY_KEY

        public static final String RUN_QUEUE_CAPACITY_KEY
        Run queue capacity "runQueueCapacity" property is used to specify run queue maximum size. Only used for non-blocking thread types.

        Default value is DEFAULT_RUN_QUEUE_CAPACITY.

        See Also:
        Constant Field Values
      • SPIN_LIMIT_KEY

        public static final String SPIN_LIMIT_KEY
        If the thread type is spin+park or ThreadType.SPINYIELD, then the integer .spinLimit property may be specified. This setting defines the number of times the Dispatcher thread may call Queue.poll() before parking or yielding.

        This value must be > zero.

        Default values is DEFAULT_SPIN_LIMIT.

        This property is ignored is the thread type is not spin+park or spin+yield.

        See Also:
        Constant Field Values
      • PARK_TIME_KEY

        public static final String PARK_TIME_KEY
        If the thread type is spin+park, then the integer .parkTime property may be specified. This setting specifies the nanosecond park time taken between Queue.poll() spin cycles.

        This value must be > zero.

        Default values is DEFAULT_PARK_TIME.

        This property is ignored is the thread type is not spin+park.

        See Also:
        Constant Field Values
      • QUANTUM_KEY

        public static final String QUANTUM_KEY
        The key "quantum" defines the run quantum each client is initially assigned. If a client exhausts its quantum, the client is placed back on the run queue.
        See Also:
        Constant Field Values
      • CLASSES_KEY

        public static final String CLASSES_KEY
        The key "classes" defines the classes which are posted to this dispatcher. This key is ignored if .isDefault is set to true.
        See Also:
        Constant Field Values
      • NUM_THREADS_KEY

        public static final String NUM_THREADS_KEY
        The dispatcher definition uses "numberThreads" key suffix to specify the number of threads in the dispatcher.
        See Also:
        Constant Field Values
      • CAN_PAUSE_KEY

        public static final String CAN_PAUSE_KEY
        If a remote client connection may be paused, then this property is defined and set to true. If not set then assumed to be false and the connection cannot be paused. This key may be defined for both acceptor and initiator connections.
        See Also:
        Constant Field Values
      • PAUSE_KEY

        public static final String PAUSE_KEY
        If CAN_PAUSE_KEY is set to true, then the connection pause parameters are stored under the "pause" key. This key may be defined for both acceptor and initiator connections.
        See Also:
        Constant Field Values
      • PAUSE_DURATION_KEY

        public static final String PAUSE_DURATION_KEY
        The pause duration is stored in "pauseTime". This is a sub-key under PAUSE_KEY. This key may be defined for both acceptor and initiator connections.
        See Also:
        Constant Field Values
      • MAX_BACKLOG_SIZE_KEY

        public static final String MAX_BACKLOG_SIZE_KEY
        Maximum allowed message backlog when paused. This key may be defined for both acceptor and initiator connections.
        See Also:
        Constant Field Values
      • DISCARD_POLICY_KEY

        public static final String DISCARD_POLICY_KEY
        When the maximum message backlog limit is breached, then this policy defines which messages should be discarded. This key is defined for initiator connections only.
        See Also:
        Constant Field Values
      • IDLE_TIME_KEY

        public static final String IDLE_TIME_KEY
        When a connection is idle (no messages sent or received) for a given time, that connection is automatically paused. This value is set in the "idleTime" property.
        See Also:
        Constant Field Values
      • MAX_CONNECT_TIME_KEY

        public static final String MAX_CONNECT_TIME_KEY
        Maximum allowed time between pauses, irrespective of connection being busy. This value is set in the the "maxConnectTime" property.
        See Also:
        Constant Field Values
      • RESUME_ON_BACKLOG_SIZE_KEY

        public static final String RESUME_ON_BACKLOG_SIZE_KEY
        Resumes the client connection automatically when the transmit queue reaches this size (application messages only). This trigger is turned off when set to zero which is the default value. This value should be less than the maximum backlog size to be effective.
        See Also:
        Constant Field Values
      • MULTICAST_KEY

        public static final String MULTICAST_KEY
        Multicast connections are stored in key "multicast".
        See Also:
        Constant Field Values
      • MULTICAST_ROLE_KEY

        public static final String MULTICAST_ROLE_KEY
        Multicast connection role is stored in key "role".
        See Also:
        Constant Field Values
      • TARGET_PORT_KEY

        public static final String TARGET_PORT_KEY
        Multicast target port is stored in key "targetPort".
        See Also:
        Constant Field Values
      • NET_IF_KEY

        public static final String NET_IF_KEY
        Multicast group network interface is stored in key " networkInterface".
        See Also:
        Constant Field Values
      • SOURCES_KEY

        public static final String SOURCES_KEY
        Multicast source addresses are stored in key "sources". This property is optional.
        See Also:
        Constant Field Values
      • PROTOCOL_KEY

        public static final String PROTOCOL_KEY
        Multicast group protocol family is stored in key "protocolFamily".
        See Also:
        Constant Field Values
      • NOTIFICATION_KEY

        public static final String NOTIFICATION_KEY
        Notification multi-feed message keys are stored in key "notifications".
        See Also:
        Constant Field Values
      • MULTIFEED_TYPE_KEY

        public static final String MULTIFEED_TYPE_KEY
        The multi-feed type of LIST or QUERY is stored in "multifeedType".
        See Also:
        Constant Field Values
      • MESSAGE_CLASS_KEY

        public static final String MESSAGE_CLASS_KEY
        Multicast message class name is stored in "messageClass".
        See Also:
        Constant Field Values
      • SUBJECT_QUERY_KEY

        public static final String SUBJECT_QUERY_KEY
        Multicast subject query is stored in "subjectQuery".
        See Also:
        Constant Field Values
      • SUBJECT_LIST_KEY

        public static final String SUBJECT_LIST_KEY
        Multicast subject list is stored in "subjectList".
        See Also:
        Constant Field Values
      • IS_DYNAMIC_KEY

        public static final String IS_DYNAMIC_KEY
        Multicast query subject is stored in "isDynamic". This key is used only if MULTIFEED_TYPE_KEY is set to QUERY.
        See Also:
        Constant Field Values
      • RETRANSMIT_DELAY_KEY

        public static final String RETRANSMIT_DELAY_KEY
        Reliable UDP re-transmits an application message after waiting this long for an application message acknowledgement receipt.
        See Also:
        Constant Field Values
      • RETRANSMIT_LIMIT_KEY

        public static final String RETRANSMIT_LIMIT_KEY
        Reliable UDP re-transmits an application message this many times before declaring the connection lost. This does not include the initial message transmit.
        See Also:
        Constant Field Values
      • DEFAULT_THREAD_TYPE

        public static final String DEFAULT_THREAD_TYPE
        The default Dispatcher thread type is ThreadType.BLOCKING.
      • DEFAULT_SPIN_LIMIT

        public static final int DEFAULT_SPIN_LIMIT
        The default spin limit is 2500000 calls to Queue.poll() before parking or yielding.
        See Also:
        Constant Field Values
      • DEFAULT_PARK_TIME

        public static final Duration DEFAULT_PARK_TIME
        The default park time after spinning is 1 microsecond.
      • DEFAULT_PRIORITY

        public static final int DEFAULT_PRIORITY
        The default dispatcher thread priority is 5.
        See Also:
        Constant Field Values
      • DEFAULT_QUANTUM

        public static final Duration DEFAULT_QUANTUM
        The default run quantum is 500 microseconds.
      • DEFAULT_NUMBER_THREADS

        public static final int DEFAULT_NUMBER_THREADS
        The default dispatcher thread count is 4.
        See Also:
        Constant Field Values
      • DEFAULT_QUEUE_SIZE

        public static final int DEFAULT_QUEUE_SIZE
        This value specifies that there is no limit to the transmit queue size.
        See Also:
        Constant Field Values
      • DEFAULT_RECONNECT_FLAG

        public static final boolean DEFAULT_RECONNECT_FLAG
        By default a lost connection is not reconnected.
        See Also:
        Constant Field Values
      • DEFAULT_RECONNECT_TIME

        public static final long DEFAULT_RECONNECT_TIME
        The default reconnect time is 5 seconds. This value is used only if reconnection is set to true when the connection was ERemoteApp.openConnection(EConfigure.RemoteConnection) opened.
        See Also:
        Constant Field Values
      • DEFAULT_HEARTBEAT_DELAY

        public static final Duration DEFAULT_HEARTBEAT_DELAY
        By default heart-beating is turned off.
      • DEFAULT_HEARTBEAT_REPLY_DELAY

        public static final Duration DEFAULT_HEARTBEAT_REPLY_DELAY
        By default wait indefinitely for a heartbeat reply.
      • DEFAULT_MESSAGE_COMPILER

        public static final EConfigure.MessageCompilerType DEFAULT_MESSAGE_COMPILER
        Default eBus message compiler type is MessageCompilerType.JAVA_ASSIST.
      • DEFAULT_TASK_QUEUE_CAPACITY

        public static final int DEFAULT_TASK_QUEUE_CAPACITY
        Default eBus client task queue capacity is 1024.
        See Also:
        Constant Field Values
      • DEFAULT_RUN_QUEUE_CAPACITY

        public static final int DEFAULT_RUN_QUEUE_CAPACITY
        Default run queue capacity is 64. This value is used only for non-blocking thread types and ignored for blocking queues.
        See Also:
        Constant Field Values
    • Method Detail

      • equals

        public boolean equals​(Object o)
        Returns true if o is a non-null EConfigure instance with the same settings; returns false otherwise.
        Overrides:
        equals in class Object
        Parameters:
        o - Test equals with this object.
        Returns:
        true if o is a non-null EConfigure instance with the same settings; returns false otherwise.
      • hashCode

        public int hashCode()
        Returns the configuration hash code.
        Overrides:
        hashCode in class Object
        Returns:
        the configuration hash code.
      • toString

        public String toString()
        Returns the configuration text representation.
        Overrides:
        toString in class Object
        Returns:
        the configuration text representation.
      • hasServices

        public boolean hasServices()
        Returns true if at least one service is configured and false otherwise.
        Returns:
        true if there is a service.
      • hasService

        public boolean hasService​(String name)
        Returns true if there is an eBus service defined with the given name.
        Parameters:
        name - service name.
        Returns:
        true if service exists.
      • service

        public EConfigure.Service service​(String name)
        Returns the eBus service for the given name. Returns null if there is no service for name.
        Parameters:
        name - service name.
        Returns:
        eBus service with the given name.
      • hasRemoteConnections

        public boolean hasRemoteConnections()
        Returns true if remote connections are configured and false if not.
        Returns:
        true if there are remote connections.
      • hasRemoteConnection

        public boolean hasRemoteConnection​(String name)
        Returns true if there is a remote connection defined with the given name.
        Parameters:
        name - connection name.
        Returns:
        true if named connection exists.
      • connection

        public EConfigure.RemoteConnection connection​(String name)
        Returns remote connection configuration with the given name. Returns null if there is no such named remote connection configuration.
        Parameters:
        name - remote connection configuration name.
        Returns:
        remote connection configuration instance or null if no such instance exists.
      • hasMulticastConnections

        public boolean hasMulticastConnections()
        Returns true if multicast connections are configured and false if not.
        Returns:
        true if there are multicast connections.
      • hasMulticastConnection

        public boolean hasMulticastConnection​(String name)
        Returns true if there is a remote connection defined with the given name.
        Parameters:
        name - multicast connection name.
        Returns:
        true if named multicast connection exists.
      • multicastConnection

        public EConfigure.MulticastConnection multicastConnection​(String name)
        Returns multicast connection configuration with the given name. Returns null if there is no such named multicast connection configuration.
        Parameters:
        name - multicast connection configuration name.
        Returns:
        multicast connection configuration instance or null if no such instance exists.
      • hasDispatchers

        public boolean hasDispatchers()
        Returns true if dispatchers are configured and false if not.
        Returns:
        true if there are dispatchers configured.
      • hasDispatcher

        public boolean hasDispatcher​(String name)
        Returns true if there is a dispatcher defined with the given name.
        Parameters:
        name - dispatcher name.
        Returns:
        true if dispatcher exists.
      • dispatchers

        public Map<String,​EConfigure.Dispatcher> dispatchers()
        Returns the set of client dispatcher configurations.
        Returns:
        client dispatcher configurations.
      • dispatcher

        public EConfigure.Dispatcher dispatcher​(String name)
        Returns the dispatcher configuration with the given name. Returns null if there is no such named dispatcher.
        Parameters:
        name - dispatcher configuration name.
        Returns:
        dispatcher configuration instance or null.
      • serverBuilder

        public static EConfigure.ServerBuilder serverBuilder()
        Returns a new ServerBuilder instance used to construct an EServer programmatically.
        Returns:
        new ServerBuilder instance.
      • load

        public static EConfigure load​(com.typesafe.config.Config config)
        Returns the eBus service, remote connection, and dispatcher configurations found in the given JSON configuration.

        An example of the eBus JSON configuration:

        Note: Each name must be unique within the selectors, services, and connections lists.

        "selectors" : [
            {
                "name" : "mdSelector"
                "type" : "spinning"
                "isDefault" : "false"
                "priority" : 9
            },
            {
                "name" : "stockSelector"
                "type" : "spin+park"
                "isDefault" : "false"
                "priority" : 6
                "spinLimit" : 3000000
                "parkTime" : 1000
            }
        ]
        
        "services" : [
             {
                "name" : "stockService"
                "port" : 12345
                "addressFilter" : [
                    "198.168.3.2",
                    "198.168.3.3:55001"
                ]
                "serviceSelector" : "stockSelector"
                "connectionSelector" : "stockSelector"
                "byteOrder" : "BIG_ENDIAN"
                "inputBufferSize" : 8192
                "outputBufferSize" : 65536
                "messageQueueSize" : 100
                "heartbeatDelay" : 30000
                "heartbeatReply" : 500
                "canPause" : false
            }
        ]
        
        "connections" : [
             {
                 "name" : "marketData"
                 "host" : "192.168.3.4"
                 "port" : 10000
                 "inputBufferSize" : 65536
                 "outputBufferSize" : 8192
                 "byteOrder" : "BIG_ENDIAN"
                 "messageQueueSize" : 0
                 "selector" : "mdSelector"
                 "reconnect" : true
                 "reconnectTime" : 500
                 "canPause" : false
             },
             {
                "name" : "stockOrders"
                "host" : "StocksRUs.com"
                "port" : 10001
                "bindPort" : 55000
                "inputBufferSize" : 8192
                "outputBufferSize" : 65536
                "byteOrder" : "BIG_ENDIAN"
                "messageQueueSize" : 10
                "selector" : "stockSelector"
                "reconnect" : true
                "reconnectTime" : 500
                "canPause" : false
            }
        ]
        Parameters:
        config - extract the eBus configuration from these JSON properties.
        Returns:
        eBus configuration settings.
        Throws:
        com.typesafe.config.ConfigException - if config contains an invalid or incomplete eBus configuration.
      • loadServices

        public static Map<String,​EConfigure.Service> loadServices​(com.typesafe.config.Config config)
        Returns the eBus TCP services. Returns an empty map if there are no eBus services.
        Parameters:
        config - typesafe.config HOCON configuration containing service definition.
        Returns:
        eBus service.
        Throws:
        com.typesafe.config.ConfigException - if a service definition is invalid.
        See Also:
        load(Config)
      • loadConnections

        public static Map<String,​EConfigure.RemoteConnection> loadConnections​(com.typesafe.config.Config config)
        Returns remote eBus connections found in config. If there are no remote connections then returns an empty map.
        Parameters:
        config - typesafe.config HOCON configuration containing connection definitions.
        Returns:
        remote eBus connections map.
        Throws:
        com.typesafe.config.ConfigException - if a remote connection definition is invalid.
        See Also:
        load(Config)
      • loadMulticastConnections

        public static Map<String,​EConfigure.MulticastConnection> loadMulticastConnections​(com.typesafe.config.Config config)
        Returns multicast connections found in config. If there are no multicast connections then returns an empty map.
        Parameters:
        config - typesafe.config HOCON configuration containing multicast connection definitions.
        Returns:
        multicast connections map.
        Throws:
        com.typesafe.config.ConfigException - if an invalid multicast connection definition is found.
      • loadDispatchers

        public static Map<String,​EConfigure.Dispatcher> loadDispatchers​(com.typesafe.config.Config config)
        Returns the eBus dispatcher configuration found in the given JSON configuration. If this is no dispatcher configuration found, then returns an empty map.
        Parameters:
        config - JSON configuration.
        Returns:
        map from dispatcher name to its configuration.
        Throws:
        com.typesafe.config.ConfigException - if config contains an invalid dispatcher configuration.
      • loadDispatcher

        public static EConfigure.Dispatcher loadDispatcher​(com.typesafe.config.Config config)
        Returns a dispatcher configured based on the given JSON properties.
        Parameters:
        config - JSCON configuration.
        Returns:
        dispatcher
        Throws:
        com.typesafe.config.ConfigException - if config contains an invalid dispatcher configuration.