Table of Contents

Class JNetCoreBase<T>

Namespace
MASES.JNet
Assembly
MASES.JNet.dll

Public entry point of JNetCoreBase<T>

public abstract class JNetCoreBase<T> : SetupJVMWrapper<T>, IJVMWrapperManagement, IJVMBridgeCore where T : JNetCoreBase<T>

Type Parameters

T
Inheritance
JNetCoreBase<T>
Implements
Derived
Inherited Members
SetupJVMWrapper<T>.ScopedOn
SetupJVMWrapper<T>.ScopedOnVersion
SetupJVMWrapper.Initialize()
SetupJVMWrapper.InitializeRemote()
Extension Methods

Constructors

JNetCoreBase()

Public ctor

public JNetCoreBase()

Fields

JARsSubFolder

The path where JARs are stored

public const string JARsSubFolder = "jars"

Field Value

string

Parser

Command line Parser instance

protected static readonly Parser Parser

Field Value

Parser

Properties

ApplicationDebugSuspendFlag

Sets the value of DebugSuspendFlag

public static string ApplicationDebugSuspendFlag { get; set; }

Property Value

string

ApplicationEnableDebug

Sets the value of EnableDebug

public static bool? ApplicationEnableDebug { get; set; }

Property Value

bool?

ApplicationHeapSize

Sets the global value of GlobalHeapSize

public static string ApplicationHeapSize { get; set; }

Property Value

string

ApplicationInitialHeapSize

Sets the global value of the InitialHeapSize

public static string ApplicationInitialHeapSize { get; set; }

Property Value

string

ApplicationJDKHome

Sets the value of JDKHome

public static string ApplicationJDKHome { get; set; }

Property Value

string

ApplicationJNIOutputFile

Sets the value of JNIOutputFile

public static string ApplicationJNIOutputFile { get; set; }

Property Value

string

ApplicationJNIVerbosity

Sets the value of JNIVerbosity

public static string ApplicationJNIVerbosity { get; set; }

Property Value

string

ApplicationJVMExtraOptions

Generic extra options to be used from JVM

public static IDictionary<string, string> ApplicationJVMExtraOptions { get; }

Property Value

IDictionary<string, string>

ApplicationJVMPath

Sets the value of JVMPath

public static string ApplicationJVMPath { get; set; }

Property Value

string

ApplicationJavaDebugOpts

Sets the value of JavaDebugOpts

public static string ApplicationJavaDebugOpts { get; set; }

Property Value

string

ApplicationJavaDebugPort

Sets the value of JavaDebugPort

public static short? ApplicationJavaDebugPort { get; set; }

Property Value

short?

ApplicationJmxPort

Sets the value of JmxPort

public static short? ApplicationJmxPort { get; set; }

Property Value

short?

ApplicationLicensePath

Sets the value of LicensePath

public static string ApplicationLicensePath { get; set; }

Property Value

string

ApplicationLogClassPath

Sets the global value of the log class path

public static bool? ApplicationLogClassPath { get; set; }

Property Value

bool?

ApplicationWriteEventOrExceptionOnCmdLine

Sets the global value to show events from the underlying JCOBridge engine

public static bool? ApplicationWriteEventOrExceptionOnCmdLine { get; set; }

Property Value

bool?

ClassPath

The starting JVM class path. Further path can be added later.

public override sealed string ClassPath { get; }

Property Value

string

Remarks

It is not the same classpath switch available in CLI. No wildcards expansion is made at this level. Use ClassPathBuilder in this case.

CommandLineArguments

IEnumerable<T> for command line

public virtual IEnumerable<IArgumentMetadata> CommandLineArguments { get; }

Property Value

IEnumerable<IArgumentMetadata>

DebugSuspendFlag

Enables Debug

public override string DebugSuspendFlag { get; }

Property Value

string

EnableDebug

Enables Debug

public override bool EnableDebug { get; }

Property Value

bool

EventOrExceptionEvent

Set the handler to receive events raised from the underlying JCOBridge engine; see SetEventOrExceptionHandler(EventHandler<EventOrExceptionEventArgs>)

public Action<EventOrExceptionEventArgs> EventOrExceptionEvent { get; set; }

Property Value

Action<EventOrExceptionEventArgs>

GlobalHeapSize

Sets the global heap size

public override string GlobalHeapSize { get; }

Property Value

string

InitialHeapSize

Sets the initial heap size

public override string InitialHeapSize { get; }

Property Value

string

JDKHome

The path where is located the JRE of the installed JDK

public override string JDKHome { get; }

Property Value

string

JNIOutputFile

The path where the JNI verbose info will be written. The file will be opened in append mode.

public override string JNIOutputFile { get; }

Property Value

string

JNIVerbosity

Sets the verbosity of the JNI interface. See oracle documentation.

public override string JNIVerbosity { get; }

