public boolean isRendering() { return renderingValue.get(false); }
public Locale get() { return localeValue.get(); }
public Object get(Object instance, InstanceContext context) { return fieldValue.get(fieldDefaultValue); }
@Override public synchronized Status getStatus() { if (perThreadStatus != null) { if (!perThreadStatus.exists()) perThreadStatus.set(status); return perThreadStatus.get(); } else return status; }
private List<Runnable> getCallbacks() { List<Runnable> result = callbacksValue.get(); if (result == null) { result = CollectionFactory.newList(); callbacksValue.set(result); } return result; }
private List<Runnable> getCallbacks() { List<Runnable> result = callbacksValue.get(); if (result == null) { result = CollectionFactory.newList(); callbacksValue.set(result); } return result; }
@Override public synchronized Status getStatus() { if (perThreadStatus != null) { if (!perThreadStatus.exists()) perThreadStatus.set(status); return perThreadStatus.get(); } else return status; }
private void addAlertStorageCleanupCallback() { // Add a callback that exists just to clear the non-persistent alerts. // Only one of these is needed. if (needAlertStorageCleanup.get(true)) { ajaxResponseRenderer.addCallback(new JavaScriptCallback() { public void run(JavaScriptSupport javascriptSupport) { // In an Ajax request, the Alerts are added, just so that they can be removed if not persistent. // Again, this is for the rare case where there's a redirect to another page. getAlertStorage().dismissNonPersistent(); } }); needAlertStorageCleanup.set(false); } }
private void addAlertStorageCleanupCallback() { // Add a callback that exists just to clear the non-persistent alerts. // Only one of these is needed. if (needAlertStorageCleanup.get(true)) { ajaxResponseRenderer.addCallback(new JavaScriptCallback() { public void run(JavaScriptSupport javascriptSupport) { // In an Ajax request, the Alerts are added, just so that they can be removed if not persistent. // Again, this is for the rare case where there's a redirect to another page. getAlertStorage().dismissNonPersistent(); } }); needAlertStorageCleanup.set(false); } }
public Object get(Object instance, InstanceContext context) { if (!fieldValue.exists()) { Object persistedValue = resources.hasFieldChange(name) ? resources.getFieldChange(name) : defaultValue; fieldValue.set(persistedValue); } return fieldValue.get(); }
private MethodResultCache getOrCreateCache(MethodInvocation invocation) { Object instance = invocation.getInstance(); // The PerThreadValue is created in the instance constructor. PerThreadValue<MethodResultCache> value = (PerThreadValue<MethodResultCache>) fieldHandle .get(instance); // But it will be empty when first created, or at the start of a new request. if (value.exists()) { return value.get(); } // Use the factory to create a MethodResultCache for the combination of instance, method, and thread. return value.set(factory.create(instance)); } };
private Map<String, Object> getRenderVariables(boolean create) { try { acquireReadLock(); if (renderVariables == null) { if (!create) { return null; } createRenderVariablesPerThreadValue(); } Map<String, Object> result = renderVariables.get(); if (result == null && create) result = renderVariables.set(CollectionFactory.newCaseInsensitiveMap()); return result; } finally { releaseReadLock(); } }