Package giggler.exception

Examples of giggler.exception.IllegalPluginException


            this.addURL(pluginJarFile.toURI().toURL());
           
        } catch (MalformedURLException e) {

            e.printStackTrace();
            throw new IllegalPluginException(e);
        }
       
        pluginDescriptor = loadPluginDescriptor();
       
        Class<Runtime> runtimeClass = getRuntimeClass();
       
        Runtime runtime = null;
       
        if (runtimeClass != null) {
           
            try {
               
                runtime = runtimeClass.newInstance();
               
            } catch (Exception e) {
                e.printStackTrace();
                throw new IllegalPluginException(e);
            }
        }
       
        File files[] = pluginDirectory.listFiles();
       
        for (File file : files) {
           
            boolean addToClassLoader = true;
           
            if (file.equals(pluginJarFile))
                addToClassLoader = false;
            else if (runtime != null)
                addToClassLoader = runtime.use(file.getName());
           
            if (addToClassLoader) {
               
                try {
                   
                    this.addURL(file.toURI().toURL());
                    log.info("["+pluginName+"] loadLibrary=["+file.getName()+"] visibility=PRIVATE");
                   
                } catch (MalformedURLException e) {

                    e.printStackTrace();
                    throw new IllegalPluginException(e);
                }
            }
        }
       
        dependencyList = new ArrayList<ClassLoader>(2);
View Full Code Here


                return pathname.getName().equals(pluginFileName);
            }
        });
       
        if (files==null || files.length!=1)
            throw new IllegalPluginException("main plugin file '"+pluginFileName+"' not found in cache");
       
        return files[0];
    }
View Full Code Here

    public PluginDescriptor loadPluginDescriptor() {
       
        URL pluginDescriptorUrl = this.findResource("META-INF/"+PluginDescriptor.FILE_NAME);

        if (pluginDescriptorUrl == null)
            throw new IllegalPluginException("missing plugin descriptor for ["+pluginName+"]");
       
        log.debug("plugin descriptor for ["+pluginName+"] found at "+pluginDescriptorUrl);

        try {

            PluginDescriptor pluginDescriptor = new PluginDescriptor(pluginDescriptorUrl.openStream());
            return pluginDescriptor;

        } catch (Exception e) {

            e.printStackTrace();
            throw new IllegalPluginException("accessing the plugin descriptor failed", e);
        }
    }
View Full Code Here

    private State state = State.Shutdown;
   
    public void register(Plugin plugin) {
       
        if (plugin.getName()==null || plugin.getName().trim().length()==0)
            throw new IllegalPluginException("plugin rejected; no name given");
       
        if (plugin.getVersion() == 0f)
            throw new IllegalPluginException("plugin '"+plugin.getName()+"' rejected; no version given");
       
        if (dependencyTree.exists(plugin.getName()))
            throw new IllegalPluginException("plugin '"+plugin.getName()+"' rejected; already registered");
       
        PluginModule module = new PluginModule(plugin);
       
        module.init();
       
View Full Code Here

       
            registry.register(plugin);
       
        } catch (Throwable t) {

            throw new IllegalPluginException("registering plugin '"+pluginName+"' failed.", t);
        }
    }
View Full Code Here

           
            zipInputStream.close();
           
        } catch (ClassCastException cce) {

            throw new IllegalPluginException("Entrypoint malformed.", cce);
           
        } catch (IOException ioe) {
           
            throw new IllegalPluginException("Unknown format.", ioe);
        }
    }
View Full Code Here

           
        } catch (ClassNotFoundException e) {
           
            e.printStackTrace();
           
            throw new IllegalPluginException("class '"+className+"' for "+entry+" not loaded; reason "+e.getMessage(), e);
        }
    }
View Full Code Here

            state = State.INITIALIZED;
           
        } catch (Throwable t) {

            t.printStackTrace();
            throw new IllegalPluginException("initializing plugin '"+plugin.getName()+"' failed.", t);
        }
  }
View Full Code Here

            fire(state);

        } catch (Throwable t) {

            t.printStackTrace();
            throw new IllegalPluginException("starting plugin '"+plugin.getName()+"' failed.", t);
        }
  }
View Full Code Here

            fire(state);
           
        } catch (Throwable t) {
         
            t.printStackTrace();
            throw new IllegalPluginException("stopping plugin '"+plugin.getName()+"' failed.", t);
        }
  }
View Full Code Here

TOP

Related Classes of giggler.exception.IllegalPluginException

Copyright © 2018 www.massapicom. 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.