this.optionalParameters = new HashMap();
this.optionalParameters = new TreeMap();
	public void setup(SourceResolver resolver, Map objectModel, String source,						Parameters parameters) throws ProcessingException,			SAXException, IOException {		super.setup(resolver, objectModel, source, parameters);		/*		 * We don't do this directly in parameterize() because setup() can be		 * called multiple times and optionalParameters needs resetting to forget		 * sitemap parameters that may have been removed inbetween		 */		this.optionalParameters = new HashMap();		String paramNames[] = componentParams.getNames();		for (int i = 0; i < paramNames.length; i++) {			String param = paramNames[i];			try {				optionalParameters.put(param, componentParams.getParameter(param));			} catch (ParameterException e1) {				// Cannot happen as we iterate through existing parameters			}		}		this.objectModel = objectModel;		this.inputSource = resolver.resolveURI(source);		this.collectionURI = parameters.getParameter(COLLECTION_URI,				this.defaultCollectionURI);		this.user = parameters.getParameter(USER, this.defaultUser);		this.password = parameters.getParameter(PASSWORD, this.defaultPassword);		this.createSession = parameters.getParameterAsBoolean(CREATE_SESSION,				this.defaultCreateSession);		this.expandXIncludes = parameters.getParameterAsBoolean(				EXPAND_XINCLUDES, this.defaultExpandXIncludes);		this.cacheValidity = parameters.getParameterAsLong(CACHE_VALIDITY, defaultCacheValidity);		paramNames = parameters.getNames();		for (int i = 0; i < paramNames.length; i++) {			String param = paramNames[i];			if (!(param.equals(COLLECTION_URI) || param.equals(USER)					|| param.equals(PASSWORD)					|| param.equals(CREATE_SESSION) || param					.equals(EXPAND_XINCLUDES) || param.equals(CACHE_VALIDITY))) {				this.optionalParameters.put(param, parameters						.getParameter(param, ""));			}		}        Context context = ObjectModelHelper.getContext(objectModel);        String dbHome = context.getRealPath("WEB-INF");		try {			Class driver = Class.forName(DRIVER);			Database database = (Database)driver.newInstance();            database.setProperty("create-database", "true");            database.setProperty("configuration", dbHome + File.separatorChar + "conf.xml");			DatabaseManager.registerDatabase(database);		} catch(Exception e) {			throw new ProcessingException("Failed to initialize database driver: " + e.getMessage(), e);		}	}