23#include <com/sun/star/bridge/BridgeFactory.hpp>
24#include <com/sun/star/connection/Acceptor.hpp>
25#include <com/sun/star/uno/XNamingService.hpp>
31using namespace css::bridge;
32using namespace css::connection;
33using namespace css::lang;
34using namespace css::uno;
43 osl_setThreadName(
"URP Acceptor");
72 osl_joinWithThread(
t);
85 css::uno::Reference< css::lang::XComponent >(
86 b, css::uno::UNO_QUERY_THROW)->dispose();
92 SAL_INFO(
"desktop.offacc",
"Acceptor::run" );
99 "Acceptor::run waiting for office to come up");
104 "Acceptor::run now enabled and continuing");
110 if (! rConnection.is())
break;
111 OUString aDescription = rConnection->getDescription();
112 SAL_INFO(
"desktop.offacc",
"Acceptor::run connection " << aDescription );
136 std::unique_lock aGuard(
m_aMutex );
137 SAL_INFO(
"desktop.offacc",
"Acceptor::initialize()" );
153 throw IllegalArgumentException(
154 "Invalid accept-string format",
m_rContext, 1);
168 bool bEnable =
false;
169 if (((nArgs == 1 && (
aArguments[0] >>= bEnable)) ||
170 (nArgs == 2 && (
aArguments[1] >>= bEnable))) &&
179 throw IllegalArgumentException(
"invalid initialization",
m_rContext, 1);
186 return "com.sun.star.office.comp.Acceptor";
190 return {
"com.sun.star.office.Acceptor" };
212 Reference<XInterface> rInstance;
214 if (
aName ==
"StarOffice.ServiceManager" )
216 rInstance.set(
m_rContext->getServiceManager() );
218 else if (
aName ==
"StarOffice.ComponentContext" )
222 else if (
aName ==
"StarOffice.NamingService" )
224 Reference< XNamingService > rNamingService(
225 m_rContext->getServiceManager()->createInstanceWithContext(
"com.sun.star.uno.NamingService",
m_rContext),
227 if ( rNamingService.is() )
229 rNamingService->registerObject(
"StarOffice.ServiceManager",
m_rContext->getServiceManager() );
230 rNamingService->registerObject(
"StarOffice.ComponentContext",
m_rContext );
231 rInstance = rNamingService;
239extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
241 css::uno::XComponentContext* context, css::uno::Sequence<css::uno::Any>
const&)
SAL_DLLPUBLIC_EXPORT css::uno::XInterface * desktop_Acceptor_get_implementation(css::uno::XComponentContext *context, css::uno::Sequence< css::uno::Any > const &)
css::uno::Reference< T > remove()
void add(css::uno::Reference< T > const &e)
css::uno::Reference< css::uno::XComponentContext > m_rContext
AccInstanceProvider(const css::uno::Reference< css::uno::XComponentContext > &rxContext)
virtual css::uno::Reference< css::uno::XInterface > SAL_CALL getInstance(const OUString &aName) override
virtual ~AccInstanceProvider() override
virtual OUString SAL_CALL getImplementationName() override
css::uno::Reference< css::bridge::XBridgeFactory2 > m_rBridgeFactory
::osl::Condition m_cEnable
Acceptor(const css::uno::Reference< css::uno::XComponentContext > &rxContext)
OUString m_aConnectString
css::uno::Reference< css::uno::XComponentContext > m_rContext
css::uno::Reference< css::connection::XAcceptor > m_rAcceptor
virtual void SAL_CALL initialize(const css::uno::Sequence< css::uno::Any > &aArguments) override
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
comphelper::WeakBag< css::bridge::XBridge > m_bridges
virtual sal_Bool SAL_CALL supportsService(const OUString &aName) override
virtual ~Acceptor() override
#define TOOLS_WARN_EXCEPTION(area, stream)
Sequence< PropertyValue > aArguments
#define SAL_INFO(area, stream)
def run(arg=None, arg2=-1)
bool CPPUHELPER_DLLPUBLIC supportsService(css::lang::XServiceInfo *implementation, rtl::OUString const &name)
static void offacc_workerfunc(void *acc)
css::uno::Reference< css::deployment::XPackageRegistry > create(css::uno::Reference< css::deployment::XPackageRegistry > const &xRootRegistry, OUString const &context, OUString const &cachePath, css::uno::Reference< css::uno::XComponentContext > const &xComponentContext)
std::basic_string_view< charT, traits > trim(std::basic_string_view< charT, traits > str)
const Reference< XComponentContext > & m_rContext