com.opensymphony.xwork2.config.impl
Class MockConfiguration

java.lang.Object
  extended by com.opensymphony.xwork2.config.impl.MockConfiguration
All Implemented Interfaces:
Configuration, Serializable

public class MockConfiguration
extends Object
implements Configuration

Simple configuration used for unit testing

See Also:
Serialized Form

Field Summary
private  ContainerBuilder builder
           
private  Container container
           
private  Set<String> loadedFiles
           
private  Map<String,PackageConfig> packages
           
protected  List<UnknownHandlerConfig> unknownHandlerStack
           
 
Constructor Summary
MockConfiguration()
           
 
Method Summary
 void addPackageConfig(String name, PackageConfig packageContext)
           
 void buildRuntimeConfiguration()
           
 void destroy()
          Allow the Configuration to clean up any resources that have been used.
 Container getContainer()
           
 Set<String> getLoadedFileNames()
           
 PackageConfig getPackageConfig(String name)
           
 Set<String> getPackageConfigNames()
           
 Map<String,PackageConfig> getPackageConfigs()
           
 RuntimeConfiguration getRuntimeConfiguration()
          The current runtime configuration.
 List<UnknownHandlerConfig> getUnknownHandlerStack()
           
 void rebuildRuntimeConfiguration()
           
 void reload(List<ConfigurationProvider> providers)
           
 List<PackageProvider> reloadContainer(List<ContainerProvider> containerProviders)
           
 PackageConfig removePackageConfig(String name)
          Removes a package from the the list of packages.
 void selfRegister()
           
 void setUnknownHandlerStack(List<UnknownHandlerConfig> unknownHandlerStack)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

packages

private Map<String,PackageConfig> packages

loadedFiles

private Set<String> loadedFiles

container

private Container container

unknownHandlerStack

protected List<UnknownHandlerConfig> unknownHandlerStack

builder

private ContainerBuilder builder
Constructor Detail

MockConfiguration

public MockConfiguration()
Method Detail

selfRegister

public void selfRegister()

getPackageConfig

public PackageConfig getPackageConfig(String name)
Specified by:
getPackageConfig in interface Configuration

getPackageConfigNames

public Set<String> getPackageConfigNames()
Specified by:
getPackageConfigNames in interface Configuration

getPackageConfigs

public Map<String,PackageConfig> getPackageConfigs()
Specified by:
getPackageConfigs in interface Configuration

getRuntimeConfiguration

public RuntimeConfiguration getRuntimeConfiguration()
Description copied from interface: Configuration
The current runtime configuration. Currently, if changes have been made to the Configuration since the last time buildRuntimeConfiguration() was called, you'll need to make sure to.

Specified by:
getRuntimeConfiguration in interface Configuration
Returns:
the current runtime configuration

addPackageConfig

public void addPackageConfig(String name,
                             PackageConfig packageContext)
Specified by:
addPackageConfig in interface Configuration

buildRuntimeConfiguration

public void buildRuntimeConfiguration()

destroy

public void destroy()
Description copied from interface: Configuration
Allow the Configuration to clean up any resources that have been used.

Specified by:
destroy in interface Configuration

rebuildRuntimeConfiguration

public void rebuildRuntimeConfiguration()
Specified by:
rebuildRuntimeConfiguration in interface Configuration

reload

public void reload(List<ConfigurationProvider> providers)
            throws ConfigurationException
Specified by:
reload in interface Configuration
Throws:
ConfigurationException

removePackageConfig

public PackageConfig removePackageConfig(String name)
Description copied from interface: Configuration
Removes a package from the the list of packages. Changes to the configuration won't take effect until buildRuntimeConfiguration is called.

Specified by:
removePackageConfig in interface Configuration
Parameters:
name - the name of the package to remove
Returns:
the package removed (if any)

getContainer

public Container getContainer()
Specified by:
getContainer in interface Configuration
Returns:
the container

getLoadedFileNames

public Set<String> getLoadedFileNames()
Specified by:
getLoadedFileNames in interface Configuration

reloadContainer

public List<PackageProvider> reloadContainer(List<ContainerProvider> containerProviders)
                                      throws ConfigurationException
Specified by:
reloadContainer in interface Configuration
Throws:
ConfigurationException

getUnknownHandlerStack

public List<UnknownHandlerConfig> getUnknownHandlerStack()
Specified by:
getUnknownHandlerStack in interface Configuration
Returns:
list of unknown handlers

setUnknownHandlerStack

public void setUnknownHandlerStack(List<UnknownHandlerConfig> unknownHandlerStack)
Specified by:
setUnknownHandlerStack in interface Configuration


Copyright © 2000-2009 Apache Software Foundation. All Rights Reserved.