|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
This is the interface for the event emitter. Event sources use this interface
to send events to an event server. Emitter instances are created
by EmitterFactory
instances.
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 bus. |
java.lang.String |
sendEvent(org.eclipse.hyades.logging.events.cbe.CommonBaseEvent event,
int synchronizationMode,
int transactionMode)
Sends an event to the event bus, 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 bus. |
java.lang.String[] |
sendEvents(org.eclipse.hyades.logging.events.cbe.CommonBaseEvent[] events,
int synchronizationMode,
int transactionMode)
Sends an array of events to the event bus. |
void |
setSynchronizationMode(int synchronizationMode)
Sets the default synchronization mode for sending events to the event bus. |
void |
setTransactionMode(int transactionMode)
Sets the transaction mode for sending events to the event bus. |
Method Detail |
public java.lang.String sendEvent(org.eclipse.hyades.logging.events.cbe.CommonBaseEvent event) throws EventsException
Sends an event to the event bus.
The event is sent to the event bus under the following circumstances:
CommonBaseEvent.validate()
method.
event
- The event to be sent to the event bus.
This value cannot be null.
EmitterException
- If an error occurs during emitter processing.
FilterException
- If an error occurs during filter processing.
java.lang.IllegalArgumentException
- If the event parameter is null.
EventsException
public java.lang.String sendEvent(org.eclipse.hyades.logging.events.cbe.CommonBaseEvent event, int synchronizationMode, int transactionMode) throws EventsException
Sends an event to the event bus, overriding the default emitter settings with the passed parameters.
The event is sent to the event bus under the following circunstances:
CommonBaseEvent.validate()
method.
event
- The event to be sent to the event bus. 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 server. If the event is sent asynchronously, this call returns
as soon as the event
emitter has passed the event to the server.
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
.
The value TransactionMode.NEW can be applied only if sendEvent code is invoked inside of an application-managed local transaction or if the global transaction is suspended before call. For more information about this restriction, see the technote(troubleshooting) 1378306, "CEI API call to emitter with TransactionMode.NEW mode causes CWSIS1004E, CWSJR1113E, J2CA0024E: transaction commit errors".
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.
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
TransactionMode
,
SynchronizationMode
public java.lang.String[] sendEvents(org.eclipse.hyades.logging.events.cbe.CommonBaseEvent[] events) throws EventsException
Sends an array of events to the event bus.
The events are sent to the event bus under the following circumstances:
CommonBaseEvent.validate()
method.
events
- The event array to be sent to the event bus.
This value cannot be null.
EmitterException
- If an error occurs during emitter processing.
FilterException
- If an error occurs during filter processing.
java.lang.IllegalArgumentException
- If the events parameter is null.
EventsException
public 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 bus.
, overriding the default emitter settings with the passed parameters.The events are sent to the event bus under the following circumstances:
CommonBaseEvent.validate()
method.
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 server. If the event is sent asynchronously, this call returns
as soon as the event
emitter has passed the event to the server.
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
.
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.
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
TransactionMode
,
SynchronizationMode
public void setTransactionMode(int transactionMode) throws TransactionModeNotSupportedException
Sets the transaction mode for sending events to the event bus.
transactionMode
- The transaction mode to use.
Valid values are:
TransactionMode.SAME
to use the same
transaction as the caller.TransactionMode.NEW
to use a new
transaction.TransactionMode.DEFAULT
to use the
default setting in the emitter.TransactionModeNotSupportedException
- If the
transaction mode specified is not supported by this emitter.public int getTransactionMode()
TransactionMode.SAME
or
TransactionMode.NEW
.public int getSynchronizationMode()
SynchronizationMode.SYNCHRONOUS
or SynchronizationMode.ASYNCHRONOUS
.SynchronizationMode
public void setSynchronizationMode(int synchronizationMode) throws EmitterException
synchronizationMode
- The synchronization mode for
sending events to the event bus. Valid values are:
SynchronizationMode.SYNCHRONOUS
to send
events to the event bus synchronously.SynchronizationMode.ASYNCHRONOUS
to send
events to the event bus asynchronously.SynchronizationMode.DEFAULT
to use the
default setting in the emitter for sending events.SynchronizationModeNotSupportedException
- If the synchronization
mode specified is not supported by this emitter.
EmitterException
- If an error occurred when changing the
synchronization mode.public ComponentMetaData getMetaData()
public ComponentMetaData getFilterMetaData() throws FilterException
Filter.getMetaData()
call.
FilterException
- If an error occurred in the filter while
obtaining metadata.public void close() throws EventsException
EmitterException
- If the emitter fails to release the
held resources.
FilterException
- If the filter fails to release the held
resources.
EventsException
- If any other error occurs when releasing resources.public boolean isSynchronizationModeSupported(int synchronizationMode)
synchronizationMode
- The SynchronizationMode
to be tested for support.
true
if the passed synchronization mode is suported, false
otherwise.SynchronizationMode
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |