Codemesh Runtime v3 C++ API Reference  3.9.205
Test_JavaVM.h
1 //
2 // Copyright (c) 1999-2020 by Codemesh, Inc.. ALL RIGHTS RESERVED.
3 //
4 
5 #ifndef Test_JavaVM_inc
6 #define Test_JavaVM_inc
7 
8 
9 #include "xmog.h"
10 
11 
12 #if (XMOG_IMPLEMENTS_REMOTE_CLIENT==1)
13 
14 
15 #include "xmog_JavaVM.h"
16 #include "ace/Map_Manager.h"
17 #include "ace/Thread_Mutex.h"
18 
19 
24 struct Test_JavaVM : public xmog_JavaVM
25 {
26 public:
27 
33  Test_JavaVM();
34 
38  ~Test_JavaVM();
39 
45  jint bind_class( const char * name );
46 
50  jstring RemoteNewString( const unsigned short * str, xmog_JNIEnv * env, int len = -1 );
51 
55  jstring RemoteNewString( const char * str, xmog_JNIEnv * env, xmog_base * encoding, int len = -1 );
56 
60  jstring RemoteNewString( const char * str, xmog_JNIEnv * env, const char * encoding, int len = -1 );
61 
65  jstring RemoteNewStringUtf( const char * str, xmog_JNIEnv * env );
66 
74  jarray RemoteNewArray( const char * arrType, jsize size, xmog_JNIEnv * env );
75 
86  virtual jarray RemoteNewPrimitiveArray( const char * arrType, xmog::xmog_data_code elemCode, void * pData, jsize length, jsize size, xmog_JNIEnv * env );
87 
98  void RemoteGetArrayRegion( const char * arrType, jarray array, jsize start, jsize len, void * buf, xmog_JNIEnv * env );
99 
110  void RemoteSetArrayRegion( const char * arrType, jarray array, jsize start, jsize len, void * buf, xmog_JNIEnv * env );
111 
118  jclass RemoteGetSuperClass( jclass sub, xmog_JNIEnv * env );
119 
127  jboolean RemoteIsAssignableFrom( jclass sub, jclass sup, xmog_JNIEnv * env );
128 
136  jboolean RemoteIsInstanceOf( jobject obj, jclass clazz, xmog_JNIEnv * env );
137 
144  jclass RemoteGetClass( jobject obj, xmog_JNIEnv * env );
145 
146 private:
147 
152  void init();
153 
159  ACE_Map_Manager<const char*,jint,ACE_Thread_Mutex> classes_;
160 
166  jint currentClassIndex_;
167 
174  static JNIInvokeInterface_ theFunctions;
175 };
176 
177 
178 #endif /* XMOG_IMPLEMENTS_REMOTE_CLIENT */
179 
180 
181 #endif /* Test_JavaVM_inc */
Test_JavaVM::RemoteNewArray
jarray RemoteNewArray(const char *arrType, jsize size, xmog_JNIEnv *env)
Creates an array and returns the handle.
Test_JavaVM::RemoteGetSuperClass
jclass RemoteGetSuperClass(jclass sub, xmog_JNIEnv *env)
Queries for a subtype's superclass.
Test_JavaVM::RemoteIsAssignableFrom
jboolean RemoteIsAssignableFrom(jclass sub, jclass sup, xmog_JNIEnv *env)
Queries for an inheritance relationship between two types.
Test_JavaVM::~Test_JavaVM
~Test_JavaVM()
Destructor.
Test_JavaVM::RemoteNewString
jstring RemoteNewString(const unsigned short *str, xmog_JNIEnv *env, int len=-1)
Attempts to create a string on the server.
Test_JavaVM::RemoteNewStringUtf
jstring RemoteNewStringUtf(const char *str, xmog_JNIEnv *env)
Attempts to create a string on the server.
xmog_JavaVM
An abstract JavaVM type that is used as a base class for concrete JavaVM_ replacement types.
Definition: xmog_JavaVM.h:39
Test_JavaVM::RemoteIsInstanceOf
jboolean RemoteIsInstanceOf(jobject obj, jclass clazz, xmog_JNIEnv *env)
Queries for an instance-of relationship between an object and a type.
Test_JavaVM::RemoteSetArrayRegion
void RemoteSetArrayRegion(const char *arrType, jarray array, jsize start, jsize len, void *buf, xmog_JNIEnv *env)
Sets the values of a region of an array.
xmog_base
The baseclass for all proxy types in the framework.
Definition: xmog_base.h:29
Test_JavaVM
A JavaVM type that simulates a Java backend for framework testing purposes.
Definition: Test_JavaVM.h:24
Test_JavaVM::RemoteGetClass
jclass RemoteGetClass(jobject obj, xmog_JNIEnv *env)
Queries for the type of an object.
Test_JavaVM::bind_class
jint bind_class(const char *name)
Binds a classname to a "handle".
Test_JavaVM::RemoteGetArrayRegion
void RemoteGetArrayRegion(const char *arrType, jarray array, jsize start, jsize len, void *buf, xmog_JNIEnv *env)
Returns the values in a region of an array.
xmog_JNIEnv
An abstract baseclass for concrete JNIEnv implementations.
Definition: xmog_JNIEnv.h:26
Test_JavaVM::Test_JavaVM
Test_JavaVM()
The default constructor.
Test_JavaVM::RemoteNewPrimitiveArray
virtual jarray RemoteNewPrimitiveArray(const char *arrType, xmog::xmog_data_code elemCode, void *pData, jsize length, jsize size, xmog_JNIEnv *env)
Creates a primitive array from the given data and returns the handle.

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