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) 2009 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:
*/
package org.objectweb.fractal.mind.adl;
import static java.lang.System.currentTimeMillis;
import static org.objectweb.fractal.mind.BindingControllerImplHelper.checkItfName;
import static org.objectweb.fractal.mind.BindingControllerImplHelper.listFcHelper;
import static org.objectweb.fractal.mind.InputResourcesHelper.getTimestamp;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.Map;
import java.util.Set;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.objectweb.fractal.adl.ADLException;
import org.objectweb.fractal.adl.AbstractLoader;
import org.objectweb.fractal.adl.Definition;
import org.objectweb.fractal.adl.NodeFactory;
import org.objectweb.fractal.adl.NodeUtil;
import org.objectweb.fractal.adl.error.GenericErrors;
import org.objectweb.fractal.adl.io.NodeInputStream;
import org.objectweb.fractal.adl.io.NodeOutputStream;
import org.objectweb.fractal.adl.util.FractalADLLogManager;
import org.objectweb.fractal.api.NoSuchInterfaceException;
import org.objectweb.fractal.api.control.IllegalBindingException;
import org.objectweb.fractal.mind.InputResource;
import org.objectweb.fractal.mind.InputResourceLocator;
import org.objectweb.fractal.mind.InputResourcesHelper;
/**
* Delegating loader that tries to load ADL definition from binary files (if
* presents and up to date).
*/
public class BinaryADLLoader extends AbstractLoader {
protected static Logger logger = FractalADLLogManager
.getLogger("loader.BinaryLoader");
// ---------------------------------------------------------------------------
// Client interfaces
// ---------------------------------------------------------------------------
/**
* The {@link ADLLocator} client interface used to locate binary and source
* ADL files.
*/
public ADLLocator adlLocatorItf;
/**
* The {@link InputResourceLocator} client interface used to locate and check
* timestamps of dependencies of ADL AST.
*/
public InputResourceLocator inputResourceLocatorItf;
/**
* The {@link NodeFactory} used to de-serialize binary ADL.
*
* @see NodeInputStream
*/
public NodeFactory nodeFactoryItf;
// ---------------------------------------------------------------------------
// Implementation of the Loader interface
// ---------------------------------------------------------------------------
public Definition load(final String name, final Map