Codemesh Runtime v3 C++ API Reference  3.9.205
xmog_JavaVM.h
1 //
2 // Copyright (c) 1999-2020 by Codemesh, Inc.. ALL RIGHTS RESERVED.
3 //
4 
5 #ifndef xmog_JavaVM_inc
6 #define xmog_JavaVM_inc
7 
8 
9 #include "xmog.h"
10 
11 
12 #if (XMOG_IMPLEMENTS_REMOTE_CLIENT==1)
13 
14 
15 class xmog_jvm;
16 struct xmog_base;
17 struct xmog_JNIEnv;
18 
19 
20 #include "xmog_remote_ref_map.h"
21 #include "xmog_class_info_mapper.h"
22 #include "xmog_message_types.h"
23 
24 
25 
26 #define CLASS_FROM_ID(x) (jclass)(((jint)(jlong)x) >> 16)
27 #define CLASSID_FROM_CLASS(x) ((jint)(jlong)(x))
28 #define FIELDID_FROM_FIELD(x) ((jint)(jlong)(x))
29 #define METHODID_FROM_METHOD(x) ((jint)(jlong)(x))
30 #define OBJECTID_FROM_OBJECT(x) ((jint)(jlong)(x))
31 
32 
40 {
41 public:
42 
46  xmog_JavaVM();
47 
51  ~xmog_JavaVM();
52 
56  xmog_jvm * getJvm() const;
57 
63  void setJvm( xmog_jvm * jvm_ );
64 
68  bool getInDestroy();
69 
73  void setInDestroy( bool b );
74 
78  virtual jstring RemoteNewString( const unsigned short * str, xmog_JNIEnv * env, int len = -1 ) = 0;
79 
83  virtual jstring RemoteNewString( const char * str, xmog_JNIEnv * env, xmog_base * encoding, int len = -1 ) = 0;
84 
88  virtual jstring RemoteNewString( const char * str, xmog_JNIEnv * env, const char * encoding, int len = -1 ) = 0;
89 
95  virtual jstring RemoteNewStringUtf( const char * str, xmog_JNIEnv * env ) = 0;
96 
104  virtual jarray RemoteNewArray( const char * arrType, jsize size, xmog_JNIEnv * env ) = 0;
105 
116  virtual jarray RemoteNewPrimitiveArray( const char * arrType, xmog::xmog_data_code elemCode, void * pData, jsize length, jsize size, xmog_JNIEnv * env ) = 0;
117 
128  virtual void RemoteGetArrayRegion( const char * arrType, jarray array, jsize start, jsize len, void * buf, xmog_JNIEnv * env ) = 0;
129 
140  virtual void RemoteSetArrayRegion( const char * arrType, jarray array, jsize start, jsize len, void * buf, xmog_JNIEnv * env ) = 0;
141 
148  virtual jclass RemoteGetSuperClass( jclass sub, xmog_JNIEnv * env ) = 0;
149 
157  virtual jboolean RemoteIsAssignableFrom( jclass sub, jclass sup, xmog_JNIEnv * env ) = 0;
158 
166  virtual jboolean RemoteIsInstanceOf( jobject obj, jclass clazz, xmog_JNIEnv * env ) = 0;
167 
174  virtual jclass RemoteGetClass( jobject obj, xmog_JNIEnv * env ) = 0;
175 
176 protected:
177 
187 
192 };
193 
194 
195 #endif /* XMOG_IMPLEMENTS_REMOTE_CLIENT */
196 
197 
198 #endif /* xmog_JavaVM_inc */
xmog_JavaVM::RemoteSetArrayRegion
virtual void RemoteSetArrayRegion(const char *arrType, jarray array, jsize start, jsize len, void *buf, xmog_JNIEnv *env)=0
Sets the values of a region of an array.
xmog_class_info_mapper
A utility class that tracks remote object types and their relationships.
Definition: xmog_class_info_mapper.h:24
xmog_JavaVM::RemoteGetSuperClass
virtual jclass RemoteGetSuperClass(jclass sub, xmog_JNIEnv *env)=0
Queries for a subtype's superclass.
xmog_JavaVM::setInDestroy
void setInDestroy(bool b)
Sets flag to true if this instance has started destroy processing.
xmog_remote_ref_map
A utility class that tracks remote object references with a reference count.
Definition: xmog_remote_ref_map.h:44
xmog_JavaVM::~xmog_JavaVM
~xmog_JavaVM()
Destructor.
xmog_JavaVM::bInDestroy_
bool bInDestroy_
A guard flag against recursive invocation of the DestroyJavaVM() method.
Definition: xmog_JavaVM.h:191
xmog_JavaVM
An abstract JavaVM type that is used as a base class for concrete JavaVM_ replacement types.
Definition: xmog_JavaVM.h:39
xmog_JavaVM::RemoteIsInstanceOf
virtual jboolean RemoteIsInstanceOf(jobject obj, jclass clazz, xmog_JNIEnv *env)=0
Queries for an instance-of relationship between an object and a type.
xmog_message_types.h
xmog_base
The baseclass for all proxy types in the framework.
Definition: xmog_base.h:29
xmog_jvm
The class that represents a Java Virtual Machine in the framework.
Definition: xmog_jvm.h:41
xmog_JavaVM::RemoteGetArrayRegion
virtual void RemoteGetArrayRegion(const char *arrType, jarray array, jsize start, jsize len, void *buf, xmog_JNIEnv *env)=0
Returns the values in a region of an array.
xmog_JavaVM::getJvm
xmog_jvm * getJvm() const
Returns the higher-level abstraction that owns this instance.
xmog_JavaVM::RemoteNewArray
virtual jarray RemoteNewArray(const char *arrType, jsize size, xmog_JNIEnv *env)=0
Creates an array and returns the handle.
xmog_JavaVM::setJvm
void setJvm(xmog_jvm *jvm_)
Sets the higher-level abstraction that owns this instance.
xmog_JavaVM::xmog_JavaVM
xmog_JavaVM()
The default constructor.
xmog_JavaVM::RemoteNewString
virtual jstring RemoteNewString(const unsigned short *str, xmog_JNIEnv *env, int len=-1)=0
Attempts to create a string on the server.
xmog_JavaVM::theJvm
xmog_jvm * theJvm
A pointer to the higher level abstraction instance that owns this instance.
Definition: xmog_JavaVM.h:186
xmog_JavaVM::RemoteGetClass
virtual jclass RemoteGetClass(jobject obj, xmog_JNIEnv *env)=0
Queries for the type of an object.
xmog_JNIEnv
An abstract baseclass for concrete JNIEnv implementations.
Definition: xmog_JNIEnv.h:26
xmog_JavaVM::RemoteIsAssignableFrom
virtual jboolean RemoteIsAssignableFrom(jclass sub, jclass sup, xmog_JNIEnv *env)=0
Queries for an inheritance relationship between two types.
xmog_JavaVM::getInDestroy
bool getInDestroy()
Returns true if this instance has started destroy processing.
xmog_JavaVM::RemoteNewPrimitiveArray
virtual jarray RemoteNewPrimitiveArray(const char *arrType, xmog::xmog_data_code elemCode, void *pData, jsize length, jsize size, xmog_JNIEnv *env)=0
Creates a primitive array from the given data and returns the handle.
xmog_JavaVM::RemoteNewStringUtf
virtual jstring RemoteNewStringUtf(const char *str, xmog_JNIEnv *env)=0
Creates a string in the shared JVM and returns the handle.

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