public void init()

in src/java/org/apache/turbine/services/rundata/TurbineRunDataService.java [103:168]


    public void init()
            throws InitializationException
    {
        // Create a default configuration.
        String[] def = new String[]
        {
            DEFAULT_RUN_DATA,
            DEFAULT_PARAMETER_PARSER,
            DEFAULT_COOKIE_PARSER
        };
        configurations.put(DEFAULT_CONFIG, def.clone());

        // Check other configurations.
        Configuration conf = getConfiguration();
        if (conf != null)
        {
            String key,value;
            String[] config;
            String[] plist = new String[]
            {
                RUN_DATA_KEY,
                PARAMETER_PARSER_KEY,
                COOKIE_PARSER_KEY
            };
            for (Iterator<String> i = conf.getKeys(); i.hasNext();)
            {
                key = i.next();
                value = conf.getString(key);
                int j = 0;
                for (String plistKey : plist)
                {
                    if (key.endsWith(plistKey) && key.length() > plistKey.length() + 1)
                    {
                        key = key.substring(0, key.length() - plistKey.length() - 1);
                        config = (String[]) configurations.get(key);
                        if (config == null)
                        {
                            config = def.clone();
                            configurations.put(key, config);
                        }
                        config[j] = value;
                        break;
                    }
                    j++;
                }
            }
        }

		pool = (PoolService)TurbineServices.getInstance().getService(PoolService.ROLE);

        if (pool == null)
        {
            throw new InitializationException("RunData Service requires"
                + " configured Pool Service!");
        }

        parserService = (ParserService)TurbineServices.getInstance().getService(ParserService.ROLE);

        if (parserService == null)
        {
            throw new InitializationException("RunData Service requires"
                + " configured Parser Service!");
        }

        setInit(true);
    }