protected XMultiServiceFactory connectAwareGetServiceFactory() throws com.sun.star.uno.Exception,
com.sun.star.uno.RuntimeException,
Exception {
// Get component context
XComponentContext xComponentContext =
com.sun.star.comp.helper.Bootstrap.createInitialComponentContext(null);
// instantiate connector service
Object x = xComponentContext.getServiceManager().createInstanceWithContext(
"com.sun.star.connection.Connector", xComponentContext);
XConnector xConnector = (XConnector) UnoRuntime.queryInterface(XConnector.class, x);
String a[] = parseUnoUrl(sConnectionString);
if (null == a) {
throw new com.sun.star.uno.Exception("Couldn't parse uno-url " + sConnectionString);
}
// connect using the connection string part of the uno-url only.
m_Connection = xConnector.connect(a[0]);
x = xComponentContext.getServiceManager().createInstanceWithContext(
"com.sun.star.bridge.BridgeFactory", xComponentContext);
XBridgeFactory xBridgeFactory = (XBridgeFactory) UnoRuntime.queryInterface(
XBridgeFactory.class, x);