KickJava   Java API By Example, From Geeks To Geeks.

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


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 package com.sun.enterprise.web.connector.grizzly;
25
26 import com.sun.enterprise.web.connector.grizzly.async.AsyncProcessorTask;
27
28 /**
29  * A interface used to define the execution of a <code>AsycnProcesssorTask</code>
30  * By default, <code>AsycnProcesssorTask</code> will invoke an implementation
31  * of this interface in this order:
32  *
33  * (1) preExecute()
34  * (2) interrupt()
35  * (3) postExecute()
36  *
37  * Implementation of this interface must decide when a task must be interrupted.
38  *
39  * @author Jeanfrancois Arcand
40  */

41 public interface AsyncExecutor {
42     
43     /**
44      * Pre-execute some operations in the <code>AsycnProcesssorTask</code>
45      * associated.
46      * @return true if the processing can continue.
47      */

48     public boolean preExecute() throws Exception JavaDoc;
49     
50     
51     /**
52      * Execute some operations on the <code>AsycnProcesssorTask</code> and then
53      * interrupt it.
54      * @return true if the processing can continue, false if it needs to be
55      * interrupted.
56      */

57     public boolean interrupt() throws Exception JavaDoc;
58     
59     
60     /**
61      * Post-execute some operations in the <code>AsycnProcesssorTask</code>
62      * associated.
63      * @return true if the processing can continue.
64      */

65     public boolean postExecute() throws Exception JavaDoc;
66     
67     
68     /**
69      * Set the <code>AsycnProcesssorTask</code>.
70      */

71     public void setAsyncProcessorTask(AsyncProcessorTask task);
72
73     
74     /**
75      * Get the <code>AsycnProcesssorTask</code>.
76      */

77     public AsyncProcessorTask getAsyncProcessorTask();
78     
79     
80     /**
81      * Add a <code>AsyncFilter</code>
82      */

83     public void addAsyncFilter(AsyncFilter asyncFilter);
84     
85     
86     /**
87      * Remove an <code>AsyncFilter</code>
88      */

89     public boolean removeAsyncFilter(AsyncFilter asyncFilter);
90 }
91
Popular Tags