GigaSpaces XAP 9.5 API

org.openspaces.core.space.cache
Class LocalCacheSpaceConfigurer

java.lang.Object
  extended by org.openspaces.core.space.cache.LocalCacheSpaceConfigurer
All Implemented Interfaces:
SpaceConfigurer

public class LocalCacheSpaceConfigurer
extends Object
implements SpaceConfigurer

A simple configurer helper to create IJSpace local cache. The configurer wraps LocalCacheSpaceFactoryBean and providing a simpler means to configure it using code.

An example of using it:

 UrlSpaceConfigurer urlSpaceConfigurer = new UrlSpaceConfigurer("/./space").schema("cache")
          .noWriteLeaseMode(true).lookupGroups(new String[] {"kimchy"});

 LocalCacheSpaceConfigurer localCacheConfigurer = new LocalCacheSpaceConfigurer(urlSpaceConfigurer).updateMode(UpdateMode.PULL);
 GigaSpace localCacheGigaSpace = new GigaSpaceConfigurer(localCacheConfigurer).gigaSpace();
 ...
 localCacheConfigurer.destroy();
 urlSpaceConfigurer.destroy();
 

Author:
kimchy

Nested Class Summary
static class LocalCacheSpaceConfigurer.UpdateMode
           
 
Constructor Summary
LocalCacheSpaceConfigurer(IJSpace space)
           
LocalCacheSpaceConfigurer(SpaceConfigurer spaceConfigurer)
           
 
Method Summary
 LocalCacheSpaceConfigurer addProperty(String name, String value)
           
 LocalCacheSpaceConfigurer batchSize(int batchSize)
          Sets the cache synchronization batch size.
 LocalCacheSpaceConfigurer batchTimeout(long batchTimeout)
          Sets the cache synchronization batch timeout (i.e. maximum time the server will batch entries before updating the client).
 IJSpace create()
          Creates and returns a local cache according to the configured settings.
 void destroy()
           
 IJSpace localCache()
           
 LocalCacheSpaceConfigurer maxDisconnectionDuration(long maxDisconnectionDuration)
          Sets the maximum time to return cached results before switching to disconnected state.
 LocalCacheSpaceConfigurer maxTimeToLive(long maxTimeToLive)
           
 LocalCacheSpaceConfigurer size(int size)
           
 IJSpace space()
           
 LocalCacheSpaceConfigurer updateMode(LocalCacheSpaceConfigurer.UpdateMode mode)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LocalCacheSpaceConfigurer

public LocalCacheSpaceConfigurer(SpaceConfigurer spaceConfigurer)

LocalCacheSpaceConfigurer

public LocalCacheSpaceConfigurer(IJSpace space)
Method Detail

addProperty

public LocalCacheSpaceConfigurer addProperty(String name,
                                             String value)
See Also:
AbstractLocalCacheSpaceFactoryBean.setProperties(java.util.Properties)

updateMode

public LocalCacheSpaceConfigurer updateMode(LocalCacheSpaceConfigurer.UpdateMode mode)
See Also:
LocalCacheSpaceFactoryBean.setUpdateModeName(String)

maxTimeToLive

public LocalCacheSpaceConfigurer maxTimeToLive(long maxTimeToLive)
See Also:
LocalCacheSpaceFactoryBean.setMaxTimeToLive(long)

size

public LocalCacheSpaceConfigurer size(int size)
See Also:
LocalCacheSpaceFactoryBean.setSize(int)

batchSize

public LocalCacheSpaceConfigurer batchSize(int batchSize)
Sets the cache synchronization batch size.

Since:
8.0.5

batchTimeout

public LocalCacheSpaceConfigurer batchTimeout(long batchTimeout)
Sets the cache synchronization batch timeout (i.e. maximum time the server will batch entries before updating the client).

Since:
8.0.5

maxDisconnectionDuration

public LocalCacheSpaceConfigurer maxDisconnectionDuration(long maxDisconnectionDuration)
Sets the maximum time to return cached results before switching to disconnected state.

Since:
8.0.5

create

public IJSpace create()
Creates and returns a local cache according to the configured settings.

Returns:
A configured space.
Since:
8.0

localCache

public IJSpace localCache()

destroy

public void destroy()

space

public IJSpace space()
Specified by:
space in interface SpaceConfigurer

GigaSpaces XAP 9.5 API

Copyright © GigaSpaces.