PHP 클래스 AppserverIo\Appserver\Application\Application

상속: extends Thread, implements AppserverIo\Psr\Application\ApplicationInterface, implements AppserverIo\Psr\Application\DirectoryAwareInterface, implements AppserverIo\Psr\Application\FilesystemAwareInterface, implements AppserverIo\Psr\Context\ContextInterface, use trait AppserverIo\Appserver\Core\Traits\ThreadedContextTrait
파일 보기 프로젝트 열기: appserver-io/appserver 1 사용 예제들

공개 메소드들

메소드 설명
__construct ( ) Initialize the internal members.
addClassLoader ( AppserverIo\Appserver\Core\Interfaces\ClassLoaderInterface $classLoader, AppserverIo\Appserver\Core\Api\Node\ClassLoaderNodeInterface $configuration ) : void Injects an additional class loader.
addLogger ( Psr\Log\LoggerInterface $logger, AppserverIo\Appserver\Core\Api\Node\LoggerNodeInterface $configuration ) : void Injects the logger instance and the configuration.
addManager ( AppserverIo\Psr\Application\ManagerInterface $manager, AppserverIo\Appserver\Core\Api\Node\ManagerNodeInterface $configuration ) : void Injects manager instance and the configuration.
addProvisioner ( AppserverIo\Psr\Application\ProvisionerInterface $provisioner, AppserverIo\Appserver\Core\Api\Node\ProvisionerNodeInterface $configuration ) : void Injects the provisioner instance and the configuration.
connect ( ) : void Has been automatically invoked by the container after the application instance has been created.
getAppBase ( ) : string Returns the absolute path to the applications base directory.
getBaseDirectory ( string $directoryToAppend = null ) : string Returns the absolute path to the servers document root directory
getCacheDir ( ) : string Returns the absolute path to the applications cache directory.
getClassLoader ( string $identifier ) : AppserverIo\Appserver\Core\Interfaces\ClassLoaderInterface Return the requested class loader instance
getClassLoaders ( ) : AppserverIo\Storage\GenericStackable Return the class loaders.
getContainer ( ) : AppserverIo\Appserver\Core\Interfaces\ContainerInterface Return's the container instance the application is bound to.
getContainerName ( ) : string Returns the name of the container the application is bound to.
getContainerRunlevel ( ) : string Returns the runlevel of the container the application is bound to.
getEnvironmentName ( ) : string Returns the applications environment name
getGroup ( ) : string Returns the groupname the application should be executed with.
getInitialContext ( ) : AppserverIo\Appserver\Application\Interfaces\ContextInterface Returns the initial context instance.
getLogger ( string $name = LoggerUtils::SYSTEM ) : Psr\Log\LoggerInterface | null Return the requested logger instance, by default the application's system logger.
getLoggers ( ) : AppserverIo\Storage\GenericStackable Returns the logger instances.
getManager ( string $identifier ) : AppserverIo\Psr\Application\ManagerInterface Return the requested manager instance.
getManagers ( ) : AppserverIo\Storage\GenericStackable Returns the manager instances.
getName ( ) : string Returns the application name (that has to be the class namespace, e.g. example)
getNamingDirectory ( ) : AppserverIo\Psr\Naming\NamingDirectoryInterface Returns the applications naming directory.
getProvisioner ( string $identifier ) : AppserverIo\Psr\Application\ProvisionerInterface Return the requested provisioner instance.
getProvisioners ( ) : AppserverIo\Storage\GenericStackable Returns the provisioner instances.
getSerial ( ) : string Return's the application's UUID.
getSessionDir ( ) : string Returns the absolute path to the applications session directory.
getTmpDir ( ) : string Returns the absolute path to the applications temporary directory.
getUmask ( ) : string Returns the umask the application should create files/directories with.
getUniqueName ( ) : string Return's the unique application name that is the container + application name separated with a slash, e. g. combined-appserver/example.
getUser ( ) : string Returns the username the application should be executed with.
getWebappPath ( ) : string Returns the absolute path to the web application base directory.
initializeManagers ( ) : void Registers all managers in the application.
injectClassLoaders ( AppserverIo\Storage\GenericStackable $classLoaders ) : void Injects the storage for the class loaders.
injectContainerName ( string $containerName ) : void Injects the name of the container the application is bound to.
injectContainerRunlevel ( string $containerRunlevel ) : void Injects the runlevel of the container the application is bound to.
injectEnvironmentName ( string $environmentName ) : void Inject the environment name
injectInitialContext ( AppserverIo\Appserver\Application\Interfaces\ContextInterface $initialContext ) : void The initial context instance.
injectLoggers ( AppserverIo\Storage\GenericStackable $loggers ) : void Injects the storage for the loggers.
injectManagers ( AppserverIo\Storage\GenericStackable $managers ) : void Injects the storage for the managers.
injectName ( string $name ) : void Injects the application name.
injectNamingDirectory ( AppserverIo\Psr\Naming\NamingDirectoryInterface $namingDirectory ) : void Injects the naming directory.
injectProvisioners ( AppserverIo\Storage\GenericStackable $provisioners ) : void Injects the storage for the provisioners.
isConnected ( ) : boolean TRUE if the application has been connected, else FALSE.
newService ( string $className ) : object (non-PHPdoc)
prepare ( AppserverIo\Appserver\Core\Interfaces\ContainerInterface $container, ContextNode $context ) : void Prepares the application with the specific data found in the passed context node.
provision ( ) : void Provisions the initialized application.
registerClassLoaders ( ) : void Registers all class loaders injected to the applications in the opposite order as they have been injected.
run ( ) : void This is the threads main() method that initializes the application with the autoloader and instantiates all the necessary manager instances.
search ( string $name, array $args = [] ) : mixed Queries the naming directory for the requested name and returns the value or invokes the bound callback.
shutdown ( ) : void Shutdown function to log unexpected errors.
stop ( ) : void Stops the application instance.
unload ( ) : void Cleanup the naming directory from the application entries.

