Class AbstractStandaloneLocalConfigurationWithXMLConfigurationBuilder

    • Constructor Detail

      • AbstractStandaloneLocalConfigurationWithXMLConfigurationBuilder

        public AbstractStandaloneLocalConfigurationWithXMLConfigurationBuilder​(String dir)
        Parameters:
        dir - configuration home
    • Method Detail

      • getNamespaces

        protected abstract Map<String,​String> getNamespaces()
        Implementations should avoid passing null, and instead pass Collections.EMPTY_MAP, if the document is DTD bound.
        Returns:
        a map of prefixes to the url namespaces used in the datasource configuration file.
      • getXpathForDataSourcesParent

        protected abstract String getXpathForDataSourcesParent()
        DataSource entries must be stored in the xml configuration file. Under which element do we insert the entries? example: //Engine/DefaultContext
        Returns:
        path the the parent element datasources should be inserted under.
      • getXpathForResourcesParent

        protected abstract String getXpathForResourcesParent()
        Resource entries must be stored in the xml configuration file. Under which element do we insert the entries? example: //Engine/DefaultContext
        Returns:
        path the the parent element Resources should be inserted under.
      • getOrCreateDataSourceConfigurationFile

        protected abstract String getOrCreateDataSourceConfigurationFile​(DataSource ds,
                                                                         LocalContainer container)
        note that this file could hold other configuration besides datasources.
        Parameters:
        ds - the DataSource configuration you wish to install on the container.
        container - the container whose configuration you wish to affect.
        Returns:
        the file that holds datasource configuration.
      • getOrCreateResourceConfigurationFile

        protected abstract String getOrCreateResourceConfigurationFile​(Resource resource,
                                                                       LocalContainer container)
        note that this file could hold other configuration besides Resources.
        Parameters:
        resource - the Resource configuration you wish to install on the container.
        container - the container whose configuration you wish to affect.
        Returns:
        the file that holds Resource configuration.
      • createConfigurationBuilder

        protected abstract ConfigurationBuilder createConfigurationBuilder​(LocalContainer container)
        Parameters:
        container - Container the dataSource will be configured on.
        Returns:
        the object that produces xml entries for DataSource definitions.
      • configureDataSources

        public void configureDataSources​(LocalContainer container)
        Configure the DataSources defined for this configuration.
        Specified by:
        configureDataSources in interface DataSourceSupport
        Parameters:
        container - the container whose configuration you wish to affect.
      • configure

        public void configure​(Resource ds,
                              LocalContainer container)
        Specified by:
        configure in interface ResourceSupport
        Parameters:
        ds - the Resource configuration you wish to install on the container.
        container - the container whose configuration you wish to affect.
      • configureResources

        public void configureResources​(LocalContainer container)
        Configure the Resources defined for this configuration.
        Specified by:
        configureResources in interface ResourceSupport
        Parameters:
        container - the container whose configuration you wish to affect.
      • configure

        public void configure​(DataSource ds,
                              LocalContainer container)
        Specified by:
        configure in interface DataSourceSupport
        Parameters:
        ds - the DataSource configuration you wish to install on the container.
        container - the container whose configuration you wish to affect.
      • writeConfigurationToXpath

        protected void writeConfigurationToXpath​(String file,
                                                 String xml,
                                                 String path)
        Utility method used to write XML to an appropriate place in the configuration file.
        Parameters:
        file - where to write the datasource configuration to.
        xml - node you wish to write to the resources configuration file.
        path - where in the file to write the configuration.