Tabnine Logo
CachePolicy.peek
Code IndexAdd Tabnine to your IDE (free)

How to use
peek
method
in
org.jboss.util.CachePolicy

Best Java code snippets using org.jboss.util.CachePolicy.peek (Showing top 7 results out of 315)

origin: org.jboss.jbossas/jboss-as-server

public boolean isActive(Object id)
{
 // Check whether an object with the given id is available in the cache
 synchronized (getCacheLock())
 {
   return getCache().peek(id) != null;
 }
}
origin: org.jboss.jbossas/jboss-as-server

protected void doInvalidate(java.io.Serializable key)
{
 if (key != null)
 {
   synchronized (getCacheLock())
   {
    EnterpriseContext ctx = (EnterpriseContext)getCache().peek(key);
    if(ctx != null)
    {
      release(ctx);
    }
   }
 }
}
origin: org.jboss.jbossas/jboss-as-server

/**
* From InstanceCache interface
* @jmx:managed-operation
*/
public void remove(Object id)
{
 if (id == null) throw new IllegalArgumentException("Can't remove an object using a null key");
 synchronized (getCacheLock())
 {
   if (getCache().peek(id) != null)
   {
    getCache().remove(id);
   }
 }
}
origin: org.jboss.security/jbosssx-bare

/** An accessor method that synchronizes access on the domainCache
to avoid a race condition that can occur when the cache entry expires
in the presence of multi-threaded access. The allowRefresh flag should
be true for authentication accesses and false for other accesses.
Previously the other accesses included authorization and caller principal
mapping. Now the only use of the 
@param principal - the caller identity whose cached credentials are to
be accessed.
@param allowRefresh - a flag indicating if the cache access should flush
any expired entries.
*/
private DomainInfo getCacheInfo(Principal principal, boolean allowRefresh)
{
 if (domainCache == null)
   return null;
 DomainInfo cacheInfo = null;
 synchronized (domainCache)
 {
   if (allowRefresh == true)
    cacheInfo = (DomainInfo) domainCache.get(principal);
   else
    cacheInfo = (DomainInfo) domainCache.peek(principal);
   if (cacheInfo != null)
    cacheInfo.acquire();
 }
 return cacheInfo;
}
origin: org.jboss.security/jbosssx-bare

/** An accessor method that synchronizes access on the domainCache
to avoid a race condition that can occur when the cache entry expires
in the presence of multi-threaded access. The allowRefresh flag should
be true for authentication accesses and false for other accesses.
Previously the other accesses included authorization and caller principal
mapping. Now the only use of the 
@param principal - the caller identity whose cached credentials are to
be accessed.
@param allowRefresh - a flag indicating if the cache access should flush
any expired entries.
*/
private DomainInfo getCacheInfo(Principal principal, boolean allowRefresh)
{
 if( domainCache == null )
   return null;
 DomainInfo cacheInfo = null;
 synchronized( domainCache )
 {
   if( allowRefresh == true )
    cacheInfo = (DomainInfo) domainCache.get(principal);
   else
    cacheInfo = (DomainInfo) domainCache.peek(principal);
   if( cacheInfo != null )
    cacheInfo.acquire();
 }
 return cacheInfo;
}
origin: org.jboss.security/jbosssx-bare

if (domainCache.peek(principal) != null)
 domainCache.remove(principal);
domainCache.insert(principal, info);
origin: org.jboss.security/jbosssx-bare

if( domainCache.peek(principal) != null )
 domainCache.remove(principal);
domainCache.insert(principal, info);
org.jboss.utilCachePolicypeek

Javadoc

Returns the object paired with the specified key if it's present in the cache, otherwise must return null.
Implementations of this method must have complexity of order O(1). This method should not apply the implemented caching policy to the object paired with the given key, so that a client can query if an object is cached without "refresh" its cache status. Real requests for the object must be done using #get.

Popular methods of CachePolicy

  • get
    Returns the object paired with the specified key if it's present in the cache, otherwise must return
  • remove
    Remove the cached object paired with the specified key. Implementations of this method must have co
  • flush
    Flushes the cached objects from the cache.
  • insert
    Inserts the specified object into the cache following the implemented policy. Implementations of th
  • create
  • start
  • destroy
  • stop
  • size

Popular in Java

  • Start an intent from android
  • findViewById (Activity)
  • getSupportFragmentManager (FragmentActivity)
  • addToBackStack (FragmentTransaction)
  • BufferedReader (java.io)
    Wraps an existing Reader and buffers the input. Expensive interaction with the underlying reader is
  • FileNotFoundException (java.io)
    Thrown when a file specified by a program cannot be found.
  • HttpURLConnection (java.net)
    An URLConnection for HTTP (RFC 2616 [http://tools.ietf.org/html/rfc2616]) used to send and receive d
  • HashMap (java.util)
    HashMap is an implementation of Map. All optional operations are supported.All elements are permitte
  • NoSuchElementException (java.util)
    Thrown when trying to retrieve an element past the end of an Enumeration or Iterator.
  • JOptionPane (javax.swing)
  • From CI to AI: The AI layer in your organization
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