javax.resource.spi

Class ConnectionEvent

  • All Implemented Interfaces:
    Serializable

    public class ConnectionEvent
    extends EventObject
    The ConnectionEvent class provides information about the source of a connection related event.A ConnectionEvent instance contains the following information:
    • Type of the connection event
    • ManagedConnection instance that generated the connection event. A ManagedConnection instance is returned from the method ConnectionEvent.getSource.
    • Connection handle associated with the ManagedConnection instance; required for the CONNECTION_CLOSED event and optional for the other event types.
    • Optionally, an exception indicating the connection related error. Note that exception is used for CONNECTION_ERROR_OCCURRED.

    This class defines following types of event notifications:

    • CONNECTION_CLOSED
    • LOCAL_TRANSACTION_STARTED
    • LOCAL_TRANSACTION_COMMITTED
    • LOCAL_TRANSACTION_ROLLEDBACK
    • CONNECTION_ERROR_OCCURRED
    Version:
    0.5
    Author:
    Rahul Sharma
    See Also:
    ConnectionEventListener, Serialized Form
    • Field Detail

      • CONNECTION_CLOSED

        public static final int CONNECTION_CLOSED
        Event notification that an application component has closed the connection
        See Also:
        Constant Field Values
      • LOCAL_TRANSACTION_STARTED

        public static final int LOCAL_TRANSACTION_STARTED
        Event notification that a Resource Manager Local Transaction was started on the connection
        See Also:
        Constant Field Values
      • LOCAL_TRANSACTION_COMMITTED

        public static final int LOCAL_TRANSACTION_COMMITTED
        Event notification that a Resource Manager Local Transaction was committed on the connection
        See Also:
        Constant Field Values
      • LOCAL_TRANSACTION_ROLLEDBACK

        public static final int LOCAL_TRANSACTION_ROLLEDBACK
        Event notification that a Resource Manager Local Transaction was rolled back on the connection
        See Also:
        Constant Field Values
      • CONNECTION_ERROR_OCCURRED

        public static final int CONNECTION_ERROR_OCCURRED
        Event notification that an error occurred on the connection. This event indicates that the ManagedConnection instance is now invalid and unusable.
        See Also:
        Constant Field Values
      • id

        protected int id
        Type of the event
    • Constructor Detail

      • ConnectionEvent

        public ConnectionEvent(ManagedConnection source,
                               int eid)
        Construct a ConnectionEvent object. Exception defaults to null.
        Parameters:
        source - ManagedConnection that is the source of the event
        eid - type of the Connection event
      • ConnectionEvent

        public ConnectionEvent(ManagedConnection source,
                               int eid,
                               Exception exception)
        Construct a ConnectionEvent object.
        Parameters:
        source - ManagedConnection that is the source of the event
        exception - exception about to be thrown to the application
        eid - type of the Connection event
    • Method Detail

      • getConnectionHandle

        public Object getConnectionHandle()
        Get the connection handle associated with the Managed Connection instance. Used for CONNECTION_CLOSED event.
        Returns:
        the connection handle. May be null
      • setConnectionHandle

        public void setConnectionHandle(Object connectionHandle)
        Set the connection handle. Used for CONNECTION_CLOSED event
      • getException

        public Exception getException()
        Get the exception. May be null.
        Returns:
        the exception about to be thrown.
      • getId

        public int getId()
        Get the type of event

Traduction non disponible

Les API Java ne sont pas encore traduites en français sur l'infobrol. Seule la version anglaise est disponible pour l'instant.

Version en cache

21/08/2025 14:26:44 Cette version de la page est en cache (à la date du 21/08/2025 14:26:44) afin d'accélérer le traitement.
Vous pouvez activer le mode utilisateur dans le menu en haut pour afficher la version plus récente de la page.

Document créé le 24/12/2007, dernière modification le 18/08/2025
Source du document imprimé : https://www.gaudry.be/java-api-javaee-rf-javax/resource/spi/ConnectionEvent.html

L'infobrol est un site personnel dont le contenu n'engage que moi. Le texte est mis à disposition sous licence CreativeCommons(BY-NC-SA). Plus d'info sur les conditions d'utilisation et sur l'auteur.

Références

  1. Consulter le document html Langue du document :fr Manuel PHP : https://docs.oracle.com, ConnectionEvent (Java(TM) EE 7 Specification APIs)

Ces références et liens indiquent des documents consultés lors de la rédaction de cette page, ou qui peuvent apporter un complément d'information, mais les auteurs de ces sources ne peuvent être tenus responsables du contenu de cette page.
L'auteur de ce site est seul responsable de la manière dont sont présentés ici les différents concepts, et des libertés qui sont prises avec les ouvrages de référence. N'oubliez pas que vous devez croiser les informations de sources multiples afin de diminuer les risques d'erreurs.