congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
CacheElementInfo
Code IndexAdd Tabnine to your IDE (free)

How to use
CacheElementInfo
in
org.apache.commons.jcs.admin

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

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

  /**
   * @return string info on the item
   */
  @Override
  public String toString()
  {
    StringBuilder buf = new StringBuilder();
    buf.append( "\nCacheElementInfo " );
    buf.append( "\n Key [" ).append( getKey() ).append( "]" );
    buf.append( "\n Eternal [" ).append( isEternal() ).append( "]" );
    buf.append( "\n CreateTime [" ).append( getCreateTime() ).append( "]" );
    buf.append( "\n MaxLifeSeconds [" ).append( getMaxLifeSeconds() ).append( "]" );
    buf.append( "\n ExpiresInSeconds [" ).append( getExpiresInSeconds() ).append( "]" );

    return buf.toString();
  }
}
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() );
}
origin: org.apache.commons/commons-jcs-core

elementInfo = new CacheElementInfo(
    String.valueOf( key ),
    attributes.getIsEternal(),
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.tomee.patch/commons-jcs-core

elementInfo = new CacheElementInfo(
    String.valueOf( key ),
    attributes.getIsEternal(),
origin: org.apache.tomee.patch/commons-jcs-core

  /**
   * @return string info on the item
   */
  @Override
  public String toString()
  {
    StringBuilder buf = new StringBuilder();
    buf.append( "\nCacheElementInfo " );
    buf.append( "\n Key [" ).append( getKey() ).append( "]" );
    buf.append( "\n Eternal [" ).append( isEternal() ).append( "]" );
    buf.append( "\n CreateTime [" ).append( getCreateTime() ).append( "]" );
    buf.append( "\n MaxLifeSeconds [" ).append( getMaxLifeSeconds() ).append( "]" );
    buf.append( "\n ExpiresInSeconds [" ).append( getExpiresInSeconds() ).append( "]" );

    return buf.toString();
  }
}
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.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 );
}
org.apache.commons.jcs.adminCacheElementInfo

Javadoc

Stores info on a cache element for the template

Most used methods

  • getKey
  • <init>
    Parameterized constructor
  • getCreateTime
  • getExpiresInSeconds
    Ignored if isEternal
  • getMaxLifeSeconds
    Ignored if isEternal
  • isEternal

Popular in Java

  • Parsing JSON documents to java classes using gson
  • requestLocationUpdates (LocationManager)
  • onCreateOptionsMenu (Activity)
  • setContentView (Activity)
  • BufferedInputStream (java.io)
    A BufferedInputStream adds functionality to another input stream-namely, the ability to buffer the i
  • BigInteger (java.math)
    An immutable arbitrary-precision signed integer.FAST CRYPTOGRAPHY This implementation is efficient f
  • Format (java.text)
    The base class for all formats. This is an abstract base class which specifies the protocol for clas
  • Scanner (java.util)
    A parser that parses a text string of primitive types and strings with the help of regular expressio
  • Handler (java.util.logging)
    A Handler object accepts a logging request and exports the desired messages to a target, for example
  • JList (javax.swing)
  • Github Copilot alternatives
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