    001    package org.apache.turbine.modules;
    002
    003
    004    /*
    005     * Licensed to the Apache Software Foundation (ASF) under one
    006     * or more contributor license agreements.  See the NOTICE file
    007     * distributed with this work for additional information
    008     * regarding copyright ownership.  The ASF licenses this file
    009     * to you under the Apache License, Version 2.0 (the
    010     * "License"); you may not use this file except in compliance
    011     * with the License.  You may obtain a copy of the License at
    012     *
    013     *   http://www.apache.org/licenses/LICENSE-2.0
    014     *
    015     * Unless required by applicable law or agreed to in writing,
    016     * software distributed under the License is distributed on an
    017     * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
    018     * KIND, either express or implied.  See the License for the
    019     * specific language governing permissions and limitations
    020     * under the License.
    021     */
    022
    023
    024    // Turbine Scheduler Classes
    025
    026    import org.apache.turbine.services.schedule.JobEntry;
    027
    028    /**
    029     * All Scheduled jobs should extend this.  The class that extends
    030     * ScheduledJobs should contain the code that you actually want to
    031     * execute at a specific time.  The name of this class is what you
    032     * register in the JobEntry.
    033     *
    034     * @author <a href="mailto:mbryson@mindspring.com">Dave Bryson</a>
    035     * @version $Id: ScheduledJob.java 717934 2008-11-15 21:48:47Z tv $
    036     */
    037    public abstract class ScheduledJob extends Assembler
    038    {
    039        /** Prefix for scheduler job related classes */
    040        public static final String PREFIX = "scheduledjobs";
    041
    042        /** The key for the schedulder job cache size if module caching is on. */
    043        public static final String CACHE_SIZE_KEY = "scheduledjob.cache.size";
    044
    045        /** The default size of the schedulder job cache if module caching is on. */
    046        public static final int CACHE_SIZE_DEFAULT = 10;
    047
    048        /** Represents Scheduled Job Objects */
    049        public static final String NAME = "scheduledjob";
    050
    051        /**
    052         * @see org.apache.turbine.modules.Assembler#getPrefix()
    053         */
    054        public String getPrefix()
    055        {
    056            return PREFIX;
    057        }
    058
    059        /**
    060         * Run the Jobentry from the scheduler queue.
    061         *
    062         * @param job The job to run.
    063         */
    064        public abstract void run(JobEntry job)
    065                throws Exception;
    066    }