示例#1
0
 /**
  * Performs PhaseListener processing and invokes the execute method
  * of the Phase.
  * @param blaze\web\application\BlazeContext $context the FacesContext for the current request
  * @param blaze\web\lifecycle\Lifecycle $lifecycle the lifecycle for this request
  * @param array[blaze\web\event\PhaseListener] $listeners
  */
 public function doPhase(BlazeContext $context, Lifecycle $lifecycle, \blaze\collections\Map $listeners)
 {
     $context->setCurrentPhaseId($this->getId());
     $event = null;
     if ($listeners->count() != 0) {
         $event = new PhaseEvent($context, $this->getId(), $lifecycle);
     }
     // start timing - include before and after phase processing
     //        Timer timer = Timer.getInstance();
     //        if (timer != null) {
     //            timer.startTiming();
     //        }
     try {
         if ($event != null) {
             $this->handleBeforePhase($context, $listeners, $event);
         }
         if (!$this->shouldSkip($context)) {
             $this->execute($context);
         }
     } catch (Exception $e) {
         $this->queueException($context, $e);
     }
     try {
         if ($event != null) {
             $this->handleAfterPhase($context, $listeners, $event);
         }
     } catch (Exception $e) {
         $this->queueException($context, $e);
     }
     // stop timing
     //            if (timer != null) {
     //                timer.stopTiming();
     //                timer.logResult(
     //                      "Execution time for phase (including any PhaseListeners) -> "
     //                      + this.getId().toString());
     //            }
     //$context->getExceptionHandler()->handle();
 }
 public function getIterator()
 {
     return $this->map->getIterator();
 }
示例#3
0
 public function retainAll(\blaze\collections\Map $obj)
 {
     foreach ($this as $key => $val) {
         if (!$obj->containsKey($key)) {
             $this->remove($key);
         }
     }
 }