@@ -916,9 +916,7 @@ <h4 id="_create_a_remote_connection">Create a Remote Connection</h4>
916916
917917builder.uri("hotrod://admin:secret@localhost:11222"); < i class ="conum " data-value ="2 "> </ i > < b > (2)</ b >
918918
919- builder.clientIntelligence(ClientIntelligence.BASIC); < i class ="conum " data-value ="3 "> </ i > < b > (3)</ b >
920-
921- remoteCacheManager = new RemoteCacheManager(builder.build()); < i class ="conum " data-value ="4 "> </ i > < b > (4)</ b > </ code > </ pre >
919+ remoteCacheManager = new RemoteCacheManager(builder.build()); < i class ="conum " data-value ="3 "> </ i > < b > (3)</ b > </ code > </ pre >
922920</ div >
923921</ div >
924922< div class ="colist arabic ">
@@ -933,10 +931,6 @@ <h4 id="_create_a_remote_connection">Create a Remote Connection</h4>
933931</ tr >
934932< tr >
935933< td > < i class ="conum " data-value ="3 "> </ i > < b > 3</ b > </ td >
936- < td > Uses < code > BASIC</ code > Hot Rod client intelligence. This is required to use Docker with a Mac.</ td >
937- </ tr >
938- < tr >
939- < td > < i class ="conum " data-value ="4 "> </ i > < b > 4</ b > </ td >
940934< td > Creates a < code > RemoteCacheManager</ code > with the configuration.</ td >
941935</ tr >
942936</ table >
@@ -1331,31 +1325,28 @@ <h4 id="_configure_the_serialization_context">Configure the Serialization Contex
13311325</ table >
13321326</ div >
13331327< div class ="listingblock ">
1334- < div class ="title "> org.infinispan.tutorial.db.LocationWeatherMarshallingContext </ div >
1328+ < div class ="title "> org.infinispan.tutorial.db.DataSourceConnector </ div >
13351329< div class ="content ">
1336- < pre class ="pygments highlight "> < code data-lang ="java "> // Retrieve metadata cache
1337- RemoteCache<String, String> metadataCache =
1338- cacheManager.getCache(ProtobufMetadataManagerConstants.PROTOBUF_METADATA_CACHE_NAME); < i class ="conum " data-value ="1 "> </ i > < b > (1)</ b >
1330+ < pre class ="pygments highlight "> < code data-lang ="java "> // Step - Get or create a Queryable Cache
1331+ public RemoteCache<String, LocationWeather> getWeatherCache() {
1332+ Objects.requireNonNull(remoteCacheManager);
1333+
1334+ // Step - Upload schema on the server
1335+ remoteCacheManager.administration().schemas()
1336+ .createOrUpdate(new LocationWeatherSchemaImpl()); < i class ="conum " data-value ="1 "> </ i > < b > (1)</ b >
13391337
1340- GeneratedSchema schema = new LocationWeatherSchemaImpl(); < i class =" conum " data-value =" 2 " > </ i > < b > (2) </ b >
1338+ System.out.println("---- Get the 'weather' cache ----");
13411339
1342- // Define the new schema on the server too
1343- metadataCache.put(schema.getProtoFileName(), schema.getProtoFile()); < i class ="conum " data-value ="3 "> </ i > < b > (3)</ b > </ code > </ pre >
1340+ // Get the cache
1341+ return remoteCacheManager.getCache("weather");
1342+ }</ code > </ pre >
13441343</ div >
13451344</ div >
13461345< div class ="colist arabic ">
13471346< table >
13481347< tr >
13491348< td > < i class ="conum " data-value ="1 "> </ i > < b > 1</ b > </ td >
1350- < td > Retrieves the metadata cache that stores all Protobuf schemas.</ td >
1351- </ tr >
1352- < tr >
1353- < td > < i class ="conum " data-value ="2 "> </ i > < b > 2</ b > </ td >
1354- < td > Use the class generated from the < code > LocationWeatherSchema</ code > interface to retrieve the schema.</ td >
1355- </ tr >
1356- < tr >
1357- < td > < i class ="conum " data-value ="3 "> </ i > < b > 3</ b > </ td >
1358- < td > Adds the schema to the cache.</ td >
1349+ < td > Use schema administration to upload to the server</ td >
13591350</ tr >
13601351</ table >
13611352</ div >
@@ -1790,7 +1781,7 @@ <h2 id="_whats_next">What’s Next?</h2>
17901781</ div >
17911782< div id ="footer ">
17921783< div id ="footer-text ">
1793- Last updated 2024-05-17 16:18:39 +0200
1784+ Last updated 2025-11-21 19:14:11 +0100
17941785</ div >
17951786</ div >
17961787</ body >
0 commit comments