Ramon F Herrera wrote:
I understand that in UNO (and COM, and CORBA...) the programmer can
"inspect" or "interrogate" the components in order to find ways to
communicate ("send messages") to them.
The OpenOffice process can be run in either (a) named-pipe mode, or
(b) listening to some particular socket mode. According to all the
code I have seen, the programmer has to know those details in advance.
IOW, if my program is going to connect the OO server via socket 8100
(some sort of convention), it has to be started like this:
"C:\Program Files\OpenOffice.org 2.3\program\soffice"
-accept=socket,host=0,port=8100;urp;
The server has to be started to accommodate my code, and think it
should be the other way around. I would like my client program to be
as general and flexible as possible. If I understand component-based
programming, I don't have to know a lot of stuff in advance, because
the components themselves will provide the details. I just don't know
what the correct "questions" are.
These are the first 5 lines of a typical OO client program (not drawn
to scale!):
(1) xContext = Bootstrap.bootstrap(); // starts OO process (plus
Windows icon) if not already running
After step (1), you already have a connection to OOo. The xContext
object you get is a UNO proxy for an OOo-side UNO object, bridged across
a UNO bridge which runs on top some connection (e.g., named pipe or
TCP). Any services you obtain from that xContext are services running
in OOo.
(2) XMultiComponentFactory xMCF = xContext.getServiceManager();
(3) createInstanceWithContext("com.sun.star.bridge.BridgeFactory");
(4) xConnector = UnoRuntime.queryInterface(XConnector.class, x);
(5) connection = xConnector.connect(con); <-- finally!, there is TCP/IP
communication here
That creates a connection from OOo to OOo. Probably not what you want.
-Stephan
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]