1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: urp_dispatch.cxx,v $
10 * $Revision: 1.17.20.1 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 // MARKER(update_precomp.py): autogen include statement, do not remove
32 #include "precompiled_bridges.hxx"
33 #include <sal/alloca.h>
34 #include <osl/mutex.hxx>
35 #include <osl/diagnose.h>
37 #include <rtl/alloc.h>
38 #include <rtl/ustrbuf.hxx>
40 #include <uno/mapping.hxx>
41 #include <uno/threadpool.h>
43 #include <bridges/remote/remote.h>
44 #include <bridges/remote/stub.hxx>
45 #include <bridges/remote/proxy.hxx>
46 #include <bridges/remote/remote.hxx>
48 #include "urp_bridgeimpl.hxx"
49 #include "urp_marshal.hxx"
50 #include "urp_dispatch.hxx"
51 #include "urp_job.hxx"
52 #include "urp_writer.hxx"
53 #include "urp_log.hxx"
55 using namespace ::rtl
;
56 using namespace ::osl
;
57 using namespace ::com::sun::star::uno
;
62 void SAL_CALL
urp_sendCloseConnection( uno_Environment
*pEnvRemote
)
64 remote_Context
*pContext
= (remote_Context
*) pEnvRemote
->pContext
;
65 urp_BridgeImpl
*pImpl
= (urp_BridgeImpl
*) ( pContext
->m_pBridgeImpl
);
68 MutexGuard
guard( pImpl
->m_marshalingMutex
);
71 if( ! pImpl
->m_blockMarshaler
.empty() )
73 pImpl
->m_pWriter
->touch( sal_True
);
76 pImpl
->m_pWriter
->sendEmptyMessage();
79 extern "C" void SAL_CALL
urp_sendRequest(
80 uno_Environment
*pEnvRemote
,
81 typelib_TypeDescription
const * pMemberType
,
83 typelib_InterfaceTypeDescription
*pInterfaceType
,
86 uno_Any
**ppException
)
88 remote_Context
*pContext
= (remote_Context
*) pEnvRemote
->pContext
;
89 urp_BridgeImpl
*pImpl
= (urp_BridgeImpl
*) ( pContext
->m_pBridgeImpl
);
90 pImpl
->m_initialized
.wait();
91 urp_sendRequest_internal(
92 pEnvRemote
, pMemberType
, pOid
, pInterfaceType
, pReturn
, ppArgs
,
95 void SAL_CALL
urp_sendRequest_internal(
96 uno_Environment
*pEnvRemote
,
97 typelib_TypeDescription
const * pMemberType
,
99 typelib_InterfaceTypeDescription
*pInterfaceType
,
102 uno_Any
**ppException
)
104 remote_Context
*pContext
= (remote_Context
*) pEnvRemote
->pContext
;
105 urp_BridgeImpl
*pImpl
= (urp_BridgeImpl
*) ( pContext
->m_pBridgeImpl
);
108 pEnvRemote
, pContext
, pImpl
, pOid
, pMemberType
, pInterfaceType
, pReturn
,
109 ppArgs
, ppException
);
111 if( job
.pack() && ! job
.isOneway() )