org.jcoderz.commons.config
Class ConfigurationServiceImpl

java.lang.Object
  extended by org.jcoderz.commons.config.ConfigurationServiceCommonImpl
      extended by org.jcoderz.commons.config.ConfigurationServiceImpl
All Implemented Interfaces:
ConfigurationServiceCommonInterface, ConfigurationServiceInterface
Direct Known Subclasses:
ConfigurationServiceBean

public class ConfigurationServiceImpl
extends ConfigurationServiceCommonImpl
implements ConfigurationServiceInterface

Implementation of the ConfigurationService business methods. This class holds all business logic of the service to fetch specific configuration data. Implementing the business interface ConfigurationServiceInterface. On this level only primitive types String, int, long and boolean are used. The well-formed and complex typed interfaces for the specific services are using this more simple interface. IMPORTANT: Because of XDoclet Bug in current version, we define delegators to the super class with ejb-tags here. These should be deleted if XDoclet is fixed.


Constructor Summary
ConfigurationServiceImpl()
           
 
Method Summary
 void addConfigurationListener(ConfigurationListener listener)
          ConfigurationListener instance that will be registered to receive notifications.
 boolean getBoolean(ConfigurationKey key)
          Returns the boolean value that is associated with the given key.
 int getInt(ConfigurationKey key)
          Returns the int value that is associated with the given key.
 long getLong(ConfigurationKey key)
          Returns the long value that is associated with the given key.
 ServiceConfiguration getServiceConfiguration(String classname)
          gets the ServiceConfiguration interface related to the given *Service*Configuration classname.
 String getString(ConfigurationKey key)
          Returns the String value that is associated with the given key.
 
Methods inherited from class org.jcoderz.commons.config.ConfigurationServiceCommonImpl
getConfigurationCacheCurrent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConfigurationServiceImpl

public ConfigurationServiceImpl()
Method Detail

addConfigurationListener

public void addConfigurationListener(ConfigurationListener listener)
                              throws ArgumentMalformedException
ConfigurationListener instance that will be registered to receive notifications.

Specified by:
addConfigurationListener in interface ConfigurationServiceInterface
Parameters:
listener - ConfigurationListener instance that will be registered to receive notifications.
Throws:
ArgumentMalformedException - Is thrown to indicate the illegal use of a null object as input parameter.
ejb.interface-method
view-type="remote"
ejb.transaction
type="Required"

getServiceConfiguration

public ServiceConfiguration getServiceConfiguration(String classname)
                                             throws ArgumentMalformedException
gets the ServiceConfiguration interface related to the given *Service*Configuration classname. This is the factory method that is used in the generated Container and Client Factories for the given service.

Specified by:
getServiceConfiguration in interface ConfigurationServiceInterface
Parameters:
classname - the service configuration interface classname (full qualified) for which the ServiceConfiguration interface should be created. The classname MUST include the complete package path.
Returns:
the related ServiceConfiguration instance
Throws:
ArgumentMalformedException - Is thrown to indicate the illegal use of a null object as input parameter.

getBoolean

public boolean getBoolean(ConfigurationKey key)
                   throws ConfigurationValueNotFoundException,
                          ConfigurationTypeConversionFailedException,
                          ArgumentMalformedException
Returns the boolean value that is associated with the given key. FIXME: activate ejb tag if XDoclet BugFix is available

Specified by:
getBoolean in interface ConfigurationServiceCommonInterface
Overrides:
getBoolean in class ConfigurationServiceCommonImpl
Parameters:
key - ConfigurationKey that is the key for a stored configuration value.
Returns:
the boolean value that is associated with the given key.
Throws:
ConfigurationValueNotFoundException - in case there is no match to key.
ConfigurationTypeConversionFailedException - in case the found value could not be converted to boolean type.
ArgumentMalformedException - Is thrown to indicate the illegal use of a null object as input parameter.
ejb.interface-method
view-type="remote"
ejb.transaction
type="Required"

getInt

public int getInt(ConfigurationKey key)
           throws ConfigurationValueNotFoundException,
                  ConfigurationTypeConversionFailedException,
                  ArgumentMalformedException
Returns the int value that is associated with the given key. FIXME: activate ejb tag if XDoclet BugFix is available

Specified by:
getInt in interface ConfigurationServiceCommonInterface
Overrides:
getInt in class ConfigurationServiceCommonImpl
Parameters:
key - ConfigurationKey that is the key for a stored configuration value.
Returns:
the int value that is associated with the given key.
Throws:
ConfigurationValueNotFoundException - in case there is no match to the key.
ConfigurationTypeConversionFailedException - in case the found value could not be converted to int type.
ArgumentMalformedException - Is thrown to indicate the illegal use of a null object as input parameter.
ejb.interface-method
view-type="remote"
ejb.transaction
type="Required"

getLong

public long getLong(ConfigurationKey key)
             throws ConfigurationValueNotFoundException,
                    ConfigurationTypeConversionFailedException,
                    ArgumentMalformedException
Returns the long value that is associated with the given key. FIXME: activate ejb tag if XDoclet BugFix is available

Specified by:
getLong in interface ConfigurationServiceCommonInterface
Overrides:
getLong in class ConfigurationServiceCommonImpl
Parameters:
key - ConfigurationKey that is the key for a stored configuration value.
Returns:
the long value that is associated with the given key.
Throws:
ConfigurationValueNotFoundException - in case there is no match to the key.
ConfigurationTypeConversionFailedException - in case the found value could not be converted to long type.
ArgumentMalformedException - Is thrown to indicate the illegal use of a null object as input parameter.
ejb.interface-method
view-type="remote"
ejb.transaction
type="Required"

getString

public String getString(ConfigurationKey key)
                 throws ConfigurationValueNotFoundException,
                        ArgumentMalformedException
Returns the String value that is associated with the given key. FIXME: activate ejb tag if XDoclet BugFix is available

Specified by:
getString in interface ConfigurationServiceCommonInterface
Overrides:
getString in class ConfigurationServiceCommonImpl
Parameters:
key - ConfigurationKey that is the key for a stored configuration value.
Returns:
the String value that is associated with the given key.
Throws:
ConfigurationValueNotFoundException - in case there is no match to the key.
ArgumentMalformedException - Is thrown to indicate the illegal use of a null object as input parameter.
ejb.interface-method
view-type="remote"
ejb.transaction
type="Required"


Copyright 2007 The jCoderZ Project.