PHP Class AppserverIo\Appserver\ServletEngine\ServletManager

Inheritance: extends AppserverIo\Appserver\Core\AbstractEpbManager, implements AppserverIo\Psr\Servlet\ServletContextInterface, implements AppserverIo\Appserver\Application\Interfaces\ManagerSettingsAwareInterface
Afficher le fichier Open project: appserver-io/appserver Class Usage Examples

Méthodes publiques

Méthode Description
addErrorPage ( string $errorCodePattern, string $errorLocation ) : void Registers the error page under the passed error code.
addInitParameter ( string $name, string $value ) : void Registers the init parameter under the passed name.
addServlet ( string $key, AppserverIo\Psr\Servlet\ServletInterface $servlet ) : void Registers a servlet under the passed key.
addServletMapping ( string $pattern, string $servletName ) : void Adds an URL mapping for a servlet.
addSessionParameter ( string $name, string $value ) : void Registers the session parameter under the passed name.
getDirectories ( ) : array Returns all the additional directories to be parsed for servlets.
getErrorPages ( ) : AppserverIo\Storage\StorageInterface Returns the container with the error page configuration.
getIdentifier ( ) : string Returns the identifier for the servlet manager instance.
getInitParameter ( string $name ) : null | string Returns the init parameter with the passed name.
getManagerSettings ( ) : AppserverIo\Appserver\Application\Interfaces\ManagerSettingsInterface Return's the servlet manager settings.
getResourceLocator ( ) : AppserverIo\Appserver\ServletEngine\ResourceLocatorInterface Return the resource locator instance.
getSecuredUrlConfigs ( ) : array Returns the webapps security context configurations.
getServlet ( string $key ) : AppserverIo\Psr\Servlet\ServletInterface Returns the servlet with the passed name.
getServletByMapping ( string $urlMapping ) : AppserverIo\Psr\Servlet\ServletInterface Returns the servlet for the passed URL mapping.
getServletLocator ( ) : AppserverIo\Appserver\ServletEngine\ResourceLocatorInterface Returns the resource locator for the servlets.
getServletMappings ( ) : AppserverIo\Storage\GenericStackable Returns the servlet mappings found in the configuration file.
getServlets ( ) : array Returns all servlets
getSessionParameter ( string $name ) : null | string Returns the session parameter with the passed name.
hasSessionParameters ( ) : boolean Returns TRUE if we've at least one session parameter configured, else FALSE.
initialize ( AppserverIo\Psr\Application\ApplicationInterface $application ) : void Has been automatically invoked by the container after the application instance has been created.
injectDirectories ( array $directories ) : void Injects the additional directories to be parsed when looking for servlets.
injectErrorPages ( AppserverIo\Storage\StorageInterface $errorPages ) : void Injects the container for the error page configuration.
injectInitParameters ( AppserverIo\Storage\StorageInterface $initParameters ) : void Injects the container for the init parameters.
injectManagerSettings ( AppserverIo\Appserver\Application\Interfaces\ManagerSettingsInterface $managerSettings ) : void Injects the servlet manager settings.
injectResourceLocator ( AppserverIo\Appserver\ServletEngine\ResourceLocatorInterface $resourceLocator ) : void Injects the resource locator that locates the requested servlet.
injectSecuredUrlConfigs ( AppserverIo\Storage\StorageInterface $securedUrlConfigs ) : void Injects the container for the secured URL configurations.
injectServletMappings ( AppserverIo\Storage\GenericStackable $servletMappings ) : void Injects the container for the servlet mappings.
injectServlets ( AppserverIo\Storage\StorageInterface $servlets ) : void Injects the container for the servlets.
injectSessionParameters ( AppserverIo\Storage\StorageInterface $sessionParameters ) : void Injects the container for the session parameters.
locate ( AppserverIo\Psr\Servlet\Http\HttpServletRequestInterface $servletRequest, array $args = [] ) : AppserverIo\Psr\Servlet\ServletInterface Tries to locate the resource related with the request.
lookup ( string $servletPath, string $sessionId = null, array $args = [] ) : AppserverIo\Psr\Servlet\GenericServlet Runs a lookup for the servlet with the passed class name and session ID.
registerServlet ( AppserverIo\Psr\Servlet\Description\ServletDescriptorInterface $descriptor ) : void Register the servlet described by the passed descriptor.
registerServlets ( AppserverIo\Psr\Application\ApplicationInterface $application ) : void Finds all servlets which are provided by the webapps and initializes them.

