JuggerNET Runtime Library v3.6.54.0  3.6.54.0
Public Member Functions | Protected Member Functions | Properties | List of all members
Codemesh.JuggerNET.JuggerNETProxyException Class Reference

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...

Inheritance diagram for Codemesh.JuggerNET.JuggerNETProxyException:
Inheritance graph
[legend]
Collaboration diagram for Codemesh.JuggerNET.JuggerNETProxyException:
Collaboration graph
[legend]

Public Member Functions

 JuggerNETProxyException (JNIHandle jobject)
 
void Dispose ()
 
void Release ()
 Releases the connection between this proxy instance and the Java object without freeing the Java object. More...
 
override void GetObjectData (SerializationInfo info, StreamingContext context)
 
bool IsInstanceOf (JavaClass clazz)
 Returns true if the instance is type compatible with the given Java type. More...
 
bool IsSame (JavaProxy proxy)
 Returns true if the proxy instance wraps around the same Java object as the other proxy instance. More...
 
override bool Equals (object obj)
 Implemented in terms of the Java equals() method. If the other object is not also a subclass of a JavaObject, the return value is always false. This is to ensure that the the results of a comparison is independent of the order, i.e. More...
 
override Exception GetBaseException ()
 Returns the Exception that is the root cause of one or more subsequent exceptions. More...
 
override int GetHashCode ()
 Implemented in terms of the Java hashCode() method. More...
 
override string ToString ()
 Implemented in terms of the Java toString() method. More...
 

Protected Member Functions

 JuggerNETProxyException (string msg)
 
 JuggerNETProxyException (string msg, Exception exc)
 
 JuggerNETProxyException (SerializationInfo info, StreamingContext ctx)
 
 JuggerNETProxyException (JNIHandle jobject, bool bIsException, bool bIsError)
 The constructor that is used when we know the kind of Throwable that we're dealing with (Error or Exception) and are passing in the proper flags. More...
 
- Protected Member Functions inherited from Codemesh.JuggerNET.JuggerNETException
 JuggerNETException ()
 The default constructor. More...
 
 JuggerNETException (string msg)
 Creates an exception with a given message. More...
 
 JuggerNETException (string msg, Exception exc)
 Creates an exception with a given message and root cause. More...
 
 JuggerNETException (SerializationInfo info, StreamingContext ctx)
 Creates an exception from serialized data. More...
 

Properties

override bool IsFrameworkException [get]
 A readonly property that is true if the exception is due to an error in the JuggerNET framework, possibly due to a minsconfiguration or erroneous use of the JuggerNET API. More...
 
override bool IsProxyError [get]
 A readonly property that is true if the exception is due to an error that occurred while executing Java code. More...
 
override bool IsProxyException [get]
 A readonly property that is true if the exception is due to an exception that occurred while executing Java code. More...
 
long JObject [get, set]
 
long JObjectDuplicate [get]
 A property representing a duplicated JNI object handle. More...
 
HandleRef Handle [get]
 
new Exception InnerException [get]
 Gets the Java Exception instance that caused the current exception. More...
 
override string Message [get]
 
override string StackTrace [get]
 
- Properties inherited from Codemesh.JuggerNET.JuggerNETException
abstract bool IsFrameworkException [get]
 A readonly property that is true if the exception is due to an error in the JuggerNET framework, possibly due to a minsconfiguration or erroneous use of the JuggerNET API. More...
 
abstract bool IsProxyException [get]
 A readonly property that is true if the exception is due to an exception that occurred while executing Java code. More...
 
abstract bool IsProxyError [get]
 A readonly property that is true if the exception is due to an error that occurred while executing Java code. More...
 
- Properties inherited from Codemesh.JuggerNET.JavaProxy
long JObject [get, set]
 A property representing the JNI object handle. More...
 
HandleRef Handle [get]
 A property representing the JNI object handle. More...
 
long JObjectDuplicate [get]
 A property representing a duplicated JNI object handle. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from Codemesh.JuggerNET.JuggerNETException
static jvalue ToJavaException (System.Exception e)
 Returns a jvalue containing a Java exception instance, suitable for throwing into the JVM. If the passed in exception is a proxy exception, we simply set it into the result. If the passed in exception is a .NET exception, we take as much information as possible from it and create a Java RuntimeException that we set into the result. More...
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ JuggerNETProxyException()

