com.ibm.events.samples.source
Class SampleEventSource

java.lang.Object
  extended by com.ibm.events.samples.source.SampleEventSource
All Implemented Interfaces:
java.lang.Runnable

public class SampleEventSource
extends java.lang.Object
implements java.lang.Runnable

This class provides sample code for an event source.


Constructor Summary
SampleEventSource()
          Constructs the sample event source
 
Method Summary
 void displayUsage()
          Displays 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 source
 void run()
          Runs the sample event source.
 void setBatchSize(int batchSize)
          Sets the number of events to send in a batch
 void setDelay(long delay)
          Sets the delay between events being submitted
 void setEmitterProfile(java.lang.String emitterProfile)
          Set the emitter profile.
 void setEventFactoryJndiName(java.lang.String eventFactoryJndiName)
          Set the event factory JNDI name.
 void setJMSPassword(java.lang.String password)
          Set the JNDI URL provider.
 void setJMSUsername(java.lang.String username)
           
 void setMessage(java.lang.String message)
          Sets the message of the event
 void setNumber(int number)
          Sets the number of events to submit
 void setNumberThreads(int numberThreads)
          DOCUMENT ME!
 void setProviderUrl(java.lang.String providerUrl)
          Sets the JNDI URL provider.
 void setSeverity(short severity)
          Sets the severity of the event
 void setXmlEvent(java.lang.String xmlEvent)
          Sets the event that was read from the XML file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SampleEventSource

public SampleEventSource()
Constructs the sample event source

Method Detail

setBatchSize

public void setBatchSize(int batchSize)
Sets the number of events to send in a batch

Parameters:
batchSize - The size of the batch

setDelay

public void setDelay(long delay)
Sets the delay between events being submitted

Parameters:
delay - The delay in milliseconds

setEmitterProfile

public void setEmitterProfile(java.lang.String emitterProfile)
Set the emitter profile.

Parameters:
emitterProfile - The name of the emitter profile

setEventFactoryJndiName

public void setEventFactoryJndiName(java.lang.String eventFactoryJndiName)
Set the event factory JNDI name.

Parameters:
eventFactoryJndiName - The JNDI name for the event factory

setJMSPassword

public void setJMSPassword(java.lang.String password)
Set the JNDI URL provider.

Parameters:
password - The JNDI URL provider

setJMSUsername

public void setJMSUsername(java.lang.String username)

setMessage

public void setMessage(java.lang.String message)
Sets the message of the event

Parameters:
message - The message to use in the event

setNumber

public void setNumber(int number)
Sets the number of events to submit

Parameters:
number - The number of events to submit

setNumberThreads

public void setNumberThreads(int numberThreads)
DOCUMENT ME!

Parameters:
numberThreads - DOCUMENT ME!

setProviderUrl

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

Parameters:
providerUrl - The JNDI URL provider

setSeverity

public void setSeverity(short severity)
Sets the severity of the event

Parameters:
severity - The severity of the event

displayUsage

public void displayUsage()
Displays 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 source

Parameters:
args - Array arguements passed form the command line
Throws:
java.lang.Exception - DOCUMENT ME!

setXmlEvent

public void setXmlEvent(java.lang.String xmlEvent)
Sets the event that was read from the XML file.

Parameters:
xmlEvent - The xml file where the event exisits.

run

public void run()
Runs the sample event source.

Specified by:
run in interface java.lang.Runnable