H
- the parameterization lower bounded by XmlHandler
itself.C
- the Connection
type.T
- the XmlEvent
type.S
- the Source
enumeration type.public abstract class XmlHandler<H extends XmlHandler<H,C,T,S>,C extends Connection,T extends XmlEvent<T,?,S>,S extends Enum<S>> extends AbstractFilteredHandler<H,C,T> implements Source<T,S>, FilterFactory<Filter<T,Element>,T,Element,H>
XmlEvent
s. Programmers will have to implement
parse(Element)
for system-specific behavior.ConnectionHandler.ClosingType
dummyFuture
Constructor and Description |
---|
XmlHandler(String name,
S type,
int maximumSize)
Alternate constructor.
|
XmlHandler(String name,
S type,
int minimumSize,
int maximumSize)
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
protected abstract T |
createEos()
Creates an end-of-stream
XmlEvent . |
protected abstract T |
createError()
Creates an error
XmlEvent . |
Handler<T> |
getHandler()
|
S |
getType()
Gets the type.
|
Filter<T,Element> |
newFilter(H handler)
Creates a new
Filter . |
void |
onBind(Queue<T> inputs)
On binding.
|
void |
onClose()
On completion of closure.
|
void |
onClosing(ConnectionHandler.ClosingType type,
Queue<T> inputs)
On closure.
|
void |
onReceive(Queue<T> inputs)
On receipt of data.
|
void |
onRemote(T evt)
Delivers an
Event to the remote manifestation. |
protected abstract T |
parse(Element rootElement)
|
void |
setHandler(Handler<T> handler)
|
close, getConnection, onBind, onClosing, onOob, onOob, onReceive, send, setConnection, setFilterFactory, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
onLocal
public XmlHandler(String name, S type, int minimumSize, int maximumSize)
name
- the name of this connection.type
- the SourceType
.minimumSize
- the minimum message buffer size.maximumSize
- the maximum message buffer size.public void onRemote(T evt)
SourceRemote
Event
to the remote manifestation.public void onReceive(Queue<T> inputs)
FilteredHandler
onReceive
in interface FilteredHandler<H extends XmlHandler<H,C,T,S>,C extends Connection,T extends XmlEvent<T,?,S>>
inputs
- the input Queue
.public void onClosing(ConnectionHandler.ClosingType type, Queue<T> inputs)
FilteredHandler
onClosing
in interface FilteredHandler<H extends XmlHandler<H,C,T,S>,C extends Connection,T extends XmlEvent<T,?,S>>
type
- the ConnectionHandler.ClosingType
.inputs
- the input Queue
.ConnectionHandler.ClosingType
public Filter<T,Element> newFilter(H handler)
FilterFactory
Filter
.public void onBind(Queue<T> inputs)
FilteredHandler
onBind
in interface FilteredHandler<H extends XmlHandler<H,C,T,S>,C extends Connection,T extends XmlEvent<T,?,S>>
inputs
- the input Queue
.public void onClose()
ConnectionHandler
onClose
in interface ConnectionHandler<C extends Connection>