Interface LibLoader


  • public interface LibLoader
    Class that is used to inject libraries into the state info() stem. This allows users (in the workspace) to issue
         info().'lib'
     
    and get a listing of custom classes. This will also use the jload mechanism of the workspace on them, so users can very conveniently either list your extensions or load them.

    The contract is simple. Create an instance of this, put a reference to it in the modules section of the configuration.

    A compelete basic (from OA4MP)

      public class OA2LibLoader implements LibLoader {
         protected String libKey = "oa2";
    
         // Calls the addEntries method from the current state. This just adds the QDLStem
         // of library entries, whose key is libKey.
    
         public void add(State state) {
             QDLStem lib = new QDLStem();
             lib.put("description", "OA4MP tools for ACLs, JWTs, claims as well as token handlers");
             state.addLibEntries(libKey, createEntries());
         }
         // Creates the individual entries.
         protected QDLStem createEntries(){
             QDLStem lib = new QDLStem();
             lib.put("description", "OA4MP tools for ACLs, JWTs, claims as well as token handlers");
             QDLStem subLib = new QDLStem();
             subLib.put("claims", ClaimsLoader.class.getCanonicalName());
             subLib.put("jwt", JWTLoader.class.getCanonicalName());
             subLib.put("acl", ACLoader.class.getCanonicalName());
             lib.put("util", subLib);
             return lib;
         }
     }
     
    The net effect is here, issuing info().'lib' in the OA4MP workspace yields
          info().lib
     {
      oa2: {
       description:OA4MP tools for ACLs, JWTs, claims as well as token handlers,
         util:  {
        jwt:edu.uiuc.ncsa.myproxy.oa4mp.qdl.util.JWTLoader,
        claims:edu.uiuc.ncsa.myproxy.oa4mp.qdl.claims.ClaimsLoader,
        acl:edu.uiuc.ncsa.myproxy.oa4mp.qdl.acl.ACLoader
       },//.. more
     

    Created by Jeff Gaynor
    on 4/4/23 at 7:46 AM