1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
/** |
4
|
|
|
* \AppserverIo\Appserver\ServletEngine\ServletValve |
5
|
|
|
* |
6
|
|
|
* NOTICE OF LICENSE |
7
|
|
|
* |
8
|
|
|
* This source file is subject to the Open Software License (OSL 3.0) |
9
|
|
|
* that is available through the world-wide-web at this URL: |
10
|
|
|
* http://opensource.org/licenses/osl-3.0.php |
11
|
|
|
* |
12
|
|
|
* PHP version 5 |
13
|
|
|
* |
14
|
|
|
* @author Tim Wagner <[email protected]> |
15
|
|
|
* @copyright 2015 TechDivision GmbH <[email protected]> |
16
|
|
|
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) |
17
|
|
|
* @link https://github.com/appserver-io/appserver |
18
|
|
|
* @link http://www.appserver.io |
19
|
|
|
*/ |
20
|
|
|
|
21
|
|
|
namespace AppserverIo\Appserver\ServletEngine; |
22
|
|
|
|
23
|
|
|
use AppserverIo\Psr\Servlet\Http\HttpServletRequestInterface; |
24
|
|
|
use AppserverIo\Psr\Servlet\Http\HttpServletResponseInterface; |
25
|
|
|
|
26
|
|
|
/** |
27
|
|
|
* Valve implementation that will be executed by the servlet engine to handle |
28
|
|
|
* an incoming HTTP servlet request. |
29
|
|
|
* |
30
|
|
|
* @author Tim Wagner <[email protected]> |
31
|
|
|
* @copyright 2015 TechDivision GmbH <[email protected]> |
32
|
|
|
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) |
33
|
|
|
* @link https://github.com/appserver-io/appserver |
34
|
|
|
* @link http://www.appserver.io |
35
|
|
|
*/ |
36
|
|
|
class ServletValve implements ValveInterface |
37
|
|
|
{ |
38
|
|
|
|
39
|
|
|
/** |
40
|
|
|
* Processes the request by invoking the request handler that executes the servlet |
41
|
|
|
* in a protected context. |
42
|
|
|
* |
43
|
|
|
* @param \AppserverIo\Psr\Servlet\Http\HttpServletRequestInterface $servletRequest The request instance |
44
|
|
|
* @param \AppserverIo\Psr\Servlet\Http\HttpServletResponseInterface $servletResponse The response instance |
45
|
|
|
* |
46
|
|
|
* @return void |
47
|
|
|
*/ |
48
|
|
|
public function invoke(HttpServletRequestInterface $servletRequest, HttpServletResponseInterface $servletResponse) |
49
|
|
|
{ |
50
|
|
|
|
51
|
|
|
// load the servlet manager |
52
|
|
|
/** @var \AppserverIo\Psr\Servlet\ServletContextInterface|\AppserverIo\Psr\Application\ManagerInterface $servletManager */ |
53
|
|
|
$servletManager = $servletRequest->getContext()->search('ServletContextInterface'); |
|
|
|
|
54
|
|
|
|
55
|
|
|
// locate and service the servlet |
56
|
|
|
$servlet = $servletManager->locate($servletRequest); |
|
|
|
|
57
|
|
|
$servlet->service($servletRequest, $servletResponse); |
58
|
|
|
|
59
|
|
|
// finally invoke the destroy() method |
60
|
|
|
$servlet->destroy(); |
61
|
|
|
|
62
|
|
|
// dispatch this request, because we have finished processing it |
63
|
|
|
$servletRequest->setDispatched(true); |
64
|
|
|
} |
65
|
|
|
} |
66
|
|
|
|
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.
This is most likely a typographical error or the method has been renamed.