@ UsedByGeneratedCode public static void associateReloadableType ( ReloadableType child , Class < ? > parent ) { // TODO performance - can we make this cheaper? ClassLoader parentClassLoader = parent . getClassLoader ( ) ; if ( parentClassLoader == null ) { return ; } TypeRegistry parentTypeRegistry = TypeRegistry . getTypeRegistryFor ( parent . getClassLoader ( ) ) ; ReloadableType parentReloadableType = parentTypeRegistry . getReloadableType ( parent ) ; if ( parentReloadableType != null ) { parentReloadableType . recordSubtype ( child ) ; } }
Called from the static initializer of a reloadabletype allowing it to connect itself to the parent type such that when reloading occurs we can mark all relevant types in the hierarchy as being impacted by the reload .