com.atlassian.spring.hosted
Class HostedBeanFactoryPostProcessor

java.lang.Object
  extended by com.atlassian.spring.hosted.HostedBeanFactoryPostProcessor
All Implemented Interfaces:
org.springframework.beans.factory.config.BeanFactoryPostProcessor, org.springframework.core.Ordered

public class HostedBeanFactoryPostProcessor
extends java.lang.Object
implements org.springframework.beans.factory.config.BeanFactoryPostProcessor, org.springframework.core.Ordered

Hosted bean factory post processor to allow Hosted to override components in Spring.

Bean factory post processors are invoked after all the bean definitions have been registered (that is, after the XML files have all been parsed), but before any beans actually get instantiated.

There are limitations to this, namely from Spring bean definition decorators that are applied before this post processor gets applied:

  1. A number of bean definition decorators/processors will rename a bean, and create a new bean definition in its place. Examples of this are the spring auto proxying decorators, and the multitenant decorators. Overriding these beans may have weird consequences.
  2. Decorators such as the PluginAvailableBeanDefinitionDecorator may get confused, especially if both the old and the new bean definition have the attribute on it. If overriding a plugin:available bean definition, it is probably wise to not annotate the overriding bean with plugin:available, as the old bean name will still be referenced by the host component provider.

Since:
2.0

Field Summary
 
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
 
Constructor Summary
HostedBeanFactoryPostProcessor()
           
 
Method Summary
 int getOrder()
           
 void postProcessBeanFactory(org.springframework.beans.factory.config.ConfigurableListableBeanFactory beanFactory)
           
 void setResource(java.lang.String resource)
          Set the resource to load, if it exists.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HostedBeanFactoryPostProcessor

public HostedBeanFactoryPostProcessor()
Method Detail

postProcessBeanFactory

public void postProcessBeanFactory(org.springframework.beans.factory.config.ConfigurableListableBeanFactory beanFactory)
                            throws org.springframework.beans.BeansException
Specified by:
postProcessBeanFactory in interface org.springframework.beans.factory.config.BeanFactoryPostProcessor
Throws:
org.springframework.beans.BeansException

getOrder

public int getOrder()
Specified by:
getOrder in interface org.springframework.core.Ordered

setResource

public void setResource(java.lang.String resource)
Set the resource to load, if it exists. By default, this is META-INF/hosted-application-context-overrides.xml.

Parameters:
resource - The resource to load.


Copyright © 2006-2011 Atlassian. All Rights Reserved.