PHP Class AppserverIo\Appserver\ServletEngine\RequestHandler

Inheritance: extends Thread
Afficher le fichier Open project: appserver-io/appserver Class Usage Examples

Méthodes publiques

Свойство Type Description
$applicationContext AppserverIo\Psr\Application\ApplicationInterface The prepared application context.
$requestContext AppserverIo\Psr\Servlet\Http\HttpServletRequestInterface The prepared request context.

Méthodes publiques

Méthode Description
addError ( Error $error ) : void Append the passed error to the request handler's stack.
copyToHttpResponse ( AppserverIo\Psr\HttpMessage\ResponseInterface $httpResponse ) : void Copies the values from the request handler back to the passed HTTP response instance.
errorHandler ( integer $errno, string $errstr, string $errfile, integer $errline ) : boolean PHP error handler implemenation that replaces the defaulf PHP error handling.
getApplicationContext ( ) : AppserverIo\Psr\Application\ApplicationInterface Returns the actual application instance thatrepresents the application context of this request.
getErrors ( ) : array Return's the array with the request handler's error stack.
getRequestContext ( ) : AppserverIo\Psr\Servlet\Http\HttpServletRequestInterface Returns the actual servlet request instance that has been prepared to handle the actual request and represents the context of this request.
injectApplication ( AppserverIo\Psr\Application\ApplicationInterface $application ) : void Injects the application of the request to be handled
injectRequest ( AppserverIo\Psr\Servlet\Http\HttpServletRequestInterface $servletRequest ) : void Inject the actual servlet request.
injectResponse ( AppserverIo\Psr\Servlet\Http\HttpServletResponseInterface $servletResponse ) : void Inject the actual servlet response.
injectValves ( array $valves ) : void Injects the valves to be processed.
run ( ) : void The main method that handles the thread in a separate context.
shutdown ( ) : void Does shutdown logic for request handler if something went wrong and produces a fatal error for example.

Method Details

addError() public méthode

Append the passed error to the request handler's stack.
public addError ( Error $error ) : void
$error AppserverIo\Appserver\ServletEngine\Utils\Error The error to append
Résultat void

copyToHttpResponse() public méthode

Copies the values from the request handler back to the passed HTTP response instance.
public copyToHttpResponse ( AppserverIo\Psr\HttpMessage\ResponseInterface $httpResponse ) : void
$httpResponse AppserverIo\Psr\HttpMessage\ResponseInterface A HTTP response object
Résultat void

errorHandler() public méthode

As this method will NOT handle Fatal Errors with code E_ERROR or E_USER, so these have to be processed by the shutdown handler itself.
public errorHandler ( integer $errno, string $errstr, string $errfile, integer $errline ) : boolean
$errno integer The intern PHP error number
$errstr string The error message itself
$errfile string The file where the error occurs
$errline integer The line where the error occurs
Résultat boolean Always return TRUE, because we want to disable default PHP error handling

getApplicationContext() public static méthode

Returns the actual application instance thatrepresents the application context of this request.
public static getApplicationContext ( ) : AppserverIo\Psr\Application\ApplicationInterface
Résultat AppserverIo\Psr\Application\ApplicationInterface The actual application context

getErrors() public méthode

Return's the array with the request handler's error stack.
public getErrors ( ) : array
Résultat array The stack with the request handler's errors

getRequestContext() public static méthode

Returns the actual servlet request instance that has been prepared to handle the actual request and represents the context of this request.
public static getRequestContext ( ) : AppserverIo\Psr\Servlet\Http\HttpServletRequestInterface
Résultat AppserverIo\Psr\Servlet\Http\HttpServletRequestInterface The prepared request context

injectApplication() public méthode

Injects the application of the request to be handled
public injectApplication ( AppserverIo\Psr\Application\ApplicationInterface $application ) : void
$application AppserverIo\Psr\Application\ApplicationInterface The application instance
Résultat void

injectRequest() public méthode

Inject the actual servlet request.
public injectRequest ( AppserverIo\Psr\Servlet\Http\HttpServletRequestInterface $servletRequest ) : void
$servletRequest AppserverIo\Psr\Servlet\Http\HttpServletRequestInterface The actual request instance
Résultat void

injectResponse() public méthode

Inject the actual servlet response.
public injectResponse ( AppserverIo\Psr\Servlet\Http\HttpServletResponseInterface $servletResponse ) : void
$servletResponse AppserverIo\Psr\Servlet\Http\HttpServletResponseInterface The actual response instance
Résultat void

injectValves() public méthode

Injects the valves to be processed.
public injectValves ( array $valves ) : void
$valves array The valves to process
Résultat void

run() public méthode

The main method that handles the thread in a separate context.
public run ( ) : void
Résultat void

shutdown() public méthode

Does shutdown logic for request handler if something went wrong and produces a fatal error for example.
public shutdown ( ) : void
Résultat void

Property Details

$applicationContext public_oe static_oe property

The prepared application context.
public static ApplicationInterface,AppserverIo\Psr\Application $applicationContext
Résultat AppserverIo\Psr\Application\ApplicationInterface

$requestContext public_oe static_oe property

The prepared request context.
public static HttpServletRequestInterface,AppserverIo\Psr\Servlet\Http $requestContext
Résultat AppserverIo\Psr\Servlet\Http\HttpServletRequestInterface