View Javadoc

1   package com.atlassian.plugin;
2   
3   /**
4    * Defines a plugin that is capable of creating and autowiring beans.  The name and autowire types copied from Spring's
5    * AutowireCapableBeanFactory.
6    * @deprecated Since 2.5.0, use {@link com.atlassian.plugin.module.ContainerManagedPlugin} instead.
7    *                              getContainerAccessor provides access to the container.
8    */
9   @Deprecated
10  public interface AutowireCapablePlugin
11  {
12      /**
13       * The autowire strategy to use when creating and wiring a bean
14       */
15      enum AutowireStrategy
16      {
17          AUTOWIRE_NO,
18          /** Performs setter-based injection by name */
19          AUTOWIRE_BY_NAME,
20  
21          /** Performs setter-based injection by type */
22          AUTOWIRE_BY_TYPE,
23  
24          /** Performs construction-based injection by type */
25          AUTOWIRE_BY_CONSTRUCTOR,
26  
27          /**
28           * Autodetects appropriate injection by first seeing if any no-arg constructors exist.  If not, performs constructor
29           * injection, and if so, autowires by type then name
30           */
31          AUTOWIRE_AUTODETECT
32      }
33  
34      /**
35       * Creates and autowires a class using the default strategy.
36       * @param clazz The class to create
37       * @return The created and wired bean
38       * @deprecated Since 2.5.0, use {@link com.atlassian.plugin.module.ContainerManagedPlugin.getContainerAccessor()} instead.
39       */
40      @Deprecated
41      <T> T autowire(Class<T> clazz);
42  
43      /**
44       * Creates and autowires a class with a specific autowire strategy
45       *
46       * @param clazz The class to create
47       * @param autowireStrategy The autowire strategy
48       * @return The created and wired bean
49       * @deprecated Since 2.5.0, use {@link com.atlassian.plugin.module.ContainerManagedPlugin.getContainerAccessor()} instead.
50       */
51      @Deprecated
52      <T> T autowire(Class<T> clazz, AutowireStrategy autowireStrategy);
53  
54      /**
55       * Autowires an existing object using the default strategy.
56       * @param instance The object to inject
57       * @deprecated Since 2.5.0, use {@link com.atlassian.plugin.module.ContainerManagedPlugin.getContainerAccessor()} instead.
58       */
59      @Deprecated
60      void autowire(Object instance);
61  
62      /**
63       * Autowires an existing object with a specific autowire strategy
64       *
65       * @param instance The object to autowire
66       * @param autowireStrategy The autowire strategy, must not be constructor
67       * @deprecated Since 2.5.0, use {@link com.atlassian.plugin.module.ContainerManagedPlugin.getContainerAccessor()} instead.
68       */
69      @Deprecated
70      void autowire(Object instance, AutowireStrategy autowireStrategy);
71  }