Class BroadcastHandler
java.lang.Object
org.apache.sling.scripting.sightly.impl.compiler.util.stream.BroadcastHandler
- All Implemented Interfaces:
CommandHandler
Broadcasts commands to other handlers
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddHandler(CommandHandler handler) Add a new child handlervoidonDone()This method is called when the stream has been closed.voidAllows this handler to process theCommandthat was just written into the stream to which this handler was attached.voidAllows this handler to process error states.
-
Constructor Details
-
BroadcastHandler
public BroadcastHandler()
-
-
Method Details
-
addHandler
Add a new child handler- Parameters:
handler- - the listening handler
-
onEmit
Description copied from interface:CommandHandlerAllows this handler to process theCommandthat was just written into the stream to which this handler was attached.- Specified by:
onEmitin interfaceCommandHandler- Parameters:
command- the received command
-
onError
Description copied from interface:CommandHandlerAllows this handler to process error states.- Specified by:
onErrorin interfaceCommandHandler- Parameters:
errorMessage- the error's message
-
onDone
public void onDone()Description copied from interface:CommandHandlerThis method is called when the stream has been closed. The contract is that after this call, no other commands or errors will be emitted.- Specified by:
onDonein interfaceCommandHandler
-