Class StandardContextSF

  • All Implemented Interfaces:
    IStoreFactory

    public class StandardContextSF
    extends StoreFactoryBase
    Store server.xml Context element with all children
    • Store all context at server.xml
    • Store existing app.xml context a conf/enginename/hostname/app.xml
    • Store with backup
    • Constructor Detail

      • StandardContextSF

        public StandardContextSF()
    • Method Detail

      • storeContextSeparate

        protected void storeContextSeparate​(java.io.PrintWriter aWriter,
                                            int indent,
                                            StandardContext aContext)
                                     throws java.lang.Exception
        Store a Context without backup add separate file or when configFile = null a aWriter.
        Parameters:
        aWriter - Current output writer
        indent - Indentation level
        aContext - The context which will be stored
        Throws:
        java.lang.Exception - Configuration storing error
      • storeWithBackup

        protected void storeWithBackup​(StandardContext aContext)
                                throws java.lang.Exception
        Store the Context with a Backup.
        Parameters:
        aContext - The context which will be stored
        Throws:
        java.lang.Exception - Configuration storing error
      • getConfigFileWriter

        protected StoreFileMover getConfigFileWriter​(Context context)
                                              throws java.lang.Exception
        Get explicit writer for context (context.getConfigFile()).
        Parameters:
        context - The context which will be stored
        Returns:
        The file mover
        Throws:
        java.lang.Exception - Error getting a writer for the configuration file
      • storeChildren

        public void storeChildren​(java.io.PrintWriter aWriter,
                                  int indent,
                                  java.lang.Object aContext,
                                  StoreDescription parentDesc)
                           throws java.lang.Exception
        Store the specified context element children.
        Overrides:
        storeChildren in class StoreFactoryBase
        Parameters:
        aWriter - Current output writer
        indent - Indentation level
        aContext - Context to store
        parentDesc - The element description
        Throws:
        java.lang.Exception - Configuration storing error
      • configBase

        protected java.io.File configBase​(Context context)
        Return a File object representing the "configuration root" directory for our associated Host.
        Parameters:
        context - The context instance
        Returns:
        a file to the configuration base path
      • filterWatchedResources

        protected java.lang.String[] filterWatchedResources​(StandardContext context,
                                                            java.lang.String[] wresources)
                                                     throws java.lang.Exception
        Filter out the default watched resources, to remove standard ones.
        Parameters:
        context - The context instance
        wresources - The raw watched resources list
        Returns:
        The filtered watched resources
        Throws:
        java.lang.Exception - Configuration storing error TODO relative watched resources TODO absolute handling configFile TODO Filename case handling for Windows? TODO digester variable substitution $catalina.base, $catalina.home