GigaSpaces - Open Spaces

org.openspaces.core.space.cache
Class LocalCacheSpaceConfigurer

java.lang.Object
  extended by org.openspaces.core.space.cache.LocalCacheSpaceConfigurer

public class LocalCacheSpaceConfigurer
extends Object

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"});
 IJSpace space = urlSpaceConfigurer.space();

 LocalCacheSpaceConfigurer localCacheConfigurer = new LocalCacheSpaceConfigurer(space).updateMode(UpdateMode.PULL);
 IJSpace localCache = localCacheConfigurer.localCache();
 ...
 localCacheConfigurer.destroy();
 urlSpaceConfigurer.destroy(); // optional
 

Author:
kimchy

Nested Class Summary
static class LocalCacheSpaceConfigurer.UpdateMode
           
 
Constructor Summary
LocalCacheSpaceConfigurer(com.j_spaces.core.IJSpace space)
           
 
Method Summary
 LocalCacheSpaceConfigurer addProperty(String name, String value)
           
 void destroy()
           
 com.j_spaces.core.IJSpace localCache()
           
 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(com.j_spaces.core.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)

localCache

public com.j_spaces.core.IJSpace localCache()

destroy

public void destroy()

GigaSpaces - Open Spaces

Copyright © GigaSpaces.