{
XImplementationLoader xImpLoader = UnoRuntime.queryInterface(
XImplementationLoader.class, new JavaLoader() );
// Get the factory of the ServiceManager
XSingleComponentFactory smgr_fac = UnoRuntime.queryInterface(
XSingleComponentFactory.class, xImpLoader.activate(
"com.sun.star.comp.servicemanager.ServiceManager", null, null, null ) );
// Create an instance of the ServiceManager
XMultiComponentFactory xSMgr = UnoRuntime.queryInterface(
XMultiComponentFactory.class, smgr_fac.createInstanceWithContext( null ) );
// post init loader
XInitialization xInit = UnoRuntime.queryInterface(
XInitialization.class, xImpLoader );
Object[] args = new Object [] { xSMgr };