PHP Class AppserverIo\Appserver\DependencyInjectionContainer\Provider

Inheritance: extends AppserverIo\Storage\GenericStackable, implements AppserverIo\Appserver\DependencyInjectionContainer\Interfaces\ProviderInterface
Show file Open project: appserver-io/appserver Class Usage Examples

Public Methods

Method Description
getApplication ( ) : AppserverIo\Psr\Application\ApplicationInterface Returns the application instance.
getAttribute ( string $key ) : mixed Returns the value with the passed name from the context.
getIdentifier ( ) : string The managers unique identifier.
getInitialContext ( ) : AppserverIo\Psr\Naming\InitialContext Returns the naming context instance.
getNamingDirectory ( ) : AppserverIo\Psr\Naming\NamingDirectoryInterface Returns the applications naming directory.
getReflectionClass ( string $className ) : AppserverIo\Lang\Reflection\ReflectionClass Returns a new reflection class intance for the passed class name.
getReflectionClassForObject ( object $instance ) : AppserverIo\Lang\Reflection\ReflectionClass Returns a reflection class intance for the passed class name.
initialize ( AppserverIo\Psr\Application\ApplicationInterface $application ) : void Has been automatically invoked by the container after the application instance has been created.
injectApplication ( AppserverIo\Psr\Application\ApplicationInterface $application ) : void The application instance.
injectDependencies ( object $instance, string | null $sessionId = null ) : void Injects the dependencies of the passed instance.
injectNamingDirectoryAliases ( AppserverIo\Storage\GenericStackable $namingDirectoryAliases ) : void Injects the naming directory aliases.
injectReflectionClasses ( AppserverIo\Storage\GenericStackable $reflectionClasses ) : void Injects the storage for the loaded reflection classes.
newAnnotationInstance ( AppserverIo\Lang\Reflection\AnnotationInterface $annotation ) : AppserverIo\Lang\Reflection\AnnotationInterface Creates a new new instance of the annotation type, defined in the passed reflection annotation.
newInstance ( string $className, string | null $sessionId = null, array $args = [] ) : object Returns a new instance of the passed class name.
newReflectionClass ( string $className ) : AppserverIo\Lang\Reflection\ReflectionClass Returns a reflection class instance for the passed class name.
setReflectionClass ( AppserverIo\Lang\Reflection\ClassInterface $reflectionClass ) : void Adds the passe reflection class instance to the DI provider.

Method Details

getApplication() public method

Returns the application instance.
public getApplication ( ) : AppserverIo\Psr\Application\ApplicationInterface
return AppserverIo\Psr\Application\ApplicationInterface The application instance

getAttribute() public method

Returns the value with the passed name from the context.
public getAttribute ( string $key ) : mixed
$key string The key of the value to return from the context.
return mixed The requested attribute

getIdentifier() public method

The managers unique identifier.
See also: AppserverIo\Psr\Application\ManagerInterface::getIdentifier()
public getIdentifier ( ) : string
return string The unique identifier

getInitialContext() public method

Returns the naming context instance.
public getInitialContext ( ) : AppserverIo\Psr\Naming\InitialContext
return AppserverIo\Psr\Naming\InitialContext The naming context instance

getNamingDirectory() public method

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

getReflectionClass() public method

Returns a new reflection class intance for the passed class name.
public getReflectionClass ( string $className ) : AppserverIo\Lang\Reflection\ReflectionClass
$className string The class name to return the reflection class instance for
return AppserverIo\Lang\Reflection\ReflectionClass The reflection instance

getReflectionClassForObject() public method

Returns a reflection class intance for the passed class name.
See also: DependencyInjectionContainer\Interfaces\ProviderInterface::newReflectionClass()
See also: DependencyInjectionContainer\Interfaces\ProviderInterface::getReflectionClass()
public getReflectionClassForObject ( object $instance ) : AppserverIo\Lang\Reflection\ReflectionClass
$instance object The instance to return the reflection class instance for
return AppserverIo\Lang\Reflection\ReflectionClass The reflection instance

initialize() public method

Has been automatically invoked by the container after the application instance has been created.
See also: AppserverIo\Psr\Application\ManagerInterface::initialize()
public initialize ( AppserverIo\Psr\Application\ApplicationInterface $application ) : void
$application AppserverIo\Psr\Application\ApplicationInterface The application instance
return void

injectApplication() public method

The application instance.
public injectApplication ( AppserverIo\Psr\Application\ApplicationInterface $application ) : void
$application AppserverIo\Psr\Application\ApplicationInterface The application instance
return void

injectDependencies() public method

Injects the dependencies of the passed instance.
public injectDependencies ( object $instance, string | null $sessionId = null ) : void
$instance object The instance to inject the dependencies for
$sessionId string | null The session-ID, necessary to inject stateful session beans (SFBs)
return void

injectNamingDirectoryAliases() public method

Injects the naming directory aliases.
public injectNamingDirectoryAliases ( AppserverIo\Storage\GenericStackable $namingDirectoryAliases ) : void
$namingDirectoryAliases AppserverIo\Storage\GenericStackable The naming directory aliases
return void

injectReflectionClasses() public method

Injects the storage for the loaded reflection classes.
public injectReflectionClasses ( AppserverIo\Storage\GenericStackable $reflectionClasses ) : void
$reflectionClasses AppserverIo\Storage\GenericStackable The storage for the reflection classes
return void

newAnnotationInstance() public method

Creates a new new instance of the annotation type, defined in the passed reflection annotation.
public newAnnotationInstance ( AppserverIo\Lang\Reflection\AnnotationInterface $annotation ) : AppserverIo\Lang\Reflection\AnnotationInterface
$annotation AppserverIo\Lang\Reflection\AnnotationInterface The reflection annotation we want to create the instance for
return AppserverIo\Lang\Reflection\AnnotationInterface The real annotation instance

newInstance() public method

Returns a new instance of the passed class name.
public newInstance ( string $className, string | null $sessionId = null, array $args = [] ) : object
$className string The fully qualified class name to return the instance for
$sessionId string | null The session-ID, necessary to inject stateful session beans (SFBs)
$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 ) : AppserverIo\Lang\Reflection\ReflectionClass
$className string The class name to return the reflection instance for
return AppserverIo\Lang\Reflection\ReflectionClass The reflection instance

setReflectionClass() public method

Adds the passe reflection class instance to the DI provider.
public setReflectionClass ( AppserverIo\Lang\Reflection\ClassInterface $reflectionClass ) : void
$reflectionClass AppserverIo\Lang\Reflection\ClassInterface The reflection class instance to add
return void