메소드 상세

__construct() 공개 메소드

Initialize the internal members.
public __construct ( )

addClassLoader() 공개 메소드

Injects an additional class loader.
public addClassLoader ( AppserverIo\Appserver\Core\Interfaces\ClassLoaderInterface $classLoader, AppserverIo\Appserver\Core\Api\Node\ClassLoaderNodeInterface $configuration ) : void
$classLoader AppserverIo\Appserver\Core\Interfaces\ClassLoaderInterface A class loader to put on the class loader stack
$configuration AppserverIo\Appserver\Core\Api\Node\ClassLoaderNodeInterface The class loader's configuration
리턴 void

addLogger() 공개 메소드

Injects the logger instance and the configuration.
public addLogger ( Psr\Log\LoggerInterface $logger, AppserverIo\Appserver\Core\Api\Node\LoggerNodeInterface $configuration ) : void
$logger Psr\Log\LoggerInterface A provisioner instance
$configuration AppserverIo\Appserver\Core\Api\Node\LoggerNodeInterface The provisioner configuration
리턴 void

addManager() 공개 메소드

Injects manager instance and the configuration.
public addManager ( AppserverIo\Psr\Application\ManagerInterface $manager, AppserverIo\Appserver\Core\Api\Node\ManagerNodeInterface $configuration ) : void
$manager AppserverIo\Psr\Application\ManagerInterface A manager instance
$configuration AppserverIo\Appserver\Core\Api\Node\ManagerNodeInterface The managers configuration
리턴 void

addProvisioner() 공개 메소드

Injects the provisioner instance and the configuration.
public addProvisioner ( AppserverIo\Psr\Application\ProvisionerInterface $provisioner, AppserverIo\Appserver\Core\Api\Node\ProvisionerNodeInterface $configuration ) : void
$provisioner AppserverIo\Psr\Application\ProvisionerInterface A provisioner instance
$configuration AppserverIo\Appserver\Core\Api\Node\ProvisionerNodeInterface The provisioner configuration
리턴 void

connect() 공개 메소드

Has been automatically invoked by the container after the application instance has been created.
또한 보기: Thread::run()
public connect ( ) : void
리턴 void

getAppBase() 공개 메소드

Returns the absolute path to the applications base directory.
public getAppBase ( ) : string
리턴 string The app base directory

getBaseDirectory() 공개 메소드

Returns the absolute path to the servers document root directory
public getBaseDirectory ( string $directoryToAppend = null ) : string
$directoryToAppend string The directory to append to the base directory
리턴 string The base directory with appended dir if given

getCacheDir() 공개 메소드

Returns the absolute path to the applications cache directory.
public getCacheDir ( ) : string
리턴 string The app cache directory

