001package 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 026import org.apache.turbine.services.schedule.JobEntry; 027 028/** 029 * All Scheduled jobs should implement this. The class that implements 030 * ScheduledJob 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$ 036 */ 037@FunctionalInterface 038public interface ScheduledJob extends Assembler 039{ 040 /** Prefix for scheduler job related classes */ 041 String PREFIX = "scheduledjobs"; 042 043 /** The key for the scheduler job cache size if module caching is on. */ 044 String CACHE_SIZE_KEY = "scheduledjob.cache.size"; 045 046 /** The default size of the scheduler job cache if module caching is on. */ 047 int CACHE_SIZE_DEFAULT = 10; 048 049 /** Represents Scheduled Job Objects */ 050 String NAME = "scheduledjob"; 051 052 /** 053 * Run the Jobentry from the scheduler queue. 054 * 055 * @param job The job to run. 056 * @throws Exception if something goes wrong 057 */ 058 void run(JobEntry job) throws Exception; 059}