See: Description
Interface | Description |
---|---|
EventNotification |
Repesents an event notification that is recieved through JMS.
|
MessagePort |
This class is used to wrap JMS destinations that are configured for an
event group.
|
NotificationHelper |
The notification helper maps concepts related to the Common Event Infrastructure to concepts
related to messaging.
|
NotificationHelperFactory |
This factory is used to get access to an instance of an object that implements
the
NotificationHelper interface. |
Exception | Description |
---|---|
InvalidNotificationTypeException |
This exception is thrown when a JMS message does not contain a valid
notification type.
|
The notification helper enables event consumers to interact with the messaging infrastructure by using the JMS programming model.
// Lookup the notification helper factory InitialContext context = new InitialContext(); Object notifHelperFxObj = context.lookup("com/ibm/events/NotificationHelperFactory"); NotificationHelperFactory notifHelperFx = (NotificationHelperFactory) PortableRemoteObject.narrow(notifHelperFxObj, NotificationHelperFactory.class); // Create the notification helper NotificationHelper notifHelper = notifHelperFx.getNotificationHelper(); notifHelper.setEventSelector("CommonBaseEvent[@globalInstanceId]"); // Get JNDI names for the JMS objects MessagePort msgPort = notifHelper.getJmsTopic("critical events"); // event group String topicConnFxJndiName = msgPort.getConnectionFactoryJndiName(); String destinationJndiName = msgPort.getDestinationJndiName(); // Lookup the JMS objects Object tcfObj = context.lookup(topicConnFxJndiName); Object tObj = context.lookup(destinationJndiName); TopicConnectionFactory tcf = (TopicConnectionFactory) PortableRemoteObject.narrow(tcfObj, TopicConnectionFactory.class); Topic t = (Topic) PortableRemoteObject.narrow(tObj, Topic.class); // Next use the JMS objects in subscription ...