Java Code Examples for org.springframework.beans.factory.xml.XmlBeanDefinitionReader#setEventListener()

The following examples show how to use org.springframework.beans.factory.xml.XmlBeanDefinitionReader#setEventListener() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ContextDependencyLister.java    From alfresco-repository with GNU Lesser General Public License v3.0 5 votes vote down vote up
protected void initBeanDefinitionReader(XmlBeanDefinitionReader reader) {
   super.initBeanDefinitionReader(reader);

   btl = new BeanTrackingListener();
   reader.setEventListener(btl);
   // Work around a spring bug where setting the listener does nothing 
   try {
      Field f = reader.getClass().getDeclaredField("eventListener");
      f.setAccessible(true);
      f.set(reader, btl);
   } catch(Exception e) {
      throw new RuntimeException(e);
   }
}
 
Example 2
Source File: TxNamespaceHandlerEventTests.java    From spring-analysis-note with MIT License 4 votes vote down vote up
@Before
public void setUp() throws Exception {
	XmlBeanDefinitionReader reader = new XmlBeanDefinitionReader(this.beanFactory);
	reader.setEventListener(this.eventListener);
	reader.loadBeanDefinitions(new ClassPathResource("txNamespaceHandlerTests.xml", getClass()));
}
 
Example 3
Source File: JmsNamespaceHandlerTests.java    From spring-analysis-note with MIT License 4 votes vote down vote up
@Override
protected void initBeanDefinitionReader(XmlBeanDefinitionReader beanDefinitionReader) {
	this.registeredComponents = new HashSet<>();
	beanDefinitionReader.setEventListener(new StoringReaderEventListener(this.registeredComponents));
	beanDefinitionReader.setSourceExtractor(new PassThroughSourceExtractor());
}
 
Example 4
Source File: TxNamespaceHandlerEventTests.java    From java-technology-stack with MIT License 4 votes vote down vote up
@Before
public void setUp() throws Exception {
	XmlBeanDefinitionReader reader = new XmlBeanDefinitionReader(this.beanFactory);
	reader.setEventListener(this.eventListener);
	reader.loadBeanDefinitions(new ClassPathResource("txNamespaceHandlerTests.xml", getClass()));
}
 
Example 5
Source File: JmsNamespaceHandlerTests.java    From java-technology-stack with MIT License 4 votes vote down vote up
@Override
protected void initBeanDefinitionReader(XmlBeanDefinitionReader beanDefinitionReader) {
	this.registeredComponents = new HashSet<>();
	beanDefinitionReader.setEventListener(new StoringReaderEventListener(this.registeredComponents));
	beanDefinitionReader.setSourceExtractor(new PassThroughSourceExtractor());
}
 
Example 6
Source File: TxNamespaceHandlerEventTests.java    From spring4-understanding with Apache License 2.0 4 votes vote down vote up
@Before
public void setUp() throws Exception {
	XmlBeanDefinitionReader reader = new XmlBeanDefinitionReader(this.beanFactory);
	reader.setEventListener(this.eventListener);
	reader.loadBeanDefinitions(new ClassPathResource("txNamespaceHandlerTests.xml", getClass()));
}
 
Example 7
Source File: JmsNamespaceHandlerTests.java    From spring4-understanding with Apache License 2.0 4 votes vote down vote up
@Override
protected void initBeanDefinitionReader(XmlBeanDefinitionReader beanDefinitionReader) {
	this.registeredComponents = new HashSet<ComponentDefinition>();
	beanDefinitionReader.setEventListener(new StoringReaderEventListener(this.registeredComponents));
	beanDefinitionReader.setSourceExtractor(new PassThroughSourceExtractor());
}
 
Example 8
Source File: LoggingContextLoader.java    From geomajas-project-server with GNU Affero General Public License v3.0 4 votes vote down vote up
protected void initBeanDefinitionReader(XmlBeanDefinitionReader reader) {
	reader.setEventListener(new LoggingEventListener());
}
 
Example 9
Source File: LoggingApplicationContext.java    From geomajas-project-server with GNU Affero General Public License v3.0 4 votes vote down vote up
@Override
protected void initBeanDefinitionReader(XmlBeanDefinitionReader reader) {
	super.initBeanDefinitionReader(reader);
	reader.setEventListener(new LoggingEventListener());
}