All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.javonet.sdk.Javonet Maven / Gradle / Ivy

Go to download

Javonet allows you to reference and use modules or packages written in (Java/Kotlin/Groovy/Clojure, C#/VB.NET, Ruby, Perl, Python, JavaScript/TypeScript) like they were created in your technology. It works on Linux/Windows and MacOS for applications created in JVM, CLR/Netcore, Perl, Python, Ruby, NodeJS, C++ or GoLang and gives you unparalleled freedom and flexibility with native performance in building your mixed-technologies products. Let it be accessing best AI or cryptography libraries, devices SDKs, legacy client modules, internal custom packages or anything from public repositories available on NPM, Nuget, PyPI, Maven/Gradle, RubyGems or GitHub. Get free from programming languages barriers today! For more information check out our guides at https://www.javonet.com/guides/v2/

There is a newer version: 2.4.5
Show newest version
package com.javonet.sdk;

import com.javonet.core.transmitter.Transmitter;
import com.javonet.utils.BinariesUnloader;
import com.javonet.utils.ConnectionType;
import com.javonet.utils.TcpConnectionData;

/**
 * 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.
 *
 * @see article
 * on Javonet Guides
 */
public final class Javonet {
    static {
        BinariesUnloader.extractNativeFromJar();
        //BinariesUnloader.extractBinariesFromJar(RuntimeName.Jvm);
        activate();
    }

    /**
     * Initializes Javonet using an in-memory channel on the same machine.
     *
     * @return a RuntimeFactory instance configured for an in-memory connection.
     * @see Article
     * on Javonet Guides
     */
    public static RuntimeFactory inMemory() {
        return new RuntimeFactory(ConnectionType.IN_MEMORY, null);
    }

    /**
     * Initializes Javonet with a TCP connection to a remote machine.
     *
     * @param address the address of the remote machine.
     * @return a RuntimeFactory instance configured for a TCP connection.
     * @see Article
     * on Javonet Guides
     */
    public static RuntimeFactory tcp(TcpConnectionData address) {
        return new RuntimeFactory(ConnectionType.TCP, address);
    }

    /**
     * Initializes Javonet with a configuration taken from external source.
     * Currently supported: Configuration file in JSON format
     *
     * @param path path to configuration file.
     * @return a ConfigRuntimeFactory instance with configuration data.
     * @see Article
     * on Javonet Guides
     */
    public static ConfigRuntimeFactory withConfig(String path) {
        Transmitter.setConfigSource(path);
        return new ConfigRuntimeFactory(path);
    }

    /**
     * Activates Javonet with the provided license key. License key can be obtained
     * from the Javonet website: https://www.javonet.com
     *
     * @param licenseKey the license key to activate Javonet.
     * @return the activation status code.
     * @see Article
     * on Javonet Guides
     */
    public static int activate(String licenseKey) {
        return Transmitter.activateWithCredentials(licenseKey);
    }

    /**
     * Activates Javonet with the provided license key and proxy host. License key
     * can be obtained from the Javonet website: https://www.javonet.com
     *
     * @param licenseKey the license key to activate Javonet.
     * @param proxyHost  the host for the proxy server.
     * @return the activation status code.
     * @see Article
     * on Javonet Guides
     */
    public static int activate(String licenseKey, String proxyHost) {
        return Transmitter.activateWithCredentialsAndProxy(licenseKey, proxyHost, "", "");
    }

    /**
     * Activates Javonet with the provided license key, proxy host, and proxy
     * credentials.
     *
     * @param licenseKey    the license key to activate Javonet.
     * @param proxyHost     the host for the proxy server.
     * @param proxyUserName the username for the proxy server.
     * @param proxyPassword the password for the proxy server.
     * @return the activation status code.
     * @see Article
     * on Javonet Guides
     */
    public static int activate(String licenseKey, String proxyHost, String proxyUserName, String proxyPassword) {
        return Transmitter.activateWithCredentialsAndProxy(licenseKey, proxyHost, proxyUserName, proxyPassword);
    }

    private static int activate() {
        return Transmitter.activateWithLicenseFile();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy