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"));
XPropertySet properties = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, serviceManager);