org.apache.geronimo.deployment.xml
Class LocalEntityResolver

java.lang.Object
  extended by org.apache.geronimo.deployment.xml.LocalEntityResolver
All Implemented Interfaces:
EntityResolver

public class LocalEntityResolver
extends Object
implements EntityResolver

Implementation of EntityResolver that looks to the local filesystem. The implementation tries to resolve an entity via the following steps:

The catalog resolving is based on the OASIS XML Catalog Standard. OASIS seems to move it around. Try http://www.oasis-open.org/committees/tc_home.php?wg_abbrev=entity and the list of documents currently at http://www.oasis-open.org/committees/documents.php?wg_abbrev=entity An older version may be at http://www.oasis-open.org/committees/entity/archives/spec-2001-08-01.html and see http://www.oasis-open.org/html/a401.htm


Field Summary
static org.apache.geronimo.gbean.GBeanInfo GBEAN_INFO
           
 
Constructor Summary
LocalEntityResolver(URI catalogFileURI, URI localRepositoryURI, boolean failOnUnresolvable)
           
 
Method Summary
 void addPublicMapping(String publicId, String uri)
           
 void addSystemMapping(String systemId, String uri)
           
 URI getCatalogFileURI()
           
static org.apache.geronimo.gbean.GBeanInfo getGBeanInfo()
           
 URI getLocalRepositoryURI()
           
 boolean isFailOnUnresolvable()
           
 InputSource resolveEntity(String publicId, String systemId)
          Attempt to resolve the entity based on the supplied publicId and systemId.
 void setCatalogFileURI(URI catalogFileURI)
           
 void setFailOnUnresolvable(boolean b)
          Sets the setFailOnUnresolvable flag.
 void setLocalRepositoryURI(URI string)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

GBEAN_INFO

public static final org.apache.geronimo.gbean.GBeanInfo GBEAN_INFO
Constructor Detail

LocalEntityResolver

public LocalEntityResolver(URI catalogFileURI,
                           URI localRepositoryURI,
                           boolean failOnUnresolvable)
Method Detail

setFailOnUnresolvable

public void setFailOnUnresolvable(boolean b)
Sets the setFailOnUnresolvable flag.

Parameters:
b - value (true means that a SAXException is thrown if the entity could not be resolved)

isFailOnUnresolvable

public boolean isFailOnUnresolvable()

setCatalogFileURI

public void setCatalogFileURI(URI catalogFileURI)

getCatalogFileURI

public URI getCatalogFileURI()

getLocalRepositoryURI

public URI getLocalRepositoryURI()

setLocalRepositoryURI

public void setLocalRepositoryURI(URI string)

addPublicMapping

public void addPublicMapping(String publicId,
                             String uri)

addSystemMapping

public void addSystemMapping(String systemId,
                             String uri)

resolveEntity

public InputSource resolveEntity(String publicId,
                                 String systemId)
                          throws SAXException,
                                 IOException
Attempt to resolve the entity based on the supplied publicId and systemId. First the catalog is queried with both publicId and systemId. Then the local repository is queried with the file name part of the systemId Then the classpath is queried with the file name part of the systemId. Then, if failOnUnresolvable is true, an exception is thrown: otherwise null is returned.

Specified by:
resolveEntity in interface EntityResolver
Parameters:
publicId -
systemId -
Returns:
Throws:
SAXException
IOException

getGBeanInfo

public static org.apache.geronimo.gbean.GBeanInfo getGBeanInfo()


Copyright © 2006 Apache Software Foundation. All Rights Reserved.