Class LocalServiceRegistry.ConfigurationValidator

Direct Known Subclasses:
ServiceRegistry.ConfigurationValidator
Enclosing class:
LocalServiceRegistry

public static class LocalServiceRegistry.ConfigurationValidator extends PluginRegistry.ConfigurationValidator
Checks the configuration of the LocalServiceRegistry.
  • Constructor Details

    • ConfigurationValidator

      public ConfigurationValidator()
  • Method Details

    • getServiceInstances

      protected List<String> getServiceInstances(Configuration configuration, String serviceType)
      Gets the names of all component instances of the designated service type, that is the declared instances or the anonymous instance if there are no declared ones. This does not check whether the service type is declared at all.
      Parameters:
      configuration - The configuration providing the declared instances of the designated service type.
      serviceType - The name of the service type to get the instances of.
      Returns:
      The names of the declared instances of the designated service type or the name of the service type denoting the anonymous instance. This will never be null nor empty.
    • checkLocalServices

      protected List<String> checkLocalServices(Configuration configuration, String serviceType) throws ConfigurationException
      Checks whether all instances of the designated service type are local services, that is each of them provides an implementation (class or object) and none of them is a private remote service. Since a registry can only create local services, this is required for each service type the registry itself needs.
      In case there are no declared instances, the anonymous instance needs to be a local service. Therefore this also ensures that at least one instance of the designated service type is available.
      Parameters:
      configuration - The configuration to check for implementations and service URIs of the instances of the designated service type.
      serviceType - The name of the service type to check the instances of.
      Returns:
      The names of the checked instances of the designated service type. This will never be null nor empty.
      Throws:
      ConfigurationException - If an instance of the designated service type does not provide an implementation or provides a service URI, a ConfigurationException will be thrown.
    • checkForNonExportedLocal

      protected void checkForNonExportedLocal(Configuration configuration, String serviceType) throws ConfigurationException
      Checks whether the instances of the designated service type are exported or published in the designated properties. If so, they will be rebuked.
      Parameters:
      configuration - The configuration to check for export or publish properties.
      serviceType - The name of the service type to check the instances of.
      Throws:
      ConfigurationException - If an instance of the designated service type is exported or published, a ConfigurationException will be thrown.
    • validate

      protected void validate(Configuration configuration) throws ConfigurationException
      Checks that the model factory registry is a local service since the registry needs it for creating any service or plugin. Furthermore this checks that no JDBC_DATA_SOURCE is exported. This does not work since Connections are not serialisable.
      Overrides:
      validate in class PluginRegistry.ConfigurationValidator
      Parameters:
      configuration - The configuration to check for properly configured plugin types.
      Throws:
      ConfigurationException - If there are incorrectly configured plugin types in the designated configuration, a ConfigurationException will be thrown.
      See Also: