/** * Loads a bean from the spring application context of a specific type. * * <p>If there are multiple beans of the specfied type in the context an exception is thrown. * * @param type The class of the bean to return. */ public <T> T getBeanOfType(Class<T> type) { return GeoServerExtensions.bean(type, getApplicationContext()); }
/** * Loads beans from the spring application context of a specific type. * * @param type The type of beans to return. * @return A list of objects of the specified type, possibly empty. * @see {@link GeoServerExtensions#extensions(Class, ApplicationContext)} */ public <T> List<T> getBeansOfType(Class<T> type) { return GeoServerExtensions.extensions(type, getApplicationContext()); }
/** * Loads a bean from the spring application context of a specific type. * <p> * If there are multiple beans of the specfied type in the context an exception is thrown. * </p> * * @param type The class of the bean to return. */ public <T> T getBeanOfType(Class<T> type) { return GeoServerExtensions.bean(type, getApplicationContext()); }
/** * Loads beans from the spring application context of a specific type. * * @param type The type of beans to return. * * @return A list of objects of the specified type, possibly empty. * @see {@link GeoServerExtensions#extensions(Class, ApplicationContext)} */ public <T> List<T> getBeansOfType(Class<T> type) { return GeoServerExtensions.extensions(type, getApplicationContext()); }
@Override public String getConfigurationType() { String config = GeoServerExtensions.getProperty("wicket." + Application.CONFIGURATION, getApplicationContext()); if (config == null) { return DEPLOYMENT; } else if (!DEPLOYMENT.equalsIgnoreCase(config) && !DEVELOPMENT.equalsIgnoreCase(config)) { LOGGER.warning("Unknown Wicket configuration value '" + config + "', defaulting to DEPLOYMENT"); return DEPLOYMENT; } else { return config; } }
@Override public RuntimeConfigurationType getConfigurationType() { String config = GeoServerExtensions.getProperty( "wicket." + Application.CONFIGURATION, getApplicationContext()); if (config == null) { return DEPLOYMENT; } else if (!"DEPLOYMENT".equalsIgnoreCase(config) && !"DEVELOPMENT".equalsIgnoreCase(config)) { LOGGER.warning( "Unknown Wicket configuration value '" + config + "', defaulting to DEPLOYMENT"); return DEPLOYMENT; } else { return RuntimeConfigurationType.valueOf(config.toUpperCase()); } }
@Override protected void onSubmit(AjaxRequestTarget target, Form<?> form) { final boolean switchTo = !Boolean.parseBoolean(toggleInfo.getModel().getObject()); final ApplicationContext ctx = getGeoServerApplication().getApplicationContext(); ctx.publishEvent(new ToggleEvent(switchTo, type)); // getConfig().putConfiguration(configKey, // Boolean.toString(switchTo)); if (switchTo) { fp.info("The " + type + " toggle is now ENABLED"); } else { fp.warn("The " + type + " toggle is now DISABLED no event will be posted/received to/from the broker"); fp.info("Note that the " + type + " is still registered to the topic destination"); } toggleInfo.getModel().setObject(Boolean.toString(switchTo)); target.addComponent(toggleInfo); target.addComponent(fp); } };
@Override protected void onSubmit(AjaxRequestTarget target, Form<?> form) { final boolean switchTo = !Boolean.parseBoolean(toggleInfo.getModel().getObject()); final ApplicationContext ctx = getGeoServerApplication().getApplicationContext(); ctx.publishEvent(new ToggleEvent(switchTo, type)); // getConfig().putConfiguration(configKey, // Boolean.toString(switchTo)); if (switchTo) { fp.info("The " + type + " toggle is now ENABLED"); } else { fp.warn("The " + type + " toggle is now DISABLED no event will be posted/received to/from the broker"); fp.info("Note that the " + type + " is still registered to the topic destination"); } toggleInfo.getModel().setObject(Boolean.toString(switchTo)); target.addComponent(toggleInfo); target.addComponent(fp); } };
GeoServerExtensions.bean( GeoServerDataDirectory.class, stylePage.getGeoServerApplication().getApplicationContext()); StyleInfo si = new StyleInfoImpl(stylePage.getCatalog()); String format = stylePage.getStyleInfo().getFormat();
ApplicationContext applicationContext = GeoServerApplication.get().getApplicationContext(); List<String> providers = new ArrayList<String>(