com.alachisoft.ncache.runtime.dependencies
Class AggregateCacheDependency
java.lang.Object
com.alachisoft.ncache.runtime.dependencies.CacheDependency
com.alachisoft.ncache.runtime.dependencies.AggregateCacheDependency
- All Implemented Interfaces:
- java.io.Serializable
public final class AggregateCacheDependency
- extends CacheDependency
Combines multiple dependencies between an item stored in an application's Cache object
and an array of CacheDependency objects. This class cannot be inherited.
The AggregateCacheDependency class monitors a collection of dependency objects so that
when any of them changes, the cached item is automatically removed.
The objects in the array can be objects, objects
or any combination of these.
The AggregateCacheDependency class differs from the CacheDependency class in that
it allows you to associate multiple dependencies of different types with a single
cached item. For example, if you create a page that imports data from a SQL Server database
table and an XML file, you can create a SqlCacheDependency object to represent a dependency
on the database table and a CacheDependency to represent the dependency on the XML file.
Rather than making an Cache.Insert method call for each dependency,
you can create an instance of the AggregateCacheDependency class with each
dependency added to it. You can then use a single Insert call to make the page
dependent on the AggregateCacheDependency instance.
- See Also:
- Serialized Form
Constructor Summary |
AggregateCacheDependency()
Initializes a new instance of the AggregateCacheDependency class that wraps multiple
This is the default constructor for the AggregateCacheDependency class. |
Method Summary |
void |
add(CacheDependency[] dependencies)
Adds an array of CacheDependency objects to the AggregateCacheDependency object. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AggregateCacheDependency
public AggregateCacheDependency()
- Initializes a new instance of the AggregateCacheDependency class that wraps multiple
This is the default constructor for the AggregateCacheDependency class.
add
public void add(CacheDependency[] dependencies)
throws ArgumentException
- Adds an array of CacheDependency objects to the AggregateCacheDependency object.
- Parameters:
dependencies
- The array of CacheDependency objects to add.
- Throws:
ArgumentException