/** * Test if an entry can expire. * @param key The key. * @return True, if entry can expire. */ public boolean canExpire(Object key) { boolean ret = true; CacheEntry ce = (CacheEntry)lru.get(key); if(ce!=null) { ret = ce.getCacheDate()!=-1; } return ret; }
/** * Add a future command. */ public void addFutureCommand(String callid, Runnable command) { getRemoteReferenceModule().checkThread(); List<Runnable> coms = terminationcommands.get(callid); if(coms==null) { coms = new ArrayList<Runnable>(); terminationcommands.put(callid, coms); } coms.add(command); }
/** * Add a future command. */ public void addFutureCommand(String callid, Runnable command) { getRemoteReferenceModule().checkThread(); List<Runnable> coms = terminationcommands.get(callid); if(coms==null) { coms = new ArrayList<Runnable>(); terminationcommands.put(callid, coms); } coms.add(command); }
Long lastmod = LASTMODS.get(path); if(lastmod!=null)
/** * Gets a visual element by BPMN id. * * @param id The ID. * @return The element, null if not found. */ public VElement getVisualElementById(mxICell startelement, String id) { VElement ret = elementidcache.get(id); if (ret == null) { ret = findElementById(startelement, id); elementidcache.put(id, ret); } return ret; }
System.arraycopy(imports, 0, keys, 3, imports.length); Tuple keytuple = new Tuple(keys); cached = modelcache.get(keytuple);
ret = beaninfos.get(beaninfokey);
/** * Get a send target manager for addresses. */ public SendManager getSendManager(IComponentIdentifier cid) { SendManager ret = managers.get(cid.getRoot()); if(ret==null) { ret = new SendManager(); managers.put(cid.getRoot(), ret); } return ret; }
/** * Get a send target manager for addresses. */ public SendManager getSendManager(IComponentIdentifier cid) { SendManager ret = managers.get(cid.getRoot()); if(ret==null) { ret = new SendManager(); managers.put(cid.getRoot(), ret); } return ret; }
/** * Get a send target manager for addresses. */ public SendManager getSendManager(IComponentIdentifier cid) { SendManager ret = managers.get(cid.getRoot()); if(ret==null) { ret = new SendManager(); managers.put(cid.getRoot(), ret); } return ret; }
/** * Get data from the cache. * @param key The key. * @param now The current time (-1 for never expire). * @return The cached object. */ public Object get(Object key, long now) { Object ret = null; CacheEntry ce = (CacheEntry)lru.get(key); if(ce!=null) { if(ce.isExpired(now)) { // System.out.println("expired: "+ce.getData()+" "+now+" "+ce.getCacheDate()+" "+ce.getTimeToLive()); lru.remove(key); } else { // System.out.println("not expired: "+ce.getData()+" "+now+" "+ce.getCacheDate()+" "+ce.getTimeToLive()); ret = ce.getData(); } } return ret; }
Tuple2<Long, String> entry = HASHES.get(path); String hash = entry!=null ? entry.getSecondEntity() : null;
/** * Test if the interceptor is applicable. * @return True, if applicable. */ public final boolean isApplicable(ServiceInvocationContext context) { boolean ret = false; if(super.isApplicable(context)) { Boolean app = applicables.get(context.getMethod()); if(app!=null) { ret = app.booleanValue(); } else { ret = customIsApplicable(context); applicables.put(context.getMethod(), ret? Boolean.TRUE: Boolean.FALSE); } } return ret; }
/** * Test if the interceptor is applicable. * @return True, if applicable. */ public final boolean isApplicable(ServiceInvocationContext context) { boolean ret = false; if(super.isApplicable(context)) { Boolean app = applicables.get(context.getMethod()); if(app!=null) { ret = app.booleanValue(); } else { ret = customIsApplicable(context); applicables.put(context.getMethod(), ret? Boolean.TRUE: Boolean.FALSE); } } return ret; }
/** * Get or generate a proxy class. */ protected Class<?> getProxyClass(IServiceIdentifier serviceid, ClassLoader classloader, Class<?> baseclass, Map<String, Object> mapprops) throws Exception { Class<?> iface = serviceid.getServiceType().getType(classloader); Class<?> ret = proxyclasses.get(new Tuple2<Class<?>, Class<?>>(iface, baseclass)); if(ret==null) { List<RestMethodInfo> rmis = generator.generateRestMethodInfos(serviceid, classloader, baseclass, mapprops); ret = createProxyClass(serviceid, classloader, baseclass, mapprops, rmis); proxyclasses.put(new Tuple2<Class<?>, Class<?>>(iface, baseclass), ret); } return ret; }
/** * Get or generate a proxy class. */ protected Class<?> getProxyClass(IService service, ClassLoader classloader, Class<?> baseclass, Map<String, Object> mapprops) throws Exception { Class<?> iface = service.getServiceIdentifier().getServiceType().getType(classloader); Class<?> ret = proxyclasses.get(new Tuple2<Class<?>, Class<?>>(iface, baseclass)); if(ret==null) { List<RestMethodInfo> rmis = generator.generateRestMethodInfos(service, classloader, baseclass, mapprops); ret = createProxyClass(service, classloader, baseclass, mapprops, rmis); proxyclasses.put(new Tuple2<Class<?>, Class<?>>(iface, baseclass), ret); } return ret; }
Date date = releasedatecache.get(rec.getRoot()); crl.resultAvailable(date);
Date date = releasedatecache.get(rec.getRoot()); crl.resultAvailable(date);