Object[] initargs = { serviceMgr };
init.initialize(initargs);
// Use the XSet interface at the ServiceManager to add the factory of
// the loader
XSet serviceMgrXSet = (XSet)UnoRuntime.queryInterface(
XSet.class, serviceMgr);
XSingleServiceFactory singleServiceFact;
// Add the factory of the loader
singleServiceFact = (XSingleServiceFactory)UnoRuntime.queryInterface(
XSingleServiceFactory.class,
implLoader.activate(
"com.sun.star.comp.loader.JavaLoader", null, null, null));
serviceMgrXSet.insert(singleServiceFact);
// Add the service manager
serviceMgrXSet.insert(managerFact);
// Add the factory of the URLResolver
singleServiceFact = (XSingleServiceFactory)UnoRuntime.queryInterface(
XSingleServiceFactory.class,
implLoader.activate(
"com.sun.star.comp.urlresolver.UrlResolver", null, null, null));
serviceMgrXSet.insert(singleServiceFact);
// Add the bridgefactory
singleServiceFact = (XSingleServiceFactory)UnoRuntime.queryInterface(
XSingleServiceFactory.class,
implLoader.activate(
"com.sun.star.comp.bridgefactory.BridgeFactory", null, null, null));
serviceMgrXSet.insert(singleServiceFact);
// Ufff ... that's all
mLocalServiceFactory = serviceMgr;
}