com.opensymphony.module.sitemesh.mapper
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Nested Class Summary | |
|---|---|
private static class |
ConfigLoader.State
State visibile across threads stored in a single container so that we can efficiently atomically access it with the guarantee that we wont see a partially loaded configuration in the face of one thread reloading the configuration while others are trying to read it. |
| Field Summary | |
|---|---|
private Config |
config
|
private File |
configFile
|
private String |
configFileName
|
private ConfigLoader.State |
state
Mark volatile so that the installation of new versions is guaranteed to be visible across threads. |
| Constructor Summary | |
|---|---|
ConfigLoader(File configFile)
Create new ConfigLoader using supplied File. |
|
ConfigLoader(String configFileName,
Config config)
Create new ConfigLoader using supplied filename and config. |
|
| Method Summary | |
|---|---|
private static String |
getAttribute(Element element,
String name)
|
private static String |
getContainedText(Node parent,
String childTagName)
|
Decorator |
getDecoratorByName(String name)
Retrieve Decorator based on name specified in configuration file. |
String |
getMappedName(String path)
Get name of Decorator mapped to given path. |
private ConfigLoader.State |
loadConfig()
Load configuration from file. |
private void |
parseConfig(ConfigLoader.State newState,
Document document)
|
private void |
populatePathMapper(ConfigLoader.State newState,
NodeList patternNodes,
String role,
String name)
|
private ConfigLoader.State |
refresh()
Check if configuration file has been updated, and if so, reload. |
private void |
storeDecorator(ConfigLoader.State newState,
Decorator d)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private volatile ConfigLoader.State state
private File configFile
private String configFileName
private Config config
| Constructor Detail |
|---|
public ConfigLoader(File configFile) throws ServletException
ServletExceptionpublic ConfigLoader(String configFileName, Config config) throws ServletException
ServletException| Method Detail |
|---|
public Decorator getDecoratorByName(String name) throws ServletException
ServletExceptionpublic String getMappedName(String path) throws ServletException
ServletExceptionprivate ConfigLoader.State loadConfig() throws ServletException
ServletExceptionprivate void parseConfig(ConfigLoader.State newState, Document document)
private void populatePathMapper(ConfigLoader.State newState, NodeList patternNodes, String role, String name)
private static String getAttribute(Element element, String name)
private static String getContainedText(Node parent, String childTagName)
private void storeDecorator(ConfigLoader.State newState, Decorator d)
private ConfigLoader.State refresh() throws ServletException
ServletException
|
www.opensymphony.com/sitemesh/ | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||