Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.ajax4jsf.resource
Class InternetResourceBase

    java.lang.Object
      org.ajax4jsf.resource.InternetResourceBase

All Implemented Interfaces:
  org.ajax4jsf.resource.InternetResource

Direct Known Subclasses:
  JarResource, StaticResource, URIInternetResource, UserResource

    public abstract class InternetResourceBase

extends java.lang.Object
implements org.ajax4jsf.resource.InternetResource

Base class for all Html page resources - images, scripts, styles etc. Realise as "brige" pattern - different subclasses for different resource source (static,jar,soft generator ) and customaized with differernt renderers for image, script, style ( linked ir inline ). must operate with different sources - application context, classpath, software generator.

Version:
  $Revision: 1.1.2.2 $ $Date: 2007/01/11 16:52:15 $
Author:
  shura (latest modification by $Author: nick_belaevski $)

Field Summary

Fields inherited from interface org.ajax4jsf.resource.InternetResource
`CODEC_ATTR, DATA_SEPARATOR, DEFAULT_EXPIRE, DEFAULT_EXPITE_PARAMETER, DEFAULT_TTL, ENCODE_PASS_PARAMETER, ENCODE_URI_PARAMETER, RESOURCE_PROTOCOL, RESOURCE_URI_PREFIX, RESOURCE_URI_PREFIX_LENGTH`

Constructor Summary
`InternetResourceBase()`

Method Summary
`protected java.lang.Object` | `deserializeData(byte[] objectArray)` Deserialize parameters object from byte array.
`void` | `encode(javax.faces.context.FacesContext context, java.lang.Object data)`
`void` | `encode(javax.faces.context.FacesContext context, java.lang.Object data, java.util.Map<java.lang.String,java.lang.Object> attributes)`
`void` | `encodeBegin(javax.faces.context.FacesContext context, java.lang.Object component, java.util.Map<java.lang.String,java.lang.Object> attrs)`
`void` | `encodeEnd(javax.faces.context.FacesContext context, java.lang.Object component)`
`int` | `getContentLength(org.ajax4jsf.resource.ResourceContext resourceContext)`
`java.lang.String` | `getContentType(org.ajax4jsf.resource.ResourceContext resourceContext)`
`protected java.lang.Object` | `getDataToStore(javax.faces.context.FacesContext context, java.lang.Object data)` Template method to construct resource-specific data ( to store in resource URI ).
`long` | `getExpired(org.ajax4jsf.resource.ResourceContext resourceContext)`
`java.lang.String` | `getKey()` Key for wich resource registered in resource builder.
`java.util.Date` | `getLastModified(org.ajax4jsf.resource.ResourceContext resourceContext)`
`java.lang.Object` | `getProperty(java.lang.Object key)`
`org.ajax4jsf.resource.ResourceRenderer` | `getRenderer(org.ajax4jsf.resource.ResourceContext resourceContext)`
`java.io.InputStream` | `getResourceAsStream(org.ajax4jsf.resource.ResourceContext context)`
`java.lang.String` | `getUri(javax.faces.context.FacesContext context, java.lang.Object data)`
`boolean` | `isCacheable(org.ajax4jsf.resource.ResourceContext resourceContext)`
`boolean` | `isSessionAware()`
`boolean` | `requireFacesContext()`
`protected java.lang.Object` | `restoreData(org.ajax4jsf.resource.ResourceContext context)` Restore data object from resource URI request parameter ( same object as returned in getDataToStore method )
`void` | `send(org.ajax4jsf.resource.ResourceContext context)`
`void` | `sendHeaders(org.ajax4jsf.resource.ResourceContext context)`
`void` | `setCacheable(boolean cacheable)`
`protected void` | `setContentLength(int contentLength)`
`void` | `setExpired(long expired)`
`void` | `setKey(java.lang.String key)` Set registration key ( by `InternetResourceBuilder` for this resource.
`void` | `setLastModified(java.util.Date lastModified)`
`void` | `setProperty(java.lang.Object key, java.lang.Object value)`
`void` | `setRenderer(org.ajax4jsf.resource.ResourceRenderer renderer)`
`void` | `setSessionAware(boolean sessionAware)`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### InternetResourceBase

    public InternetResourceBase()

Method Detail

### getContentLength

    public int getContentLength(org.ajax4jsf.resource.ResourceContext resourceContext)

  Specified by:
    `getContentLength` in interface `org.ajax4jsf.resource.InternetResource`

### setContentLength

    protected void setContentLength(int contentLength)

  Parameters:
    `contentLength` - The contentLength to set.

### getExpired

    public long getExpired(org.ajax4jsf.resource.ResourceContext resourceContext)

  Specified by:
    `getExpired` in interface `org.ajax4jsf.resource.InternetResource`

### setExpired

    public void setExpired(long expired)

  Specified by:
    `setExpired` in interface `org.ajax4jsf.resource.InternetResource`
  Parameters:
    `expired` - The expired to set.

### getLastModified

    public java.util.Date getLastModified(org.ajax4jsf.resource.ResourceContext resourceContext)

  Specified by:
    `getLastModified` in interface `org.ajax4jsf.resource.InternetResource`

### setLastModified

    public void setLastModified(java.util.Date lastModified)

  Specified by:
    `setLastModified` in interface `org.ajax4jsf.resource.InternetResource`
  Parameters:
    `lastModified` - The lastModified to set.

### isCacheable

    public boolean isCacheable(org.ajax4jsf.resource.ResourceContext resourceContext)

  Specified by:
    `isCacheable` in interface `org.ajax4jsf.resource.InternetResource`

### setCacheable

    public void setCacheable(boolean cacheable)

  Specified by:
    `setCacheable` in interface `org.ajax4jsf.resource.InternetResource`
  Parameters:
    `cacheable` - The cacheable to set.

### isSessionAware

    public boolean isSessionAware()

  Specified by:
    `isSessionAware` in interface `org.ajax4jsf.resource.InternetResource`
  Returns:
    Returns the sessionAware.

### setSessionAware

    public void setSessionAware(boolean sessionAware)

  Specified by:
    `setSessionAware` in interface `org.ajax4jsf.resource.InternetResource`
  Parameters:
    `sessionAware` - The sessionAware to set.

### getContentType

    public java.lang.String getContentType(org.ajax4jsf.resource.ResourceContext resourceContext)

  Specified by:
    `getContentType` in interface `org.ajax4jsf.resource.InternetResource`

### getRenderer

    public org.ajax4jsf.resource.ResourceRenderer getRenderer(org.ajax4jsf.resource.ResourceContext resourceContext)

  Specified by:
    `getRenderer` in interface `org.ajax4jsf.resource.InternetResource`
  Returns:
    Returns the renderer.

### setRenderer

    public void setRenderer(org.ajax4jsf.resource.ResourceRenderer renderer)

  Specified by:
    `setRenderer` in interface `org.ajax4jsf.resource.InternetResource`
  Parameters:
    `renderer` - The renderer to set.

### getKey

    public java.lang.String getKey()

  Key for wich resource registered in resource builder.

  Specified by:
    `getKey` in interface `org.ajax4jsf.resource.InternetResource`
  Returns:
    Returns the key.

### setKey

    public void setKey(java.lang.String key)

  Set registration key ( by `InternetResourceBuilder` for this resource.

  Specified by:
    `setKey` in interface `org.ajax4jsf.resource.InternetResource`
  Parameters:
    `key` - The key to set.

### getUri

    public java.lang.String getUri(javax.faces.context.FacesContext context,
                                   java.lang.Object data)

  Specified by:
    `getUri` in interface `org.ajax4jsf.resource.InternetResource`

### getDataToStore

    protected java.lang.Object getDataToStore(javax.faces.context.FacesContext context,
                                              java.lang.Object data)

  Template method to construct resource-specific data ( to store in resource URI ). If resource must store any data in session or other cache, it must be done here. Since lightweight realisation, information for restore such data muct be returned by this method.

  Parameters:
    `context` - - current faces context.
    `data` - - data for build information, usually current `UIComponent`
  Returns:
    - any `Serializable` object, or null.

### restoreData

    protected java.lang.Object restoreData(org.ajax4jsf.resource.ResourceContext context)

  Restore data object from resource URI request parameter ( same object as returned in getDataToStore method )

  Parameters:
    `context` -
  Returns:
    restored data, or null.

### deserializeData

    protected java.lang.Object deserializeData(byte[] objectArray)

  Deserialize parameters object from byte array. By default, used Java de-serialisation from ObjectOutputStream , but implementations can override this method ( togewer with getDataToStore ) for implement short version.

  Parameters:
    `objectArray` -
  Returns:
  Throws:
    `java.io.IOException`
    `java.lang.ClassNotFoundException`

### getResourceAsStream

    public java.io.InputStream getResourceAsStream(org.ajax4jsf.resource.ResourceContext context)

  Specified by:
    `getResourceAsStream` in interface `org.ajax4jsf.resource.InternetResource`

### getProperty

    public java.lang.Object getProperty(java.lang.Object key)

  Specified by:
    `getProperty` in interface `org.ajax4jsf.resource.InternetResource`

### setProperty

    public void setProperty(java.lang.Object key,
                            java.lang.Object value)

  Specified by:
    `setProperty` in interface `org.ajax4jsf.resource.InternetResource`

### encode

    public void encode(javax.faces.context.FacesContext context,
                       java.lang.Object data)
                throws java.io.IOException

  Specified by:
    `encode` in interface `org.ajax4jsf.resource.InternetResource`
  Throws:
    `java.io.IOException`

### encode

    public void encode(javax.faces.context.FacesContext context,
                       java.lang.Object data,
                       java.util.Map<java.lang.String,java.lang.Object> attributes)
                throws java.io.IOException

  Specified by:
    `encode` in interface `org.ajax4jsf.resource.InternetResource`
  Throws:
    `java.io.IOException`

### encodeBegin

    public void encodeBegin(javax.faces.context.FacesContext context,
                            java.lang.Object component,
                            java.util.Map<java.lang.String,java.lang.Object> attrs)
                     throws java.io.IOException

  Specified by:
    `encodeBegin` in interface `org.ajax4jsf.resource.InternetResource`
  Throws:
    `java.io.IOException`

### encodeEnd

    public void encodeEnd(javax.faces.context.FacesContext context,
                          java.lang.Object component)
                   throws java.io.IOException

  Specified by:
    `encodeEnd` in interface `org.ajax4jsf.resource.InternetResource`
  Throws:
    `java.io.IOException`

### send

    public void send(org.ajax4jsf.resource.ResourceContext context)
              throws java.io.IOException

  Specified by:
    `send` in interface `org.ajax4jsf.resource.InternetResource`
  Throws:
    `java.io.IOException`

### sendHeaders

    public void sendHeaders(org.ajax4jsf.resource.ResourceContext context)

  Specified by:
    `sendHeaders` in interface `org.ajax4jsf.resource.InternetResource`

### requireFacesContext

    public boolean requireFacesContext()

  Specified by:
    `requireFacesContext` in interface `org.ajax4jsf.resource.InternetResource`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2010 JBoss, a division of Red Hat, Inc.. All Rights Reserved.