NetKernel APIs


org.ten60.netkernel.layer1.meta
Class DependencyMeta

java.lang.Object
  extended byorg.ten60.netkernel.layer1.meta.DependencyMeta
All Implemented Interfaces:
IHasDependencies, IURMeta
Direct Known Subclasses:
ActiveAccessorMeta, TimedExpiryDependencyMeta

public class DependencyMeta
extends Object
implements IURMeta, IHasDependencies

An implementation of IURMeta that supports chaining of IURRepresentations for derived results such that costs and expiry dependencies are accumulated.


Field Summary
static boolean sDebugFlag
          global to determine if instances should keep additional debug metadata useful for development but unused by system
protected static IURMeta[] sEmpty
           
 
Constructor Summary
DependencyMeta(IURRepresentation aOther, int aCreationCost)
           
DependencyMeta(IURRepresentation aOther, int aCreationCost, int aUsageCost)
           
DependencyMeta(String aMimeType, int aCreationCost, int aUsageCost)
          Used by accessors for results
 
Method Summary
 boolean canIndependentlyExpire()
          return true if this meta can expire independently of its dependencies
 int getContextSensitivity()
          Return the depth of sensitivity on the calling context (super stack).
 IURMeta[] getCostDependenciesRecursive()
          get recursive list of cost dependencies
 int getCreationCost()
          Return an abitrary integer cost quantifier for regenerating this representation- see typical accessors for costs they assign.
 IURMeta[] getDirectDependencies()
          return an array of direct dependencies of this resource
 IURMeta[] getExpiryDependenciesRecursive()
          get recursive list of expiry dependencies
 int getLocalCreationCost()
          return local cost for this resource without cost of its dependencies
 String getMimeType()
          Return the MIME (Multipurpose Internet Mail Extensions) type of the resource this representation represents
 long getPessimisticExpiryTime()
          recursively calculate the pessimistic expiry time
 int getUsageCost()
          return the usage cost
 boolean isExpired()
          recursive evaluation of isExpired by looking at dependencies
 boolean isIntermediate()
          return true if the representation we are the meta for is intermediate
 void setDebugString(String aDebug)
           
 void setDependencies(List aCreationDependencies, List aUsageDependencies)
          Override any previously set dependencies
 void setIntermediate(boolean aIsIntermediate)
           
 void setMimeType(String aMimeType)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

sEmpty

protected static final IURMeta[] sEmpty

sDebugFlag

public static final boolean sDebugFlag
global to determine if instances should keep additional debug metadata useful for development but unused by system

Constructor Detail

DependencyMeta

public DependencyMeta(String aMimeType,
                      int aCreationCost,
                      int aUsageCost)
Used by accessors for results


DependencyMeta

public DependencyMeta(IURRepresentation aOther,
                      int aCreationCost,
                      int aUsageCost)

DependencyMeta

public DependencyMeta(IURRepresentation aOther,
                      int aCreationCost)
Method Detail

getMimeType

public String getMimeType()
Description copied from interface: IURMeta
Return the MIME (Multipurpose Internet Mail Extensions) type of the resource this representation represents

Specified by:
getMimeType in interface IURMeta

setMimeType

public void setMimeType(String aMimeType)

getUsageCost

public int getUsageCost()
return the usage cost

Specified by:
getUsageCost in interface IURMeta

getContextSensitivity

public int getContextSensitivity()
Description copied from interface: IURMeta
Return the depth of sensitivity on the calling context (super stack). 0 means no sensitivity

Specified by:
getContextSensitivity in interface IURMeta

isIntermediate

public boolean isIntermediate()
return true if the representation we are the meta for is intermediate

Specified by:
isIntermediate in interface IURMeta

setIntermediate

public void setIntermediate(boolean aIsIntermediate)

getLocalCreationCost

public int getLocalCreationCost()
Description copied from interface: IHasDependencies
return local cost for this resource without cost of its dependencies

Specified by:
getLocalCreationCost in interface IHasDependencies

toString

public String toString()

canIndependentlyExpire

public boolean canIndependentlyExpire()
Description copied from interface: IHasDependencies
return true if this meta can expire independently of its dependencies

Specified by:
canIndependentlyExpire in interface IHasDependencies

setDebugString

public void setDebugString(String aDebug)

setDependencies

public void setDependencies(List aCreationDependencies,
                            List aUsageDependencies)
Override any previously set dependencies


getPessimisticExpiryTime

public long getPessimisticExpiryTime()
recursively calculate the pessimistic expiry time

Specified by:
getPessimisticExpiryTime in interface IURMeta

isExpired

public boolean isExpired()
recursive evaluation of isExpired by looking at dependencies

Specified by:
isExpired in interface IURMeta

getCreationCost

public int getCreationCost()
Description copied from interface: IURMeta
Return an abitrary integer cost quantifier for regenerating this representation- see typical accessors for costs they assign. This value helps caches decide the worth of data. The value accumulates in highly derived resources

Specified by:
getCreationCost in interface IURMeta

getDirectDependencies

public IURMeta[] getDirectDependencies()
Description copied from interface: IHasDependencies
return an array of direct dependencies of this resource

Specified by:
getDirectDependencies in interface IHasDependencies

getCostDependenciesRecursive

public IURMeta[] getCostDependenciesRecursive()
Description copied from interface: IHasDependencies
get recursive list of cost dependencies

Specified by:
getCostDependenciesRecursive in interface IHasDependencies

getExpiryDependenciesRecursive

public IURMeta[] getExpiryDependenciesRecursive()
Description copied from interface: IHasDependencies
get recursive list of expiry dependencies

Specified by:
getExpiryDependenciesRecursive in interface IHasDependencies

NetKernel APIs


Copyright © 2002-2004 1060 Research Ltd. All Rights Reserved.