JuggerNET Runtime Library v3.6.54.0  3.6.54.0
Classes | Enumerations | Functions
Codemesh.JuggerNET Namespace Reference

Classes

struct  access_struct
 A structure used to increase the performance of field accesses. By not marshaling all JNI arguments but rather only using an IntPtr to this structure, we gain a lot of performance benefits. More...
 
class  BasePeerMarshaller
 A baseclass that provides default implementations for the delegating versions of Marshal() and Unmarshal() and some utility methods. More...
 
class  boolArray
 The proxy type for the Java type boolean[] More...
 
class  BoolHolder
 A class used to represent a boolean value associated with a setting that can be referenced by other entities.
 
class  byteArray
 The proxy type for the Java type byte[] More...
 
struct  call_struct
 A structure used to increase the performance of method invocations. By not marshaling all JNI arguments but rather only using an IntPtr to this structure, we gain a lot of performance benefits. More...
 
struct  call_struct0
 <exclude>
 
struct  call_struct1
 <exclude>
 
class  charArray
 The proxy type for the Java type char[] More...
 
class  CollectionMarshaller
 <exclude> More...
 
class  COMErrorHelper
 A COM accessible type granting access to extended error information. More...
 
class  ConfigOptionAttribute
 An attribute used to signal that a property is a configuration setting. More...
 
class  DashDOptionType
 A type representing a -D option. More...
 
class  DashXOptionType
 A type representing a -X option. More...
 
class  Diagnostics
 This class provides facilities for the debugging of Java/.NET interoperability issues. It includes both a tracing and a memory debugging facility. Tracing can be controlled through a set of Switch instances that govern various groups of functionality. More...
 
class  doubleArray
 The proxy type for the Java type double[] More...
 
class  floatArray
 The proxy type for the Java type float[] More...
 
interface  ICOMErrorHelper
 An interface granting access to extended error information. More...
 
interface  IJvm
 The interface implemented by all JVMs. More...
 
interface  IJvmLoader
 The interface for explicitly configuring or loading a JVM. More...
 
interface  IJvmOptions
 An interface which defines the options that can be configured for a JVM. More...
 
class  intArray
 The proxy type for the Java type int[] More...
 
interface  IOptions
 An interface defining the framework options for JuggerNET. More...
 
interface  IPeerMarshaller
 The interface implemented by all peer marshallers/unmarshallers. More...
 
interface  IRemoteOptions
 An interface encapsulating the remote (shared JVM) options of JuggerNET. More...
 
class  IterableEnumerator
 
class  JavaClass
 The framework type wrapping around a Java type. More...
 
class  JavaField
 The framework type wrapping around a Java field. More...
 
class  JavaMethod
 The framework type wrapping around a Java method. More...
 
class  JavaMethodArguments
 
interface  JavaPeer
 The base interface for the .NET version of Java peer types. More...
 
class  JavaPeerAttribute
 An attribute used to signal that a type should be treated as a peer type. More...
 
class  JavaPeerValue
 Summary description for JavaPeerValue. More...
 
interface  JavaProxy
 An interface implemented by every type that is a proxy type for a Java type. It provides an abstraction layer for getting/setting Java object handles and for getting a duplicated object handle for the same object. More...
 
class  JavaProxyHelper
 A class that helps dealing with automatically converted .NET objects. We don't want to leak JNI references when passing .NET strings as arguments. In beta2, we correctly converted the System.String instances to Java strings, but nobody was responsible for the JNI handles and we created a nasty reference leak. This class helps by tracking such string instances and cleaning up the references when it is disposed of. More...
 
class  JavaProxyLockHolder
 Provides access to Java synchronization primitives. By declaring the instance in a using block, the .NET runtime will automatically and safely (in the presence of exceptions) enter and exit a critical section based on the specified Java object. More...
 
class  JavaProxyMonitor
 Provides access to Java synchronization primitives.

See also
Codemesh.JuggerNET.JavaProxyLockHolder
More...
 
struct  JNIHandle
 A value type used as an argument in framework constructors. We need to be able to create instances of proxy types from an existing JNI object reference. We could use an integer constructor, but then there might be a clash with a proxy constructor that takes integer arguments, so we use this type instead. More...
 
