You'll have to enable global state persistence for your cache manager and also specify a persistence path (the default one is a temp dir which might not be persistent across machine restarts!), either via programmatic or xml configuration.
Here is a test that accomplishes what you want: infinispan/ProtobufMetadataCachePreserveStateAcrossRestartsTest.java at master · infinispan/infinispan · GitHub
Ensure you have the <global-state/> element under <cache-container>. The default persistent state directory is the server data dir (standalone/data or domain/data).