public class DefaultInputPort extends Object implements InputPort, Observer<InputPortContext>
| Constructor and Description |
|---|
DefaultInputPort(org.vertx.java.core.Vertx vertx,
InputPortContext context) |
| Modifier and Type | Method and Description |
|---|---|
InputPort |
batchHandler(org.vertx.java.core.Handler<InputBatch> handler)
Registers a batch handler.
|
void |
close()
Closes the stream.
|
void |
close(org.vertx.java.core.Handler<org.vertx.java.core.AsyncResult<Void>> doneHandler)
Closes the stream.
|
InputPort |
groupHandler(String group,
org.vertx.java.core.Handler<InputGroup> handler)
Registers a group handler.
|
InputPort |
messageHandler(org.vertx.java.core.Handler handler)
Registers a message handler on the input.
|
String |
name()
Returns the port name.
|
InputPort |
open()
Opens the stream.
|
InputPort |
open(org.vertx.java.core.Handler<org.vertx.java.core.AsyncResult<Void>> doneHandler)
Opens the stream.
|
InputPort |
pause()
Pauses the input.
|
InputPort |
resume()
Resumes receiving data on the input.
|
void |
update(InputPortContext update)
Notifies the observer of an update.
|
org.vertx.java.core.Vertx |
vertx()
Returns the input's vertx instance.
|
public DefaultInputPort(org.vertx.java.core.Vertx vertx,
InputPortContext context)
public org.vertx.java.core.Vertx vertx()
Inputpublic void update(InputPortContext update)
Observerupdate in interface Observer<InputPortContext>update - The updated object.public InputPort pause()
InputWhen the input is paused, messages received by the input will be buffered, so it is important that inputs not be paused for too long if messages continue to flow.
public InputPort resume()
InputWhen the input is resumed, any messages that were buffered during the pause will be processed first. Once the input's buffer is empty it will resume normal operation.
public InputPort messageHandler(org.vertx.java.core.Handler handler)
InputThe message handler can accept any message type that is supported by the Vert.x event bus. Vertigo messages cannot be replied to and do not need to be acked. The input handles communicating and coordinating with outputs internally.
messageHandler in interface Input<InputPort>handler - A message handler.public InputPort batchHandler(org.vertx.java.core.Handler<InputBatch> handler)
InputBatchSupportbatchHandler in interface InputBatchSupport<InputPort>handler - The handler to register. This handler will be called
whenever a new batch is started.public InputPort groupHandler(String group, org.vertx.java.core.Handler<InputGroup> handler)
InputGroupSupportgroupHandler in interface InputGroupSupport<InputPort>group - The name of the group for which to register the handler.handler - The handler to register. This handler will be called
whenever a group of the given name is started.public InputPort open(org.vertx.java.core.Handler<org.vertx.java.core.AsyncResult<Void>> doneHandler)
Openablepublic void close()
CloseableCopyright © 2013-2014. All Rights Reserved.