org.jboss.dna.repository
Class DnaConfiguration.Builder<ReturnType>

java.lang.Object
  extended by org.jboss.dna.repository.Configurator<ReturnType>
      extended by org.jboss.dna.repository.DnaConfiguration.Builder<ReturnType>
All Implemented Interfaces:
Configurator.Initializer<ReturnType>, Configurator.MimeDetectorConfigurator<ReturnType>, Configurator.RepositoryConfigurator<ReturnType>, Configurator.SequencerConfigurator<ReturnType>
Enclosing class:
DnaConfiguration

public static class DnaConfiguration.Builder<ReturnType>
extends Configurator<ReturnType>
implements Configurator.Initializer<ReturnType>, Configurator.SequencerConfigurator<ReturnType>, Configurator.RepositoryConfigurator<ReturnType>, Configurator.MimeDetectorConfigurator<ReturnType>


Nested Class Summary
 
Nested classes/interfaces inherited from class org.jboss.dna.repository.Configurator
Configurator.And<ReturnType>, Configurator.Builder<ReturnType>, Configurator.ChooseClass<ComponentClassType,ReturnType>, Configurator.ConfigRepositoryDetails<ReturnType>, Configurator.ConfigurationRepository, Configurator.Initializer<ReturnType>, Configurator.LoadedFrom<ReturnType>, Configurator.MimeDetectorConfigurator<ReturnType>, Configurator.MimeTypeDetectorDetails<ReturnType>, Configurator.PathExpressionOutput<ReturnType>, Configurator.PropertySetter<ReturnType>, Configurator.RepositoryConfigurator<ReturnType>, Configurator.RepositoryDetails<ReturnType>, Configurator.SequencerConfigurator<ReturnType>, Configurator.SequencerDetails<ReturnType>, Configurator.SetDescription<ReturnType>, Configurator.SetName<ReturnType>, Configurator.SetProperties<ReturnType>
 
Constructor Summary
DnaConfiguration.Builder(ExecutionContext context, ReturnType builder)
          Specify a new ExecutionContext that should be used for this DNA instance.
 
Method Summary
 Configurator.ChooseClass<MimeTypeDetector,Configurator.MimeTypeDetectorDetails<ReturnType>> addMimeTypeDetector(String id)
          Add a new MIME type detector to this configuration.
 ReturnType addRepository(RepositorySource source)
          Add a new repository for this configuration.
 Configurator.ChooseClass<RepositorySource,Configurator.RepositoryDetails<ReturnType>> addRepository(String id)
          Add a new repository for this configuration.
 Configurator.ChooseClass<Sequencer,Configurator.SequencerDetails<ReturnType>> addSequencer(String id)
          Add a new sequencer to this configuration.
 DnaEngine buildDnaEngine()
           
 Configurator.ConfigurationRepository getConfigurationRepository()
           
 Configurator.ChooseClass<RepositorySource,Configurator.ConfigRepositoryDetails<ReturnType>> withConfigurationRepository()
          Specify that this configuration should use a particular RepositorySource for its configuration repository.
 
Methods inherited from class org.jboss.dna.repository.Configurator
getExecutionContext, save
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DnaConfiguration.Builder

public DnaConfiguration.Builder(ExecutionContext context,
                                ReturnType builder)
Specify a new ExecutionContext that should be used for this DNA instance.

Parameters:
context - the new context, or null if a default-constructed execution context should be used
builder - the builder object returned from all the methods
Throws:
IllegalArgumentException - if the supplied context reference is null
Method Detail

buildDnaEngine

public DnaEngine buildDnaEngine()

getConfigurationRepository

public Configurator.ConfigurationRepository getConfigurationRepository()

withConfigurationRepository

public Configurator.ChooseClass<RepositorySource,Configurator.ConfigRepositoryDetails<ReturnType>> withConfigurationRepository()
Specify that this configuration should use a particular RepositorySource for its configuration repository. By default each configuration uses an internal transient repository for its configuration, but using this method will make the configuration use a different repository (that is perhaps shared with other processes).

Specified by:
withConfigurationRepository in interface Configurator.Initializer<ReturnType>
Returns:
the interface for choosing the class, which returns the interface used to configure the repository source that will be used for the configuration repository; never null
See Also:
Configurator.Initializer.withConfigurationRepository()

addSequencer

public Configurator.ChooseClass<Sequencer,Configurator.SequencerDetails<ReturnType>> addSequencer(String id)
Add a new sequencer to this configuration. The new sequencer will have the supplied name, and if the name of an existing sequencer is used, this will replace the existing sequencer configuration.

Specified by:
addSequencer in interface Configurator.SequencerConfigurator<ReturnType>
Parameters:
id - the identifier of the new sequencer
Returns:
the interface for choosing the class, which returns the interface used to configure the sequencer; never null
See Also:
Configurator.SequencerConfigurator.addSequencer(java.lang.String)

addRepository

public Configurator.ChooseClass<RepositorySource,Configurator.RepositoryDetails<ReturnType>> addRepository(String id)
Add a new repository for this configuration. The new repository will have the supplied name, and if the name of an existing repository is used, this will replace the existing repository configuration.

Specified by:
addRepository in interface Configurator.RepositoryConfigurator<ReturnType>
Parameters:
id - the id of the new repository that is to be added
Returns:
the interface for choosing the class, which returns the interface used to configure the repository source; never null
See Also:
Configurator.RepositoryConfigurator.addRepository(java.lang.String)

addRepository

public ReturnType addRepository(RepositorySource source)
Add a new repository for this configuration. The new repository will have the supplied name, and if the name of an existing repository is used, this will replace the existing repository configuration.

Specified by:
addRepository in interface Configurator.RepositoryConfigurator<ReturnType>
Parameters:
source - the RepositorySource instance that should be used
Returns:
this configuration object, for method-chaining purposes
See Also:
Configurator.RepositoryConfigurator.addRepository(org.jboss.dna.graph.connector.RepositorySource)

addMimeTypeDetector

public Configurator.ChooseClass<MimeTypeDetector,Configurator.MimeTypeDetectorDetails<ReturnType>> addMimeTypeDetector(String id)
Add a new MIME type detector to this configuration. The new detector will have the supplied name, and if the name of an existing detector is used, this will replace the existing detector configuration.

Specified by:
addMimeTypeDetector in interface Configurator.MimeDetectorConfigurator<ReturnType>
Parameters:
id - the id of the new detector
Returns:
the interface for choosing the class, which returns the interface used to configure the detector; never null
See Also:
Configurator.MimeDetectorConfigurator.addMimeTypeDetector(java.lang.String)


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