public class Javonet
extends java.lang.Object
activate(String, String, JavonetFramework)
method or specifying your
license details in Javonet XML configuration file.
Javonet.activate("your@mail.com", "your-javonet-license-key");
NObject objRandom = Javonet.New("System.Random");
Integer value = objRandom.invoke("Next",10,20);
System.out.println(value);
Constructor and Description |
---|
Javonet() |
Modifier and Type | Method and Description |
---|---|
static boolean |
activate(java.lang.String oemLicenceKey,
JavonetFramework framework)
Activates Javonet copy with OEM license details.
|
static boolean |
activate(java.lang.String email,
java.lang.String licenceKey,
JavonetFramework framework)
Activates Javonet copy with your license details.
|
static boolean |
activate(java.lang.String email,
java.lang.String licenceKey,
java.lang.String proxyHost,
JavonetFramework framework)
Activates Javonet copy with your license details.
|
static boolean |
activate(java.lang.String email,
java.lang.String licenceKey,
java.lang.String proxyHost,
java.lang.String proxyUsername,
java.lang.String proxyPassword,
JavonetFramework framework)
Activates Javonet copy with your license details.
|
static boolean |
activate(java.lang.String email,
java.lang.String licenceKey,
java.lang.String proxyHost,
java.lang.String proxyUsername,
java.lang.String proxyPassword,
java.lang.String proxyDomain,
JavonetFramework framework,
java.lang.String relay)
Activates Javonet copy with your license details.
|
static void |
addReference(java.lang.String... pathOrName)
Loads .NET library or libraries into memory on .NET side.
|
static void |
addReference(java.lang.String name,
byte[] dotNetAssemblyByteArray)
Loads .NET library from byte array into memory on .NET side.
|
static void |
addReference(java.lang.String name,
java.lang.Byte[] dotNetAssemblyByteArray)
Loads .NET library from byte array into memory on .NET side.
|
static NObject |
create(java.lang.String typeName)
Creates new instance of .NET class using parameter-less constructor specified by provided type name and located in any of the loaded assemblies.
|
static NObject |
create(java.lang.String typeName,
java.lang.Object... parameters)
Creates new instance of .NET class using constructor with parameters specified by provided type name and located in any of the loaded assemblies.
|
static void |
Dispose()
Disposes Javonet session.
|
static JavonetFramework |
getFramework()
Returns current .NET Framework version that is being used by Javonet.
|
static com.javonet.internal.IGateway |
getGateway()
Returns current gateway session object.
|
static NType |
getType(java.lang.String typeName)
Loads specified type on .NET side and returns new instance of NType class connected to this type.
|
static NType |
getType(java.lang.String typeName,
java.lang.Object... genericTypes)
Loads specified generic type on .NET side and returns new instance of NType class connected to this type.
|
static boolean |
getUseLegacyExceptions()
Returns if Javonet is working in legacy exceptions mode or new NException mode.
|
static boolean |
getUsePrivateHandleField()
Returns information if Javonet is using the private handles field mode for strongly
typed wrappers.
|
static boolean |
isActivated()
Returns true or false indicating if Javonet engine has been activated
and configured in the current process.
|
static NObject |
New(java.lang.String typeName)
Creates new instance of .NET class using parameter-less constructor specified by provided type name and located in any of the loaded assemblies.
|
static NObject |
New(java.lang.String typeName,
java.lang.Object... parameters)
Creates new instance of .NET class using constructor with parameters specified by provided type name and located in any of the loaded assemblies.
|
static NAssembly |
reference(java.lang.String pathOrName)
Loads .NET library and returns instance of associated NAssembly object.
|
static void |
setActivationRelay(java.lang.String relayUrl,
java.lang.String relaySignature)
Sets the custom URL that will be used for processing activation requests.
|
static void |
setApartmentState(JavonetApartmentState apartmentState)
Sets apartment state for .NET process main thread.
|
static void |
setDependencyPath(java.lang.String name,
java.lang.String path)
Defines fixed path for dependent DLL which is being dynamically loading by .NET code.
|
static void |
setLicenseDirectory(java.lang.String licenseDirectory)
Sets the absolute path where the Javonet license files should be stored.
|
static void |
setUseHardwareKey(boolean useHardwareKey)
Sets if the Javonet should use hardware key as a source of machine ID
for license verification.
|
static void |
setUseLegacyExceptions(boolean value)
Sets if Javonet is working in legacy exceptions mode or new NException mode.
|
static void |
setUsePrivateHandleField(boolean value)
Sets if Javonet should use the private handles field mode for strongly typed wrappers.
|
static void |
showWelcomeMessage()
Prints on console Javonet Welcome message.
|
public static boolean activate(java.lang.String oemLicenceKey, JavonetFramework framework) throws JavonetException
oemLicenceKey
- Your OEM license keyframework
- .NET Framework version to be used read more at JavonetFramework
JavonetException
- If exception occurs during activationpublic static boolean activate(java.lang.String email, java.lang.String licenceKey, JavonetFramework framework) throws JavonetException
email
- Your license key email addresslicenceKey
- Your license keyframework
- .NET Framework version to be used read more at JavonetFramework
JavonetException
- If exception occurs during activationpublic static boolean activate(java.lang.String email, java.lang.String licenceKey, java.lang.String proxyHost, JavonetFramework framework) throws JavonetException
email
- Your license key email addresslicenceKey
- Your license keyproxyHost
- Proxy host name in format HOST:PORT or IP:PORTframework
- .NET Framework version to be used read more at JavonetFramework
JavonetException
- If exception occurs during activationpublic static boolean activate(java.lang.String email, java.lang.String licenceKey, java.lang.String proxyHost, java.lang.String proxyUsername, java.lang.String proxyPassword, JavonetFramework framework) throws JavonetException
email
- Your license key email addresslicenceKey
- Your license keyproxyHost
- Proxy host name in format HOST:PORT or IP:PORTproxyUsername
- Username to be used for proxy authenticationproxyPassword
- Password to be used for proxy authenticationframework
- .NET Framework version to be used read more at JavonetFramework
JavonetException
- If exception occurs during activationpublic static boolean activate(java.lang.String email, java.lang.String licenceKey, java.lang.String proxyHost, java.lang.String proxyUsername, java.lang.String proxyPassword, java.lang.String proxyDomain, JavonetFramework framework, java.lang.String relay) throws JavonetException
email
- Your license key email addresslicenceKey
- Your license keyproxyHost
- Proxy host name in format HOST:PORT or IP:PORTproxyUsername
- Username to be used for proxy authenticationproxyPassword
- Password to be used for proxy authenticationproxyDomain
- User domain to be used for proxy authenticationframework
- .NET Framework version to be used read more at JavonetFramework
JavonetException
- If exception occurs during activationpublic static void addReference(java.lang.String... pathOrName) throws JavonetException
pathOrName
- List of .NET assemblies paths or full assembly names to be loadedJavonetException
- If .NET exception occurs during while loading assemblypublic static void addReference(java.lang.String name, byte[] dotNetAssemblyByteArray) throws JavonetException
addReference(String, Byte[])
.name
- Name of the library provided in second argument.dotNetAssemblyByteArray
- Byte Array of an assembly to be loaded.JavonetException
- If .NET exception occurs during while loading assemblypublic static void addReference(java.lang.String name, java.lang.Byte[] dotNetAssemblyByteArray) throws JavonetException
name
- Name of the library provided in second argument.dotNetAssemblyByteArray
- Byte Array of an assembly to be loaded.JavonetException
- If .NET exception occurs during while loading assemblypublic static NObject create(java.lang.String typeName) throws JavonetException
typeName
- Name of the type for which new instance should be createdJavonetException
- If .NET exception occurs during initialization of .NET objectpublic static NObject create(java.lang.String typeName, java.lang.Object... parameters) throws JavonetException
typeName
- Name of the type for which new instance should be createdparameters
- Parameters to be passed to constructor during creation of new instance of associated .NET typeJavonetException
- If .NET exception occurs during initialization of .NET objectpublic static void Dispose()
public static JavonetFramework getFramework()
activate(String, String, JavonetFramework)
method
or setting "framework" property in "settings" section of javonet.xml configuration file.public static com.javonet.internal.IGateway getGateway() throws JavonetException
JavonetException
- If exception occurs during gateway initializationpublic static NType getType(java.lang.String typeName) throws JavonetException
typeName
- Name of the type to be loadedJavonetException
- If .NET exception occurs during .NET type loadingpublic static NType getType(java.lang.String typeName, java.lang.Object... genericTypes) throws JavonetException
typeName
- Name of the type to be loadedgenericTypes
- List of generic types used to parameterize this generic type instanceJavonetException
- If .NET exception occurs during .NET type loadingpublic static boolean getUseLegacyExceptions()
public static boolean getUsePrivateHandleField()
https://www.javonet.com/java-devs/guides/
public static boolean isActivated()
public static NObject New(java.lang.String typeName) throws JavonetException
create(String)
and was created to provide more semantically meaningful usage.typeName
- Name of the type for which new instance should be createdJavonetException
- If .NET exception occurs during initialization of .NET objectpublic static NObject New(java.lang.String typeName, java.lang.Object... parameters) throws JavonetException
create(String, Object...)
and was created to provide more semantically meaningful usage.
typeName
- Name of the type for which new instance should be createdparameters
- Parameters to be passed to constructor during creation of new instance of associated .NET typeJavonetException
- If .NET exception occurs during initialization of .NET objectpublic static NAssembly reference(java.lang.String pathOrName) throws JavonetException
pathOrName
- Full path or full assembly nameJavonetException
- If .NET exception occurs during while loading assemblypublic static void setActivationRelay(java.lang.String relayUrl, java.lang.String relaySignature)
relayUrl
- Target url for activation processing i.e. https://ads.sdncenter.plrelaySignature
- Url signature in base64 formatpublic static void setApartmentState(JavonetApartmentState apartmentState) throws JavonetException
apartmentState
- Apartment state to be setJavonetException
- If exception occurs while setting apartment statepublic static void setDependencyPath(java.lang.String name, java.lang.String path) throws JavonetException
name
- Name of the library for which the path will be specified. In example MyProject.Commons.path
- Path to the DLL file that will be set as fixed location for library specified.JavonetException
- If .NET exception occurs while specifying fixed registrationpublic static void setLicenseDirectory(java.lang.String licenseDirectory)
licenseDirectory
- path for Javonet license filespublic static void setUseHardwareKey(boolean useHardwareKey) throws JavonetException
useHardwareKey
- flag if hardware dongle key should be used as source of machine id.JavonetException
- thrown if method is called after activate methodpublic static void setUseLegacyExceptions(boolean value)
value
- true or false indicating if legacy exceptions should be used.public static void setUsePrivateHandleField(boolean value)
https://www.javonet.com/java-devs/guides/
value
- true or false indicating if private handles fields mode should be used.public static void showWelcomeMessage()