Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.opencms.template.cache
Class A_CmsElement  view A_CmsElement download A_CmsElement.java

java.lang.Object
  extended bycom.opencms.template.cache.A_CmsElement
All Implemented Interfaces:
com.opencms.boot.I_CmsLogChannels
Direct Known Subclasses:
CmsElementDump, CmsElementXml, CmsMethodElement

public abstract class A_CmsElement
extends java.lang.Object
implements com.opencms.boot.I_CmsLogChannels

An instance of A_CmsElement represents an requestable Element in the OpenCms element cache area. It contains all informations to generate the content of this element. It also stores the variants of once generated content to speed up performance. It may point to other depending elements. Theses elements are called to generate their content on generation-time.


Field Summary
protected  com.opencms.template.A_CmsCacheDirectives m_cacheDirectives
          Cache directives of this element.
protected  java.lang.String m_className
          The class-name of this element definition.
protected  CmsElementDefinitionCollection m_elementDefinitions
          All definitions declared in this element.
protected  boolean m_hasDepVariants
          indicates if this element may have a variant that has dependencies if such a element is deletet from elementcache the extern dependencies hashtable must be updated.
protected  java.lang.String m_readAccessGroup
          The name of the group that can read this ressource.
protected  java.lang.String m_templateName
          The template-name of this element definition.
protected  long m_timestamp
          Last time this element was generated.(used for CacheDirectives timeout)
private  CmsLruCache m_variants
          LruCache for element variant cache
 
Fields inherited from interface com.opencms.boot.I_CmsLogChannels
C_FLEX_CACHE, C_FLEX_LOADER, C_LOGGING, C_MODULE_CRITICAL, C_MODULE_DEBUG, C_MODULE_INFO, C_OPENCMS_CACHE, C_OPENCMS_CRITICAL, C_OPENCMS_CRONSCHEDULER, C_OPENCMS_DEBUG, C_OPENCMS_ELEMENTCACHE, C_OPENCMS_INFO, C_OPENCMS_INIT, C_OPENCMS_POOL, C_OPENCMS_STATICEXPORT, C_OPENCMS_STREAMING, C_PREPROCESSOR_IS_LOGGING
 
Constructor Summary
A_CmsElement()
           
 
Method Summary
 void addDefinition(CmsElementDefinition def)
          Adds a single definition to this element.
 java.util.Vector addVariant(java.lang.Object key, CmsElementVariant variant)
          Adds a single variant to this element.
 void checkProxySettings(com.opencms.file.CmsObject cms, com.opencms.template.CmsCacheDirectives proxySettings, java.util.Hashtable parameters)
          checks the proxy public and the proxy private cache settings of this element and all subelements.
 void checkReadAccess(com.opencms.file.CmsObject cms)
          checks the read access.
 void clearVariantCache()
          Clears all variants.
 CmsElementDefinitionCollection getAllDefinitions()
          Returns a Vector with all ElementDefinitions
 java.util.Vector getAllVariantKeys()
           
 com.opencms.template.A_CmsCacheDirectives getCacheDirectives()
          Get cache directives for this element.
abstract  byte[] getContent(CmsElementCache elementCache, com.opencms.file.CmsObject cms, CmsElementDefinitionCollection efDefs, java.lang.String elementName, java.util.Hashtable parameters, java.lang.String methodParameter)
          Abstract method for getting the content of this element.
 CmsElementDefinition getElementDefinition(java.lang.String name)
          Get the element definition for the sub-element with the given name
protected  com.opencms.template.I_CmsTemplate getTemplateClass(com.opencms.file.CmsObject cms, java.lang.String classname)
          Get a template class from the template class manager.
 CmsElementVariant getVariant(java.lang.Object key)
          Get a variant from the vatiant cache
 boolean hasDependenciesVariants()
          says if the extern dependenciescache has to be updated when this element is deleted.
protected  void init(java.lang.String className, java.lang.String templateName, java.lang.String readAccessGroup, com.opencms.template.A_CmsCacheDirectives cd, CmsElementDefinitionCollection defs, int variantCachesize)
          Initializer for building an element with the given element definitions.
protected  void init(java.lang.String className, java.lang.String templateName, java.lang.String readAccessGroup, com.opencms.template.A_CmsCacheDirectives cd, int variantCachesize)
          Initializer for an element with the given class and template name.
 void removeVariant(java.lang.Object key)
           
 byte[] resolveVariant(com.opencms.file.CmsObject cms, CmsElementVariant variant, CmsElementCache elementCache, CmsElementDefinitionCollection elDefs, java.util.Hashtable parameters)
          Resolve given variant of this element and get content of all sub elements.
 void thisElementHasDepVariants()
          indicates this element critical for delete.
 java.lang.String toString()
          Get a string representation of this element.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

