/** * Put an entry in the cache. * @param key The key. * @param value The value. * @param now The current time (-1 for never expire). */ public void put(Object key, Object value, long now, long ttl) { CacheEntry ce = new CacheEntry(value, now, ttl); lru.put(key, ce); }
/** * Add a termination command. */ public void addTerminationCommand(String callid, Runnable command) { getRemoteReferenceModule().checkThread(); terminationcommands.put(callid, command); }
public void exceptionOccurred(Exception exception) { releasedatecache.put(rec.getRoot(), null); crl.resultAvailable(null); } });
public void exceptionOccurred(Exception exception) { releasedatecache.put(rec.getRoot(), null); crl.resultAvailable(null); } });
/** * 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); }
LASTMODS.put(path, Long.valueOf(ret));
/** * 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; }
beaninfos.put(beaninfokey, 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 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; }
HASHES.put(path, new Tuple2<Long, String>(Long.valueOf(getLastModified(f)), hash)); saveHashCache();
/** * 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; }
/** * Decodes and adds sub-objects during decoding. * * @param object The instantiated object. * @param clazz The class of the object. * @param context The decoding context. * @return The finished object. */ public Object decodeSubObjects(Object object, Class<?> clazz, IDecodingContext context) { LRU ret = (LRU) object; int maxentries = (int) context.readVarInt(); ret.setMaxEntries(maxentries); ILRUEntryCleaner cleaner = (ILRUEntryCleaner) BinarySerializer.decodeObject(context); ret.setCleaner(cleaner); int size = (int) context.readVarInt(); for (int i = 0; i < size; ++i) { Object key = BinarySerializer.decodeObject(context); Object value = BinarySerializer.decodeObject(context); ret.put(key, value); } return ret; }