This module provides facilities to manipulate a Java context (i.e. an environment in which Java elements can be accessed through JNI). This section allows you to access the C++ source files of the module. This module is part of Bpp/Java . The files listed below are included in the interface part of the module. So any module dependent of this module is also dependent of the files listed here. The files listed below are needed by the implementation part of the module. But a module dependent of this module is not necessary dependent of the files listed here. The namespaces listed below are integrated in this module. That means any element declared in one of those namespaces can now be directly used by or from this module. Here are listed the errors that are supported or generated by the module. To use one of them, you do not have to specify the namespace of the module. erJavaArrayAccess Can not access the element of the Java array.
erJavaArrayCreation Can not create the Java array.
erJavaAttributeAccess Can not access the Java attribute.
erJavaAttributeNotFound Can not find the Java attribute.
erJavaClassNotFound Can not find the Java class.
erJavaException Problem with a Java exception.
erJavaGlobalReference Can not make the Java reference global.
erJavaLocalReference Can not create a local Java reference.
erJavaMethodCall Can not call the Java method.
erJavaMethodNotFound Can not find the Java method.
erJavaObjectClass Can not check the class of the object.
erJavaReferenceFree Can not free the Java reference.
erJavaStringAccess Can not access the content of the Java string.
erJavaStringCreation Can not create the Java string.
erJavaSynchronization Can not synchronize the Java object.
Here are listed the classes provided by the module. To use one of them, you have to specify the namespace of the module. class clContext
Represents a Java context. inline clContext::clContext(void) Builds the Java context of the current thread.
inline clContext::clContext(jyContext agPointer) Builds a Java context from its pointer in JNI.
inline clContext::~clContext(void) Destructs the context.
inline jyClass clContext::getClass(tcString agName) const Gets the ID of a Java class.
inline jyClass clContext::getClass(jyObject agObject) const Gets the ID of the class of a Java object reference.
inline void clContext::freeGlobal(jyObject agObject) const Frees a global JNI reference (i.e. it may be garbage collected).
inline void clContext::freeLocal(jyObject agObject) const Frees a local JNI reference (i.e. it may be garbage collected).
inline tyBoolean clContext::checkException(void) const Checks if an exception has been thrown in the context from the virtual machine.
inline void clContext::clearException(void) const Clears any exception that has been thrown in the current context from the virtual machine.
inline jyException clContext::getException(void) const Gets the exception thrown in the current context from the virtual machine.
inline void clContext::throwException(tcString agSignature,tcString agMessage) const Throws an exception with a message in the virtual machine.
inline void clContext::lockObject(jyObject agObject) const Locks an object for the exclusive use of the current thread. If it is already locked by another thread, the method waits for its release.
inline void clContext::releaseObject(jyObject agObject) const Releases an object from the exclusive use of the current thread.
inline jyObject clContext::localObject(jyObject agObject) const Returns a local reference to a JNI object.
inline jyClass clContext::globalClass(jyClass agClass) const Makes a JNI class reference global (i.e. it can not be garbage collected yet). The local reference is not valid anymore.
inline jyObject clContext::globalObject(jyObject agObject) const Makes a JNI object reference global (i.e. it can not be garbage collected yet). The local reference is not valid anymore.
inline tyBoolean clContext::isInstance(jyObject agObject,jyClass agClass) const Returns if a Java object is an instance of a given Java class.
inline jyArray clContext::newObjectArray(jyClass agClass,tyCardinal agSize) const Builds a Java array of objects given its class and size.
inline void clContext::setObjectArrayElement(jyArray agArray,tyCardinal agPosition,jyObject agObject) const Sets the element at a given position in a Java array of objects.
inline jyObject clContext::getObjectArrayElement(jyArray agArray,tyCardinal agPosition) const Returns the element at a given position in a Java array of objects.
template <class prType> inline jyArray clContext::newPrimitiveArray(tyCardinal agSize) const Builds a Java array of elements of a primitive type, given its size.
template <class prType> inline void clContext::setPrimitiveArrayContent(jyArray agArray,tyCardinal agSize,prType * agBuffer) const Sets the content of a Java array of elements of a primitive type from a C++ array.
template <class prType> inline void clContext::getPrimitiveArrayContent(jyArray agArray,tyCardinal agSize,prType * agBuffer) const Copies the content of a Java array of elements of a primitive type into a C++ array.
inline tyCardinal clContext::getArrayLength(jyArray agArray) const Returns the length of a Java array.
property void clContext::throwException(jyObject agException) const Throws an exception in the virtual machine.
property jyAttribute clContext::getClassAttribute(jyClass agClass,tcString agName,tcString agSignature) const Gets the ID of a Java class attribute.
property jyAttribute clContext::getInstanceAttribute(jyClass agClass,tcString agName,tcString agSignature) const Gets the ID of a Java instance attribute.
property <Type> clContext::readClass<Type>Attribute(jyClass agClass,jyAttribute agAttribute) const Reads the value of a Java class attribute.
property <Type> clContext::readInstance<Type>Attribute(jyObject agObject,jyAttribute agAttribute) const Reads the value of a Java instance attribute.
property void clContext::writeClass<Type>Attribute(jyClass agClass,jyAttribute agAttribute,<Type> agValue) const Writes the value of a Java class attribute.
property void clContext::writeInstance<Type>Attribute(jyObject agObject,jyAttribute agAttribute,<Type> agValue) const Writes the value of a Java instance attribute.
property jyMethod clContext::getClassMethod(jyClass agClass,tcString agName,tcString agSignature) const Gets the ID of a Java class method.
property jyMethod clContext::getInstanceMethod(jyClass agClass,tcString agName,tcString agSignature) const Gets the ID of a Java instance method.
property jyMethod clContext::getConstructor(jyClass agClass,tcString agSignature) const Gets the ID of a Java constructor.
property <Type> clContext::callClass<Type>Method(jyClass agClass,jyMethod agMethod,...) const Calls a Java class method.
property <Type> clContext::callInstance<Type>Method(jyObject agObject,jyMethod agMethod,...) const Calls a Java instance method.
property jyObject clContext::newObject(jyClass agClass,jyMethod agMethod,...) const Builds a new Java object.
property jyObject clContext::newString(tcString agString) const Builds a Java string from a C++ string.
property clString clContext::getString(jyObject agObject) const Copies the content of a Java string into a C++ string.
| | Copyright (c) 1999-2016 - Bruno Bachelet - bruno@nawouak.net - http://www.nawouak.net | Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.1 or any later version published by the Free Software Foundation. See this license for more details (http://www.gnu.org). |
|
| |