Hi all,

I'm using OpenOffice.org remotely for some tasks. When remote
OpenOffice.org crashes (or is terminated), XEventListener.disposing()
is called from bridge component and my application registers this
call. My application tries to reconnect again when needed. Remote
OpenOffice.org instance is automatically restarted (by my daemon) and
my application is unable to connect to the new instance again. I can
connect to the remote OpenOffice.org instance again only if I restart
my application. Steps to reproduce my problem:

 - start remote OpenOffice.org (accepts connections)
 - connect to remote OpenOffice.org from my application
 - terminate remote OpenOffice.org instance (application registers
this by disposing event)
 - start remote OpenOffice.org again
 - try to reconnect to remote OpenOffice.org from my application -> fails

Last step works only when I restart my application. Code, which
connects to remote OpenOffice.org instance is attached below.

The code below works pretty well until remote OpenOffice.org instance
crashes. The same code is unable to reconnect when new remote
OpenOffice.org instance is started. Application must be restarted. Any
idea what can be wrong?

Regards,
Robert


<remote connect code>

XComponentContext mLocalContext =
Bootstrap.createInitialComponentContext( null );
XMultiComponentFactory xMCF = mServiceManager =
mLocalContext.getServiceManager();

XConnector xConnector = ( XConnector ) UnoRuntime.queryInterface(
XConnector.class,
  xMCF.createInstanceWithContext( "com.sun.star.connection.Connector",
mLocalContext ) );

XConnection xConnection = xConnector.connect( mConnectionString );

XBridgeFactory xBF = ( XBridgeFactory ) UnoRuntime.queryInterface(
XBridgeFactory.class,
  xMCF.createInstanceWithContext( "com.sun.star.bridge.BridgeFactory",
mLocalContext ) );

XBridge mBridge = xBF.createBridge( "", "urp", xConnection, null );
XComponent mBridgeComponent = ( XComponent )
UnoRuntime.queryInterface( XComponent.class, mBridge );

mBridgeComponent.addEventListener( this );

XMultiComponentFactory mServiceManager = ( XMultiComponentFactory )
UnoRuntime.queryInterface( XMultiComponentFactory.class,
  mBridge.getInstance( "StarOffice.ServiceManager" ) );

XComponentContext mRemoteComponentContext = ( XComponentContext )
UnoRuntime.queryInterface( XComponentContext.class,
  PropertySet.getPropertyValue( mServiceManager, "DefaultContext" ) );

</remote connect code>

-- 
Robert Vojta

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to