org.codehaus.plexus
Class DefaultPlexusContainer

java.lang.Object
  extended by org.codehaus.plexus.DefaultPlexusContainer
All Implemented Interfaces:
MutablePlexusContainer, PlexusContainer

public final class DefaultPlexusContainer
extends Object
implements MutablePlexusContainer

PlexusContainer shim that delegates to a Plexus-aware Guice Injector.


Constructor Summary
DefaultPlexusContainer()
           
DefaultPlexusContainer(ContainerConfiguration configuration)
           
DefaultPlexusContainer(ContainerConfiguration configuration, com.google.inject.Module... customModules)
           
 
Method Summary
 void addComponent(Object component, String role)
           
<T> void
addComponent(T component, Class<?> role, String hint)
           
<T> void
addComponentDescriptor(ComponentDescriptor<T> descriptor)
           
 void addPlexusInjector(List<PlexusBeanModule> beanModules, com.google.inject.Module... customModules)
           
 org.codehaus.plexus.classworlds.realm.ClassRealm createChildRealm(String id)
           
 List<ComponentDescriptor<?>> discoverComponents(org.codehaus.plexus.classworlds.realm.ClassRealm realm)
           
 void dispose()
           
 org.codehaus.plexus.classworlds.ClassWorld getClassWorld()
           
<T> ComponentDescriptor<T>
getComponentDescriptor(Class<T> type, String role, String hint)
           
 ComponentDescriptor<?> getComponentDescriptor(String role, String hint)
           
<T> List<ComponentDescriptor<T>>
getComponentDescriptorList(Class<T> type, String role)
           
 List getComponentDescriptorList(String role)
           
<T> Map<String,ComponentDescriptor<T>>
getComponentDescriptorMap(Class<T> type, String role)
           
 Map getComponentDescriptorMap(String role)
           
 org.codehaus.plexus.classworlds.realm.ClassRealm getContainerRealm()
           
 Context getContext()
           
 Logger getLogger()
           
 LoggerManager getLoggerManager()
           
 org.codehaus.plexus.classworlds.realm.ClassRealm getLookupRealm()
           
 boolean hasComponent(Class<?> role)
           
 boolean hasComponent(Class role, String hint)
           
 boolean hasComponent(Class type, String role, String hint)
           
<T> T
lookup(Class<T> role)
           
<T> T
lookup(Class<T> role, String hint)
           
<T> T
lookup(Class<T> type, String role, String hint)
           
 Object lookup(String role)
           
 Object lookup(String role, String hint)
           
<T> List<T>
lookupList(Class<T> role)
           
 List<Object> lookupList(String role)
           
<T> Map<String,T>
lookupMap(Class<T> role)
           
 Map<String,Object> lookupMap(String role)
           
 void release(Object component)
           
 void releaseAll(List<?> components)
           
 void releaseAll(Map<String,?> components)
           
 void setLoggerManager(LoggerManager loggerManager)
           
 org.codehaus.plexus.classworlds.realm.ClassRealm setLookupRealm(org.codehaus.plexus.classworlds.realm.ClassRealm realm)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultPlexusContainer

public DefaultPlexusContainer()
                       throws PlexusContainerException
Throws:
PlexusContainerException

DefaultPlexusContainer

public DefaultPlexusContainer(ContainerConfiguration configuration)
                       throws PlexusContainerException
Throws:
PlexusContainerException

DefaultPlexusContainer

public DefaultPlexusContainer(ContainerConfiguration configuration,
                              com.google.inject.Module... customModules)
                       throws PlexusContainerException
Throws:
PlexusContainerException
Method Detail

getContext

public Context getContext()
Specified by:
getContext in interface PlexusContainer

lookup

public Object lookup(String role)
              throws ComponentLookupException
Specified by:
lookup in interface PlexusContainer
Throws:
ComponentLookupException

lookup

public Object lookup(String role,
                     String hint)
              throws ComponentLookupException
Specified by:
lookup in interface PlexusContainer
Throws:
ComponentLookupException

lookup

public <T> T lookup(Class<T> role)
         throws ComponentLookupException
Specified by:
lookup in interface PlexusContainer
Throws:
ComponentLookupException

lookup

public <T> T lookup(Class<T> role,
                    String hint)
         throws ComponentLookupException
Specified by:
lookup in interface PlexusContainer
Throws:
ComponentLookupException

lookup

public <T> T lookup(Class<T> type,
                    String role,
                    String hint)
         throws ComponentLookupException
Specified by:
lookup in interface PlexusContainer
Throws:
ComponentLookupException

lookupList

public List<Object> lookupList(String role)
                        throws ComponentLookupException
