public void configure()

in src/java/org/apache/fulcrum/yaafi/service/reconfiguration/ReconfigurationServiceImpl.java [102:147]


	public void configure(Configuration configuration) throws ConfigurationException {
		// limit to minimum interval of 1 second

		this.interval = Math.max(configuration.getAttributeAsInteger("interval", 5000), 1000);

		this.getLogger().debug("Monitoring the resources every " + this.interval + " ms");

		// parse the resources to monitor

		// Configuration entry = null;
		Configuration services = null;
		Configuration[] serviceEntries = null;
		Configuration[] entryList = configuration.getChildren("entry");

		String location = null;
		String serviceName = null;
		String[] serviceNameList = null;
		ReconfigurationEntry reconfigurationEntry = null;
		ReconfigurationEntry[] list = new ReconfigurationEntry[entryList.length];
		int listIndex = 0;
		for (Configuration entry : entryList) {
			location = entry.getChild("location").getValue();
			services = entry.getChild("services", false);

			this.getLogger().debug("Adding the following resource to monitor : " + location);

			if (services != null) {
				serviceEntries = services.getChildren("service");
				serviceNameList = new String[serviceEntries.length];

				for (int j = 0; j < serviceEntries.length; j++) {
					serviceName = serviceEntries[j].getAttribute("name");
					serviceNameList[j] = serviceName;
				}
			}

			reconfigurationEntry = new ReconfigurationEntry(this.getLogger(), this.applicationDir, location,
					serviceNameList);

			list[listIndex++] = reconfigurationEntry;
		}

		this.getLogger().debug("Monitoring " + list.length + " resources");

		this.setReconfigurationEntryList(list);
	}