com.ibm.events.samples.subscriber
Class SampleEventSubscriber

java.lang.Object
  extended by com.ibm.events.samples.subscriber.SampleEventSubscriber

public class SampleEventSubscriber
extends java.lang.Object

This class provides sample code for an event subscriber.


Constructor Summary
SampleEventSubscriber()
          Construct the sample event subscriber
 
Method Summary
 void displayUsage()
          Display the command line usage for this sample.
static void main(java.lang.String[] args)
          Main method that will take command line arguments and run the event subscriber
 void run()
          Run the sample event subscriber
 void setEventGroup(java.lang.String eventGroup)
          Sets the event group used for event subscription
 void setEventSelector(java.lang.String eventSelector)
          Sets the event selector used for event subscription
 void setIndex(int index)
          Set the distribution queue index
 void setNumber(int number)
          Set the number of events to receive from subscription
 void setPrintEvents(boolean printEvents)
          Set whether events should be printed or not
 void setProviderUrl(java.lang.String providerUrl)
          Set the JNDI URL provider.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SampleEventSubscriber

public SampleEventSubscriber()
Construct the sample event subscriber

Method Detail

setEventGroup

public void setEventGroup(java.lang.String eventGroup)
Sets the event group used for event subscription

Parameters:
eventGroup - The event group to use for event subscription

setEventSelector

public void setEventSelector(java.lang.String eventSelector)
Sets the event selector used for event subscription

Parameters:
eventSelector - The event selector to use for event subscription

setIndex

public void setIndex(int index)
Set the distribution queue index

Parameters:
index - The index of the distribution queue to listen on

setNumber

public void setNumber(int number)
Set the number of events to receive from subscription

Parameters:
number - The number of events to receive from subscription

setPrintEvents

public void setPrintEvents(boolean printEvents)
Set whether events should be printed or not

Parameters:
printEvents - Whether to print out events or not

setProviderUrl

public void setProviderUrl(java.lang.String providerUrl)
Set the JNDI URL provider.

Parameters:
providerUrl - The JNDI URL provider

displayUsage

public void displayUsage()
Display the command line usage for this sample.


main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception
Main method that will take command line arguments and run the event subscriber

Parameters:
args - Array arguments passed form the command line
Throws:
java.lang.Exception - If there is an error processing commands

run

public void run()
Run the sample event subscriber