Package org.jboss.util

Examples of org.jboss.util.TimedCachePolicy.peek()


      if (keys != null && keys.isEmpty() == false)
      {
         Map<Object, VFSContext> contexts = new TreeMap<Object, VFSContext>();
         for (Object key : keys)
         {
            VFSContext context = (VFSContext)tcp.peek(key);
            if (context != null) // should be there, but you never know
               contexts.put(key, context);
         }

         return contexts.values();
View Full Code Here


      List keys = tcp.getValidKeys();
      if (keys != null && keys.isEmpty() == false)
      {
         Map<Object, VFSContext> contexts = new TreeMap<Object, VFSContext>();
         for (Object key : keys)
            contexts.put(key, (VFSContext)tcp.peek(key));

         return contexts.values();
      }
      return Collections.emptySet();
   }
View Full Code Here

        cache.insert("1", new Refreshable(5, "value1", 4));
        cache.insert("2", new Refreshable(3, "value2", 10));
        cache.insert("3", "value3");
        long start = System.currentTimeMillis();
        // Loop until the longest lived value is gone
        while( cache.peek("2") != null )
        {
            long now = System.currentTimeMillis();
            System.out.println("Elapsed: "+(now - start) / 1000);
            System.out.println("get(1) -> "+cache.get("1"));
            System.out.println("get(2) -> "+cache.get("2"));
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.