summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatúš Kukan <matus.kukan@collabora.com>2014-01-22 14:05:06 +0100
committerStephan Bergmann <sbergman@redhat.com>2014-01-24 14:24:34 +0000
commitef597d80dc18f9662a50f3abad5d39d0fd76449e (patch)
tree343c0be676a4c41c76e1e14e3a3e48c9aa1329dd
parent4b1ecc4c7da84eee69c583222b62afbf6afed3ab (diff)
Introduce com.sun.star.task.theJobExecutor singleton.
To replace com.sun.star.task.JobExecutor single-instance service, incorrectly converted in 748aa84e9808ad31c6ff6b71459525c82de10e58 [including changes by Stephan Bergmann <sbergman@redhat.com>] Change-Id: I4cea2c63a20b5b22f6e1f822fb35fcc4d0397687 Reviewed-on: https://gerrit.libreoffice.org/7609 Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Tested-by: Stephan Bergmann <sbergman@redhat.com>
-rw-r--r--dbaccess/source/ui/dlg/dbwizsetup.cxx1
-rw-r--r--desktop/source/app/app.cxx4
-rw-r--r--desktop/source/app/check_ext_deps.cxx1
-rw-r--r--desktop/source/deployment/gui/license_dialog.cxx1
-rw-r--r--desktop/source/deployment/gui/license_dialog.hxx1
-rw-r--r--framework/inc/pch/precompiled_fwk.hxx2
-rw-r--r--framework/source/jobs/jobexecutor.cxx134
-rw-r--r--framework/source/services/frame.cxx4
-rw-r--r--framework/util/fwk.component1
-rwxr-xr-xoffapi/UnoApi_offapi.mk1
-rw-r--r--offapi/com/sun/star/task/AsyncJob.idl4
-rw-r--r--offapi/com/sun/star/task/Job.idl4
-rw-r--r--offapi/com/sun/star/task/JobExecutor.idl16
-rw-r--r--offapi/com/sun/star/task/XAsyncJob.idl2
-rw-r--r--offapi/com/sun/star/task/XJob.idl2
-rw-r--r--offapi/com/sun/star/task/XJobExecutor.idl2
-rw-r--r--offapi/com/sun/star/task/XJobListener.idl4
-rw-r--r--offapi/com/sun/star/task/theJobExecutor.idl43
-rw-r--r--reportdesign/source/filter/xml/dbloader2.hxx1
-rw-r--r--sfx2/inc/pch/precompiled_sfx.hxx2
-rw-r--r--sfx2/source/notify/eventsupplier.cxx1
-rw-r--r--sfx2/source/notify/globalevents.cxx4
22 files changed, 144 insertions, 91 deletions
diff --git a/dbaccess/source/ui/dlg/dbwizsetup.cxx b/dbaccess/source/ui/dlg/dbwizsetup.cxx
index f08047aa49e3..827be420a46e 100644
--- a/dbaccess/source/ui/dlg/dbwizsetup.cxx
+++ b/dbaccess/source/ui/dlg/dbwizsetup.cxx
@@ -59,7 +59,6 @@
#include <com/sun/star/frame/XComponentLoader.hpp>
#include <com/sun/star/frame/XModel.hpp>
#include <com/sun/star/ucb/SimpleFileAccess.hpp>
-#include <com/sun/star/task/XJobExecutor.hpp>
#include <com/sun/star/lang/XInitialization.hpp>
#include <com/sun/star/sdb/CommandType.hpp>
#include <com/sun/star/ucb/InteractiveIOException.hpp>
diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx
index 9b32f6cf1b68..43b99e117ce5 100644
--- a/desktop/source/app/app.cxx
+++ b/desktop/source/app/app.cxx
@@ -64,7 +64,7 @@
#include <com/sun/star/configuration/InstallationIncompleteException.hpp>
#include <com/sun/star/configuration/backend/BackendSetupException.hpp>
#include <com/sun/star/configuration/backend/BackendAccessException.hpp>
-#include <com/sun/star/task/JobExecutor.hpp>
+#include <com/sun/star/task/theJobExecutor.hpp>
#include <com/sun/star/task/OfficeRestartManager.hpp>
#include <com/sun/star/task/XRestartManager.hpp>
#include <com/sun/star/document/XEventListener.hpp>
@@ -2848,7 +2848,7 @@ void Desktop::DoFirstRunInitializations()
{
try
{
- Reference< XJobExecutor > xExecutor = JobExecutor::create( ::comphelper::getProcessComponentContext() );
+ Reference< XJobExecutor > xExecutor = theJobExecutor::get( ::comphelper::getProcessComponentContext() );
xExecutor->trigger( OUString("onFirstRunInitialization") );
}
catch(const ::com::sun::star::uno::Exception&)
diff --git a/desktop/source/app/check_ext_deps.cxx b/desktop/source/app/check_ext_deps.cxx
index 23c6b92c8bbb..d98fceb1da24 100644
--- a/desktop/source/app/check_ext_deps.cxx
+++ b/desktop/source/app/check_ext_deps.cxx
@@ -45,7 +45,6 @@
#include "com/sun/star/deployment/ui/LicenseDialog.hpp"
#include <com/sun/star/task/OfficeRestartManager.hpp>
#include <com/sun/star/task/XJob.hpp>
-#include <com/sun/star/task/XJobExecutor.hpp>
#include <com/sun/star/task/XInteractionApprove.hpp>
#include <com/sun/star/task/XInteractionAbort.hpp>
#include <com/sun/star/ui/dialogs/XExecutableDialog.hpp>
diff --git a/desktop/source/deployment/gui/license_dialog.cxx b/desktop/source/deployment/gui/license_dialog.cxx
index f67566164653..a0c3c18548c1 100644
--- a/desktop/source/deployment/gui/license_dialog.cxx
+++ b/desktop/source/deployment/gui/license_dialog.cxx
@@ -28,7 +28,6 @@
#include "vcl/msgbox.hxx"
#include "toolkit/helper/vclunohelper.hxx"
#include "com/sun/star/lang/XServiceInfo.hpp"
-#include "com/sun/star/task/XJobExecutor.hpp"
#include "svtools/svmedit.hxx"
#include "svl/lstner.hxx"
#include "vcl/xtextedt.hxx"
diff --git a/desktop/source/deployment/gui/license_dialog.hxx b/desktop/source/deployment/gui/license_dialog.hxx
index 24cfae66a7d4..acdf147c7e46 100644
--- a/desktop/source/deployment/gui/license_dialog.hxx
+++ b/desktop/source/deployment/gui/license_dialog.hxx
@@ -22,7 +22,6 @@
#include "dp_gui.h"
#include "cppuhelper/implbase1.hxx"
#include "com/sun/star/lang/XServiceInfo.hpp"
-#include "com/sun/star/task/XJobExecutor.hpp"
#include "com/sun/star/ui/dialogs/XExecutableDialog.hpp"
#include "boost/bind.hpp"
diff --git a/framework/inc/pch/precompiled_fwk.hxx b/framework/inc/pch/precompiled_fwk.hxx
index 4095d2a2c629..4d1790c3a1c1 100644
--- a/framework/inc/pch/precompiled_fwk.hxx
+++ b/framework/inc/pch/precompiled_fwk.hxx
@@ -179,7 +179,7 @@
#include <com/sun/star/style/XStyleFamiliesSupplier.hpp>
#include <com/sun/star/task/ErrorCodeRequest.hpp>
#include <com/sun/star/task/InteractionHandler.hpp>
-#include <com/sun/star/task/JobExecutor.hpp>
+#include <com/sun/star/task/theJobExecutor.hpp>
#include <com/sun/star/task/StatusIndicatorFactory.hpp>
#include <com/sun/star/task/XAsyncJob.hpp>
#include <com/sun/star/task/XInteractionAbort.hpp>
diff --git a/framework/source/jobs/jobexecutor.cxx b/framework/source/jobs/jobexecutor.cxx
index 7c8b7961ab26..f5605a2075b8 100644
--- a/framework/source/jobs/jobexecutor.cxx
+++ b/framework/source/jobs/jobexecutor.cxx
@@ -21,10 +21,6 @@
#include <jobs/joburl.hxx>
#include <jobs/configaccess.hxx>
#include <classes/converter.hxx>
-#include <threadhelp/transactionguard.hxx>
-#include <threadhelp/threadhelpbase.hxx>
-#include <threadhelp/readguard.hxx>
-#include <threadhelp/writeguard.hxx>
#include <general.h>
#include <stdtypes.h>
@@ -41,7 +37,7 @@
#include <com/sun/star/document/XEventListener.hpp>
#include <com/sun/star/frame/XModuleManager2.hpp>
-#include <cppuhelper/implbase4.hxx>
+#include <cppuhelper/compbase4.hxx>
#include <cppuhelper/supportsservice.hxx>
#include <unotools/configpaths.hxx>
#include <rtl/ref.hxx>
@@ -52,27 +48,26 @@ using namespace framework;
namespace {
+typedef cppu::WeakComponentImplHelper4<
+ css::lang::XServiceInfo
+ , css::task::XJobExecutor
+ , css::container::XContainerListener // => lang.XEventListener
+ , css::document::XEventListener >
+ Base;
+
/**
@short implements a job executor, which can be triggered from any code
@descr It uses the given trigger event to locate any registered job service
inside the configuration and execute it. Of course it controls the
liftime of such jobs too.
*/
-class JobExecutor : private ThreadHelpBase
- , public ::cppu::WeakImplHelper4<
- css::lang::XServiceInfo
- , css::task::XJobExecutor
- , css::container::XContainerListener // => lang.XEventListener
- , css::document::XEventListener >
+class JobExecutor : private osl::Mutex, public Base
{
private:
/** reference to the uno service manager */
css::uno::Reference< css::uno::XComponentContext > m_xContext;
- /** reference to the module info service */
- css::uno::Reference< css::frame::XModuleManager2 > m_xModuleManager;
-
/** cached list of all registered event names of cfg for call optimization. */
OUStringList m_lEvents;
@@ -82,6 +77,8 @@ private:
/** helper to allow us listen to the configuration without a cyclic dependency */
com::sun::star::uno::Reference<com::sun::star::container::XContainerListener> m_xConfigListener;
+ virtual void SAL_CALL disposing() SAL_OVERRIDE;
+
public:
JobExecutor( const css::uno::Reference< css::uno::XComponentContext >& xContext );
@@ -133,9 +130,8 @@ public:
reference to the uno service manager
*/
JobExecutor::JobExecutor( /*IN*/ const css::uno::Reference< css::uno::XComponentContext >& xContext )
- : ThreadHelpBase (&Application::GetSolarMutex() )
+ : Base (*static_cast<Mutex *>(this))
, m_xContext (xContext )
- , m_xModuleManager (css::frame::ModuleManager::create( m_xContext ))
, m_aConfig (xContext, OUString::createFromAscii(JobData::EVENTCFG_ROOT) )
{
}
@@ -172,9 +168,24 @@ void JobExecutor::initListeners()
JobExecutor::~JobExecutor()
{
- css::uno::Reference< css::container::XContainer > xNotifier(m_aConfig.cfg(), css::uno::UNO_QUERY);
- if (xNotifier.is())
- xNotifier->removeContainerListener(m_xConfigListener);
+ disposing();
+}
+
+void JobExecutor::disposing() {
+ css::uno::Reference<css::container::XContainer> notifier;
+ css::uno::Reference<css::container::XContainerListener> listener;
+ {
+ osl::MutexGuard g(rBHelper.rMutex);
+ if (m_aConfig.getMode() != ConfigAccess::E_CLOSED) {
+ notifier.set(m_aConfig.cfg(), css::uno::UNO_QUERY);
+ listener = m_xConfigListener;
+ m_aConfig.close();
+ }
+ m_xConfigListener.clear();
+ }
+ if (notifier.is()) {
+ notifier->removeContainerListener(listener);
+ }
}
//________________________________
@@ -192,8 +203,10 @@ void SAL_CALL JobExecutor::trigger( const OUString& sEvent ) throw(css::uno::Run
{
SAL_INFO( "fwk", "fwk (as96863) JobExecutor::trigger()");
- /* SAFE { */
- ReadGuard aReadLock(m_aLock);
+ css::uno::Sequence< OUString > lJobs;
+
+ /* SAFE */ {
+ osl::MutexGuard g(rBHelper.rMutex);
// Optimization!
// Check if the given event name exist inside configuration and reject wrong requests.
@@ -204,17 +217,17 @@ void SAL_CALL JobExecutor::trigger( const OUString& sEvent ) throw(css::uno::Run
// get list of all enabled jobs
// The called static helper methods read it from the configuration and
// filter disabled jobs using it's time stamp values.
- css::uno::Sequence< OUString > lJobs = JobData::getEnabledJobsForEvent(m_xContext, sEvent);
-
- aReadLock.unlock();
- /* } SAFE */
+ lJobs = JobData::getEnabledJobsForEvent(m_xContext, sEvent);
+ } /* SAFE */
// step over all enabled jobs and execute it
sal_Int32 c = lJobs.getLength();
for (sal_Int32 j=0; j<c; ++j)
{
- /* SAFE { */
- aReadLock.lock();
+ rtl::Reference<Job> pJob;
+
+ /* SAFE */ {
+ SolarMutexGuard g2;
JobData aCfg(m_xContext);
aCfg.setEvent(sEvent, lJobs[j]);
@@ -225,14 +238,11 @@ void SAL_CALL JobExecutor::trigger( const OUString& sEvent ) throw(css::uno::Run
And freeing of such uno object is done by uno itself.
So we have to use dynamic memory everytimes.
*/
- Job* pJob = new Job(m_xContext, css::uno::Reference< css::frame::XFrame >());
- css::uno::Reference< css::uno::XInterface > xJob(static_cast< ::cppu::OWeakObject* >(pJob), css::uno::UNO_QUERY);
+ pJob = new Job(m_xContext, css::uno::Reference< css::frame::XFrame >());
pJob->setJobData(aCfg);
+ } /* SAFE */
- aReadLock.unlock();
- /* } SAFE */
-
- pJob->execute(css::uno::Sequence< css::beans::NamedValue >());
+ pJob->execute(css::uno::Sequence< css::beans::NamedValue >());
}
}
@@ -247,21 +257,21 @@ void SAL_CALL JobExecutor::notifyEvent( const css::document::EventObject& aEvent
OUString EVENT_ON_DOCUMENT_OPENED("onDocumentOpened"); // Job UI event : OnNew or OnLoad
OUString EVENT_ON_DOCUMENT_ADDED("onDocumentAdded"); // Job API event : OnCreate or OnLoadFinished
- /* SAFE { */
- ReadGuard aReadLock(m_aLock);
-
+ OUString aModuleIdentifier;
::comphelper::SequenceAsVector< JobData::TJob2DocEventBinding > lJobs;
+ /* SAFE */ {
+ osl::MutexGuard g(rBHelper.rMutex);
+
// Optimization!
// Check if the given event name exist inside configuration and reject wrong requests.
// This optimization supress using of the cfg api for getting event and job descriptions.
// see using of m_lEvents.find() below ...
// retrieve event context from event source
- OUString aModuleIdentifier;
try
{
- aModuleIdentifier = m_xModuleManager->identify( aEvent.Source );
+ aModuleIdentifier = css::frame::ModuleManager::create( m_xContext )->identify( aEvent.Source );
}
catch( const css::uno::Exception& )
{}
@@ -289,9 +299,7 @@ void SAL_CALL JobExecutor::notifyEvent( const css::document::EventObject& aEvent
// Add all jobs for "real" notified event too .-)
if (m_lEvents.find(aEvent.EventName) != m_lEvents.end())
JobData::appendEnabledJobsForEvent(m_xContext, aEvent.EventName, lJobs);
-
- aReadLock.unlock();
- /* } SAFE */
+ } /* SAFE */
// step over all enabled jobs and execute it
::comphelper::SequenceAsVector< JobData::TJob2DocEventBinding >::const_iterator pIt;
@@ -299,8 +307,10 @@ void SAL_CALL JobExecutor::notifyEvent( const css::document::EventObject& aEvent
pIt != lJobs.end() ;
++pIt )
{
- /* SAFE { */
- aReadLock.lock();
+ rtl::Reference<Job> pJob;
+
+ /* SAFE */ {
+ SolarMutexGuard g2;
const JobData::TJob2DocEventBinding& rBinding = *pIt;
@@ -317,12 +327,9 @@ void SAL_CALL JobExecutor::notifyEvent( const css::document::EventObject& aEvent
So we have to use dynamic memory everytimes.
*/
css::uno::Reference< css::frame::XModel > xModel(aEvent.Source, css::uno::UNO_QUERY);
- Job* pJob = new Job(m_xContext, xModel);
- css::uno::Reference< css::uno::XInterface > xJob(static_cast< ::cppu::OWeakObject* >(pJob), css::uno::UNO_QUERY);
+ pJob = new Job(m_xContext, xModel);
pJob->setJobData(aCfg);
-
- aReadLock.unlock();
- /* } SAFE */
+ } /* SAFE */
pJob->execute(css::uno::Sequence< css::beans::NamedValue >());
}
@@ -384,7 +391,7 @@ void SAL_CALL JobExecutor::elementReplaced( const css::container::ContainerEvent
void SAL_CALL JobExecutor::disposing( const css::lang::EventObject& aEvent ) throw(css::uno::RuntimeException)
{
/* SAFE { */
- ReadGuard aReadLock(m_aLock);
+ osl::MutexGuard g(rBHelper.rMutex);
css::uno::Reference< css::uno::XInterface > xCFG(m_aConfig.cfg(), css::uno::UNO_QUERY);
if (
(xCFG == aEvent.Source ) &&
@@ -393,10 +400,28 @@ void SAL_CALL JobExecutor::disposing( const css::lang::EventObject& aEvent ) thr
{
m_aConfig.close();
}
- aReadLock.unlock();
/* } SAFE */
}
+struct Instance {
+ explicit Instance(
+ css::uno::Reference<css::uno::XComponentContext> const & context):
+ instance(
+ static_cast<cppu::OWeakObject *>(new JobExecutor(context)))
+ {
+ // 2nd phase initialization needed
+ static_cast<JobExecutor *>(static_cast<cppu::OWeakObject *>
+ (instance.get()))->initListeners();
+ }
+
+ rtl::Reference<css::uno::XInterface> instance;
+};
+
+struct Singleton:
+ public rtl::StaticWithArg<
+ Instance, css::uno::Reference<css::uno::XComponentContext>, Singleton>
+{};
+
}
extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
@@ -404,12 +429,9 @@ com_sun_star_comp_framework_JobExecutor_get_implementation(
css::uno::XComponentContext *context,
css::uno::Sequence<css::uno::Any> const &)
{
- JobExecutor *inst = new JobExecutor(context);
- css::uno::XInterface *acquired_inst = cppu::acquire(inst);
-
- inst->initListeners();
-
- return acquired_inst;
+ css::uno::XInterface *inst = Singleton::get(context).instance.get();
+ inst->acquire();
+ return inst;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/framework/source/services/frame.cxx b/framework/source/services/frame.cxx
index 2bc93d6d67c8..0d04ba6fff11 100644
--- a/framework/source/services/frame.cxx
+++ b/framework/source/services/frame.cxx
@@ -60,7 +60,7 @@
#include <com/sun/star/frame/FrameSearchFlag.hpp>
#include <com/sun/star/lang/DisposedException.hpp>
#include <com/sun/star/task/StatusIndicatorFactory.hpp>
-#include <com/sun/star/task/JobExecutor.hpp>
+#include <com/sun/star/task/theJobExecutor.hpp>
#include <com/sun/star/task/XJobExecutor.hpp>
#include <com/sun/star/util/URLTransformer.hpp>
#include <com/sun/star/util/XURLTransformer.hpp>
@@ -2757,7 +2757,7 @@ void SAL_CALL Frame::windowShown( const css::lang::EventObject& ) throw(css::uno
if (bMustBeTriggered)
{
css::uno::Reference< css::task::XJobExecutor > xExecutor
- = css::task::JobExecutor::create( xContext );
+ = css::task::theJobExecutor::get( xContext );
xExecutor->trigger( "onFirstVisibleTask" );
}
}
diff --git a/framework/util/fwk.component b/framework/util/fwk.component
index e08b966311e9..cc977f9c71ee 100644
--- a/framework/util/fwk.component
+++ b/framework/util/fwk.component
@@ -59,6 +59,7 @@
<implementation name="com.sun.star.comp.framework.JobExecutor"
constructor="com_sun_star_comp_framework_JobExecutor_get_implementation">
<service name="com.sun.star.task.JobExecutor"/>
+ <singleton name="com.sun.star.task.theJobExecutor"/>
</implementation>
<implementation name="com.sun.star.comp.framework.LangSelectionStatusbarController"
constructor="com_sun_star_comp_framework_LangSelectionStatusbarController_get_implementation">
diff --git a/offapi/UnoApi_offapi.mk b/offapi/UnoApi_offapi.mk
index bd38826bea31..850635aa7fb9 100755
--- a/offapi/UnoApi_offapi.mk
+++ b/offapi/UnoApi_offapi.mk
@@ -390,6 +390,7 @@ $(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,com/sun/star/task,\
PasswordContainer \
PasswordContainerInteractionHandler \
StatusIndicatorFactory \
+ theJobExecutor \
))
$(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,com/sun/star/text,\
AutoTextContainer \
diff --git a/offapi/com/sun/star/task/AsyncJob.idl b/offapi/com/sun/star/task/AsyncJob.idl
index f11e9532a829..6482cf7e4572 100644
--- a/offapi/com/sun/star/task/AsyncJob.idl
+++ b/offapi/com/sun/star/task/AsyncJob.idl
@@ -26,8 +26,8 @@
module com { module sun { module star { module task {
-/** represent an asynchronous job, which can be executed by the global JobExecutor
- instance.
+/** Represent an asynchronous job, which can be executed by the global
+ theJobExecutor instance.
@see Job
diff --git a/offapi/com/sun/star/task/Job.idl b/offapi/com/sun/star/task/Job.idl
index 69a5305b53f2..414975e5266f 100644
--- a/offapi/com/sun/star/task/Job.idl
+++ b/offapi/com/sun/star/task/Job.idl
@@ -26,8 +26,8 @@
module com { module sun { module star { module task {
-/** represent a synchronous job, which can be executed by the global JobExecutor
- instance.
+/** Represent a synchronous job, which can be executed by the global
+ theJobExecutor instance.
@see AsyncJob
diff --git a/offapi/com/sun/star/task/JobExecutor.idl b/offapi/com/sun/star/task/JobExecutor.idl
index 41737f3fd04a..14d5b581c9b6 100644
--- a/offapi/com/sun/star/task/JobExecutor.idl
+++ b/offapi/com/sun/star/task/JobExecutor.idl
@@ -25,18 +25,10 @@
module com { module sun { module star { module task {
-/** generic job execution service
-
- <p>
- Can start registered uno services on triggered events and handle there
- own configuration and there lifetime. Such events are simple strings
- which meaning doesn't matter for any real service implementation of this
- specification. But triggered events must be available inside the
- configuration and some Jobs or AsyncJobs must be registered for that.
- </p>
-
- @see Job
- @see AsyncJob
+/**
+ A legacy (single-instance) service-variant of theJobExecutor singleton.
+
+ @deprecated Use theJobExecutor singleton instead.
*/
published service JobExecutor : XJobExecutor;
diff --git a/offapi/com/sun/star/task/XAsyncJob.idl b/offapi/com/sun/star/task/XAsyncJob.idl
index 9b868ae1c105..1750b5e36c78 100644
--- a/offapi/com/sun/star/task/XAsyncJob.idl
+++ b/offapi/com/sun/star/task/XAsyncJob.idl
@@ -50,7 +50,7 @@ published interface XAsyncJob : com::sun::star::uno::XInterface
@param Arguments
are arguments for executing the job. Their semantics is completely implementation dependent. Usually,
a concrete implementation of a job specifies in its service descriptions which parameters are allowed
- (or expected). This values are persistent by the configuration of the JobExecutor
+ (or expected). This values are persistent by the configuration of theJobExecutor
which use this asynchronous job. It's possible to write it back by called listener
function XJobListener::jobFinished().
diff --git a/offapi/com/sun/star/task/XJob.idl b/offapi/com/sun/star/task/XJob.idl
index 54b50b488ae6..6c8daf2761c6 100644
--- a/offapi/com/sun/star/task/XJob.idl
+++ b/offapi/com/sun/star/task/XJob.idl
@@ -44,7 +44,7 @@ published interface XJob : com::sun::star::uno::XInterface
@param Arguments
are arguments for executing the job. Their semantics is completely implementation dependent. Usually,
a concrete implementation of a job specifies in its service descriptions which parameters are allowed
- (or expected). This values are persistent by the configuration of the JobExecutor
+ (or expected). This values are persistent by the configuration of theJobExecutor
which use this synchronous job. It's possible to write it back by use special protocol
in return value.
diff --git a/offapi/com/sun/star/task/XJobExecutor.idl b/offapi/com/sun/star/task/XJobExecutor.idl
index 6cd3a093db66..b27468cf423a 100644
--- a/offapi/com/sun/star/task/XJobExecutor.idl
+++ b/offapi/com/sun/star/task/XJobExecutor.idl
@@ -36,7 +36,7 @@ module com { module sun { module star { module task {
a new event will be detected later.
</p>
- @see JobExecutor
+ @see theJobExecutor
*/
published interface XJobExecutor : com::sun::star::uno::XInterface
{
diff --git a/offapi/com/sun/star/task/XJobListener.idl b/offapi/com/sun/star/task/XJobListener.idl
index 0bdbf4db4f6c..93634a8c342e 100644
--- a/offapi/com/sun/star/task/XJobListener.idl
+++ b/offapi/com/sun/star/task/XJobListener.idl
@@ -34,14 +34,14 @@ published interface XJobListener : com::sun::star::lang::XEventListener
/** indicates that the job is done
@param Job
- identifies the asynchronous job so the JobExecutor
+ identifies the asynchronous job so that theJobExecutor
can differ between more then ones.
@param Result
should be the same like for the synchronous mode on XJob::execute().
It provides information about success or failure of job execution. It's possible too,
to use special protocol (which depends from real implementation) between
- JobExecutor and a real job. So it can be possible to:
+ theJobExecutor and a real job. So it can be possible to:
<ul>
<li>deregister the job</li>
diff --git a/offapi/com/sun/star/task/theJobExecutor.idl b/offapi/com/sun/star/task/theJobExecutor.idl
new file mode 100644
index 000000000000..6189938aed3f
--- /dev/null
+++ b/offapi/com/sun/star/task/theJobExecutor.idl
@@ -0,0 +1,43 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#ifndef __com_sun_star_task_theJobExecutor_idl__
+#define __com_sun_star_task_theJobExecutor_idl__
+
+#include <com/sun/star/task/XJobExecutor.idl>
+
+
+module com { module sun { module star { module task {
+
+/**
+ Generic job execution singleton
+
+ <p>
+ Can start registered uno services on triggered events and handle there
+ own configuration and there lifetime. Such events are simple strings
+ which meaning doesn't matter for any real service implementation of this
+ specification. But triggered events must be available inside the
+ configuration and some Jobs or AsyncJobs must be registered for that.
+ </p>
+
+ Prior to LibreOffice 4.3, this singleton was only available as a
+ (single-instance) JobExecutor service.
+
+ @see Job
+ @see AsyncJob
+
+ @since LibreOffice 4.3
+ */
+published singleton theJobExecutor : XJobExecutor;
+
+}; }; }; };
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/reportdesign/source/filter/xml/dbloader2.hxx b/reportdesign/source/filter/xml/dbloader2.hxx
index 95cf7f3cc8d5..082a7e8361e9 100644
--- a/reportdesign/source/filter/xml/dbloader2.hxx
+++ b/reportdesign/source/filter/xml/dbloader2.hxx
@@ -58,7 +58,6 @@
#include <sfx2/docfile.hxx>
#include <unotools/moduleoptions.hxx>
#include <comphelper/storagehelper.hxx>
-#include <com/sun/star/task/XJobExecutor.hpp>
#include <vcl/msgbox.hxx>
// -------------------------------------------------------------------------
diff --git a/sfx2/inc/pch/precompiled_sfx.hxx b/sfx2/inc/pch/precompiled_sfx.hxx
index 13139d9c451a..1c8c73b01026 100644
--- a/sfx2/inc/pch/precompiled_sfx.hxx
+++ b/sfx2/inc/pch/precompiled_sfx.hxx
@@ -392,7 +392,7 @@
#include <com/sun/star/task/FutureDocumentVersionProductUpdateRequest.hpp>
#include <com/sun/star/task/InteractionClassification.hpp>
#include <com/sun/star/task/InteractionHandler.hpp>
-#include <com/sun/star/task/JobExecutor.hpp>
+#include <com/sun/star/task/theJobExecutor.hpp>
#include <com/sun/star/task/StatusIndicatorFactory.hpp>
#include <com/sun/star/task/XInteractionAskLater.hpp>
#include <com/sun/star/task/XInteractionHandler.hpp>
diff --git a/sfx2/source/notify/eventsupplier.cxx b/sfx2/source/notify/eventsupplier.cxx
index 4b25de6ed29b..4ed2da689951 100644
--- a/sfx2/source/notify/eventsupplier.cxx
+++ b/sfx2/source/notify/eventsupplier.cxx
@@ -22,7 +22,6 @@
#include <com/sun/star/util/URL.hpp>
#include <com/sun/star/frame/Desktop.hpp>
-#include <com/sun/star/task/JobExecutor.hpp>
#include <com/sun/star/util/URLTransformer.hpp>
#include <com/sun/star/util/XURLTransformer.hpp>
#include <tools/urlobj.hxx>
diff --git a/sfx2/source/notify/globalevents.cxx b/sfx2/source/notify/globalevents.cxx
index de482dcd0746..d5931e920db7 100644
--- a/sfx2/source/notify/globalevents.cxx
+++ b/sfx2/source/notify/globalevents.cxx
@@ -19,7 +19,7 @@
#include <sal/types.h>
-#include <com/sun/star/task/JobExecutor.hpp>
+#include <com/sun/star/task/theJobExecutor.hpp>
#include <com/sun/star/container/XNameReplace.hpp>
#include <com/sun/star/container/XSet.hpp>
#include <com/sun/star/document/XEventListener.hpp>
@@ -230,7 +230,7 @@ uno::Any SAL_CALL ModelCollectionEnumeration::nextElement()
//-----------------------------------------------------------------------------
SfxGlobalEvents_Impl::SfxGlobalEvents_Impl( const uno::Reference < uno::XComponentContext >& rxContext)
: ModelCollectionMutexBase( )
- , m_xJobExecutorListener( task::JobExecutor::create( rxContext ), uno::UNO_QUERY_THROW )
+ , m_xJobExecutorListener( task::theJobExecutor::get( rxContext ), uno::UNO_QUERY_THROW )
, m_aLegacyListeners (m_aLock)
, m_aDocumentListeners (m_aLock)
, pImp (0 )