protected Cache < String , SessionData > create ( String name , long idleTime ) { return Caching . getCachingProvider ( ) . getCacheManager ( ) . createCache ( name , new MutableConfiguration < String , SessionData > ( ) . setTypes ( String . class , SessionData . class ) . setExpiryPolicyFactory ( TouchedExpiryPolicy . factoryOf ( new Duration ( TimeUnit . SECONDS , idleTime ) ) ) ) ; }
Create a cache with name and expiry policy with idle time .