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 LifeCycleMethod 20 { 21 22 protected final Kernel kernel; 23 24 protected LifeCycleMethod(Kernel kernel) 25 { 26 this.kernel = kernel; 27 } 28 29 protected void invokeOnDependsOnMe(Entry entry) 30 { 31 for (Iterator i = entry.dependsOnMe.iterator(); i.hasNext();) 53 { 54 ServiceID dependsOnMeID = (ServiceID)i.next(); 55 Entry dependsOnMeEntry = kernel.getEntry(dependsOnMeID); 56 try 57 { 58 invokeMethodOnDependsOnMe(dependsOnMeEntry); 59 } 60 catch (KernelException e) 61 { 62 Throwable t = e; 64 while (t.getCause() != null) 65 { 66 t = t.getCause(); 67 } 68 dependsOnMeEntry.log.error("Exception occured when invoking nested lifecycle method", t); 69 } 70 } 71 } 72 73 public abstract State invoke(Entry entry) throws TransitionNotPossibleException, ServiceFailureException; 74 75 79 protected abstract void checkState(Entry entry) throws TransitionNotPossibleException; 80 81 85 protected abstract void invokeMethod(Entry entry) throws Exception ; 86 87 91 protected abstract void invokeMethodOnDependsOnMe(Entry entry) throws KernelException; 92 } 93 | Popular Tags |