public interface GridSpiJsonConfigurable
The main idea behind JSON-based configuration is to provide more terse configuration via JSON rather than traditional Spring syntax.
void setJson(String json)
JSON specification is available at http://www.json.org. Additionally to the standard JSON there are two special properties:
@class property specifying fully
qualified class name. If type is not specified implementation will try to infer the type
via reflection. If type is not specified and cannot be determined via reflection, the
implementation will use HashMap for net.sf.json.JSONObject and
ArrayList for net.sf.json.JSONArray.
@elem property providing fully
qualified class name. If type is not specified implementation will try to infer the type
via reflection. If type is not specified and cannot be determined via reflection, the
implementation will use HashMap for net.sf.json.JSONObject and
ArrayList for net.sf.json.JSONArray.
This example defines one HashMap with the only key key mapped to
LinkedHashMap object that will have two entries with the keys a0 and a1.
The mapped values will be of type foo.bar.A which has settable property val:
{
key: {
a0: {val:'test0'},
a1: {val:'test1'},
@class:'java.util.LinkedHashMap',
@elem:'foo.bar.A'
}
}
Note that you can see more examples on JSON configuration for specific SPI in default Spring
XML configuration file ${GRIDGAIN_HOME}/config/default-config.xml
The following example shows usage of JSON configuration in Spring XML:
<property name="communicationSpi">
<bean class="org.gridgain.grid.spi.communication.tcp.GridTcpCommunicationSpi">
<property name="json"
value="{directBuffer: 'false', localAddress='1.2.3.4', localPort: 47100, localPortRange: 100}"/>
</bean>
</property>
json - JSON expression.
Core Products
:
Data Grid ver. 6.0.2,
Streaming ver. 6.0.2
Accelerators
:
Hadoop Accelerator ver. 6.0.2
Release Date
:
March 24 2014