@Override
    public List<ModelNode> load() throws ConfigurationPersistenceException {
        if (suppressLoad) {
            return new ArrayList<>();
        }

        final XMLMapper mapper = XMLMapper.Factory.create();
        mapper.registerRootElement(rootElement, rootParser);
        synchronized (additionalParsers) {
            for (Map.Entry<QName, XMLElementReader<List<ModelNode>>> entry : additionalParsers.entrySet()) {
                mapper.registerRootElement(entry.getKey(), entry.getValue());
            }
        }
        final List<ModelNode> updates = new ArrayList<ModelNode>();
        try {
            final FileInputStream fis = new FileInputStream(fileName);
            try {
                BufferedInputStream input = new BufferedInputStream(fis);
                XMLStreamReader streamReader = XMLInputFactory.newInstance().createXMLStreamReader(input);
                mapper.parseDocument(updates, streamReader);
                streamReader.close();
                input.close();
                fis.close();
            } finally {
                safeClose(fis);
            }
        } catch (XMLStreamException e) {
            final boolean reported = reportValidationError(e);
            Throwable cause = null;
            if (!reported) {
                if (e instanceof XMLStreamValidationException) {
                    cause = e.getNestedException();
                } else {
                    cause = e;
                }
            }
            throw ControllerLogger.ROOT_LOGGER.failedToParseConfiguration(cause);
        } catch (Exception e) {
            throw ControllerLogger.ROOT_LOGGER.failedToParseConfiguration(e);
        }
        return updates;
    }
@ Override public List < ModelNode > load ( ) throws ConfigurationPersistenceException { if ( suppressLoad ) { return new ArrayList < > ( ) ; } final XMLMapper mapper = XMLMapper . Factory . create ( ) ; mapper . registerRootElement ( rootElement , rootParser ) ; synchronized ( additionalParsers ) { for ( Map . Entry < QName , XMLElementReader < List < ModelNode > > > entry : additionalParsers . entrySet ( ) ) { mapper . registerRootElement ( entry . getKey ( ) , entry . getValue ( ) ) ; } } final List < ModelNode > updates = new ArrayList < ModelNode > ( ) ; try { final FileInputStream fis = new FileInputStream ( fileName ) ; try { BufferedInputStream input = new BufferedInputStream ( fis ) ; XMLStreamReader streamReader = XMLInputFactory . newInstance ( ) . createXMLStreamReader ( input ) ; mapper . parseDocument ( updates , streamReader ) ; streamReader . close ( ) ; input . close ( ) ; fis . close ( ) ; } finally { safeClose ( fis ) ; } } catch ( XMLStreamException e ) { final boolean reported = reportValidationError ( e ) ; Throwable cause = null ; if ( ! reported ) { if ( e instanceof XMLStreamValidationException ) { cause = e . getNestedException ( ) ; } else { cause = e ; } } throw ControllerLogger . ROOT_LOGGER . failedToParseConfiguration ( cause ) ; } catch ( Exception e ) { throw ControllerLogger . ROOT_LOGGER . failedToParseConfiguration ( e ) ; } return updates ; }
{@inheritDoc}