Oracle Fusion Middleware Java API Reference for Oracle ADF Share
11g Release 2 (11.1.2.0.0)

E17486-01

oracle.adf.share.jsp
Interface JSPProviderHelper


public interface JSPProviderHelper

Use this interface to delegate the locating and loading of jsp resources away from the jsp servlet to any arbitrary provider class (one of more). Configuration: Use the webapp context-param name "oracle.adf.jsp.provider.N" (where "N" is an integer, 0-n) and the value is the provider class name, to identify the implementing classes to load at startup. Provider classes are called in "N" order in terms of arbitration for the incoming requestURI. Lifecycle: each provider class will be instantiated once per servlet context, and the init method called, passing the context (and the Hashtable of params from the jsp servlet?). If the servlet context is unloaded the destroy will be called, giving each provider a chance to cleanup. Processing: The main point of this interface is to allow alternate ways to load jsp resources. A provider signifies that it "owns" a resource by returning a non-null string from getProviderURI. Once the providerURI is achieved, it will always be passed back to the provider when either the lastModified time or the inputStream associated with the resource is needed by the jsp servlet. The "transformed" URI returned from the above must either be unchanged from the input value (see explanation below), or it must have a new path element prefix. The caller of getProviderURI will use the first path element to designate the unique prefix supported by the provider. This is similar to the way the servlet container maps servlets. Known prefixes at this time are "/adflib", and "/mdssys". Processing Note: It is possible for a provider to return the input parameter unchanged in getProviderURI. This does two things: it stops the querying of providers; and it indicates that the provider wishes to "get a crack" at handling any request where a specific provider doesn't claim a reqource. In essence the provider becomes a wildcard or fallback provider from that point forward. There is currently no way to reverse that designation, once set. Note: Get the current ADFContext by calling it's getCurrent static method.


Method Summary
 void destroy()
          Called during the servlet context destroy to allow cleanup.
 java.io.InputStream fromStream(java.lang.String providerURI)
          Return the input stream for the providerURI.
 long getLastModified(java.lang.String providerURI, javax.servlet.http.HttpServletRequest request)
          Return the lastModified time for the providerURI, or 0.
 java.lang.String getProviderURI(java.lang.String requestURI)
          Allows the provider to take ownership of the requestURI by returning a non-null string.
 void init(javax.servlet.ServletContext sc, java.util.Hashtable initParams)
          Called immediately after the constructor when the jsp servlet initializes.
 

Method Detail

init

void init(javax.servlet.ServletContext sc,
          java.util.Hashtable initParams)
Called immediately after the constructor when the jsp servlet initializes.

Parameters:
sc - The ServletContext for the current webapp.
initParams - The params from the jsp servlet - may remove this?

destroy

void destroy()
Called during the servlet context destroy to allow cleanup.


getProviderURI

java.lang.String getProviderURI(java.lang.String requestURI)
Allows the provider to take ownership of the requestURI by returning a non-null string. Once a resource is owned by a provider, other providers won't be asked about that requestURI. See additional notes about about this in the class description.

Parameters:
requestURI - The UTF-8 decoded value from the incoming request.
Returns:
Either null (for no interest), or the providerURI for that input.

getLastModified

long getLastModified(java.lang.String providerURI,
                     javax.servlet.http.HttpServletRequest request)
                     throws java.io.FileNotFoundException,
                            java.io.IOException
Return the lastModified time for the providerURI, or 0.

Parameters:
providerURI - The value returned from getProviderURI
request - The current servlet request (may be null in rare circumstances)
Returns:
the last modified time of the resource, or 0.
Throws:
java.io.FileNotFoundException
java.io.IOException
See Also:
java.io.File.lastModified()

fromStream

java.io.InputStream fromStream(java.lang.String providerURI)
                               throws java.io.FileNotFoundException,
                                      java.io.IOException
Return the input stream for the providerURI.

Parameters:
providerURI -
Returns:
the associated input stream
Throws:
java.io.FileNotFoundException
java.io.IOException

Oracle Fusion Middleware Java API Reference for Oracle ADF Share
11g Release 2 (11.1.2.0.0)

E17486-01

Copyright © 1997, 2011, Oracle. All rights reserved.