Specified by:
lookupList in interface PlexusContainer
Throws:
ComponentLookupException

lookupList

public <T> List<T> lookupList(Class<T> role)
                   throws ComponentLookupException
Specified by:
lookupList in interface PlexusContainer
Throws:
ComponentLookupException

lookupMap

public Map<String,Object> lookupMap(String role)
                             throws ComponentLookupException
Specified by:
lookupMap in interface PlexusContainer
Throws:
ComponentLookupException

lookupMap

public <T> Map<String,T> lookupMap(Class<T> role)
                        throws ComponentLookupException
Specified by:
lookupMap in interface PlexusContainer
Throws:
ComponentLookupException

hasComponent

public boolean hasComponent(Class<?> role)
Specified by:
hasComponent in interface PlexusContainer

hasComponent

public boolean hasComponent(Class role,
                            String hint)
Specified by:
hasComponent in interface PlexusContainer

hasComponent

public boolean hasComponent(Class type,
                            String role,
                            String hint)
Specified by:
hasComponent in interface PlexusContainer

addComponent

public void addComponent(Object component,
                         String role)
Specified by:
addComponent in interface PlexusContainer

addComponent

public <T> void addComponent(T component,
                             Class<?> role,
                             String hint)
Specified by:
addComponent in interface PlexusContainer

addComponentDescriptor

public <T> void addComponentDescriptor(ComponentDescriptor<T> descriptor)
Specified by:
addComponentDescriptor in interface PlexusContainer

getComponentDescriptor

public ComponentDescriptor<?> getComponentDescriptor(String role,
                                                     String hint)
Specified by:
getComponentDescriptor in interface PlexusContainer

getComponentDescriptor

public <T> ComponentDescriptor<T> getComponentDescriptor(Class<T> type,
                                                         String role,
                                                         String hint)
Specified by:
getComponentDescriptor in interface PlexusContainer

getComponentDescriptorList

public List getComponentDescriptorList(String role)
Specified by:
getComponentDescriptorList in interface PlexusContainer

getComponentDescriptorList

public <T> List<ComponentDescriptor<T>> getComponentDescriptorList(Class<T> type,
                                                                   String role)
Specified by:
getComponentDescriptorList in interface PlexusContainer

getComponentDescriptorMap

public Map getComponentDescriptorMap(String role)
Specified by:
getComponentDescriptorMap in interface PlexusContainer

getComponentDescriptorMap

public <T> Map<String,ComponentDescriptor<T>> getComponentDescriptorMap(Class<T> type,
                                                                        String role)
Specified by:
getComponentDescriptorMap in interface PlexusContainer

discoverComponents

public List<ComponentDescriptor<?>> discoverComponents(org.codehaus.plexus.classworlds.realm.ClassRealm realm)
Specified by:
discoverComponents in interface PlexusContainer

addPlexusInjector

public void addPlexusInjector(List<PlexusBeanModule> beanModules,
                              com.google.inject.Module... customModules)

getClassWorld

public org.codehaus.plexus.classworlds.ClassWorld getClassWorld()
Specified by:
getClassWorld in interface MutablePlexusContainer

getContainerRealm

public org.codehaus.plexus.classworlds.realm.ClassRealm getContainerRealm()
Specified by:
getContainerRealm in interface PlexusContainer

setLookupRealm

public org.codehaus.plexus.classworlds.realm.ClassRealm setLookupRealm(org.codehaus.plexus.classworlds.realm.ClassRealm realm)
Specified by:
setLookupRealm in interface PlexusContainer

getLookupRealm

public org.codehaus.plexus.classworlds.realm.ClassRealm getLookupRealm()
Specified by:
getLookupRealm in interface PlexusContainer

createChildRealm

public org.codehaus.plexus.classworlds.realm.ClassRealm createChildRealm(String id)
Specified by:
createChildRealm in interface PlexusContainer

getLoggerManager

public LoggerManager getLoggerManager()
Specified by:
getLoggerManager in interface MutablePlexusContainer

setLoggerManager

@Inject(optional=true)
public void setLoggerManager(LoggerManager loggerManager)
Specified by:
setLoggerManager in interface MutablePlexusContainer

getLogger

public Logger getLogger()
Specified by:
getLogger in interface MutablePlexusContainer

release

public void release(Object component)
Specified by:
release in interface PlexusContainer

releaseAll

public void releaseAll(Map<String,?> components)
Specified by:
releaseAll in interface PlexusContainer

releaseAll

public void releaseAll(List<?> components)
Specified by:
releaseAll in interface PlexusContainer

dispose

public void dispose()
Specified by:
dispose in interface PlexusContainer


Copyright © 2010 Sonatype, Inc.. All Rights Reserved.