public abstract class AbstractServiceConfigurationValidator extends java.lang.Object implements ServiceConfigurationValidator
Title: Open Service Framework
Description: This is the base class for any Configuration Validator
.
Developers that wish to create custom Validators
for their services should extend this class. The mechanism
for writing a validator is very simple. The constructor accepts a ServiceConfigurationProperties
list which is
by default passed by the AbstractServiceConfigurationObject
inside the AbstractServiceConfigurationObject.validate()
method. At run-time the Validator
's invocation is managed by the service framework. When a service is
initialized all pre-processing of the properties (such as expansion from Global Variables
) is performed on
the properties and the Service then invokes the Validator
. If the ServiceConfigurationValidatorResults
are returned with any pending messages, the Service suspends its execution and emits a State Notification Event
indicating that a run-time configuration error has occured. The Service accesses configuratin properties in read-only mode.
In order to change the values of the properties the Service Configuration Artifact
would need to be edited by a
user and the Service woudl have to be re-loaded in order to pick up the changes. The validator would then pick up any changed
values.
A Validator
has a single method ServiceConfigurationValidator.validate()
that the developer must implement in
order to affect validation of the configuration properties. The framework supplies a default Validator
called
DefaultValidator
that can perform basic type checking for all factory-supplied property types. However, more complex
Services may have significant inter-dependencies between configuration properties. Therefore developers may need to create custom
Validators
that allow for such inter-dependencies to be tested.
Validators
may be chained by calling several validation modules in a sequence and merging the results into a
single result set using ServiceConfigurationValidatorResults.addResultsAll(ServiceConfigurationValidatorResults)
. In this way developers may reuse available
validator routines and combine their capabiltites.
Copyright: Copyright (c) 2008
Company: StreamScape Technologies
Constructor and Description |
---|
AbstractServiceConfigurationValidator() |
AbstractServiceConfigurationValidator(ServiceConfigurationProperties serviceProperties) |
Modifier and Type | Method and Description |
---|---|
ServiceConfigurationProperties |
getProperties() |
ServiceConfigurationValidatorResults |
getValidationResultSet()
Returns this validator's result set object.
|
java.lang.String |
getValidatorName()
Returns this validator's class name.
|
void |
setProperties(ServiceConfigurationProperties p) |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
validate
public AbstractServiceConfigurationValidator(ServiceConfigurationProperties serviceProperties)
public AbstractServiceConfigurationValidator()
public final void setProperties(ServiceConfigurationProperties p)
public final ServiceConfigurationProperties getProperties()
public final ServiceConfigurationValidatorResults getValidationResultSet()
public final java.lang.String getValidatorName()
Copyright © 2015-2024 StreamScape Technologies. All rights reserved.