WebLogic Integration


com.bea.eci.repository.helper
Class RepositoryResolver

java.lang.Object
  |
  +--org.xml.sax.helpers.DefaultHandler
        |
        +--com.bea.eci.repository.helper.RepositoryResolver

public class RepositoryResolver
extends org.xml.sax.helpers.DefaultHandler
implements org.xml.sax.EntityResolver, org.xml.sax.ErrorHandler, javax.xml.transform.URIResolver, java.io.Serializable

This class provides methods for obtaining XML entities stored in the repository. It implements the resolveEntity method of the EntityResolver interface and the resolve interface of URIResolver.

Note: The Repository EJB must be deployed and accessible in order to use these methods.

Debuging output is available by setting the environment variable "eci.repository.helper.debug" (to anything).

Author:
Copyright © 2000, 2001 BEA Systems, Inc. All Rights Reserved.
See Also:
Serialized Form

Constructor Summary
RepositoryResolver(java.util.Properties icProps)
          Creates a new RepositoryResolver and obtains a reference to the Repository EJB using the default JNDI name of the Repository Ejb and the connection properties provided.
RepositoryResolver(java.lang.String ejbName, java.util.Properties icProps)
          Creates a new RepositoryResolver and obtains a reference to the Repository EJB using the provided JNDI name for the Repositroy EJB and the connection properties specified.
RepositoryResolver(XMLRepository repEJB)
          Create a new RepositoryResolver and uses the provided Repository EJB reference.
 
Method Summary
 void error(org.xml.sax.SAXParseException e)
          Internal use only.
 void fatalError(org.xml.sax.SAXParseException e)
          Internal use only.
 void notationDecl(java.lang.String name, java.lang.String publicId, java.lang.String systemId)
          Internal use only.
 javax.xml.transform.Source resolve(java.lang.String href, java.lang.String base)
          Implementation of the URIResolver interface that uses the eCI repository as the entity source.
 org.xml.sax.InputSource resolveEntity(java.lang.String publicId, java.lang.String systemId)
          Implementation of the EnityResolver interface that uses the eCI repository as the entity source.
 void unparsedEntityDecl(java.lang.String name, java.lang.String publicId, java.lang.String systemId, java.lang.String notationName)
          Internal use only.
 void warning(org.xml.sax.SAXParseException e)
          Internal use only.
 
Methods inherited from class org.xml.sax.helpers.DefaultHandler
characters, endDocument, endElement, endPrefixMapping, ignorableWhitespace, processingInstruction, setDocumentLocator, skippedEntity, startDocument, startElement, startPrefixMapping
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RepositoryResolver

public RepositoryResolver(java.util.Properties icProps)
                   throws javax.naming.NamingException,
                          java.rmi.RemoteException,
                          javax.ejb.CreateException
Creates a new RepositoryResolver and obtains a reference to the Repository EJB using the default JNDI name of the Repository Ejb and the connection properties provided.

