PHP Class AppserverIo\Appserver\Core\InitialContext

Inheritance: implements AppserverIo\Appserver\Application\Interfaces\ContextInterface
Mostrar archivo Open project: appserver-io/appserver Class Usage Examples

Protected Properties

Property Type Description
$classLoader AppserverIo\Appserver\Core\SplClassLoader The server's classLoading instance
$storage AppserverIo\Storage\StorageInterface The storage instance
$systemLogger Psr\Log\LoggerInterface The server's system logger instance.

Public Methods

Method Description
__construct ( AppserverIo\Appserver\Core\Interfaces\SystemConfigurationInterface $systemConfiguration ) Initializes the context with the connection to the storage backend.
getAttribute ( string $key ) : mixed Returns the value with the passed key from the initial context.
getLogger ( string $loggerName ) : Psr\Log\LoggerInterface | null Gets the logger by given name
getLoggers ( ) : array Return
getStorage ( ) : AppserverIo\Storage\StorageInterface Returns the storage instance.
getSystemConfiguration ( ) : AppserverIo\Appserver\Core\Interfaces\SystemConfigurationInterface Returns the system configuration.
getSystemLogger ( ) : Psr\Log\LoggerInterface Returns the system logger instance.
newInstance ( string $className, array $args = [] ) : object Returns a new instance of the passed class name.
newReflectionClass ( string $className ) : ReflectionClass Returns a reflection class instance for the passed class name.
newService ( string $className ) : AppserverIo\Appserver\Core\Api\ServiceInterface Returns a new instance of the passed API service.
removeAttribute ( string $key ) : void Removes the attribute with the passed key from the initial context.
setAttribute ( string $key, mixed $value ) : void Stores the passed key value pair in the initial context.
setLoggers ( array $loggers ) : void Set's logger array
setStorage ( AppserverIo\Storage\StorageInterface $storage ) : AppserverIo\Storage\StorageInterface Returns the storage instance.
setSystemConfiguration ( AppserverIo\Appserver\Core\Interfaces\SystemConfigurationInterface $systemConfiguration ) : void Adds the system configuration to the initial context.
setSystemLogger ( Psr\Log\LoggerInterface $systemLogger ) : void Set's the system logger instance.

Method Details

__construct() public method

Initializes the context with the connection to the storage backend.
public __construct ( AppserverIo\Appserver\Core\Interfaces\SystemConfigurationInterface $systemConfiguration )
$systemConfiguration AppserverIo\Appserver\Core\Interfaces\SystemConfigurationInterface The system configuration

getAttribute() public method

Returns the value with the passed key from the initial context.
public getAttribute ( string $key ) : mixed
$key string The key of the value to return
return mixed The value stored in the initial context

getLogger() public method

Gets the logger by given name
public getLogger ( string $loggerName ) : Psr\Log\LoggerInterface | null
$loggerName string the loggers name
return Psr\Log\LoggerInterface | null The logger instance

getLoggers() public method

Return
public getLoggers ( ) : array
return array

getStorage() public method

Returns the storage instance.
public getStorage ( ) : AppserverIo\Storage\StorageInterface
return AppserverIo\Storage\StorageInterface The storage instance

getSystemConfiguration() public method

Returns the system configuration.
public getSystemConfiguration ( ) : AppserverIo\Appserver\Core\Interfaces\SystemConfigurationInterface
return AppserverIo\Appserver\Core\Interfaces\SystemConfigurationInterface The system configuration

getSystemLogger() public method

Returns the system logger instance.
public getSystemLogger ( ) : Psr\Log\LoggerInterface
return Psr\Log\LoggerInterface

newInstance() public method

Returns a new instance of the passed class name.
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
return object The instance itself

newReflectionClass() public method

Returns a reflection class instance for the passed class name.
public newReflectionClass ( string $className ) : ReflectionClass
$className string The class name to return the reflection instance for
return ReflectionClass The reflection instance

newService() public method

Returns a new instance of the passed API service.
public newService ( string $className ) : AppserverIo\Appserver\Core\Api\ServiceInterface
$className string The API service class name to return the instance for
return AppserverIo\Appserver\Core\Api\ServiceInterface The service instance

removeAttribute() public method

Removes the attribute with the passed key from the initial context.
public removeAttribute ( string $key ) : void
$key string The key of the value to delete
return void

setAttribute() public method

Stores the passed key value pair in the initial context.
public setAttribute ( string $key, mixed $value ) : void
$key string The key to store the value under
$value mixed The value to add to the initial context
return void

setLoggers() public method

Set's logger array
public setLoggers ( array $loggers ) : void
$loggers array The loggers array to set
return void

setStorage() public method

Returns the storage instance.
public setStorage ( AppserverIo\Storage\StorageInterface $storage ) : AppserverIo\Storage\StorageInterface
$storage AppserverIo\Storage\StorageInterface A storage instance
return AppserverIo\Storage\StorageInterface The storage instance

setSystemConfiguration() public method

Adds the system configuration to the initial context.
public setSystemConfiguration ( AppserverIo\Appserver\Core\Interfaces\SystemConfigurationInterface $systemConfiguration ) : void
$systemConfiguration AppserverIo\Appserver\Core\Interfaces\SystemConfigurationInterface The system configuration
return void

setSystemLogger() public method

Set's the system logger instance.
public setSystemLogger ( Psr\Log\LoggerInterface $systemLogger ) : void
$systemLogger Psr\Log\LoggerInterface The system logger
return void

Property Details

$classLoader protected_oe property

The server's classLoading instance
protected SplClassLoader,AppserverIo\Appserver\Core $classLoader
return AppserverIo\Appserver\Core\SplClassLoader

$storage protected_oe property

The storage instance
protected StorageInterface,AppserverIo\Storage $storage
return AppserverIo\Storage\StorageInterface

$systemLogger protected_oe property

The server's system logger instance.
protected LoggerInterface,Psr\Log $systemLogger
return Psr\Log\LoggerInterface