public class ConnectionInputGroup extends Object implements InputGroup
This input group is created directly by a DefaultInputConnection when
the connection receives a new group message.
| Constructor and Description |
|---|
ConnectionInputGroup(String id,
String name,
DefaultInputConnection connection) |
| Modifier and Type | Method and Description |
|---|---|
InputGroup |
endHandler(org.vertx.java.core.Handler<Void> handler)
Registers an end handler on the group.
|
InputGroup |
groupHandler(String group,
org.vertx.java.core.Handler<InputGroup> handler)
Registers a group handler on the input.
|
String |
id()
Returns the unique group identifier.
|
InputGroup |
messageHandler(org.vertx.java.core.Handler handler)
Registers a message handler on the input.
|
String |
name()
Returns the group name.
|
InputGroup |
pause()
Pauses the input.
|
InputGroup |
resume()
Resumes receiving data on the input.
|
InputGroup |
startHandler(org.vertx.java.core.Handler<Void> handler)
Registers a start handler on the group.
|
org.vertx.java.core.Vertx |
vertx()
Returns the input's vertx instance.
|
public ConnectionInputGroup(String id, String name, DefaultInputConnection connection)
public String id()
Groupid in interface Group<InputGroup>public String name()
Groupname in interface Group<InputGroup>public org.vertx.java.core.Vertx vertx()
Inputvertx in interface Input<InputGroup>public InputGroup 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<InputGroup>public InputGroup 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<InputGroup>public InputGroup 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<InputGroup>handler - A message handler.public InputGroup 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<InputGroup>group - The name of the group for which to register the handler.handler - A handler to be called when the group is received.public InputGroup startHandler(org.vertx.java.core.Handler<Void> handler)
InputGroupstartHandler in interface InputGrouphandler - A handler to be called when the group is started.public InputGroup endHandler(org.vertx.java.core.Handler<Void> handler)
InputGroupendHandler in interface InputGrouphandler - A handler to be called when the group is ended.Copyright © 2013-2014. All Rights Reserved.