Parameters:
icProps - the Properties used to obtain the InitialContext. This must have the following keys with the String value indicated:

  • Context.INITIAL_CONTEXT_FACTORY - class name of the InitialContextfactory, typically "weblogic.jndi.WLInitialContextFactory"
  • Context.PROVIDER_URL - the URL of the WLS server, similar to "t3://>host<:>port<"
  • Context.SECURITY_PRINCIPAL - the name of the WLS user
  • Context.SECURITY_CREDENTIALS - the user's password

  • RepositoryResolver

    public RepositoryResolver(java.lang.String ejbName,
                              java.util.Properties icProps)
                       throws javax.naming.NamingException,
                              java.rmi.RemoteException,
                              javax.ejb.CreateException
    Creates a new RepositoryResolver and obtains a reference to the Repository EJB using the provided JNDI name for the Repositroy EJB and the connection properties specified.

    Parameters:
    icProps - the Properties used to obtain the InitialContext. This must have the following keys with the String value indicated:

  • Context.INITIAL_CONTEXT_FACTORY - class name of the InitialContextfactory, typically "weblogic.jndi.WLInitialContextFactory"
  • Context.PROVIDER_URL - the URL of the WLS server, similar to "t3://>host<:>port<"
  • Context.SECURITY_PRINCIPAL - the name of the WLS user
  • Context.SECURITY_CREDENTIALS - the user's password
  • ejbName - the JNDI name of the Repository EJB. By default the repository EJB is deployed with the JNDI name "com.bea.eci.repository.ejb.XMLRepository".

    RepositoryResolver

    public RepositoryResolver(XMLRepository repEJB)
                       throws javax.naming.NamingException,
                              java.rmi.RemoteException,
                              javax.ejb.CreateException
    Create a new RepositoryResolver and uses the provided Repository EJB reference.

    Parameters:
    repEJB - a reference to the Repository EJB.
    Method Detail

    resolveEntity

    public org.xml.sax.InputSource resolveEntity(java.lang.String publicId,
                                                 java.lang.String systemId)
    Implementation of the EnityResolver interface that uses the eCI repository as the entity source. Presented with an system identifier and an optional public identifier, this function attempts to locate an entity in the eCI Repository. The publicId, if not null, is tried first. If no mapping is found (or an error occurs attempting to obtain the mapped value as an input source) then the systemId is tried. If the systemId is not found (or an error occurs) null is returned.
    Specified by:
    resolveEntity in interface org.xml.sax.EntityResolver

    Parameters:
    publicId - The public identifier for the entity in question. This may be null.
    systemId - The system identifier for the entity in question. XML requires a system identifier on all external entities, so this value is always specified.
    Returns:
    An InputSource for the entity named by the identifier, or null if the entity was not found.
    Overrides:
    resolveEntity in class org.xml.sax.helpers.DefaultHandler

    resolve

    public javax.xml.transform.Source resolve(java.lang.String href,
                                              java.lang.String base)
                                       throws javax.xml.transform.TransformerException
    Implementation of the URIResolver interface that uses the eCI repository as the entity source. This method returns the content of an entity from the repsoitry looking first for an entity named by the value of href and then, if href is not found, by the value of base. If niether is found null is returned. Any errors that are encountered are printed but otherwise ignored, resulting in null being returned.
    Specified by:
    resolve in interface javax.xml.transform.URIResolver

    Parameters:
    href - An href attribute, which may be relative or absolute. The name is used verbatim to match a name in the repository.
    base - Not Used - the base URI in effect when the href attribute was encountered.
    Returns:
    a Source for the entity named by href, or null if the named entity was not found in the repository or an error was encountered.

    warning

    public void warning(org.xml.sax.SAXParseException e)
                 throws org.xml.sax.SAXException
    Internal use only.
    Specified by:
    warning in interface org.xml.sax.ErrorHandler

    Parameters:
    e -  
    Throws:
    org.xml.sax.SAXException -  
    Overrides:
    warning in class org.xml.sax.helpers.DefaultHandler

    error

    public void error(org.xml.sax.SAXParseException e)
               throws org.xml.sax.SAXException
    Internal use only.
    Specified by:
    error in interface org.xml.sax.ErrorHandler

    Parameters:
    e -  
    Throws:
    org.xml.sax.SAXException -  
    Overrides:
    error in class org.xml.sax.helpers.DefaultHandler

    fatalError

    public void fatalError(org.xml.sax.SAXParseException e)
                    throws org.xml.sax.SAXException
    Internal use only.
    Specified by:
    fatalError in interface org.xml.sax.ErrorHandler

    Parameters:
    e -  
    Throws:
    org.xml.sax.SAXException -  
    Overrides:
    fatalError in class org.xml.sax.helpers.DefaultHandler

    notationDecl

    public void notationDecl(java.lang.String name,
                             java.lang.String publicId,
                             java.lang.String systemId)
    Internal use only.

    Parameters:
    name -  
    publicId -  
    systemId -  
    Overrides:
    notationDecl in class org.xml.sax.helpers.DefaultHandler

    unparsedEntityDecl

    public void unparsedEntityDecl(java.lang.String name,
                                   java.lang.String publicId,
                                   java.lang.String systemId,
                                   java.lang.String notationName)
    Internal use only.

    Parameters:
    name -  
    publicId -  
    systemId -  
    notationName -  
    Overrides:
    unparsedEntityDecl in class org.xml.sax.helpers.DefaultHandler

    WebLogic Integration

    WebLogic Integration (WLI)