On 1/27/09, Juergen Schmidt <juergen.schm...@sun.com> wrote: > > Jason Cooper wrote: > >> On Sat, Jan 24, 2009 at 4:34 AM, Juergen Schmidt <juergen.schm...@sun.com >> >wrote: >> >> Jason Cooper wrote: >>> >>> I'm writing a Java client that I would like to, among other things, be >>>> aware >>>> of OOo connection status. I've been reading through *3.3.1 UNO >>>> Interprocess >>>> Connections* in the Dev Guide and understand the >>>> ConnectionAwareClient.java >>>> example there. >>>> >>>> I'm wondering if I can somehow connect to an OOo process that wasn't >>>> started >>>> in listening mode. For example, an instance of OO Calc, started normally >>>> (from the menu or whatever) that was running before my client was >>>> launched. >>>> I'd like my client to be able to interact with and monitor the >>>> connection >>>> status of that instance of OO Calc. Is this possible? >>>> >>>> you can use the Bootstrap.bootstrap that will connect to the default >>> office >>> if an instance is already running or it will start a new one. The >>> connection >>> is done via a named pipe connection. You can't connect to an office on a >>> different machine. >>> >>> >> That sounds good. My next question is at what point can I register event >> listeners, so that I can tell when the pipe connection has been severed? I >> noticed that I can get the service manager from the XComponentContext, at >> which point I can query for the XComponent interface and add event >> listeners. If I do so, will I get events from the pipe connection or >> something else? >> > > Bootstrap.boostrap returns a XComponentContext. Either you receive a null > interface in case of an error or a valid XComponentContext from the office. > The context is the entrance for everything else ;-)
I understand that. What I'm trying to ask is where do I add event listeners so that I can stay aware of the connection? In the ConnectionAwareClient example, a conneciton and bridge are created. Maybe I'm not understanding things, but after calling Bootstrap.bootstrap() and getting my XComponentContext, can I still create an XConnection to pass to the bridge factory? Jason