title: ADTF SDK: import manifest AND handle it
body: <p>I'm trying to run a <strong>full ADTF configuration</strong> from my own <strong>C++ command-line application</strong> using the <strong>ADTF SDK</strong>. ADTF version: <strong>2.9.1</strong> (pretty old).</p>
  
  <p>Here's what I have (want) to do:</p>
  
  <ol>
  <li><strong>Load manifest</strong> file</li>
  <li><strong>Load globals-xml</strong></li>
  <li><strong>Load config-xml</strong></li>
  </ol>
  
  <p><strong>2 &amp; 3 are done</strong>, using the <strong>session-manager</strong> service - see <strong>ISessionManager</strong> interface: <a href="https://support.digitalwerk.net/adtf/v2/adtf_sdk_html_docs/classadtf_1_1_i_session_manager.html" rel="nofollow noreferrer">https://support.digitalwerk.net/adtf/v2/adtf_sdk_html_docs/classadtf_1_1_i_session_manager.html</a> , functions <strong>LoadGlobalsFromFile</strong> &amp; <strong>LoadConfigFromFile</strong>.</p>
  
  <p>The problem is that <strong>I don't know how to do point 1</strong>: currently, instead of loading a manifest, I manually load the list of services myself using <strong>_runtime->RegisterPlugin</strong>, <strong>_runtime->CreateInstance</strong> and <strong>_runtime->RegisterObject</strong>.</p>
  
  <p>What I've managed to do is to load only the <strong>namespace service</strong> and use the <strong>INamespace</strong> interface which has a method for loading manifest files: <a href="https://support.digitalwerk.net/adtf/v2/adtf_sdk_html_docs/classadtf_1_1_i_namespace.html" rel="nofollow noreferrer">https://support.digitalwerk.net/adtf/v2/adtf_sdk_html_docs/classadtf_1_1_i_namespace.html</a> - see <strong>ImportFile</strong> with ui32ImportFlags = <strong>CF_IMPORT_MANIFEST</strong>. </p>
  
  <p>But <strong>this only loads the manifest settings into the namespace</strong>, it doesn't actually instantiate the services. I could do it manually, by:</p>
  
  <ol>
  <li>Do <strong>_runtime->RegisterPlugin</strong> for every <strong>url</strong> under
  <strong>root/plugins/</strong> in the namespace</li>
  <li>Do <strong>_runtime->CreateInstance</strong> for every <strong>objectid</strong> under
  <strong>root/services/</strong> in the namespace</li>
  </ol>
  
  <p>But I want this to be more <strong>robust</strong> and I'm hoping there's already <strong>a service that handles the populated namespace subsequently</strong> and does these actions. <strong>Is there such a service?</strong></p>
  
  <p>Note: if you know how this could be done in <strong>ADTF3</strong> that might <strong>also be of help</strong> for me, so don't hesitate to answer/comment</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>See "Flow of the system" on this page: <a href="https://support.digitalwerk.net/adtf/v2/adtf_sdk_html_docs/page_service_layer.html" rel="nofollow noreferrer">https://support.digitalwerk.net/adtf/v2/adtf_sdk_html_docs/page_service_layer.html</a></p>
  
  <p>Apparently the <strong>runtime instance itself handles the manifest</strong> file (see run-levels shutdown &amp; kernel) but I don't know how I'm supposed to tell it where it is.</p>
  
  <p>I've tried setting the <strong>command-line arguments</strong> to be <strong>count = 2</strong> and the <strong>2nd = manifest file path</strong> when instantiating <strong>cRuntime</strong>. <strong>It doesn't work :)</strong>.</p>