Search in sources :

Example 1 with FastHashMap

use of org.apache.commons.collections.FastHashMap in project OpenOLAT by OpenOLAT.

the class InstitutionConfiguration method init.

/**
 * initializes the institution portlet config
 */
public void init() {
    institutions = new FastHashMap();
    File configurationFile = new File(WebappHelper.getContextRealPath(CONFIG_FILE));
    XStream xstream = getInstitutionConfigXStream();
    InstitutionConfiguration configuration = (InstitutionConfiguration) xstream.fromXML(configurationFile);
    for (InstitutionPortletEntry institution : configuration.getInstitution()) {
        String shortName = institution.shortname;
        if (shortName == null) {
            throw new StartupException("Institution portlet startup: No shortname given for one entry!");
        }
        institutions.put(shortName.toLowerCase(), institution);
    }
    // from now on optimize for non-synchronized read access
    institutions.setFast(true);
}
Also used : StartupException(org.olat.core.logging.StartupException) XStream(com.thoughtworks.xstream.XStream) FastHashMap(org.apache.commons.collections.FastHashMap) File(java.io.File)

Example 2 with FastHashMap

use of org.apache.commons.collections.FastHashMap in project openolat by klemens.

the class InstitutionConfiguration method init.

/**
 * initializes the institution portlet config
 */
public void init() {
    institutions = new FastHashMap();
    File configurationFile = new File(WebappHelper.getContextRealPath(CONFIG_FILE));
    XStream xstream = getInstitutionConfigXStream();
    InstitutionConfiguration configuration = (InstitutionConfiguration) xstream.fromXML(configurationFile);
    for (InstitutionPortletEntry institution : configuration.getInstitution()) {
        String shortName = institution.shortname;
        if (shortName == null) {
            throw new StartupException("Institution portlet startup: No shortname given for one entry!");
        }
        institutions.put(shortName.toLowerCase(), institution);
    }
    // from now on optimize for non-synchronized read access
    institutions.setFast(true);
}
Also used : StartupException(org.olat.core.logging.StartupException) XStream(com.thoughtworks.xstream.XStream) FastHashMap(org.apache.commons.collections.FastHashMap) File(java.io.File)

Aggregations

XStream (com.thoughtworks.xstream.XStream)2 File (java.io.File)2 FastHashMap (org.apache.commons.collections.FastHashMap)2 StartupException (org.olat.core.logging.StartupException)2