Class: RuntimeFactory
- Inherits:
-
AbstractRuntimeFactory
- Object
- AbstractRuntimeFactory
- RuntimeFactory
- Defined in:
- lib/javonet-ruby-sdk/sdk/internal/runtime_factory.rb
Overview
The RuntimeFactory class implements the AbstractRuntimeFactory interface and provides methods for creating runtime contexts. Each method corresponds to a specific runtime (CLR, JVM, .NET Core, Perl, Ruby, Node.js, Python) and returns a RuntimeContext instance for that runtime.
@see Refer to this article on Javonet Guides
Instance Method Summary collapse
-
#clr ⇒ RuntimeContext
Creates a RuntimeContext instance to interact with CLR runtime.
-
#initialize(connection_type, tcp_address = nil) ⇒ RuntimeFactory
constructor
A new instance of RuntimeFactory.
-
#jvm ⇒ RuntimeContext
Creates a RuntimeContext instance to interact with JVM runtime.
-
#netcore ⇒ RuntimeContext
Creates a RuntimeContext instance to interact with .NET runtime.
-
#nodejs ⇒ RuntimeContext
Creates a RuntimeContext instance to interact with Node.js runtime.
-
#perl ⇒ RuntimeContext
Creates a RuntimeContext instance to interact with Perl runtime.
-
#python ⇒ RuntimeContext
Creates a RuntimeContext instance to interact with Python runtime.
-
#ruby ⇒ RuntimeContext
Creates a RuntimeContext instance to interact with Ruby runtime.
Constructor Details
#initialize(connection_type, tcp_address = nil) ⇒ RuntimeFactory
Returns a new instance of RuntimeFactory.
10 11 12 13 14 15 16 17 18 |
# File 'lib/javonet-ruby-sdk/sdk/internal/runtime_factory.rb', line 10 def initialize(connection_type, tcp_address = nil) @connection_type = connection_type if @connection_type == ConnectionType::TCP if tcp_address.nil? raise("Error tcp ip adress is not given!") end end @tcp_address = tcp_address end |
Instance Method Details
#clr ⇒ RuntimeContext
Creates a RuntimeContext instance to interact with CLR runtime.
23 24 25 |
# File 'lib/javonet-ruby-sdk/sdk/internal/runtime_factory.rb', line 23 def clr RuntimeContext.get_instance(RuntimeName::CLR, @connection_type, @tcp_address) end |
#jvm ⇒ RuntimeContext
Creates a RuntimeContext instance to interact with JVM runtime.
30 31 32 |
# File 'lib/javonet-ruby-sdk/sdk/internal/runtime_factory.rb', line 30 def jvm RuntimeContext.get_instance(RuntimeName::JVM, @connection_type, @tcp_address) end |
#netcore ⇒ RuntimeContext
Creates a RuntimeContext instance to interact with .NET runtime.
37 38 39 |
# File 'lib/javonet-ruby-sdk/sdk/internal/runtime_factory.rb', line 37 def netcore RuntimeContext.get_instance(RuntimeName::NETCORE, @connection_type, @tcp_address) end |
#nodejs ⇒ RuntimeContext
Creates a RuntimeContext instance to interact with Node.js runtime.
58 59 60 |
# File 'lib/javonet-ruby-sdk/sdk/internal/runtime_factory.rb', line 58 def nodejs RuntimeContext.get_instance(RuntimeName::NODEJS, @connection_type, @tcp_address) end |
#perl ⇒ RuntimeContext
Creates a RuntimeContext instance to interact with Perl runtime.
44 45 46 |
# File 'lib/javonet-ruby-sdk/sdk/internal/runtime_factory.rb', line 44 def perl RuntimeContext.get_instance(RuntimeName::PERL, @connection_type, @tcp_address) end |
#python ⇒ RuntimeContext
Creates a RuntimeContext instance to interact with Python runtime.
65 66 67 |
# File 'lib/javonet-ruby-sdk/sdk/internal/runtime_factory.rb', line 65 def python RuntimeContext.get_instance(RuntimeName::PYTHON, @connection_type, @tcp_address) end |
#ruby ⇒ RuntimeContext
Creates a RuntimeContext instance to interact with Ruby runtime.
51 52 53 |
# File 'lib/javonet-ruby-sdk/sdk/internal/runtime_factory.rb', line 51 def ruby RuntimeContext.get_instance(RuntimeName::RUBY, @connection_type, @tcp_address) end |