JCache - hazelcast/hazelcast-scala GitHub Wiki
Hazelcast comes with built-in support for JCache, JSR 107, but since it's based on an external specification, getting an instance is different than other distributed data structures in Hazelcast.
The hazelcast-scala API provides a getCache(name)
method, to make this as easy as the other data structures:
import com.hazelcast.Scala.jcache._
val hz: HazelcastInstance: ???
val cache = hz.getCache[Int, String]("MyJCache")
JCache adds support for strong type-safety by checking types at runtime. This is enabled by default when using the getCache
method. If not required, it can be explicitly disabled:
val cache = hz.getCache[Int, String]("MyJCache", typesafe = false)