com.sapportals.portal.prt.util

Class StringBufferPool

java.lang.Object
  extended by com.sapportals.portal.prt.util.AbstractPool
      extended by com.sapportals.portal.prt.util.StringBufferPool

public class StringBufferPool
extends AbstractPool

StringBufferPool.java Created: Wed Jun 27 10:52:51 2001


Field Summary
protected static String DEFAULT_POOL_NAME
           
protected static StringBufferPool m_corePoolFactory
           
protected static HashMap mm_namedPools
           
protected  String mm_poolName
           
protected static int STRINGBUFFER_INITIALCAPACITY
           
protected static int STRINGBUFFER_INITIALNBINSTANCES
           
protected static int STRINGBUFFER_MAX_POOLSIZE
           
 
Fields inherited from class com.sapportals.portal.prt.util.AbstractPool
mm_maxPoolSize, mm_unlocked
 
Constructor Summary
protected StringBufferPool(int initialCapacity, int initialNbInstances, int maxSize)
           
 
Method Summary
static StringBufferPool createInstance(String poolName, int intialCapacity)
          Creates a pool and bind to the name specified by the poolName argument.
static StringBufferPool createInstance(String poolName, int intialCapacity, int initialNbInstances)
          Creates a pool and bind to the name specified by the poolName argument.
static StringBufferPool createInstance(String poolName, int intialCapacity, int initialNbInstances, int maxPoolSize)
          Creates a pool and bind to the name specified by the poolName argument.
protected  StringBufferPool createInstanceInternal(String poolName, int intialCapacity)
          Creates a pool and bind to the name specified by the poolName argument.
protected  StringBufferPool createInstanceInternal(String poolName, int intialCapacity, int initialNbInstances)
          Creates a pool and bind to the name specified by the poolName argument.
protected  StringBufferPool createInstanceInternal(String poolName, int intialCapacity, int initialNbInstances, int maxPoolSize)
          Creates a pool and bind to the name specified by the poolName argument.
protected  Object createPoolObject()
          Factory method to create pool objects
static void deleteInstance(String poolName)
           
protected static void ensureInitialized()
           
protected  void expirePoolObject(Object o)
          Callback when object are not managed anymore by the pool.
 RecyclableStringBuffer get(int size)
          Returns the
static StringBufferPool getInstance()
          Gets the StringBufferPool instance.
static StringBufferPool getInstance(String poolName)
          Gets a StringBufferPool specified by the poolName argument.
protected  StringBufferPool getInstanceInternal()
          Gets the StringBufferPool instance.
protected  StringBufferPool getInstanceInternal(String poolName)
          Gets a StringBufferPool specified by the poolName argument.
 void release(RecyclableStringBuffer rStrBuf)
           
protected  boolean validatePoolObject(Object o)
          Method called to validate an object that has been put back in the pool
 
Methods inherited from class com.sapportals.portal.prt.util.AbstractPool
getPoolObject, releasePoolObject, updateController
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_corePoolFactory

protected static StringBufferPool m_corePoolFactory

mm_namedPools

protected static HashMap mm_namedPools

DEFAULT_POOL_NAME

protected static final String DEFAULT_POOL_NAME
See Also:
Constant Field Values

STRINGBUFFER_INITIALCAPACITY

protected static final int STRINGBUFFER_INITIALCAPACITY
See Also:
Constant Field Values

STRINGBUFFER_INITIALNBINSTANCES

protected static final int STRINGBUFFER_INITIALNBINSTANCES
See Also:
Constant Field Values

STRINGBUFFER_MAX_POOLSIZE

protected static final int STRINGBUFFER_MAX_POOLSIZE
See Also:
Constant Field Values

mm_poolName

protected String mm_poolName
Constructor Detail

StringBufferPool

protected StringBufferPool(int initialCapacity,
                           int initialNbInstances,
                           int maxSize)
Method Detail

getInstance

public static StringBufferPool getInstance()
Gets the StringBufferPool instance. Note that this instance can be shared among all portal processes and applications. Returns the StringBufferPool instance.


ensureInitialized

protected static void ensureInitialized()

getInstance

