LibreOffice Module jvmaccess (master) 1
Classes | Public Member Functions | Private Member Functions | Private Attributes | List of all members
jvmaccess::UnoVirtualMachine Class Referencefinal

An encapsulating wrapper around a Java virtual machine and an appropriate UNO class loader. More...

#include <unovirtualmachine.hxx>

Inheritance diagram for jvmaccess::UnoVirtualMachine:
[legend]
Collaboration diagram for jvmaccess::UnoVirtualMachine:
[legend]

Classes

class  CreationException
 An exception indicating failure to create a UnoVirtualMachine. More...
 

Public Member Functions

 UnoVirtualMachine (rtl::Reference< jvmaccess::VirtualMachine > virtualMachine, void *classLoader)
 Create a wrapper around a Java virtual machine and an appropriate UNO class loader. More...
 
const rtl::Reference< jvmaccess::VirtualMachine > & getVirtualMachine () const
 Get the Java virtual machine wrapper. More...
 
void * getClassLoader () const
 Get the UNO class loader. More...
 
- Public Member Functions inherited from salhelper::SimpleReferenceObject
 SimpleReferenceObject ()
 
void acquire ()
 
void release ()
 

Private Member Functions

 UnoVirtualMachine (UnoVirtualMachine const &)=delete
 
UnoVirtualMachineoperator= (UnoVirtualMachine const &)=delete
 
virtual ~UnoVirtualMachine () override
 

Private Attributes

rtl::Reference< jvmaccess::VirtualMachinem_virtualMachine
 
void * m_classLoader
 

Additional Inherited Members

- Static Public Member Functions inherited from salhelper::SimpleReferenceObject
static void * operator new (std::size_t nSize)
 
static void * operator new (std::size_t nSize, std::nothrow_t const &rNothrow)
 
static void operator delete (void *pPtr)
 
static void operator delete (void *pPtr, std::nothrow_t const &rNothrow)
 
- Protected Member Functions inherited from salhelper::SimpleReferenceObject
virtual ~SimpleReferenceObject () COVERITY_NOEXCEPT_FALSE
 
- Protected Attributes inherited from salhelper::SimpleReferenceObject
oslInterlockedCount m_nCount
 

Detailed Description

An encapsulating wrapper around a Java virtual machine and an appropriate UNO class loader.

Definition at line 35 of file unovirtualmachine.hxx.

Constructor & Destructor Documentation

◆ UnoVirtualMachine() [1/2]

jvmaccess::UnoVirtualMachine::UnoVirtualMachine ( rtl::Reference< jvmaccess::VirtualMachine virtualMachine,
void *  classLoader 
)

Create a wrapper around a Java virtual machine and an appropriate UNO class loader.

Parameters
virtualMachineA Java virtual machine wrapper. Must not be null.
classLoaderA local or global JNI reference, relative to the given virtualMachine, to an appropriate UNO class loader instance. Must not be null. This parameter should be of type jobject, not void *, but the exact definition of jobject is different for different JDK versions, so that the mangled C++ name of the constructor would depend on the JDK version used at compile time.
Exceptions
CreationExceptionThrown in case creation fails (due to a JNI problem).

Definition at line 43 of file unovirtualmachine.cxx.

References jvmaccess::VirtualMachine::AttachGuard, getEnvironment(), m_classLoader, and m_virtualMachine.

◆ UnoVirtualMachine() [2/2]

jvmaccess::UnoVirtualMachine::UnoVirtualMachine ( UnoVirtualMachine const &  )
privatedelete

◆ ~UnoVirtualMachine()

jvmaccess::UnoVirtualMachine::~UnoVirtualMachine ( )
overrideprivatevirtual

Member Function Documentation

◆ getClassLoader()

void * jvmaccess::UnoVirtualMachine::getClassLoader ( ) const
inline

Get the UNO class loader.

Returns
A global JNI reference to the UNO class loader. (The JNI reference must not be deleted by client code.) Will never be null. This should be of type jobject, not void *, but the exact definition of jobject is different for different JDK versions, so that the mangled C++ name of the function would depend on the JDK version used at compile time.

Definition at line 85 of file unovirtualmachine.hxx.

◆ getVirtualMachine()

const rtl::Reference< jvmaccess::VirtualMachine > & jvmaccess::UnoVirtualMachine::getVirtualMachine ( ) const

Get the Java virtual machine wrapper.

Returns
The Java virtual machine wrapper. Will never be null.

Definition at line 60 of file unovirtualmachine.cxx.

References m_virtualMachine.

◆ operator=()

UnoVirtualMachine & jvmaccess::UnoVirtualMachine::operator= ( UnoVirtualMachine const &  )
privatedelete

Member Data Documentation

◆ m_classLoader

void* jvmaccess::UnoVirtualMachine::m_classLoader
private

Definition at line 94 of file unovirtualmachine.hxx.

Referenced by UnoVirtualMachine(), and ~UnoVirtualMachine().

◆ m_virtualMachine

rtl::Reference<jvmaccess::VirtualMachine> jvmaccess::UnoVirtualMachine::m_virtualMachine
private

Definition at line 93 of file unovirtualmachine.hxx.

Referenced by getVirtualMachine(), UnoVirtualMachine(), and ~UnoVirtualMachine().


The documentation for this class was generated from the following files: