org.apache.myfaces.component.html.util
Class StreamingResourceHandler

java.lang.Object
  extended by org.apache.myfaces.component.html.util.StreamingResourceHandler
All Implemented Interfaces:
ResourceHandler

public class StreamingResourceHandler
extends Object
implements ResourceHandler

Class whose instances represent a virtual resource which will be collected by the StreamingResourceHandler.

Author:
Mario Ivankovits

Constructor Summary
StreamingResourceHandler(String resourceName)
          Constructor.
 
Method Summary
 Class getResourceLoaderClass()
          Return a Class object which can decode the url generated by this class in the getResourceUri method and use that info to locate the resource data represented by this object.
 String getResourceUri(javax.faces.context.FacesContext context)
          Return a URL that the browser can later submit to retrieve the resource handled by this instance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.myfaces.renderkit.html.util.ResourceHandler
equals, hashCode
 

Constructor Detail

StreamingResourceHandler

public StreamingResourceHandler(String resourceName)
Constructor.

Parameters:
resourceName - is the name of a file that can be found in dir "resource/{resourceName} relative to the location of the specified component class in the classpath.
Method Detail

getResourceLoaderClass

public Class getResourceLoaderClass()
Return a Class object which can decode the url generated by this class in the getResourceUri method and use that info to locate the resource data represented by this object.

Specified by:
getResourceLoaderClass in interface ResourceHandler
Returns:
a class which implements org.apache.myfaces.component.html.util.ResourceLoader
See Also:
org.apache.myfaces.shared.renderkit.html.util.ResourceHandler#getResourceLoaderClass()

getResourceUri

public String getResourceUri(javax.faces.context.FacesContext context)
Return a URL that the browser can later submit to retrieve the resource handled by this instance.

The emitted URL is of form:

   {partial.class.name}/{resourceName}
 
where partial.class.name is the name of the base class specified in the constructor, and resourceName is the resource specified in the constructor.

Specified by:
getResourceUri in interface ResourceHandler
See Also:
org.apache.myfaces.shared.renderkit.html.util.ResourceHandler#getResourceUri(javax.faces.context.FacesContext)


Copyright © 2012 The Apache Software Foundation. All Rights Reserved.