lib/javonet-ruby-sdk/Binaries/Perl/MacOs/X64/lib/Javonet/Javonet.pm in javonet-ruby-sdk-2.3.0 vs lib/javonet-ruby-sdk/Binaries/Perl/MacOs/X64/lib/Javonet/Javonet.pm in javonet-ruby-sdk-2.4.2

- old
+ new

@@ -2,39 +2,47 @@ use strict; use warnings FATAL => 'all'; use Moose; use lib 'lib'; use aliased 'Javonet::Sdk::Internal::RuntimeFactory' => 'RuntimeFactory'; -use aliased 'Javonet::Core::Transmitter::PerlTransmitter' => 'Transmitter', qw(activate_with_licence_file activate_with_credentials activate_with_credentials_and_proxy); +use aliased 'Javonet::Core::Transmitter::PerlTransmitter' => 'Transmitter', qw(activate_with_license_file activate_with_credentials activate_with_credentials_and_proxy); BEGIN { - Transmitter->activate_with_licence_file() + Transmitter->activate_with_license_file() } sub activate { if(@_ == 1) { - return Transmitter->activate_with_licence_file(); + return Transmitter->activate_with_license_file(); } if(@_ == 2) { - my($self, $licenceKey) = @_; - return Transmitter->activate_with_credentials($licenceKey); + my($self, $licenseKey) = @_; + return Transmitter->activate_with_credentials($licenseKey); } elsif (@_ > 2) { - my($self, $licenceKey, $proxyHost, $proxyUserName, $proxyPassword) = @_; + my($self, $licenseKey, $proxyHost, $proxyUserName, $proxyPassword) = @_; $proxyUserName //=""; $proxyPassword //=""; - return Transmitter->activate_with_credentials_and_proxy($licenceKey, $proxyHost, $proxyUserName, $proxyPassword); + return Transmitter->activate_with_credentials_and_proxy($licenseKey, $proxyHost, $proxyUserName, $proxyPassword); } } sub in_memory { - return RuntimeFactory->new(Javonet::Sdk::Internal::ConnectionType::get_connection_type('InMemory')); + return RuntimeFactory->new(Javonet::Sdk::Internal::ConnectionType::get_connection_type('InMemory'), undef, undef); } sub tcp { # additional shift is needed to pass second argument my $class = shift; my $address = shift; - return RuntimeFactory->new(Javonet::Sdk::Internal::ConnectionType::get_connection_type('Tcp'), $address); + return RuntimeFactory->new(Javonet::Sdk::Internal::ConnectionType::get_connection_type('Tcp'), $address, undef); +} + +sub with_config { + my ($self, $config_path) = @_; + # Sets the configuration source + Transmitter->set_config_source($config_path); + # Returns a new RuntimeFactory instance configured with a custom configuration file + return RuntimeFactory->new(Javonet::Sdk::Internal::ConnectionType::get_connection_type('WithConfig'), undef, $config_path); } 1; \ No newline at end of file