LibreOffice Module framework (master) 1
|
protocol handler for "service:*" URLs @descr It's a special dispatch/provider object which is registered for such URL pattern and will be automatically used by the framework dispatch mechanism if such URL occurred. More...
#include <servicehandler.hxx>
Public Member Functions | |
ServiceHandler (css::uno::Reference< css::uno::XComponentContext >) | |
standard ctor @descr This initializes a new instance of this class with needed information for work. More... | |
virtual | ~ServiceHandler () override |
standard dtor More... | |
virtual OUString SAL_CALL | getImplementationName () override |
virtual sal_Bool SAL_CALL | supportsService (const OUString &sServiceName) override |
virtual css::uno::Sequence< OUString > SAL_CALL | getSupportedServiceNames () override |
virtual css::uno::Reference< css::frame::XDispatch > SAL_CALL | queryDispatch (const css::util::URL &aURL, const OUString &sTarget, sal_Int32 nFlags) override |
decide if this dispatch implementation can be used for requested URL or not @descr A protocol handler is registered for a URL pattern inside configuration and will be asked by the generic dispatch mechanism inside framework, if he can handle this special URL which match his registration. More... | |
virtual css::uno::Sequence< css::uno::Reference< css::frame::XDispatch > > SAL_CALL | queryDispatches (const css::uno::Sequence< css::frame::DispatchDescriptor > &lDescriptor) override |
do the same like dispatch() but for multiple requests at the same time More... | |
virtual void SAL_CALL | dispatchWithNotification (const css::util::URL &aURL, const css::uno::Sequence< css::beans::PropertyValue > &lArguments, const css::uno::Reference< css::frame::XDispatchResultListener > &xListener) override |
dispatch with guaranteed notifications about success @descr We use threadsafe internal method to do so. More... | |
virtual void SAL_CALL | dispatch (const css::util::URL &aURL, const css::uno::Sequence< css::beans::PropertyValue > &lArguments) override |
dispatch URL with arguments @descr We use threadsafe internal method to do so. More... | |
virtual void SAL_CALL | addStatusListener (const css::uno::Reference< css::frame::XStatusListener > &xListener, const css::util::URL &aURL) override |
add/remove listener for state events @descr We use an internal container to hold such registered listener. More... | |
virtual void SAL_CALL | removeStatusListener (const css::uno::Reference< css::frame::XStatusListener > &xListener, const css::util::URL &aURL) override |
Private Member Functions | |
css::uno::Reference< css::uno::XInterface > | implts_dispatch (const css::util::URL &aURL) |
threadsafe helper for dispatch calls @descr We support two interfaces for the same process - dispatch URLs. More... | |
Private Attributes | |
css::uno::Reference< css::uno::XComponentContext > | m_xContext |
reference to global uno service manager which had created us More... | |
protocol handler for "service:*" URLs @descr It's a special dispatch/provider object which is registered for such URL pattern and will be automatically used by the framework dispatch mechanism if such URL occurred.
His job is to create any registered uno components which must be coded inside dispatched URL (may with some optional given parameters). After that such created service must be hold his self alive. Such mechanism can be useful for UI components (e.g. Dialogs, Wizards) only.
@base OWeakObject provides XWeak and ref count mechanism
@devstatus ready to use
Definition at line 49 of file servicehandler.hxx.
framework::ServiceHandler::ServiceHandler | ( | css::uno::Reference< css::uno::XComponentContext > | xContext | ) |
standard ctor @descr This initializes a new instance of this class with needed information for work.
xFactory | reference to uno servicemanager for creation of new services |
Definition at line 60 of file servicehandler.cxx.
|
overridevirtual |
standard dtor
Definition at line 68 of file servicehandler.cxx.
|
overridevirtual |
add/remove listener for state events @descr We use an internal container to hold such registered listener.
This container lives if we live. And if call pass registration as non breakable transaction - we can accept the request without any explicit lock. Because we share our mutex with this container.
xListener | reference to a valid listener for state events |
aURL | URL about listener will be informed, if something occurred |
Definition at line 238 of file servicehandler.cxx.
|
overridevirtual |
dispatch URL with arguments @descr We use threadsafe internal method to do so.
It returns a state value - but we ignore it. Because we don't support status listener notifications here.
aURL | uno URL which should be executed |
lArguments | list of optional arguments for this request |
Definition at line 119 of file servicehandler.cxx.
References aURL, and implts_dispatch().
|
overridevirtual |
dispatch with guaranteed notifications about success @descr We use threadsafe internal method to do so.
Return state of this function will be used for notification if an optional listener is given.
aURL | uno URL which should be executed |
lArguments | list of optional arguments for this request |
xListener | optional listener for state events |
Definition at line 141 of file servicehandler.cxx.
References aEvent, aURL, and implts_dispatch().
|
overridevirtual |
Definition at line 37 of file servicehandler.cxx.
|
overridevirtual |
Definition at line 47 of file servicehandler.cxx.
References framework::SERVICENAME_PROTOCOLHANDLER.
|
private |
threadsafe helper for dispatch calls @descr We support two interfaces for the same process - dispatch URLs.
css::uno::RuntimeException |
That the reason for this internal function. It implements the real dispatch operation and returns a state value which inform caller about success. He can notify listener then by using this return value.
aURL | uno URL which should be executed |
Definition at line 178 of file servicehandler.cxx.
References aURL, m_xContext, framework::PROTOCOL_VALUE, sServiceName, and TOOLS_WARN_EXCEPTION.
Referenced by dispatch(), and dispatchWithNotification().
|
overridevirtual |
decide if this dispatch implementation can be used for requested URL or not @descr A protocol handler is registered for a URL pattern inside configuration and will be asked by the generic dispatch mechanism inside framework, if he can handle this special URL which match his registration.
He can agree by returning of a valid dispatch instance or disagree by returning <NULL>. We don't create new dispatch instances here really - we return THIS as result to handle it at the same implementation.
Definition at line 81 of file servicehandler.cxx.
References aURL, and framework::PROTOCOL_VALUE.
Referenced by queryDispatches().
|
overridevirtual |
do the same like dispatch() but for multiple requests at the same time
Definition at line 94 of file servicehandler.cxx.
References i, nCount, and queryDispatch().
|
overridevirtual |
Definition at line 244 of file servicehandler.cxx.
|
overridevirtual |
Definition at line 42 of file servicehandler.cxx.
References sServiceName, and cppu::supportsService().
|
private |
reference to global uno service manager which had created us
Definition at line 58 of file servicehandler.hxx.
Referenced by implts_dispatch().