title: how to get session object from resource resolver factory?
body: <pre><code>@Component
  public class AddNode {
      @Reference
      static ResourceResolverFactory resolverFactory;
      static Session session;
  
      public static void main(String[] args) throws Exception { 
  
  
          ResourceResolver resourceResolver = resolverFactory.getServiceResourceResolver(null);
  
          session = resourceResolver.adaptTo(Session.class);        
            Node root = session.getRootNode(); 
  
            Node adobe = root.addNode("ProgramNode"); 
            Node day = adobe.addNode("subnode"); 
            day.setProperty("jcr:title", "programNode"); 
  
            Node node = root.getNode("ProgramNode/subnode"); 
            System.out.println(node.getPath()); 
            System.out.println(node.getProperty("jcr:title").getString()); 
            session.save(); 
            session.logout();
  
  
          }
  
  }
  </code></pre>
  
  <p>here  resolverFactory.getServiceResourceResolver(null);  i need to  pass any parameter at null.please give some example to get access of repository.</p>