Method Details

addErrorPage() public méthode

Registers the error page under the passed error code.
public addErrorPage ( string $errorCodePattern, string $errorLocation ) : void
$errorCodePattern string The error code for the page
$errorLocation string The error page location
Résultat void

addInitParameter() public méthode

Registers the init parameter under the passed name.
public addInitParameter ( string $name, string $value ) : void
$name string Name to register the init parameter with
$value string The value of the init parameter
Résultat void

addServlet() public méthode

Registers a servlet under the passed key.
public addServlet ( string $key, AppserverIo\Psr\Servlet\ServletInterface $servlet ) : void
$key string The servlet to key to register with
$servlet AppserverIo\Psr\Servlet\ServletInterface The servlet to be registered
Résultat void

addServletMapping() public méthode

Adds an URL mapping for a servlet.
public addServletMapping ( string $pattern, string $servletName ) : void
$pattern string The URL pattern we want the servlet to map to
$servletName string The servlet name to map
Résultat void

addSessionParameter() public méthode

Registers the session parameter under the passed name.
public addSessionParameter ( string $name, string $value ) : void
$name string Name to register the session parameter with
$value string The value of the session parameter
Résultat void

getDirectories() public méthode

Returns all the additional directories to be parsed for servlets.
public getDirectories ( ) : array
Résultat array The additional directories

getErrorPages() public méthode

Returns the container with the error page configuration.
public getErrorPages ( ) : AppserverIo\Storage\StorageInterface
Résultat AppserverIo\Storage\StorageInterface The container with the error page configuration

getIdentifier() public méthode

Returns the identifier for the servlet manager instance.
See also: AppserverIo\Psr\Application\ManagerInterface::getIdentifier()
public getIdentifier ( ) : string
Résultat string

getInitParameter() public méthode

Returns the init parameter with the passed name.
public getInitParameter ( string $name ) : null | string
$name string Name of the init parameter to return
Résultat null | string

getManagerSettings() public méthode

Return's the servlet manager settings.
public getManagerSettings ( ) : AppserverIo\Appserver\Application\Interfaces\ManagerSettingsInterface
Résultat AppserverIo\Appserver\Application\Interfaces\ManagerSettingsInterface The servlet manager settings

getResourceLocator() public méthode

Return the resource locator instance.
public getResourceLocator ( ) : AppserverIo\Appserver\ServletEngine\ResourceLocatorInterface
Résultat AppserverIo\Appserver\ServletEngine\ResourceLocatorInterface The resource locator instance

getSecuredUrlConfigs() public méthode

Returns the webapps security context configurations.
public getSecuredUrlConfigs ( ) : array
Résultat array The security context configurations

getServlet() public méthode

Returns the servlet with the passed name.
public getServlet ( string $key ) : AppserverIo\Psr\Servlet\ServletInterface
$key string The name of the servlet to return
Résultat AppserverIo\Psr\Servlet\ServletInterface The servlet instance

getServletByMapping() public méthode

Returns the servlet for the passed URL mapping.
public getServletByMapping ( string $urlMapping ) : AppserverIo\Psr\Servlet\ServletInterface
$urlMapping string The URL mapping to return the servlet for
Résultat AppserverIo\Psr\Servlet\ServletInterface The servlet instance

getServletLocator() public méthode

Returns the resource locator for the servlets.
public getServletLocator ( ) : AppserverIo\Appserver\ServletEngine\ResourceLocatorInterface
Résultat AppserverIo\Appserver\ServletEngine\ResourceLocatorInterface The resource locator for the servlets

getServletMappings() public méthode

Returns the servlet mappings found in the configuration file.
public getServletMappings ( ) : AppserverIo\Storage\GenericStackable
Résultat AppserverIo\Storage\GenericStackable The servlet mappings

getServlets() public méthode

Returns all servlets
public getServlets ( ) : array
Résultat array The servlets collection

getSessionParameter() public méthode

Returns the session parameter with the passed name.
public getSessionParameter ( string $name ) : null | string
$name string Name of the session parameter to return
Résultat null | string

hasSessionParameters() public méthode

Returns TRUE if we've at least one session parameter configured, else FALSE.
public hasSessionParameters ( ) : boolean
Résultat boolean TRUE if we've at least one session parameter configured, else FALSE

