Package org.jnode.plugin

Examples of org.jnode.plugin.PluginException


     * @throws PluginException
     */
    protected void unresolve(PluginRegistryModel registry) throws PluginException {
        final ExtensionPointModel ep = (ExtensionPointModel) registry.getExtensionPoint(point);
        if (ep == null) {
            throw new PluginException("Unknown extension-point " + point);
        } else {
            ep.remove(this);
        }
    }
View Full Code Here


            MouseProtocolHandlerManager mphmgr =
                new MouseProtocolHandlerManager(descriptor.getExtensionPoint("mouse-protocol-handlers"));
            InitialNaming.bind(MouseProtocolHandlerManager.NAME, mphmgr);
        } catch (NamingException ex) {
            throw new PluginException(ex);
        }
    }
View Full Code Here

    protected void startPlugin() throws PluginException {
        try {
            dma = new DMA();
            InitialNaming.bind(NAME, this);
        } catch (DMAException ex) {
            throw new PluginException("Cannot initialize DMA", ex);
        } catch (NamingException ex) {
            throw new PluginException("Cannot bind DMAService", ex);
        }
    }
View Full Code Here

                initBuffer = new byte[0];
            }
            // Load the plugin into memory
            resources = loadResources(pluginIs);
        } catch (IOException ex) {
            throw new PluginException("Error loading jarfile", ex);
        }

        final XMLElement root;
        try {
            // Not find the plugin.xml
            final ByteBuffer buf = getResourceAsBuffer("plugin.xml");
            if (buf == null) {
                throw new PluginException(
                    "plugin.xml not found in jar file");
            }

            // Now parse plugin.xml
            root = new XMLElement(new Hashtable<Object, Object>(), true, false);
            final Reader r = new InputStreamReader(new ByteBufferInputStream(buf));
            try {
                root.parseFromReader(r);
            } finally {
                r.close();
            }
        } catch (IOException ex) {
            throw new PluginException("Plugin " + pluginUrl, ex);
        }
        this.descriptor = Factory.parseDescriptor(this, root);
    }
View Full Code Here

            } else if (tag.equals("requires")) {
                for (final XMLElement impE : childE.getChildren()) {
                    if (impE.getName().equals("import")) {
                        reqList.add(new PluginPrerequisiteModel(this, impE));
                    } else {
                        throw new PluginException("Unknown element "
                            + impE.getName());
                    }
                }
            } else if (tag.equals("extension")) {
                exList.add(new ExtensionModel(this, childE));
            } else if (tag.equals("runtime")) {
                if (runtime == null) {
                    runtime = new RuntimeModel(this, childE);
                } else {
                    throw new PluginException("duplicate runtime element");
                }
            } else {
                throw new PluginException("Unknown element " + tag);
            }
        }
        if (!epList.isEmpty()) {
            extensionPoints = (ExtensionPointModel[]) epList
                .toArray(new ExtensionPointModel[epList.size()]);
View Full Code Here

                    final Constructor<?> cons = cls
                        .getConstructor(new Class[]{PluginDescriptor.class});
                    return (Plugin) cons.newInstance(new Object[]{this});
                }
            } catch (ClassNotFoundException ex) {
                throw new PluginException(ex);
            } catch (IllegalAccessException ex) {
                throw new PluginException(ex);
            } catch (InstantiationException ex) {
                throw new PluginException(ex);
            } catch (InvocationTargetException ex) {
                throw new PluginException(ex.getTargetException());
            } catch (NoSuchMethodException ex) {
                throw new PluginException(ex);
            }
        }
    }
View Full Code Here

                }
                while (!started) {
                    try {
                        startLock.wait();
                    } catch (InterruptedException ex) {
                        throw new PluginException(ex);
                    }
                }
            }
        }
    }
View Full Code Here

        // Setup the default policy
        try {
            Policy.setPolicy(policy);
        } catch (Throwable ex) {
            ex.printStackTrace();
            throw new PluginException("setPolicy failed");
        }

        // Setup the securitymanager
        System.setSecurityManager(new JNodeSecurityManager());
    }
View Full Code Here

            addWorker();
        }
        try {
            InitialNaming.bind(NAME, this);
        } catch (NamingException ex) {
            throw new PluginException(ex);
        }
    }
View Full Code Here

                root.parseFromReader(r);
            } finally {
                r.close();
            }
        } catch (IOException ex) {
            throw new PluginException(ex);
        }
        if (!root.getName().equals("plugin-list")) {
            throw new PluginException("plugin-list element expected");
        }

        this.name = (String) root.getAttribute("name");
        if (name == null) {
            throw new PluginException("name attribute is missing in " + file);
        }

        for (Iterator<?> i = root.getChildren().iterator(); i.hasNext();) {

            final XMLElement e = (XMLElement) i.next();
            if (e.getName().equals("plugin")) {
                final String id = e.getStringAttribute("id");

                if (id == null) {
                    throw new PluginException("id attribute expected on "
                        + e.getName());
                }
               
                // version attribute is optional
                // if not specified, then the latest version found will be used.
                final String version = e.getStringAttribute("version");

                addPlugin(descrList, pluginList, id, version);
            } else if (e.getName().equals("manifest")) {
                manifest = parseManifest(e);
            } else if (e.getName().equals("include")) {
                parseInclude(e, file.getParentFile(), defaultDir, targetArch,
                    descrList, pluginList);
            } else {
                throw new PluginException("Unknown element " + e.getName());
            }
        }
    }
View Full Code Here

TOP

Related Classes of org.jnode.plugin.PluginException

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.