1 24 25 package org.objectweb.fractal.api; 26 27 import org.objectweb.fractal.api.factory.InstantiationException; 28 import org.objectweb.fractal.api.factory.Factory; 29 30 36 37 public class Fractal { 38 39 42 43 private Fractal () { 44 } 45 46 64 65 public static Component getBootstrapComponent () 66 throws InstantiationException 67 { 68 String bootTmplClassName = System.getProperty("fractal.provider"); 69 if (bootTmplClassName == null) { 70 throw new InstantiationException ( 71 "The fractal.provider system property is not defined"); 72 } 73 Factory bootTmpl; 74 try { 75 Class bootTmplClass = Class.forName(bootTmplClassName); 76 bootTmpl = (Factory)bootTmplClass.newInstance(); 77 } catch (Exception e) { 78 throw new InstantiationException ( 79 "Cannot find or instantiate the '" + bootTmplClassName + 80 "' class specified in the fractal.provider system property"); 81 } 82 return bootTmpl.newFcInstance(); 83 } 84 } 85 | Popular Tags |