@InterfaceAudience.Private @InterfaceStability.Stable public class JdbcChannel extends AbstractChannel
A JDBC based channel implementation.
JdbcChannel is marked
InterfaceAudience.Private because it
should only be instantiated via a configuration. For example, users should
certainly use JdbcChannel but not by instantiating JdbcChannel objects.
Meaning the label Private applies to user-developers not user-operators.
In cases where a Channel is required by instantiated by user-developers
MemoryChannel should be used.
| Constructor and Description |
|---|
JdbcChannel()
Instantiates a new JDBC Channel.
|
| Modifier and Type | Method and Description |
|---|---|
void |
configure(Context context)
Request the implementing class to (re)configure itself.
|
Transaction |
getTransaction() |
void |
put(Event event)
Puts the given event into the channel.
|
void |
stop()
Stops a service or component.
|
Event |
take()
Returns the next event from the channel if available.
|
getLifecycleState, getName, setName, start, toStringpublic void put(Event event) throws ChannelException
ChannelPuts the given event into the channel.
Note: This method must be invoked within an active
Transaction boundary. Failure to do so can lead to unpredictable
results.
event - the event to transport.ChannelException - in case this operation fails.Transaction.begin()public Event take() throws ChannelException
ChannelReturns the next event from the channel if available. If the channel
does not have any events available, this method must return null.
Note: This method must be invoked within an active
Transaction boundary. Failure to do so can lead to unpredictable
results.
null if no events are
available.ChannelException - in case this operation fails.Transaction.begin()public Transaction getTransaction()
public void stop()
LifecycleAwareStops a service or component.
Implementations should determine the result of any stop logic and effect
the return value of LifecycleAware.getLifecycleState() accordingly.
stop in interface LifecycleAwarestop in class AbstractChannelpublic void configure(Context context)
ConfigurableRequest the implementing class to (re)configure itself.
When configuration parameters are changed, they must be reflected by the component asap.
There are no thread safety guarantees on when configure might be called.
configure in interface Configurableconfigure in class AbstractChannelCopyright © 2009-2022 Apache Software Foundation. All Rights Reserved.