使用的设计模式的名称是什么

时间:2015-05-13 15:35:15

标签: spring design-patterns cdi

我正在努力确定用于在弹簧容器和CDI容器之间桥接的设计模式的名称。这是我写的在我的CDI容器中使用spring bean的类:

   @ApplicationScoped
public class CDIFactory {

ApplicationContext applicationContext = new ClassPathXmlApplicationContext("classpath:spring/context/application-context.xml");

@Produces
public ServiceManager facadeServices(){
    return (ServiceManager) applicationContext.getBean("ServiceManager");   
}

我们将不胜感激。

1 个答案:

答案 0 :(得分:1)

CDIFactory是Singleton,因为它使用@ApplicationScoped注释,CDIFactory#facadeServices是工厂方法,因为它提供了ServiceManager个实例/实例。