EMSExceptionHandler


Delegate

Declaration

delegate void EMSExceptionHandler( 
    object sender, 
    EMSExceptionEventArgs args ); 

Purpose

Asynchronously detect problems with connections.

Remarks

When a program uses a connection to send messages, the send calls can detect problems with the connection, and notify the client program by throwing exceptions. However, when a program uses a connection only to receive messages, the client cannot catch such exceptions.

This delegate provides an alternate pathway for alerting a client program of connection problems. The program implements this delegate, and registers it with the connection. When the client library detects a connection problem, it raises an event. This delegate processes the event, which contains an exception that details the problem.

EMSExceptionHandler detects this type of problem in a .NET programming idiom. In contrast, IExceptionListener mimics the way in which JMS provides similar functionality in a Java programming idiom. Programmers may select either idiom—but not both (which would cause duplicate exception processing, with undefined behavior).

Parameter
Description
sender
The problematic connection object.
args
The event, which contains the exception object.

Example 2 Exception Event Handler
... 
connection.ExceptionHandler += new EMSExceptionHandler(handleEx); 
... 
private void handleEx(object sender, EMSExceptionEventArgs arg) 
{ 
   EMSException e = arg.Exception; 
   Console.WriteLine("Exception: " + e.Message); 
} 
... 

See Also

Connection

EMSExceptionHandler

EMSExceptionEventArgs


TIBCO Enterprise Message Service™ .NET Reference
System Release 4.3, February 2006
Copyright © TIBCO Software Inc. All rights reserved
www.tibco.com