summaryrefslogtreecommitdiff
path: root/cppuhelper/source/servicemanager.cxx
AgeCommit message (Collapse)Author
2014-10-08fdo#80927: css.office.Quickstart should be single-instance service.Matúš Kukan
Incorrectly converted in a384b21cc40818bf3c918951a086a30b5d9d8022 where SFX_IMPL_ONEINSTANCEFACTORY was used. AFAICS it's the first converted single-instance service which implements css::lang::XInitialization. That's kind of strange but can do its job. sbergman@redhat.com: Three things were necessary in order to not call the ~ShutdownIcon code too late during exit now: * Move the relevant code from ~ShutdownIcon to ShutdownIcon::disposing. * Add a dummy <singleton name="com.sun.star.office.theQuickstart"/> so the service manager will eventually dispose the (single) instance. * In cppuhelper::ServiceManager::Data::Implementation::createInstanceWithArguments do not shortcut updateDisposeSingleton in that odd case of calling createInstanceWithArguments on an implementation that (effectively) is a singleton (as otherwise the service manager would still not dispose it). It looks to me like that "return inst;" was an inadvertent leftover in 874c481801434d4fac3c50f076bff0fe3a3988b6 "Simplify service manager's tracking of singletons" and wasn't intended to serve some subtle purpose. Change-Id: Icd4d3168ec0bbb820b17ac321fe897ac9f9ce7fc
2014-09-25Eliminate memory leak due to circular shared_ptrMatthew J. Francis
Without this, a Data::Implementation can have a circular reference of shared_ptr to itself through .factory1 Change-Id: Ie05545e7ecc0ae85256d2c374fe79f0c678ccf64 Signed-off-by: Stephan Bergmann <sbergman@redhat.com>
2014-08-08Remove redundant inclusions of header "cppuhelper/shlib.h"Matthew Pottage
Change-Id: Iab402035613a6cc96b7b4ebd2981a1fd0f8bed23 Signed-off-by: Stephan Bergmann <sbergman@redhat.com>
2014-06-04cppuhelper: fix includesThomas Arnhold
Change-Id: I0e6bc822d19cf266dea716fe92f2ccd08d87c51f
2014-05-23remove boilerplate in UNO Exception constructor callsNoel Grandin
Now that we have default values for Exception constructor params, remove lots of boilerplate code. Change-Id: I620bd641eecfed38e6123873b3b94aaf47922e74
2014-04-04fix creating com.sun.star.sheet.Solver instanceMatúš Kukan
Change-Id: I100d45b8f749ece5496d8e5a0e3343dee96f7138
2014-03-26First batch of adding SAL_OVERRRIDE to overriding function declarationsStephan Bergmann
...mostly done with a rewriting Clang plugin, with just some manual tweaking necessary to fix poor macro usage. Change-Id: I71fa20213e86be10de332ece0aa273239df7b61a
2014-03-18Find places where OUString and OString are passed by value.Noel Grandin
It's not very efficient, because we generally end up copying it twice - once into the parameter and again into the destination OUString. So I create a clang plugin that finds such places and generates a warning so that we can convert them to pass-by-reference. Change-Id: I5341a6ea9e3190f4b4c05c42c85595e3dcd83361
2014-02-26cppuhelper: retrofit std::exception into overriding exception specsStephan Bergmann
Change-Id: I56e32131b7991ee9948ce46765632eb823d463b3
2014-02-07Simplify service manager's tracking of singletonsStephan Bergmann
It only tracks whether to dispose a singleton instance now, and (at least conceptually) no longer remembers the single instance (apart from what is necessary in order to call dispose on it), as the underlying implementation already needs to keep track of that to support direct calls of constructor functions. Change-Id: I154bf05438e1db099c1c5ffb1c56377725c6bfc6
2014-01-22Introduce static inline cppu::acquire(), and make use of that.Jan Holesovsky
This is much better approach compared to the callback function, as it allows passing arguments to the c++ constructor directly, while still allowing some additional initialization after having acquired the instance. Change-Id: I5a0f981915dd58f1522ee6054e53a3550b29d624
2014-01-21Change _get_implementation()'s not to do initialization directly.Jan Holesovsky
Many of the initalizations (in eg. framework) have to be done on an acquire()'d object, so instead of doing the initialization directly, return the initialization member function back to the createInstance() / createInstanceWithContext() / ... and perform the initialization there. As a sideeffect, I belive the calling initialize() from servicemanager is not that much a hack any more - whoever converts the implementation to be constructor-base has the choice to provide the callback, or still initialize through XInitialization, where the callback is preferred by servicemanager when it exists. Change-Id: I8a87b75c54c1441ca0f184967d31ff4902fc4081
2014-01-20Simplify code; STATUS_LOADED => component||factory1||factory2Stephan Bergmann
Change-Id: I661eb69551eae3d888d156c6bd4291a532d0b6ab
2014-01-20Minimize the constructor functions to a bare minimum.Jan Holesovsky
Most of the constructors are supposed to be only a call of new TheInstance(arguments) or an equivalent; so let's just change the constructor caller accordingly, to accept unacquired new instance. If there are exceptions that need to do more heavy lifting, they do not have to use the constructor feature, or there can be a wrapper for the real implementation, doing the additional work in their (C++) constructor. Change-Id: I035c378778aeda60d15af4e56ca3761c586d5ded
2014-01-16Support for singleton constructor functionsStephan Bergmann
The service manager now keeps track of instances of singleton implementations (i.e., implementations whose XML description lists at least one <singleton ...>). These instances will be disposed either when the service manager is disposed, or, for instances that have been instantiated into the component context's /singleton/* map, when the component context is disposed. This change allows to use constructor functions for such singleton implementations, too. Change-Id: I220c9ddc9824e4d7f7556daefb599e2ec36b0e6c
2014-01-15Use const& arguments parameter for ctor functions.Matúš Kukan
Change-Id: I19ce8bd1a23123ac9a62a7fc95cd54fea5315221
2014-01-15Initialize constructor based implementations in one place.Matúš Kukan
Change-Id: I324f25bb5ec7d792c3e015815f2a11b08f519764
2013-12-19FactoryWrapper is a misnomer nowStephan Bergmann
Change-Id: I59d77b4712e273318409a326c835861dc467596c
2013-12-19Add .component <implementation constructor="..." featureStephan Bergmann
...to directly call constructor functions of ComponentContext-based C++ implementations of (non-single-instance) UNO services. The case where these calls would need to be bridged across different environments (e.g., from gcc3 to gcc3:affine) is not yet implemented. bootstrap.component and expwrap.component are adapted accordingly as a proof-of- concept (which had previously been adapted to use the prefix="direct" feature, which may become unnecessary again in the end, depending on how to handle single-instance services/singletons). More to follow. Change-Id: I18682d75bcd29d3d427e31331b4ce8161dbb846d
2013-12-16Allow setting environment value directly in .component filesStephan Bergmann
...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
2013-12-16Parser::attrImplementation_ can be a local varStephan Bergmann
Change-Id: I402040a4b747d457b1b7a3695d0b3567fa7bf478
2013-12-16Clean-up: The "_" delimiter is logically not part of the prefixStephan Bergmann
Change-Id: I60329aabe465da48aac11ad76dd72e9a0ae4d078
2013-12-13[API CHANGE] remove cppu::loadSharedLibComponentFactory w/ rPrefix againStephan Bergmann
...it was never meant to be called by client code anyway and is no longer needed to be exposed since the global service manager implementation moved to cppuhelper. Change-Id: If2d0510b2364084d36edeb156a3459d9b8aeb983
2013-10-11Not being able to honor a "prefix" is a rather hard errorStephan Bergmann
It happens when an extension has just been live-deployed into the running soffice process and then trying to instantiate out-of-process in an additional uno process one of that extension's shared library components and that component ---erroneously---uses the "prefix" feature. (Which can be reproduced with the mysql-connector-ooo.oxt extension, --enable-ext-mariadb-connector: "rm -rf instdir/*/share/extensions/mysql-connector-ooo", "instdir/*/program/soffice workdir/*/Extension/mysql-connector.oxt", install the per-user, then "File - New - Database - Connect to an existing database: MySQL - Next >> - Connect directly - Next >> - Database name: foo - Server / Port - Server: bar - Next >> - Test Connection", crash.) Change-Id: Ibab2ad31199eec5dc26ffa337a5e3e7490f782d7
2013-08-19Use upcasting Reference copy ctorStephan Bergmann
Change-Id: Iab00310e2e6fcf8a43617363cf095a1bccfd9751
2013-04-07mass removal of rtl:: prefixes for O(U)String*Luboš Luňák
Modules sal, salhelper, cppu, cppuhelper, codemaker (selectively) and odk have kept them, in order not to break external API (the automatic using declaration is LO-internal). Change-Id: I588fc9e0c45b914f824f91c0376980621d730f09
2013-02-17cppcheck: Iterator i used after element has been erasedStephan Bergmann
Change-Id: Id8eb6a475dafcaddc98ddc48627fa8090e91cf4f
2013-01-16Move addSingletonContextEntries to ServiceManagerStephan Bergmann
Change-Id: I2a4c5b1f1f735e2bf5a8670d2f957f84388f0164
2013-01-16UNO methods are no longer called directly on ServiceManagerStephan Bergmann
Change-Id: I037ed9899873e614e9e10c89f1f8a74efa73d737
2013-01-16Extract servicemanager and typedescriptionprovider from defaultbootstrapStephan Bergmann
Change-Id: I94fe7e68c5a49e591a625e9bf62108acac69428d