Kaydet (Commit) ef597d80 authored tarafından Matúš Kukan's avatar Matúš Kukan Kaydeden (comit) Stephan Bergmann

Introduce com.sun.star.task.theJobExecutor singleton.

To replace com.sun.star.task.JobExecutor single-instance service,
incorrectly converted in 748aa84e

[including changes by Stephan Bergmann <sbergman@redhat.com>]

Change-Id: I4cea2c63a20b5b22f6e1f822fb35fcc4d0397687
Reviewed-on: https://gerrit.libreoffice.org/7609Reviewed-by: 's avatarStephan Bergmann <sbergman@redhat.com>
Tested-by: 's avatarStephan Bergmann <sbergman@redhat.com>
üst 4b1ecc4c
...@@ -59,7 +59,6 @@ ...@@ -59,7 +59,6 @@
#include <com/sun/star/frame/XComponentLoader.hpp> #include <com/sun/star/frame/XComponentLoader.hpp>
#include <com/sun/star/frame/XModel.hpp> #include <com/sun/star/frame/XModel.hpp>
#include <com/sun/star/ucb/SimpleFileAccess.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/lang/XInitialization.hpp>
#include <com/sun/star/sdb/CommandType.hpp> #include <com/sun/star/sdb/CommandType.hpp>
#include <com/sun/star/ucb/InteractiveIOException.hpp> #include <com/sun/star/ucb/InteractiveIOException.hpp>
......
...@@ -64,7 +64,7 @@ ...@@ -64,7 +64,7 @@
#include <com/sun/star/configuration/InstallationIncompleteException.hpp> #include <com/sun/star/configuration/InstallationIncompleteException.hpp>
#include <com/sun/star/configuration/backend/BackendSetupException.hpp> #include <com/sun/star/configuration/backend/BackendSetupException.hpp>
#include <com/sun/star/configuration/backend/BackendAccessException.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/OfficeRestartManager.hpp>
#include <com/sun/star/task/XRestartManager.hpp> #include <com/sun/star/task/XRestartManager.hpp>
#include <com/sun/star/document/XEventListener.hpp> #include <com/sun/star/document/XEventListener.hpp>
...@@ -2848,7 +2848,7 @@ void Desktop::DoFirstRunInitializations() ...@@ -2848,7 +2848,7 @@ void Desktop::DoFirstRunInitializations()
{ {
try try
{ {
Reference< XJobExecutor > xExecutor = JobExecutor::create( ::comphelper::getProcessComponentContext() ); Reference< XJobExecutor > xExecutor = theJobExecutor::get( ::comphelper::getProcessComponentContext() );
xExecutor->trigger( OUString("onFirstRunInitialization") ); xExecutor->trigger( OUString("onFirstRunInitialization") );
} }
catch(const ::com::sun::star::uno::Exception&) catch(const ::com::sun::star::uno::Exception&)
......
...@@ -45,7 +45,6 @@ ...@@ -45,7 +45,6 @@
#include "com/sun/star/deployment/ui/LicenseDialog.hpp" #include "com/sun/star/deployment/ui/LicenseDialog.hpp"
#include <com/sun/star/task/OfficeRestartManager.hpp> #include <com/sun/star/task/OfficeRestartManager.hpp>
#include <com/sun/star/task/XJob.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/XInteractionApprove.hpp>
#include <com/sun/star/task/XInteractionAbort.hpp> #include <com/sun/star/task/XInteractionAbort.hpp>
#include <com/sun/star/ui/dialogs/XExecutableDialog.hpp> #include <com/sun/star/ui/dialogs/XExecutableDialog.hpp>
......
...@@ -28,7 +28,6 @@ ...@@ -28,7 +28,6 @@
#include "vcl/msgbox.hxx" #include "vcl/msgbox.hxx"
#include "toolkit/helper/vclunohelper.hxx" #include "toolkit/helper/vclunohelper.hxx"
#include "com/sun/star/lang/XServiceInfo.hpp" #include "com/sun/star/lang/XServiceInfo.hpp"
#include "com/sun/star/task/XJobExecutor.hpp"
#include "svtools/svmedit.hxx" #include "svtools/svmedit.hxx"
#include "svl/lstner.hxx" #include "svl/lstner.hxx"
#include "vcl/xtextedt.hxx" #include "vcl/xtextedt.hxx"
......
...@@ -22,7 +22,6 @@ ...@@ -22,7 +22,6 @@
#include "dp_gui.h" #include "dp_gui.h"
#include "cppuhelper/implbase1.hxx" #include "cppuhelper/implbase1.hxx"
#include "com/sun/star/lang/XServiceInfo.hpp" #include "com/sun/star/lang/XServiceInfo.hpp"
#include "com/sun/star/task/XJobExecutor.hpp"
#include "com/sun/star/ui/dialogs/XExecutableDialog.hpp" #include "com/sun/star/ui/dialogs/XExecutableDialog.hpp"
#include "boost/bind.hpp" #include "boost/bind.hpp"
......
...@@ -179,7 +179,7 @@ ...@@ -179,7 +179,7 @@
#include <com/sun/star/style/XStyleFamiliesSupplier.hpp> #include <com/sun/star/style/XStyleFamiliesSupplier.hpp>
#include <com/sun/star/task/ErrorCodeRequest.hpp> #include <com/sun/star/task/ErrorCodeRequest.hpp>
#include <com/sun/star/task/InteractionHandler.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/StatusIndicatorFactory.hpp>
#include <com/sun/star/task/XAsyncJob.hpp> #include <com/sun/star/task/XAsyncJob.hpp>
#include <com/sun/star/task/XInteractionAbort.hpp> #include <com/sun/star/task/XInteractionAbort.hpp>
......
...@@ -60,7 +60,7 @@ ...@@ -60,7 +60,7 @@
#include <com/sun/star/frame/FrameSearchFlag.hpp> #include <com/sun/star/frame/FrameSearchFlag.hpp>
#include <com/sun/star/lang/DisposedException.hpp> #include <com/sun/star/lang/DisposedException.hpp>
#include <com/sun/star/task/StatusIndicatorFactory.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/task/XJobExecutor.hpp>
#include <com/sun/star/util/URLTransformer.hpp> #include <com/sun/star/util/URLTransformer.hpp>
#include <com/sun/star/util/XURLTransformer.hpp> #include <com/sun/star/util/XURLTransformer.hpp>
...@@ -2757,7 +2757,7 @@ void SAL_CALL Frame::windowShown( const css::lang::EventObject& ) throw(css::uno ...@@ -2757,7 +2757,7 @@ void SAL_CALL Frame::windowShown( const css::lang::EventObject& ) throw(css::uno
if (bMustBeTriggered) if (bMustBeTriggered)
{ {
css::uno::Reference< css::task::XJobExecutor > xExecutor css::uno::Reference< css::task::XJobExecutor > xExecutor
= css::task::JobExecutor::create( xContext ); = css::task::theJobExecutor::get( xContext );
xExecutor->trigger( "onFirstVisibleTask" ); xExecutor->trigger( "onFirstVisibleTask" );
} }
} }
......
...@@ -59,6 +59,7 @@ ...@@ -59,6 +59,7 @@
<implementation name="com.sun.star.comp.framework.JobExecutor" <implementation name="com.sun.star.comp.framework.JobExecutor"
constructor="com_sun_star_comp_framework_JobExecutor_get_implementation"> constructor="com_sun_star_comp_framework_JobExecutor_get_implementation">
<service name="com.sun.star.task.JobExecutor"/> <service name="com.sun.star.task.JobExecutor"/>
<singleton name="com.sun.star.task.theJobExecutor"/>
</implementation> </implementation>
<implementation name="com.sun.star.comp.framework.LangSelectionStatusbarController" <implementation name="com.sun.star.comp.framework.LangSelectionStatusbarController"
constructor="com_sun_star_comp_framework_LangSelectionStatusbarController_get_implementation"> constructor="com_sun_star_comp_framework_LangSelectionStatusbarController_get_implementation">
......
...@@ -390,6 +390,7 @@ $(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,com/sun/star/task,\ ...@@ -390,6 +390,7 @@ $(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,com/sun/star/task,\
PasswordContainer \ PasswordContainer \
PasswordContainerInteractionHandler \ PasswordContainerInteractionHandler \
StatusIndicatorFactory \ StatusIndicatorFactory \
theJobExecutor \
)) ))
$(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,com/sun/star/text,\ $(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,com/sun/star/text,\
AutoTextContainer \ AutoTextContainer \
......
...@@ -26,8 +26,8 @@ ...@@ -26,8 +26,8 @@
module com { module sun { module star { module task { module com { module sun { module star { module task {
/** represent an asynchronous job, which can be executed by the global JobExecutor /** Represent an asynchronous job, which can be executed by the global
instance. theJobExecutor instance.
@see Job @see Job
......
...@@ -26,8 +26,8 @@ ...@@ -26,8 +26,8 @@
module com { module sun { module star { module task { module com { module sun { module star { module task {
/** represent a synchronous job, which can be executed by the global JobExecutor /** Represent a synchronous job, which can be executed by the global
instance. theJobExecutor instance.
@see AsyncJob @see AsyncJob
......
...@@ -25,18 +25,10 @@ ...@@ -25,18 +25,10 @@
module com { module sun { module star { module task { module com { module sun { module star { module task {
/** generic job execution service /**
A legacy (single-instance) service-variant of theJobExecutor singleton.
<p>
Can start registered uno services on triggered events and handle there @deprecated Use theJobExecutor singleton instead.
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
*/ */
published service JobExecutor : XJobExecutor; published service JobExecutor : XJobExecutor;
......
...@@ -50,7 +50,7 @@ published interface XAsyncJob : com::sun::star::uno::XInterface ...@@ -50,7 +50,7 @@ published interface XAsyncJob : com::sun::star::uno::XInterface
@param Arguments @param Arguments
are arguments for executing the job. Their semantics is completely implementation dependent. Usually, 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 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 which use this asynchronous job. It's possible to write it back by called listener
function XJobListener::jobFinished(). function XJobListener::jobFinished().
......
...@@ -44,7 +44,7 @@ published interface XJob : com::sun::star::uno::XInterface ...@@ -44,7 +44,7 @@ published interface XJob : com::sun::star::uno::XInterface
@param Arguments @param Arguments
are arguments for executing the job. Their semantics is completely implementation dependent. Usually, 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 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 which use this synchronous job. It's possible to write it back by use special protocol
in return value. in return value.
......
...@@ -36,7 +36,7 @@ module com { module sun { module star { module task { ...@@ -36,7 +36,7 @@ module com { module sun { module star { module task {
a new event will be detected later. a new event will be detected later.
</p> </p>
@see JobExecutor @see theJobExecutor
*/ */
published interface XJobExecutor : com::sun::star::uno::XInterface published interface XJobExecutor : com::sun::star::uno::XInterface
{ {
......
...@@ -34,14 +34,14 @@ published interface XJobListener : com::sun::star::lang::XEventListener ...@@ -34,14 +34,14 @@ published interface XJobListener : com::sun::star::lang::XEventListener
/** indicates that the job is done /** indicates that the job is done
@param Job @param Job
identifies the asynchronous job so the JobExecutor identifies the asynchronous job so that theJobExecutor
can differ between more then ones. can differ between more then ones.
@param Result @param Result
should be the same like for the synchronous mode on XJob::execute(). 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, It provides information about success or failure of job execution. It's possible too,
to use special protocol (which depends from real implementation) between 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> <ul>
<li>deregister the job</li> <li>deregister the job</li>
......
/* -*- 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: */
...@@ -58,7 +58,6 @@ ...@@ -58,7 +58,6 @@
#include <sfx2/docfile.hxx> #include <sfx2/docfile.hxx>
#include <unotools/moduleoptions.hxx> #include <unotools/moduleoptions.hxx>
#include <comphelper/storagehelper.hxx> #include <comphelper/storagehelper.hxx>
#include <com/sun/star/task/XJobExecutor.hpp>
#include <vcl/msgbox.hxx> #include <vcl/msgbox.hxx>
// ------------------------------------------------------------------------- // -------------------------------------------------------------------------
......
...@@ -392,7 +392,7 @@ ...@@ -392,7 +392,7 @@
#include <com/sun/star/task/FutureDocumentVersionProductUpdateRequest.hpp> #include <com/sun/star/task/FutureDocumentVersionProductUpdateRequest.hpp>
#include <com/sun/star/task/InteractionClassification.hpp> #include <com/sun/star/task/InteractionClassification.hpp>
#include <com/sun/star/task/InteractionHandler.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/StatusIndicatorFactory.hpp>
#include <com/sun/star/task/XInteractionAskLater.hpp> #include <com/sun/star/task/XInteractionAskLater.hpp>
#include <com/sun/star/task/XInteractionHandler.hpp> #include <com/sun/star/task/XInteractionHandler.hpp>
......
...@@ -22,7 +22,6 @@ ...@@ -22,7 +22,6 @@
#include <com/sun/star/util/URL.hpp> #include <com/sun/star/util/URL.hpp>
#include <com/sun/star/frame/Desktop.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/URLTransformer.hpp>
#include <com/sun/star/util/XURLTransformer.hpp> #include <com/sun/star/util/XURLTransformer.hpp>
#include <tools/urlobj.hxx> #include <tools/urlobj.hxx>
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
#include <sal/types.h> #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/XNameReplace.hpp>
#include <com/sun/star/container/XSet.hpp> #include <com/sun/star/container/XSet.hpp>
#include <com/sun/star/document/XEventListener.hpp> #include <com/sun/star/document/XEventListener.hpp>
...@@ -230,7 +230,7 @@ uno::Any SAL_CALL ModelCollectionEnumeration::nextElement() ...@@ -230,7 +230,7 @@ uno::Any SAL_CALL ModelCollectionEnumeration::nextElement()
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
SfxGlobalEvents_Impl::SfxGlobalEvents_Impl( const uno::Reference < uno::XComponentContext >& rxContext) SfxGlobalEvents_Impl::SfxGlobalEvents_Impl( const uno::Reference < uno::XComponentContext >& rxContext)
: ModelCollectionMutexBase( ) : 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_aLegacyListeners (m_aLock)
, m_aDocumentListeners (m_aLock) , m_aDocumentListeners (m_aLock)
, pImp (0 ) , pImp (0 )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment