// Path: nicobar-core/src/main/java/com/netflix/nicobar/core/compile/ScriptArchiveCompiler.java
// public interface ScriptArchiveCompiler {
//     /**
//      * Whether or not this compiler should be used to compile the archive
//      */
//     public boolean shouldCompile(ScriptArchive archive);
// 
//     /**
//      * Compile the archive into a ScriptModule
//      * @param archive archive to generate class files for
//      * @param moduleClassLoader class loader which can be used to find all classes and resources for modules.
//      *  The resultant classes of the compile operation should be injected into the classloader
//      *  for which the given archive has a declared dependency on
//      * @param targetDir a directory in which to store compiled classes, if any.
//      * @return The set of classes that were compiled
//      * @throws ScriptCompilationException if there was a compilation issue in the archive.
//      * @throws IOException if there was a problem reading/writing the archive
//      */
//     public Set<Class<?>> compile(ScriptArchive archive, JBossModuleClassLoader moduleClassLoader, Path targetDir) throws ScriptCompilationException, IOException;
// }
// 
// Path: nicobar-core/src/main/java/com/netflix/nicobar/core/module/jboss/JBossModuleClassLoader.java
// public class JBossModuleClassLoader extends ModuleClassLoader {
//     private final ScriptArchive scriptArchive;
//     private final Map<String, Class<?>> localClassCache;
// 
//     static {
//         try {
//             ClassLoader.registerAsParallelCapable();
//         } catch (Throwable ignored) {
//         }
//     }
//     
//     public JBossModuleClassLoader(Configuration moduleClassLoaderContext, ScriptArchive scriptArchive) {
//         super(moduleClassLoaderContext);
//         this.scriptArchive = scriptArchive;
//         this.localClassCache = new ConcurrentHashMap<String, Class<?>>(scriptArchive.getArchiveEntryNames().size());
//     }
// 
//     /**
//      * Creates a ModuleClassLoaderFactory that produces a {@link JBossModuleClassLoader}.
//      * This method is necessary to inject our custom {@link ModuleClassLoader} into
//      * the {@link ModuleSpec}
//      */
//     protected static ModuleClassLoaderFactory createFactory(final ScriptArchive scriptArchive) {
//         return new ModuleClassLoaderFactory() {
//             public ModuleClassLoader create(final Configuration configuration) {
//                 return AccessController.doPrivileged(
//                     new PrivilegedAction<JBossModuleClassLoader>() {
//                         public JBossModuleClassLoader run() {
//                             return new JBossModuleClassLoader(configuration, scriptArchive);
//                         }
//                     });
//             }
//         };
//     }
// 
//     /**
//      * Manually add the compiled classes to this classloader.
//      * This method will not redefine the class, so that the class's
//      * classloader will continue to be compiler's classloader.
//      */
//     public void addClasses(Set<Class<?>> classes) {
//         for (Class<?> classToAdd: classes) {
//             localClassCache.put(classToAdd.getName(), classToAdd);
//         }
//     }
// 
//     /**
//      * Manually add the compiled classes to this classloader. This method will
//      * define and resolve the class, binding this classloader to the class.
//      * @return the loaded class
//      */
//     public Class<?> addClassBytes(String name, byte[] classBytes) {
//         Class<?> newClass = defineClass(name, classBytes, 0, classBytes.length);
//         resolveClass(newClass);
//         localClassCache.put(newClass.getName(), newClass);
//         return newClass;
//     }
// 
//     @Override
//     public Class<?> loadClassLocal(String className, boolean resolve) throws ClassNotFoundException {
//         Class<?> local = localClassCache.get(className);
//         if (local != null) {
//             return local;
//         }
//         local = super.loadClassLocal(className, resolve);
//         if (local != null)
//             localClassCache.put(className, local);
//         return local;
//     }
// 
//     public ScriptArchive getScriptArchive() {
//         return scriptArchive;
//     }
// 
//     public Set<Class<?>> getLoadedClasses() {
//         return Collections.unmodifiableSet(new HashSet<Class<?>>(localClassCache.values()));
//     }
// }


import java.nio.file.Path;
import java.util.Collections;
import java.util.Set;
import com.netflix.nicobar.core.archive.ScriptArchive;
import com.netflix.nicobar.core.compile.ScriptArchiveCompiler;
import com.netflix.nicobar.core.module.jboss.JBossModuleClassLoader;
/*
 * Copyright 2013 Netflix, Inc.
 *
 *      Licensed under the Apache License, Version 2.0 (the "License");
 *      you may not use this file except in compliance with the License.
 *      You may obtain a copy of the License at
 *
 *          http://www.apache.org/licenses/LICENSE-2.0
 *
 *      Unless required by applicable law or agreed to in writing, software
 *      distributed under the License is distributed on an "AS IS" BASIS,
 *      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *      See the License for the specific language governing permissions and
 *      limitations under the License.
 */
package com.netflix.nicobar.core.internal.compile;



/**
 * A {@link ScriptArchiveCompiler} that does nothing. Intended for use during testing.
 *
 * @author Vasanth Asokan
 */
public class NoOpCompiler implements ScriptArchiveCompiler {

