org.apache.jetspeed.profiler.rules.impl
Class AbstractProfilingRule

java.lang.Object
  extended by org.apache.jetspeed.profiler.rules.impl.AbstractProfilingRule
All Implemented Interfaces:
java.io.Serializable, ProfilingRule
Direct Known Subclasses:
RoleFallbackProfilingRule, StandardProfilingRule

public abstract class AbstractProfilingRule
extends java.lang.Object
implements ProfilingRule

ProfilingRuleImpl

Version:
$Id: AbstractProfilingRule.java 605772 2007-12-20 01:14:31Z taylor $
Author:
David Sean Taylor
See Also:
Serialized Form

Field Summary
protected  java.util.Collection criteria
           
protected  java.lang.String id
           
protected  java.util.Map locators
          Map of profile locators kept around for reuse TODO: evict entries after max size reached
protected  java.lang.String ojbConcreteClass
           
protected  ProfileResolvers resolvers
          Map of resolver rules for criteria.
protected  java.lang.String title
           
 
Fields inherited from interface org.apache.jetspeed.profiler.rules.ProfilingRule
CCPP_PROPERTY, REQUEST_ATTRIBUTE, REQUEST_PARAMETER, SESSION_ATTRIBUTE, STANDARD, STANDARD_COUNTRY, STANDARD_GROUP, STANDARD_GROUP_ROLE_USER, STANDARD_LANGUAGE, STANDARD_MEDIATYPE, STANDARD_PAGE, STANDARD_ROLE, STANDARD_ROLE_FALLBACK, STANDARD_USER, USER_ATTRIBUTE
 
Constructor Summary
AbstractProfilingRule()
           
AbstractProfilingRule(ProfileResolvers resolvers)
           
 
Method Summary
protected  void addLocatorToCache(java.lang.String key, ProfileLocator locator)
           
abstract  ProfileLocator apply(RequestContext context, Profiler service)
          Applying the profiling rule generates a generic profile locator.
 java.lang.String getClassname()
          Get the implementing classname of this rule from the database.
 RuleCriterionResolver getDefaultResolver()
           
 java.lang.String getId()
          Gets the unique identifier for this rule
protected  ProfileLocator getLocatorFromCache(java.lang.String key)
           
 RuleCriterionResolver getResolver(java.lang.String name)
          Given a criterion name, look up a value resolver
 ProfileResolvers getResolvers()
           
 java.util.Collection getRuleCriteria()
          Returns a sorted map (ordered) of rule criteria.
 java.lang.String getTitle()
          Gets the title used for with the rule for displaying descriptive text.
 void setClassname(java.lang.String classname)
          Sets the implementing classname of this rule from the database.
 void setId(java.lang.String id)
          Sets the unique identifier for this rule
 void setResolvers(ProfileResolvers resolvers)
           
 void setTitle(java.lang.String title)
          Set the title used for with the rule for displaying descriptive text.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

criteria

protected java.util.Collection criteria

id

protected java.lang.String id

title

protected java.lang.String title

ojbConcreteClass

protected java.lang.String ojbConcreteClass

locators

protected java.util.Map locators
Map of profile locators kept around for reuse TODO: evict entries after max size reached


resolvers

protected ProfileResolvers resolvers
Map of resolver rules for criteria. The map goes from criterion name to resolver class

Constructor Detail

AbstractProfilingRule

public AbstractProfilingRule()

AbstractProfilingRule

public AbstractProfilingRule(ProfileResolvers resolvers)
Method Detail

getLocatorFromCache

protected ProfileLocator getLocatorFromCache(java.lang.String key)

addLocatorToCache

protected void addLocatorToCache(java.lang.String key,
                                 ProfileLocator locator)

getResolver

public RuleCriterionResolver getResolver(java.lang.String name)
Description copied from interface: ProfilingRule
Given a criterion name, look up a value resolver

Specified by:
getResolver in interface ProfilingRule
Parameters:
name - The name of the criterion
Returns:

getDefaultResolver

public RuleCriterionResolver getDefaultResolver()

apply

public abstract ProfileLocator apply(RequestContext context,
                                     Profiler service)
Description copied from interface: ProfilingRule
Applying the profiling rule generates a generic profile locator. With this locator we can then locate a profiling resource.

Specified by:
apply in interface ProfilingRule
Returns:

getRuleCriteria

public java.util.Collection getRuleCriteria()
Description copied from interface: ProfilingRule
Returns a sorted map (ordered) of rule criteria. Each criteria consists of a normalized property/attribute/parameter associated with a request type.

Specified by:
getRuleCriteria in interface ProfilingRule
Returns:
a sorted map of rule criteria.

getId

public java.lang.String getId()
Description copied from interface: ProfilingRule
Gets the unique identifier for this rule

Specified by:
getId in interface ProfilingRule
Returns:
The unique identifier

setId

public void setId(java.lang.String id)
Description copied from interface: ProfilingRule
Sets the unique identifier for this rule

Specified by:
setId in interface ProfilingRule
Parameters:
id - The unique identifier

getTitle

public java.lang.String getTitle()
Description copied from interface: ProfilingRule
Gets the title used for with the rule for displaying descriptive text.

Specified by:
getTitle in interface ProfilingRule
Returns:
The title of this rule.

setTitle

public void setTitle(java.lang.String title)
Description copied from interface: ProfilingRule
Set the title used for with the rule for displaying descriptive text.

Specified by:
setTitle in interface ProfilingRule
Parameters:
title - The title of this rule.

getClassname

public java.lang.String getClassname()
Description copied from interface: ProfilingRule
Get the implementing classname of this rule from the database. The class must exist in the hiearchy and in fact refers to itself when instantiated.

Specified by:
getClassname in interface ProfilingRule
Returns:
The classname of this instance.

setClassname

public void setClassname(java.lang.String classname)
Description copied from interface: ProfilingRule
Sets the implementing classname of this rule from the database. The class must exist in the hiearchy and in fact refers to itself when instantiated.

Specified by:
setClassname in interface ProfilingRule
Parameters:
classname - The classname of this instance.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getResolvers

public ProfileResolvers getResolvers()
Specified by:
getResolvers in interface ProfilingRule
Returns:
Returns the resolvers.

setResolvers

public void setResolvers(ProfileResolvers resolvers)
Specified by:
setResolvers in interface ProfilingRule
Parameters:
resolvers - The resolvers to set.


Copyright © 1999-2009 Apache Software Foundation. All Rights Reserved.