/** * Technically, this should be a synchronized method, but the _shutdown variable hardly ever * changes, and the consequences are pretty minimal. See HIVEMIND-104. */ private void checkShutdown() { if (_shutdown) throw new ApplicationRuntimeException(HiveMindMessages.registryShutdown()); }
private void error(String message, Location location, Throwable cause) { _factoryParameters.getErrorLog().error(message, location, cause); }
public Object getFacetValue(ServiceImplementationFactoryParameters factoryParameters, Class targetType) { return factoryParameters.getLog(); }
private Class findTypeInClassResolver(String type) { Class result = _resolver.checkForClass(type); if (result == null) result = _resolver.checkForClass(_packageName + "." + type); if (result == null) throw new ApplicationRuntimeException(ImplMessages.unableToConvertType( type, _packageName)); return result; } }
Resource localizeResource(Resource resource, Locale locale) { if (locale == null) return resource; Resource localized = resource.getLocalization(locale); if (localized != null && localized.getResourceURL() != null) return localized; return resource; }
public void initializeService() { _webInfLocation = _contextRoot.getRelativeResource("WEB-INF/"); _webInfAppLocation = _webInfLocation.getRelativeResource(_applicationId + "/"); }
/** * As with {@link #isBlank(String)}, but inverts the response. */ public static boolean isNonBlank(String string) { return !isBlank(string); }
/** * Invokes {@link Registry#shutdown()}. */ public void destroy() { if (_registry != null) _registry.shutdown(); _filterConfig = null; }
public ParsedScript(ExpressionEvaluator evaluator, ValueConverter valueConverter, Location location) { super(location); _evaluator = evaluator; _valueConverter = valueConverter; _scriptResource = location.getResource(); }
public boolean doesClassExist(String className) { try { _resolver.findClass(className); return true; } catch (ApplicationRuntimeException ex) { return false; } }
public ApplicationRuntimeException(String message, Object component, Location location, Throwable rootCause) { super(message); _rootCause = rootCause; _component = component; _location = HiveMind.findLocation(new Object[] { location, rootCause, component }); }
/** * Invokes {@link Resource#getLocalization(java.util.Locale)}. */ public Resource findLocalization(Resource rootResource, Locale locale) { return rootResource.getLocalization(locale); }
public void threadDidCleanup() { unbindServiceFromCurrentThread(); if (_core instanceof Discardable) { Discardable d = (Discardable) _core; d.threadDidDiscardService(); } } }
private void checkShutdown() { if (_shutdown) throw HiveMind.createRegistryShutdownException(); }
public static ApplicationRuntimeException createRegistryShutdownException() { return new ApplicationRuntimeException(HiveMindMessages.registryShutdown()); }
Resource localizeResource(Resource resource, Locale locale) { if (locale == null) return resource; Resource localized = resource.getLocalization(locale); if (localized != null && localized.getResourceURL() != null) return localized; return resource; }
/** * Called by hivemind automatically. */ public void initializeService() { _webInfLocation = _contextRoot.getRelativeResource(WEB_INF); _webInfAppLocation = _webInfLocation.getRelativeResource(_applicationId + "/"); }
public ParsedScript(ExpressionEvaluator evaluator, ValueConverter valueConverter, Location location) { super(location); _evaluator = evaluator; _valueConverter = valueConverter; _scriptResource = location.getResource(); }
public void initializeService() { _webInfLocation = _contextRoot.getRelativeResource("WEB-INF/"); _webInfAppLocation = _webInfLocation.getRelativeResource(_applicationId + "/"); }
/** * Called by hivemind automatically. */ public void initializeService() { _webInfLocation = _contextRoot.getRelativeResource(WEB_INF); _webInfAppLocation = _webInfLocation.getRelativeResource(_applicationId + "/"); }