INTEGRATION: CWS sb44 (1.71.10); FILE MERGED
2005/12/12 16:02:56 sb 1.71.10.1: #i51419# Transport complete jvmaccess::UnoVirtualMachine instance including UNO class loader from juh to javavm service.
This commit is contained in:
@@ -4,9 +4,9 @@
|
|||||||
*
|
*
|
||||||
* $RCSfile: javavm.cxx,v $
|
* $RCSfile: javavm.cxx,v $
|
||||||
*
|
*
|
||||||
* $Revision: 1.71 $
|
* $Revision: 1.72 $
|
||||||
*
|
*
|
||||||
* last change: $Author: kz $ $Date: 2005-10-05 15:00:28 $
|
* last change: $Author: kz $ $Date: 2006-01-03 12:44:05 $
|
||||||
*
|
*
|
||||||
* The Contents of this file are made available subject to
|
* The Contents of this file are made available subject to
|
||||||
* the terms of GNU Lesser General Public License Version 2.1.
|
* the terms of GNU Lesser General Public License Version 2.1.
|
||||||
@@ -81,6 +81,7 @@ int main( int argc, char * argv[])
|
|||||||
#include "interact.hxx"
|
#include "interact.hxx"
|
||||||
#include "jvmargs.hxx"
|
#include "jvmargs.hxx"
|
||||||
|
|
||||||
|
#include "com/sun/star/beans/NamedValue.hpp"
|
||||||
#include "com/sun/star/beans/PropertyState.hpp"
|
#include "com/sun/star/beans/PropertyState.hpp"
|
||||||
#include "com/sun/star/beans/PropertyValue.hpp"
|
#include "com/sun/star/beans/PropertyValue.hpp"
|
||||||
#include "com/sun/star/container/XContainer.hpp"
|
#include "com/sun/star/container/XContainer.hpp"
|
||||||
@@ -719,7 +720,22 @@ JavaVirtualMachine::initialize(css::uno::Sequence< css::uno::Any > const &
|
|||||||
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
|
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
|
||||||
"bad call to initialize")),
|
"bad call to initialize")),
|
||||||
static_cast< cppu::OWeakObject * >(this));
|
static_cast< cppu::OWeakObject * >(this));
|
||||||
OSL_ENSURE(sizeof (sal_Int64) >= sizeof (jvmaccess::VirtualMachine *),
|
css::beans::NamedValue val;
|
||||||
|
if (rArguments.getLength() == 1 && (rArguments[0] >>= val)
|
||||||
|
&& val.Name.equalsAsciiL(
|
||||||
|
RTL_CONSTASCII_STRINGPARAM( "UnoVirtualMachine")))
|
||||||
|
{
|
||||||
|
OSL_ENSURE(
|
||||||
|
sizeof (sal_Int64) >= sizeof (jvmaccess::UnoVirtualMachine *),
|
||||||
|
"Pointer cannot be represented as sal_Int64");
|
||||||
|
sal_Int64 nPointer = reinterpret_cast< sal_Int64 >(
|
||||||
|
static_cast< jvmaccess::UnoVirtualMachine * >(0));
|
||||||
|
val.Value >>= nPointer;
|
||||||
|
m_xUnoVirtualMachine =
|
||||||
|
reinterpret_cast< jvmaccess::UnoVirtualMachine * >(nPointer);
|
||||||
|
} else {
|
||||||
|
OSL_ENSURE(
|
||||||
|
sizeof (sal_Int64) >= sizeof (jvmaccess::VirtualMachine *),
|
||||||
"Pointer cannot be represented as sal_Int64");
|
"Pointer cannot be represented as sal_Int64");
|
||||||
sal_Int64 nPointer = reinterpret_cast< sal_Int64 >(
|
sal_Int64 nPointer = reinterpret_cast< sal_Int64 >(
|
||||||
static_cast< jvmaccess::VirtualMachine * >(0));
|
static_cast< jvmaccess::VirtualMachine * >(0));
|
||||||
@@ -727,16 +743,9 @@ JavaVirtualMachine::initialize(css::uno::Sequence< css::uno::Any > const &
|
|||||||
rArguments[0] >>= nPointer;
|
rArguments[0] >>= nPointer;
|
||||||
rtl::Reference< jvmaccess::VirtualMachine > vm(
|
rtl::Reference< jvmaccess::VirtualMachine > vm(
|
||||||
reinterpret_cast< jvmaccess::VirtualMachine * >(nPointer));
|
reinterpret_cast< jvmaccess::VirtualMachine * >(nPointer));
|
||||||
if (!vm.is())
|
if (vm.is()) {
|
||||||
throw css::lang::IllegalArgumentException(
|
|
||||||
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
|
|
||||||
"sequence of exactly one any containing a hyper"
|
|
||||||
" representing a non-null pointer to a"
|
|
||||||
" jvmaccess::VirtualMachine required")),
|
|
||||||
static_cast< cppu::OWeakObject * >(this), 0);
|
|
||||||
try {
|
try {
|
||||||
m_xUnoVirtualMachine = new jvmaccess::UnoVirtualMachine(vm, 0);
|
m_xUnoVirtualMachine = new jvmaccess::UnoVirtualMachine(vm, 0);
|
||||||
//TODO: non-null classLoader
|
|
||||||
} catch (jvmaccess::UnoVirtualMachine::CreationException &) {
|
} catch (jvmaccess::UnoVirtualMachine::CreationException &) {
|
||||||
throw css::uno::RuntimeException(
|
throw css::uno::RuntimeException(
|
||||||
rtl::OUString(
|
rtl::OUString(
|
||||||
@@ -744,7 +753,21 @@ JavaVirtualMachine::initialize(css::uno::Sequence< css::uno::Any > const &
|
|||||||
"jvmaccess::UnoVirtualMachine::CreationException")),
|
"jvmaccess::UnoVirtualMachine::CreationException")),
|
||||||
static_cast< cppu::OWeakObject * >(this));
|
static_cast< cppu::OWeakObject * >(this));
|
||||||
}
|
}
|
||||||
m_xVirtualMachine = vm;
|
}
|
||||||
|
}
|
||||||
|
if (!m_xUnoVirtualMachine.is()) {
|
||||||
|
throw css::lang::IllegalArgumentException(
|
||||||
|
rtl::OUString(
|
||||||
|
RTL_CONSTASCII_USTRINGPARAM(
|
||||||
|
"sequence of exactly one any containing either (a) a"
|
||||||
|
" com.sun.star.beans.NamedValue with Name"
|
||||||
|
" \"UnoVirtualMachine\" and Value a hyper representing a"
|
||||||
|
" non-null pointer to a jvmaccess:UnoVirtualMachine, or (b)"
|
||||||
|
" a hyper representing a non-null pointer to a"
|
||||||
|
" jvmaccess::VirtualMachine required")),
|
||||||
|
static_cast< cppu::OWeakObject * >(this), 0);
|
||||||
|
}
|
||||||
|
m_xVirtualMachine = m_xUnoVirtualMachine->getVirtualMachine();
|
||||||
}
|
}
|
||||||
|
|
||||||
rtl::OUString SAL_CALL JavaVirtualMachine::getImplementationName()
|
rtl::OUString SAL_CALL JavaVirtualMachine::getImplementationName()
|
||||||
|
Reference in New Issue
Block a user