org.modeshape.repository
Class ModeShapeConfiguration.ConfigurationDefinition

java.lang.Object
  extended by org.modeshape.repository.ModeShapeConfiguration.ConfigurationDefinition
Enclosing class:
ModeShapeConfiguration

@Immutable
public static class ModeShapeConfiguration.ConfigurationDefinition
extends Object

Representation of the current configuration content.


Constructor Summary
protected ModeShapeConfiguration.ConfigurationDefinition(String configurationName, RepositorySource source, String workspace, Path path, ExecutionContext context, ClassLoaderFactory classLoaderFactory)
           
 
Method Summary
 ClassLoaderFactory getClassLoaderFactory()
           
 ExecutionContext getContext()
           
 Property getGlobalProperty(Name name)
          Read a global configuration property.
 String getName()
          Get the name of this configuration.
 Path getPath()
          Get the path in the configuration repository where the configuration content may be found
 RepositorySource getRepositorySource()
          Get the repository source where the configuration content may be found
 String getWorkspace()
          Get the name of the workspace used for the configuration repository.
 Graph graph()
          Obtain a graph to this configuration repository.
 ModeShapeConfiguration.ConfigurationDefinition with(ClassLoaderFactory classLoaderFactory)
          Return a copy of this configuration that uses the supplied class loader factory instead of this object's class loader factory.
 ModeShapeConfiguration.ConfigurationDefinition with(Path path)
          Return a copy of this configuration that uses the supplied path instead of this object's path.
 ModeShapeConfiguration.ConfigurationDefinition with(RepositorySource source)
          Return a copy of this configuration that uses the supplied repository source instead of this object's repository source.
 ModeShapeConfiguration.ConfigurationDefinition with(String name)
          Return a copy of this configuration that uses the supplied name instead of this object's path.
 ModeShapeConfiguration.ConfigurationDefinition withWorkspace(String workspace)
          Return a copy of this configuration that uses the supplied workspace name instead of this object's workspace.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ModeShapeConfiguration.ConfigurationDefinition

protected ModeShapeConfiguration.ConfigurationDefinition(String configurationName,
                                                         RepositorySource source,
                                                         String workspace,
                                                         Path path,
                                                         ExecutionContext context,
                                                         ClassLoaderFactory classLoaderFactory)
Method Detail

getName

public String getName()
Get the name of this configuration.

Returns:
the configuration's name; never null

getRepositorySource

public RepositorySource getRepositorySource()
Get the repository source where the configuration content may be found

Returns:
the source for the configuration repository; never null

getPath

public Path getPath()
Get the path in the configuration repository where the configuration content may be found

Returns:
the path to the configuration content; never null

getWorkspace

public String getWorkspace()
Get the name of the workspace used for the configuration repository.

Returns:
the name of the workspace, or null if the default workspace should be used

getContext

public ExecutionContext getContext()
Returns:
context

getClassLoaderFactory

public ClassLoaderFactory getClassLoaderFactory()
Returns:
classLoaderFactory

with

public ModeShapeConfiguration.ConfigurationDefinition with(String name)
Return a copy of this configuration that uses the supplied name instead of this object's path.

Parameters:
name - the desired name for the new configuration; if null, then the name of this configuration is used
Returns:
the new configuration

with

public ModeShapeConfiguration.ConfigurationDefinition with(Path path)
Return a copy of this configuration that uses the supplied path instead of this object's path.

Parameters:
path - the desired path for the new configuration; if null, then "/" is used
Returns:
the new configuration

withWorkspace

public ModeShapeConfiguration.ConfigurationDefinition withWorkspace(String workspace)
Return a copy of this configuration that uses the supplied workspace name instead of this object's workspace.

Parameters:
workspace - the desired workspace name for the new configuration; if null, then the default workspace will be used
Returns:
the new configuration

with

public ModeShapeConfiguration.ConfigurationDefinition with(ClassLoaderFactory classLoaderFactory)
Return a copy of this configuration that uses the supplied class loader factory instead of this object's class loader factory.

Parameters:
classLoaderFactory - the classloader factory, or null if the default factory should be used
Returns:
the new configuration

with

public ModeShapeConfiguration.ConfigurationDefinition with(RepositorySource source)
Return a copy of this configuration that uses the supplied repository source instead of this object's repository source.

Parameters:
source - the repository source containing the configuration
Returns:
the new configuration

graph

public Graph graph()
Obtain a graph to this configuration repository. This method will always return the same graph instance.

Returns:
the graph; never null

getGlobalProperty

public Property getGlobalProperty(Name name)
Read a global configuration property.

Parameters:
name - the property name
Returns:
the property, or null if there is no such property


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