/** * Returns the application scope. * * @return The application scope. */ public Map<String, Object> getApplicationScope() { return applicationContext.getApplicationScope(); }
/** {@inheritDoc} */ public Map<String, Object> getApplicationScope() { return context.getApplicationScope(); }
/** * Registers an application context. It will be registered into itself as an * attribute, using the {@link #APPLICATION_CONTEXT_ATTRIBUTE} name. * * @param applicationContext The application context to register. */ public static void register(ApplicationContext applicationContext) { applicationContext.getApplicationScope().put( APPLICATION_CONTEXT_ATTRIBUTE, applicationContext); }
/** * Returns the container to be used in the application registered under a specific key. * * @param context The Tiles application context object to use. * @param key The key under which the container will be stored. * @return The container object. * @since 3.0.0 */ public static TilesContainer getContainer(ApplicationContext context, String key) { if (key == null) { key = CONTAINER_ATTRIBUTE; } return (TilesContainer) context.getApplicationScope().get(key); }
/** * Configures the container to be used in the application. * * @param context The Tiles application context object to use. * @param container The container object to set. * @param key The key under which the container will be stored. * @since 2.1.2 */ public static void setContainer(ApplicationContext context, TilesContainer container, String key) { Logger log = LoggerFactory.getLogger(TilesAccess.class); if (key == null) { key = CONTAINER_ATTRIBUTE; } if (container == null) { if (log.isInfoEnabled()) { log.info("Removing TilesContext for context: " + context.getClass().getName()); } context.getApplicationScope().remove(key); } else { if (log.isInfoEnabled()) { log.info("Publishing TilesContext for context: " + context.getClass().getName()); } context.getApplicationScope().put(key, container); } }
/** {@inheritDoc} */ @Override protected DefinitionDAO<Locale> createLocaleDefinitionDao(ApplicationContext applicationContext, LocaleResolver resolver) { LocaleDbDefinitionDAO definitionDao = new LocaleDbDefinitionDAO(); definitionDao.setDataSource((DataSource) applicationContext .getApplicationScope().get("dataSource")); return definitionDao; }