public abstract class AbstractService extends Object implements Service
Constructor and Description |
---|
AbstractService(Provider provider)
This is the default constructor.
|
Modifier and Type | Method and Description |
---|---|
Map<String,String> |
getConfiguration()
Returns the configuration.
|
String |
getConfigurationValue(Enum<?> key)
Returns the value from the component configuration based on the provided configuration key.
|
String |
getConfigurationValue(String key)
Returns the value from the component configuration based on the provided configuration key.
|
Logger |
getLogger()
Returns the internal logger.
|
String |
getPropertyPart()
Returns the property part.
Property parts enables to replace the input request key with the part defined to enable to reuse services with different configuration blocks. Property parts are the values after the common prefix and before any specific configuration key, or in other words the top context of the configuration. For example: org.fax4j.[partvalue].some.key The org.fax4j is the common prefix, the some.key is the suffix and partvalue is the part to be replaced. |
Provider |
getProvider()
This function returns the provider.
|
void |
initialize(Map<String,String> configuration)
This function initializes the component.
|
protected abstract void |
initializeImpl()
This function initializes the component.
|
void |
setPropertyPart(String propertyPart)
This function sets the property part value.
This function should be called before the initialize method. See org.fax4j.common.ConfigurationHolder.getPropertyPart() for more info. |
public AbstractService(Provider provider)
provider
- The providerpublic final Provider getProvider()
getProvider
in interface ProviderImplementation
public final void initialize(Map<String,String> configuration)
initialize
in interface Initializable
configuration
- The component configurationpublic final Logger getLogger()
public void setPropertyPart(String propertyPart)
setPropertyPart
in interface Service
propertyPart
- The property part valuepublic final String getPropertyPart()
getPropertyPart
in interface ConfigurationHolder
public final Map<String,String> getConfiguration()
getConfiguration
in interface ConfigurationHolder
public final String getConfigurationValue(String key)
getConfigurationValue
in interface ConfigurationHolder
key
- The configuration keypublic final String getConfigurationValue(Enum<?> key)
getConfigurationValue
in interface ConfigurationHolder
key
- The configuration key (toString value will be used)protected abstract void initializeImpl()
Copyright © 2009–2020 fax4j. All rights reserved.