Class: Javonet
- Inherits:
-
Object
- Object
- Javonet
- Defined in:
- lib/javonet-ruby-sdk/sdk/javonet.rb
Overview
The Javonet class is a singleton class that serves as the entry point for interacting with Javonet. It provides methods to activate and initialize the Javonet SDK. It supports both in-memory and TCP connections.
Class Method Summary collapse
-
.activate(license_key, proxy_host = nil, proxy_user_name = nil, proxy_password = nil) ⇒ Integer
Activates Javonet with the provided license key and optionally with proxy data.
-
.in_memory ⇒ RuntimeFactory
Initializes Javonet using an in-memory channel on the same machine.
-
.tcp(tcp_connection_data) ⇒ RuntimeFactory
Initializes Javonet with a TCP connection to a remote machine.
-
.with_config(path) ⇒ ConfigRuntimeFactory
Initializes Javonet with a custom configuration file.
Class Method Details
.activate(license_key, proxy_host = nil, proxy_user_name = nil, proxy_password = nil) ⇒ Integer
Activates Javonet with the provided license key and optionally with proxy data.
58 59 60 61 62 63 64 65 66 67 68 |
# File 'lib/javonet-ruby-sdk/sdk/javonet.rb', line 58 def self.activate(license_key, proxy_host=nil, proxy_user_name=nil, proxy_password=nil) proxy_host ||= "" proxy_user_name ||= "" proxy_password ||= "" begin return Transmitter.activate_with_credentials_and_proxy(license_key, proxy_host, proxy_user_name, proxy_password) rescue Exception => e SdkExceptionHelper.send_exception_to_app_insights(e, license_key) raise e end end |
.in_memory ⇒ RuntimeFactory
Initializes Javonet using an in-memory channel on the same machine.
24 25 26 |
# File 'lib/javonet-ruby-sdk/sdk/javonet.rb', line 24 def self.in_memory RuntimeFactory.new(ConnectionType::IN_MEMORY, nil) end |
.tcp(tcp_connection_data) ⇒ RuntimeFactory
Initializes Javonet with a TCP connection to a remote machine.
32 33 34 |
# File 'lib/javonet-ruby-sdk/sdk/javonet.rb', line 32 def self.tcp(tcp_connection_data) RuntimeFactory.new(ConnectionType::TCP, tcp_connection_data) end |
.with_config(path) ⇒ ConfigRuntimeFactory
Initializes Javonet with a custom configuration file.
40 41 42 43 44 45 46 47 48 49 |
# File 'lib/javonet-ruby-sdk/sdk/javonet.rb', line 40 def self.with_config(path) begin Transmitter.set_config_source(path) ConfigRuntimeFactory.new(path) rescue Exception => e SdkExceptionHelper.send_exception_to_app_insights(e, "withConfig") raise e end end |