Tabnine Logo
ObjectPoolFactory
Code IndexAdd Tabnine to your IDE (free)

How to use
ObjectPoolFactory
in
com.nepxion.thunder.common.object

Best Java code snippets using com.nepxion.thunder.common.object.ObjectPoolFactory (Showing top 6 results out of 315)

origin: Nepxion/Thunder

public static void initialize() {
  ObjectPoolFactory.initialize(properties);
  ThreadPoolFactory.initialize(properties);
  SerializerFactory.initialize(properties);
}
origin: Nepxion/Thunder

public static ObjectPool<FSTConfiguration> createPool() {
  GenericObjectPoolConfig config = ObjectPoolFactory.createFSTObjectPoolConfig();
  return new GenericObjectPool<FSTConfiguration>(
      new PooledObjectFactory<FSTConfiguration>() {
        public PooledObject<FSTConfiguration> makeObject() throws Exception {
          return new DefaultPooledObject<FSTConfiguration>(createFST());
        }
        public void destroyObject(PooledObject<FSTConfiguration> p) throws Exception {
        }
        public boolean validateObject(PooledObject<FSTConfiguration> p) {
          return false;
        }
        public void activateObject(PooledObject<FSTConfiguration> p) throws Exception {
        }
        public void passivateObject(PooledObject<FSTConfiguration> p) throws Exception {
        }
      }, config);
}
origin: Nepxion/Thunder

public static void initialize(ThunderProperties properties) {
  RedisClusterFactory.properties = properties;
  String clusterValue = null;
  try {
    clusterValue = properties.getString(ThunderConstant.REDIS_CLUSTER_ATTRIBUTE_NAME);
  } catch (Exception e) {
    LOG.warn("Redis cluster address is null, redis won't start");
    return;
  }
  if (StringUtils.isEmpty(clusterValue)) {
    LOG.warn("Redis cluster address is null, redis won't start");
    return;
  }
  try {
    HashSet<HostAndPort> clusterSet = new HashSet<HostAndPort>();
    String[] clusterArray = StringUtils.split(clusterValue, ";");
    for (String cluster : clusterArray) {
      String[] info = StringUtils.split(cluster, ":");
      clusterSet.add(new HostAndPort(info[0].trim(), Integer.valueOf(info[1].trim())));
    }
    cluster = new JedisCluster(clusterSet,
        properties.getInteger(ThunderConstant.REDIS_CONNECTION_TIMEOUT_ATTRIBUTE_NAME),
        properties.getInteger(ThunderConstant.REDIS_SO_TIMEOUT_ATTRIBUTE_NAME),
        properties.getInteger(ThunderConstant.REDIS_MAX_REDIRECTIONS_ATTRIBUTE_NAME),
        ObjectPoolFactory.createRedisObjectPoolConfig());
    LOG.info("Redis cluster is initialized...");
  } catch (Exception e) {
    LOG.error("Redis cluster is initialized failed", e);
  }
}
origin: Nepxion/Thunder

ObjectPoolFactory.createRedisObjectPoolConfig(),
properties.getInteger(ThunderConstant.REDIS_CONNECTION_TIMEOUT_ATTRIBUTE_NAME),
properties.getInteger(ThunderConstant.REDIS_SO_TIMEOUT_ATTRIBUTE_NAME),
origin: Nepxion/Thunder

protected void initializeFactory() {
  ObjectPoolFactory.initialize(properties);
  ThreadPoolFactory.initialize(properties);
  SerializerFactory.initialize(properties);
  CompressorFactory.initialize(properties);
  ProtocolEventFactory.initialize(properties);
  SmtpEventFactory.initialize(properties);
  RedisSentinelPoolFactory.initialize(properties);
  RedisClusterFactory.initialize(properties);
}
origin: Nepxion/Thunder

public static ObjectPool<FSTConfiguration> createPool() {
  GenericObjectPoolConfig config = ObjectPoolFactory.createFSTObjectPoolConfig();
  return new GenericObjectPool<FSTConfiguration>(
      new PooledObjectFactory<FSTConfiguration>() {
        public PooledObject<FSTConfiguration> makeObject() throws Exception {
          return new DefaultPooledObject<FSTConfiguration>(createFST());
        }
        public void destroyObject(PooledObject<FSTConfiguration> p) throws Exception {
        }
        public boolean validateObject(PooledObject<FSTConfiguration> p) {
          return false;
        }
        public void activateObject(PooledObject<FSTConfiguration> p) throws Exception {
        }
        public void passivateObject(PooledObject<FSTConfiguration> p) throws Exception {
        }
      }, config);
}
com.nepxion.thunder.common.objectObjectPoolFactory

Most used methods

  • initialize
  • createFSTObjectPoolConfig
  • createRedisObjectPoolConfig

Popular in Java

  • Finding current android device location
  • setScale (BigDecimal)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • onRequestPermissionsResult (Fragment)
  • InputStreamReader (java.io)
    A class for turning a byte stream into a character stream. Data read from the source input stream is
  • Runnable (java.lang)
    Represents a command that can be executed. Often used to run code in a different Thread.
  • SocketException (java.net)
    This SocketException may be thrown during socket creation or setting options, and is the superclass
  • DecimalFormat (java.text)
    A concrete subclass of NumberFormat that formats decimal numbers. It has a variety of features desig
  • Hashtable (java.util)
    A plug-in replacement for JDK1.5 java.util.Hashtable. This version is based on org.cliffc.high_scale
  • JFrame (javax.swing)
  • Best IntelliJ plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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