Author: richard.opalka(a)jboss.com
Date: 2009-01-29 11:29:44 -0500 (Thu, 29 Jan 2009)
New Revision: 9167
Modified:
common/trunk/src/main/java/org/jboss/wsf/common/KernelAwareSPIFactory.java
Log:
[JBWS-2504] KRE -> CC
Modified: common/trunk/src/main/java/org/jboss/wsf/common/KernelAwareSPIFactory.java
===================================================================
--- common/trunk/src/main/java/org/jboss/wsf/common/KernelAwareSPIFactory.java 2009-01-29
16:24:23 UTC (rev 9166)
+++ common/trunk/src/main/java/org/jboss/wsf/common/KernelAwareSPIFactory.java 2009-01-29
16:29:44 UTC (rev 9167)
@@ -21,22 +21,22 @@
*/
package org.jboss.wsf.common;
-import org.jboss.kernel.Kernel;
-import org.jboss.kernel.spi.registry.KernelRegistry;
-import org.jboss.kernel.spi.registry.KernelRegistryEntry;
+import org.jboss.dependency.spi.ControllerContext;
+import org.jboss.kernel.spi.dependency.KernelController;
import org.jboss.wsf.spi.util.KernelLocator;
/**
+ * SPI factory delegating to kernel for bean lookups
+ * @author richard.opalka(a)jboss.com
* @author Heiko.Braun(a)jboss.com
- * Created: Jul 19, 2007
*/
public class KernelAwareSPIFactory
{
+ @SuppressWarnings("unchecked")
public <T> T getKernelProvidedSPI(String beanName, Class<T> spiArtifact)
{
- Kernel kernel = KernelLocator.getKernel();
- KernelRegistry registry = kernel.getRegistry();
- KernelRegistryEntry entry = registry.getEntry(beanName);
- return (T)entry.getTarget();
+ KernelController controller = KernelLocator.getKernel().getController();
+ ControllerContext ctx = controller.getInstalledContext(beanName);
+ return (T)ctx.getTarget();
}
}
Show replies by date