KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > enterprise > web > connector > grizzly > Rule


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

24 package com.sun.enterprise.web.connector.grizzly;
25
26 import java.util.concurrent.Callable JavaDoc;
27 import java.util.concurrent.Future JavaDoc;
28
29 /**
30  * A rule is used to define operations, and can be executed by invoking
31  * <code>call</code> directly or using any objects that supports the
32  * <code>Callable</code> interface. The rule can always be cancelled based on
33  * its <code>Futore</code>.
34  *
35  * @author Jeanfrancois Arcand
36  */

37 public interface Rule<E> extends Callable JavaDoc{
38
39     /**
40      * Attach a <code>E</code> to this rule.
41      */

42     public void attach(E o);
43     
44     
45     /**
46      * Return the current attachement <E>
47      */

48     public E attachement();
49     
50     
51     /**
52      * Cancel execution of this rule.
53      */

54     public void cancel();
55     
56     
57     /**
58      * Set the <code>Future</code> associated with this execution of this rule.
59      */

60     public void setFuture(Future JavaDoc future);
61     
62     
63     /**
64      * Set the interval in seconds to wait before executing this rule.
65      */

66     public void setExecutionTime(int time);
67     
68     
69     /**
70      * Return the time in second before this rule will be executed.
71      */

72     public int getExecutionTime();
73 }
74
Popular Tags