Class NozzlePipeline
- All Implemented Interfaces:
com.tccc.kos.commons.core.service.handle.HandleAware
- Direct Known Subclasses:
BeverageNozzlePipeline
,IngredientNozzlePipeline
Although pipeline access to the nozzle is serialized, any given pipeline is free to use the nozzle (and associated pumps) in whatever way makes sense. For example while it makes no sense to have more than one concurrent beverage pour, a pipeline that implements utility pumping (technician operations for example) is free to run multiple concurrent pours as makes sense for the application.
A pipeline creates a new BeanContext that is a child of the nozzle context. This allows objects to be placed in the pipeline context and autowire to each other without mixing with objects in other pipelines. Even if instances of the same class are placed in multiple pipelines, they will be isolated by context and also have a unique handle path related to the nozzle and pipeline. This ensures that multiple instances of service in different pipelines are uniquely identifiable and have distinct config settings, allowing each pipeline to be uniquely configured.
- Since:
- 1.0
- Version:
- 2023-01-13
-
Constructor Summary
ConstructorsConstructorDescriptionNozzlePipeline
(String name) Create a new nozzle pipeline with the specified name. -
Method Summary
Modifier and TypeMethodDescriptioncom.tccc.kos.commons.core.context.BeanContext
getCtx()
com.tccc.kos.commons.core.service.handle.Handle
boolean
void
Send a message with the specified topic which will be automatically prefixed with the base nozzle topic.void
Send a message with the specified topic and body.void
Send a message with the specified topic and body.void
start()
Called when the pipeline is installed to the nozzle.void
stop()
Called when a pipeline is uninstalled from the nozzle.Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.tccc.kos.commons.core.service.handle.HandleAware
addHandleChild, getName, getPath
-
Constructor Details
-
NozzlePipeline
Create a new nozzle pipeline with the specified name. The name will be part of the handle path and will also be used to namespace any controllers that exist within the pipeline.
-
-
Method Details
-
start
public void start()Called when the pipeline is installed to the nozzle. The nozzle will be set and the pipeline context will be bound to the nozzle context before this is called. This allows the pipeline to prepare for use. Any controllers in the pipeline will be made active when this returns. Override as needed. -
stop
public void stop()Called when a pipeline is uninstalled from the nozzle. The nozzle will remain set until this returns. Any controllers in the pipeline will be disabled before this is called. Override as needed. -
send
Send a message with the specified topic which will be automatically prefixed with the base nozzle topic.- Parameters:
topic
- the relative topic to send
-
send
Send a message with the specified topic and body. The topic will be automatically prefixed with the base nozzle topic.- Parameters:
topic
- the relative topic to sendbody
- object to serialize as the body of the topic
-
send
Send a message with the specified topic and body. The topic will be automatically prefixed with the base nozzle topic. The body will be serialized using the specified view.- Parameters:
topic
- the relative topic to sendbody
- object to serialize as the body of the topicview
- the view to use to serialize the body
-
getPumpEventService
-
getHandle
public com.tccc.kos.commons.core.service.handle.Handle getHandle()- Specified by:
getHandle
in interfacecom.tccc.kos.commons.core.service.handle.HandleAware
-
getCtx
public com.tccc.kos.commons.core.context.BeanContext getCtx() -
getNozzle
-
isInstalled
public boolean isInstalled() -
getTopicPrefix
-