public static StringBufferPool getInstance(String poolName)
Gets a StringBufferPool specified by the poolName argument. This will eventually create the corresponding pool using default capacity and max size values. But a client should typically create its own pool using the createInstance method first and use the getInstance afterwards. Returns a StringBufferPool instance


createInstance

public static StringBufferPool createInstance(String poolName,
                                              int intialCapacity)
Creates a pool and bind to the name specified by the poolName argument. If the pool already exists the method simply returns the previous instance ignoring the initial capacity argument. Returns a StringBufferPool instance


createInstance

public static StringBufferPool createInstance(String poolName,
                                              int intialCapacity,
                                              int initialNbInstances)
Creates a pool and bind to the name specified by the poolName argument. If the pool already exists the method simply returns the previous instance ignoring the all additional arguments. Returns a StringBufferPool instance


createInstance

public static StringBufferPool createInstance(String poolName,
                                              int intialCapacity,
                                              int initialNbInstances,
                                              int maxPoolSize)
Creates a pool and bind to the name specified by the poolName argument. If the pool already exists the method simply returns the previous instance ignoring the all additional arguments. Returns a StringBufferPool instance


deleteInstance

public static void deleteInstance(String poolName)

validatePoolObject

protected boolean validatePoolObject(Object o)
Description copied from class: AbstractPool
Method called to validate an object that has been put back in the pool

Specified by:
validatePoolObject in class AbstractPool
Parameters:
o -
Returns:
true is the object is valid for reuse.

createPoolObject

protected Object createPoolObject()
                           throws Exception
Description copied from class: AbstractPool
Factory method to create pool objects

Specified by:
createPoolObject in class AbstractPool
Returns:
the object to be pooled
Throws:
Exception

expirePoolObject

protected void expirePoolObject(Object o)
Description copied from class: AbstractPool
Callback when object are not managed anymore by the pool.

Specified by:
expirePoolObject in class AbstractPool
Parameters:
o -

get

public RecyclableStringBuffer get(int size)
Returns the

Parameters:
size -

release

public void release(RecyclableStringBuffer rStrBuf)
Parameters:
rStrBuf -

createInstanceInternal

protected StringBufferPool createInstanceInternal(String poolName,
                                                  int intialCapacity)
Creates a pool and bind to the name specified by the poolName argument. If the pool already exists the method simply returns the previous instance ignoring the initial capacity argument. Returns a StringBufferPool instance


createInstanceInternal

protected StringBufferPool createInstanceInternal(String poolName,
                                                  int intialCapacity,
                                                  int initialNbInstances)
Creates a pool and bind to the name specified by the poolName argument. If the pool already exists the method simply returns the previous instance ignoring the all additional arguments. Returns a StringBufferPool instance


createInstanceInternal

protected StringBufferPool createInstanceInternal(String poolName,
                                                  int intialCapacity,
                                                  int initialNbInstances,
                                                  int maxPoolSize)
Creates a pool and bind to the name specified by the poolName argument. If the pool already exists the method simply returns the previous instance ignoring the all additional arguments. Returns a StringBufferPool instance


getInstanceInternal

protected StringBufferPool getInstanceInternal()
Gets the StringBufferPool instance. Note that this instance can be shared among all portal processes and applications. Returns the StringBufferPool instance.


getInstanceInternal

protected StringBufferPool getInstanceInternal(String poolName)
Gets a StringBufferPool specified by the poolName argument. This will eventually create the corresponding pool using default capacity and max size values. But a client should typically create its own pool using the createInstance method first and use the getInstance afterwards. Returns a StringBufferPool instance

Access Rights

This class can be accessed from:


SC DC Public Part ACH
[sap.com] EP-BASIS-API [sap.com] epbc.prtapi._apideprecated default EP-PIN-PRT
[sap.com] EP-BASIS-API [sap.com] tc/epbc/prt/api api EP-PIN
[sap.com] EP-BASIS-API [sap.com] tc/epbc/prt/lib/api api EP-PIN
[sap.com] EP-RUNTIME [sap.com] tc/ep/semantics/api api EP-PIN
[sap.com] KMC-WPC [sap.com] tc/kmc/wpc/wpcfacade api EP-PIN-WPC-WCM


Copyright 2015 SAP AG Complete Copyright Notice