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

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

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

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

admin.clearRegion( cacheName );
origin: org.apache.tomee.patch/commons-jcs-core

admin.clearRegion( cacheName );
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 );
}
org.apache.commons.jcs.adminJCSAdminBeanclearRegion

Javadoc

Clears a particular cache region.

If this class is running within a remote cache server, clears the region via the RemoteCacheServer API, so that removes will be broadcast to client machines. Otherwise clears the region directly via the usual cache API.

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
  • buildElementInfo
    Builds up info about each element in a region.
  • clearAllRegions
    Clears all regions in the cache. If this class is running within a remote cache server, clears all r
  • 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

  • Creating JSON documents from java classes using gson
  • startActivity (Activity)
  • addToBackStack (FragmentTransaction)
  • scheduleAtFixedRate (Timer)
  • Thread (java.lang)
    A thread is a thread of execution in a program. The Java Virtual Machine allows an application to ha
  • BigDecimal (java.math)
    An immutable arbitrary-precision signed decimal.A value is represented by an arbitrary-precision "un
  • ArrayList (java.util)
    ArrayList is an implementation of List, backed by an array. All optional operations including adding
  • TreeSet (java.util)
    TreeSet is an implementation of SortedSet. All optional operations (adding and removing) are support
  • JFileChooser (javax.swing)
  • JTable (javax.swing)
  • 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