PHP Класс AppserverIo\Appserver\Core\AbstractContainerThread

Автор: Tim Wagner ([email protected])
Автор: Johann Zelger ([email protected])
Автор: Bernhard Wick ([email protected])
Наследование: extends AppserverIo\Appserver\Core\AbstractContextThread, implements AppserverIo\Appserver\Core\Interfaces\ContainerInterface
Показать файл Открыть проект

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

Метод Описание
__construct ( AppserverIo\Appserver\Application\Interfaces\ContextInterface $initialContext, AppserverIo\Psr\Naming\NamingDirectoryInterface $namingDirectory, AppserverIo\Appserver\Core\Api\Node\ContainerNodeInterface $containerNode, string $runlevel ) Initializes the container with the initial context, the unique container ID and the deployed applications.
addApplication ( AppserverIo\Psr\Application\ApplicationInterface $application ) : void Append the deployed application to the deployment instance and registers it in the system configuration.
addApplicationToSystemConfiguration ( AppserverIo\Psr\Application\ApplicationInterface $application ) : void Connects the passed application to the system configuration.
getAppBase ( ) : string (non-PHPdoc)
getApplication ( string $name ) : AppserverIo\Psr\Application\ApplicationInterface Returns the application instance with the passed name.
getApplications ( ) : AppserverIo\Storage\GenericStackable Returns the deployed applications.
getBaseDirectory ( string | null $directoryToAppend = null ) : string (non-PHPdoc)
getContainerNode ( ) : ContainerNode Returns the containers configuration node.
getDeployment ( ) : AppserverIo\Psr\Deployment\DeploymentInterface Returns the deployment interface for the container for this container thread.
getInitialContext ( ) : AppserverIo\Appserver\Application\Interfaces\ContextInterface Returns the initial context instance.
getName ( ) : string Returns the unique container name from the configuration.
getNamingDirectory ( ) : AppserverIo\Psr\Naming\NamingDirectoryInterface Returns the containers naming directory.
getRunlevel ( ) : string Returns the runlevel the container has been started in.
getServer ( string $name ) : AppserverIo\Server\Interfaces\ServerInterface Returns the sever instance with the passed name.
getServers ( ) : AppserverIo\Storage\GenericStackable Returns the deployed servers.
getService ( ) : AppService Returns the service instance we need to handle system configuration tasks.
getTmpDir ( string | null $directoryToAppend = null ) : string Returns the servers tmp directory, append with the passed directory.
hasProvisioningEnabled ( ) : boolean Returns TRUE if application provisioning for the container is enabled, else FALSE.
hasServersStarted ( ) : boolean Returns boolean wheather the servers has been started yet or not
main ( ) : void Run the containers logic
newInstance ( string $className, array $args = [] ) : object (non-PHPdoc)
newService ( string $className ) : AppserverIo\Appserver\Core\Api\ServiceInterface (non-PHPdoc)
shutdown ( ) : void Does shutdown logic for request handler if something went wrong and produces a fatal error for example.
stop ( ) : void Stops the container instance.

Защищенные методы

Метод Описание
getServerNodeConfiguration ( AppserverIo\Appserver\Core\Api\Node\ServerNodeInterface $serverNode ) : ServerNodeConfiguration Return's the prepared server node configuration.
registerClassLoaders ( AppserverIo\Storage\GenericStackable $classLoaders ) : void Register's the class loaders configured for this container.
validateDirectories ( ) : void Validates that the container's application and temporary directory is available.

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

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

Initializes the container with the initial context, the unique container ID and the deployed applications.
public __construct ( AppserverIo\Appserver\Application\Interfaces\ContextInterface $initialContext, AppserverIo\Psr\Naming\NamingDirectoryInterface $namingDirectory, AppserverIo\Appserver\Core\Api\Node\ContainerNodeInterface $containerNode, string $runlevel )
$initialContext AppserverIo\Appserver\Application\Interfaces\ContextInterface The initial context
$namingDirectory AppserverIo\Psr\Naming\NamingDirectoryInterface The naming directory
$containerNode AppserverIo\Appserver\Core\Api\Node\ContainerNodeInterface The container node
$runlevel string The runlevel the container has been started in

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

Append the deployed application to the deployment instance and registers it in the system configuration.
public addApplication ( AppserverIo\Psr\Application\ApplicationInterface $application ) : void
$application AppserverIo\Psr\Application\ApplicationInterface The application to append
Результат void

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

Connects the passed application to the system configuration.
public addApplicationToSystemConfiguration ( AppserverIo\Psr\Application\ApplicationInterface $application ) : void
$application AppserverIo\Psr\Application\ApplicationInterface The application to be prepared
Результат void

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