class  JSuperMapper
 <exclude>
 
class  JuggerNETException
 The baseclass for all exceptions related to JuggerNET. This includes two major subhierarchies, framework exceptions and proxy exceptions. Among proxy excpetions, it makes sense to distinguish between errors and exceptions. More...
 
class  JuggerNETFrameworkException
 The baseclass for all exceptions occuring in the JuggerNET framework, posibly due to a misconfiguration or due to programmer error. More...
 
class  JuggerNETInitAttribute
 An attribute used to signal that a type should be resolved when it is encountered in an assembly that is being loaded into the process. This property should be used on user-written types that perform an initialization activity in the static class initializer, for example the registration of a configuration hook. It is resolved by calling its static Init() method. More...
 
class  JuggerNETProxyArray
 The baseclass for all array types that are proxy types for Java types. More...
 
class  JuggerNETProxyException
 The baseclass for all exceptions that are proxy types for exceptions or errors thrown by the Java Runtime. This class cannot extend MarshalByRef because it has to be a descendent of Exception. As a consequence, we cannot really have a fully usable remote exception instance because invoking any Java methods will be meaningless in the remote context when the exception is passed there by value. To make it at least somewhat useful, we provide custom serialization/ deserialization methods that pass the stacktrace and the exception message to the other side. More...
 
class  JuggerNETProxyObject
 The baseclass for all non-exception types that are proxy types for Java types. More...
 
class  JuggerNETProxyTypeAttribute
 An attribute used to contain additional housekeeping information about the generated proxytype. More...
 
class  JuggerNETTraceSwitch
 A class that overrides the settings changed callback to inform the native library of a verbosity change event.
 
struct  jvalue
 <exclude> More...
 
class  Jvm
 The default implementation for the IJvm interface. You are unlikely to ever have to use these methods explicitly, unless you want to control in detail how .NET threads are attached to the Java virtual machine. More...
 
class  JvmLoader
 The class that acts as a factory for JVM instances. More...
 
class  JvmLoaderConfigurationException
 The class representing all exceptions that are thrown when there is a problem in the JvmLoader configuration.
More...
 
class  JvmLoaderException
 The baseclass for all exceptions that are thrown when there is a problem in the JvmLoader.
More...
 
class  JvmLoaderFactory
 A factory class for JvmLoader instances to be used from COM. More...
 
class  LifeCycleManager
 The LifeCycleManager class allows a user to manage the lifecycle of .NET and related instances better. This class has become necessary because of callbacks and the requirement that both the user-written callback and the generated callback instance be available and not finalized while the Java instance is dispatching callbacks to them. More...
 
class  longArray
 The proxy type for the Java type long[] More...
 
class  NativeInterface
 A utility class that deals with all interactions with the native side. More...
 
class  NJKey
 A class used as a key in mapping a type-tuple to another type. This class is represents the tuple of a .NET return type and a Java type represented by its classname and is used in the process of determining the most derived .NET type that is available to represent the concrete Java class.
 
class  NTypeValue
 A class used as a value and an object factory in the class type-mapping mechanism.
 
class  PeerManager
 A class that is used to manage PeerMarshallers. More...
 
class  PeerMarshalContext
 Summary description for PeerMarshalContext. More...
 
class  ProxyEnumerator
 An implementation of an IEnumerator that works with a Java Iterator or a
Java Enumeration as a backend. More...
 
class  ReflectionPeerValueMarshaller
 A marshaller that uses reflection to get/set properties. More...
 
class  shortArray
 The proxy type for the Java type short[] More...
 
class  TestSupport
 A class that offers various methods useful for testing various ugly conditions. More...
 

Enumerations

enum  Verbosity : int {
  None = 0, Class =1, GC =2, JNI =4,
  All =7
}
 The verbosity level of the JVM. More...
 
enum  TraceFacility : int {
  TraceFacility.TraceNothing = 0, TraceFacility.TraceJvm = 1, TraceFacility.TraceThread = 2, TraceFacility.TraceJni = 4,
  TraceFacility.TraceRemote = 8, TraceFacility.TraceAll = 15, TraceFacility.TraceEverything = 15
}
 An enumeration of facilities that the runtime library can provide runtime information about. You can bitwise OR the values together. More...
 
