Tabnine Logo
StackObjectPool.<init>
Code IndexAdd Tabnine to your IDE (free)

How to use
org.apache.commons.pool.impl.StackObjectPool
constructor

Best Java code snippets using org.apache.commons.pool.impl.StackObjectPool.<init> (Showing top 13 results out of 315)

origin: commons-pool/commons-pool

/**
 * Create a StackObjectPool.
 * 
 * @return a new StackObjectPool with the configured factory, maxIdle and initial capacity settings
 */
public ObjectPool<T> createPool() {
  return new StackObjectPool<T>(_factory,_maxSleeping,_initCapacity);
}
origin: org.apache.commons/com.springsource.org.apache.commons.pool

public ObjectPool createPool() {
  return new StackObjectPool(_factory,_maxSleeping,_initCapacity);
}
origin: org.apache.openjpa/openjpa-all

/**
 * Create a StackObjectPool.
 * 
 * @return a new StackObjectPool with the configured factory, maxIdle and initial capacity settings
 */
public ObjectPool<T> createPool() {
  return new StackObjectPool<T>(_factory,_maxSleeping,_initCapacity);
}
origin: org.wso2.carbon.appmgt/org.wso2.carbon.appmgt.impl

public void init() {
  clientPool = new StackObjectPool(new BasePoolableObjectFactory() {
    @Override
    public Object makeObject() throws Exception {
      return new RemoteAuthorizationManagerClient();
    }
  });
}
origin: org.apache.commons/pool

/**
 * Create a StackObjectPool.
 * 
 * @return a new StackObjectPool with the configured factory, maxIdle and initial capacity settings
 */
public ObjectPool<T> createPool() {
  return new StackObjectPool<T>(_factory,_maxSleeping,_initCapacity);
}
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.commons-pool

public ObjectPool createPool() {
  return new StackObjectPool(_factory,_maxSleeping,_initCapacity);
}
origin: org.wso2.carbon.appmgt/org.wso2.carbon.appmgt.gateway

private ThriftKeyValidatorClientPool() {
  log.debug("Initializing thrift key validator client pool");
  clientPool = new StackObjectPool(new BasePoolableObjectFactory() {
    @Override
    public Object makeObject() throws Exception {
      log.debug("Initializing new ThriftKeyValidatorClient instance");
      return new ThriftKeyValidatorClient();
    }
  }, 50, 20);
}
origin: org.wso2.carbon.appmgt/org.wso2.carbon.appmgt.gateway

private APIKeyValidatorClientPool() {
  log.debug("Initializing WebApp key validator client pool");
  clientPool = new StackObjectPool(new BasePoolableObjectFactory() {
    @Override
    public Object makeObject() throws Exception {
      log.debug("Initializing new APIKeyValidatorClient instance");
      return new APIKeyValidatorClient();
    }
  }, 50, 20);
}
origin: org.wso2.carbon.apimgt/org.wso2.carbon.apimgt.keymgt.client

private SubscriberKeyMgtClientPool() {
  log.debug("Initializing API Key Management Client Pool");
  clientPool = new StackObjectPool(new BasePoolableObjectFactory() {
    @Override
    public Object makeObject() throws Exception {
      log.debug("Initializing new SubscriberKeyMgtClient instance");
      return new SubscriberKeyMgtClient(serverURL, username, password);
    }
  }, 20, 5);
}
origin: org.opencms/opencms-core

/**
 * Initialize the static part of the class.<p>
 *
 * @param config the combined configuration of "opencms.properties" and the "persistence.xml"
 */
public static void init(CmsParameterConfiguration config) {
  if (!m_isInitialized) {
    m_isInitialized = true;
    String connProps = buildConnectionPropertiesValue(config, CmsDbPool.OPENCMS_DEFAULT_POOL_NAME);
    Properties systemProps = System.getProperties();
    systemProps.setProperty(CmsPersistenceUnitConfiguration.ATTR_CONNECTION_PROPERTIES, connProps);
    m_persistenceFactory = Persistence.createEntityManagerFactory(JPA_PERSISTENCE_UNIT, systemProps);
    m_factoryTable.put(JPA_PERSISTENCE_UNIT, m_persistenceFactory);
    CmsPoolEntityManagerFactory entityMan = new CmsPoolEntityManagerFactory(m_persistenceFactory);
    int entityManagerPoolSize = config.getInteger(
      CmsDbPool.KEY_DATABASE_POOL
        + "."
        + CmsDbPool.OPENCMS_DEFAULT_POOL_NAME
        + "."
        + CmsDbPool.KEY_ENTITY_MANAGER_POOL_SIZE,
      DEFAULT_ENTITY_MANAGER_POOL_SIZE);
    m_openCmsEmPool = new StackObjectPool(entityMan, entityManagerPoolSize, 0);
  }
}
origin: org.wso2.carbon.apimgt/org.wso2.carbon.apimgt.gateway

