public static function factory(
        ApplicationServerInterface $applicationServer,
        ContainerConfigurationInterface $configuration,
        $runlevel = ApplicationServerInterface::NETWORK
    ) {

        // create a new reflection class instance
        $reflectionClass = new \ReflectionClass($configuration->getType());

        // initialize the container configuration with the base directory and pass it to the thread
        $params = array($applicationServer->getInitialContext(), $applicationServer->getNamingDirectory(), $configuration, $applicationServer->runlevelToString($runlevel));

        // create, initialize and return the container instance
        return $reflectionClass->newInstanceArgs($params);
    }
public static function factory(
        ApplicationServerInterface $applicationServer,
        ContainerConfigurationInterface $configuration,
        $runlevel = ApplicationServerInterface::NETWORK
    ) {

        // create a new reflection class instance
        $reflectionClass = new \ReflectionClass($configuration->getType());

        // initialize the container configuration with the base directory and pass it to the thread
        $params = array($applicationServer->getInitialContext(), $applicationServer->getNamingDirectory(), $configuration, $applicationServer->runlevelToString($runlevel));

        // create, initialize and return the container instance
        return $reflectionClass->newInstanceArgs($params);
    }
public static function factory ( ApplicationServerInterface $ applicationServer , ContainerConfigurationInterface $ configuration , $ runlevel = ApplicationServerInterface :: NETWORK ) { // create a new reflection class instance $ reflectionClass = new \ ReflectionClass ( $ configuration -> getType ( ) ) ; // initialize the container configuration with the base directory and pass it to the thread $ params = array ( $ applicationServer -> getInitialContext ( ) , $ applicationServer -> getNamingDirectory ( ) , $ configuration , $ applicationServer -> runlevelToString ( $ runlevel ) ) ; // create, initialize and return the container instance return $ reflectionClass -> newInstanceArgs ( $ params ) ; }
Factory method to create a new container instance.

@param \AppserverIo\Psr\ApplicationServer\ApplicationServerInterface                    $applicationServer The application instance to register the class loader with
@param \AppserverIo\Psr\ApplicationServer\Configuration\ContainerConfigurationInterface $configuration     The class loader configuration
@param integer                                                                          $runlevel          The runlevel the container has been started in

@return void
Factory method to create a new container instance .