All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.slavaz.maven.plugin.postgresql.embedded.classloader.ClassLoaderHolder Maven / Gradle / Ivy

Go to download

This is a Maven plugin for running an embedded PostgreSQL server, mostly for integration tests.

The newest version!
package com.github.slavaz.maven.plugin.postgresql.embedded.classloader;

public class ClassLoaderHolder {

    private static volatile ClassLoader classLoader;

    private ClassLoaderHolder() {
    	// a static singleton
    }

    public static void setClassLoader(ClassLoader classLoader) {
        if ((classLoader != null) && (ClassLoaderHolder.classLoader != null)) {
            throw new IllegalStateException("A classloader has already been set. Run the `stop` goal before running start twice.");
        }
        ClassLoaderHolder.classLoader = classLoader;
    }

    public static ClassLoader getClassLoader() {
        return classLoader;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy