public void initialize(GeoServer geoServer) throws Exception { geoServer.addListener( new ConfigurationListenerAdapter() {
public UpdateSequenceListener(GeoServer geoServer) { this.geoServer = geoServer; geoServer.getCatalog().addListener(this); geoServer.addListener(this); }
@Override public void initialize(GeoServer geoServer) throws Exception { // Consider moving earlier to make use of the requested LockProvider during initial // configuration String lockProviderName = geoServer.getGlobal().getLockProviderName(); setLockProvider(lockProviderName); geoServer.addListener(listener); }
public void initialize(GeoServer geoServer) throws Exception { initJAI(geoServer.getGlobal().getJAI()); geoServer.addListener( new ConfigurationListenerAdapter() { public void handleGlobalChange( GeoServerInfo global, List<String> propertyNames, List<Object> oldValues, List<Object> newValues) { if (propertyNames.contains( "jAI")) { // TODO: check why the propertyname is reported as jAI // instead of JAI // Make sure to proceed with JAI init // only in case the global change involved that section initJAI(global.getJAI()); } } }); }
protected void loadGeoServer(final GeoServer geoServer, XStreamPersister xp) throws Exception { if (listener == null) { // add event listener which persists changes final List<XStreamServiceLoader> loaders = GeoServerExtensions.extensions(XStreamServiceLoader.class); listener = new ServicePersister(loaders, geoServer); } else { // avoid re-dumping all service config files during load, // we'll attach it back once done geoserver.removeListener(listener); } try { if (this.configPersister != null) { // avoid having the persister write down new config files while we read the config, // otherwise it'll dump it back in xml files geoserver.removeListener(configPersister); } else { // lazy creation of the persisters at the first need this.configPersister = new GeoServerConfigPersister(resourceLoader, xp); } readConfiguration(geoServer, xp); } finally { // attach back the catalog persister and the service one geoserver.addListener(configPersister); geoserver.addListener(listener); } }
public void initialize(GeoServer geoServer) throws Exception { this.gs = geoServer; final GeoServerInfo geoserverInfo = geoServer.getGlobal(); CoverageAccessInfo coverageAccess = geoserverInfo.getCoverageAccess(); if (coverageAccess == null) { coverageAccess = new CoverageAccessInfoImpl(); geoserverInfo.setCoverageAccess(coverageAccess); } initCoverage(coverageAccess); geoServer.addListener( new ConfigurationListenerAdapter() { public void handleGlobalChange( GeoServerInfo global, List<String> propertyNames, List<Object> oldValues, List<Object> newValues) { if (propertyNames.contains("coverageAccess")) { // Make sure to proceed with coverageAccess init // only in case the global change involved that section initCoverage(global.getCoverageAccess()); } } @Override public void handlePostGlobalChange(GeoServerInfo global) { // No need to handle that change too } }); }
@Override protected void onSetUp(SystemTestData testData) throws Exception { GeoServer geoServer = getGeoServer(); geoServer.addListener( new ServicePersister( (List) Arrays.asList(new ServiceLoader(getResourceLoader())), geoServer)); }
geoServer.addListener( new ConfigurationListenerAdapter() { @Override
geoServer.addListener(p);
public WpsAccessRuleDAO(GeoServer gs) throws IOException { this.gs = gs; gs.addListener(this); }
/** * * @param topicTemplate the JmsTemplate object used to send message to the topic queue * @param geoserver * @param props properties to attach to all the message. May contains at least the producer name which should be unique. */ public JMSConfigurationListener(final GeoServer geoserver, final JMSPublisher jmsPublisher) { super(); // store GeoServer reference this.geoserver = geoserver; // add this as geoserver listener this.geoserver.addListener(this); // the publisher this.jmsPublisher = jmsPublisher; }
/** * * @param topicTemplate the JmsTemplate object used to send message to the topic queue * @param geoserver * @param props properties to attach to all the message. May contains at least the producer name which should be unique. */ public JMSConfigurationListener(final GeoServer geoserver, final JMSPublisher jmsPublisher) { super(); // store GeoServer reference this.geoserver = geoserver; // add this as geoserver listener this.geoserver.addListener(this); // the publisher this.jmsPublisher = jmsPublisher; }
public QuickTileCache(GeoServer geoServer) { geoServer.addListener( new ConfigurationListenerAdapter() { public void handleGlobalChange( GeoServerInfo global, List<String> propertyNames, List<Object> oldValues, List<Object> newValues) { tileCache.clear(); } public void handleServiceChange( ServiceInfo service, List<String> propertyNames, List<Object> oldValues, List<Object> newValues) { tileCache.clear(); } public void reloaded() { tileCache.clear(); } }); }
public void initialize(final GeoServer geoServer) throws Exception { initWPS(geoServer.getService(WPSInfo.class)); geoServer.addListener(new ConfigurationListenerAdapter() { public void handleGlobalChange(GeoServerInfo global, List<String> propertyNames, List<Object> oldValues, List<Object> newValues) { initWPS(geoServer.getService(WPSInfo.class)); } @Override public void handlePostGlobalChange(GeoServerInfo global) { initWPS(geoServer.getService(WPSInfo.class)); } }); }
public void initialize(final GeoServer geoServer) throws Exception { initWPS(geoServer.getService(WPSInfo.class), geoServer); geoServer.addListener( new ConfigurationListenerAdapter() { @Override public void handlePostGlobalChange(GeoServerInfo global) { initWPS(geoServer.getService(WPSInfo.class), geoServer); } }); }
@Override public void initialize(GeoServer geoServer) throws Exception { WPSInfo wps = geoServer.getService(WPSInfo.class); if (wps != null) { updateFilters(wps); } geoServer.addListener( new ConfigurationListenerAdapter() { @Override public void handlePostServiceChange(ServiceInfo service) { if (service instanceof WPSInfo) { updateFilters((WPSInfo) service); } } }); }
public synchronized void setEnabled(boolean enabled) { this.enabled = enabled; if (enabled) { // remove Default persister if (persister != null) { geoserver.removeListener(persister); persister = null; } // remove Default listener if (listener != null) { geoserver.removeListener(listener); listener = null; } } else { if (listener == null) { // add event listener which persists changes final List<XStreamServiceLoader> loaders = GeoServerExtensions .extensions(XStreamServiceLoader.class); listener = new ServicePersister(loaders, geoserver); geoserver.addListener(listener); } if (persister == null) { persister = new GeoServerPersister(resourceLoader, xpf.createXMLPersister()); // attach back the persister geoserver.addListener(persister); } } } }
public synchronized void enable(boolean enabled) { this.enabled = enabled; if (enabled) { // remove Default persister if (persister != null) { geoserver.removeListener(persister); persister = null; } // remove Default listener if (listener != null) { geoserver.removeListener(listener); listener = null; } } else { if (listener == null) { // add event listener which persists changes final List<XStreamServiceLoader> loaders = GeoServerExtensions .extensions(XStreamServiceLoader.class); listener = new ServicePersister(loaders, geoserver); geoserver.addListener(listener); } if (persister == null) { persister = new GeoServerPersister(resourceLoader, xpf.createXMLPersister()); // attach back the persister geoserver.addListener(persister); } } } }
public HzSynchronizer(HzCluster cluster, GeoServer gs) { this.cluster = cluster; this.gs = gs; topic = cluster.getHz().getTopic("geoserver.config"); topic.addMessageListener(this); executor = getNewExecutor(); gs.addListener(this); gs.getCatalog().addListener(this); }
geoServer.addListener(listener);