(non-PHPdoc)
См. также: AppserverIo\Appserver\Core\Api\ContainerService::getAppBase()
public getAppBase ( ) : string
Результат string The application base directory for this container

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

Returns the application instance with the passed name.
public getApplication ( string $name ) : AppserverIo\Psr\Application\ApplicationInterface
$name string The name of the application to return
Результат AppserverIo\Psr\Application\ApplicationInterface The application instance

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

Returns the deployed applications.
public getApplications ( ) : AppserverIo\Storage\GenericStackable
Результат AppserverIo\Storage\GenericStackable The applications

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

(non-PHPdoc)
См. также: AppserverIo\Appserver\Core\Api\ContainerService::getBaseDirectory()
public getBaseDirectory ( string | null $directoryToAppend = null ) : string
$directoryToAppend string | null Append this directory to the base directory before returning it
Результат string The base directory

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

Returns the containers configuration node.
public getContainerNode ( ) : ContainerNode
Результат AppserverIo\Appserver\Core\Api\Node\ContainerNode The configuration node

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

Returns the deployment interface for the container for this container thread.
public getDeployment ( ) : AppserverIo\Psr\Deployment\DeploymentInterface
Результат AppserverIo\Psr\Deployment\DeploymentInterface The deployment instance for this container thread

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

Returns the initial context instance.
См. также: AppserverIo\Appserver\Core\Interfaces\ContainerInterface::getInitialContext()
public getInitialContext ( ) : AppserverIo\Appserver\Application\Interfaces\ContextInterface
Результат AppserverIo\Appserver\Application\Interfaces\ContextInterface The initial context instance

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

Returns the unique container name from the configuration.
См. также: AppserverIo\Appserver\Core\Interfaces\ContainerInterface::getName()
public getName ( ) : string
Результат string The unique container name

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

Returns the containers naming directory.
public getNamingDirectory ( ) : AppserverIo\Psr\Naming\NamingDirectoryInterface
Результат AppserverIo\Psr\Naming\NamingDirectoryInterface The containers naming directory

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

Returns the runlevel the container has been started in.
public getRunlevel ( ) : string
Результат string The runlevel

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

Returns the sever instance with the passed name.
public getServer ( string $name ) : AppserverIo\Server\Interfaces\ServerInterface
$name string The name of the server to return
Результат AppserverIo\Server\Interfaces\ServerInterface The server instance

getServerNodeConfiguration() защищенный метод

Return's the prepared server node configuration.
protected getServerNodeConfiguration ( AppserverIo\Appserver\Core\Api\Node\ServerNodeInterface $serverNode ) : ServerNodeConfiguration
$serverNode AppserverIo\Appserver\Core\Api\Node\ServerNodeInterface The server node
Результат ServerNodeConfiguration The server node configuration

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

Returns the deployed servers.
public getServers ( ) : AppserverIo\Storage\GenericStackable
Результат AppserverIo\Storage\GenericStackable The servers

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

Returns the service instance we need to handle system configuration tasks.
public getService ( ) : AppService
Результат AppserverIo\Appserver\Core\Api\AppService The service instance we need

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

Returns the servers tmp directory, append with the passed directory.
public getTmpDir ( string | null $directoryToAppend = null ) : string
$directoryToAppend string | null The directory to append
Результат string

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

Returns TRUE if application provisioning for the container is enabled, else FALSE.
public hasProvisioningEnabled ( ) : boolean
Результат boolean TRUE if application provisioning is enabled, else FALSE

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

Returns boolean wheather the servers has been started yet or not
public hasServersStarted ( ) : boolean
Результат boolean

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

Run the containers logic
public main ( ) : void
Результат void

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

(non-PHPdoc)
См. также: AppserverIo\Appserver\Core\InitialContext::newInstance()
public newInstance ( string $className, array $args = [] ) : object
$className string The fully qualified class name to return the instance for
$args array Arguments to pass to the constructor of the instance
Результат object The instance itself

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

(non-PHPdoc)
См. также: AppserverIo\Appserver\Core\InitialContext::newService()
public newService ( string $className ) : AppserverIo\Appserver\Core\Api\ServiceInterface
$className string The API service class name to return the instance for
Результат AppserverIo\Appserver\Core\Api\ServiceInterface The service instance

registerClassLoaders() защищенный метод

Register's the class loaders configured for this container.
protected registerClassLoaders ( AppserverIo\Storage\GenericStackable $classLoaders ) : void
$classLoaders AppserverIo\Storage\GenericStackable The container for the class loader instances
Результат void

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

Does shutdown logic for request handler if something went wrong and produces a fatal error for example.
public shutdown ( ) : void
Результат void

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

Stops the container instance.
public stop ( ) : void
Результат void

validateDirectories() защищенный метод

Validates that the container's application and temporary directory is available.
protected validateDirectories ( ) : void
Результат void