1 22 package org.jboss.kernel.plugins.config; 23 24 import org.jboss.kernel.spi.config.KernelConfig; 25 import org.jboss.kernel.plugins.config.property.PropertyKernelConfig; 26 27 import java.util.Properties ; 28 29 37 public class KernelConfigFactory { 38 39 49 public static KernelConfig newInstance() { 50 return newInstance( System.getProperties() ); 54 } 55 56 68 public static KernelConfig newInstance( Properties props ) { 69 KernelConfig cfg; 70 try 71 { 72 cfg = new PropertyKernelConfig( props ); 76 } 77 catch ( Throwable t ) 78 { 79 String msg = "Unable to construct a " + 80 PropertyKernelConfig.class.getName() + 81 " instance based on the specified properties."; 82 throw new RuntimeException ( msg, t ); 83 } 84 85 return cfg; 86 } 87 } 88 | Popular Tags |