GigaSpaces XAP 7.0 API

org.openspaces.core.map
Class MapConfigurer

java.lang.Object
  extended by org.openspaces.core.map.MapConfigurer

public class MapConfigurer
extends Object

A simple configurer helper to create IMap based on an IJSpace. The configurer wraps MapFactoryBean and providing a simpler means to configure it using code.

An example of using it:

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

 IMap map = new MapConfigurer(space).localCachePutFirst(true).createMap();
 ...
 urlSpaceConfigurer.destroySpace(); // optional
 

Author:
kimchy

Nested Class Summary
static class MapConfigurer.UpdateMode
           
 
Constructor Summary
MapConfigurer(IJSpace space)
           
 
Method Summary
 MapConfigurer clustered(boolean clustered)
           
 MapConfigurer compression(int compression)
           
 IMap createMap()
          Creates an IMap based on the configuration.
 MapConfigurer localCacheEvictionStrategy(EvictionStrategy evictionStrategy)
           
 MapConfigurer localCachePutFirst(boolean putFirst)
           
 MapConfigurer localCacheSizeLimit(int sizeLimit)
           
 MapConfigurer localCacheUpdateMode(MapConfigurer.UpdateMode updateMode)
           
 MapConfigurer localCacheUseMulticast(boolean useMulticast)
           
 MapConfigurer localCacheVersioned(boolean versioned)
           
 IMap map()
          Creates an IMap based on the configuration.
 MapConfigurer useLocalCache()
          If no local cache properties are set, will mark this map to use local cache.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MapConfigurer

public MapConfigurer(IJSpace space)
Method Detail

clustered

public MapConfigurer clustered(boolean clustered)
See Also:
MapFactoryBean.setClustered(Boolean)

compression

public MapConfigurer compression(int compression)
See Also:
MapFactoryBean.setCompression(int)

useLocalCache

public MapConfigurer useLocalCache()
If no local cache properties are set, will mark this map to use local cache.


localCacheVersioned

public MapConfigurer localCacheVersioned(boolean versioned)
See Also:
MapFactoryBean.setLocalCacheSupport(LocalCacheSupport), LocalCacheSupport.setVersioned(boolean)

localCacheEvictionStrategy

public MapConfigurer localCacheEvictionStrategy(EvictionStrategy evictionStrategy)
See Also:
MapFactoryBean.setLocalCacheSupport(LocalCacheSupport), LocalCacheSupport.setEvictionStrategy(com.j_spaces.javax.cache.EvictionStrategy)

localCacheUpdateMode

public MapConfigurer localCacheUpdateMode(MapConfigurer.UpdateMode updateMode)
See Also:
MapFactoryBean.setLocalCacheSupport(LocalCacheSupport), LocalCacheSupport.setUpdateModeName(String)

localCacheUseMulticast

public MapConfigurer localCacheUseMulticast(boolean useMulticast)
See Also:
MapFactoryBean.setLocalCacheSupport(LocalCacheSupport), LocalCacheSupport.setUseMulticast(boolean)

localCachePutFirst

public MapConfigurer localCachePutFirst(boolean putFirst)
See Also:
MapFactoryBean.setLocalCacheSupport(LocalCacheSupport), LocalCacheSupport.setPutFirst(boolean)

localCacheSizeLimit

public MapConfigurer localCacheSizeLimit(int sizeLimit)
See Also:
MapFactoryBean.setLocalCacheSupport(LocalCacheSupport), LocalCacheSupport.setSizeLimit(int)

createMap

public IMap createMap()
Creates an IMap based on the configuration. Uses MapFactoryBean.afterPropertiesSet().


map

public IMap map()
Creates an IMap based on the configuration. Uses MapFactoryBean.afterPropertiesSet().


GigaSpaces XAP 7.0 API

Copyright © GigaSpaces.