|
|||||||||
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 ResourceType.Core.DISK pool. |
ResourcePoolsBuilder |
disk(long size,
MemoryUnit unit,
boolean persistent)
Convenience method to add a ResourceType.Core.DISK pool specifying persistence. |
ResourcePoolsBuilder |
heap(long size,
ResourceUnit unit)
Convenience method to add a ResourceType.Core.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 a ResourceType.Core.OFFHEAP pool. |
ResourcePoolsBuilder |
with(ResourceType type,
long size,
ResourceUnit unit,
boolean persistent)
Adds 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 ResourcePoolsBuilder with(ResourceType 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
public ResourcePoolsBuilder heap(long size, ResourceUnit unit)
ResourceType.Core.HEAP
pool.
size
- the pool sizeunit
- the pool size unit
public ResourcePoolsBuilder offheap(long size, MemoryUnit unit)
ResourceType.Core.OFFHEAP
pool.
size
- the pool sizeunit
- the pool size unit
public ResourcePoolsBuilder disk(long size, MemoryUnit unit)
ResourceType.Core.DISK
pool.
size
- the pool sizeunit
- the pool size unit
public ResourcePoolsBuilder disk(long size, MemoryUnit unit, boolean persistent)
ResourceType.Core.DISK
pool specifying persistence.
size
- the pool sizeunit
- the pool size unitpersistent
- if the pool is persistent or not
public 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 |