org.sonar.api.platform
Class ComponentContainer

java.lang.Object
  extended by org.sonar.api.platform.ComponentContainer
All Implemented Interfaces:
BatchComponent, ServerComponent

public class ComponentContainer
extends Object
implements BatchComponent, ServerComponent

Since:
2.12

Constructor Summary
ComponentContainer()
          Create root container
 
Method Summary
 ComponentContainer addComponent(Object component, boolean singleton)
           
 ComponentContainer addExtension(PluginMetadata plugin, Object extension)
           
 ComponentContainer addPicoAdapter(org.picocontainer.ComponentAdapter adapter)
           
 ComponentContainer addSingleton(Object component)
           
 ComponentContainer createChild()
           
 void declareExtension(PluginMetadata plugin, Object extension)
           
 ComponentContainer getChild()
           
 Object getComponentByKey(Object key)
           
<T> T
getComponentByType(Class<T> tClass)
           
<T> List<T>
getComponentsByType(Class<T> tClass)
           
 ComponentContainer getParent()
           
 org.picocontainer.MutablePicoContainer getPicoContainer()
          Warning - do not use.
 ComponentContainer removeChild()
           
 ComponentContainer startComponents()
          This method MUST NOT be renamed start() because the container is registered itself in picocontainer.
 ComponentContainer stopComponents()
          This method MUST NOT be renamed stop() because the container is registered itself in picocontainer.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ComponentContainer

public ComponentContainer()
Create root container

Method Detail

startComponents

public final ComponentContainer startComponents()
This method MUST NOT be renamed start() because the container is registered itself in picocontainer. Starting a component twice is not authorized.


stopComponents

public final ComponentContainer stopComponents()
This method MUST NOT be renamed stop() because the container is registered itself in picocontainer. Starting a component twice is not authorized.


addSingleton

public final ComponentContainer addSingleton(Object component)

addComponent

public final ComponentContainer addComponent(Object component,
                                             boolean singleton)
Parameters:
singleton - return always the same instance if true, else a new instance is returned each time the component is requested

addExtension

public final ComponentContainer addExtension(PluginMetadata plugin,
                                             Object extension)

declareExtension

public final void declareExtension(PluginMetadata plugin,
                                   Object extension)

addPicoAdapter

public final ComponentContainer addPicoAdapter(org.picocontainer.ComponentAdapter adapter)

getComponentByType

public final <T> T getComponentByType(Class<T> tClass)

getComponentByKey

public final Object getComponentByKey(Object key)

getComponentsByType

public final <T> List<T> getComponentsByType(Class<T> tClass)

removeChild

public final ComponentContainer removeChild()

createChild

public final ComponentContainer createChild()

getParent

public ComponentContainer getParent()

getChild

public ComponentContainer getChild()

getPicoContainer

public org.picocontainer.MutablePicoContainer getPicoContainer()
Warning - do not use. This method exists only for the backward-compatibility due to the suppression of IocContainer

Returns:


Copyright © 2009-2011 SonarSource. All Rights Reserved.