IBM WebSphere Application ServerTM
Release 8

com.ibm.events.emitter
Interface Emitter

All Known Implementing Classes:
ECSEmitter

public interface Emitter

This is the interface for the event emitter. Event sources use this interface to send events to an event service. Emitter instances are created by EmitterFactory instances.

This interface uses the following security roles:

Since:
5.1.0
Version:
1.2 11/4/05
See Also:
EmitterFactory, CommonBaseEvent, com.ibm.events.filter

Method Summary
 void close()
          Causes the emitter to release all resources that are owned by this object and its dependents.
 ComponentMetaData getFilterMetaData()
          Obtains the filter metadata.
 ComponentMetaData getMetaData()
          Obtains the emitter component metadata.
 int getSynchronizationMode()
          Returns the current setting for the synchronization mode.
 int getTransactionMode()
          Returns the current setting for the transaction mode.
 boolean isSynchronizationModeSupported(int synchronizationMode)
          Enables the caller to determine if a synchronization mode is supported by this emitter.
 java.lang.String sendEvent(org.eclipse.hyades.logging.events.cbe.CommonBaseEvent event)
          Sends an event to the event service.
 java.lang.String sendEvent(org.eclipse.hyades.logging.events.cbe.CommonBaseEvent event, int synchronizationMode, int transactionMode)
          Sends an event to the event service, overriding the default emitter settings with the passed parameters.
 java.lang.String[] sendEvents(org.eclipse.hyades.logging.events.cbe.CommonBaseEvent[] events)
          Sends an array of events to the event service.
 java.lang.String[] sendEvents(org.eclipse.hyades.logging.events.cbe.CommonBaseEvent[] events, int synchronizationMode, int transactionMode)
          Sends an array of events to the event service.
 void setSynchronizationMode(int synchronizationMode)
          Sets the default synchronization mode for sending events to the event service.
 void setTransactionMode(int transactionMode)
          Sets the transaction mode for sending events to the event service.
 

Method Detail

sendEvent

java.lang.String sendEvent(org.eclipse.hyades.logging.events.cbe.CommonBaseEvent event)
                           throws EventsException

Sends an event to the event service.

The event is sent to the event service under the following circumstances:

The eventCreator or the eventAdministrator security role is required for this method.

Parameters:
event - The event to be sent to the event service. This value cannot be null.
Returns:
The global instance ID of the event that was built.
Throws:
EmitterException - If an error occurs during emitter processing.
com.ibm.events.filter.FilterException - If an error occurs during filter processing.
java.lang.IllegalArgumentException - If the event parameter is null.
EventsException

sendEvent

java.lang.String sendEvent(org.eclipse.hyades.logging.events.cbe.CommonBaseEvent event,
                           int synchronizationMode,
                           int transactionMode)
                           throws EventsException

Sends an event to the event service, overriding the default emitter settings with the passed parameters.

The event is sent to the event service under the following circunstances:

The eventCreator or the eventAdministrator security role is required for this method.

Parameters:
event - The event to be sent to the event service. This value cannot be null.
synchronizationMode - Indicates whether the event will be sent synchronously (SynchronizationMode.SYNCHRONOUS) or asynchronously (SynchronizationMode.ASYNCHRONOUS) If the event is sent synchronously, this call does not return until the event has been processed by the event service. If the event is sent asynchronously, this call returns as soon as the event emitter has passed the event to the event service. To avoid overriding the synchronization mode, pass a value of SynchronizationMode.DEFAULT.
transactionMode - Indicates whether the event emitter processes the event in the current transaction (TransactionMode.SAME) or in a new transaction (TransactionMode.NEW). To avoid overriding the transaction mode, pass a value of TransactionMode.DEFAULT.
Returns:
The global instance ID of the event that was built.
Throws:
SynchronizationModeNotSupportedException - If the the emitter does not support the synchronization mode specified by the caller.
TransactionModeNotSupportedException - If the the emitter does not support the transaction mode specified by the caller.
EmitterException - If an ocurrs during emitter processing.
com.ibm.events.filter.FilterException - If an error occurs during filter processing.
java.lang.IllegalArgumentException - If the event parameter is null or the transactionMode or synchronizationMode are invalid.
EventsException
See Also:
TransactionMode, SynchronizationMode

sendEvents

java.lang.String[] sendEvents(org.eclipse.hyades.logging.events.cbe.CommonBaseEvent[] events)
                              throws EventsException

Sends an array of events to the event service.

The events are sent to the event service under the following circumstances:

