You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Sven Homburg <ho...@googlemail.com> on 2009/04/01 01:18:09 UTC

Re: T5 - Chenillekit Quartz & Services

possible it helps

public class ImportEmailToArchive implements Job
{
    private final Logger logger =
LoggerFactory.getLogger(ImportEmailToArchive.class);

    @CommitAfter
    public void execute(JobExecutionContext jobExecutionContext) throws
JobExecutionException
    {
        PerthreadManager perthreadManager = (PerthreadManager)
jobExecutionContext.getMergedJobDataMap().get("perthreadManager");
        EmailArchiveImporter importer = (EmailArchiveImporter)
jobExecutionContext.getMergedJobDataMap().get("importer");

        if (logger.isInfoEnabled())
            logger.info("starting email importer ...");

        try
        {
            importer.importMessages();
        }
        finally
        {
            perthreadManager.cleanup();
        }

        if (logger.isInfoEnabled())
            logger.info("email importer finished");
    }
}

    public EmailArchiveImporterImpl(Logger logger,
                                    SearcherService ldapSearchService,
                                    HibernateSessionManager
hibernateSessionManager,
                                    Resource configResource)
    {
        this.logger = logger;
        this.ldapSearchService = ldapSearchService;
        this.hibernateSessionManager = hibernateSessionManager;

        try
        {
            this.configuration = new
PropertiesConfiguration(configResource.toURL());
        }
        catch (ConfigurationException e)
        {
            throw new RuntimeException(e);
        }
    }


2009/3/31 Daniel Jones <da...@murieston.com>

>
> Is there a more elegant solution than this?  If so please share!
>
> Cheers,
> Dan
> --
> View this message in context:
> http://www.nabble.com/T5---Chenillekit-Quartz---Services-tp22787045p22805264.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>


-- 
with regards
Sven Homburg
http://www.chenillekit.org
http://tapestry5-components.googlecode.com