org.jboss.dna.repository
Interface DnaConfiguration.ChooseClass<ComponentClassType,ReturnType>

Type Parameters:
ComponentClassType - the class or interface that the component is to implement
ReturnType - the interface returned from these methods
All Known Subinterfaces:
DnaConfiguration.MimeTypeDetectorDefinition<ReturnType>, DnaConfiguration.RepositorySourceDefinition<ReturnType>, DnaConfiguration.SequencerDefinition<ReturnType>
Enclosing class:
DnaConfiguration

public static interface DnaConfiguration.ChooseClass<ComponentClassType,ReturnType>

The interface used to configure the class used for a component.


Method Summary
 ReturnType usingClass(Class<? extends ComponentClassType> clazz)
          Specify the class that should be instantiated for the instance.
 DnaConfiguration.LoadedFrom<ReturnType> usingClass(String classname)
          Specify the name of the class that should be instantiated for the instance.
 

Method Detail

usingClass

DnaConfiguration.LoadedFrom<ReturnType> usingClass(String classname)
Specify the name of the class that should be instantiated for the instance. The classpath information will need to be defined using the returned interface.

Parameters:
classname - the name of the class that should be instantiated
Returns:
the interface used to define the classpath information; never null
Throws:
IllegalArgumentException - if the class name is null, empty, blank, or not a valid class name

usingClass

ReturnType usingClass(Class<? extends ComponentClassType> clazz)
Specify the class that should be instantiated for the instance. Because the class is already available to this class loader, there is no need to specify the classloader information.

Parameters:
clazz - the class that should be instantiated
Returns:
the next component to continue configuration; never null
Throws:
DnaConfigurationException - if the class could not be accessed and instantiated (if needed)
IllegalArgumentException - if the class reference is null


Copyright © 2008-2009 JBoss, a division of Red Hat. All Rights Reserved.