org.jboss.dna.repository
Class DnaConfiguration

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

public class DnaConfiguration
extends Object
implements Configurator.Initializer<DnaConfiguration>, Configurator.SequencerConfigurator<DnaConfiguration>, Configurator.RepositoryConfigurator<DnaConfiguration>, Configurator.MimeDetectorConfigurator<DnaConfiguration>, Configurator.Builder<DnaEngine>


Nested Class Summary
static class DnaConfiguration.Builder<ReturnType>
           
 
Constructor Summary
DnaConfiguration()
          Create a new configuration for DNA.
DnaConfiguration(ExecutionContext context)
          Specify a new ExecutionContext that should be used for this DNA instance.
 
Method Summary
 Configurator.ChooseClass<MimeTypeDetector,Configurator.MimeTypeDetectorDetails<DnaConfiguration>> addMimeTypeDetector(String id)
          Add a new MIME type detector to this configuration.
 DnaConfiguration addRepository(RepositorySource source)
          Add a new repository for this configuration.
 Configurator.ChooseClass<RepositorySource,Configurator.RepositoryDetails<DnaConfiguration>> addRepository(String id)
          Add a new repository for this configuration.
 Configurator.ChooseClass<Sequencer,Configurator.SequencerDetails<DnaConfiguration>> addSequencer(String id)
          Add a new sequencer to this configuration.
 DnaEngine build()
          Complete this configuration and create the corresponding engine.
 ExecutionContext getExecutionContext()
          Get the execution context used by this configurator.
 DnaConfiguration save()
          Save any changes that have been made so far to the configuration.
 Configurator.ChooseClass<RepositorySource,Configurator.ConfigRepositoryDetails<DnaConfiguration>> withConfigurationRepository()
          Specify that this configuration should use a particular RepositorySource for its configuration repository.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DnaConfiguration

public DnaConfiguration()
Create a new configuration for DNA.


DnaConfiguration

public DnaConfiguration(ExecutionContext context)
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
Throws:
IllegalArgumentException - if the supplied context reference is null
Method Detail

getExecutionContext

public final ExecutionContext getExecutionContext()
Get the execution context used by this configurator.

Returns:
the execution context; never null

withConfigurationRepository

public Configurator.ChooseClass<RepositorySource,Configurator.ConfigRepositoryDetails<DnaConfiguration>> 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<DnaConfiguration>
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()

addRepository

public Configurator.ChooseClass<RepositorySource,Configurator.RepositoryDetails<DnaConfiguration>> 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<DnaConfiguration>
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 DnaConfiguration 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<DnaConfiguration>
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)

addSequencer

public Configurator.ChooseClass<Sequencer,Configurator.SequencerDetails<DnaConfiguration>> 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<DnaConfiguration>
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)

addMimeTypeDetector

public Configurator.ChooseClass<MimeTypeDetector,Configurator.MimeTypeDetectorDetails<DnaConfiguration>> 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<DnaConfiguration>
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)

save

public DnaConfiguration save()
Save any changes that have been made so far to the configuration. This method does nothing if no changes have been made.

Returns:
this configuration object for method chaining purposes; never null

build

public DnaEngine build()
                throws DnaConfigurationException
Complete this configuration and create the corresponding engine.

Specified by:
build in interface Configurator.Builder<DnaEngine>
Returns:
the new engine configured by this instance
Throws:
DnaConfigurationException - if the engine cannot be created from this configuration.
See Also:
Configurator.Builder.build()


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