Codemesh Runtime v3 C++ API Reference  3.9.205
Public Member Functions | Protected Attributes | List of all members
xmog_JavaVM Struct Referenceabstract

An abstract JavaVM type that is used as a base class for concrete JavaVM_ replacement types. More...

#include <xmog_JavaVM.h>

Inheritance diagram for xmog_JavaVM:
Inheritance graph
[legend]
Collaboration diagram for xmog_JavaVM:
Collaboration graph
[legend]

Public Member Functions

 xmog_JavaVM ()
 The default constructor.
 
 ~xmog_JavaVM ()
 Destructor. More...
 
xmog_jvmgetJvm () const
 Returns the higher-level abstraction that owns this instance.
 
void setJvm (xmog_jvm *jvm_)
 Sets the higher-level abstraction that owns this instance. More...
 
bool getInDestroy ()
 Returns true if this instance has started destroy processing.
 
void setInDestroy (bool b)
 Sets flag to true if this instance has started destroy processing.
 
virtual jstring RemoteNewString (const unsigned short *str, xmog_JNIEnv *env, int len=-1)=0
 Attempts to create a string on the server.
 
virtual jstring RemoteNewString (const char *str, xmog_JNIEnv *env, xmog_base *encoding, int len=-1)=0
 Attempts to create a string on the server.
 
virtual jstring RemoteNewString (const char *str, xmog_JNIEnv *env, const char *encoding, int len=-1)=0
 Attempts to create a string on the server.
 
virtual jstring RemoteNewStringUtf (const char *str, xmog_JNIEnv *env)=0
 Creates a string in the shared JVM and returns the handle. More...
 
virtual jarray RemoteNewArray (const char *arrType, jsize size, xmog_JNIEnv *env)=0
 Creates an array and returns the handle. More...
 
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. More...
 
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. More...
 
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. More...
 
virtual jclass RemoteGetSuperClass (jclass sub, xmog_JNIEnv *env)=0
 Queries for a subtype's superclass. More...
 
virtual jboolean RemoteIsAssignableFrom (jclass sub, jclass sup, xmog_JNIEnv *env)=0
 Queries for an inheritance relationship between two types. More...
 
virtual jboolean RemoteIsInstanceOf (jobject obj, jclass clazz, xmog_JNIEnv *env)=0
 Queries for an instance-of relationship between an object and a type. More...
 
virtual jclass RemoteGetClass (jobject obj, xmog_JNIEnv *env)=0
 Queries for the type of an object. More...
 
- Public Member Functions inherited from xmog_remote_ref_map
 xmog_remote_ref_map (xmog_remote_ref_map *parentFrame)
 Constructs a reference map.
 
int get_data (jobject _ref, void **pData, size_t *pLength)
 Returns the cached data associated with a reference.
 
int delete_global (jobject _ref)
 Deletes a global reference from the map. More...
 
jobject new_global (jobject _ref, void *data=NULL, size_t size=0)
 Adds a global reference to the map.
 
int delete_local (jobject _ref)
 Deletes a local reference from the map. More...
 
jobject new_local (jobject _ref, void *data=NULL, size_t size=0)
 Adds a local reference to the map.
 
int delete_weakglobal (jobject _ref)
 Deletes a weak global reference from the map. More...
 
jobject new_weakglobal (jobject _ref, void *data=NULL, size_t size=0)
 Adds a weak global reference to the map.
 
xmog_remote_ref_mappush_frame ()
 Pushes a new frame on the stack and returns the new frame.
 
xmog_remote_ref_mappop_frame ()
 Pops a frame from the stack and returns the parent frame.
 
- Public Member Functions inherited from xmog_class_info_mapper
 xmog_class_info_mapper ()
 Constructs a mapper instance.
 
int register_class (jclass id, jclass super_id, const char *name, size_t numIfcs, jclass *ifcs)
 
int get_super (jclass sub, jclass &sup) const
 
int get_class_name (jclass id, char *&name) const
 
int get_num_ifcs (jclass sub, size_t &size) const
 
int get_ifc (jclass sub, size_t index, jclass &ifc) const
 
int is_assignable (jclass sub, jclass sup, jboolean &bAssignable) const
 

Protected Attributes

xmog_jvmtheJvm
 A pointer to the higher level abstraction instance that owns this instance. More...
 
bool bInDestroy_
 A guard flag against recursive invocation of the DestroyJavaVM() method.
 

Additional Inherited Members

- Public Types inherited from xmog_remote_ref_map
typedef jobject Key
 
typedef xmog_remote_refValue
 
typedef ACE_Map_Manager< Key, Value, ACE_Null_Mutex > ObjectFrame
 
- Public Types inherited from xmog_class_info_mapper
typedef ACE_Map_Manager< jclass, xmog_class_info, ACE_Recursive_Thread_Mutex > ClassToClassInfoMap
 

Detailed Description

An abstract JavaVM type that is used as a base class for concrete JavaVM_ replacement types.

