congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
J2CacheConfig.getL2CacheProperties
Code IndexAdd Tabnine to your IDE (free)

How to use
getL2CacheProperties
method
in
net.oschina.j2cache.J2CacheConfig

Best Java code snippets using net.oschina.j2cache.J2CacheConfig.getL2CacheProperties (Showing top 4 results out of 315)

origin: sanluan/PublicCMS

@Override
public void init(String region, Properties properties) {
  this.region = region;
  J2CacheConfig config = new J2CacheConfig();
  config.setSerialization(properties.getProperty("j2cache.serialization"));
  config.setBroadcast(properties.getProperty("j2cache.broadcast"));
  config.setL1CacheName(properties.getProperty("j2cache.L1.provider_class"));
  config.setL2CacheName(properties.getProperty("j2cache.L2.provider_class"));
  config.setSyncTtlToRedis(!"false".equalsIgnoreCase(properties.getProperty("j2cache.sync_ttl_to_redis")));
  config.setDefaultCacheNullObject("true".equalsIgnoreCase(properties.getProperty("j2cache.default_cache_null_object")));
  String l2_config_section = properties.getProperty("j2cache.L2.config_section");
  if (l2_config_section == null || l2_config_section.trim().equals("")) {
    l2_config_section = config.getL2CacheName();
  }
  final String l2_section = l2_config_section;
  properties.forEach((k, v) -> {
    String key = (String) k;
    if (key.startsWith(config.getBroadcast() + ".")) {
      config.getBroadcastProperties().setProperty(key.substring((config.getBroadcast() + ".").length()), (String) v);
    }
    if (key.startsWith(config.getL1CacheName() + ".")) {
      config.getL1CacheProperties().setProperty(key.substring((config.getL1CacheName() + ".").length()), (String) v);
    }
    if (key.startsWith(l2_section + ".")) {
      config.getL2CacheProperties().setProperty(key.substring((l2_section + ".").length()), (String) v);
    }
  });
  J2CacheBuilder builder = J2CacheBuilder.init(config);
  channel = builder.getChannel();
}
origin: net.oschina.j2cache/j2cache-core

/**
 * Initialize Cache Provider
 *
 * @param config   j2cache config instance
 * @param listener cache listener
 * @return holder : return CacheProviderHolder instance
 */
public static CacheProviderHolder init(J2CacheConfig config, CacheExpiredListener listener) {
  CacheProviderHolder holder = new CacheProviderHolder();
  holder.listener = listener;
  holder.l1_provider = loadProviderInstance(config.getL1CacheName());
  if (!holder.l1_provider.isLevel(CacheObject.LEVEL_1))
    throw new CacheException(holder.l1_provider.getClass().getName() + " is not level_1 cache provider");
  holder.l1_provider.start(config.getL1CacheProperties());
  log.info("Using L1 CacheProvider : {}", holder.l1_provider.getClass().getName());
  holder.l2_provider = loadProviderInstance(config.getL2CacheName());
  if (!holder.l2_provider.isLevel(CacheObject.LEVEL_2))
    throw new CacheException(holder.l2_provider.getClass().getName() + " is not level_2 cache provider");
  holder.l2_provider.start(config.getL2CacheProperties());
  log.info("Using L2 CacheProvider : {}", holder.l2_provider.getClass().getName());
  return holder;
}
origin: yuboon/Aooms

Properties l2CacheProperties = j2CacheConfig.getL2CacheProperties();
String hosts = l2CacheProperties.getProperty("hosts");
String mode = l2CacheProperties.getProperty("mode");
origin: yuboon/Aooms

Properties l2CacheProperties = j2CacheConfig.getL2CacheProperties();
String hosts = l2CacheProperties.getProperty("hosts");
String mode = l2CacheProperties.getProperty("mode");
net.oschina.j2cacheJ2CacheConfiggetL2CacheProperties

Popular methods of J2CacheConfig

  • <init>
  • getL2CacheName
  • getBroadcast
  • getBroadcastProperties
  • getL1CacheName
  • getL1CacheProperties
  • setBroadcast
  • setL1CacheName
  • setL2CacheName
  • setSerialization
  • setSyncTtlToRedis
  • getConfigStream
    get j2cache properties stream
  • setSyncTtlToRedis,
  • getConfigStream,
  • getSerialization,
  • getSubProperties,
  • initFromConfig,
  • isDefaultCacheNullObject,
  • isSyncTtlToRedis,
  • setBroadcastProperties,
  • setDefaultCacheNullObject

Popular in Java

  • Making http post requests using okhttp
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • setContentView (Activity)
  • setRequestProperty (URLConnection)
  • FlowLayout (java.awt)
    A flow layout arranges components in a left-to-right flow, much like lines of text in a paragraph. F
  • Properties (java.util)
    A Properties object is a Hashtable where the keys and values must be Strings. Each property can have
  • Set (java.util)
    A Set is a data structure which does not allow duplicate elements.
  • Executors (java.util.concurrent)
    Factory and utility methods for Executor, ExecutorService, ScheduledExecutorService, ThreadFactory,
  • Reference (javax.naming)
  • JPanel (javax.swing)
  • PhpStorm for WordPress
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now