dafabet手机版登录 3.5 DocumentationCURRENT
The static method returns a new instance.
Use the builder to define a with alias "preConfigured". This cache will be created when is invoked on the actual instance.
The first argument is the cache alias, which is used to retrieve the cache from the .
The second argument, , is used to configure the .
We use the static method on to create a default configuration.
Finally, invoking returns a fully instantiated, but uninitialized, we can use.
Before using the it needs to be initialized, which can be done in 1 of 2 ways:
Calling on the instance, or calling the method with the boolean parameter set to true.
A cache is retrieved by passing its alias, key type and value type to the .
For instance, to obtain the cache declared in step 2 you need its , and .
For type-safety, we ask for both key and value types to be passed in.
If these differ from the ones we expect, the throws a early in the application’s lifecycle.
This guards the from being polluted by random types.
The can be used to create new instances as needed. Just as in step 2, it requires passing in an
alias as well as a . The instantiated and fully initialized added will be returned and/or
accessed through the API.
The newly added can now be used to store entries, which are comprised of key value pairs.
The put method’s first parameter is the key and the second parameter is the value.
Remember the key and value types must be the same types as those defined in the .
Additionally the key must be unique and is only associated with one value.
A value is retrieved from a cache by calling the method.
It only takes one parameter which is the key, and returns the value associated with that key. If there is no value associated with that key then null is returned.
We can a given . The will not only remove its reference to the
, but will also close it. The releases all locally held transient resources (such as memory).
References to this become unusable.
In order to release all transient resources (memory, threads, …?) a provides to instances
it manages, you have to invoke , which in turns closes all instances known at the time.