PHP 클래스 AppserverIo\Appserver\Core\ApplicationServer

상속: extends Thread, implements AppserverIo\Appserver\Core\Interfaces\ApplicationServerInterface
파일 보기 프로젝트 열기: appserver-io/appserver 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$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