KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > enterprise > util > scheduler > PeriodicallyServicable


1 /*
2  * The contents of this file are subject to the terms
3  * of the Common Development and Distribution License
4  * (the License). You may not use this file except in
5  * compliance with the License.
6  *
7  * You can obtain a copy of the license at
8  * https://glassfish.dev.java.net/public/CDDLv1.0.html or
9  * glassfish/bootstrap/legal/CDDLv1.0.txt.
10  * See the License for the specific language governing
11  * permissions and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL
14  * Header Notice in each file and include the License file
15  * at glassfish/bootstrap/legal/CDDLv1.0.txt.
16  * If applicable, add the following below the CDDL Header,
17  * with the fields enclosed by brackets [] replaced by
18  * you own identifying information:
19  * "Portions Copyrighted [year] [name of copyright owner]"
20  *
21  * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
22  */

23
24 //
25
// Copyright 2001 iPlanet/ Sun Microsystems, Inc. All Rights Reserved.
26
//
27
// Author : darpan
28
// Module : Utils
29
//
30
package com.sun.enterprise.util.scheduler;
31
32 /**
33 * PeriodicallyServicable inherits from the <I>Servicable</I> interface and
34 * enable utilities such as PeriodicEventScheduler to give a callback to the
35 * objects on their service methods.<br>
36 * Ensure that the objects implementing PeriodicallyServicable do not hog the
37 * threads for execution. Logic like inserting a task onto the writer thread
38 * queues is best suited for this purpose.
39 * <BR> <I>$Source: /cvs/glassfish/appserv-commons/src/java/com/sun/enterprise/util/scheduler/PeriodicallyServicable.java,v $</I>
40 * @author $Author: tcfujii $
41 * @version 1.0 $Revision: 1.3 $ $Date: 2005/12/25 04:12:29 $
42 * @see com.sun.enterprise.util.threadpool.Servicable
43 * @see PeriodicEventScheduler
44 */

45 public interface PeriodicallyServicable
46     extends com.sun.enterprise.util.threadpool.Servicable
47 {
48     /**
49     * Get the frequency (time interval) at which service() method will be invoked.
50     * @return time in milli seconds.
51     */

52     public long getFrequency();
53     
54     /**
55     * Determine to execute the service method of this object even if it has
56     * missed the right schedule.
57     */

58     public boolean getExecuteIfMissed();
59     
60     /**
61     * Determine to execute the service method of this object when the
62     * schedule is delayed by 'missedByMillis' milli seconds.
63     */

64     public boolean getExecutionTolerance(long missedByMillis);
65     
66     /**
67     * Print an identification for the object.
68     */

69     public String JavaDoc toString();
70 }
71
Popular Tags