Class ButterflyClassLoader

  • All Implemented Interfaces:
    Closeable, AutoCloseable

    public class ButterflyClassLoader
    extends URLClassLoader
    This is Butterfly's own classloader that allows it to load classes and libraries from modules directly, instead of forcing them to be in the container's classpath or in the WEB-INF/(classes|lib) folders. This allows modules to be developed in isolation. Also, this classloader is capable of monitoring changes to the loaded classes (or to special files that we want watched for changes) and it's capable of executing a given Runnable action when such changes occur.
    • Constructor Detail

      • ButterflyClassLoader

        public ButterflyClassLoader​(ClassLoader parent)
    • Method Detail

      • getClassLoaderWatcher

        public TimerTask getClassLoaderWatcher​(Runnable trigger)
      • addRepository

        public void addRepository​(File repository)
      • watch

        public void watch​(File file)