@ Override public List < Dashboard > getDashboards ( ) { JAXBContext context ; try { context = JAXBContext . newInstance ( Dashboard . class . getPackage ( ) . getName ( ) ) ; } catch ( JAXBException e ) { throw new IllegalArgumentException ( "Could not create JAXBContext" , e ) ; } List < Dashboard > dashboards = new ArrayList < Dashboard > ( ) ; try { Configuration config = ( Configuration ) context . createUnmarshaller ( ) . unmarshal ( sourceXml . getInputStream ( ) ) ; dashboards . addAll ( config . getDashboard ( ) ) ; } catch ( Exception e ) { throw new IllegalStateException ( "Could not load dashboards configuration from " + sourceXml . toString ( ) , e ) ; } /* if(additionalSourceXml != null) { if (additionalSourceXml.isReadable()) { try { Configuration config = (Configuration) context.createUnmarshaller().unmarshal(additionalSourceXml.getInputStream()); dashboards.addAll(config.getDashboard()); } catch (Exception e) { throw new IllegalStateException("Could not load dashboards configuration from " + additionalSourceXml.toString(), e); } } else { throw new IllegalStateException("Could not read configuration from " + additionalSourceXml.toString()); } } */ Collections . sort ( dashboards ) ; return dashboards ; }
private Resource additionalSourceXml ;