public void init()

in src/java/org/apache/turbine/services/intake/IntakeTool.java [94:148]


    public void init(Object runData)
    {
        if (groups == null) // Initialize only once
        {
            String[] groupNames = intakeService.getGroupNames();
            int groupCount = 0;
            if (groupNames != null)
            {
                groupCount = groupNames.length;
            }
            groups = new HashMap<>((int) (1.25 * groupCount + 1));
            pullMap = new HashMap<>((int) (1.25 * groupCount + 1));

            for (int i = groupCount - 1; i >= 0; i--)
            {
                pullMap.put(groupNames[i], new PullHelper(groupNames[i]));
            }
        }

        this.pp = ((RunData) runData).getParameters();

        String[] groupKeys = pp.getStrings(INTAKE_GRP);
        String[] groupNames = null;
        if (ArrayUtils.isEmpty(groupKeys))
        {
            groupNames = intakeService.getGroupNames();
        }
        else
        {
            groupNames = new String[groupKeys.length];
            for (int i = groupKeys.length - 1; i >= 0; i--)
            {
                groupNames[i] = intakeService.getGroupName(groupKeys[i]);
            }
        }

        for (int i = groupNames.length - 1; i >= 0; i--)
        {
            try
            {
                List<Group> foundGroups = intakeService.getGroup(groupNames[i])
                    .getObjects(pp);

                if (foundGroups != null)
                {
                    foundGroups.forEach(
                            group -> groups.put(group.getObjectKey(), group));
                }
            }
            catch (IntakeException e)
            {
                log.error(e);
            }
        }
    }