Package org.webharvest.runtime

Source Code of org.webharvest.runtime.RuntimeConfig

package org.webharvest.runtime;

import net.sf.saxon.query.StaticQueryContext;
import net.sf.saxon.Configuration;
import org.webharvest.runtime.processors.XQueryExpressionPool;

/**
* Facade for runtime objects needed for specific processors' execution.
*
* @author: Vladimir Nikic
* Date: Jul 4, 2007
*/
public class RuntimeConfig {

    private StaticQueryContext staticQueryContext;

    private XQueryExpressionPool xQueryExpressionPool;

    public synchronized StaticQueryContext getStaticQueryContext() {
        if (staticQueryContext == null) {
            Configuration config = new Configuration();
            staticQueryContext = new StaticQueryContext(config);
        }
        return staticQueryContext;
    }

    public synchronized XQueryExpressionPool getXQueryExpressionPool() {
        if (xQueryExpressionPool == null) {
            xQueryExpressionPool = new XQueryExpressionPool(getStaticQueryContext());
        }

        return xQueryExpressionPool;
    }

}
TOP

Related Classes of org.webharvest.runtime.RuntimeConfig

TOP
Copyright © 2018 www.massapi.com. 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.