Package gw.config

Class Registry

java.lang.Object
gw.config.Registry

public class Registry extends Object
  • Field Details

    • TAG_ALLOW_DEPRECATED_REFERENCES

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

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

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

      private static final String TAG_SERIALIZATION
      See Also:
    • TAG_TYPELOADERS

      private static final String TAG_TYPELOADERS
      See Also:
    • TAG_TYPELOADER

      private static final String TAG_TYPELOADER
      See Also:
    • TAG_CLASSPATH

      private static final String TAG_CLASSPATH
      See Also:
    • TAG_CLASS

      public static final String TAG_CLASS
      See Also:
    • TAG_SRC

      public static final String TAG_SRC
      See Also:
    • TAG_ENTRY

      public static final String TAG_ENTRY
      See Also:
    • g_instance

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

      private static 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 List<TypeLoaderSpec> _additionalTypeLoaderSpecs
      XMLNode specifications for additional typeloaders that will be created for this runtime environment
    • _classpathEntries

      private List<String> _classpathEntries
      Classpath entries from the registry
    • _commonServiceInit

      private String _commonServiceInit
      The entity access class.
    • _registerUrl

      private URL _registerUrl
      The URL of the active registry
  • Constructor Details

    • Registry

      public Registry(String kernelInitClass)
    • Registry

      private Registry(URL registrURL, String strCommonServicesInitDefault)
  • Method Details

    • initDefaults

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

      public static void setLocation(String kernelInitClass)
    • setLocation

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

      public static void setLocation(URL registryURL, String strCommonServicesInitDefault)
    • addLocationListener

      public static void addLocationListener(ChangeListener l)
    • removeLocationListener

      public static void removeLocationListener(ChangeListener l)
    • fireLocationChanged

      private static void fireLocationChanged()
    • getDocument

      private Document getDocument(URL registrURL) throws IOException, ParserConfigurationException, SAXException
      Throws:
      IOException
      ParserConfigurationException
      SAXException
    • disableExternalEntities

      private void disableExternalEntities(DocumentBuilderFactory dbf) throws 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:
      ParserConfigurationException
    • getTag

      private Node getTag(Document doc, String tagName)
    • instance

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

      public String getCommonServiceInit()
      Returns:
    • setCommonServiceInit

      public void setCommonServiceInit(String commonServiceInit)
      Parameters:
      commonServiceInit -
    • getAdditionalTypeLoaders

      public List<TypeLoaderSpec> getAdditionalTypeLoaders()
    • getClasspathEntries

      public List<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(List<String> classpath)
    • canWrite

      private boolean canWrite(File file)