Return-Path: Delivered-To: apmail-cocoon-cvs-archive@www.apache.org Received: (qmail 75090 invoked from network); 12 Oct 2004 15:50:07 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 12 Oct 2004 15:50:07 -0000 Received: (qmail 39089 invoked by uid 500); 12 Oct 2004 15:50:06 -0000 Delivered-To: apmail-cocoon-cvs-archive@cocoon.apache.org Received: (qmail 39034 invoked by uid 500); 12 Oct 2004 15:50:06 -0000 Mailing-List: contact cvs-help@cocoon.apache.org; run by ezmlm Precedence: bulk Reply-To: dev@cocoon.apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list cvs@cocoon.apache.org Received: (qmail 39022 invoked by uid 99); 12 Oct 2004 15:50:06 -0000 X-ASF-Spam-Status: No, hits=-10.0 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [209.237.227.194] (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.28) with SMTP; Tue, 12 Oct 2004 08:50:05 -0700 Received: (qmail 75062 invoked by uid 65534); 12 Oct 2004 15:50:04 -0000 Date: 12 Oct 2004 15:50:04 -0000 Message-ID: <20041012155004.75057.qmail@minotaur.apache.org> From: unico@apache.org To: cvs@cocoon.apache.org Subject: svn commit: rev 54674 - cocoon/branches/BRANCH_2_1_X/src/blocks/cron/java/org/apache/cocoon/components/cron X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Author: unico Date: Tue Oct 12 08:50:03 2004 New Revision: 54674 Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/cron/java/org/apache/cocoon/components/cron/CocoonQuartzJobExecutor.java (contents, props changed) cocoon/branches/BRANCH_2_1_X/src/blocks/cron/java/org/apache/cocoon/components/cron/CocoonQuartzJobScheduler.java (contents, props changed) Log: props Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/cron/java/org/apache/cocoon/components/cron/CocoonQuartzJobExecutor.java ============================================================================== --- cocoon/branches/BRANCH_2_1_X/src/blocks/cron/java/org/apache/cocoon/components/cron/CocoonQuartzJobExecutor.java (original) +++ cocoon/branches/BRANCH_2_1_X/src/blocks/cron/java/org/apache/cocoon/components/cron/CocoonQuartzJobExecutor.java Tue Oct 12 08:50:03 2004 @@ -1,80 +1,80 @@ -/* - * Copyright 1999-2004 The Apache Software Foundation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.cocoon.components.cron; - -import java.net.MalformedURLException; - -import org.apache.avalon.framework.component.WrapperComponentManager; -import org.apache.avalon.framework.context.ContextException; -import org.apache.avalon.framework.service.ServiceException; -import org.apache.cocoon.Constants; -import org.apache.cocoon.Processor; -import org.apache.cocoon.components.CocoonComponentManager; -import org.apache.cocoon.environment.background.BackgroundEnvironment; -import org.quartz.JobDataMap; -import org.quartz.JobExecutionException; - -/** - * This component is resposible to launch a {@link CronJob}s in a Quart Scheduler. - * - * @author Giacomo Pati - * @version CVS $Id: QuartzJobExecutor.java 47533 2004-09-30 03:15:55Z vgritsenko $ - * - * @since 2.1.1 - */ -public class CocoonQuartzJobExecutor extends QuartzJobExecutor { - - private Object m_key; - private BackgroundEnvironment m_env; - private Processor m_processor; - - protected void setup(JobDataMap data) throws JobExecutionException { - super.setup(data); - org.apache.cocoon.environment.Context envContext; - try { - envContext = - (org.apache.cocoon.environment.Context) m_context.get(Constants.CONTEXT_ENVIRONMENT_CONTEXT); - } catch (ContextException e) { - throw new JobExecutionException(e); - } - - try { - m_env = new BackgroundEnvironment(m_logger, envContext); - } catch (MalformedURLException e) { - // Unlikely to happen - throw new JobExecutionException(e); - } - - try { - m_processor = (Processor) m_manager.lookup(Processor.ROLE); - } catch (ServiceException e) { - throw new JobExecutionException(e); - } - - m_key = CocoonComponentManager.startProcessing(m_env); - CocoonComponentManager.enterEnvironment(m_env, new WrapperComponentManager(m_manager), m_processor); - } - - protected void release(JobDataMap data) { - super.release(data); - CocoonComponentManager.leaveEnvironment(); - CocoonComponentManager.endProcessing(m_env, m_key); - if (m_manager != null) { - m_manager.release(m_processor); - } - } - -} +/* + * Copyright 1999-2004 The Apache Software Foundation. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.cocoon.components.cron; + +import java.net.MalformedURLException; + +import org.apache.avalon.framework.component.WrapperComponentManager; +import org.apache.avalon.framework.context.ContextException; +import org.apache.avalon.framework.service.ServiceException; +import org.apache.cocoon.Constants; +import org.apache.cocoon.Processor; +import org.apache.cocoon.components.CocoonComponentManager; +import org.apache.cocoon.environment.background.BackgroundEnvironment; +import org.quartz.JobDataMap; +import org.quartz.JobExecutionException; + +/** + * This component is resposible to launch a {@link CronJob}s in a Quart Scheduler. + * + * @author Giacomo Pati + * @version CVS $Id$ + * + * @since 2.1.1 + */ +public class CocoonQuartzJobExecutor extends QuartzJobExecutor { + + private Object m_key; + private BackgroundEnvironment m_env; + private Processor m_processor; + + protected void setup(JobDataMap data) throws JobExecutionException { + super.setup(data); + org.apache.cocoon.environment.Context envContext; + try { + envContext = + (org.apache.cocoon.environment.Context) m_context.get(Constants.CONTEXT_ENVIRONMENT_CONTEXT); + } catch (ContextException e) { + throw new JobExecutionException(e); + } + + try { + m_env = new BackgroundEnvironment(m_logger, envContext); + } catch (MalformedURLException e) { + // Unlikely to happen + throw new JobExecutionException(e); + } + + try { + m_processor = (Processor) m_manager.lookup(Processor.ROLE); + } catch (ServiceException e) { + throw new JobExecutionException(e); + } + + m_key = CocoonComponentManager.startProcessing(m_env); + CocoonComponentManager.enterEnvironment(m_env, new WrapperComponentManager(m_manager), m_processor); + } + + protected void release(JobDataMap data) { + super.release(data); + CocoonComponentManager.leaveEnvironment(); + CocoonComponentManager.endProcessing(m_env, m_key); + if (m_manager != null) { + m_manager.release(m_processor); + } + } + +} Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/cron/java/org/apache/cocoon/components/cron/CocoonQuartzJobScheduler.java ============================================================================== --- cocoon/branches/BRANCH_2_1_X/src/blocks/cron/java/org/apache/cocoon/components/cron/CocoonQuartzJobScheduler.java (original) +++ cocoon/branches/BRANCH_2_1_X/src/blocks/cron/java/org/apache/cocoon/components/cron/CocoonQuartzJobScheduler.java Tue Oct 12 08:50:03 2004 @@ -1,37 +1,37 @@ -/* - * Copyright 1999-2004 The Apache Software Foundation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.cocoon.components.cron; - -import org.quartz.Job; -import org.quartz.JobDataMap; -import org.quartz.JobDetail; - -/** - * QuartzJobScheduler that runs jobs within a Cocoon Environment. - */ -public class CocoonQuartzJobScheduler extends QuartzJobScheduler { - - protected JobDetail createJobDetail(String name, JobDataMap jobDataMap) { - JobDetail detail = new JobDetail(name, DEFAULT_QUARTZ_JOB_GROUP, CocoonQuartzJobExecutor.class); - detail.setJobDataMap(jobDataMap); - return detail; - } - - protected Job createJobExecutor() { - return new CocoonQuartzJobExecutor(); - } - -} +/* + * Copyright 1999-2004 The Apache Software Foundation. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.cocoon.components.cron; + +import org.quartz.Job; +import org.quartz.JobDataMap; +import org.quartz.JobDetail; + +/** + * QuartzJobScheduler that runs jobs within a Cocoon Environment. + */ +public class CocoonQuartzJobScheduler extends QuartzJobScheduler { + + protected JobDetail createJobDetail(String name, JobDataMap jobDataMap) { + JobDetail detail = new JobDetail(name, DEFAULT_QUARTZ_JOB_GROUP, CocoonQuartzJobExecutor.class); + detail.setJobDataMap(jobDataMap); + return detail; + } + + protected Job createJobExecutor() { + return new CocoonQuartzJobExecutor(); + } + +}