// 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 };
xInit.initialize( args );
// initial component context
if (context_entries == null)
context_entries = new Hashtable( 1 );
// add smgr
context_entries.put(
"/singletons/com.sun.star.lang.theServiceManager",
new ComponentContextEntry( null, xSMgr ) );
// ... xxx todo: add standard entries
XComponentContext xContext = new ComponentContext( context_entries, null );
// post init smgr
xInit = UnoRuntime.queryInterface(
XInitialization.class, xSMgr );
args = new Object [] { null, xContext }; // no registry, default context
xInit.initialize( args );
XSet xSet = UnoRuntime.queryInterface( XSet.class, xSMgr );
// insert the service manager
xSet.insert( smgr_fac );
// and basic jurt factories