1 17 package org.apache.geronimo.system.main; 18 19 import java.util.Iterator ; 20 import java.util.Set ; 21 22 import org.apache.commons.logging.Log; 23 import org.apache.commons.logging.LogFactory; 24 import org.apache.geronimo.gbean.AbstractName; 25 import org.apache.geronimo.gbean.AbstractNameQuery; 26 import org.apache.geronimo.kernel.GBeanNotFoundException; 27 import org.apache.geronimo.kernel.Kernel; 28 import org.apache.geronimo.kernel.management.State; 29 import org.apache.geronimo.kernel.repository.Artifact; 30 31 34 public class SilentStartupMonitor implements StartupMonitor { 35 private final static Log log = LogFactory.getLog(SilentStartupMonitor.class.getName()); 36 37 private Kernel kernel; 38 39 public void systemStarting(long startTime) { 40 } 41 42 public void systemStarted(Kernel kernel) { 43 this.kernel = kernel; 44 } 45 46 public void foundModules(Artifact[] modules) { 47 } 48 49 public void moduleLoading(Artifact module) { 50 } 51 52 public void moduleLoaded(Artifact module) { 53 } 54 55 public void moduleStarting(Artifact module) { 56 } 57 58 public void moduleStarted(Artifact module) { 59 } 60 61 public void startupFinished() { 62 try { 63 Set gbeans = kernel.listGBeans((AbstractNameQuery)null); 64 for (Iterator it = gbeans.iterator(); it.hasNext();) { 65 AbstractName name = (AbstractName) it.next(); 66 int state = kernel.getGBeanState(name); 67 if (state != State.RUNNING_INDEX) { 68 log.warn("Unable to start "+name+" ("+State.fromInt(state).getName()+")"); 69 } 70 } 71 } catch (GBeanNotFoundException e) { 72 } 73 System.out.println("Geronimo startup complete"); 74 } 75 76 public void serverStartFailed(Exception problem) { 77 System.out.println("Geronimo startup failed:"); 78 problem.printStackTrace(System.out); 79 } 80 81 } 82 | Popular Tags |