@Scope(ScopeConstants.PERTHREAD) public class InternalRequestGlobalsImpl implements InternalRequestGlobals { private Throwable classLoaderException; public Throwable getClassLoaderException() { return classLoaderException; } public void storeClassLoaderException(Throwable classLoaderException) { if (this.classLoaderException == null) this.classLoaderException = classLoaderException; } }
private String extractServiceScope(Method method) { Scope scope = method.getAnnotation(Scope.class); return scope != null ? scope.value() : ScopeConstants.DEFAULT; }
@Scope(ScopeConstants.PERTHREAD) public class DateUtilitiesImpl implements DateUtilities { private static final TimeZone tz = TimeZone.getTimeZone("UTC"); private DateFormat df = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'"); { df.setTimeZone(tz); } public String formatISO8601(Date date) { assert date != null; return df.format(date); } }
private String extractServiceScope(Method method) { Scope scope = method.getAnnotation(Scope.class); return scope != null ? scope.value() : ScopeConstants.DEFAULT; }
@Scope(ScopeConstants.PERTHREAD) public class ThreadLocaleImpl implements ThreadLocale { private Locale locale = Locale.getDefault(); @Override public Locale getLocale() { return locale; } @Override public void setLocale(Locale locale) { assert locale != null; this.locale = locale; } }
@Override public <T> ServiceBindingOptions bind(Class<T> serviceInterface, Class<? extends T> serviceImplementation) { assert serviceInterface != null; assert serviceImplementation != null; lock.check(); flush(); this.serviceInterface = serviceInterface; this.serviceImplementation = serviceImplementation; // Set defaults for the other properties. eagerLoad = serviceImplementation.getAnnotation(EagerLoad.class) != null; serviceId = InternalUtils.getServiceId(serviceImplementation); if (serviceId == null) { serviceId = serviceInterface.getSimpleName(); } Scope scope = serviceImplementation.getAnnotation(Scope.class); this.scope = scope != null ? scope.value() : ScopeConstants.DEFAULT; Marker marker = serviceImplementation.getAnnotation(Marker.class); if (marker != null) { InternalUtils.validateMarkerAnnotations(marker.value()); markers.addAll(Arrays.asList(marker.value())); } preventDecoration |= serviceImplementation.getAnnotation(PreventServiceDecoration.class) != null; return this; }
@Scope(ScopeConstants.PERTHREAD) public class ThreadLocaleImpl implements ThreadLocale { private Locale locale = Locale.getDefault(); @Override public Locale getLocale() { return locale; } @Override public void setLocale(Locale locale) { assert locale != null; this.locale = locale; } }
@Override public <T> ServiceBindingOptions bind(Class<T> serviceInterface, Class<? extends T> serviceImplementation) { assert serviceInterface != null; assert serviceImplementation != null; lock.check(); flush(); this.serviceInterface = serviceInterface; this.serviceImplementation = serviceImplementation; // Set defaults for the other properties. eagerLoad = serviceImplementation.getAnnotation(EagerLoad.class) != null; serviceId = InternalUtils.getServiceId(serviceImplementation); if (serviceId == null) { serviceId = serviceInterface.getSimpleName(); } Scope scope = serviceImplementation.getAnnotation(Scope.class); this.scope = scope != null ? scope.value() : ScopeConstants.DEFAULT; Marker marker = serviceImplementation.getAnnotation(Marker.class); if (marker != null) { InternalUtils.validateMarkerAnnotations(marker.value()); markers.addAll(Arrays.asList(marker.value())); } preventDecoration |= serviceImplementation.getAnnotation(PreventServiceDecoration.class) != null; return this; }
@Scope(ScopeConstants.PERTHREAD) public class JSSupportImpl implements JSSupport { private final JSLocator jsLocator; private final StringBuffer scriptBuffer; public JSSupportImpl(JSLocator jsLocator, Logger logger) { this.jsLocator = jsLocator; scriptBuffer = new StringBuffer(); } public void addScript(String script) { scriptBuffer.append(script); } public String store() { if ( scriptBuffer.length() == 0 ) { return null; } scriptBuffer.insert(0,"function jsOnLoad() {"); scriptBuffer.append("}"); return jsLocator.store(scriptBuffer.toString()); } }
/** * @since 5.2.6 */ @Scope(ScopeConstants.PERTHREAD) public class RenderTrackerImpl implements RenderTracker { private Stack<Component> components = new Stack<Component>(); private Map<String, Boolean> ids = new HashMap<String, Boolean>(); public void push(Component component) { components.push(component); } public void pop() { components.pop(); } public Component getRendering() { if ( components.size() > 0) { return components.peek(); } return null; } public Map<String, Boolean> getIdMap() { return ids; } }
@Scope(ScopeConstants.PERTHREAD) public class RequestGlobalsImpl implements RequestGlobals
@Scope(ScopeConstants.PERTHREAD) public class RequestPageCacheImpl implements RequestPageCache, Runnable
@Scope(ScopeConstants.PERTHREAD) public class LocationRenderer implements ObjectRenderer<Location>
@Scope(ScopeConstants.PERTHREAD) public class AjaxFormUpdateControllerImpl implements AjaxFormUpdateController
@Scope(ScopeConstants.PERTHREAD) public class EntityTransactionManagerImpl implements EntityTransactionManager
@Scope(ScopeConstants.PERTHREAD) public StringBuilder buildScopeRequiresAProxyAndNoInterfaceIsProvided() { return null; } }
@Scope("onread") public String getAnnotationOnRead() { return null; }
@Scope("magic") public Runnable buildUnknownScope() { return null; } }
@Scope(ScopeConstants.PERTHREAD) public class PageRenderQueueImpl implements PageRenderQueue
@Scope("threaded") public FoeService buildBarney() { return null; }