|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.ehcache.config.builders.ResourcePoolsBuilder
public class ResourcePoolsBuilder
The ResourcePoolsBuilder enables building ResourcePools configurations using a fluent style.
As with all Ehcache builders, all instances are immutable and calling any method on the builder will return a new instance without modifying the one on which the method was called. This enables the sharing of builder instances without any risk of seeing them modified by code elsewhere.
| Method Summary | |
|---|---|
ResourcePools |
build()
Builds the ResourcePools based on this builder's configuration. |
ResourcePoolsBuilder |
disk(long size,
MemoryUnit unit)
Convenience method to add a non persistent disk pool. |
ResourcePoolsBuilder |
disk(long size,
MemoryUnit unit,
boolean persistent)
Convenience method to add a disk pool specifying persistence. |
static ResourcePoolsBuilder |
heap(long entries)
Creates a new ResourcePoolsBuilder with a heap pool sized
in entries |
ResourcePoolsBuilder |
heap(long size,
ResourceUnit unit)
Convenience method to add a heap pool. |
static ResourcePoolsBuilder |
newResourcePoolsBuilder()
Creates a new ResourcePoolsBuilder. |
static ResourcePoolsBuilder |
newResourcePoolsBuilder(ResourcePools pools)
Convenience method to get a builder from an existing ResourcePools. |
ResourcePoolsBuilder |
offheap(long size,
MemoryUnit unit)
Convenience method to add an offheap pool. |
ResourcePoolsBuilder |
with(ResourcePool resourcePool)
Add the ResourcePool of ResourceType in the returned builder. |
ResourcePoolsBuilder |
with(ResourceType<SizedResourcePool> type,
long size,
ResourceUnit unit,
boolean persistent)
Add the ResourcePool of ResourceType in the returned builder. |
ResourcePoolsBuilder |
withReplacing(ResourcePool resourcePool)
Add or replace the ResourcePool of ResourceType in the returned builder. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static ResourcePoolsBuilder newResourcePoolsBuilder()
ResourcePoolsBuilder.
public static ResourcePoolsBuilder newResourcePoolsBuilder(ResourcePools pools)
ResourcePools.
pools - the resource pools to build from
public static ResourcePoolsBuilder heap(long entries)
ResourcePoolsBuilder with a heap pool sized
in entries
entries - the maximum number of mappings to cache
public ResourcePoolsBuilder with(ResourcePool resourcePool)
ResourcePool of ResourceType in the returned builder.
resourcePool - the non-null resource pool to add
java.lang.IllegalArgumentException - if the set of resource pools already contains a pool for typepublic ResourcePoolsBuilder withReplacing(ResourcePool resourcePool)
ResourcePool of ResourceType in the returned builder.
resourcePool - the non-null resource pool to add/replace
public ResourcePoolsBuilder with(ResourceType<SizedResourcePool> type,
long size,
ResourceUnit unit,
boolean persistent)
ResourcePool of ResourceType in the returned builder.
type - the resource typesize - the pool sizeunit - the pool size unitpersistent - if the pool is to be persistent
java.lang.IllegalArgumentException - if the set of resource pools already contains a pool for type
public ResourcePoolsBuilder heap(long size,
ResourceUnit unit)
heap pool.
size - the pool sizeunit - the pool size unit
java.lang.IllegalArgumentException - if the set of resource pools already contains a heap resource
public ResourcePoolsBuilder offheap(long size,
MemoryUnit unit)
offheap pool.
size - the pool sizeunit - the pool size unit
java.lang.IllegalArgumentException - if the set of resource pools already contains an offheap resource
public ResourcePoolsBuilder disk(long size,
MemoryUnit unit)
disk pool.
size - the pool sizeunit - the pool size unit
java.lang.IllegalArgumentException - if the set of resource pools already contains a disk resource
public ResourcePoolsBuilder disk(long size,
MemoryUnit unit,
boolean persistent)
disk pool specifying persistence.
size - the pool sizeunit - the pool size unitpersistent - if the pool is persistent or not
java.lang.IllegalArgumentException - if the set of resource pools already contains a disk resourcepublic ResourcePools build()
ResourcePools based on this builder's configuration.
build in interface Builder<ResourcePools>
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||