synchronized void setStatus(Status status) { if (perThreadStatus != null) perThreadStatus.set(status); else this.status = status; } }
public boolean isRendering() { return renderingValue.get(false); }
public boolean isSet() { return localeValue.exists(); } }
synchronized void setStatus(Status status) { if (perThreadStatus != null) perThreadStatus.set(status); else this.status = status; } }
public Locale get() { return localeValue.get(); }
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 void set(Locale locale) { assert locale != null; if (!localeNames.contains(locale.toString().toLowerCase())) { String message = String .format("Locale '%s' is not supported by this application. Supported locales are '%s'; this is configured via the %s symbol.", locale, supportedLocales, SymbolConstants.SUPPORTED_LOCALES); throw new IllegalArgumentException(message); } localeValue.set(locale); }
public Object get(Object instance, InstanceContext context) { return fieldValue.get(fieldDefaultValue); }
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 void set(Object instance, InstanceContext context, Object newValue) { fieldValue.set(newValue); // This catches the case where the instance initializer method sets a value for the field. // That value is captured and used when no specific value has been stored. if (!resources.isLoaded()) fieldDefaultValue = newValue; } }
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(); } }
public void set(Object instance, InstanceContext context, Object newValue) { resources.persistFieldChange(name, newValue); fieldValue.set(newValue); } }
public MutableServiceActivity(ServiceDef serviceDef, PerthreadManager perthreadManager, Status status) { this.serviceDef = serviceDef; if (serviceDef.getServiceScope().equals(ScopeConstants.PERTHREAD)) { perThreadStatus = perthreadManager.createValue(); perThreadStatus.set(status); this.status = status; // this is now the default status } else { perThreadStatus = null; this.status = status; } }
public MutableServiceActivity(ServiceDef serviceDef, PerthreadManager perthreadManager, Status status) { this.serviceDef = serviceDef; if (serviceDef.getServiceScope().equals(ScopeConstants.PERTHREAD)) { perThreadStatus = perthreadManager.createValue(); perThreadStatus.set(status); this.status = status; // this is now the default status } else { perThreadStatus = null; this.status = status; } }