1   /*
2    * Copyright (c) 2003 by Atlassian Software Systems Pty. Ltd. All rights reserved.
3    */
4   package com.atlassian.spring.container;
5   
6   import com.atlassian.event.Event;
7   import org.springframework.beans.factory.config.BeanPostProcessor;
8   
9   public interface ContainerContext
10  {
11      /**
12       * Retrieves a component from the container
13       * @param key the key which matches to the component
14       * @return the component or null if the component was not found
15       * @throws com.atlassian.spring.container.ComponentNotFoundException if the key passed in is null or the component is not found
16       * or if there is more than one satisfiable component for the given key, such as the key is a Class
17       * and multiple instances of the class exist in the container
18       */
19      Object getComponent(Object key) throws ComponentNotFoundException;
20  
21      /**
22       * Create an object of the given class, and try to auto-wire by name.
23       */
24      Object createComponent(Class clazz);
25  
26      /**
27       * Creates a new bean from the given class. Also executes any lifecyle process like {@link BeanPostProcessor}s and autowires
28       * the bean.
29       *
30       * @param clazz @NotNull
31       * @return A fully constructed object of the passed class. May be a proxy of the class.
32       */
33      Object createCompleteComponent(Class clazz);
34  
35      /**
36       * Autowire an object in this container as much as we can.
37       */
38      void autowireComponent(Object component);
39  
40      /**
41       * Refreshes the container, i.e. reloads it's components from it's config file
42       */
43      void refresh();
44  
45      boolean isSetup();
46  
47      void publishEvent(Event e);
48  }