com.atlassian.spring.container
Class SpringContainerContext

java.lang.Object
  extended by com.atlassian.spring.container.SpringContainerContext
All Implemented Interfaces:
ContainerContext
Direct Known Subclasses:
SpringTestContainerContext

public class SpringContainerContext
extends Object
implements ContainerContext

Implementation of ContainerContext to allow compoennts to be retrieved from a spring container


Constructor Summary
SpringContainerContext()
           
 
Method Summary
 void autowireComponent(Object bean)
          autowire the dependences a bean that has already been created
protected  void contextReloaded()
           
 Object createComponent(Class clazz)
          Create an object of the given class, and try to auto-wire it as much as we can.
protected  org.springframework.context.ApplicationContext getApplicationContext()
           
 Object getComponent(Object key)
          Retrieves a component from the container
 javax.servlet.ServletContext getServletContext()
           
 boolean isSetup()
           
 void publishEvent(Event e)
           
 void refresh()
          Refreshes the container, i.e.
 void setApplicationContext(org.springframework.context.ApplicationContext appContext)
           
 void setServletContext(javax.servlet.ServletContext context)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SpringContainerContext

public SpringContainerContext()
Method Detail

setServletContext

public void setServletContext(javax.servlet.ServletContext context)

getServletContext

public javax.servlet.ServletContext getServletContext()

getComponent

public Object getComponent(Object key)
                    throws ComponentNotFoundException
Description copied from interface: ContainerContext
Retrieves a component from the container

Specified by:
getComponent in interface ContainerContext
Parameters:
key - the key which matches to the component
Returns:
the component or null if the component was not found
Throws:
ComponentNotFoundException - if the key passed in is null or the component is not found or if there is more than one satisfiable component for the given key, such as the key is a Class and multiple instances of the class exist in the container

createComponent

public Object createComponent(Class clazz)
Description copied from interface: ContainerContext
Create an object of the given class, and try to auto-wire it as much as we can.

Specified by:
createComponent in interface ContainerContext

autowireComponent

public void autowireComponent(Object bean)
autowire the dependences a bean that has already been created

Specified by:
autowireComponent in interface ContainerContext
Parameters:
bean -

setApplicationContext

public void setApplicationContext(org.springframework.context.ApplicationContext appContext)
                           throws org.springframework.context.ApplicationContextException
Throws:
org.springframework.context.ApplicationContextException

refresh

public void refresh()
Description copied from interface: ContainerContext
Refreshes the container, i.e. reloads it's components from it's config file

Specified by:
refresh in interface ContainerContext

isSetup

public boolean isSetup()
Specified by:
isSetup in interface ContainerContext

contextReloaded

protected void contextReloaded()

getApplicationContext

protected org.springframework.context.ApplicationContext getApplicationContext()

publishEvent

public void publishEvent(Event e)
Specified by:
publishEvent in interface ContainerContext


Atlassian Spring is developed by Atlassian Software Systems.