Package org.jnode.plugin

Examples of org.jnode.plugin.PluginException


                .doPrivileged(new PrivilegedExceptionAction<PluginJar>() {

                    public PluginJar run() throws PluginException, IOException {
                        final ByteBuffer buf = loader.getPluginBuffer(pluginReference);
                        if (buf == null) {
                            throw new PluginException(
                                "Plugin " + pluginReference + " not found");
                        }
                        return new PluginJar(registry, buf, null);
                    }
                });
        } catch (PrivilegedActionException pax) {
            final Throwable ex = pax.getException();
            if (ex instanceof PluginException) {
                throw (PluginException) ex;
            } else {
                throw new PluginException(ex);
            }
        }
        return pluginJar.getDescriptorModel();
    }
View Full Code Here


     */
    private final void doUnloadPlugin(String pluginId, List<PluginReference> unloadedIds) throws PluginException {
        final PluginDescriptorModel descr = (PluginDescriptorModel) getPluginDescriptor(pluginId);
        if (descr != null) {
            if (descr.isSystemPlugin()) {
                throw new PluginException(
                    "Cannot unload a system plugin: " + pluginId);
            }

            // Unload all plugins that depend on this plugin
            final ArrayList<PluginDescriptor> descriptors = new ArrayList<PluginDescriptor>(descriptorMap.values());
View Full Code Here

                public void execute() {
                    loadExtensions();
                }
            });
        } catch (NamingException ex) {
            throw new PluginException(ex);
        }
    }
View Full Code Here

     */
    protected final String getAttribute(XMLElement e, String name, boolean required) throws PluginException {
        final String v = e.getStringAttribute(name);
        if (required) {
            if (v == null) {
                throw new PluginException("Required attribute " + name + " in element " + e.getName() + " not found");
            }
        }
        if (v != null) {
            return v.intern();
        } else {
View Full Code Here

        if (root.getName().equals("plugin")) {
            return new PluginDescriptorModel(jar, root);
        } else if (root.getName().equals("fragment")) {
            return new FragmentDescriptorModel(jar, root);
        } else {
            throw new PluginException("Unknown root tag " + root.getName());
        }
    }
View Full Code Here

            final ArrayList<AttributeModel> list = new ArrayList<AttributeModel>();
            for (String name : attributeNames) {
                final String value = element.getStringAttribute(name);
                list.add(new AttributeModel(name, value));
                if (value == null) {
                    throw new PluginException("Cannot find attribute value for attribute " + name);
                }
            }
            attributes = list.toArray(new AttributeModel[list.size()]);
        } else {
            attributes = null;
View Full Code Here

    protected void startPlugin() throws PluginException {
        try {
            final DefaultDeviceManager devMan = (DefaultDeviceManager) InitialNaming.lookup(DeviceManager.NAME);
            devMan.findDevices();
        } catch (NameNotFoundException ex) {
            throw new PluginException("Cannot find DeviceManager");
        } catch (InterruptedException ex) {
            throw new PluginException("findDevices was interrupted", ex);
        }
    }
View Full Code Here

     */
    public void resolve(PluginRegistryModel registry) throws PluginException {
        super.resolve(registry);
        plugin = (PluginDescriptorModel) registry.getPluginDescriptor(pluginId);
        if (plugin == null) {
            throw new PluginException("Plugin " + getPluginId() + " not found");
        }
        BootLogInstance.get().info("Resolve " + getId());
        plugin.add(this);
    }
View Full Code Here

        }
        elements = (ConfigurationElement[]) list.toArray(new ConfigurationElement[list.size()]);

        if (id != null) {
            if (id.indexOf('.') >= 0) {
                throw new PluginException("id cannot contain an '.' character");
            }
            uniqueId = plugin.getId() + '.' + id;
        } else {
            uniqueId = null;
        }
View Full Code Here

    }

    protected void resolve(PluginRegistryModel registry) throws PluginException {
        final ExtensionPointModel ep = (ExtensionPointModel) registry.getExtensionPoint(point);
        if (ep == null) {
            throw new PluginException("Unknown extension-point " + point);
        } else {
            ep.add(this);
        }
    }
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.