@ Override /* BuildLink interface */ public synchronized Object reload ( ) { Object result = null ; try { boolean reloadRequired = buildLink . build ( ) ; if ( reloadRequired ) { int version = ++ classLoaderVersion ; String name = "ReloadableClassLoader(v" + version + ")" ; currentApplicationClassLoader = new DelegatedResourcesClassLoader ( name , toUrls ( outputDirectories ) , baseLoader ) ; result = currentApplicationClassLoader ; } } catch ( MalformedURLException e ) { throw new UnexpectedException ( "Unexpected reloader exception" , e ) ; //?? } catch ( Play2BuildFailure e ) { result = new CompilationException ( e . getMessage ( ) , e . line ( ) , e . position ( ) , e . source ( ) != null ? e . source ( ) . getAbsolutePath ( ) : null , e . input ( ) ) ; } catch ( Play2BuildError e ) { result = new UnexpectedException ( e . getMessage ( ) , e . getCause ( ) ) ; //?? } return result ; }
Contrary to its name this doesn t necessarily reload the app . It is invoked on every request and will only trigger a reload of the app if something has changed .