private T loadResourceValue ( final URL resource ) { try ( final InputStream is = resource . openStream ( ) ) { cached = null ; // Prevent the old value from being used return setCached ( clazz . cast ( factory . getInstance ( clazz ) . deserialise ( is ) ) ) ; } catch ( IOException e ) { throw new RuntimeException ( "Error loading JAXB resource " + name + " " + clazz + " from " + resource , e ) ; } }
Load from a classpath resource ; reloads every time