Object[] iniargs = { xMultiFac };
xInit.initialize( iniargs );
// now use the XSet interface at the ServiceManager to add the factory of the loader
XSet xSet = (XSet) UnoRuntime.queryInterface(XSet.class, xMultiFac);
// Get the factory of the loader
XSingleServiceFactory xSingleServiceFactory = (XSingleServiceFactory) UnoRuntime.queryInterface(XSingleServiceFactory.class,
xImpLoader.activate("com.sun.star.comp.loader.JavaLoader", null, null, null));
// add the javaloader
xSet.insert(xSingleServiceFactory);
// add the service manager
xSet.insert(xManagerFac);
// Get the factory of the URLResolver
xSingleServiceFactory = (XSingleServiceFactory)UnoRuntime.queryInterface(XSingleServiceFactory.class,
xImpLoader.activate("com.sun.star.comp.urlresolver.UrlResolver", null, null, null));
xSet.insert(xSingleServiceFactory);
// add the bridgefactory
xSingleServiceFactory = (XSingleServiceFactory)UnoRuntime.queryInterface(XSingleServiceFactory.class,
xImpLoader.activate("com.sun.star.comp.bridgefactory.BridgeFactory", null, null, null));
xSet.insert(xSingleServiceFactory);
// add the connector
xSingleServiceFactory = (XSingleServiceFactory)UnoRuntime.queryInterface(XSingleServiceFactory.class,
xImpLoader.activate("com.sun.star.comp.connections.Connector", null, null, null));
xSet.insert(xSingleServiceFactory);
// add the acceptor
xSingleServiceFactory = (XSingleServiceFactory)UnoRuntime.queryInterface(XSingleServiceFactory.class,
xImpLoader.activate("com.sun.star.comp.connections.Acceptor", null, null, null));
xSet.insert(xSingleServiceFactory);
return xMultiFac;
}