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.catalina.mapper;
19
20 import javax.servlet.http.MappingMatch;
21
22 import org.apache.catalina.Context;
23 import org.apache.catalina.Host;
24 import org.apache.catalina.Wrapper;
25 import org.apache.tomcat.util.buf.MessageBytes;
26
27 /**
28  * Mapping data.
29  *
30  * @author Remy Maucherat
31  */

32 public class MappingData {
33
34     public Host host = null;
35     public Context context = null;
36     public int contextSlashCount = 0;
37     public Context[] contexts = null;
38     public Wrapper wrapper = null;
39     public boolean jspWildCard = false;
40
41     /**
42      * @deprecated Unused. This will be removed in Tomcat 10.
43      */

44     @Deprecated
45     public final MessageBytes contextPath = MessageBytes.newInstance();
46     public final MessageBytes requestPath = MessageBytes.newInstance();
47     public final MessageBytes wrapperPath = MessageBytes.newInstance();
48     public final MessageBytes pathInfo = MessageBytes.newInstance();
49
50     public final MessageBytes redirectPath = MessageBytes.newInstance();
51
52     // Fields used by ApplicationMapping to implement javax.servlet.http.HttpServletMapping
53     public MappingMatch matchType = null;
54
55     public void recycle() {
56         host = null;
57         context = null;
58         contextSlashCount = 0;
59         contexts = null;
60         wrapper = null;
61         jspWildCard = false;
62         contextPath.recycle();
63         requestPath.recycle();
64         wrapperPath.recycle();
65         pathInfo.recycle();
66         redirectPath.recycle();
67         matchType = null;
68     }
69 }
70