m_className

protected java.lang.String m_className
The class-name of this element definition.


m_templateName

protected java.lang.String m_templateName
The template-name of this element definition.


m_cacheDirectives

protected com.opencms.template.A_CmsCacheDirectives m_cacheDirectives
Cache directives of this element.


m_readAccessGroup

protected java.lang.String m_readAccessGroup
The name of the group that can read this ressource.


m_timestamp

protected long m_timestamp
Last time this element was generated.(used for CacheDirectives timeout)


m_elementDefinitions

protected CmsElementDefinitionCollection m_elementDefinitions
All definitions declared in this element.


m_variants

private CmsLruCache m_variants
LruCache for element variant cache


m_hasDepVariants

protected boolean m_hasDepVariants
indicates if this element may have a variant that has dependencies if such a element is deletet from elementcache the extern dependencies hashtable must be updated.

Constructor Detail

A_CmsElement

public A_CmsElement()
Method Detail

init

protected void init(java.lang.String className,
                    java.lang.String templateName,
                    java.lang.String readAccessGroup,
                    com.opencms.template.A_CmsCacheDirectives cd,
                    int variantCachesize)
Initializer for an element with the given class and template name.


init

protected void init(java.lang.String className,
                    java.lang.String templateName,
                    java.lang.String readAccessGroup,
                    com.opencms.template.A_CmsCacheDirectives cd,
                    CmsElementDefinitionCollection defs,
                    int variantCachesize)
Initializer for building an element with the given element definitions.


addDefinition

public void addDefinition(CmsElementDefinition def)
Adds a single definition to this element.


addVariant

public java.util.Vector addVariant(java.lang.Object key,
                                   CmsElementVariant variant)
Adds a single variant to this element.


removeVariant

public void removeVariant(java.lang.Object key)

checkReadAccess

public void checkReadAccess(com.opencms.file.CmsObject cms)
                     throws com.opencms.core.CmsException
checks the read access.


clearVariantCache

public void clearVariantCache()
Clears all variants. Used for TimeCritical elements.


getAllVariantKeys

public java.util.Vector getAllVariantKeys()

getVariant

public CmsElementVariant getVariant(java.lang.Object key)
Get a variant from the vatiant cache


hasDependenciesVariants

public boolean hasDependenciesVariants()
says if the extern dependenciescache has to be updated when this element is deleted.


thisElementHasDepVariants

public void thisElementHasDepVariants()
indicates this element critical for delete.


getAllDefinitions

public CmsElementDefinitionCollection getAllDefinitions()
Returns a Vector with all ElementDefinitions


getElementDefinition

public CmsElementDefinition getElementDefinition(java.lang.String name)
Get the element definition for the sub-element with the given name


getCacheDirectives

public com.opencms.template.A_CmsCacheDirectives getCacheDirectives()
Get cache directives for this element.


checkProxySettings

public void checkProxySettings(com.opencms.file.CmsObject cms,
                               com.opencms.template.CmsCacheDirectives proxySettings,
                               java.util.Hashtable parameters)
                        throws com.opencms.core.CmsException
checks the proxy public and the proxy private cache settings of this element and all subelements.


getContent

public abstract byte[] getContent(CmsElementCache elementCache,
                                  com.opencms.file.CmsObject cms,
                                  CmsElementDefinitionCollection efDefs,
                                  java.lang.String elementName,
                                  java.util.Hashtable parameters,
                                  java.lang.String methodParameter)
                           throws com.opencms.core.CmsException
Abstract method for getting the content of this element. Element classes may have different implementations for getting the contents. Common tasks of all implementations are checking the variant cache and creating the variant if required.


getTemplateClass

protected com.opencms.template.I_CmsTemplate getTemplateClass(com.opencms.file.CmsObject cms,
                                                              java.lang.String classname)
                                                       throws com.opencms.core.CmsException
Get a template class from the template class manager.


resolveVariant

public byte[] resolveVariant(com.opencms.file.CmsObject cms,
                             CmsElementVariant variant,
                             CmsElementCache elementCache,
                             CmsElementDefinitionCollection elDefs,
                             java.util.Hashtable parameters)
                      throws com.opencms.core.CmsException
Resolve given variant of this element and get content of all sub elements.


toString

public java.lang.String toString()
Get a string representation of this element.