1 10 package org.picocontainer.gems; 11 import org.picocontainer.PicoContainer; 12 import org.picocontainer.PicoInitializationException; 13 import org.picocontainer.PicoIntrospectionException; 14 import org.picocontainer.PicoVerificationException; 15 import org.picocontainer.defaults.AbstractComponentAdapter; 16 17 18 24 public class StaticFactoryComponentAdapter 25 extends AbstractComponentAdapter { 26 private StaticFactory staticFactory; 27 28 34 public StaticFactoryComponentAdapter(Class type, StaticFactory staticFactory) { 35 36 this(type, type, staticFactory); 37 } 38 39 46 public StaticFactoryComponentAdapter(Object componentKey, Class type, StaticFactory staticFactory) { 47 super(componentKey, type); 48 this.staticFactory = staticFactory; 49 } 50 51 55 public Object getComponentInstance(PicoContainer container) throws PicoInitializationException, PicoIntrospectionException { 56 return staticFactory.get(); 57 } 58 59 63 public void verify(PicoContainer container) throws PicoVerificationException { 64 } 65 } | Popular Tags |