enum  TraceLevel : int {
  TraceLevel.TraceDisabled = 0, TraceLevel.TraceErrors = 1, TraceLevel.TraceError = 1, TraceLevel.TraceWarnings = 2,
  TraceLevel.TraceInfo = 3, TraceLevel.TraceFinest = 4, TraceLevel.TraceVerbose = 4, TraceLevel.TraceUnconditional = 5
}
 An enumeration of levels at which the runtime library can provide runtime information about tracing facilities. More...
 
enum  When {
  When.XMOG_BEFORE_INITIALIZATION = 0, When.XMOG_AFTER_INITIALIZATION = 1, When.XMOG_BEFORE_LOADING = 2, When.XMOG_AFTER_LOADING = 3,
  When.XMOG_BEFORE = XMOG_BEFORE_INITIALIZATION, When.XMOG_AFTER = XMOG_AFTER_INITIALIZATION
}
 Constants that are used by the ConfigurationHook delegate during JVM configuration. Each value represents a specific stage during the loader configuration. More...
 

Functions

delegate void AbortCallback ()
 The callback for VM abortion. More...
 
delegate void ExitCallback (int code)
 The callback for VM exit. More...
 
delegate int VfprintfCallback (string msg)
 The callback for redirecting all VM messages. More...
 
delegate void TraceCallback (int level, string msg)
 The callback for tracing. You can register your own trace method with the framework as long as it has this signature. More...
 
delegate System.Exception ExceptionHandlerCallback (System.Exception ex)
 The callback for exception handling. You can register your own exception handler to override the kind of excpetion that is being thrown or to perform additional logging before the exception is thrown. More...
 
delegate void ConfigurationHook (IJvmLoader loader, int when)
 A callback that will be invoked by the runtime library when the loader instance is being created. The assembly can then perform additional configuration operations. More...
 
delegate int GenericCallback (out int result_type, out jvalue result, IntPtr param)
 The callback used for Java classes that have to call into .NET within the context of a .NET process. More...
 

Enumeration Type Documentation

◆ TraceFacility

An enumeration of facilities that the runtime library can provide runtime information about. You can bitwise OR the values together.

Enumerator
TraceNothing 

Provided for completeness.

TraceJvm 

Trace all things related to the JVM (configuration, loading, etc.).

TraceThread 

Trace all things related to the attachment or detachment of threads.

TraceJni 

Trace all things related to JNI.

TraceRemote 

Trace all things related to remote Java (shared JVM) functionality.

TraceAll 

A bitwise ORed value of all other facilities. TraceFacility.TraceEverything

TraceEverything 

A bitwise ORed value of all other facilities. TraceFacility.TraceAll

◆ TraceLevel

enum Codemesh.JuggerNET.TraceLevel : int
strong

An enumeration of levels at which the runtime library can provide runtime information about tracing facilities.

The default trace level is usually TraceWarnings. When you're debugging misconfigurations, you will definitely want to go to TraceInfo because at that level the runtime reports its configuration arguments before attempting to load the JVM or connect to a server.

Enumerator
TraceDisabled 

Disable a trace facility totally.

TraceErrors 

Only trace severe errors for the facility.

TraceError 

Only trace severe errors for the facility.

TraceWarnings 

Only trace warnings or severe errors for the facility. This is the default level for all trace facilities.

TraceInfo 

Trace informative messages, warnings, and severe errors for the facility.

TraceFinest 

Trace all messages for the facility.

TraceVerbose 

Trace all messages for the facility.

TraceUnconditional 

Bypasses the applicability check.

◆ Verbosity

enum Codemesh.JuggerNET.Verbosity : int
strong

The verbosity level of the JVM.

◆ When

Constants that are used by the ConfigurationHook delegate during JVM configuration. Each value represents a specific stage during the loader configuration.

Enumerator
XMOG_BEFORE_INITIALIZATION 

Currently unused.

XMOG_AFTER_INITIALIZATION 

