#include <xmog_localenv.h>
Collaboration diagram for xmog_localenv:

Public Member Functions | |
| xmog_localenv (xmog_jvm *jvm, JNIEnv *env=NULL) | |
| void | in_delete (bool bInDelete) |
Sets the value of the bInDelete_ field. | |
| bool | in_delete () |
Returns the value of the bInDelete_ field. | |
| void | in_detach (bool bInDetach) |
Sets the value of the bInDetach_ field. | |
| bool | in_detach () |
Returns the value of the bInDetach_ field. | |
| void | in_exception (bool bInException) |
Sets the value of the bInException_ field. | |
| bool | in_exception () |
Returns the value of the bInException_ field. | |
| xmog_jvm * | getJvm () |
| Returns the xmog_jvm pointer that represents the JVM to which this local environment instance belongs. | |
| JNIEnv * | getJNIEnv () |
| Returns the JNIEnv pointer this local environment wraps around. | |
| JNIEnv * | getEnv () |
| Returns the JNIEnv pointer this local environment wraps around. | |
| JavaVM * | getJavaVM () |
| Returns the JavaVM pointer that represents the JVM to which this thread is attached. | |
| jint | getJNIVersion () |
| Returns the JNI version of the JVM to which this thread is attached. | |
| void | setDefaultEncoding (xmog_base *_enc) |
| Sets the default string encoding that is used when native strings are converted to Java strings. | |
| xmog_base * | getDefaultEncoding () |
| Returns the default string encoding that is used when native strings are converted to Java strings. | |
| void | set_error_handler (xmog_error_handler *_eh) |
| Sets the error handler that will be used for this local environment. | |
| xmog_error_handler * | get_error_handler () |
| Returns the error handler that's used for this local environment. | |
| void * | operator new (size_t) |
| The overloaded operator new. | |
| void | operator delete (void *) |
Static Public Member Functions | |
| static xmog_localenv * | get_instance (xmog_localenv *env) |
| Returns a local environment. | |
| static xmog_localenv * | get_instance (JNIEnv *env) |
| Returns a local environment for the JNIEnv pointer that is passed in. | |
| static xmog_localenv * | get_localenv (JNIEnv *, XMOGVERSION, XMOGCONFIG, XMOGVERSION, const char *, jint) |
| Returns a local environment. | |
This class provides the necessary abstraction that allows us to support both in-process and out-of-process integration easily. Using APIs provided by this class rather than the internally maintained JNIEnv pointer will greatly improve performance in some scenarios.
This class also maintains several default settings that are, by virtue of this class only being used in a thread-local fashion, per thread settings. The errorhandling policy and the string default encoding are probably the most important of these thread-local settings.
|
|
Returns the error handler that's used for this local environment. Error handlers are thread specific because a programmer must be able to adjust the errorhandling policy in one thread without affecting the entire application. |
|
|
Returns a local environment for the JNIEnv pointer that is passed in. While the thread does not have to be attached to the JVM anymore (after all, we already have a JNIEnv pointer), we might need to perform the framework initialization for the thread. This method is useful in the context of manually implemented native methods, when you want to get a local call environment pointer in the context of a native method call.
|
|
|
Returns a local environment. Attaches the thread if necessary by calling xmog_jvm::attach().
|
|
||||||||||||||||||||||||||||
|
Returns a local environment. This method is only supplied to provide already written C++ code with an easier migration path to the 3.0 version of the runtime library. Use the get_instance() method instead when you're writing new code. |
|
|
Returns the default string encoding that is used when native strings are converted to Java strings.
The default value will be based on the platform and the version of Java. A value of
|
|
|
Returns the JNIEnv pointer this local environment wraps around.
|
|
|
Sets the value of the Don't call this method directly. It is used internally by the framework.
|
|
|
Sets the value of the Don't call this method directly. It is used internally by the framework.
|
|
|
Sets the value of the Don't call this method directly. It is used internally by the framework.
|
|
|
Sets the error handler that will be used for this local environment. Error handlers are thread specific because a programmer must be able to adjust the errorhandling policy in one thread without affecting the entire application.
|
|
|
Sets the default string encoding that is used when native strings are converted to Java strings.
The default value will be based on the platform and the version of Java. A value of
|
1.4.1