/protocols/smpp/src/main/java/org/mobicents/protocols/smpp/event/ReceiverExceptionEvent.java
http://mobicents.googlecode.com/ · Java · 90 lines · 22 code · 9 blank · 59 comment · 0 complexity · c16967d13921e6a391098bb1e3f4f8d0 MD5 · raw file
- /*
- * JBoss, Home of Professional Open Source
- * Copyright 2011, Red Hat, Inc. and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
- package org.mobicents.protocols.smpp.event;
- import org.mobicents.protocols.smpp.Session;
- import org.mobicents.protocols.smpp.SessionState;
- /**
- * Event generated by the receiver thread when a non-fatal exception is caught.
- * An application will receive this event type if the receiver thread catches an
- * exception which does not cause it to terminate. The exception which was
- * caught and the state the connection was in when it was caught are saved in
- * this event.
- *
- * @version $Id: ReceiverExceptionEvent.java 452 2009-01-15 16:56:36Z orank $
- */
- public class ReceiverExceptionEvent extends SMPPEvent {
- /**
- * The exception that was caught.
- */
- private Throwable exception;
- /**
- * The state the Connection was in when the exception was caught.
- */
- private SessionState connectionState;
- /**
- * Create a new ReceiverExceptionEvent.
- *
- * @param source The source Connection of this event.
- * @param t The exception being reported.
- */
- public ReceiverExceptionEvent(Session source, Throwable t) {
- super(RECEIVER_EXCEPTION, source);
- this.exception = t;
- }
- /**
- * Create a new ReceiverExceptionEvent.
- *
- * @param source The source Connection of this event.
- * @param t The exception being reported.
- * @param state The state the connection was in when the exception was
- * caught.
- */
- public ReceiverExceptionEvent(Session source, Throwable t, SessionState state) {
- super(RECEIVER_EXCEPTION, source);
- this.exception = t;
- this.connectionState = state;
- }
- /**
- * Get the exception which was caught.
- */
- public Throwable getException() {
- return exception;
- }
- /**
- * Get the state the connection was in when the exception was caught.
- *
- * @return the integer value representing the state of the connection.
- * @see SessionState
- */
- public SessionState getState() {
- return connectionState;
- }
- }