Package org.drasyl.pipeline
Class DefaultPipeline
- java.lang.Object
-
- org.drasyl.pipeline.DefaultPipeline
-
- All Implemented Interfaces:
Pipeline
- Direct Known Subclasses:
DrasylPipeline
,EmbeddedPipeline
public abstract class DefaultPipeline extends Object implements Pipeline
AbstractPipeline
implementation, that needs head and tail.
-
-
Field Summary
Fields Modifier and Type Field Description protected DrasylConfig
config
protected Map<String,org.drasyl.pipeline.AbstractHandlerContext>
handlerNames
protected org.drasyl.pipeline.AbstractHandlerContext
head
protected io.reactivex.rxjava3.core.Scheduler
scheduler
protected org.drasyl.pipeline.AbstractHandlerContext
tail
-
Constructor Summary
Constructors Constructor Description DefaultPipeline()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Pipeline
addAfter(String baseName, String name, Handler handler)
Inserts aHandler
after an existing handler of this pipeline.Pipeline
addBefore(String baseName, String name, Handler handler)
Inserts aHandler
before an existing handler of this pipeline.Pipeline
addFirst(String name, Handler handler)
Inserts aHandler
at the first position of this pipeline.Pipeline
addLast(String name, Handler handler)
Appends aHandler
at the last position of this pipeline.HandlerContext
context(String name)
Returns the context object of theHandler
with the specified name in this pipeline.void
executeInbound(Event event)
void
executeInbound(ApplicationMessage msg)
void
executeOutbound(ApplicationMessage msg)
Handler
get(String name)
Returns theHandler
with the specified name in this pipeline.protected void
initPointer()
Pipeline
remove(String name)
Removes theHandler
with the specified name from this pipeline.Pipeline
replace(String oldName, String newName, Handler newHandler)
Replaces theHandler
of the specified name with a new handler in this pipeline.
-
-
-
Field Detail
-
head
protected org.drasyl.pipeline.AbstractHandlerContext head
-
tail
protected org.drasyl.pipeline.AbstractHandlerContext tail
-
scheduler
protected io.reactivex.rxjava3.core.Scheduler scheduler
-
config
protected DrasylConfig config
-
-
Method Detail
-
initPointer
protected void initPointer()
-
addFirst
public Pipeline addFirst(String name, Handler handler)
Description copied from interface:Pipeline
Inserts aHandler
at the first position of this pipeline.
-
addLast
public Pipeline addLast(String name, Handler handler)
Description copied from interface:Pipeline
Appends aHandler
at the last position of this pipeline.
-
addBefore
public Pipeline addBefore(String baseName, String name, Handler handler)
Description copied from interface:Pipeline
Inserts aHandler
before an existing handler of this pipeline.
-
addAfter
public Pipeline addAfter(String baseName, String name, Handler handler)
Description copied from interface:Pipeline
Inserts aHandler
after an existing handler of this pipeline.
-
remove
public Pipeline remove(String name)
Description copied from interface:Pipeline
Removes theHandler
with the specified name from this pipeline.
-
replace
public Pipeline replace(String oldName, String newName, Handler newHandler)
Description copied from interface:Pipeline
Replaces theHandler
of the specified name with a new handler in this pipeline.
-
get
public Handler get(String name)
Description copied from interface:Pipeline
Returns theHandler
with the specified name in this pipeline.
-
context
public HandlerContext context(String name)
Description copied from interface:Pipeline
Returns the context object of theHandler
with the specified name in this pipeline.
-
executeInbound
public void executeInbound(ApplicationMessage msg)
- Specified by:
executeInbound
in interfacePipeline
-
executeInbound
public void executeInbound(Event event)
- Specified by:
executeInbound
in interfacePipeline
-
executeOutbound
public void executeOutbound(ApplicationMessage msg)
- Specified by:
executeOutbound
in interfacePipeline
-
-