/** * This implementation clones the configuration passed in before using it. * * @param configuration to use * @return a cache * @throws ConfigurationException if there are problems with the cfg */ public Cache<K, V> createCache(Configuration configuration) throws ConfigurationException { return createCache(configuration, true); }
public Cache<K, V> createCache(String configFileName) throws ConfigurationException { return createCache(configFileName, true); }
public Cache<K, V> createCache() throws ConfigurationException { return createCache(true); }
/** * 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); }
public Cache<K, V> createCache(boolean start) throws ConfigurationException { return createCache(new Configuration(), start); }
public Cache<K, V> createCache(InputStream is, boolean start) throws ConfigurationException { XmlConfigurationParser parser = new XmlConfigurationParser(); Configuration c = parser.parseStream(is); return createCache(c, start); }
public Cache<K, V> createCache(InputStream is) throws ConfigurationException { XmlConfigurationParser parser = new XmlConfigurationParser(); Configuration c = null; try { c = parser.parseStream(is); } catch (ConfigurationException e) { XmlConfigurationParser2x oldParser = new XmlConfigurationParser2x(); c = oldParser.parseStream(is); if (c != null && log.isInfoEnabled()) log.info("Detected legacy configuration file format when parsing configuration file. Migrating to the new (3.x) file format is recommended. See FAQs for details."); } return createCache(c); }
/** * 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);
public Cache<K, V> createCache(String configFileName, boolean start) throws ConfigurationException { XmlConfigurationParser parser = new XmlConfigurationParser(); Configuration c; try { c = parser.parseFile(configFileName); } catch (ConfigurationException e) { XmlConfigurationParser2x oldParser = new XmlConfigurationParser2x(); c = oldParser.parseFile(configFileName); } return createCache(c, start); }
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); } }