Package org.castor.cpa.test.framework.xml

Examples of org.castor.cpa.test.framework.xml.CpactfConf


    public void loadConfiguration(final String url) {
        InputSource source = new InputSource(url);
        _jdoConfBaseURL = source.getSystemId();
       
        CpactfConf cpactfconf = null;
        try {
            Unmarshaller unmarshaller = new Unmarshaller(CpactfConf.class);
            unmarshaller.setEntityResolver(new DTDResolver(null));
            cpactfconf = (CpactfConf) unmarshaller.unmarshal(source);
        } catch (MarshalException e) {
            throw new CPAConfigException(e);
        } catch (ValidationException e) {
            throw new CPAConfigException(e);
        }

        _defaultDatabaseName = cpactfconf.getDefaultDatabase();
        _defaultTransactionName = cpactfconf.getDefaultTransaction();
       
        Iterator cfgIter = cpactfconf.iterateConfiguration();
        while (cfgIter.hasNext()) {
            Configuration config = (Configuration) cfgIter.next();
            _configurations.put(config.getName(), config);
        }
       
        Iterator dbIter = cpactfconf.iterateDatabase();
        while (dbIter.hasNext()) {
            Database database = (Database) dbIter.next();
            _databases.put(database.getName(), database);
        }
       
        Iterator transIter = cpactfconf.iterateTransaction();
        while (transIter.hasNext()) {
            Transaction trans = (Transaction) transIter.next();
            _transactions.put(trans.getName(), trans);
        }
    }
View Full Code Here

TOP

Related Classes of org.castor.cpa.test.framework.xml.CpactfConf

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.