public <T extends Object> T construct(NitDesc nitDesc) throws NitException {
    NitAgent agent = agents.get(nitDesc.spec);
    if (agent == null){
      if (nitDesc.spec == NitDesc.NitSpec.GROOVY_CLASS_LOADER){
        agent = new GroovyClasspathAgent();
      } else if (nitDesc.spec == NitDesc.NitSpec.JAVASCRIPT_CLOSURE ) {
        agent = new JavascriptClosureAgent();
      } else if (nitDesc.spec == NitDesc.NitSpec.CLOJURE_CLOSURE) {
        agent = new ClojureClosureAgent();
      } else if (nitDesc.spec == NitDesc.NitSpec.GROOVY_CLOSURE) {
        agent = new GroovyClosureAgent();
      } else if (nitDesc.spec == NitDesc.NitSpec.JAVA_LOCAL_CLASSPATH){
        agent = new JavaLocalClasspathAgent();
      } else if (nitDesc.spec == NitDesc.NitSpec.JAVA_ON_JAVA){ 
        agent = new JavaOnJavaAgent();
      } else if (nitDesc.spec == NitDesc.NitSpec.JAVA_URL_CLASSLOADER ) {
        agent = new UrlClassLoaderAgent();
      } else if (nitDesc.spec == NitDesc.NitSpec.SCALA_CLOSURE){
        agent = new ScalaClosureAgent();
      } else {
        throw new NitException(nitDesc.spec + " not found");
      }
      agents.put(nitDesc.spec, agent);
    }
    return (T) agent.createInstance(nitDesc);
  }