Package gw.config

Class Registry


  • public class Registry
    extends java.lang.Object
    • Field Detail

      • TAG_ALLOW_DEPRECATED_REFERENCES

        public static final java.lang.String TAG_ALLOW_DEPRECATED_REFERENCES
        The xml tag for indicating if deprecated methods/properties s/b allowed.
        See Also:
        Constant Field Values
      • TAG_ALLOW_ENTITY_QUERIES

        public static final java.lang.String TAG_ALLOW_ENTITY_QUERIES
        The xml tag for indicating if Gosu query expressions can reference entities.
        See Also:
        Constant Field Values
      • COMMON_SERVICE_INIT

        private static final java.lang.String COMMON_SERVICE_INIT
        The xml tag for indicating what class to use to initialize Gosu's Common Services with.
        See Also:
        Constant Field Values
      • TAG_SERIALIZATION

        private static final java.lang.String TAG_SERIALIZATION
        See Also:
        Constant Field Values
      • g_instance

        private static Registry g_instance
        The singleton instance of this class.
      • g_listeners

        private static java.util.List g_listeners
        A list of init listeners.
      • _bAllowDeprecatedReferences

        private boolean _bAllowDeprecatedReferences
        Indicates if deprecated methods/properties s/b allowed.
      • _bAllowEntityQueires

        private boolean _bAllowEntityQueires
        Indicates if Gosu query expressions can reference entities.
      • _additionalTypeLoaderSpecs

        private java.util.List<TypeLoaderSpec> _additionalTypeLoaderSpecs
        XMLNode specifications for additional typeloaders that will be created for this runtime environment
      • _classpathEntries

        private java.util.List<java.lang.String> _classpathEntries
        Classpath entries from the registry
      • _commonServiceInit

        private java.lang.String _commonServiceInit
        The entity access class.
      • _registerUrl

        private java.net.URL _registerUrl
        The URL of the active registry
    • Constructor Detail

      • Registry

        public Registry​(java.lang.String kernelInitClass)
      • Registry

        private Registry​(java.net.URL registrURL,
                         java.lang.String strCommonServicesInitDefault)
    • Method Detail

      • initDefaults

        public static void initDefaults()
        /** Initialize with defaults. Guidewire applications should NEVER call this.
      • setLocation

        public static void setLocation​(java.lang.String kernelInitClass)
      • setLocation

        public static void setLocation​(java.net.URL registryURL)
        Sets the location of the registry file. Initializes singleton registry.
        Parameters:
        registryURL -
      • setLocation

        public static void setLocation​(java.net.URL registryURL,
                                       java.lang.String strCommonServicesInitDefault)
      • addLocationListener

        public static void addLocationListener​(javax.swing.event.ChangeListener l)
      • removeLocationListener

        public static void removeLocationListener​(javax.swing.event.ChangeListener l)
      • fireLocationChanged

        private static void fireLocationChanged()
      • getDocument

        private org.w3c.dom.Document getDocument​(java.net.URL registrURL)
                                          throws java.io.IOException,
                                                 javax.xml.parsers.ParserConfigurationException,
                                                 org.xml.sax.SAXException
        Throws:
        java.io.IOException
        javax.xml.parsers.ParserConfigurationException
        org.xml.sax.SAXException
      • disableExternalEntities

        private void disableExternalEntities​(javax.xml.parsers.DocumentBuilderFactory dbf)
                                      throws javax.xml.parsers.ParserConfigurationException
        The purpose of this method is to prevent vulnerabilities related to XXE (XML external entity injection). Although the nature of Gosu's registry in this case is such that it is _not_ vulnerable, we configure the parser in this way to appease those who demand zero alarm results from static analysis tooling such as Veracode.
        Throws:
        javax.xml.parsers.ParserConfigurationException
      • getTag

        private org.w3c.dom.Node getTag​(org.w3c.dom.Document doc,
                                        java.lang.String tagName)
      • instance

        public static Registry instance()
        Get the singleton instance.
        Returns:
        The one and only Registry.
      • getCommonServiceInit

        public java.lang.String getCommonServiceInit()
        Returns:
      • setCommonServiceInit

        public void setCommonServiceInit​(java.lang.String commonServiceInit)
        Parameters:
        commonServiceInit -
      • getAdditionalTypeLoaders

        public java.util.List<TypeLoaderSpec> getAdditionalTypeLoaders()
      • getClasspathEntries

        public java.util.List<java.lang.String> getClasspathEntries()
      • isAllowDeprecatedReferences

        public boolean isAllowDeprecatedReferences()
        Returns:
      • setAllowDeprecatedReferences

        public void setAllowDeprecatedReferences​(boolean bAllowDeprecatedReferences)
      • isAllowEntityQueires

        public boolean isAllowEntityQueires()
        Returns:
      • setAllowEntityQueires

        public void setAllowEntityQueires​(boolean bAllowEntityQueires)
      • updateClasspath

        public void updateClasspath​(java.util.List<java.lang.String> classpath)
      • canWrite

        private boolean canWrite​(java.io.File file)