import org.springframework.beans.BeansException; import org.springframework.context.ApplicationContext; import org.springframework.context.ApplicationContextAware; import org.springframework.stereotype.Repository; public final class TaskFactory { private static TaskFactory instance; private TaskFactory() { } public static TaskFactory getInstance() { if (instance == null) { instance = new TaskFactory(); } return instance; } }
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd"> <beans> <description></description> <bean id="taskFactory" class="com.yundaex.common.parent.threadpool.TaskFactory" factory-method="getInstance"> </bean> </beans>
时间: 2024-10-13 21:58:57