public JBossCacheCacheFactory() { super(); cacheFactory = new DefaultCacheFactory<String, Object>(); }
/** * Extension point for subclasses, where we actually use a * {@link CacheFactory} to create a cache. This default implementation * uses {@link DefaultCacheFactory}. * * @param config the Configuration for the cache * @return the Cache */ protected Cache<Object, Object> createCache(Configuration config) { return new DefaultCacheFactory<Object, Object>().createCache(config, false); }
/** * This is here for backward compatibility only. Use <tt>new DefaultCacheFactory()</tt> instead. * * @deprecated */ @SuppressWarnings("unchecked") @Deprecated @Compat public static CacheFactory getInstance() { return new DefaultCacheFactory(); }
@Override public void afterPropertiesSet() throws Exception { final CacheFactory<String, Ticket> cf = new DefaultCacheFactory<>(); this.cache = cf.createCache(this.configLocation.getInputStream()); }
Configuration config = new Configuration(); config.setCacheMode(LOCAL); Cache cache = new DefaultCacheFactory().createCache(config, false); ...
protected void constructCache() throws ConfigurationException { log.debug("Constructing Cache"); CacheFactory<K, V> cf = new DefaultCacheFactory<K, V>(); setCache(cf.createCache(config, false)); }
public void start() { CacheFactory<String, Object> factory = new DefaultCacheFactory<>(); String configFileName = CONFIG_PATH; _cache = factory.createCache(configFileName, false); _cache.create(); _cache.start(); } }
/** * Create a cache using the given settings and properties. * * @param settings The Hibernate settings * @param properties The configuration properties * @return The created cache */ protected Cache createSharedCache(Settings settings, Properties properties) { String configResource = PropertiesHelper.getString(CACHE_RESOURCE_PROP, properties, null); if (configResource == null) { configResource = PropertiesHelper.getString(LEGACY_CACHE_RESOURCE_PROP, properties, DEFAULT_CACHE_RESOURCE); } return new DefaultCacheFactory().createCache(configResource, false); }
CacheSPI cache = (CacheSPI) new DefaultCacheFactory<Object, Object>().createCache(configFileName); ConsoleListener listener = new ConsoleListener(cache); listener.listen();
cache = (CacheSPI) new DefaultCacheFactory<Object, Object>().createCache(this.config);
@Create public void create() { log.debug("Starting JBoss Cache"); try { CacheFactory factory = new DefaultCacheFactory(); cache = factory.createCache(getConfigurationAsStream()); cache.create(); cache.start(); } catch (Exception e) { //log.error(e, e); throw new IllegalStateException("Error starting JBoss Cache", e); } }
public void init() throws SipCacheException { String pojoConfigurationPath = configProperties.getProperty(JBOSS_CACHE_CONFIG_PATH, DEFAULT_FILE_CONFIG_PATH); if (clusteredlogger.isLoggingEnabled(StackLogger.TRACE_INFO)) { clusteredlogger.logInfo( "Mobicents JAIN SIP JBoss Cache Configuration path is : " + pojoConfigurationPath); } try { cache = new DefaultCacheFactory<String, SIPDialog>().createCache(pojoConfigurationPath); cache.create(); cacheListener = new JBossJainSipCacheListener(clusteredSipStack); cache.addCacheListener(cacheListener); } catch (Exception e) { throw new SipCacheException("Couldn't init JBoss Cache", e); } }