View Javadoc

1   /*
2    * Created on May 20, 2005
3    *
4    * An interface that describes an Inversion-of-Control (Ioc) or
5    * dependency-injection container
6    */
7   package net.sf.tlc.ioc;
8   
9   /***
10   * An interface that describes an Inversion-of-Control (Ioc) or
11   * dependency-injection container
12   * 
13   * @author aisrael
14   */
15  public interface IocContainer {
16  
17      /***
18       * Registers a class with the IocContainer.
19       * 
20       * @param c
21       *            Class
22       */
23      void register(final Class c);
24  
25      /***
26       * Adds a previously instantiated object to the container registry.
27       * 
28       * @param o
29       *            Object
30       */
31      void add(final Object o);
32  
33      /***
34       * Attempt to obtain an instance of the requested class with auto-wiring of
35       * dependencies.
36       * 
37       * @param c
38       *            a class previously registered with the container
39       * @return an instance of the requested class
40       */
41      Object getInstance(final Class c);
42  
43  }