1 /* 2 * Licensed to the Apache Software Foundation (ASF) under one or more 3 * contributor license agreements. See the NOTICE file distributed with 4 * this work for additional information regarding copyright ownership. 5 * The ASF licenses this file to You under the Apache License, Version 2.0 6 * (the "License"); you may not use this file except in compliance with 7 * the License. You may obtain a copy of the License at 8 * 9 * http://www.apache.org/licenses/LICENSE-2.0 10 * 11 * Unless required by applicable law or agreed to in writing, software 12 * distributed under the License is distributed on an "AS IS" BASIS, 13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 * See the License for the specific language governing permissions and 15 * limitations under the License. 16 */ 17 18 package org.apache.coyote; 19 20 import org.apache.tomcat.util.net.SocketStatus; 21 22 23 /** 24 * Adapter. This represents the entry point in a coyote-based servlet container. 25 * 26 * 27 * @author Remy Maucherat 28 * @see ProtocolHandler 29 */ 30 public interface Adapter { 31 32 /** 33 * Call the service method, and notify all listeners 34 * 35 * @exception Exception if an error happens during handling of 36 * the request. Common errors are: 37 * <ul><li>IOException if an input/output error occurs and we are 38 * processing an included servlet (otherwise it is swallowed and 39 * handled by the top level error handler mechanism) 40 * <li>ServletException if a servlet throws an exception and 41 * we are processing an included servlet (otherwise it is swallowed 42 * and handled by the top level error handler mechanism) 43 * </ul> 44 * Tomcat should be able to handle and log any other exception ( including 45 * runtime exceptions ) 46 */ 47 public void service(Request req, Response res) 48 throws Exception; 49 50 public boolean event(Request req, Response res, SocketStatus status) 51 throws Exception; 52 53 } 54