1 26 27 package net.sourceforge.groboutils.util.classes.v1; 28 29 30 31 39 public class SingletonStore extends AbstractSingleStore 40 { 41 private Class defaultImplementation; 42 private String sysPropertyKey; 43 44 45 55 public SingletonStore( Class instanceOf, Class defaultImpl, 56 String sysPropertyKey ) 57 { 58 super( instanceOf ); 59 this.defaultImplementation = defaultImpl; 60 this.sysPropertyKey = sysPropertyKey; 61 } 62 63 64 68 public void setDefaultSingleton() 69 { 70 setSingletonFromProperty( this.sysPropertyKey ); 71 } 72 73 74 84 public void setSingletonFromProperty( String key ) 85 { 86 setSingleton( createFromProperty( key, this.defaultImplementation ) ); 87 } 88 } 89 90 | Popular Tags |