com.ail.core
Class Component

java.lang.Object
  extended by com.ail.core.Component
All Implemented Interfaces:
ConfigurationOwner, CoreUser, java.io.Serializable
Direct Known Subclasses:
EJBComponent

public abstract class Component
extends java.lang.Object
implements CoreUser, ConfigurationOwner

This class is the abstract supclass of all Components. A component is simply a way of grouping entry points together. It isn't required that all components extend this class, but it does save implementation effort.

Version:
$Revision: 1.6 $
See Also:
Serialized Form

Constructor Summary
Component()
           
 
Method Summary
 Configuration getConfiguration()
          Default component implementation of the getConfiguration method.
 java.lang.String getConfigurationNamespace()
          Default component implementation of the getConfigurationNamespace method.
abstract  Core getCore()
          Fetch the entry point's instance of the core.
abstract  Version getVersion()
          Return the version details of this component.
 VersionEffectiveDate getVersionEffectiveDate()
          A default component implemention returning the time now.
 void resetConfiguration()
          Default component implementation of the resetConfiguration method.
 void setConfiguration(Configuration configuration)
          Default component implementation of the setConfiguration method.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Component

public Component()
Method Detail

getVersion

public abstract Version getVersion()
Return the version details of this component.

Returns:
version details

getVersionEffectiveDate

public VersionEffectiveDate getVersionEffectiveDate()
A default component implemention returning the time now. Components with a critical dependency on selecting the version effective date should override this method.

Specified by:
getVersionEffectiveDate in interface CoreUser
Returns:
VersionEffectiveDate now.

getCore

public abstract Core getCore()
Fetch the entry point's instance of the core.

Returns:
The core being used by the entry points.

setConfiguration

public void setConfiguration(Configuration configuration)
Default component implementation of the setConfiguration method. This method takes care of saving configrations on the behalf of the entry point.

Specified by:
setConfiguration in interface ConfigurationOwner
Parameters:
configuration - The configuration to save.

getConfiguration

public Configuration getConfiguration()
Default component implementation of the getConfiguration method. This method takes care of loading configurations on the behalf of the component.

Specified by:
getConfiguration in interface ConfigurationOwner
Returns:
The loaded configuration.

getConfigurationNamespace

public java.lang.String getConfigurationNamespace()
Default component implementation of the getConfigurationNamespace method. The name of the component class is returned.

Specified by:
getConfigurationNamespace in interface CoreUser
Returns:
The classes namespace

resetConfiguration

public void resetConfiguration()
Default component implementation of the resetConfiguration method. This implementation loads the default config from the class resource file named "DefaultConfig.xml". For an component named 'Red', the resource 'RedDefaultConfig.xml' is loaded.

Note: If the component's name ends with 'Bean' - as EJB based ones do, the 'Bean' postfix is removed (RedBean -> Red).

Specified by:
resetConfiguration in interface ConfigurationOwner