getClassLoader() 공개 메소드

Return the requested class loader instance
public getClassLoader ( string $identifier ) : AppserverIo\Appserver\Core\Interfaces\ClassLoaderInterface
$identifier string The unique identifier of the requested class loader
리턴 AppserverIo\Appserver\Core\Interfaces\ClassLoaderInterface The class loader instance

getClassLoaders() 공개 메소드

Return the class loaders.
public getClassLoaders ( ) : AppserverIo\Storage\GenericStackable
리턴 AppserverIo\Storage\GenericStackable The class loader instances

getContainer() 공개 메소드

Return's the container instance the application is bound to.
public getContainer ( ) : AppserverIo\Appserver\Core\Interfaces\ContainerInterface
리턴 AppserverIo\Appserver\Core\Interfaces\ContainerInterface The container instance

getContainerName() 공개 메소드

Returns the name of the container the application is bound to.
public getContainerName ( ) : string
리턴 string The container's name

getContainerRunlevel() 공개 메소드

Returns the runlevel of the container the application is bound to.
public getContainerRunlevel ( ) : string
리턴 string The container's runlevel

getEnvironmentName() 공개 메소드

Returns the applications environment name
public getEnvironmentName ( ) : string
리턴 string The applications environment name

getGroup() 공개 메소드

Returns the groupname the application should be executed with.
public getGroup ( ) : string
리턴 string The groupname

getInitialContext() 공개 메소드

Returns the initial context instance.
public getInitialContext ( ) : AppserverIo\Appserver\Application\Interfaces\ContextInterface
리턴 AppserverIo\Appserver\Application\Interfaces\ContextInterface The initial Context

getLogger() 공개 메소드

Return the requested logger instance, by default the application's system logger.
public getLogger ( string $name = LoggerUtils::SYSTEM ) : Psr\Log\LoggerInterface | null
$name string The name of the requested logger
리턴 Psr\Log\LoggerInterface | null The logger instance

getLoggers() 공개 메소드

Returns the logger instances.
public getLoggers ( ) : AppserverIo\Storage\GenericStackable
리턴 AppserverIo\Storage\GenericStackable The logger instances

getManager() 공개 메소드

Return the requested manager instance.
public getManager ( string $identifier ) : AppserverIo\Psr\Application\ManagerInterface
$identifier string The unique identifier of the requested manager
리턴 AppserverIo\Psr\Application\ManagerInterface The manager instance

getManagers() 공개 메소드

Returns the manager instances.
public getManagers ( ) : AppserverIo\Storage\GenericStackable
리턴 AppserverIo\Storage\GenericStackable The manager instances

getName() 공개 메소드

Returns the application name (that has to be the class namespace, e.g. example)
public getName ( ) : string
리턴 string The application name

getNamingDirectory() 공개 메소드

Returns the applications naming directory.
public getNamingDirectory ( ) : AppserverIo\Psr\Naming\NamingDirectoryInterface
리턴 AppserverIo\Psr\Naming\NamingDirectoryInterface The applications naming directory interface

getProvisioner() 공개 메소드

Return the requested provisioner instance.
public getProvisioner ( string $identifier ) : AppserverIo\Psr\Application\ProvisionerInterface
$identifier string The unique identifier of the requested provisioner
리턴 AppserverIo\Psr\Application\ProvisionerInterface The provisioner instance

getProvisioners() 공개 메소드

Returns the provisioner instances.
public getProvisioners ( ) : AppserverIo\Storage\GenericStackable
리턴 AppserverIo\Storage\GenericStackable The provisioner instances

getSerial() 공개 메소드

Return's the application's UUID.
public getSerial ( ) : string
리턴 string The application's UUID

getSessionDir() 공개 메소드

Returns the absolute path to the applications session directory.
public getSessionDir ( ) : string
리턴 string The app session directory

getTmpDir() 공개 메소드

Returns the absolute path to the applications temporary directory.
public getTmpDir ( ) : string
리턴 string The app temporary directory

getUmask() 공개 메소드

Returns the umask the application should create files/directories with.
public getUmask ( ) : string
리턴 string The umask

getUniqueName() 공개 메소드

Return's the unique application name that is the container + application name separated with a slash, e. g. combined-appserver/example.
public getUniqueName ( ) : string
리턴 string

