diff options
author | Noel Grandin <noel@peralex.com> | 2013-01-16 15:16:05 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2013-02-11 08:02:10 +0200 |
commit | 9a36294079a13d713490ed754be441d9dbc214ce (patch) | |
tree | 6bd7c23e2cdfba1d03dedf689646e67bae0cca54 | |
parent | 7841fd1536e018defaf9cbeb283cb82b687f95e1 (diff) |
fdo#46808, Adapt java::JavaVirtualMachine UNO service to new style
Change-Id: Ib0329b9cdc4290ce98c4182e8466c1b44b408341
-rw-r--r-- | connectivity/inc/connectivity/CommonTools.hxx | 6 | ||||
-rw-r--r-- | connectivity/source/commontools/CommonTools.cxx | 17 | ||||
-rw-r--r-- | connectivity/source/drivers/jdbc/JConnection.cxx | 5 | ||||
-rw-r--r-- | connectivity/source/drivers/jdbc/Object.cxx | 10 | ||||
-rw-r--r-- | connectivity/source/inc/java/lang/Object.hxx | 9 | ||||
-rw-r--r-- | connectivity/source/inc/java/sql/Connection.hxx | 1 | ||||
-rw-r--r-- | dbaccess/source/filter/xml/xmlFileBasedDatabase.cxx | 2 | ||||
-rw-r--r-- | dbaccess/source/filter/xml/xmlTable.cxx | 2 | ||||
-rw-r--r-- | dbaccess/source/filter/xml/xmlfilter.cxx | 22 | ||||
-rw-r--r-- | dbaccess/source/filter/xml/xmlfilter.hxx | 1 | ||||
-rw-r--r-- | dbaccess/source/ui/dlg/ConnectionPage.cxx | 2 | ||||
-rw-r--r-- | dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx | 4 | ||||
-rw-r--r-- | dbaccess/source/ui/dlg/detailpages.cxx | 2 | ||||
-rw-r--r-- | offapi/type_reference/types.rdb | bin | 7440384 -> 7440384 bytes | |||
-rw-r--r-- | udkapi/UnoApi_udkapi.mk | 6 | ||||
-rw-r--r-- | udkapi/com/sun/star/java/JavaVirtualMachine.idl | 17 | ||||
-rw-r--r-- | vcl/source/window/syschild.cxx | 7 |
17 files changed, 47 insertions, 66 deletions
diff --git a/connectivity/inc/connectivity/CommonTools.hxx b/connectivity/inc/connectivity/CommonTools.hxx index 6a1dfc9de9ad..f562d6720a57 100644 --- a/connectivity/inc/connectivity/CommonTools.hxx +++ b/connectivity/inc/connectivity/CommonTools.hxx @@ -31,7 +31,7 @@ #include <com/sun/star/sdbcx/XColumnsSupplier.hpp> #include <osl/interlck.h> #include <jvmaccess/virtualmachine.hxx> -#include <com/sun/star/lang/XMultiServiceFactory.hpp> +#include <com/sun/star/uno/XComponentContext.hpp> #include "connectivity/dbtoolsdllapi.hxx" namespace com { namespace sun { namespace star { namespace util { @@ -158,12 +158,12 @@ namespace connectivity /** creates a java virtual machine - @param _rxFactory + @param _rxContext The ORB. @return The JavaVM. */ - OOO_DLLPUBLIC_DBTOOLS ::rtl::Reference< jvmaccess::VirtualMachine > getJavaVM(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxFactory); + OOO_DLLPUBLIC_DBTOOLS ::rtl::Reference< jvmaccess::VirtualMachine > getJavaVM(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _rxContext); /** return <TRUE/> if the java class exists, otherwise <FALSE/>. @param _pJVM diff --git a/connectivity/source/commontools/CommonTools.cxx b/connectivity/source/commontools/CommonTools.cxx index d8bb7ff7efe4..918193402ba7 100644 --- a/connectivity/source/commontools/CommonTools.cxx +++ b/connectivity/source/commontools/CommonTools.cxx @@ -30,7 +30,7 @@ #include <cppuhelper/interfacecontainer.h> #include "TConnection.hxx" #include <comphelper/types.hxx> -#include <com/sun/star/java/XJavaVM.hpp> +#include <com/sun/star/java/JavaVirtualMachine.hpp> #include <rtl/process.h> using namespace ::comphelper; @@ -44,8 +44,8 @@ namespace connectivity using namespace ::com::sun::star::uno; using namespace ::com::sun::star::lang; using namespace ::com::sun::star::beans; + using namespace ::com::sun::star::java; using namespace dbtools; - namespace starjava = com::sun::star::java; //------------------------------------------------------------------------------ const sal_Unicode CHAR_PLACE = '_'; const sal_Unicode CHAR_WILD = '%'; @@ -153,21 +153,16 @@ namespace connectivity } // ----------------------------------------------------------------------------- - ::rtl::Reference< jvmaccess::VirtualMachine > getJavaVM(const Reference<XMultiServiceFactory >& _rxFactory) + ::rtl::Reference< jvmaccess::VirtualMachine > getJavaVM(const Reference<XComponentContext >& _rxContext) { ::rtl::Reference< jvmaccess::VirtualMachine > aRet; - OSL_ENSURE(_rxFactory.is(),"No XMultiServiceFactory a.v.!"); - if(!_rxFactory.is()) + OSL_ENSURE(_rxContext.is(),"No XMultiServiceFactory a.v.!"); + if(!_rxContext.is()) return aRet; try { - Reference< starjava::XJavaVM > xVM(_rxFactory->createInstance( - rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.java.JavaVirtualMachine"))), UNO_QUERY); - - OSL_ENSURE(_rxFactory.is(),"InitJava: I have no factory!"); - if (!xVM.is() || !_rxFactory.is()) - throw Exception(); // -2; + Reference< XJavaVM > xVM = JavaVirtualMachine::create(_rxContext); Sequence<sal_Int8> processID(16); rtl_getGlobalProcessId( (sal_uInt8*) processID.getArray() ); diff --git a/connectivity/source/drivers/jdbc/JConnection.cxx b/connectivity/source/drivers/jdbc/JConnection.cxx index 3ef5f0c60361..4eb02fc13cf5 100644 --- a/connectivity/source/drivers/jdbc/JConnection.cxx +++ b/connectivity/source/drivers/jdbc/JConnection.cxx @@ -257,8 +257,9 @@ IMPLEMENT_SERVICE_INFO(java_sql_Connection,"com.sun.star.sdbcx.JConnection","com jclass java_sql_Connection::theClass = 0; java_sql_Connection::java_sql_Connection( const java_sql_Driver& _rDriver ) - :java_lang_Object( _rDriver.getContext().getLegacyServiceFactory() ) + :java_lang_Object() ,OSubComponent<java_sql_Connection, java_sql_Connection_BASE>((::cppu::OWeakObject*)(&_rDriver), this) + ,m_xContext( _rDriver.getContext().getUNOContext() ) ,m_pDriver( &_rDriver ) ,m_pDriverobject(NULL) ,m_pDriverClassLoader() @@ -772,7 +773,7 @@ sal_Bool java_sql_Connection::construct(const ::rtl::OUString& url, const Sequence< PropertyValue >& info) { { // initialize the java vm - ::rtl::Reference< jvmaccess::VirtualMachine > xTest = java_lang_Object::getVM(getORB()); + ::rtl::Reference< jvmaccess::VirtualMachine > xTest = java_lang_Object::getVM(m_xContext); if ( !xTest.is() ) throwGenericSQLException(STR_NO_JAVA,*this); } diff --git a/connectivity/source/drivers/jdbc/Object.cxx b/connectivity/source/drivers/jdbc/Object.cxx index 5f1093a3691f..9395a11771ac 100644 --- a/connectivity/source/drivers/jdbc/Object.cxx +++ b/connectivity/source/drivers/jdbc/Object.cxx @@ -50,11 +50,11 @@ using namespace ::com::sun::star::lang; return s_VM; } // ----------------------------------------------------------------------------- -::rtl::Reference< jvmaccess::VirtualMachine > java_lang_Object::getVM(const Reference<XMultiServiceFactory >& _rxFactory) +::rtl::Reference< jvmaccess::VirtualMachine > java_lang_Object::getVM(const Reference<XComponentContext >& _rxContext) { ::rtl::Reference< jvmaccess::VirtualMachine > xVM = getJavaVM2(); - if ( !xVM.is() && _rxFactory.is() ) - xVM = getJavaVM2(::connectivity::getJavaVM(_rxFactory)); + if ( !xVM.is() && _rxContext.is() ) + xVM = getJavaVM2(::connectivity::getJavaVM(_rxContext)); return xVM; } @@ -101,8 +101,8 @@ jclass java_lang_Object::getMyClass() const return theClass; } // the actual constructor -java_lang_Object::java_lang_Object(const Reference<XMultiServiceFactory >& _rxFactory) - : m_xFactory(_rxFactory),object( 0 ) +java_lang_Object::java_lang_Object() + : object( 0 ) { SDBThreadAttach::addRef(); } diff --git a/connectivity/source/inc/java/lang/Object.hxx b/connectivity/source/inc/java/lang/Object.hxx index add7609eb82a..147567db3488 100644 --- a/connectivity/source/inc/java/lang/Object.hxx +++ b/connectivity/source/inc/java/lang/Object.hxx @@ -23,6 +23,7 @@ #include <osl/thread.h> #include <com/sun/star/sdbc/SQLException.hpp> #include <com/sun/star/lang/XMultiServiceFactory.hpp> +#include <com/sun/star/uno/XComponentContext.hpp> #include <osl/diagnose.h> #include <jvmaccess/virtualmachine.hxx> #include <memory> @@ -72,9 +73,6 @@ namespace connectivity java_lang_Object& operator= (java_lang_Object&); java_lang_Object(java_lang_Object&); - // Only to destroy the C++ pointer of Java objects derived from JSbxObject - ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > m_xFactory; - protected: // The Java handle to this class jobject object; @@ -90,7 +88,7 @@ namespace connectivity java_lang_Object( JNIEnv * pEnv, jobject myObj ); // The actual ctor - java_lang_Object(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxFactory=NULL); + java_lang_Object(); virtual ~java_lang_Object(); @@ -101,7 +99,6 @@ namespace connectivity void clearObject(); virtual ::rtl::OUString toString() const; - ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > getORB() { return m_xFactory; } static void ThrowSQLException(JNIEnv * pEnv,const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface> & _rContext); static void ThrowLoggedSQLException( @@ -110,7 +107,7 @@ namespace connectivity const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _rxContext ); - static ::rtl::Reference< jvmaccess::VirtualMachine > getVM(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxFactory=NULL); + static ::rtl::Reference< jvmaccess::VirtualMachine > getVM(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _rxContext=NULL); static jclass findMyClass(const char* _pClassName); void obtainMethodId(JNIEnv* _pEnv, const char* _pMethodName, const char* _pSignature, jmethodID& _inout_MethodID) const; diff --git a/connectivity/source/inc/java/sql/Connection.hxx b/connectivity/source/inc/java/sql/Connection.hxx index 9b6559923196..3af3d3c5e849 100644 --- a/connectivity/source/inc/java/sql/Connection.hxx +++ b/connectivity/source/inc/java/sql/Connection.hxx @@ -43,6 +43,7 @@ namespace connectivity public OAutoRetrievingBase { friend class OSubComponent<java_sql_Connection, java_sql_Connection_BASE>; + ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > m_xContext; const java_sql_Driver* m_pDriver; jobject m_pDriverobject; jdbc::GlobalRef< jobject > diff --git a/dbaccess/source/filter/xml/xmlFileBasedDatabase.cxx b/dbaccess/source/filter/xml/xmlFileBasedDatabase.cxx index 623bacdd1f5c..5afe4c9a86f7 100644 --- a/dbaccess/source/filter/xml/xmlFileBasedDatabase.cxx +++ b/dbaccess/source/filter/xml/xmlFileBasedDatabase.cxx @@ -100,7 +100,7 @@ OXMLFileBasedDatabase::OXMLFileBasedDatabase( ODBFilter& rImport, } if ( !(sLocation.isEmpty() || sMediaType.isEmpty()) ) { - ::dbaccess::ODsnTypeCollection aTypeCollection(comphelper::getComponentContext(rImport.getORB())); + ::dbaccess::ODsnTypeCollection aTypeCollection(comphelper::getComponentContext(rImport.getServiceFactory())); ::rtl::OUString sURL(aTypeCollection.getDatasourcePrefixFromMediaType(sMediaType,sFileTypeExtension)); sURL += sLocation; try diff --git a/dbaccess/source/filter/xml/xmlTable.cxx b/dbaccess/source/filter/xml/xmlTable.cxx index e8a124c5c1b9..ca8ffd19ead7 100644 --- a/dbaccess/source/filter/xml/xmlTable.cxx +++ b/dbaccess/source/filter/xml/xmlTable.cxx @@ -99,7 +99,7 @@ OXMLTable::OXMLTable( ODBFilter& _rImport aValue.Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Parent")); aValue.Value <<= m_xParentContainer; aArguments[1] <<= aValue; - m_xTable.set(GetOwnImport().getORB()->createInstanceWithArguments(m_sServiceName,aArguments),UNO_QUERY); + m_xTable.set(GetOwnImport().getServiceFactory()->createInstanceWithArguments(m_sServiceName,aArguments),UNO_QUERY); } // ----------------------------------------------------------------------------- diff --git a/dbaccess/source/filter/xml/xmlfilter.cxx b/dbaccess/source/filter/xml/xmlfilter.cxx index 21c2da5eb152..0187a0b2158d 100644 --- a/dbaccess/source/filter/xml/xmlfilter.cxx +++ b/dbaccess/source/filter/xml/xmlfilter.cxx @@ -83,8 +83,8 @@ namespace dbaxml { public: typedef enum { E_JAVA, E_CALC } StartType; - FastLoader(uno::Reference< lang::XMultiServiceFactory > const & _xFactory,StartType _eType) - :m_xFactory(_xFactory) + FastLoader(uno::Reference< uno::XComponentContext > const & _xContext,StartType _eType) + :m_xContext(_xContext) ,m_eWhat(_eType) {} @@ -95,7 +95,7 @@ namespace dbaxml virtual void SAL_CALL run(); virtual void SAL_CALL onTerminated(); private: - uno::Reference< lang::XMultiServiceFactory > m_xFactory; + uno::Reference< uno::XComponentContext > m_xContext; StartType m_eWhat; }; @@ -109,7 +109,7 @@ namespace dbaxml s_bFirstTime = false; try { - ::rtl::Reference< jvmaccess::VirtualMachine > xJVM = ::connectivity::getJavaVM(m_xFactory); + ::rtl::Reference< jvmaccess::VirtualMachine > xJVM = ::connectivity::getJavaVM(m_xContext); } catch (const uno::Exception&) { @@ -125,7 +125,7 @@ namespace dbaxml s_bFirstTime = false; try { - uno::Reference<frame::XDesktop2> xDesktop = frame::Desktop::create( comphelper::getComponentContext(m_xFactory) ); + uno::Reference<frame::XDesktop2> xDesktop = frame::Desktop::create( m_xContext ); const ::rtl::OUString sTarget(RTL_CONSTASCII_USTRINGPARAM("_blank")); sal_Int32 nFrameSearchFlag = frame::FrameSearchFlag::TASKS | frame::FrameSearchFlag::CREATE; uno::Reference< frame::XFrame> xFrame = xDesktop->findFrame(sTarget,nFrameSearchFlag); @@ -144,7 +144,7 @@ namespace dbaxml aArgs[nLen].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Hidden")); aArgs[nLen++].Value <<= sal_True; - ::comphelper::MimeConfigurationHelper aHelper( comphelper::getComponentContext(m_xFactory) ); + ::comphelper::MimeConfigurationHelper aHelper( m_xContext ); SvtModuleOptions aModuleOptions; uno::Reference< frame::XModel > xModel(xFrameLoad->loadComponentFromURL( aModuleOptions.GetFactoryEmptyDocumentURL( aModuleOptions.ClassifyFactoryByServiceName( aHelper.GetDocServiceNameFromMediaType(MIMETYPE_OASIS_OPENDOCUMENT_SPREADSHEET) )), @@ -169,14 +169,14 @@ namespace dbaxml class DatasourceURLListener : public ::cppu::WeakImplHelper1< beans::XPropertyChangeListener > { - uno::Reference< lang::XMultiServiceFactory > m_xFactory; + uno::Reference< uno::XComponentContext > m_xContext; ::dbaccess::ODsnTypeCollection m_aTypeCollection; DatasourceURLListener(const DatasourceURLListener&); void operator =(const DatasourceURLListener&); protected: virtual ~DatasourceURLListener(){} public: - DatasourceURLListener(uno::Reference< lang::XMultiServiceFactory > const & _xFactory) : m_xFactory(_xFactory),m_aTypeCollection(comphelper::getComponentContext(_xFactory)){} + DatasourceURLListener(uno::Reference< uno::XComponentContext > const & _xContext) : m_xContext(_xContext), m_aTypeCollection(_xContext){} // XPropertyChangeListener virtual void SAL_CALL propertyChange( const beans::PropertyChangeEvent& _rEvent ) throw (uno::RuntimeException) { @@ -186,11 +186,11 @@ namespace dbaxml if ( m_aTypeCollection.needsJVM(sURL) ) { - pCreatorThread = new FastLoader(m_xFactory,FastLoader::E_JAVA); + pCreatorThread = new FastLoader(m_xContext, FastLoader::E_JAVA); } else if ( sURL.matchIgnoreAsciiCaseAsciiL("sdbc:calc:",10,0) ) { - pCreatorThread = new FastLoader(m_xFactory,FastLoader::E_CALC); + pCreatorThread = new FastLoader(m_xContext, FastLoader::E_CALC); } if ( pCreatorThread ) { @@ -446,7 +446,7 @@ sal_Bool ODBFilter::implImport( const Sequence< PropertyValue >& rDescriptor ) uno::Reference<sdb::XOfficeDatabaseDocument> xOfficeDoc(GetModel(),UNO_QUERY_THROW); m_xDataSource.set(xOfficeDoc->getDataSource(),UNO_QUERY_THROW); - uno::Reference<beans::XPropertyChangeListener> xListener = new DatasourceURLListener(getServiceFactory()); + uno::Reference<beans::XPropertyChangeListener> xListener = new DatasourceURLListener( comphelper::getComponentContext(getServiceFactory())); m_xDataSource->addPropertyChangeListener(PROPERTY_URL,xListener); uno::Reference< XNumberFormatsSupplier > xNum(m_xDataSource->getPropertyValue(PROPERTY_NUMBERFORMATSSUPPLIER),UNO_QUERY); SetNumberFormatsSupplier(xNum); diff --git a/dbaccess/source/filter/xml/xmlfilter.hxx b/dbaccess/source/filter/xml/xmlfilter.hxx index 46237c813507..4b8303667aa4 100644 --- a/dbaccess/source/filter/xml/xmlfilter.hxx +++ b/dbaccess/source/filter/xml/xmlfilter.hxx @@ -124,7 +124,6 @@ public: virtual void SetViewSettings(const com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue>& aViewProps); virtual void SetConfigurationSettings(const com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue>& aConfigProps); - inline Reference< XMultiServiceFactory > getORB() { return getServiceFactory(); } inline Reference<XPropertySet> getDataSource() const { return m_xDataSource; } inline const TPropertyNameMap& getQuerySettings() const { return m_aQuerySettings;} diff --git a/dbaccess/source/ui/dlg/ConnectionPage.cxx b/dbaccess/source/ui/dlg/ConnectionPage.cxx index 925ac9ecfc49..77cfece9653c 100644 --- a/dbaccess/source/ui/dlg/ConnectionPage.cxx +++ b/dbaccess/source/ui/dlg/ConnectionPage.cxx @@ -318,7 +318,7 @@ namespace dbaui { if ( !m_aJavaDriver.GetText().isEmpty() ) { - ::rtl::Reference< jvmaccess::VirtualMachine > xJVM = ::connectivity::getJavaVM( Reference<XMultiServiceFactory>(m_pAdminDialog->getORB()->getServiceManager(), UNO_QUERY_THROW) ); + ::rtl::Reference< jvmaccess::VirtualMachine > xJVM = ::connectivity::getJavaVM( m_pAdminDialog->getORB() ); bSuccess = ::connectivity::existsJavaClassByName(xJVM,m_aJavaDriver.GetText()); } } diff --git a/dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx b/dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx index b4150effa75e..fa86f15622f0 100644 --- a/dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx +++ b/dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx @@ -557,7 +557,7 @@ DBG_NAME(OMySQLIntroPageSetup) if ( !m_aETDriverClass.GetText().isEmpty() ) { // TODO change jvmaccess - ::rtl::Reference< jvmaccess::VirtualMachine > xJVM = ::connectivity::getJavaVM( uno::Reference<lang::XMultiServiceFactory>(m_pAdminDialog->getORB()->getServiceManager(), uno::UNO_QUERY_THROW) ); + ::rtl::Reference< jvmaccess::VirtualMachine > xJVM = ::connectivity::getJavaVM( m_pAdminDialog->getORB() ); bSuccess = ::connectivity::existsJavaClassByName(xJVM,m_aETDriverClass.GetText()); } } @@ -677,7 +677,7 @@ DBG_NAME(OMySQLIntroPageSetup) if ( !m_aETDriverClass.GetText().isEmpty() ) { // TODO change jvmaccess - ::rtl::Reference< jvmaccess::VirtualMachine > xJVM = ::connectivity::getJavaVM( uno::Reference<lang::XMultiServiceFactory>(m_pAdminDialog->getORB()->getServiceManager(), uno::UNO_QUERY_THROW) ); + ::rtl::Reference< jvmaccess::VirtualMachine > xJVM = ::connectivity::getJavaVM( m_pAdminDialog->getORB() ); bSuccess = xJVM.is() && ::connectivity::existsJavaClassByName(xJVM,m_aETDriverClass.GetText()); } } diff --git a/dbaccess/source/ui/dlg/detailpages.cxx b/dbaccess/source/ui/dlg/detailpages.cxx index f79cab6d354c..0c62704e41c4 100644 --- a/dbaccess/source/ui/dlg/detailpages.cxx +++ b/dbaccess/source/ui/dlg/detailpages.cxx @@ -627,7 +627,7 @@ namespace dbaui if ( !m_aEDDriverClass.GetText().isEmpty() ) { // TODO change jvmaccess - ::rtl::Reference< jvmaccess::VirtualMachine > xJVM = ::connectivity::getJavaVM( Reference<XMultiServiceFactory>(m_pAdminDialog->getORB()->getServiceManager(), UNO_QUERY_THROW) ); + ::rtl::Reference< jvmaccess::VirtualMachine > xJVM = ::connectivity::getJavaVM( m_pAdminDialog->getORB() ); bSuccess = ::connectivity::existsJavaClassByName(xJVM,m_aEDDriverClass.GetText()); } } diff --git a/offapi/type_reference/types.rdb b/offapi/type_reference/types.rdb Binary files differindex 9b696b6b1d77..3528bb76df75 100644 --- a/offapi/type_reference/types.rdb +++ b/offapi/type_reference/types.rdb diff --git a/udkapi/UnoApi_udkapi.mk b/udkapi/UnoApi_udkapi.mk index e043fc951ddc..2d8abc63a9db 100644 --- a/udkapi/UnoApi_udkapi.mk +++ b/udkapi/UnoApi_udkapi.mk @@ -68,9 +68,6 @@ $(eval $(call gb_UnoApi_add_idlfiles_noheader,udkapi,udkapi/com/sun/star/io,\ TextInputStream \ TextOutputStream \ )) -$(eval $(call gb_UnoApi_add_idlfiles_noheader,udkapi,udkapi/com/sun/star/java,\ - JavaVirtualMachine \ -)) $(eval $(call gb_UnoApi_add_idlfiles_noheader,udkapi,udkapi/com/sun/star/lang,\ MultiServiceFactory \ RegistryServiceManager \ @@ -122,6 +119,9 @@ $(eval $(call gb_UnoApi_add_idlfiles_nohdl,udkapi,udkapi/com/sun/star/io,\ SequenceOutputStream \ TempFile \ )) +$(eval $(call gb_UnoApi_add_idlfiles_nohdl,udkapi,udkapi/com/sun/star/java,\ + JavaVirtualMachine \ +)) $(eval $(call gb_UnoApi_add_idlfiles_nohdl,udkapi,udkapi/com/sun/star/reflection,\ theCoreReflection \ ProxyFactory \ diff --git a/udkapi/com/sun/star/java/JavaVirtualMachine.idl b/udkapi/com/sun/star/java/JavaVirtualMachine.idl index 92e4375a526a..e5d049d21662 100644 --- a/udkapi/com/sun/star/java/JavaVirtualMachine.idl +++ b/udkapi/com/sun/star/java/JavaVirtualMachine.idl @@ -19,30 +19,19 @@ #ifndef __com_sun_star_java_JavaVirtualMachine_idl__ #define __com_sun_star_java_JavaVirtualMachine_idl__ +#include <com/sun/star/java/XJavaVM.idl> module com { module sun { module star { module java { - published interface XJavaVM; - published interface XJavaThreadRegister_11; - -// DocMerge from xml: service com::sun::star::java::JavaVirtualMachine -/** exports interfaces to handle a JavaVM and Java threads. +/** Exports interfaces to handle a Java VM. @deprecated A UNO service seems to be at the wrong abstraction level for this functionality. This should probably be replaced by an appropriate C/C++ API. */ -published service JavaVirtualMachine -{ - // DocMerge: empty anyway - interface XJavaVM; - - // DocMerge: empty anyway - interface XJavaThreadRegister_11; - -}; +published service JavaVirtualMachine : XJavaVM; }; }; }; }; diff --git a/vcl/source/window/syschild.cxx b/vcl/source/window/syschild.cxx index a107fc1ad7bd..9332bf11ac14 100644 --- a/vcl/source/window/syschild.cxx +++ b/vcl/source/window/syschild.cxx @@ -43,8 +43,7 @@ #include <comphelper/processfactory.hxx> #include <jvmaccess/virtualmachine.hxx> -#include <com/sun/star/java/XJavaVM.hpp> -#include <com/sun/star/java/XJavaThreadRegister_11.hpp> +#include <com/sun/star/java/JavaVirtualMachine.hpp> #include <com/sun/star/lang/XMultiServiceFactory.hpp> using namespace ::com::sun::star; @@ -235,14 +234,14 @@ sal_IntPtr SystemChildWindow::GetParentWindowHandle( sal_Bool bUseJava ) #ifdef SOLAR_JAVA else { - uno::Reference< lang::XMultiServiceFactory > xFactory( comphelper::getProcessServiceFactory() ); + uno::Reference< uno::XComponentContext > xContext( comphelper::getProcessComponentContext() ); if( GetSystemData()->aWindow > 0 ) { try { ::rtl::Reference< ::jvmaccess::VirtualMachine > xVM; - uno::Reference< java::XJavaVM > xJavaVM( xFactory->createInstance( rtl::OUString("com.sun.star.java.JavaVirtualMachine") ), uno::UNO_QUERY ); + uno::Reference< java::XJavaVM > xJavaVM = java::JavaVirtualMachine::create(xContext);; uno::Sequence< sal_Int8 > aProcessID( 17 ); rtl_getGlobalProcessId( (sal_uInt8*) aProcessID.getArray() ); |