Tabnine Logo
JCSAdminBean.buildElementInfo
Code IndexAdd Tabnine to your IDE (free)

How to use
buildElementInfo
method
in
org.apache.commons.jcs.admin.JCSAdminBean

Best Java code snippets using org.apache.commons.jcs.admin.JCSAdminBean.buildElementInfo (Showing top 8 results out of 315)

origin: org.apache.commons/commons-jcs-core

context.put( "elementInfoRecords", admin.buildElementInfo( cacheName ) );
origin: org.apache.tomee.patch/commons-jcs-core

context.put( "elementInfoRecords", admin.buildElementInfo( cacheName ) );
origin: org.apache.tomee.patch/commons-jcs-core

  /**
   * Add an item to a region. Call clear all and verify that it doesn't exist.
   *
   * @throws Exception
   */
  public void testClearAll()
    throws Exception
  {
    JCSAdminBean admin = new JCSAdminBean();

    String regionName = "myRegion";
    CacheAccess<String, String> cache = JCS.getInstance( regionName );

    String key = "myKey";
    cache.put( key, "value" );

    admin.clearAllRegions();

    CacheElementInfo[] elements2 = admin.buildElementInfo( regionName );
    assertEquals( "Wrong number of elements in the region after remove.", 0, elements2.length );
  }
}
origin: org.apache.commons/commons-jcs-core

  /**
   * Add an item to a region. Call clear all and verify that it doesn't exist.
   *
   * @throws Exception
   */
  public void testClearAll()
    throws Exception
  {
    JCSAdminBean admin = new JCSAdminBean();

    String regionName = "myRegion";
    CacheAccess<String, String> cache = JCS.getInstance( regionName );

    String key = "myKey";
    cache.put( key, "value" );

    admin.clearAllRegions();

    CacheElementInfo[] elements2 = admin.buildElementInfo( regionName );
    assertEquals( "Wrong number of elements in the region after remove.", 0, elements2.length );
  }
}
origin: org.apache.commons/commons-jcs-core

/**
 * Remove an item via the remove method.
 *
 * @throws Exception
 */
public void testRemove()
  throws Exception
{
  JCSAdminBean admin = new JCSAdminBean();
  String regionName = "myRegion";
  CacheAccess<String, String> cache = JCS.getInstance( regionName );
  // clear the region
  cache.clear();
  admin.clearRegion( regionName );
  String key = "myKey";
  cache.put( key, "value" );
  CacheElementInfo[] elements = admin.buildElementInfo( regionName );
  assertEquals( "Wrong number of elements in the region.", 1, elements.length );
  CacheElementInfo elementInfo = elements[0];
  assertEquals( "Wrong key.", key, elementInfo.getKey() );
  admin.removeItem( regionName, key );
  CacheElementInfo[] elements2 = admin.buildElementInfo( regionName );
  assertEquals( "Wrong number of elements in the region after remove.", 0, elements2.length );
}
origin: org.apache.tomee.patch/commons-jcs-core

/**
 * Remove an item via the remove method.
 *
 * @throws Exception
 */
public void testRemove()
  throws Exception
{
  JCSAdminBean admin = new JCSAdminBean();
  String regionName = "myRegion";
  CacheAccess<String, String> cache = JCS.getInstance( regionName );
  // clear the region
  cache.clear();
  admin.clearRegion( regionName );
  String key = "myKey";
  cache.put( key, "value" );
  CacheElementInfo[] elements = admin.buildElementInfo( regionName );
  assertEquals( "Wrong number of elements in the region.", 1, elements.length );
  CacheElementInfo elementInfo = elements[0];
  assertEquals( "Wrong key.", key, elementInfo.getKey() );
  admin.removeItem( regionName, key );
  CacheElementInfo[] elements2 = admin.buildElementInfo( regionName );
  assertEquals( "Wrong number of elements in the region after remove.", 0, elements2.length );
}
origin: org.apache.tomee.patch/commons-jcs-core

/**
 * Put a value in a region and verify that it shows up.
 *
 * @throws Exception
 */
public void testGetElementForRegionInfo()
  throws Exception
{
  String regionName = "myRegion";
  CacheAccess<String, String> cache = JCS.getInstance( regionName );
  // clear the region
  cache.clear();
  String key = "myKey";
  cache.put( key, "value" );
  JCSAdminBean admin = new JCSAdminBean();
  CacheElementInfo[] elements = admin.buildElementInfo( regionName );
  assertEquals( "Wrong number of elements in the region.", 1, elements.length );
  CacheElementInfo elementInfo = elements[0];
  assertEquals( "Wrong key." + elementInfo, key, elementInfo.getKey() );
}
origin: org.apache.commons/commons-jcs-core

/**
 * Put a value in a region and verify that it shows up.
 *
 * @throws Exception
 */
public void testGetElementForRegionInfo()
  throws Exception
{
  String regionName = "myRegion";
  CacheAccess<String, String> cache = JCS.getInstance( regionName );
  // clear the region
  cache.clear();
  String key = "myKey";
  cache.put( key, "value" );
  JCSAdminBean admin = new JCSAdminBean();
  CacheElementInfo[] elements = admin.buildElementInfo( regionName );
  assertEquals( "Wrong number of elements in the region.", 1, elements.length );
  CacheElementInfo elementInfo = elements[0];
  assertEquals( "Wrong key." + elementInfo, key, elementInfo.getKey() );
}
org.apache.commons.jcs.adminJCSAdminBeanbuildElementInfo

Javadoc

Builds up info about each element in a region.

Popular methods of JCSAdminBean

  • <init>
    Parameterized constructor
  • buildCacheInfo
    Builds up data on every region. TODO we need a most light weight method that does not count bytes. T
  • clearAllRegions
    Clears all regions in the cache. If this class is running within a remote cache server, clears all r
  • clearRegion
    Clears a particular cache region. If this class is running within a remote cache server, clears the
  • removeItem
    Removes a particular item from a particular region. If this class is running within a remote cache s
  • getByteCount
    Tries to estimate how much data is in a region. This is expensive. If there are any non serializable

Popular in Java

  • Start an intent from android
  • onCreateOptionsMenu (Activity)
  • notifyDataSetChanged (ArrayAdapter)
  • findViewById (Activity)
  • FileReader (java.io)
    A specialized Reader that reads from a file in the file system. All read requests made by calling me
  • NumberFormat (java.text)
    The abstract base class for all number formats. This class provides the interface for formatting and
  • Properties (java.util)
    A Properties object is a Hashtable where the keys and values must be Strings. Each property can have
  • HttpServlet (javax.servlet.http)
    Provides an abstract class to be subclassed to create an HTTP servlet suitable for a Web site. A sub
  • Project (org.apache.tools.ant)
    Central representation of an Ant project. This class defines an Ant project with all of its targets,
  • IsNull (org.hamcrest.core)
    Is the value null?
  • Top Vim 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