Property Value

string

JVMOptions

The options to pass to the JVM when a JVM will be created

public override sealed IEnumerable<KeyValuePair<string, string>> JVMOptions { get; }

Property Value

IEnumerable<KeyValuePair<string, string>>

JVMPath

The path to the JRE ennvironment or full path to (jvm.dll/libjvm.so). If not set the library try to find a suitable version on the system.

public override string JVMPath { get; }

Property Value

string

JavaDebugOpts

Java Debug options used if EnableDebug is true

public override string JavaDebugOpts { get; }

Property Value

string

JavaDebugPort

Java Debug Port

public override short JavaDebugPort { get; }

Property Value

short

JmxPort

The JMX Port to use

public override short? JmxPort { get; }

Property Value

short?

LicensePath

The path where is located the license file

public override string LicensePath { get; }

Property Value

string

LogClassPath

Set to true to print ClassPath

public virtual bool LogClassPath { get; }

Property Value

bool

Options

Adds options to the JVM

protected abstract IDictionary<string, string> Options { get; }

Property Value

IDictionary<string, string>

ParsedArgs

Arguments parsed

public IEnumerable<IArgumentMetadataParsed> ParsedArgs { get; }

Property Value

IEnumerable<IArgumentMetadataParsed>

PathToParse

A list of paths to be used in initialization of JVM ClassPath

protected virtual IList<string> PathToParse { get; }

Property Value

IList<string>

WriteEventOrExceptionOnCmdLine

Set to true to show events from the underlying JCOBridge engine

public virtual bool WriteEventOrExceptionOnCmdLine { get; }

Property Value

bool

Methods

AddJVMOption(string, string)

Adds jvmOptionName, with optional jvmOptionValue, to ApplicationJVMExtraOptions

public static void AddJVMOption(string jvmOptionName, string jvmOptionValue = null)

Parameters

jvmOptionName string

The JVM option name

jvmOptionValue string

The value of jvmOptionName if it is an option like name=value

EventOrExceptionHandler(EventOrExceptionEventArgs)

Manages events raised from the underlying JCOBridge engine; see SetEventOrExceptionHandler(EventHandler<EventOrExceptionEventArgs>)

protected virtual void EventOrExceptionHandler(EventOrExceptionEventArgs e)

Parameters

e EventOrExceptionEventArgs

The EventOrExceptionEventArgs with information

HelpInfo(int?)

public static string HelpInfo(int? width = null)

Parameters

width int?

Returns

string

Launch(Type, params string[])

Launch the type with the args arguments

public static void Launch(Type type, params string[] args)

Parameters

type Type

The Type extending IJVMBridgeMain

args string[]

The arguments of the main method

LaunchWithFilteredArgs(Type)

Launch the type with the FilteredArgs arguments

public static void LaunchWithFilteredArgs(Type type)

Parameters

type Type

The Type extending IJVMBridgeMain

LaunchWithFilteredArgs<TClass>()

Launch the TClass class with the FilteredArgs arguments

public static void LaunchWithFilteredArgs<TClass>() where TClass : IJVMBridgeMain

Type Parameters

TClass

A type which is defined as Main-Class

Launch<TClass>(params string[])

Launch the TClass class with the args arguments

public static void Launch<TClass>(params string[] args) where TClass : IJVMBridgeMain

Parameters

args string[]

The arguments of the main method

Type Parameters

TClass

A type which is defined as Main-Class

New(string)

Retrieve the object associated to className

public static dynamic New(string className)

Parameters

className string

The java class to be instantiated

Returns

dynamic

The instance associated to the requested className

New(string, params object[])

Retrieve the object associated to className

public static dynamic New(string className, params object[] args)

Parameters

className string

The java class to be instantiated

args object[]

The argument of the costructor

Returns

dynamic

The instance associated to the requested className

PreInitialization(ref string, ref Version)

Override the method to setup some information, this is the first virtual method invoked: some settings can be applied here like SetEventOrExceptionHandler(EventHandler<EventOrExceptionEventArgs>)

protected override void PreInitialization(ref string scopeOn, ref Version scopeOnVersion)

Parameters

scopeOn string

The value to return to override the value of MASES.JCOBridge.C2JBridge.SetupJVMWrapper.ScopedOn

scopeOnVersion Version

The value to return to override the value of MASES.JCOBridge.C2JBridge.SetupJVMWrapper.ScopedOnVersion

ProcessCommandLine()

Process command line arguments

protected override string[] ProcessCommandLine()

Returns

string[]

The filtered residual arguments

ReplaceEnvironmentVariable(string)

Replace environment variable in item

public static string ReplaceEnvironmentVariable(string item)

Parameters

item string

The string where the environemnt variables shall be replaced

Returns

string

The string with replaced environment varibales

Remarks

Each environment variable is expected in the form $(ENV_VAR)