Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/**
* Copyright (C) 2010 STMicroelectronics
*
* This file is part of "Mind Compiler" is free software: you can redistribute
* it and/or modify it under the terms of the GNU Lesser General Public License
* as published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see .
*
* Contact: [email protected]
*
* Authors: Matthieu Leclercq
* Contributors: Ali Erdem Ozcan
*/
package org.ow2.mind.plugin;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.net.URL;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.Map;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
import org.objectweb.fractal.adl.ADLException;
import org.objectweb.fractal.adl.CompilerError;
import org.objectweb.fractal.adl.Node;
import org.objectweb.fractal.adl.NodeFactory;
import org.objectweb.fractal.adl.error.GenericErrors;
import org.objectweb.fractal.adl.util.FractalADLLogManager;
import org.ow2.mind.plugin.ast.Extension;
import org.ow2.mind.plugin.ast.ExtensionPoint;
import org.ow2.mind.plugin.ast.Plugin;
import org.ow2.mind.plugin.ast.PluginASTHelper;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.NodeList;
import org.xml.sax.SAXException;
public class BasicPluginManager implements PluginManager {
public static final String PLUGIN_XML = "mind-plugin.xml";
protected PluginRegistry pluginRegistry;
protected ClassLoader classLoader;
protected DocumentBuilder builder = null;
protected static Logger pluginLogger = FractalADLLogManager
.getLogger("plugin");
// ---------------------------------------------------------------------------
// Client interfaces
// ---------------------------------------------------------------------------
/** Client interface for node factory. */
public NodeFactory nodeFactoryItf;
// public XMLNodeFactory xmlNodeFactoryItf;
// ---------------------------------------------------------------------------
// Constructor
// ---------------------------------------------------------------------------
public BasicPluginManager() {
final DocumentBuilderFactory builderFactory = DocumentBuilderFactory
.newInstance();
try {
builder = builderFactory.newDocumentBuilder();
} catch (final ParserConfigurationException e) {
throw new CompilerError(GenericErrors.INTERNAL_ERROR, e,
"Can't initialize document builder");
}
}
// ---------------------------------------------------------------------------
// Implementation of the PluginManager interface
// ---------------------------------------------------------------------------
public void setClassLoader(final ClassLoader cl) {
classLoader = cl;
// invalidate plugin registry
pluginRegistry = null;
};
public Collection getExtensions(final String extensionPoint,
final Map