initialize() public méthode

Has been automatically invoked by the container after the application instance has been created.
See also: AppserverIo\Psr\Application\ManagerInterface::initialize()
public initialize ( AppserverIo\Psr\Application\ApplicationInterface $application ) : void
$application AppserverIo\Psr\Application\ApplicationInterface The application instance
Résultat void

injectDirectories() public méthode

Injects the additional directories to be parsed when looking for servlets.
public injectDirectories ( array $directories ) : void
$directories array The additional directories to be parsed
Résultat void

injectErrorPages() public méthode

Injects the container for the error page configuration.
public injectErrorPages ( AppserverIo\Storage\StorageInterface $errorPages ) : void
$errorPages AppserverIo\Storage\StorageInterface The container for the error page configuration
Résultat void

injectInitParameters() public méthode

Injects the container for the init parameters.
public injectInitParameters ( AppserverIo\Storage\StorageInterface $initParameters ) : void
$initParameters AppserverIo\Storage\StorageInterface The container for the init parameters
Résultat void

injectManagerSettings() public méthode

Injects the servlet manager settings.
public injectManagerSettings ( AppserverIo\Appserver\Application\Interfaces\ManagerSettingsInterface $managerSettings ) : void
$managerSettings AppserverIo\Appserver\Application\Interfaces\ManagerSettingsInterface The servlet manager settings
Résultat void

injectResourceLocator() public méthode

Injects the resource locator that locates the requested servlet.
public injectResourceLocator ( AppserverIo\Appserver\ServletEngine\ResourceLocatorInterface $resourceLocator ) : void
$resourceLocator AppserverIo\Appserver\ServletEngine\ResourceLocatorInterface The resource locator
Résultat void

injectSecuredUrlConfigs() public méthode

Injects the container for the secured URL configurations.
public injectSecuredUrlConfigs ( AppserverIo\Storage\StorageInterface $securedUrlConfigs ) : void
$securedUrlConfigs AppserverIo\Storage\StorageInterface The container for the secured URL configurations
Résultat void

injectServletMappings() public méthode

Injects the container for the servlet mappings.
public injectServletMappings ( AppserverIo\Storage\GenericStackable $servletMappings ) : void
$servletMappings AppserverIo\Storage\GenericStackable The container for the servlet mappings
Résultat void

injectServlets() public méthode

Injects the container for the servlets.
public injectServlets ( AppserverIo\Storage\StorageInterface $servlets ) : void
$servlets AppserverIo\Storage\StorageInterface The container for the servlets
Résultat void

injectSessionParameters() public méthode

Injects the container for the session parameters.
public injectSessionParameters ( AppserverIo\Storage\StorageInterface $sessionParameters ) : void
$sessionParameters AppserverIo\Storage\StorageInterface The container for the session parameters
Résultat void

locate() public méthode

Tries to locate the resource related with the request.
See also: AppserverIo\Appserver\ServletEngine\ResourceLocator::locate()
public locate ( AppserverIo\Psr\Servlet\Http\HttpServletRequestInterface $servletRequest, array $args = [] ) : AppserverIo\Psr\Servlet\ServletInterface
$servletRequest AppserverIo\Psr\Servlet\Http\HttpServletRequestInterface The request instance to return the servlet for
$args array The arguments passed to the servlet constructor
Résultat AppserverIo\Psr\Servlet\ServletInterface The requested servlet

lookup() public méthode

Runs a lookup for the servlet with the passed class name and session ID.
public lookup ( string $servletPath, string $sessionId = null, array $args = [] ) : AppserverIo\Psr\Servlet\GenericServlet
$servletPath string The servlet path
$sessionId string The session ID
$args array The arguments passed to the servlet constructor
Résultat AppserverIo\Psr\Servlet\GenericServlet The requested servlet

registerServlet() public méthode

Register the servlet described by the passed descriptor.
public registerServlet ( AppserverIo\Psr\Servlet\Description\ServletDescriptorInterface $descriptor ) : void
$descriptor AppserverIo\Psr\Servlet\Description\ServletDescriptorInterface The servlet descriptor
Résultat void

registerServlets() public méthode

Finds all servlets which are provided by the webapps and initializes them.
public registerServlets ( AppserverIo\Psr\Application\ApplicationInterface $application ) : void
$application AppserverIo\Psr\Application\ApplicationInterface The application instance
Résultat void