getUser() 공개 메소드

Returns the username the application should be executed with.
public getUser ( ) : string
리턴 string The username

getWebappPath() 공개 메소드

Returns the absolute path to the web application base directory.
public getWebappPath ( ) : string
리턴 string The path to the webapps folder

initializeManagers() 공개 메소드

Registers all managers in the application.
public initializeManagers ( ) : void
리턴 void

injectClassLoaders() 공개 메소드

Injects the storage for the class loaders.
public injectClassLoaders ( AppserverIo\Storage\GenericStackable $classLoaders ) : void
$classLoaders AppserverIo\Storage\GenericStackable The storage for the class loaders
리턴 void

injectContainerName() 공개 메소드

Injects the name of the container the application is bound to.
public injectContainerName ( string $containerName ) : void
$containerName string The container's name
리턴 void

injectContainerRunlevel() 공개 메소드

Injects the runlevel of the container the application is bound to.
public injectContainerRunlevel ( string $containerRunlevel ) : void
$containerRunlevel string The container's runlevel
리턴 void

injectEnvironmentName() 공개 메소드

Inject the environment name
public injectEnvironmentName ( string $environmentName ) : void
$environmentName string The environment name to inject
리턴 void

injectInitialContext() 공개 메소드

The initial context instance.
public injectInitialContext ( AppserverIo\Appserver\Application\Interfaces\ContextInterface $initialContext ) : void
$initialContext AppserverIo\Appserver\Application\Interfaces\ContextInterface The initial context instance
리턴 void

injectLoggers() 공개 메소드

Injects the storage for the loggers.
public injectLoggers ( AppserverIo\Storage\GenericStackable $loggers ) : void
$loggers AppserverIo\Storage\GenericStackable The storage for the loggers
리턴 void

injectManagers() 공개 메소드

Injects the storage for the managers.
public injectManagers ( AppserverIo\Storage\GenericStackable $managers ) : void
$managers AppserverIo\Storage\GenericStackable The storage for the managers
리턴 void

injectName() 공개 메소드

Injects the application name.
public injectName ( string $name ) : void
$name string The application name
리턴 void

injectNamingDirectory() 공개 메소드

Injects the naming directory.
public injectNamingDirectory ( AppserverIo\Psr\Naming\NamingDirectoryInterface $namingDirectory ) : void
$namingDirectory AppserverIo\Psr\Naming\NamingDirectoryInterface The naming directory instance
리턴 void

injectProvisioners() 공개 메소드

Injects the storage for the provisioners.
public injectProvisioners ( AppserverIo\Storage\GenericStackable $provisioners ) : void
$provisioners AppserverIo\Storage\GenericStackable The storage for the provisioners
리턴 void

isConnected() 공개 메소드

TRUE if the application has been connected, else FALSE.
public isConnected ( ) : boolean
리턴 boolean Returns TRUE if the application has been connected, else FALSE

newService() 공개 메소드

(non-PHPdoc)
또한 보기: AppserverIo\Appserver\Application\Interfaces\ContextInterface::newService()
public newService ( string $className ) : object
$className string The API service class name to return the instance for
리턴 object The service instance

prepare() 공개 메소드

Prepares the application with the specific data found in the passed context node.
public prepare ( AppserverIo\Appserver\Core\Interfaces\ContainerInterface $container, ContextNode $context ) : void
$container AppserverIo\Appserver\Core\Interfaces\ContainerInterface The container instance bind the application to
$context AppserverIo\Appserver\Core\Api\Node\ContextNode The application configuration
리턴 void

provision() 공개 메소드

Provisions the initialized application.
public provision ( ) : void
리턴 void

registerClassLoaders() 공개 메소드

Registers all class loaders injected to the applications in the opposite order as they have been injected.
public registerClassLoaders ( ) : void
리턴 void

run() 공개 메소드

This is the threads main() method that initializes the application with the autoloader and instantiates all the necessary manager instances.
public run ( ) : void
리턴 void

shutdown() 공개 메소드

Shutdown function to log unexpected errors.
또한 보기: http://php.net/register_shutdown_function
public shutdown ( ) : void
리턴 void

stop() 공개 메소드

Stops the application instance.
public stop ( ) : void
리턴 void

unload() 공개 메소드

Cleanup the naming directory from the application entries.
public unload ( ) : void
리턴 void