public void configure()

in hibernate/src/java/org/apache/fulcrum/security/hibernate/PersistenceHelperDefaultImpl.java [222:260]


    public void configure(org.apache.avalon.framework.configuration.Configuration conf) throws ConfigurationException
    {
        configuration = new Configuration();

        // read properties
        org.apache.avalon.framework.configuration.Configuration[] props = conf.getChild("session-factory").getChildren("property");

        for (org.apache.avalon.framework.configuration.Configuration prop : props)
        {
            String value = prop.getValue(null);
            String key = prop.getAttribute("name", null);

            if (key != null && value != null)
            {
                configuration.setProperty(key, value);
            }
            else
            {
                throw new ConfigurationException("Invalid configuration", prop);
            }
        }

        // read mappings
        org.apache.avalon.framework.configuration.Configuration[] maps = conf.getChild("mappings").getChildren("resource");

        for (org.apache.avalon.framework.configuration.Configuration map : maps)
        {
            String value = map.getValue(null);

            if (value != null)
            {
                configuration.addResource(value);
            }
            else
            {
                throw new ConfigurationException("Invalid configuration", map);
            }
        }
    }