Example usage for org.springframework.boot.devtools.restart.classloader RestartClassLoader RestartClassLoader

List of usage examples for org.springframework.boot.devtools.restart.classloader RestartClassLoader RestartClassLoader

Introduction

In this page you can find the example usage for org.springframework.boot.devtools.restart.classloader RestartClassLoader RestartClassLoader.

Prototype

public RestartClassLoader(ClassLoader parent, URL[] urls, ClassLoaderFileRepository updatedFiles, Log logger) 

Source Link

Document

Create a new RestartClassLoader instance.

Usage

From source file:org.springframework.boot.devtools.restart.Restarter.java

private Throwable doStart() throws Exception {
    Assert.notNull(this.mainClassName, "Unable to find the main class to restart");
    ClassLoader parent = this.applicationClassLoader;
    URL[] urls = this.urls.toArray(new URL[this.urls.size()]);
    ClassLoaderFiles updatedFiles = new ClassLoaderFiles(this.classLoaderFiles);
    ClassLoader classLoader = new RestartClassLoader(parent, urls, updatedFiles, this.logger);
    if (this.logger.isDebugEnabled()) {
        this.logger.debug("Starting application " + this.mainClassName + " with URLs " + Arrays.asList(urls));
    }/*  ww w .  jav  a  2  s .  c  om*/
    return relaunch(classLoader);
}