com.atlassian.plugin.module
Interface ContainerAccessor

All Known Subinterfaces:
SpringContainerAccessor
All Known Implementing Classes:
DefaultSpringContainerAccessor

public interface ContainerAccessor

The ContainerAccessor allows access to the underlying plugin container (e.g. spring).

Since:
2.5.0

Method Summary
<T> T
createBean(Class<T> clazz)
          Will ask the container to instantiate a bean of the given class and does inject all constructor defined dependencies.
<T> Collection<T>
getBeansOfType(Class<T> interfaceClass)
          Gets all the beans that implement a given interface
 

Method Detail

createBean

<T> T createBean(Class<T> clazz)
Will ask the container to instantiate a bean of the given class and does inject all constructor defined dependencies. Currently we have only spring as a container that will autowire this bean.

Parameters:
clazz - the Class to instantiate. Cannot be null.
Returns:
an instantiated bean.

getBeansOfType

<T> Collection<T> getBeansOfType(Class<T> interfaceClass)
Gets all the beans that implement a given interface

Type Parameters:
T - The target interface type
Parameters:
interfaceClass - The interface class
Returns:
A collection of implementations from the plugin's container


Copyright © 2010 Atlassian. All Rights Reserved.