1 23 24 29 30 package com.sun.enterprise.tools.upgrade.common ; 31 32 36 37 import java.util.*; 38 39 public class UpdateProgressManager { 40 41 private java.util.Vector upgradeUpdateListeners = null; 42 private static UpdateProgressManager updateProgressManager = null; 43 44 private boolean continueUpgrade = true; 48 49 50 private UpdateProgressManager() { 51 upgradeUpdateListeners = new java.util.Vector (); 52 } 53 public static UpdateProgressManager getProgressManager(){ 54 if(updateProgressManager == null) 55 updateProgressManager = new UpdateProgressManager(); 56 return updateProgressManager; 57 } 58 public void addUpgradeUpdateListener(UpgradeUpdateListener listener){ 59 this.upgradeUpdateListeners.addElement(listener); 60 } 61 public void removeUpgradeUpdateListener(UpgradeUpdateListener listener){ 62 this.upgradeUpdateListeners.removeElement(listener); 63 } 64 67 public void processUpgradeUpdateEvent(int progressState){ 68 UpgradeUpdateEvent de = new UpgradeUpdateEvent(this, progressState); 69 de.setProgressState(progressState); 70 for(int i=0 ; i<this.upgradeUpdateListeners.size(); i++){ 71 ((UpgradeUpdateListener)upgradeUpdateListeners.elementAt(i)).upgradeProcessUpdate(de); 72 } 73 } 74 public void setContinueUpgrade(boolean state){ 75 this.continueUpgrade = state; 76 } 77 public boolean canContinueUpgrade(){ 78 return this.continueUpgrade; 79 } 80 81 } 82 | Popular Tags |