GigaSpaces XAP 9.7.2 API

org.openspaces.core.space.cache
Class LocalViewSpaceConfigurer

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

public class LocalViewSpaceConfigurer
extends Object
implements SpaceConfigurer

A simple configurer helper to create IJSpace local view. The configurer wraps LocalViewSpaceFactoryBean 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"});

 LocalViewSpaceConfigurer localViewConfigurer = new LocalViewSpaceConfigurer(urlSpaceConfigurer)
           .addView(new View(SimpleMessage.class, "processed = true"));
 GigaSpace localViewGigaSpace = new GigaSpaceConfigurer(localViewConfigurer).gigaSpace();
 ...
 localViewConfigurer.destroy();
 urlSpaceConfigurer.destroy(); // optional
 

Author:
kimchy

Constructor Summary
LocalViewSpaceConfigurer(IJSpace space)
           
LocalViewSpaceConfigurer(SpaceConfigurer spaceConfigurer)
           
 
Method Summary
 LocalViewSpaceConfigurer addProperty(String name, String value)
           
 LocalViewSpaceConfigurer addView(View view)
          Deprecated. since 8.0.5 - use addViewQuery(SQLQuery) instead.
 LocalViewSpaceConfigurer addViewQuery(SQLQuery query)
          Adds a query to the view's criteria.
 LocalViewSpaceConfigurer batchSize(int batchSize)
          Sets the cache synchronization batch size.
 LocalViewSpaceConfigurer 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 localView()
           
 LocalViewSpaceConfigurer maxDisconnectionDuration(long maxDisconnectionDuration)
          Sets the maximum time to return cached results before switching to disconnected state.
 IJSpace space()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LocalViewSpaceConfigurer

public LocalViewSpaceConfigurer(SpaceConfigurer spaceConfigurer)

LocalViewSpaceConfigurer

public LocalViewSpaceConfigurer(IJSpace space)
Method Detail

addProperty

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

addView

@Deprecated
public LocalViewSpaceConfigurer addView(View view)
Deprecated. since 8.0.5 - use addViewQuery(SQLQuery) instead.


addViewQuery

public LocalViewSpaceConfigurer addViewQuery(SQLQuery query)
Adds a query to the view's criteria.

Since:
8.0.5

batchSize

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

Since:
8.0.5

batchTimeout

public LocalViewSpaceConfigurer 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 LocalViewSpaceConfigurer 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

localView

public IJSpace localView()

destroy

public void destroy()

space

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

GigaSpaces XAP 9.7.2 API

Copyright © GigaSpaces.