Search in sources :

Example 1 with PathSharingContext

use of org.archive.spring.PathSharingContext in project Asqatasun by Asqatasun.

the class AsqatasunCrawlJob method startContext.

/**
     * Start the context, catching and reporting any BeansExceptions.
     */
private void startContext(CrawlJob crawlJob) {
    LOGGER.debug("Starting context");
    PathSharingContext ac = crawlJob.getJobContext();
    ac.addApplicationListener(this);
    try {
        ac.start();
    } catch (BeansException be) {
        LOGGER.warn(be.getMessage());
        ac.close();
    } catch (Exception e) {
        LOGGER.warn(e.getMessage());
        try {
            ac.close();
        } catch (Exception e2) {
            e2.printStackTrace(System.err);
        } finally {
        }
    }
    LOGGER.debug("Context started");
}
Also used : PathSharingContext(org.archive.spring.PathSharingContext) TransformerException(javax.xml.transform.TransformerException) TransformerConfigurationException(javax.xml.transform.TransformerConfigurationException) IOException(java.io.IOException) BeansException(org.springframework.beans.BeansException) ParserConfigurationException(javax.xml.parsers.ParserConfigurationException) SAXException(org.xml.sax.SAXException) CrawlerException(org.asqatasun.crawler.exception.CrawlerException) BeansException(org.springframework.beans.BeansException)

Aggregations

IOException (java.io.IOException)1 ParserConfigurationException (javax.xml.parsers.ParserConfigurationException)1 TransformerConfigurationException (javax.xml.transform.TransformerConfigurationException)1 TransformerException (javax.xml.transform.TransformerException)1 PathSharingContext (org.archive.spring.PathSharingContext)1 CrawlerException (org.asqatasun.crawler.exception.CrawlerException)1 BeansException (org.springframework.beans.BeansException)1 SAXException (org.xml.sax.SAXException)1