You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
import AbstractFactory from '../../../di/src/factory/AbstractFactory.ts'
|
|
|
|
import Cache from './Cache.ts'
|
|
|
|
import { InMemCache } from './InMemCache.ts'
|
|
|
|
import {DependencyRequirement} from '../../../di/src/type/DependencyRequirement.ts'
|
|
|
|
import {Collection} from '../collection/Collection.ts'
|
|
|
|
|
|
|
|
// TODO add support for configurable Cache backends
|
|
|
|
|
|
|
|
/**
|
|
|
|
* IoC container factory that produces cache instances.
|
|
|
|
* @extends AbstractFactory
|
|
|
|
*/
|
|
|
|
export default class CacheFactory extends AbstractFactory {
|
|
|
|
constructor() {
|
|
|
|
super({})
|
|
|
|
}
|
|
|
|
|
|
|
|
produce(dependencies: any[], parameters: any[]): Cache {
|
|
|
|
return new InMemCache()
|
|
|
|
}
|
|
|
|
|
|
|
|
match(something: any) {
|
|
|
|
return something === Cache
|
|
|
|
}
|
|
|
|
|
|
|
|
get_dependency_keys(): Collection<DependencyRequirement> {
|
|
|
|
return new Collection<DependencyRequirement>()
|
|
|
|
}
|
|
|
|
}
|