XMultiComponentFactory localServiceManager = localContext.getServiceManager();
XConnector connector = (XConnector) UnoRuntime.queryInterface(XConnector.class,
localServiceManager.createInstanceWithContext("com.sun.star.connection.Connector", localContext));
XConnection connection = connector.connect(connectionString);
XBridgeFactory bridgeFactory = (XBridgeFactory) UnoRuntime.queryInterface(XBridgeFactory.class,
localServiceManager.createInstanceWithContext("com.sun.star.bridge.BridgeFactory", localContext));
bridge = bridgeFactory.createBridge("", "urp", connection, null);
bridgeComponent = (XComponent) UnoRuntime.queryInterface(XComponent.class, bridge);
bridgeComponent.addEventListener(this);
serviceManager = (XMultiComponentFactory) UnoRuntime.queryInterface(XMultiComponentFactory.class,
bridge.getInstance("StarOffice.ServiceManager"));