Class CatalogLocation


  • public class CatalogLocation
    extends java.lang.Object
    A ThreadSpecificCatalogs class maintains all catalogfiles catolog.xml found in the Thread.currentThread().getContextClassLoader().
    Version:
    $Revision$
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private static java.lang.String[] catalogFilesNames
      The catalog is assembled by taking into account all accessible resources whose name is META-INF/jax-ws-catalog.xml.
      private Resolver catologResolver  
      private boolean isLastEntityResolved  
      private java.net.URL location  
      private static org.jboss.logging.Logger log  
    • Constructor Summary

      Constructors 
      Constructor Description
      CatalogLocation​(java.net.URL url)
      Create a new CatalogLocation.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object other)
      To catalog locations are qual if the location is equal.
      int hashCode()
      Two catalog locations have the same hash code if the location is equal.
      boolean isEntityResolved()
      Returns the boolean value to inform id DTD was found in the XML file or not
      private java.io.InputStream loadResource​(java.lang.String resolvedURI)
      Loads the resolved resource.
      static java.net.URL lookupCatalogFiles()
      Seach the path for oasis catalog files.
      org.xml.sax.InputSource resolveEntity​(java.lang.String publicId, java.lang.String systemId)
      Tries to resolve the entity using the thread specific catolog resolvers
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • log

        private static org.jboss.logging.Logger log
      • catalogFilesNames

        private static final java.lang.String[] catalogFilesNames
        The catalog is assembled by taking into account all accessible resources whose name is META-INF/jax-ws-catalog.xml. Each resource MUST be a valid entity catalog according to the XML Catalogs
      • catologResolver

        private final Resolver catologResolver
      • location

        private final java.net.URL location
      • isLastEntityResolved

        private boolean isLastEntityResolved
    • Constructor Detail

      • CatalogLocation

        public CatalogLocation​(java.net.URL url)
                        throws java.io.IOException
        Create a new CatalogLocation.
        Parameters:
        url - - the location of the catalog xml file
        Throws:
        java.io.IOException - if the catalog files cannot be loaded
    • Method Detail

      • resolveEntity

        public org.xml.sax.InputSource resolveEntity​(java.lang.String publicId,
                                                     java.lang.String systemId)
                                              throws java.net.MalformedURLException,
                                                     java.io.IOException
        Tries to resolve the entity using the thread specific catolog resolvers
        Parameters:
        publicId - - Public ID of DTD, or null if it is a schema
        systemId - - the system ID of DTD or Schema
        Returns:
        InputSource of entity
        Throws:
        java.net.MalformedURLException - - if the url is wrong
        java.io.IOException - - error reading the local file
      • lookupCatalogFiles

        public static java.net.URL lookupCatalogFiles()
                                               throws java.io.IOException
        Seach the path for oasis catalog files. The classpath of Thread.currentThread().getContextClassLoader() is used for the lookup.
        Returns:
        the url where the jax-ws-catalog.xml is located
        Throws:
        java.io.IOException - if the catalog files cannot be loaded
      • isEntityResolved

        public boolean isEntityResolved()
        Returns the boolean value to inform id DTD was found in the XML file or not
        Returns:
        boolean - true if DTD was found in XML
      • loadResource

        private java.io.InputStream loadResource​(java.lang.String resolvedURI)
                                          throws java.io.IOException
        Loads the resolved resource.
        Parameters:
        resolvedURI - - the full qualified URI of the resoved local ressource
        Returns:
        - the inputstram represnting this resource
        Throws:
        java.io.IOException - - if the resource cannot be opened
      • equals

        public boolean equals​(java.lang.Object other)
        To catalog locations are qual if the location is equal.
        Overrides:
        equals in class java.lang.Object
        Parameters:
        other - - the catlog location to compare
        Returns:
        true if equal
      • hashCode

        public int hashCode()
        Two catalog locations have the same hash code if the location is equal.
        Overrides:
        hashCode in class java.lang.Object
        Returns:
        - the hash code