All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.terapico.caf.SpringInvocationContextFactory Maven / Gradle / Ivy

The newest version!
package com.terapico.caf;

import org.springframework.context.support.AbstractApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class SpringInvocationContextFactory extends ServletInvocationContextFactory {
	AbstractApplicationContext context; 
	public SpringInvocationContextFactory(){
		context = new ClassPathXmlApplicationContext("classpath*:/META-INF/spring.xml");		
	}

	
	public String[] getBeanNames() {		
		return context.getBeanDefinitionNames();
	}
	protected Object getBean(String beanName)
	{
		Object target=super.getBean(beanName);
		if(target!=null){
			return target;
		}
		
		return getObject(beanName);
		
	}
	protected Object getObject(String objectPath) {
		return context.getBean(objectPath);
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy