/** * Creates the cache to be used for storing string registries. This method can be overriden * to use a particular cache implementation. * * @param expirationDuration * The duration until a cache entry expires * @param expirationTimeUnit * The time unit for the cache expiration * @return An appropriate cache instance */ protected StringRegistryCache createCache(final long expirationDuration, final TimeUnit expirationTimeUnit) { return new StringRegistryCache(expirationDuration, expirationTimeUnit); }
/** * Creates the cache to be used for storing string registries. This method can be overriden * to use a particular cache implementation. * * @param expirationDuration * The duration until a cache entry expires * @param expirationTimeUnit * The time unit for the cache expiration * @return An appropriate cache instance */ protected StringRegistryCache createCache(final long expirationDuration, final TimeUnit expirationTimeUnit) { return new StringRegistryCache(expirationDuration, expirationTimeUnit); }
/** * Constructor which allows to specify a configuration property which contains the cache duration in the * given time unit. Since defaults are populated by the super constructor, the access to the configuration * property needs to be deferred until after the super constructor invocation. * * @param configuration * The configuration for this component. * @param projectContext * The project context for this component. The component will be registered. * @param cacheDurationProperty * The name of the configuration property containing the cache duration * @param cacheDurationTimeUnit * The time unit for the cache duration */ protected AbstractStringRegistryReaderPlugin(final Configuration configuration, final IProjectContext projectContext, final String cacheDurationProperty, final TimeUnit cacheDurationTimeUnit) { super(configuration, projectContext); // Since the defaults are populated by the super constructor, the property access // must be performed after the super call final long cacheExpirationDuration = configuration.getLongProperty(cacheDurationProperty); this.stringRegistryLookup = new StringRegistryCache(cacheExpirationDuration, cacheDurationTimeUnit); }
/** * Constructor which allows to specify a configuration property which contains the cache duration in the * given time unit. Since defaults are populated by the super constructor, the access to the configuration * property needs to be deferred until after the super constructor invocation. * * @param configuration * The configuration for this component. * @param projectContext * The project context for this component. The component will be registered. * @param cacheDurationProperty * The name of the configuration property containing the cache duration * @param cacheDurationTimeUnit * The time unit for the cache duration */ protected AbstractStringRegistryReaderPlugin(final Configuration configuration, final IProjectContext projectContext, final String cacheDurationProperty, final TimeUnit cacheDurationTimeUnit) { super(configuration, projectContext); // Since the defaults are populated by the super constructor, the property access // must be performed after the super call final long cacheExpirationDuration = configuration.getLongProperty(cacheDurationProperty); this.stringRegistryLookup = new StringRegistryCache(cacheExpirationDuration, cacheDurationTimeUnit); }