01: /* Copyright 2002 The JA-SIG Collaborative. All rights reserved.
02: * See license distributed with this file and
03: * available online at http://www.uportal.org/license.html
04: */
05:
06: package org.jasig.portal.car;
07:
08: import java.util.Properties;
09:
10: import org.xml.sax.Attributes;
11: import org.xml.sax.SAXException;
12: import org.xml.sax.helpers.DefaultHandler;
13:
14: /**
15: * Handles reading the worker tags in the descriptor. These tags
16: * contain only attributes and hence only the startElement event is
17: * needed.
18: *
19: * @author Mark Boyd {@link <a href="mailto:mark.boyd@engineer.com">mark.boyd@engineer.com</a>}
20: * @version $Revision: 36690 $
21: */
22: class WorkerTagHandler extends DefaultHandler {
23: private Properties workerProps = null;
24:
25: WorkerTagHandler(Properties workers) {
26: this .workerProps = workers;
27: }
28:
29: public void startElement(java.lang.String namespaceURI,
30: java.lang.String localName, java.lang.String qName,
31: Attributes atts) throws SAXException {
32: if (!qName.equals(DescriptorHandler.WORKER_TAG_NAME))
33: return;
34: String workerClass = atts.getValue("class");
35:
36: if (workerClass == null)
37: return;
38:
39: workerProps.put(workerClass.replace('.', '_'), workerClass);
40: }
41: }
|