PHP Класс AppserverIo\Appserver\ServletEngine\ServletManager

Автор: Tim Wagner ([email protected])
Наследование: extends AppserverIo\Appserver\Core\AbstractEpbManager, implements AppserverIo\Psr\Servlet\ServletContextInterface, implements AppserverIo\Appserver\Application\Interfaces\ManagerSettingsAwareInterface
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
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.

Описание методов

addErrorPage() публичный метод

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
Результат void

addInitParameter() публичный метод

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
Результат void

addServlet() публичный метод

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
Результат void

addServletMapping() публичный метод

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
Результат void

addSessionParameter() публичный метод

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
Результат void

getDirectories() публичный метод

Returns all the additional directories to be parsed for servlets.
public getDirectories ( ) : array
Результат array The additional directories

getErrorPages() публичный метод

Returns the container with the error page configuration.
public getErrorPages ( ) : AppserverIo\Storage\StorageInterface
Результат AppserverIo\Storage\StorageInterface The container with the error page configuration

getIdentifier() публичный метод

Returns the identifier for the servlet manager instance.
См. также: AppserverIo\Psr\Application\ManagerInterface::getIdentifier()
public getIdentifier ( ) : string
Результат string

getInitParameter() публичный метод

Returns the init parameter with the passed name.
public getInitParameter ( string $name ) : null | string
$name string Name of the init parameter to return
Результат null | string

getManagerSettings() публичный метод

Return's the servlet manager settings.
public getManagerSettings ( ) : AppserverIo\Appserver\Application\Interfaces\ManagerSettingsInterface
Результат AppserverIo\Appserver\Application\Interfaces\ManagerSettingsInterface The servlet manager settings

getResourceLocator() публичный метод

Return the resource locator instance.
public getResourceLocator ( ) : AppserverIo\Appserver\ServletEngine\ResourceLocatorInterface
Результат AppserverIo\Appserver\ServletEngine\ResourceLocatorInterface The resource locator instance

getSecuredUrlConfigs() публичный метод

Returns the webapps security context configurations.
public getSecuredUrlConfigs ( ) : array
Результат array The security context configurations

getServlet() публичный метод

Returns the servlet with the passed name.
public getServlet ( string $key ) : AppserverIo\Psr\Servlet\ServletInterface
$key string The name of the servlet to return
Результат AppserverIo\Psr\Servlet\ServletInterface The servlet instance

getServletByMapping() публичный метод

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
Результат AppserverIo\Psr\Servlet\ServletInterface The servlet instance

getServletLocator() публичный метод

Returns the resource locator for the servlets.
public getServletLocator ( ) : AppserverIo\Appserver\ServletEngine\ResourceLocatorInterface
Результат AppserverIo\Appserver\ServletEngine\ResourceLocatorInterface The resource locator for the servlets

getServletMappings() публичный метод

Returns the servlet mappings found in the configuration file.
public getServletMappings ( ) : AppserverIo\Storage\GenericStackable
Результат AppserverIo\Storage\GenericStackable The servlet mappings

getServlets() публичный метод

Returns all servlets
public getServlets ( ) : array
Результат array The servlets collection

getSessionParameter() публичный метод

Returns the session parameter with the passed name.
public getSessionParameter ( string $name ) : null | string
$name string Name of the session parameter to return
Результат null | string

hasSessionParameters() публичный метод

Returns TRUE if we've at least one session parameter configured, else FALSE.
public hasSessionParameters ( ) : boolean
Результат boolean TRUE if we've at least one session parameter configured, else FALSE

initialize() публичный метод

Has been automatically invoked by the container after the application instance has been created.
См. также: AppserverIo\Psr\Application\ManagerInterface::initialize()
public initialize ( AppserverIo\Psr\Application\ApplicationInterface $application ) : void
$application AppserverIo\Psr\Application\ApplicationInterface The application instance
Результат void

injectDirectories() публичный метод

Injects the additional directories to be parsed when looking for servlets.
public injectDirectories ( array $directories ) : void
$directories array The additional directories to be parsed
Результат void

injectErrorPages() публичный метод

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
Результат void

injectInitParameters() публичный метод

Injects the container for the init parameters.
public injectInitParameters ( AppserverIo\Storage\StorageInterface $initParameters ) : void
$initParameters AppserverIo\Storage\StorageInterface The container for the init parameters
Результат void

injectManagerSettings() публичный метод

Injects the servlet manager settings.
public injectManagerSettings ( AppserverIo\Appserver\Application\Interfaces\ManagerSettingsInterface $managerSettings ) : void
$managerSettings AppserverIo\Appserver\Application\Interfaces\ManagerSettingsInterface The servlet manager settings
Результат void

injectResourceLocator() публичный метод

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
Результат void

injectSecuredUrlConfigs() публичный метод

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
Результат void

injectServletMappings() публичный метод

Injects the container for the servlet mappings.
public injectServletMappings ( AppserverIo\Storage\GenericStackable $servletMappings ) : void
$servletMappings AppserverIo\Storage\GenericStackable The container for the servlet mappings
Результат void

injectServlets() публичный метод

Injects the container for the servlets.
public injectServlets ( AppserverIo\Storage\StorageInterface $servlets ) : void
$servlets AppserverIo\Storage\StorageInterface The container for the servlets
Результат void

injectSessionParameters() публичный метод

Injects the container for the session parameters.
public injectSessionParameters ( AppserverIo\Storage\StorageInterface $sessionParameters ) : void
$sessionParameters AppserverIo\Storage\StorageInterface The container for the session parameters
Результат void

locate() публичный метод

Tries to locate the resource related with the request.
См. также: 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
Результат AppserverIo\Psr\Servlet\ServletInterface The requested servlet

lookup() публичный метод

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
Результат AppserverIo\Psr\Servlet\GenericServlet The requested servlet

registerServlet() публичный метод

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
Результат void

registerServlets() публичный метод

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
Результат void