AppserverIo\Appserver\Core\Scanner\AbstractScanner::__construct PHP Method

__construct() public method

Constructor sets initialContext object per default and calls init function to pass other args.
public __construct ( AppserverIo\Appserver\Application\Interfaces\ContextInterface $initialContext, string $name )
$initialContext AppserverIo\Appserver\Application\Interfaces\ContextInterface The initial context instance
$name string The unique scanner name from the configuration
    public function __construct($initialContext, $name)
    {
        // invoke parent constructor
        parent::__construct($initialContext);
        // set the unique scanner name
        $this->name = $name;
    }

Usage Example

Example #1
0
 /**
  * Constructor sets initialContext object per default and calls
  * init function to pass other args.
  *
  * @param \AppserverIo\Appserver\Application\Interfaces\ContextInterface $initialContext The initial context instance
  * @param string                                                         $name           The unique scanner name from the configuration
  * @param integer                                                        $interval       The interval in seconds we want to execute the configured jobs
  */
 public function __construct($initialContext, $name, $interval = 1)
 {
     // call parent constructor
     parent::__construct($initialContext, $name);
     // initialize the members
     $this->interval = $interval;
     // immediately start the scanner
     $this->start();
 }
All Usage Examples Of AppserverIo\Appserver\Core\Scanner\AbstractScanner::__construct