Known subtypes include Test_JavaVM and IPv4Sockets_JavaVM.

Constructor & Destructor Documentation

◆ ~xmog_JavaVM()

xmog_JavaVM::~xmog_JavaVM ( )

Destructor.

Member Function Documentation

◆ RemoteGetArrayRegion()

virtual void xmog_JavaVM::RemoteGetArrayRegion ( const char *  arrType,
jarray  array,
jsize  start,
jsize  len,
void *  buf,
xmog_JNIEnv env 
)
pure virtual

Returns the values in a region of an array.

Parameters
arrTypethe array type in JNI representation ("Z" for bool, etc).
arraythe array object handle.
startthe starting index of the region in the array.
lenthe length of the region.
bufthe native buffer into which we get the value.
envthe local environment.

Implemented in IPv4Sockets_JavaVM, and Test_JavaVM.

◆ RemoteGetClass()

virtual jclass xmog_JavaVM::RemoteGetClass ( jobject  obj,
xmog_JNIEnv env 
)
pure virtual

Queries for the type of an object.

Parameters
objthe object we're testing.
envthe local environment.

Implemented in IPv4Sockets_JavaVM, and Test_JavaVM.

◆ RemoteGetSuperClass()

virtual jclass xmog_JavaVM::RemoteGetSuperClass ( jclass  sub,
xmog_JNIEnv env 
)
pure virtual

Queries for a subtype's superclass.

Parameters
subthe subtype's handle.
envthe local environment.

Implemented in IPv4Sockets_JavaVM, and Test_JavaVM.

◆ RemoteIsAssignableFrom()

virtual jboolean xmog_JavaVM::RemoteIsAssignableFrom ( jclass  sub,
jclass  sup,
xmog_JNIEnv env 
)
pure virtual

Queries for an inheritance relationship between two types.

Parameters
subthe subtype's handle.
supthe supertype's handle.
envthe local environment.

Implemented in IPv4Sockets_JavaVM, and Test_JavaVM.

◆ RemoteIsInstanceOf()

virtual jboolean xmog_JavaVM::RemoteIsInstanceOf ( jobject  obj,
jclass  clazz,
xmog_JNIEnv env 
)
pure virtual

Queries for an instance-of relationship between an object and a type.

Parameters
objthe object we're testing.
clazzthe type we're testing against.
envthe local environment.

Implemented in IPv4Sockets_JavaVM, and Test_JavaVM.

◆ RemoteNewArray()

virtual jarray xmog_JavaVM::RemoteNewArray ( const char *  arrType,
jsize  size,
xmog_JNIEnv env 
)
pure virtual

Creates an array and returns the handle.

Parameters
arrTypethe array type name in UTF-8 representation.
sizethe array size.
envthe local environment.

Implemented in IPv4Sockets_JavaVM, and Test_JavaVM.

◆ RemoteNewPrimitiveArray()

virtual jarray xmog_JavaVM::RemoteNewPrimitiveArray ( const char *  arrType,
xmog::xmog_data_code  elemCode,
void *  pData,
jsize  length,
jsize  size,
xmog_JNIEnv env 
)
pure virtual

Creates a primitive array from the given data and returns the handle.

Parameters
arrTypethe array type name in UTF-8 representation.
elemCodethe data code of the element type.
pDatathe array data.
lengththe array length (number of elements).
sizethe array size in bytes.
envthe local environment.

Implemented in IPv4Sockets_JavaVM, and Test_JavaVM.

◆ RemoteNewStringUtf()

virtual jstring xmog_JavaVM::RemoteNewStringUtf ( const char *  str,
xmog_JNIEnv env 
)
pure virtual

Creates a string in the shared JVM and returns the handle.

Parameters
strthe native string in UTF-8 representation.

Implemented in IPv4Sockets_JavaVM, and Test_JavaVM.

◆ RemoteSetArrayRegion()

virtual void xmog_JavaVM::RemoteSetArrayRegion ( const char *  arrType,
jarray  array,
jsize  start,
jsize  len,
void *  buf,
xmog_JNIEnv env 
)
pure virtual

Sets the values of a region of an array.

Parameters
arrTypethe array type in JNI representation ("Z" for bool, etc).
arraythe array object handle.
startthe starting index of the region in the array.
lenthe length of the region.
bufthe native buffer into which we get the value.
envthe local environment.

Implemented in IPv4Sockets_JavaVM, and Test_JavaVM.

◆ setJvm()

void xmog_JavaVM::setJvm ( xmog_jvm jvm_)

Sets the higher-level abstraction that owns this instance.

This operation will only succeed once.

Member Data Documentation

◆ theJvm

xmog_jvm* xmog_JavaVM::theJvm
protected

A pointer to the higher level abstraction instance that owns this instance.

We don't really need the higher level abstraction unless we want to do things in an optimized fashion at the higher level of abstraction. This could include batching up certain requests.


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

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