com.objectwave.configuration
Class BasicPropertySource

java.lang.Object
  |
  +--com.objectwave.configuration.BasicPropertySource
All Implemented Interfaces:
PropertySource
Direct Known Subclasses:
BrokerPropertySource, FilePropertySource, LoggingPropertySource, SocketProperty, TestPropertySource

public abstract class BasicPropertySource
extends java.lang.Object
implements PropertySource

Common behavior that should help all PropertySource concrete classes.

Version:
$Id: BasicPropertySource.java,v 2.3 2002/02/28 17:03:44 dave_hoag Exp $
Author:
David Hoag

Field Summary
protected  ConfigurationService configurationService
           
protected  java.lang.String name
           
 
Constructor Summary
BasicPropertySource()
          Constructor for the BasicPropertySource object
 
Method Summary
 java.lang.String getCategoryId()
          Get the default category id that would be generated for this object.
 java.lang.Object getConfigObject()
          A convience method.
 java.lang.Object getConfigurationInstance()
          The result of this method will be cast the appropriate type by the concrete subclass implementations.
 java.lang.Object getConfigurationInstance(java.lang.String category)
          The result of this method will be cast the appropriate type by the concrete subclass implementations.
protected  ConfigurationService getConfigurationService()
          Either get the default service, or the one overridden in my instance var.
 java.lang.String getName()
          A single property source may be used to managed a list several instances of property detail.
 void setConfigurationService(ConfigurationService config)
          Set this value to force this property source to use the specified configuration service, otherwise use the default configuration service.
 void setName(java.lang.String nameValue)
          Support named instances.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.objectwave.configuration.PropertySource
getExpectedClass
 

Field Detail

configurationService

protected ConfigurationService configurationService

name

protected java.lang.String name
Constructor Detail

BasicPropertySource

public BasicPropertySource()
Constructor for the BasicPropertySource object

Method Detail

getCategoryId

public java.lang.String getCategoryId()
Get the default category id that would be generated for this object.

Returns:
A category id as defined by the specific configuration service

getConfigObject

public java.lang.Object getConfigObject()
A convience method. You may not want to deal with configuration exceptions. In which case, you'll certainly want the error logged.

Returns:
The configObject value

getConfigurationInstance

public java.lang.Object getConfigurationInstance(java.lang.String category)
                                          throws ConfigurationException
The result of this method will be cast the appropriate type by the concrete subclass implementations.

Parameters:
category - Get the configuration instance that is specific to this class and the specified category.
Returns:
The configurationInstance value
Throws:
ConfigurationException

getConfigurationInstance

public java.lang.Object getConfigurationInstance()
                                          throws ConfigurationException
The result of this method will be cast the appropriate type by the concrete subclass implementations.

Returns:
The configurationInstance value
Throws:
ConfigurationException

getConfigurationService

protected ConfigurationService getConfigurationService()
Either get the default service, or the one overridden in my instance var.

Returns:
The configurationService value

getName

public java.lang.String getName()
A single property source may be used to managed a list several instances of property detail. Each instance is a 'named' instance. When a detail is being located, the name of the desired instance will be requested.

Specified by:
getName in interface PropertySource
Returns:
String null If your source needs to manage multiple detail objects, you'll need to provide a name.

setName

public void setName(java.lang.String nameValue)
Support named instances.

Parameters:
nameValue - null is legal value

setConfigurationService

public void setConfigurationService(ConfigurationService config)
Set this value to force this property source to use the specified configuration service, otherwise use the default configuration service. This is NOT required to be set

Parameters:
config - The new ConfigurationService value