1 22 package org.jboss.kernel.plugins.bootstrap; 23 24 import org.jboss.kernel.Kernel; 25 import org.jboss.kernel.KernelFactory; 26 import org.jboss.kernel.plugins.AbstractKernelObject; 27 import org.jboss.kernel.spi.config.KernelConfig; 28 29 36 public abstract class AbstractBootstrap extends AbstractKernelObject implements Runnable 37 { 38 39 protected KernelConfig config; 40 41 45 protected Kernel kernel; 46 47 50 public AbstractBootstrap() 51 { 52 } 53 54 59 public KernelConfig getConfig() 60 { 61 Kernel.checkAccess(); 62 return config; 63 } 64 65 70 public void setConfig(KernelConfig config) 71 { 72 Kernel.checkConfigure(); 73 this.config = config; 74 } 75 76 80 public Kernel getKernel() 81 { 82 return this.kernel; 83 } 84 85 public void run() 86 { 87 try 88 { 89 bootstrap(); 90 } 91 catch (RuntimeException e) 92 { 93 log.trace("RuntimeException during JBoss Kernel Bootstrap.", e); 94 throw e; 95 } 96 catch (Exception e) 97 { 98 log.trace("Exception during JBoss Kernel Bootstrap.", e); 99 throw new RuntimeException ("Exception during Bootstrap", e); 100 } 101 catch (Error e) 102 { 103 log.trace("Error during JBoss Kernel Bootstrap.", e); 104 throw e; 105 } 106 catch (Throwable t) 107 { 108 log.trace("Error during JBoss Kernel Bootstrap.", t); 109 throw new RuntimeException ("Error during Bootstrap", t); 110 } 111 } 112 113 118 protected void bootstrap() throws Throwable 119 { 120 kernel = KernelFactory.newInstance(config); 121 } 122 } 123 | Popular Tags |