[转]基本的缓存类操作封装(抽象类)
原文链接:http://blog.csdn.net/shadowsky/archive/2007/04/02/1548827.aspx
Imports System
Imports System.Web
Imports System.Web.Caching
Namespace DRMSystem.Common.Caching
Public MustInherit Class DataCacheAbstract
#Region "Abstract Methods"
Public MustOverride Function CreateSqlTableCacheDependency(ByVal ConfigDataBaseName As String, ByVal ConfigTableName As String) As AggregateCacheDependency
Public MustOverride Function CreateFileCacheDependency(ByVal FileName As String) As AggregateCacheDependency
Public MustOverride Function GetCache(ByVal Key As String) As Object
Public MustOverride Sub Remove(ByVal Key As String)
Public MustOverride Sub Clear()
Public MustOverride Function Add(ByVal Key As String, ByVal Value As Object, ByVal Dependencies As CacheDependency, ByVal AbsoluteExpiration As DateTime, ByVal SlidingExpiration As TimeSpan, ByVal Priority As CacheItemPriority, ByVal OnRemoveCallback As CacheItemRemovedCallback) As Object
Public MustOverride Sub Insert(ByVal Key As String, ByVal Value As Object)
Public MustOverride Sub Insert(ByVal Key As String, ByVal Value As Object, ByVal Dependencies As CacheDependency)
Public MustOverride Sub Insert(ByVal Key As String, ByVal Value As Object, ByVal Dependencies As CacheDependency, ByVal AbsoluteExpiration As DateTime, ByVal SlidingExpiration As TimeSpan)
Public MustOverride Sub Insert(ByVal Key As String, ByVal Value As Object, ByVal Dependencies As CacheDependency, ByVal AbsoluteExpiration As DateTime, ByVal SlidingExpiration As TimeSpan, ByVal Priority As CacheItemPriority, ByVal OnRemoveCallback As CacheItemRemovedCallback)
#End Region
End Class
End Namespace
Imports System
Imports System.Web
Imports System.Web.Caching
Namespace DRMSystem.Common.Caching
Public MustInherit Class DataCacheAbstract
#Region "Abstract Methods"
Public MustOverride Function CreateSqlTableCacheDependency(ByVal ConfigDataBaseName As String, ByVal ConfigTableName As String) As AggregateCacheDependency
Public MustOverride Function CreateFileCacheDependency(ByVal FileName As String) As AggregateCacheDependency
Public MustOverride Function GetCache(ByVal Key As String) As Object
Public MustOverride Sub Remove(ByVal Key As String)
Public MustOverride Sub Clear()
Public MustOverride Function Add(ByVal Key As String, ByVal Value As Object, ByVal Dependencies As CacheDependency, ByVal AbsoluteExpiration As DateTime, ByVal SlidingExpiration As TimeSpan, ByVal Priority As CacheItemPriority, ByVal OnRemoveCallback As CacheItemRemovedCallback) As Object
Public MustOverride Sub Insert(ByVal Key As String, ByVal Value As Object)
Public MustOverride Sub Insert(ByVal Key As String, ByVal Value As Object, ByVal Dependencies As CacheDependency)
Public MustOverride Sub Insert(ByVal Key As String, ByVal Value As Object, ByVal Dependencies As CacheDependency, ByVal AbsoluteExpiration As DateTime, ByVal SlidingExpiration As TimeSpan)
Public MustOverride Sub Insert(ByVal Key As String, ByVal Value As Object, ByVal Dependencies As CacheDependency, ByVal AbsoluteExpiration As DateTime, ByVal SlidingExpiration As TimeSpan, ByVal Priority As CacheItemPriority, ByVal OnRemoveCallback As CacheItemRemovedCallback)
#End Region
End Class
End Namespace