ExceptionListenerJMS.java

  1. /*
  2.  * GovWay - A customizable API Gateway
  3.  * https://govway.org
  4.  *
  5.  * Copyright (c) 2005-2025 Link.it srl (https://link.it).
  6.  *
  7.  * This program is free software: you can redistribute it and/or modify
  8.  * it under the terms of the GNU General Public License version 3, as published by
  9.  * the Free Software Foundation.
  10.  *
  11.  * This program is distributed in the hope that it will be useful,
  12.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14.  * GNU General Public License for more details.
  15.  *
  16.  * You should have received a copy of the GNU General Public License
  17.  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  18.  *
  19.  */


  20. package org.openspcoop2.utils.transport.jms;

  21. import javax.jms.JMSException;

  22. /**
  23.  * Gestisce eventuali errori del broker JMS per rinegoziare la connessione
  24.  *
  25.  *
  26.  * @author Andrea Poli (apoli@link.it)
  27.  * @author Stefano Corallo (corallo@link.it)
  28.  * @author Sandra Giangrandi (sandra@link.it)
  29.  * @author $Author$
  30.  * @version $Rev$, $Date$
  31.  *
  32.  */
  33. public class ExceptionListenerJMS implements javax.jms.ExceptionListener {

  34.     private Exception exception = null;
  35.     private boolean connessioneCorrotta = false;

  36.     public ExceptionListenerJMS() {

  37.     }

  38.     @Override
  39.     public void onException(JMSException arg0) {
  40.         this.connessioneCorrotta = true;
  41.         this.exception = arg0;
  42.     }

  43.     public Exception getException() {
  44.         return this.exception;
  45.     }

  46.     public void setException(Exception exception) {
  47.         this.exception = exception;
  48.     }

  49.     public boolean isConnessioneCorrotta() {
  50.         return this.connessioneCorrotta;
  51.     }

  52.     public void setConnessioneCorrotta(boolean connessioneCorrotta) {
  53.         this.connessioneCorrotta = connessioneCorrotta;
  54.     }

  55. }