diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2013-12-16 21:39:14 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2013-12-16 21:43:12 +0100 |
commit | b1d65c9f1535c9ef283d2a91a225359e5983f747 (patch) | |
tree | 9fa6c419d271067578f716167073e0121b9693c0 /connectivity | |
parent | 9630b973553c7db8e591adb34470228965f01491 (diff) |
Allow setting environment value directly in .component files
...for internal loader="com.sun.star.loader.SharedLibrary" components, instead
of exported component_getImplementationEnvironmen (or implicit
CPPU_CURRENT_LANGUAGE_BINDING_NAME). Adapted a few .component files as proof-
of-concept, more to follow.
Change-Id: I82332e0a48e6fc1da245990bb72265fe6e58447e
Diffstat (limited to 'connectivity')
-rw-r--r-- | connectivity/source/drivers/ado/Aservices.cxx | 9 | ||||
-rw-r--r-- | connectivity/source/drivers/ado/ado.component | 3 | ||||
-rw-r--r-- | connectivity/source/drivers/jdbc/jdbc.component | 13 | ||||
-rw-r--r-- | connectivity/source/drivers/jdbc/jservices.cxx | 16 |
4 files changed, 14 insertions, 27 deletions
diff --git a/connectivity/source/drivers/ado/Aservices.cxx b/connectivity/source/drivers/ado/Aservices.cxx index a5ef10115da8..bd1320128f11 100644 --- a/connectivity/source/drivers/ado/Aservices.cxx +++ b/connectivity/source/drivers/ado/Aservices.cxx @@ -19,7 +19,6 @@ #include "ado/ADriver.hxx" #include <cppuhelper/factory.hxx> -#include <uno/lbnames.h> using namespace connectivity::ado; using ::com::sun::star::uno::Reference; @@ -75,14 +74,6 @@ struct ProviderRequest }; //--------------------------------------------------------------------------------------- -extern "C" SAL_DLLPUBLIC_EXPORT void SAL_CALL ado_component_getImplementationEnvironment( - const sal_Char **ppEnvTypeName, - uno_Environment ** /*ppEnv*/) -{ - *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME ":affine"; -} - -//--------------------------------------------------------------------------------------- extern "C" SAL_DLLPUBLIC_EXPORT void* SAL_CALL ado_component_getFactory( const sal_Char* pImplementationName, void* pServiceManager, diff --git a/connectivity/source/drivers/ado/ado.component b/connectivity/source/drivers/ado/ado.component index 9286ca0bd0a5..b90673ae8644 100644 --- a/connectivity/source/drivers/ado/ado.component +++ b/connectivity/source/drivers/ado/ado.component @@ -17,7 +17,8 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . --> -<component loader="com.sun.star.loader.SharedLibrary" prefix="ado" +<component loader="com.sun.star.loader.SharedLibrary" + environment="@CPPU_ENV@:affine" prefix="ado" xmlns="http://openoffice.org/2010/uno-components"> <implementation name="com.sun.star.comp.sdbc.ado.ODriver"> <service name="com.sun.star.sdbc.Driver"/> diff --git a/connectivity/source/drivers/jdbc/jdbc.component b/connectivity/source/drivers/jdbc/jdbc.component index 5b8b151ba3dc..07fd03c68467 100644 --- a/connectivity/source/drivers/jdbc/jdbc.component +++ b/connectivity/source/drivers/jdbc/jdbc.component @@ -17,7 +17,18 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . --> -<component loader="com.sun.star.loader.SharedLibrary" prefix="jdbc" +<!-- Recent Java 6 VMs make calls to JNI Attach/DetachCurrentThread (which this + code does extensively) very expensive. A follow-up JVM fix reduced the + overhead significantly again for all threads but the main thread. So a + quick hack to improve performance of this component again is to confine it + in the affine apartment (where all code will run on a single, dedicated + thread that is guaranteed no to be the main thread). However, a better fix + would still be to redesign the code so that it does not call + Attach/DetachCurrentThread so frequently: +--> + +<component loader="com.sun.star.loader.SharedLibrary" + environment="@CPPU_ENV@:affine" prefix="jdbc" xmlns="http://openoffice.org/2010/uno-components"> <implementation name="com.sun.star.comp.sdbc.JDBCDriver"> <service name="com.sun.star.sdbc.Driver"/> diff --git a/connectivity/source/drivers/jdbc/jservices.cxx b/connectivity/source/drivers/jdbc/jservices.cxx index 81cfc3c09f09..438bb28b3318 100644 --- a/connectivity/source/drivers/jdbc/jservices.cxx +++ b/connectivity/source/drivers/jdbc/jservices.cxx @@ -19,7 +19,6 @@ #include "java/sql/Driver.hxx" #include <cppuhelper/factory.hxx> -#include <uno/lbnames.h> using namespace connectivity; using ::com::sun::star::uno::Reference; @@ -76,21 +75,6 @@ struct ProviderRequest void* getProvider() const { return xRet.get(); } }; -extern "C" SAL_DLLPUBLIC_EXPORT void SAL_CALL -jdbc_component_getImplementationEnvironment( - char const ** ppEnvTypeName, uno_Environment **) -{ - // Recent Java 6 VMs make calls to JNI Attach/DetachCurrentThread (which - // this code does extensively) very expensive. A follow-up JVM fix reduced - // the overhead significantly again for all threads but the main thread. So - // a quick hack to improve performance of this component again is to confine - // it in the affine apartment (where all code will run on a single, - // dedicated thread that is guaranteed no to be the main thread). However, - // a better fix would still be to redesign the code so that it does not call - // Attach/DetachCurrentThread so frequently: - *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME ":affine"; -} - extern "C" SAL_DLLPUBLIC_EXPORT void* SAL_CALL jdbc_component_getFactory( const sal_Char* pImplementationName, void* pServiceManager, |