Package edu.stanford.bmir.protege.web.client.dispatch.cache

Examples of edu.stanford.bmir.protege.web.client.dispatch.cache.ResultCache$InvalidationKeyWrapper


    private int requestCount;

    private Map<ProjectId, ResultCache> resultCacheMap = new HashMap<ProjectId, ResultCache>();

    private ResultCache getResultCache(ProjectId projectId) {
        ResultCache resultCache = resultCacheMap.get(projectId);
        if(resultCache == null) {
            resultCache = new ResultCache(projectId);
            resultCacheMap.put(projectId, resultCache);
        }
        return resultCache;
    }
View Full Code Here


    @SuppressWarnings("unchecked")
    public <A extends Action<R>, R extends Result> void execute(A action, final AsyncCallback<R> callback) {
        if(action instanceof HasProjectId) {
            ProjectId projectId = ((HasProjectId) action).getProjectId();
            ResultCache resultCache = getResultCache(projectId);
            Optional<R> result = resultCache.getCachedResult(action);
            if(result.isPresent()) {
                GWT.log("[DISPATCH] Using cached result (" + action + ")");
                callback.onSuccess(result.get());
                return;
            }
View Full Code Here

        @Override
        public void onSuccess(DispatchServiceResultContainer result) {
            // TODO: Fix
            if(action instanceof HasProjectId) {
                ResultCache resultCache = getResultCache(((HasProjectId) action).getProjectId());
                resultCache.cacheResult((Action<R>) action, (R) result.getResult());
            }
            cacheRenderables(result.getResult());
            dispatchEvents(result.getResult());
            delegate.onSuccess(result.getResult());
View Full Code Here

TOP

Related Classes of edu.stanford.bmir.protege.web.client.dispatch.cache.ResultCache$InvalidationKeyWrapper

Copyright © 2018 www.massapicom. 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.