1 /*
2 * Copyright 1999-2002,2004 The Apache Software Foundation.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17 package org.apache.commons.latka.event;
18
19 import org.apache.commons.latka.http.Request;
20 import org.apache.commons.latka.http.Response;
21 import org.apache.commons.latka.ValidationException;
22
23 /**
24 * An event for when a request fails
25 *
26 * @author Morgan Delagrange
27 * @author dIon Gillard
28 * @version $Id: RequestFailedEvent.java 155424 2005-02-26 13:09:29Z dirkv $
29 */
30 public class RequestFailedEvent extends BaseRequestEvent implements RequestEvent
31 {
32
33 /** used to hold the validation exception */
34 private ValidationException _ex = null;
35
36 /** Create a new request failed event
37 * @param request The request that failed
38 * @param response The response from processing the failed request
39 * @param e The validation failure
40 */
41 public RequestFailedEvent(Request request, Response response,
42 ValidationException e) {
43 super(request, response);
44 _ex = e;
45 }
46
47 /** get the validation exception provided on construction
48 * @return the validation exception provided on construction
49 */
50 public Throwable getValidationException() {
51 return _ex;
52 }
53 }