public class DefaultInputConnection extends Object implements InputConnection
| Constructor and Description |
|---|
DefaultInputConnection(org.vertx.java.core.Vertx vertx,
InputConnectionContext context) |
DefaultInputConnection(org.vertx.java.core.Vertx vertx,
String address) |
| Modifier and Type | Method and Description |
|---|---|
String |
address()
Returns the connection address.
|
void |
close()
Closes the stream.
|
void |
close(org.vertx.java.core.Handler<org.vertx.java.core.AsyncResult<Void>> doneHandler)
Closes the stream.
|
InputConnection |
groupHandler(String group,
org.vertx.java.core.Handler<InputGroup> handler)
Registers a group handler on the input.
|
InputConnection |
messageHandler(org.vertx.java.core.Handler handler)
Registers a message handler on the input.
|
InputConnection |
open()
Opens the stream.
|
InputConnection |
open(org.vertx.java.core.Handler<org.vertx.java.core.AsyncResult<Void>> doneHandler)
Opens the stream.
|
InputConnection |
pause()
Pauses the input.
|
InputConnection |
resume()
Resumes receiving data on the input.
|
int |
size()
Returns the current connection size.
|
org.vertx.java.core.Vertx |
vertx()
Returns the input's vertx instance.
|
public DefaultInputConnection(org.vertx.java.core.Vertx vertx,
String address)
public DefaultInputConnection(org.vertx.java.core.Vertx vertx,
InputConnectionContext context)
public String address()
Connectionaddress in interface Connection<InputConnection>public org.vertx.java.core.Vertx vertx()
Inputvertx in interface Input<InputConnection>public int size()
Connectionsize in interface Connection<InputConnection>public InputConnection open()
Openableopen in interface Openable<InputConnection>public InputConnection open(org.vertx.java.core.Handler<org.vertx.java.core.AsyncResult<Void>> doneHandler)
Openableopen in interface Openable<InputConnection>doneHandler - An asynchronous handler to be called once complete.public InputConnection 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.
pause in interface Input<InputConnection>public InputConnection 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.
resume in interface Input<InputConnection>public InputConnection 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<InputConnection>handler - A message handler.public InputConnection groupHandler(String group, org.vertx.java.core.Handler<InputGroup> handler)
InputThe group handler will be called any time a group with the given name is received on the input on which the handler was registered. That means if the handler was registered on a port, the handler will only be called for a group that is received by the port. Alternatively, if the handler was registered on a group then the handler will only be called for a group that was received by the group on which the handler was registered. This means that group handlers are inherently hierarchical, and its important that users take care in how handlers are registered.
groupHandler in interface Input<InputConnection>group - The name of the group for which to register the handler.handler - A handler to be called when the group is received.public void close()
Closeableclose in interface Closeable<InputConnection>public void close(org.vertx.java.core.Handler<org.vertx.java.core.AsyncResult<Void>> doneHandler)
Closeableclose in interface Closeable<InputConnection>doneHandler - An asynchronous handler to be called once complete.Copyright © 2013-2014. All Rights Reserved.