IBM WebSphere Application ServerTM
Release 8

Package com.ibm.events.notification

This package enables event consumers to obtain JMS parameters to subscribe for event notifications.

See:
          Description

Interface Summary
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 Summary
InvalidNotificationTypeException This exception is thrown when a JMS message does not contain a valid notification type.
 

Package com.ibm.events.notification Description

This package enables event consumers to obtain JMS parameters to subscribe for event notifications.

The notification helper enables event consumers to interact with the messaging infrastructure by using the JMS programming model.

Code sample for using the notification helper

    // 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

    ...

Version:
1.1.0

IBM WebSphere Application ServerTM
Release 8