private APIKeyValidatorClientPool() {
  String maxIdleClients = ServiceReferenceHolder.getInstance().getAPIManagerConfiguration().getFirstProperty
      ("APIKeyValidator.ConnectionPool.MaxIdle");
  String initIdleCapacity = ServiceReferenceHolder.getInstance().getAPIManagerConfiguration().getFirstProperty
      ("APIKeyValidator.ConnectionPool.InitIdleCapacity");
  int initIdleCapSize;
  if (StringUtils.isNotEmpty(maxIdleClients)) {
    maxIdle = Integer.parseInt(maxIdleClients);
  } else {
    maxIdle = 50;
  }
  if (StringUtils.isNotEmpty(initIdleCapacity)) {
    initIdleCapSize = Integer.parseInt(initIdleCapacity);
  } else {
    initIdleCapSize = 20;
  }
  log.debug("Initializing API key validator client pool");
  clientPool = new StackObjectPool(new BasePoolableObjectFactory() {
    @Override
    public Object makeObject() throws Exception {
      log.debug("Initializing new APIKeyValidatorClient instance");
      return new APIKeyValidatorClient();
    }
  }, maxIdle, initIdleCapSize);
}
origin: org.wso2.carbon.apimgt/org.wso2.carbon.apimgt.gateway

private ThriftKeyValidatorClientPool() {
  String maxIdleClients = ServiceReferenceHolder.getInstance().getAPIManagerConfiguration().getFirstProperty
      ("APIKeyValidator.ConnectionPool.MaxIdle");
  String initIdleCapacity = ServiceReferenceHolder.getInstance().getAPIManagerConfiguration().getFirstProperty
      ("APIKeyValidator.ConnectionPool.InitIdleCapacity");
  if (StringUtils.isNotEmpty(maxIdleClients)) {
    maxIdle = Integer.parseInt(maxIdleClients);
  } else {
    maxIdle = 50;
  }
  int initIdleCapSize;
  if (StringUtils.isNotEmpty(initIdleCapacity)) {
    initIdleCapSize = Integer.parseInt(initIdleCapacity);
  } else {
    initIdleCapSize = 20;
  }
  log.debug("Initializing thrift key validator client pool");
  clientPool = new StackObjectPool(new BasePoolableObjectFactory() {
    @Override
    public Object makeObject() throws Exception {
      log.debug("Initializing new ThriftKeyValidatorClient instance");
      return new ThriftKeyValidatorClient();
    }
  }, maxIdle, initIdleCapSize);
}
origin: org.wso2.carbon.apimgt/org.wso2.carbon.apimgt.gateway

private ThrottleDataPublisherPool() {
  //Using stack object pool to handle high concurrency scenarios without droping any messages.
  //Tuning this pool is mandatory according to use cases.
  //A finite number of "sleeping" or idle instances is enforced, but when the pool is empty, new instances
  // are created to support the new load. Hence this following data stricture places no limit on the number of "
  // active" instance created by the pool, but is quite useful for re-using Objects without introducing
  // artificial limits.
  //Proper tuning is mandatory for good performance according to system load.
  ThrottleProperties.DataPublisherPool dataPublisherPoolConfiguration = ServiceReferenceHolder
      .getInstance().getThrottleProperties().getDataPublisherPool();
  clientPool = new StackObjectPool(new BasePoolableObjectFactory() {
    @Override
    public Object makeObject() throws Exception {
      if(log.isDebugEnabled()) {
        log.debug("Initializing new ThrottleDataPublisher instance");
      }
      return new DataProcessAndPublishingAgent();
    }
  }, dataPublisherPoolConfiguration.getMaxIdle(), dataPublisherPoolConfiguration.getInitIdleCapacity());
}
org.apache.commons.pool.implStackObjectPool<init>

Javadoc

Create a new pool using no factory. Clients must first #setFactory(PoolableObjectFactory)else this pool will not behave correctly. Clients may first populate the pool using #returnObject(java.lang.Object)before they can be #borrowObject but this useage is discouraged.

Popular methods of StackObjectPool

  • assertOpen
  • clear
    Clears any objects sitting idle in the pool.
  • getNumActive
    Return the number of instances currently borrowed from this pool.
  • isClosed

Popular in Java

  • Creating JSON documents from java classes using gson
  • putExtra (Intent)
  • getExternalFilesDir (Context)
  • getSupportFragmentManager (FragmentActivity)
  • GridBagLayout (java.awt)
    The GridBagLayout class is a flexible layout manager that aligns components vertically and horizonta
  • Window (java.awt)
    A Window object is a top-level window with no borders and no menubar. The default layout for a windo
  • Runnable (java.lang)
    Represents a command that can be executed. Often used to run code in a different Thread.
  • HttpURLConnection (java.net)
    An URLConnection for HTTP (RFC 2616 [http://tools.ietf.org/html/rfc2616]) used to send and receive d
  • Arrays (java.util)
    This class contains various methods for manipulating arrays (such as sorting and searching). This cl
  • Calendar (java.util)
    Calendar is an abstract base class for converting between a Date object and a set of integer fields
  • Best plugins for Eclipse
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