- java.lang.Object
-
- java.util.EventObject
-
- javax.resource.spi.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 Summary
Fields Modifier and Type Field and Description static int
CONNECTION_CLOSED
Event notification that an application component has closed the connectionstatic int
CONNECTION_ERROR_OCCURRED
Event notification that an error occurred on the connection.protected int
id
Type of the eventstatic int
LOCAL_TRANSACTION_COMMITTED
Event notification that a Resource Manager Local Transaction was committed on the connectionstatic int
LOCAL_TRANSACTION_ROLLEDBACK
Event notification that a Resource Manager Local Transaction was rolled back on the connectionstatic int
LOCAL_TRANSACTION_STARTED
Event notification that a Resource Manager Local Transaction was started on the connection-
Fields inherited from class java.util.EventObject
source
-
-
Constructor Summary
Constructors Constructor and Description ConnectionEvent(ManagedConnection source, int eid)
Construct a ConnectionEvent object.ConnectionEvent(ManagedConnection source, int eid, Exception exception)
Construct a ConnectionEvent object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description Object
getConnectionHandle()
Get the connection handle associated with the Managed Connection instance.Exception
getException()
Get the exception.int
getId()
Get the type of eventvoid
setConnectionHandle(Object connectionHandle)
Set the connection handle.
-
-
-
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 eventeid
- 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 eventexception
- exception about to be thrown to the applicationeid
- 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
-
-
Deutsche Übersetzung
Sie haben gebeten, diese Seite auf Deutsch zu besuchen. Momentan ist nur die Oberfläche übersetzt, aber noch nicht der gesamte Inhalt.Wenn Sie mir bei Übersetzungen helfen wollen, ist Ihr Beitrag willkommen. Alles, was Sie tun müssen, ist, sich auf der Website zu registrieren und mir eine Nachricht zu schicken, in der Sie gebeten werden, Sie der Gruppe der Übersetzer hinzuzufügen, die Ihnen die Möglichkeit gibt, die gewünschten Seiten zu übersetzen. Ein Link am Ende jeder übersetzten Seite zeigt an, dass Sie der Übersetzer sind und einen Link zu Ihrem Profil haben.
Vielen Dank im Voraus.
Dokument erstellt 11/06/2005, zuletzt geändert 18/08/2025
Quelle des gedruckten Dokuments:https://www.gaudry.be/de/java-api-javaee-rf-javax/resource/spi/ConnectionEvent.html
Die Infobro ist eine persönliche Seite, deren Inhalt in meiner alleinigen Verantwortung liegt. Der Text ist unter der CreativeCommons-Lizenz (BY-NC-SA) verfügbar. Weitere Informationen auf die Nutzungsbedingungen und dem Autor.
Referenzen
Diese Verweise und Links verweisen auf Dokumente, die während des Schreibens dieser Seite konsultiert wurden, oder die zusätzliche Informationen liefern können, aber die Autoren dieser Quellen können nicht für den Inhalt dieser Seite verantwortlich gemacht werden.
Der Autor dieser Website ist allein dafür verantwortlich, wie die verschiedenen Konzepte und Freiheiten, die mit den Nachschlagewerken gemacht werden, hier dargestellt werden. Denken Sie daran, dass Sie mehrere Quellinformationen austauschen müssen, um das Risiko von Fehlern zu reduzieren.