|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.excalibur.event.impl.MultiCastSink
public class MultiCastSink
This is a org.apache.excalibur.event.seda.event.Sink
implementation that multicasts enqueue operations to the
contained and concrete sink objects. The multi cast sink
will try to enqueue and only succeeds if no element was
rejected from any sink. The sink can be configured to
enqueue into one sink alone or all sinks.
If a sink array in the collection of sinks contains more
than one sink the multicast sink will try to enqueue the
element always to only one of these sinks.
| Nested Class Summary | |
|---|---|
private static class |
MultiCastSink.DefaultPreparedEnqueue
A prepared enqueue object that holds other prepared enqueue objects and allows to perform a commit / abort on all of these objects. |
| Field Summary | |
|---|---|
private boolean |
m_single
Boolean value describing if one or all operations must succeed. |
private java.util.Collection |
m_sinks
A collection of sink arrays representing the sinks to enqueue to. |
private int |
m_size
The size of the sink. |
| Fields inherited from interface org.apache.excalibur.event.Sink |
|---|
ROLE |
| Constructor Summary | |
|---|---|
MultiCastSink(java.util.Collection sinks)
This constructor creates a failure in-tolerant multicast sink based on the collection of sink arrays. |
|
MultiCastSink(java.util.Collection sinks,
boolean single)
This constructor creates a failure in-tolerant multicast sink based on the collection of sink arrays. |
|
| Method Summary | |
|---|---|
int |
canAccept()
|
void |
enqueue(java.lang.Object element)
|
void |
enqueue(java.lang.Object[] elements)
|
boolean |
isFull()
|
int |
maxSize()
|
org.apache.excalibur.event.PreparedEnqueue |
prepareEnqueue(java.lang.Object[] elements)
|
int |
size()
|
boolean |
tryEnqueue(java.lang.Object element)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private final java.util.Collection m_sinks
private final int m_size
private final boolean m_single
| Constructor Detail |
|---|
public MultiCastSink(java.util.Collection sinks)
sinks - A collection of sink arrays for each stage.
public MultiCastSink(java.util.Collection sinks,
boolean single)
sinks - A collection of sink arrays for each stage.single - | Method Detail |
|---|
public int canAccept()
canAccept in interface org.apache.excalibur.event.SinkSink.canAccept()public boolean isFull()
isFull in interface org.apache.excalibur.event.SinkSink.isFull()public int maxSize()
maxSize in interface org.apache.excalibur.event.SinkSink.maxSize()
public void enqueue(java.lang.Object element)
throws org.apache.excalibur.event.SinkException
enqueue in interface org.apache.excalibur.event.Sinkorg.apache.excalibur.event.SinkExceptionSink.enqueue(Object)
public void enqueue(java.lang.Object[] elements)
throws org.apache.excalibur.event.SinkException
enqueue in interface org.apache.excalibur.event.Sinkorg.apache.excalibur.event.SinkExceptionSink.enqueue(Object[])public boolean tryEnqueue(java.lang.Object element)
tryEnqueue in interface org.apache.excalibur.event.SinkSink.tryEnqueue(Object)
public org.apache.excalibur.event.PreparedEnqueue prepareEnqueue(java.lang.Object[] elements)
throws org.apache.excalibur.event.SinkException
prepareEnqueue in interface org.apache.excalibur.event.Sinkorg.apache.excalibur.event.SinkExceptionSink.prepareEnqueue(Object[])public int size()
size in interface org.apache.excalibur.event.SinkSink.size()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||