+ translated tabs into spaces to avoid code rendering problems
This commit is contained in:
@@ -56,16 +56,16 @@
|
||||
checked exceptions, threading or resource management concerns:</para>
|
||||
|
||||
<programlisting language="java">template.execute(new GemfireCallback<Iterable<String>>() {
|
||||
public Iterable<String> doInGemfire(Region reg) throws GemFireCheckedException, GemFireException {
|
||||
// working against a Region of String
|
||||
Region<String, String> region = reg;
|
||||
|
||||
region.put("1", "one");
|
||||
region.put("3", "three");
|
||||
|
||||
// should return 1
|
||||
return region.query("length < 5).size();
|
||||
}
|
||||
public Iterable<String> doInGemfire(Region reg) throws GemFireCheckedException, GemFireException {
|
||||
// working against a Region of String
|
||||
Region<String, String> region = reg;
|
||||
|
||||
region.put("1", "one");
|
||||
region.put("3", "three");
|
||||
|
||||
// should return 1
|
||||
return region.query("length < 5).size();
|
||||
}
|
||||
});</programlisting>
|
||||
</section>
|
||||
|
||||
@@ -185,19 +185,19 @@
|
||||
case:</para>
|
||||
|
||||
<programlisting language="java">public class DBLoader extends WiringDeclarableSupport implements CacheLoader {
|
||||
private DataSource dataSource;
|
||||
|
||||
public void setDataSource(DataSource ds){
|
||||
this.dataSource = ds;
|
||||
}
|
||||
|
||||
public Object load(LoaderHelper helper) { ... }
|
||||
private DataSource dataSource;
|
||||
|
||||
public void setDataSource(DataSource ds){
|
||||
this.dataSource = ds;
|
||||
}
|
||||
|
||||
public Object load(LoaderHelper helper) { ... }
|
||||
}</programlisting>
|
||||
|
||||
<programlisting language="xml"><cache-loader>
|
||||
<class-name>com.company.app.DBLoader</class-name>
|
||||
<!-- no parameter is passed (use the bean implicit name
|
||||
that is the class name) -->
|
||||
that is the class name) -->
|
||||
</cache-loader></programlisting>
|
||||
|
||||
<programlisting language="xml"><?xml version="1.0" encoding="UTF-8"?>
|
||||
@@ -207,8 +207,8 @@
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans
|
||||
http://www.springframework.org/schema/beans/spring-beans.xsd">
|
||||
|
||||
<bean id="dataSource" ... />
|
||||
|
||||
<bean id="dataSource" ... />
|
||||
|
||||
<!-- template bean definition -->
|
||||
<bean id="com.company.app.DBLoader" abstract="true" p:dataSource-ref="dataSource"/>
|
||||
</beans></programlisting>
|
||||
@@ -236,8 +236,8 @@
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans
|
||||
http://www.springframework.org/schema/beans/spring-beans.xsd">
|
||||
|
||||
<bean id="dataSource" ... />
|
||||
|
||||
<bean id="dataSource" ... />
|
||||
|
||||
<!-- template bean definition -->
|
||||
<bean id="template-bean" abstract="true" p:dataSource-ref="dataSource"/>
|
||||
|
||||
@@ -271,11 +271,11 @@
|
||||
<interface>DataSource</interface> in the following way:</para>
|
||||
|
||||
<programlisting language="java">public class DBLoader extends WiringDeclarableSupport implements CacheLoader {
|
||||
// use annotations to 'mark' the needed dependencies
|
||||
@javax.inject.Inject
|
||||
private DataSource dataSource;
|
||||
|
||||
public Object load(LoaderHelper helper) { ... }
|
||||
// use annotations to 'mark' the needed dependencies
|
||||
@javax.inject.Inject
|
||||
private DataSource dataSource;
|
||||
|
||||
public Object load(LoaderHelper helper) { ... }
|
||||
}</programlisting>
|
||||
|
||||
<programlisting language="xml"><cache-loader>
|
||||
@@ -308,4 +308,4 @@
|
||||
<classname>DBLoader</classname> code.</para>
|
||||
</section>
|
||||
</section>
|
||||
</chapter>
|
||||
</chapter>
|
||||
@@ -123,4 +123,4 @@ Hello World!
|
||||
their dependency and life-cycle callbacks.</para>
|
||||
</section>
|
||||
</section>
|
||||
</chapter>
|
||||
</chapter>
|
||||
@@ -45,10 +45,10 @@
|
||||
as a usual bean:</para>
|
||||
|
||||
<programlisting language="xml"><bean id="instantiator" class="org.springframework.data.gemfire.serialization.WiringInstantiator">
|
||||
<!-- DataSerializable type -->
|
||||
<constructor-arg>org.pkg.SomeDataSerializableClass</constructor-arg>
|
||||
<!-- type id -->
|
||||
<constructor-arg>95</constructor-arg>
|
||||
<!-- DataSerializable type -->
|
||||
<constructor-arg>org.pkg.SomeDataSerializableClass</constructor-arg>
|
||||
<!-- type id -->
|
||||
<constructor-arg>95</constructor-arg>
|
||||
</bean></programlisting>
|
||||
|
||||
<para>During the container startup, once it is being initialized, the
|
||||
@@ -71,12 +71,12 @@
|
||||
reflection:</para>
|
||||
|
||||
<programlisting language="xml"><bean id="instantiator-factory" class="org.springframework.data.gemfire.serialization.InstantiatorFactoryBean">
|
||||
<property name="customTypes">
|
||||
<map>
|
||||
<entry key="org.pkg.CustomTypeA" value="1025"/>
|
||||
<entry key="org.pkg.CustomTypeB" value="1026"/>
|
||||
</map>
|
||||
</property>
|
||||
<property name="customTypes">
|
||||
<map>
|
||||
<entry key="org.pkg.CustomTypeA" value="1025"/>
|
||||
<entry key="org.pkg.CustomTypeB" value="1026"/>
|
||||
</map>
|
||||
</property>
|
||||
</bean></programlisting>
|
||||
|
||||
<para>The definition above, automatically generated two
|
||||
|
||||
Reference in New Issue
Block a user