Package org.openspaces.core.space.cache
Class LocalViewSpaceConfigurer
java.lang.Object
org.openspaces.core.space.cache.LocalViewSpaceConfigurer
- All Implemented Interfaces:
Closeable,AutoCloseable,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:
SpaceConfigurer spaceConfigurer = new SpaceProxyConfigurer("mySpace");
LocalViewSpaceConfigurer localViewConfigurer = new LocalViewSpaceConfigurer(spaceConfigurer)
.addViewQuery(new SQLQuery(SimpleMessage.class, "processed = true"));
GigaSpace localViewGigaSpace = new GigaSpaceConfigurer(localViewConfigurer).gigaSpace();
...
localViewConfigurer.close();
spaceConfigurer.close();
- Author:
- kimchy
-
Constructor Summary
ConstructorsConstructorDescriptionLocalViewSpaceConfigurer(IJSpace space) LocalViewSpaceConfigurer(SpaceConfigurer spaceConfigurer) -
Method Summary
Modifier and TypeMethodDescriptionaddProperty(String name, String value) addViewQuery(SQLQuery query) Adds a query to the view's criteria.batchSize(int batchSize) Sets the cache synchronization batch size.batchTimeout(long batchTimeout) Sets the cache synchronization batch timeout (i.e.voidclose()create()Creates and returns a local cache according to the configured settings.Returns aLocalViewMonitorinterface from the local view gigaspacemaxDisconnectionDuration(long maxDisconnectionDuration) Sets the maximum time to return cached results before switching to disconnected state.space()
-
Constructor Details
-
LocalViewSpaceConfigurer
-
LocalViewSpaceConfigurer
-
-
Method Details
-
addProperty
-
addViewQuery
Adds a query to the view's criteria.- Since:
- 8.0.5
-
batchSize
Sets the cache synchronization batch size.- Since:
- 8.0.5
-
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
Sets the maximum time to return cached results before switching to disconnected state.- Since:
- 8.0.5
-
create
Creates and returns a local cache according to the configured settings.- Returns:
- A configured space.
- Since:
- 8.0
-
localView
-
getLocalViewMonitor
Returns aLocalViewMonitorinterface from the local view gigaspace- Returns:
- A local view manager
- Since:
- 12.3
-
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein interfaceSpaceConfigurer
-
space
- Specified by:
spacein interfaceSpaceConfigurer
-