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

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

Защищенные свойства (Protected)

Свойство Тип Описание
$instance AppserverIo\Appserver\Core\Interfaces\ApplicationServerInterface The application server instance itself.

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

Метод Описание
bindService ( integer $runlevel, object $service ) : void Binds the passed service to the runlevel.
doctrine ( React\Socket\ConnectionInterface $conn, array $command ) : void Executes a Doctrine command.
getBootstrapConfigurationFilename ( ) : string Returns the name and the path of the bootstrap configuration file.
getConfigurationFilename ( ) : string Returns the name and the path of the system configuration file.
getInitialContext ( ) : InitialContext Return's the initial context instance.
getLogger ( string $name ) : Psr\Log\LoggerInterface | null Returns the requested logger instance.
getLoggers ( ) : array Returns the logger instances.
getNamingDirectory ( ) : AppserverIo\Psr\Naming\NamingDirectoryInterface Returns the naming directory instance.
getService ( integer $runlevel, string $name ) Returns the service for the passed runlevel and name.
getSystemConfiguration ( ) : AppserverIo\Appserver\Core\Interfaces\SystemConfigurationInterface Returns the system configuration.
getSystemLogger ( ) : Psr\Log\LoggerInterface Return's the system logger instance.
init ( React\Socket\ConnectionInterface $conn = null, integer $runlevel = ApplicationServerInterface::FULL ) : void The runlevel to switch to.
keepRunning ( ) : boolean Query whether the application server should keep running or not.
mode ( React\Socket\ConnectionInterface $conn, string $mode ) : void Switch to the passed mode, which can either be 'dev', 'prod' or 'install'.
newService ( string $className ) : AppserverIo\Appserver\Core\Api\ServiceInterface Returns a new instance of the passed API service.
run ( ) The thread's run() method that runs asynchronously.
runlevelFromString ( string $runlevel ) : integer Translates and returns the runlevel of the passed a string representation.
runlevelToString ( integer $runlevel ) : string Translates and returns a string representation of the passed runlevel.
setInitialContext ( InitialContext $initialContext ) : void Sets the initial context instance.
setLoggers ( array $loggers ) Set's the logger instances.
setSystemConfiguration ( AppserverIo\Appserver\Core\Interfaces\SystemConfigurationInterface $systemConfiguration ) : null Sets the system configuration.
shutdown ( ) : void Shutdown handler that checks for fatal/user errors.
singleton ( AppserverIo\Psr\Naming\NamingDirectoryInterface $namingDirectory, AppserverIo\Storage\GenericStackable $runlevels ) : AppserverIo\Appserver\Core\Interfaces\ApplicationServerInterface Creates a new singleton application server instance.
stopServices ( integer $runlevel ) : void Stops all services of the passed runlevel.
unbindService ( integer $runlevel, string $name ) : void Unbind the service with the passed name and runlevel.

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

Метод Описание
__construct ( AppserverIo\Psr\Naming\NamingDirectoryInterface $namingDirectory, AppserverIo\Storage\GenericStackable $runlevels ) Initialize and start the application server.
doDoctrine ( array $command = [] ) : string Execute the Doctrine CLI tool.
doLoadBootstrap ( $bootstrapConfigurationFilename ) : BootstrapNode Loads the bootstrap configuration from the XML file.
doStopServices ( integer $runlevel ) : void Stops all services of the passed runlevel.
doSwitchSetupMode ( string $newMode, string $configurationFilename ) : void Switches the running setup mode to the passed value.

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

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

Initialize and start the application server.
protected __construct ( AppserverIo\Psr\Naming\NamingDirectoryInterface $namingDirectory, AppserverIo\Storage\GenericStackable $runlevels )
$namingDirectory AppserverIo\Psr\Naming\NamingDirectoryInterface
$runlevels AppserverIo\Storage\GenericStackable The storage for the services

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

Binds the passed service to the runlevel.
public bindService ( integer $runlevel, object $service ) : void
$runlevel integer The runlevel to bound the service to
$service object The service to bound
Результат void

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

Execute the Doctrine CLI tool.
protected doDoctrine ( array $command = [] ) : string
$command array The Doctrine command to be executed
Результат string The commands output

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

Loads the bootstrap configuration from the XML file.
protected doLoadBootstrap ( $bootstrapConfigurationFilename ) : BootstrapNode
Результат AppserverIo\Appserver\Core\Api\Node\BootstrapNode The boostrap configuration

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

Stops all services of the passed runlevel.
protected doStopServices ( integer $runlevel ) : void
$runlevel integer The runlevel to stop all services for
Результат void

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

