1 23 package com.sun.enterprise.web.connector.grizzly; 24 25 import java.io.IOException ; 26 import java.nio.channels.SelectionKey ; 27 import java.util.ArrayList ; 28 import java.util.concurrent.Callable ; 29 import org.apache.coyote.RequestGroupInfo; 30 31 36 public interface Task extends Runnable , Callable { 37 38 public static int ACCEPT_TASK = 0; 40 public static int READ_TASK = 1; 41 public static int PROCESSOR_TASK = 2; 42 43 46 public int getType(); 47 48 51 public void doTask() throws IOException ; 52 53 54 57 public void cancelTask(String message, String httpCode); 58 59 60 63 public void setSelectionKey(SelectionKey key); 64 65 66 69 public SelectionKey getSelectionKey(); 70 71 72 75 public void setSelectorThread(SelectorThread selectorThread); 76 77 78 81 public SelectorThread getSelectorThread(); 82 83 84 87 public RequestGroupInfo getRequestGroupInfo(); 88 89 90 94 public boolean isMonitoringEnabled(); 95 96 97 100 public KeepAliveStats getKeepAliveStats(); 101 102 103 106 public void addTaskListener(TaskListener task); 107 108 109 112 public void removeTaskListener(TaskListener task); 113 114 115 120 public void execute(); 121 122 123 126 public void recycle(); 127 128 129 132 public ArrayList getTaskListeners(); 133 134 135 138 public void clearTaskListeners(); 139 140 141 144 public void setRecycle(boolean recycle); 145 146 147 150 public boolean getRecycle(); 151 152 153 } 154 | Popular Tags |