1 package org.apache.turbine.services.servlet;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 import java.io.InputStream;
20 import java.net.URL;
21 import javax.servlet.ServletConfig;
22 import javax.servlet.ServletContext;
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 278958 2005-09-06 09:35:39Z henning $
34 */
35 public interface ServletService extends Service
36 {
37 /***
38 * The service identifier
39 */
40 String 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 getResource(String 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 getResourceAsStream(String 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 getRealPath(String uri);
67
68 /***
69 * Returns the servlet config used by this
70 * Turbine web application.
71 *
72 * @return turbine servlet config
73 */
74 ServletConfig getServletConfig();
75
76 /***
77 * Returns the servlet context used by this
78 * Turbine web application.
79 *
80 * @return turbine servlet context
81 */
82 ServletContext 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 getServerScheme();
92
93 /***
94 * Returns the server name that this
95 * Turbine application is running
96 * on.
97 *
98 * @return String
99 */
100 String 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 getServerPort();
110
111 /***
112 * Returns the context path for this
113 * Turbine application.
114 *
115 * @return String
116 */
117 String getContextPath();
118 }