Switches the running setup mode to the passed value.
protected doSwitchSetupMode ( string $newMode, string $configurationFilename ) : void
$newMode string The mode to switch to
$configurationFilename string The path of the configuration filename
Результат void

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

Executes a Doctrine command.
public doctrine ( React\Socket\ConnectionInterface $conn, array $command ) : void
$conn React\Socket\ConnectionInterface The connection resource
$command array The array with the command elements to execute
Результат void

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

Returns the name and the path of the bootstrap configuration file.
public getBootstrapConfigurationFilename ( ) : string
Результат string Name and path of the bootstrap configuraiton file

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

Returns the name and the path of the system configuration file.
public getConfigurationFilename ( ) : string
Результат string Name and path of the sytsem configuration file

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

Return's the initial context instance.
public getInitialContext ( ) : InitialContext
Результат InitialContext The initial context instance

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

Returns the requested logger instance.
public getLogger ( string $name ) : Psr\Log\LoggerInterface | null
$name string Name of the requested logger instance
Результат Psr\Log\LoggerInterface | null The requested logger instance

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

Returns the logger instances.
public getLoggers ( ) : array
Результат array The logger instances

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

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

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

Returns the service for the passed runlevel and name.
public getService ( integer $runlevel, string $name )
$runlevel integer The runlevel of the requested service
$name string The name of the requested service

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

Returns the system configuration.
public getSystemConfiguration ( ) : AppserverIo\Appserver\Core\Interfaces\SystemConfigurationInterface
Результат AppserverIo\Appserver\Core\Interfaces\SystemConfigurationInterface The system configuration

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

Return's the system logger instance.
public getSystemLogger ( ) : Psr\Log\LoggerInterface
Результат Psr\Log\LoggerInterface The system logger instance

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

The runlevel to switch to.
public init ( React\Socket\ConnectionInterface $conn = null, integer $runlevel = ApplicationServerInterface::FULL ) : void
$conn React\Socket\ConnectionInterface The connection resource
$runlevel integer The new runlevel to switch to
Результат void

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

Query whether the application server should keep running or not.
public keepRunning ( ) : boolean
Результат boolean TRUE if the server should keep running, else FALSE

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

Switch to the passed mode, which can either be 'dev', 'prod' or 'install'.
public mode ( React\Socket\ConnectionInterface $conn, string $mode ) : void
$conn React\Socket\ConnectionInterface The connection resource
$mode string The setup mode to switch to
Результат void

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

Returns a new instance of the passed API service.
См. также: 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

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

The thread's run() method that runs asynchronously.
public run ( )

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

Translates and returns the runlevel of the passed a string representation.
public runlevelFromString ( string $runlevel ) : integer
$runlevel string The string representation of the runlevel to return
Результат integer The runlevel of the passed string representation

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

Translates and returns a string representation of the passed runlevel.
public runlevelToString ( integer $runlevel ) : string
$runlevel integer The runlevel to return the string representation for
Результат string The string representation for the passed runlevel

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

Sets the initial context instance.
public setInitialContext ( InitialContext $initialContext ) : void
$initialContext InitialContext The initial context instance
Результат void

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

Set's the logger instances.
public setLoggers ( array $loggers )
$loggers array The logger instances to set

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

Sets the system configuration.
public setSystemConfiguration ( AppserverIo\Appserver\Core\Interfaces\SystemConfigurationInterface $systemConfiguration ) : null
$systemConfiguration AppserverIo\Appserver\Core\Interfaces\SystemConfigurationInterface The system configuration object
Результат null

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

Shutdown handler that checks for fatal/user errors.
public shutdown ( ) : void
Результат void

singleton() публичный статический метод

Creates a new singleton application server instance.
public static singleton ( AppserverIo\Psr\Naming\NamingDirectoryInterface $namingDirectory, AppserverIo\Storage\GenericStackable $runlevels ) : AppserverIo\Appserver\Core\Interfaces\ApplicationServerInterface
$namingDirectory AppserverIo\Psr\Naming\NamingDirectoryInterface
$runlevels AppserverIo\Storage\GenericStackable The storage for the services
Результат AppserverIo\Appserver\Core\Interfaces\ApplicationServerInterface The singleton application instance

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

Stops all services of the passed runlevel.
public stopServices ( integer $runlevel ) : void
$runlevel integer The runlevel to stop all services for
Результат void

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

Unbind the service with the passed name and runlevel.
public unbindService ( integer $runlevel, string $name ) : void
$runlevel integer The runlevel of the service
$name string The name of the service
Результат void

Описание свойств

$instance защищенное статическое свойство

The application server instance itself.
protected static ApplicationServerInterface,AppserverIo\Appserver\Core\Interfaces $instance
Результат AppserverIo\Appserver\Core\Interfaces\ApplicationServerInterface