    @Override
    public boolean shouldCompile(ScriptArchive archive) {
// Path: nicobar-core/src/main/java/com/netflix/nicobar/core/compile/ScriptArchiveCompiler.java
// public interface ScriptArchiveCompiler {
//     /**
//      * Whether or not this compiler should be used to compile the archive
//      */
//     public boolean shouldCompile(ScriptArchive archive);
// 
//     /**
//      * Compile the archive into a ScriptModule
//      * @param archive archive to generate class files for
//      * @param moduleClassLoader class loader which can be used to find all classes and resources for modules.
//      *  The resultant classes of the compile operation should be injected into the classloader
//      *  for which the given archive has a declared dependency on
//      * @param targetDir a directory in which to store compiled classes, if any.
//      * @return The set of classes that were compiled
//      * @throws ScriptCompilationException if there was a compilation issue in the archive.
//      * @throws IOException if there was a problem reading/writing the archive
//      */
//     public Set<Class<?>> compile(ScriptArchive archive, JBossModuleClassLoader moduleClassLoader, Path targetDir) throws ScriptCompilationException, IOException;
// }
// 
// Path: nicobar-core/src/main/java/com/netflix/nicobar/core/module/jboss/JBossModuleClassLoader.java
// public class JBossModuleClassLoader extends ModuleClassLoader {
//     private final ScriptArchive scriptArchive;
//     private final Map<String, Class<?>> localClassCache;
// 
//     static {
//         try {
//             ClassLoader.registerAsParallelCapable();
//         } catch (Throwable ignored) {
//         }
//     }
//     
//     public JBossModuleClassLoader(Configuration moduleClassLoaderContext, ScriptArchive scriptArchive) {
//         super(moduleClassLoaderContext);
//         this.scriptArchive = scriptArchive;
//         this.localClassCache = new ConcurrentHashMap<String, Class<?>>(scriptArchive.getArchiveEntryNames().size());
//     }
// 
//     /**
//      * Creates a ModuleClassLoaderFactory that produces a {@link JBossModuleClassLoader}.
//      * This method is necessary to inject our custom {@link ModuleClassLoader} into
//      * the {@link ModuleSpec}
//      */
//     protected static ModuleClassLoaderFactory createFactory(final ScriptArchive scriptArchive) {
//         return new ModuleClassLoaderFactory() {
//             public ModuleClassLoader create(final Configuration configuration) {
//                 return AccessController.doPrivileged(
//                     new PrivilegedAction<JBossModuleClassLoader>() {
//                         public JBossModuleClassLoader run() {
//                             return new JBossModuleClassLoader(configuration, scriptArchive);
//                         }
//                     });
//             }
//         };
//     }
// 
//     /**
//      * Manually add the compiled classes to this classloader.
//      * This method will not redefine the class, so that the class's
//      * classloader will continue to be compiler's classloader.
//      */
//     public void addClasses(Set<Class<?>> classes) {
//         for (Class<?> classToAdd: classes) {
//             localClassCache.put(classToAdd.getName(), classToAdd);
//         }
//     }
// 
//     /**
//      * Manually add the compiled classes to this classloader. This method will
//      * define and resolve the class, binding this classloader to the class.
//      * @return the loaded class
//      */
//     public Class<?> addClassBytes(String name, byte[] classBytes) {
//         Class<?> newClass = defineClass(name, classBytes, 0, classBytes.length);
//         resolveClass(newClass);
//         localClassCache.put(newClass.getName(), newClass);
//         return newClass;
//     }
// 
//     @Override
//     public Class<?> loadClassLocal(String className, boolean resolve) throws ClassNotFoundException {
//         Class<?> local = localClassCache.get(className);
//         if (local != null) {
//             return local;
//         }
//         local = super.loadClassLocal(className, resolve);
//         if (local != null)
//             localClassCache.put(className, local);
//         return local;
//     }
// 
//     public ScriptArchive getScriptArchive() {
//         return scriptArchive;
//     }
// 
//     public Set<Class<?>> getLoadedClasses() {
//         return Collections.unmodifiableSet(new HashSet<Class<?>>(localClassCache.values()));
//     }
// }


// Path: nicobar-core/src/main/java/com/netflix/nicobar/core/internal/compile/NoOpCompiler.java
import java.nio.file.Path;
import java.util.Collections;
import java.util.Set;
import com.netflix.nicobar.core.archive.ScriptArchive;
import com.netflix.nicobar.core.compile.ScriptArchiveCompiler;
import com.netflix.nicobar.core.module.jboss.JBossModuleClassLoader;

/*
 * Copyright 2013 Netflix, Inc.
 *
 *      Licensed under the Apache License, Version 2.0 (the "License");
 *      you may not use this file except in compliance with the License.
 *      You may obtain a copy of the License at
 *
 *          http://www.apache.org/licenses/LICENSE-2.0
 *
 *      Unless required by applicable law or agreed to in writing, software
 *      distributed under the License is distributed on an "AS IS" BASIS,
 *      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *      See the License for the specific language governing permissions and
 *      limitations under the License.
 */
package com.netflix.nicobar.core.internal.compile;



/**
 * A {@link ScriptArchiveCompiler} that does nothing. Intended for use during testing.
 *
 * @author Vasanth Asokan
 */
public class NoOpCompiler implements ScriptArchiveCompiler {

    @Override
    public boolean shouldCompile(ScriptArchive archive) {
        return true;