Package com.vmware.aurora.vc.vcevent.VcEventHandlers

Examples of com.vmware.aurora.vc.vcevent.VcEventHandlers.TaskFinishedEvent


   private void fireTaskFinishedEventHandlers(ManagedObjectReference taskMoRef,
                                              TaskInfo.State state)
   throws Exception {
      VcEventHandlers handlers = VcEventHandlers.getInstance();
      /* Create and fire TaskFinished pseudo-event. */
      TaskFinishedEvent taskEvent = handlers.new TaskFinishedEvent(taskMoRef, state);
      handlers.fire(taskEvent);
      dispatchedTaskCount++;    // stats only, unlocked ok.
   }
View Full Code Here


       * @param  taskEvent instance of TaskFinishedEvent
       * @return boolean   true for aurora tasks
       * @throws Exception
       */
      public boolean eventHandler(VcEventType type, Event taskEvent) throws Exception {
         TaskFinishedEvent event = (TaskFinishedEvent)taskEvent;
         ManagedObjectReference taskMoRef = event.getTaskMoRef();
         VcTask task = taskFinished(taskMoRef);

         if (task == null) {
            /* Repeat the check with the write lock. */
            rwLock.writeLock().lock();
            task = taskFinished(taskMoRef);
            rwLock.writeLock().unlock();
         }
         if (task != null) {
            logger.info("Task completed: " + task.getType() + " " + task.getMoRef().getValue());
            task.taskNotify(event.getTaskState());
         } else {
            logger.debug("Foreign task: " + taskMoRef);
         }
         return task != null;
      }
View Full Code Here

TOP

Related Classes of com.vmware.aurora.vc.vcevent.VcEventHandlers.TaskFinishedEvent

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.