Main Page | Modules | Class Hierarchy | Class List | Directories | File List | Class Members | Related Pages

xmog_exception_impl Class Reference
[Error Handling]

The type that is used when the GenericException policy is in effect or for exceptions epresenting framework exceptions that are not based on Java exceptions. More...

#include <xmog_exception.h>

Inheritance diagram for xmog_exception_impl:

Inheritance graph
[legend]
Collaboration diagram for xmog_exception_impl:

Collaboration graph
[legend]
List of all members.

Public Member Functions

int get_error_code ()
 Returns the error code.
virtual char * get_message_chars (xmog_localenv *env=NULL, xmog_base *enc=NULL)
 Returns the error message for this instance.
virtual unsigned short * get_message_u16 (xmog_localenv *env=NULL)
 Returns the error message for this instance.
 xmog_exception_impl (int error_code, jthrowable t, xmog_flags flags=xmog_base::GLOBAL)
 Creates a new exception instance with the given error code and a Java exception instance.
 xmog_exception_impl (int error_code, const XMOG_WCHAR *msg)
 Creates a new exception instance with the given error code and error message.
 xmog_exception_impl (int error_code, const char *msg=NULL)
 Creates a new exception instance with the given error code and optional error message.
 ~xmog_exception_impl ()
 Cleans up behind the exception instance.

Detailed Description

The type that is used when the GenericException policy is in effect or for exceptions epresenting framework exceptions that are not based on Java exceptions.

Sometimes, it is desirable to not throw typed exceptions, but to just have one generic exception type that is used for all types of exceptional events. This is the type that is used under those conditions.


Constructor & Destructor Documentation

xmog_exception_impl::xmog_exception_impl int  error_code,
const char *  msg = NULL
 

Creates a new exception instance with the given error code and optional error message.

This constructor is used for framework exceptions that are not "backed" by and underlying Java exception. An example of a framework exception might be the framework's inability to load a JVM.

Parameters:
error_code the error condition represented by this instance.
msg the error message represented by this instance. May be NULL.

xmog_exception_impl::xmog_exception_impl int  error_code,
const XMOG_WCHAR *  msg
 

Creates a new exception instance with the given error code and error message.

This constructor is used for framework exceptions that are not "backed" by and underlying Java exception. An example of a framework exception might be the framework's inability to load a JVM.

Parameters:
error_code the error condition represented by this instance.
msg the error message represented by this instance.

xmog_exception_impl::xmog_exception_impl int  error_code,
jthrowable  t,
xmog_flags  flags = xmog_base::GLOBAL
 

Creates a new exception instance with the given error code and a Java exception instance.

This constructor is used for exceptions that are "backed" by a Java exception when the GenericException policy is in effect.

Parameters:
error_code the error condition represented by this instance.
t the reference to the Java exception that was thrown.
flags the type of Java reference.


Member Function Documentation

virtual char* xmog_exception_impl::get_message_chars xmog_localenv env = NULL,
xmog_base enc = NULL
[virtual]
 

Returns the error message for this instance.

The caller is responsible for cleaning up the returned string by calling xmog_util::free() or xmog_util::setString().

Parameters:
env the local call environment. May be NULL.
enc the optional encoding to be used. Use one of the encodings in the xmog_java_string class.
Returns:
the exception message, owned by the caller.

Reimplemented from xmog_exception.

virtual unsigned short* xmog_exception_impl::get_message_u16 xmog_localenv env = NULL  )  [virtual]
 

Returns the error message for this instance.

The caller is responsible for cleaning up the returned string by calling xmog_util::free() or xmog_util::setString().

Parameters:
env the local call environment. May be NULL.
Returns:
the exception message, owned by the caller.

Reimplemented from xmog_exception.


The documentation for this class was generated from the following file:
Generated on Fri Jun 16 10:19:03 2006 for JMS Courier for C++ by  doxygen 1.4.1