@Override public void initDefaults(JMSConfiguration config) throws IOException { config.putConfiguration(CONNECTION_KEY, DEFAULT_CONNECTION_STATUS.toString()); config.putConfiguration(CONNECTION_RETRY_KEY, DEFAULT_CONNECTION_RETRY.toString()); config.putConfiguration(CONNECTION_MAXWAIT_KEY, DEFAULT_CONNECTION_MAXWAIT.toString()); }
@Override public void onApplicationEvent(ContextRefreshedEvent event) { if (event.getApplicationContext() == applicationContext) { final String startString = config .getConfiguration(ConnectionConfiguration.CONNECTION_KEY); if (startString != null && startString.equals(ConnectionConfigurationStatus.enabled.toString())) { if (!connect()) { if (LOGGER.isLoggable(Level.SEVERE)) { LOGGER.severe("Unable to connect to the broker, force connection status to disabled"); } // change configuration status config.putConfiguration(ConnectionConfiguration.CONNECTION_KEY, ConnectionConfigurationStatus.disabled.toString()); // store changes to the configuration try { config.storeConfig(); } catch (IOException e) { LOGGER.log(Level.SEVERE, e.getMessage(), e); } } } } } }
fp.warn("You will (probably) loose next incoming events from other instances!!! (depending on how you have configured the broker)"); connectionInfo.getModel().setObject( ConnectionConfigurationStatus.disabled.toString()); } else { fp.error("Disconnection error!"); connectionInfo.getModel().setObject( ConnectionConfigurationStatus.enabled.toString()); fp.info("Now GeoServer is registered with the destination"); connectionInfo.getModel().setObject( ConnectionConfigurationStatus.enabled.toString()); } else { fp.error("Connection error!"); fp.error("Registration aborted due to a connection problem"); connectionInfo.getModel().setObject( ConnectionConfigurationStatus.disabled.toString());
@Override public void onApplicationEvent(ContextRefreshedEvent event) { if (event.getApplicationContext() == applicationContext) { final String startString = config.getConfiguration(ConnectionConfiguration.CONNECTION_KEY); if (startString != null && startString.equals(ConnectionConfigurationStatus.enabled.toString())) { if (!connect()) { if (LOGGER.isLoggable(Level.SEVERE)) { LOGGER.severe( "Unable to connect to the broker, force connection status to disabled"); } // change configuration status config.putConfiguration( ConnectionConfiguration.CONNECTION_KEY, ConnectionConfigurationStatus.disabled.toString()); // store changes to the configuration try { config.storeConfig(); } catch (IOException e) { LOGGER.log(Level.SEVERE, e.getMessage(), e); } } } } } }