PHP Class AppserverIo\Appserver\ServletEngine\ServletManager

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

Public Methods

Method 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 method

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
return void

addInitParameter() public method

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
return void

addServlet() public method

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
return void

addServletMapping() public method

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
return void

addSessionParameter() public method

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
return void

getDirectories() public method

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

getErrorPages() public method

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

getIdentifier() public method

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

getInitParameter() public method

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

getManagerSettings() public method

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

getResourceLocator() public method

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

getSecuredUrlConfigs() public method

Returns the webapps security context configurations.
public getSecuredUrlConfigs ( ) : array
return array The security context configurations

getServlet() public method

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

getServletByMapping() public method

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
return AppserverIo\Psr\Servlet\ServletInterface The servlet instance

getServletLocator() public method

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

getServletMappings() public method

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

getServlets() public method

Returns all servlets
public getServlets ( ) : array
return array The servlets collection

getSessionParameter() public method

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

hasSessionParameters() public method

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

initialize() public method

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
return void

injectDirectories() public method

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

injectErrorPages() public method

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
return void

injectInitParameters() public method

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

injectManagerSettings() public method

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

injectResourceLocator() public method

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
return void

injectSecuredUrlConfigs() public method

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
return void

injectServletMappings() public method

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

injectServlets() public method

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

injectSessionParameters() public method

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

locate() public method

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
return AppserverIo\Psr\Servlet\ServletInterface The requested servlet

lookup() public method

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
return AppserverIo\Psr\Servlet\GenericServlet The requested servlet

registerServlet() public method

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
return void

registerServlets() public method

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
return void