WebSphere WebSphere Enterprise Service Bus, Version 6.0.1 Operating Systems: AIX, HP-UX, Linux, Solaris, Windows

Obtaining an emitter

Before you can obtain an emitter, there must be at least one emitter factory profile configured.

Before you begin

For each emitter factory profile, an emitter factory is automatically created and is accessible using the JNDI name of the emitter factory profile.

Why and when to perform this task

To obtain an emitter, follow these steps:

Steps for this task

  1. Perform a JNDI lookup specifying the name of the emitter factory you want to use for your emitter. This is the JNDI name specified by an administrator when defining an emitter factory profile.
  2. Call the getEmitter() method of the emitter factory. The returned object is an emitter configured according to the options defined in the emitter factory profile you specified. If the emitter factory is unable to obtain an emitter, it throws an EmitterException exception.
    Note: If your event source is a J2EE client application running in a secure environment, and the emitter profile you are using specifies asynchronous transmission profiles, you must specify a JMS user name and password in order to get an emitter. To do this, use the getEmitter(String, String) method, passing the JMS user name and password you want to use. For more information, refer to the Javadoc documentation for the com.ibm.events.emitter class.

Example

The following code fragment obtains an emitter configured with the profile Default:
import javax.naming.*
import com.ibm.events.emitter.*

Context context = new InitialContext();
EmitterFactory emitterFactory =
  (EmitterFactory) context.lookup("com/ibm/events/configuration/emitter/Default");
Emitter emitter = emitterFactory.getEmitter();

Task topic

Terms of Use | Rate this page

Timestamp iconLast updated: 13 Dec 2005
http://publib.boulder.ibm.com/infocenter/dmndhelp/v6rxmx/index.jsp?topic=/com.ibm.websphere.wesb.doc\doc\tcei_dev_getemitter.html

(C) Copyright IBM Corporation 2005. All Rights Reserved.
This information center is powered by Eclipse technology. (http://www.eclipse.org)