Class ApplicationConfigurationBinder

    • Constructor Detail

      • ApplicationConfigurationBinder

        public ApplicationConfigurationBinder()
    • Method Detail

      • load

        public ApplicationConfiguration load​(InputStream stream)
        Returns the application configuration from its XML serialisation.
        Parameters:
        stream - the serialisation
        Returns:
        the configuration
        Throws:
        RuntimeException - if the serialisation is invalid
      • bindHandlers

        public ApplicationHandlers bindHandlers​(ClassLoader classLoader)
        Returns the handlers of the application from their XML serialisation.
        Parameters:
        stream - the serialisation
        Returns:
        the handlers
        Throws:
        RuntimeException - if the serialisation is invalid
      • scanForApplicationHandlers

        public void scanForApplicationHandlers​(ClassLoader currentClassLoader)
        Returns the extensions of the application from their XML serialisation.
        Parameters:
        stream - the serialisation
        Throws:
        RuntimeException - if the serialisation is invalid public ApplicationExtensions bindExtensions(InputStream stream) { //collects handler classes Set> classes = scanForExtensions(); try { JAXBContext ctx = JAXBContext.newInstance(classes.toArray(new Class[0])); return (ApplicationExtensions) ctx.createUnmarshaller().unmarshal(stream); } catch (JAXBException e) { throw unchecked(e); } finally { closeSafely(stream); } } private Set> scanForExtensions() throws RuntimeException {