View Javadoc
1   package com.atlassian.plugin.hostcontainer;
2   
3   /**
4    * Interface into the host application's dependency injection system. The implementation will be expected to be able
5    * to instantiate modules and possibly {@link com.atlassian.plugin.ModuleDescriptor} instances via constructor
6    * injection, matching the constructor with the largest number of arguments first.
7    *
8    * @since 2.2.0
9    */
10  public interface HostContainer {
11      /**
12       * Constructs an instance of a class, matching the constructor with the largest number of arguments first, and
13       * autowires as appropriate. Actual method of autowiring may vary between implementations, though all should
14       * support constructor injection.
15       *
16       * @param moduleClass The class
17       * @return An instance of the passed class
18       * @throws IllegalArgumentException If unable to instantiate the class
19       */
20      <T> T create(Class<T> moduleClass) throws IllegalArgumentException;
21  }