KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > turbine > services > servlet > ServletService


1 package org.apache.turbine.services.servlet;
2
3 /*
4  * Copyright 2001-2004 The Apache Software Foundation.
5  *
6  * Licensed under the Apache License, Version 2.0 (the "License")
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  */

18
19 import java.io.InputStream JavaDoc;
20 import java.net.URL JavaDoc;
21 import javax.servlet.ServletConfig JavaDoc;
22 import javax.servlet.ServletContext JavaDoc;
23
24 import org.apache.turbine.services.Service;
25
26 /**
27  * <p>This interface exposes methods of the runner context in order
28  * resolve or get access to external resources</p>
29  *
30  * @author <a HREF="mailto:ekkerbj@netscape.net">Jeff Brekke</a>
31  * @author <a HREF="mailto:raphael@apache.org">Raphaël Luta</a>
32  * @author <a HREF="mailto:jvanzyl@periapt.com">Jason van Zyl</a>
33  * @version $Id: ServletService.java,v 1.4.2.2 2004/05/20 03:06:49 seade Exp $
34  */

35 public interface ServletService extends Service
36 {
37     /**
38      * The service identifier
39      */

40     String JavaDoc SERVICE_NAME = "ServletService";
41
42     /**
43      * Returns an URL object for a given URI string.
44      *
45      * @param uri the URI to resolve as an URL
46      * @return an URL object or null is the uri is malformed or
47      * can't be resolved
48      */

49     URL JavaDoc getResource(String JavaDoc uri);
50
51     /**
52      * Same as getResource except that it returns an InputStream
53      *
54      * @param uri the URI to resolve
55      * @return an InputStream on the URI content or null
56      */

57     InputStream JavaDoc getResourceAsStream(String JavaDoc uri);
58
59     /**
60      * Returns the complete filesystem path for a
61      * given URI
62      *
63      * @param uri the URI to resolve
64      * @return the full system path of this URI
65      */

66     String JavaDoc getRealPath(String JavaDoc uri);
67
68     /**
69      * Returns the servlet config used by this
70      * Turbine web application.
71      *
72      * @return turbine servlet config
73      */

74     ServletConfig JavaDoc getServletConfig();
75
76     /**
77      * Returns the servlet context used by this
78      * Turbine web application.
79      *
80      * @return turbine servlet context
81      */

82     ServletContext JavaDoc getServletContext();
83
84     /**
85      * Returns the server scheme for this
86      * Turbine application. This will either
87      * be http or https.
88      *
89      * @return String
90      */

91     String JavaDoc getServerScheme();
92
93     /**
94      * Returns the server name that this
95      * Turbine application is running
96      * on.
97      *
98      * @return String
99      */

100     String JavaDoc getServerName();
101
102     /**
103      * Returns the port that this Turbine
104      * application is running through
105      * on the server.
106      *
107      * @return String
108      */

109     String JavaDoc getServerPort();
110
111     /**
112      * Returns the context path for this
113      * Turbine application.
114      *
115      * @return String
116      */

117     String JavaDoc getContextPath();
118 }
119
Popular Tags