Codemesh.JuggerNET.JuggerNETProxyException.JuggerNETProxyException ( JNIHandle  jobject,
bool  bIsException,
bool  bIsError 
)
inlineprotected

The constructor that is used when we know the kind of Throwable that we're dealing with (Error or Exception) and are passing in the proper flags.

Parameters
jobjectthe JNI object reference.
bIsExceptiontrue if the instance is assignable with Exception.
bIsErrortrue if the instance is assignable with Error.

Member Function Documentation

◆ Equals()

override bool Codemesh.JuggerNET.JuggerNETProxyException.Equals ( object  obj)
inline

Implemented in terms of the Java equals() method. If the other object is not also a subclass of a JavaObject, the return value is always false. This is to ensure that the the results of a comparison is independent of the order, i.e.

a.Equals( b ) == b.Equals( a )

which could not be guaranteed if we did special things for obj being of some special .NET type.

Parameters
objthe object we're comparing for equality.
Returns

◆ GetBaseException()

override Exception Codemesh.JuggerNET.JuggerNETProxyException.GetBaseException ( )
inline

Returns the Exception that is the root cause of one or more subsequent exceptions.

For proxy exception types, the base exception is the calculated by recursively invoking getCause() until we arrive at an exception that has a null cause or that has itself as the cause (simply to prevent the possiblity of infinite recursion).

Returns
The root exception.

◆ GetHashCode()

override int Codemesh.JuggerNET.JuggerNETProxyException.GetHashCode ( )
inline

Implemented in terms of the Java hashCode() method.

Returns
The object's Java hashcode.

◆ IsInstanceOf()

bool Codemesh.JuggerNET.JuggerNETProxyException.IsInstanceOf ( JavaClass  clazz)
inline

Returns true if the instance is type compatible with the given Java type.

Parameters
clazzthe Java type.
Returns

Implements Codemesh.JuggerNET.JavaProxy.

◆ IsSame()

bool Codemesh.JuggerNET.JuggerNETProxyException.IsSame ( JavaProxy  proxy)
inline

Returns true if the proxy instance wraps around the same Java object as the other proxy instance.

Parameters
proxyThe other proxy instance.
Returns
True if the two proxies reference the same Java object.

Implements Codemesh.JuggerNET.JavaProxy.

◆ Release()

void Codemesh.JuggerNET.JuggerNETProxyException.Release ( )
inline

Releases the connection between this proxy instance and the Java object without freeing the Java object.

Implements Codemesh.JuggerNET.JavaProxy.

◆ ToString()

override string Codemesh.JuggerNET.JuggerNETProxyException.ToString ( )
inline

Implemented in terms of the Java toString() method.

Returns
the string representation of the object.

Property Documentation

◆ InnerException

new Exception Codemesh.JuggerNET.JuggerNETProxyException.InnerException
get

Gets the Java Exception instance that caused the current exception.

This is the exception reported by the Java method getCause(). Please note that this property hides the Exception.InnerException property. If you invoke InnerException through an Exception instance, you will get the .NET version of the property. To get the Java version, you have to invoke the InnerException property through JuggerNETProxyException or one of its derived types. The following snippet illustrates this:

try
{
myProxyObject.MyMethod(); // throws a Java exception that has a cause (inner exception)
}
catch( Exception e )
{
Exception innerDotNet = e.InnerException;
Exception innerJava = (<b>(JavaProxyException)</b>e).InnerException;
Console.WriteLine( innerDotNet != null ? innerDotNet : "null" ); // reports null
Console.WriteLine( innerJava != null ? innerJava : "null" ); // reports the inner exception
}


◆ IsFrameworkException

override bool Codemesh.JuggerNET.JuggerNETProxyException.IsFrameworkException
get

A readonly property that is true if the exception is due to an error in the JuggerNET framework, possibly due to a minsconfiguration or erroneous use of the JuggerNET API.

◆ IsProxyError

override bool Codemesh.JuggerNET.JuggerNETProxyException.IsProxyError
get

A readonly property that is true if the exception is due to an error that occurred while executing Java code.

◆ IsProxyException

override bool Codemesh.JuggerNET.JuggerNETProxyException.IsProxyException
get

A readonly property that is true if the exception is due to an exception that occurred while executing Java code.

◆ JObjectDuplicate

long Codemesh.JuggerNET.JuggerNETProxyException.JObjectDuplicate
get

A property representing a duplicated JNI object handle.


The documentation for this class was generated from the following file:

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