1 8 9 package org.jboss.spring.kernel; 10 11 import org.jboss.dependency.spi.ControllerContext; 12 import org.jboss.kernel.spi.dependency.KernelController; 13 14 17 public class ControllerLocator implements Locator 18 { 19 20 private KernelController controller; 21 22 protected ControllerLocator() 23 { 24 } 25 26 public ControllerLocator(KernelController controller) 27 { 28 this.controller = controller; 29 } 30 31 public KernelController getController() 32 { 33 return controller; 34 } 35 36 public Object locateBean(String beanName) 37 { 38 ControllerContext context = getController().getInstalledContext(beanName); 39 if (context == null) 40 { 41 return null; 42 } 43 return context.getTarget(); 44 } 45 46 } 47 | Popular Tags |