de.novanic.eventservice.config.loader
Class WebDescriptorConfigurationLoader

java.lang.Object
  extended by de.novanic.eventservice.config.loader.WebDescriptorConfigurationLoader
All Implemented Interfaces:
ConfigurationLoader

public class WebDescriptorConfigurationLoader
extends java.lang.Object
implements ConfigurationLoader

WebDescriptorConfigurationLoader is used by EventServiceConfigurationFactory to load the EventServiceConfiguration with the servlet parameters / init-parameters of the web-descriptor.

Author:
sstrohschein
Date: 05.03.2009
Time: 23:37:15

Constructor Summary
WebDescriptorConfigurationLoader(javax.servlet.ServletConfig aServletConfig)
           
 
Method Summary
 boolean isAvailable()
          Checks if the configuration is available and can be loaded.
 EventServiceConfiguration load()
          Loads the configuration with the WebDescriptorConfigurationLoader.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WebDescriptorConfigurationLoader

public WebDescriptorConfigurationLoader(javax.servlet.ServletConfig aServletConfig)
Method Detail

isAvailable

public boolean isAvailable()
Checks if the configuration is available and can be loaded. If no configuration is available, the load method ConfigurationLoader.load() shouldn't called. In the case of WebDescriptorConfigurationLoader the method returns true when the init-parameters for the servlet are registered in the web-descriptor.

Specified by:
isAvailable in interface ConfigurationLoader
Returns:
true when available, otherwise false

load

public EventServiceConfiguration load()
Loads the configuration with the WebDescriptorConfigurationLoader.

Specified by:
load in interface ConfigurationLoader
Returns:
EventServiceConfiguration the loaded configuration
Throws:
ConfigurationException - occurs when the configuration can't be loaded or if it contains unreadable values.