1 9 package org.jboss.portal.server.kernel; 10 11 import java.util.Iterator ; 12 13 import org.jboss.portal.server.kernel.state.State; 14 15 19 public abstract class UpgradeMethod extends LifeCycleMethod 20 { 21 22 protected UpgradeMethod(Kernel kernel) 23 { 24 super(kernel); 25 } 26 27 public State invoke(Entry entry) throws TransitionNotPossibleException, ServiceFailureException 28 { 29 checkState(entry); 31 32 for (Iterator i = entry.depends.iterator();i.hasNext();) 34 { 35 ServiceID dependOnID = (ServiceID)i.next(); 36 Entry dependOnEntry = kernel.getEntry(dependOnID); 37 if (doesDependantPreventsInvoke(dependOnEntry)) 38 { 39 return entry.getState(); 40 } 41 } 42 43 try 44 { 45 invokeMethod(entry); 47 48 invokeOnDependsOnMe(entry); 50 51 return entry.getState(); 53 } 54 catch (Exception e) 55 { 56 entry.machine.fail(false); 58 throw new ServiceFailureException(e); 59 } 60 } 61 62 67 protected abstract boolean doesDependantPreventsInvoke(Entry entry); 68 } 69 | Popular Tags |