Indicates that the JvmLoader instance has just been created and the application writer's code that configures the laoder instance has not yet run.

Use this stage to create application defaults that can be overridden by the application developer.

XMOG_BEFORE_LOADING 

Indicates that JvmLoader.Load() is about to be called.

Use this stage to override or amend settings created by the application developer.

XMOG_AFTER_LOADING 

Indicates that JvmLoader.Load() has been called.

Use this stage to perform activities right after the JVM has been loaded but before any application Java code has had a chance to execute.

XMOG_BEFORE 

An alias for XMOG_BEFORE_INITIALIZATION.

XMOG_AFTER 

An alias for XMOG_AFTER_INITIALIZATION.

Function Documentation

◆ AbortCallback()

delegate void Codemesh.JuggerNET.AbortCallback ( )

The callback for VM abortion.

◆ ConfigurationHook()

delegate void Codemesh.JuggerNET.ConfigurationHook ( IJvmLoader  loader,
int  when 
)

A callback that will be invoked by the runtime library when the loader instance is being created. The assembly can then perform additional configuration operations.

Your registered ConfigurationHook will be called with the singleton IJvmLoader instance as the loader argument and with one of the When values to indicate the stage at which the loading process is. Write your configuration hook in a way that won't cause problems if it gets invoked multiple times.

The following snippet can be added to an assembly containing proxy types to automatically configure the Java runtime environment without the assembly user having to do anything special.

// marking the type as JuggerNETInit will cause its Init() method to
// be called when the assembly in which it resides is loaded
[JuggerNETInit]
public class HookRegistrar
{
public static void ConfigMethod( IJvmLoader loader, int when )
{
// this block is executed after config files (if any) have been read
if( (When)when == When.XMOG_AFTER_INITIALIZATION )
{
// append the current directory to the classpath
loader.AppendToClassPath( "." );
// set a maximum heapsize of 256MB unless the user configured something larger
if( loader.MaximumHeapSizeInMB < 256 )
loader.MaximumHeapSizeInMB = 256;
}
// this block is executed just before the JVM is loaded
// and in this example is used to print some stats to the console
else if( (When)when == When.XMOG_BEFORE_LOADING )
{
Console.WriteLine( "JvmPath=" + loader.JvmPath );
if( loader.ClassPath != null && loader.ClassPath.Length > 0 )
Console.WriteLine( "ClassPath=" + loader.ClassPath );
}
}
public static void Init()
{
JvmLoader.RegisterConfigurationHook( new ConfigurationHook( ConfigMethod ) );
}
}

◆ ExceptionHandlerCallback()

delegate System.Exception Codemesh.JuggerNET.ExceptionHandlerCallback ( System.Exception  ex)

The callback for exception handling. You can register your own exception handler to override the kind of excpetion that is being thrown or to perform additional logging before the exception is thrown.

Parameters
exThe exception that would be thrown by the JuggerNET framework.
Returns
The exception that you wish to throw.

◆ ExitCallback()

delegate void Codemesh.JuggerNET.ExitCallback ( int  code)

The callback for VM exit.

◆ GenericCallback()

delegate int Codemesh.JuggerNET.GenericCallback ( out int  result_type,
out jvalue  result,
IntPtr  param 
)

The callback used for Java classes that have to call into .NET within the context of a .NET process.

◆ TraceCallback()

delegate void Codemesh.JuggerNET.TraceCallback ( int  level,
string  msg 
)

The callback for tracing. You can register your own trace method with the framework as long as it has this signature.

Parameters
levelThe trace level for the message.
msgThe message.

◆ VfprintfCallback()

delegate int Codemesh.JuggerNET.VfprintfCallback ( string  msg)

The callback for redirecting all VM messages.

Codemesh.JuggerNET.ConfigurationHook
delegate void ConfigurationHook(IJvmLoader loader, int when)
A callback that will be invoked by the runtime library when the loader instance is being created....
Codemesh.JuggerNET.When
When
Constants that are used by the ConfigurationHook delegate during JVM configuration....
Definition: JvmLoader.cs:75

Copyright (c) 1999-2020 by Codemesh, Inc., ALL RIGHTS RESERVED.