The eventCreator or the eventAdministrator security role is required for this method.

Parameters:
events - The event array to be sent to the event service. This value cannot be null.
Returns:
The global instance ID's of the events that were built.
Throws:
EmitterException - If an error occurs during emitter processing.
com.ibm.events.filter.FilterException - If an error occurs during filter processing.
java.lang.IllegalArgumentException - If the events parameter is null.
EventsException

sendEvents

java.lang.String[] sendEvents(org.eclipse.hyades.logging.events.cbe.CommonBaseEvent[] events,
                              int synchronizationMode,
                              int transactionMode)
                              throws EventsException

Sends an array of events to the event service.

, overriding the default emitter settings with the passed parameters.

The events are sent to the event service under the following circumstances:

The eventCreator or the eventAdministrator security role is required for this method.

Parameters:
events - The event array to be sent to the event service. This value cannot be null.
synchronizationMode - Indicates whether the event will be sent synchronously (SynchronizationMode.SYNCHRONOUS) or asynchronously (SynchronizationMode.ASYNCHRONOUS) If the event is sent synchronously, this call does not return until the event has been processed by the event service. If the event is sent asynchronously, this call returns as soon as the event emitter has passed the event to the event service. To avoid overriding the synchronization mode, pass a value of SynchronizationMode.DEFAULT.
transactionMode - Indicates whether the event emitter processes the event in the current transaction (TransactionMode.SAME) or in a new transaction (TransactionMode.NEW). To avoid overriding the transaction mode, pass a value of TransactionMode.DEFAULT.
Returns:
The global instance ID of the event that was built.
Throws:
SynchronizationModeNotSupportedException - If the the emitter does not support the synchronization mode specified by the caller.
TransactionModeNotSupportedException - If the the emitter does not support the transaction mode specified by the caller.
EmitterException - If an ocurrs during emitter processing.
com.ibm.events.filter.FilterException - If an error occurs during filter processing.
java.lang.IllegalArgumentException - If the events parameter is null or the transactionMode or synchronizationMode are invalid.
EventsException
See Also:
TransactionMode, SynchronizationMode

setTransactionMode

void setTransactionMode(int transactionMode)
                        throws TransactionModeNotSupportedException

Sets the transaction mode for sending events to the event service.

Parameters:
transactionMode - The transaction mode to use. Valid values are:
Throws:
TransactionModeNotSupportedException - If the transaction mode specified is not supported by this emitter.

getTransactionMode

int getTransactionMode()
Returns the current setting for the transaction mode.

Returns:
Either TransactionMode.SAME or TransactionMode.NEW.

getSynchronizationMode

int getSynchronizationMode()
Returns the current setting for the synchronization mode.

Returns:
Either SynchronizationMode.SYNCHRONOUS or SynchronizationMode.ASYNCHRONOUS.
See Also:
SynchronizationMode

setSynchronizationMode

void setSynchronizationMode(int synchronizationMode)
                            throws EmitterException
Sets the default synchronization mode for sending events to the event service.

Parameters:
synchronizationMode - The synchronization mode for sending events to the event service. Valid values are:
Throws:
SynchronizationModeNotSupportedException - If the synchronization mode specified is not supported by this emitter.
EmitterException - If an error occurred when changing the synchronization mode.

getMetaData

ComponentMetaData getMetaData()
Obtains the emitter component metadata.

Returns:
The component metadata for the emitter.

getFilterMetaData

ComponentMetaData getFilterMetaData()
                                    throws com.ibm.events.filter.FilterException
Obtains the filter metadata. This method returns null if a filter is not configured for this emitter. If a filter is configured, this method returns the result of a Filter.getMetaData() call.

Returns:
Component metadata for the filter or null if the metadata is not available.
Throws:
com.ibm.events.filter.FilterException - If an error occurred in the filter while obtaining metadata.

close

void close()
           throws EventsException
Causes the emitter to release all resources that are owned by this object and its dependents. Subsequent calls to this method have no effect.

Throws:
EmitterException - If the emitter fails to release the held resources.
com.ibm.events.filter.FilterException - If the filter fails to release the held resources.
EventsException - If any other error occurs when releasing resources.

isSynchronizationModeSupported

boolean isSynchronizationModeSupported(int synchronizationMode)
Enables the caller to determine if a synchronization mode is supported by this emitter.

Parameters:
synchronizationMode - The SynchronizationMode to be tested for support.
Returns:
true if the passed synchronization mode is suported, false otherwise.
See Also:
SynchronizationMode

IBM WebSphere Application ServerTM
Release 8