Package org.drasyl.pipeline
Class DefaultPipeline
java.lang.Object
org.drasyl.pipeline.DefaultPipeline
- All Implemented Interfaces:
Pipeline
- Direct Known Subclasses:
DrasylPipeline
,EmbeddedPipeline
Abstract
Pipeline
implementation, that needs head and tail.-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected DrasylConfig
protected org.drasyl.pipeline.AbstractEndHandler
protected Identity
protected TypeValidator
protected TypeValidator
protected io.reactivex.rxjava3.core.Scheduler
protected org.drasyl.pipeline.AbstractEndHandler
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionInserts aHandler
after an existing handler of this pipeline.Inserts aHandler
before an existing handler of this pipeline.Inserts aHandler
at the first position of this pipeline.Appends aHandler
at the last position of this pipeline.Returns the context object of theHandler
with the specified name in this pipeline.Returns theHandler
with the specified name in this pipeline.protected void
processInbound
(Event event) Processes an inbound event by the pipeline.processInbound
(Message msg) Processes an inbound message by the pipeline.processInbound
(Address sender, Object msg) Processes an inbound message by the pipeline.processOutbound
(Address recipient, Object msg) Processes an outbound message by the pipeline.Removes theHandler
with the specified name from this pipeline.Replaces theHandler
of the specified name with a new handler in this pipeline.
-
Field Details
-
handlerNames
-
head
protected org.drasyl.pipeline.AbstractEndHandler head -
tail
protected org.drasyl.pipeline.AbstractEndHandler tail -
scheduler
protected io.reactivex.rxjava3.core.Scheduler scheduler -
config
-
identity
-
inboundValidator
-
outboundValidator
-
-
Constructor Details
-
DefaultPipeline
public DefaultPipeline()
-
-
Method Details
-
initPointer
protected void initPointer() -
addFirst
Description copied from interface:Pipeline
Inserts aHandler
at the first position of this pipeline. -
addLast
Description copied from interface:Pipeline
Appends aHandler
at the last position of this pipeline. -
addBefore
Description copied from interface:Pipeline
Inserts aHandler
before an existing handler of this pipeline. -
addAfter
Description copied from interface:Pipeline
Inserts aHandler
after an existing handler of this pipeline. -
remove
Description copied from interface:Pipeline
Removes theHandler
with the specified name from this pipeline. -
replace
Description copied from interface:Pipeline
Replaces theHandler
of the specified name with a new handler in this pipeline. -
get
Description copied from interface:Pipeline
Returns theHandler
with the specified name in this pipeline. -
context
Description copied from interface:Pipeline
Returns the context object of theHandler
with the specified name in this pipeline. -
processInbound
Description copied from interface:Pipeline
Processes an inbound message by the pipeline.- Specified by:
processInbound
in interfacePipeline
- Parameters:
sender
- the sender of the messagemsg
- the inbound message
-
processInbound
Description copied from interface:Pipeline
Processes an inbound message by the pipeline.- Specified by:
processInbound
in interfacePipeline
- Parameters:
msg
- the inbound message
-
processInbound
Description copied from interface:Pipeline
Processes an inbound event by the pipeline.- Specified by:
processInbound
in interfacePipeline
- Parameters:
event
- the inbound event
-
processOutbound
Description copied from interface:Pipeline
Processes an outbound message by the pipeline.- Specified by:
processOutbound
in interfacePipeline
- Parameters:
recipient
- the recipient of the messagemsg
- the outbound message- Returns:
- a completed future if the message was successfully processed, otherwise an exceptionally future
-