Examples of JarClassLoader


Examples of eu.bibl.bio.jfile.classloader.JarClassLoader

   */
  public JarDownloader(JarInfo... jars) {
    super();
    this.jars = jars;
    contents = new ClassContainer();
    classLoader = new JarClassLoader(contents);
  }
View Full Code Here

Examples of freenet.support.JarClassLoader

      } finally {
        Closer.close(pluginJarFile);
      }

      try {
        JarClassLoader jarClassLoader = new JarClassLoader(pluginFile);
        Class<?> pluginMainClass = jarClassLoader.loadClass(pluginMainClassName);
        Object object = pluginMainClass.newInstance();
        if(!(object instanceof FredPlugin)) {
          Logger.error(this, "plugin main class is not a plugin");
          pluginFile.delete();
          if(!downloaded) continue;
          throw new PluginNotFoundException("plugin main class is not a plugin");
        }

        if(pdl instanceof PluginDownLoaderOfficialHTTPS ||
            pdl instanceof PluginDownLoaderOfficialFreenet) {
          System.err.println("Loading official plugin "+name);
          // Check the version after loading it!
          // FIXME IMPORTANT Build the version into the manifest. This is actually pretty easy and just involves changing build.xml.
          // We already do similar things elsewhere.

          // Ugh, this is just as messy ... ideas???? Maybe we need to have OS
          // detection and use grep/sed on unix and find on windows???

          OfficialPluginDescription desc = officialPlugins.get(name);

          long minVer = desc.minimumVersion;
          long ver = -1;

          if(minVer != -1) {
            if(object instanceof FredPluginRealVersioned) {
              ver = ((FredPluginRealVersioned)object).getRealVersion();
            }
          }

          // FIXME l10n the PluginNotFoundException errors.
          if(ver < minVer) {
            System.err.println("Failed to load plugin "+name+" : TOO OLD: need at least version "+minVer+" but is "+ver);
            Logger.error(this, "Failed to load plugin "+name+" : TOO OLD: need at least version "+minVer+" but is "+ver);

            // At this point, the constructor has run, so it's theoretically possible that the plugin has e.g. created some threads.
            // However, it has not been able to use any of the node's services, because we haven't passed it the PluginRespirator.
            // So there is no need to call runPlugin and terminate().
            // And it doesn't matter all that much if the shutdown fails - we won't be able to delete the file on Windows anyway, we're relying on the ignoreOld logic.
            // Plus, this will not cause a leak of more than one fd per plugin, even when it has started threads.
            try {
              jarClassLoader.close();
            } catch (Throwable t) {
              Logger.error(this, "Failed to close jar classloader for plugin: "+t, t);
            }
            pluginFile.delete();
            if(!downloaded) continue;
View Full Code Here

Examples of l2p.extensions.scripts.jarloader.JarClassLoader

   
    Class<?> c;
    JAR = new File("./scripts.jar").exists();
    if(JAR)
    {
      JarClassLoader jcl;
      try
      {
        jcl = new JarClassLoader("./scripts.jar");
        for(String name : jcl.getClassNames())
        {
          if(!name.contains(".class"))
          {
            continue;
          }
          if(name.contains("$"))
          {
            continue;
          } // пропускаем вложенные классы
          name = name.replace(".class", "").replace("/", ".");
          c = jcl.loadClass(name);
          Script s = new Script(c);
          _classes.put(c.getName(), s);
        }
      }
      catch(Exception e)
View Full Code Here

Examples of org.qdao.core.JarClassLoader

    return config;
  }

  private JarClassLoader getLoader() {
    if (loader == null) {
      loader = new JarClassLoader(config.jarPath, this.getClass().getClassLoader());
    }
    return this.loader;
  }
View Full Code Here

Examples of org.voltdb.utils.JarClassLoader

        this.database = CatalogUtil.getDatabase(this.catalog);
        this.hosts = this.cluster.getHosts();
        this.sites = this.cluster.getSites();
       
        if (this.jarPath != null) {
            this.catalogClassLoader = new JarClassLoader(this.jarPath.getAbsolutePath());
            this.paramMappings = ParametersUtil.getParameterMappingsSetFromJar(this.database, this.jarPath);
        } else {
            this.catalogClassLoader = null;
            this.paramMappings = null;
        }
View Full Code Here

Examples of org.xeustechnologies.jcl.JarClassLoader

    private final JarClassLoader parent;
   
    public DynamicClassLoader(String dir) {
        classes = Collections.synchronizedMap( new HashMap<String, Class>() );
        dirPath = dir;
        parent = new JarClassLoader();
        parent.getLocalLoader().setOrder(2);
        parent.getCurrentLoader().setOrder(3);
        parent.getParentLoader().setOrder(4);
        parent.getThreadLoader().setOrder(5);
        parent.getSystemLoader().setOrder(6);
View Full Code Here

Examples of org.xeustechnologies.jcl.JarClassLoader

            for (int i = 0; i < nl.getLength(); i++) {
                Node n = nl.item( i );

                String name = n.getAttributes().getNamedItem( ATTRIBUTE_NAME ).getNodeValue();

                JarClassLoader jcl = new JarClassLoader();

                NodeList config = n.getChildNodes();

                for (int j = 0; j < config.getLength(); j++) {
                    Node c = config.item( j );
View Full Code Here

Examples of org.xeustechnologies.jcl.JarClassLoader

    private String jarLocation;

    public Application(String jarLocation) {
        this.jarLocation = jarLocation;

        jcl = new JarClassLoader();
        jcl.add(jarLocation);

        Document manifest = null;
        try {
            manifest = new JarReader().readXML(jarLocation, "manifest.xml");
View Full Code Here

Examples of scalaExec.ClassLoaders.JarClassLoader

           progressFrame.add(progressPanel);
           progressFrame.setSize(600, 100);
           progressFrame.setLocation(10, 10);
           progressFrame.setVisible(true);
                 
         JarClassLoader  myJarLoader = new JarClassLoader();
        
         int scalaSciClasses = myJarLoader.scanBuiltInScalaSciClasses(jarFilePath);
         int libsEJMLScalaSciClasses = myJarLoader.scanLibsScalaSciClasses(scalalab.JavaGlobals.ejmlFile);
         int libsMTJScalaSciClasses = myJarLoader.scanLibsScalaSciClasses(scalalab.JavaGlobals.mtjColtSGTFile);
         int libsApacheCommonsScalaSciClasses = myJarLoader.scanLibsScalaSciClasses(scalalab.JavaGlobals.ApacheCommonsFile);
         int libsNumalScalaSciClasses = myJarLoader.scanLibsScalaSciClasses(scalalab.JavaGlobals.numalFile);
        
         scalaExec.Interpreter.GlobalValues.autoCompletionScalaSci = new scalaExec.gui.AutoCompletionScalaSci()// create the autocompletion object
         System.out.println("#ScalaSciClasses =  "+scalaSciClasses+", # numaliClasses = "+libsNumalScalaSciClasses +
                 ", # ejmlClasses = "+ libsEJMLScalaSciClasses+", # MTJColtSGTClasses ="+libsMTJScalaSciClasses+
View Full Code Here

Examples of scalaExec.ClassLoaders.JarClassLoader

  
   public void loadClasses(String toolboxJarFile) {
               try {
        
                 
         JarClassLoader  myJarLoader = new JarClassLoader();
        
             
        int numClassesLoadedFromToolbox = myJarLoader.scanAllToolboxClasses(toolboxJarFile);
         String smallName = toolboxJarFile;
        int idx;
        while ((idx = smallName.indexOf('.')) != -1)   // extract class name
           smallName = smallName.substring(idx+1, smallName.length());
        GlobalValues.loadedToolboxesNames[GlobalValues.currentToolboxId= smallName;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.