예제 #1
0
 /**
  * Creates a new singleton application server instance.
  *
  * @param \AppserverIo\Psr\Naming\NamingDirectoryInterface $configurationFilename The default naming directory
  * @param \AppserverIo\Storage\GenericStackable            $runlevels             The storage for the services
  *
  * @return \AppserverIo\Appserver\Core\Interfaces\ApplicationServerInterface The singleton application instance
  */
 public static function singleton(NamingDirectoryInterface $namingDirectory, GenericStackable $runlevels)
 {
     // query whether we already have an instance or not
     if (ApplicationServer::$instance == null) {
         // initialize and start the application server
         ApplicationServer::$instance = new ApplicationServer($namingDirectory, $runlevels);
         ApplicationServer::$instance->start();
     }
     // return the instance
     return ApplicationServer::$instance;
 }