Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Small cosmetic updates and groovyfications

  • Loading branch information...
commit 4de332a1fc4ba1d14b30796c424b40b0f5489425 1 parent 1e04f30
@glaforge authored
Showing with 128 additions and 116 deletions.
  1. +2 −2 src/examples/groovy/echo/EchoClient.groovy
  2. +18 −2 src/examples/groovy/echo/EchoServer.groovy
  3. +3 −3 src/examples/groovy/eventbus/Handler.groovy
  4. +2 −2 src/examples/groovy/eventbus/Sender.groovy
  5. +1 −1  src/examples/groovy/eventbusbridge/BridgeServer.groovy
  6. +2 −2 src/examples/groovy/fanout/FanoutServer.groovy
  7. +1 −1  src/examples/groovy/https/Server.groovy
  8. +2 −2 src/examples/groovy/proxy/Proxy.groovy
  9. +1 −1  src/examples/groovy/sockjs/SockJSExample.groovy
  10. +3 −3 src/examples/groovy/ssl/Server.groovy
  11. +6 −5 src/examples/groovy/upload/Client.groovy
  12. +2 −2 src/examples/groovy/upload/Server.groovy
  13. +1 −1  src/examples/groovy/webapp/OrderMgr.groovy
  14. +1 −1  src/examples/groovy/webapp/WebServer.groovy
  15. +30 −30 src/main/groovy/org/vertx/groovy/core/Vertx.groovy
  16. +5 −5 src/main/groovy/org/vertx/groovy/core/buffer/Buffer.groovy
  17. +3 −9 src/main/groovy/org/vertx/groovy/core/eventbus/EventBus.groovy
  18. +3 −2 src/main/groovy/org/vertx/groovy/core/eventbus/Message.groovy
  19. +2 −2 src/main/groovy/org/vertx/groovy/core/file/FileSystem.groovy
  20. +1 −1  src/main/groovy/org/vertx/groovy/core/http/HttpClient.groovy
  21. +1 −1  src/main/groovy/org/vertx/groovy/core/http/HttpClientRequest.groovy
  22. +5 −5 src/main/groovy/org/vertx/groovy/core/http/HttpServer.groovy
  23. +1 −1  src/main/groovy/org/vertx/groovy/core/http/HttpServerResponse.groovy
  24. +5 −5 src/main/groovy/org/vertx/groovy/core/http/ServerWebSocket.groovy
  25. +2 −2 src/main/groovy/org/vertx/groovy/core/http/WebSocket.groovy
  26. +1 −1  src/main/groovy/org/vertx/groovy/core/http/impl/DefaultHttpServer.groovy
  27. +1 −1  src/main/groovy/org/vertx/groovy/core/net/NetClient.groovy
  28. +1 −1  src/main/groovy/org/vertx/groovy/core/net/NetServer.groovy
  29. +2 −2 src/main/groovy/org/vertx/groovy/core/net/NetSocket.groovy
  30. +1 −1  src/main/groovy/org/vertx/groovy/core/net/impl/DefaultNetClient.groovy
  31. +10 −10 src/main/groovy/org/vertx/groovy/core/parsetools/RecordParser.groovy
  32. +5 −5 src/main/groovy/org/vertx/groovy/core/sockjs/SockJSServer.groovy
  33. +1 −1  src/main/groovy/org/vertx/groovy/core/sockjs/impl/DefaultSockJSServer.groovy
  34. +1 −1  src/main/groovy/org/vertx/groovy/core/streams/Pump.groovy
  35. +1 −1  src/main/groovy/org/vertx/groovy/core/streams/ReadStream.groovy
  36. +1 −1  src/main/groovy/org/vertx/groovy/core/streams/WriteStream.groovy
View
4 src/examples/groovy/echo/EchoClient.groovy
@@ -14,10 +14,10 @@
* limitations under the License.
*/
-vertx.createNetClient().connect(1234, "localhost") { socket->
+vertx.createNetClient().connect(1234, "localhost") { socket ->
socket.dataHandler { buffer ->
- println "Net client receiving: ${buffer.toString()}"
+ println "Net client receiving: ${buffer}"
}
// Now send some data
View
20 src/examples/groovy/echo/EchoServer.groovy
@@ -1,7 +1,23 @@
-import org.vertx.groovy.core.streams.Pump
+/*
+ * Copyright 2011-2012 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import static org.vertx.groovy.core.streams.Pump.createPump
vertx.createNetServer().connectHandler { socket ->
- Pump.createPump(socket, socket).start()
+ createPump(socket, socket).start()
}.listen(1234)
View
6 src/examples/groovy/eventbus/Handler.groovy
@@ -14,10 +14,10 @@
* limitations under the License.
*/
-eb = vertx.eventBus()
+def eb = vertx.eventBus()
-address = 'example.address'
+def address = 'example.address'
-handler = { message -> println "Received message ${message.body}" }
+def handler = { message -> println "Received message ${message.body}" }
eb.registerHandler(address, handler)
View
4 src/examples/groovy/eventbus/Sender.groovy
@@ -14,9 +14,9 @@
* limitations under the License.
*/
-eb = vertx.eventBus()
+def eb = vertx.eventBus()
-address = 'example.address'
+def address = 'example.address'
def count = 0
View
2  src/examples/groovy/eventbusbridge/BridgeServer.groovy
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-server = vertx.createHttpServer()
+def server = vertx.createHttpServer()
// Serve the static resources
server.requestHandler { req ->
View
4 src/examples/groovy/fanout/FanoutServer.groovy
@@ -14,9 +14,9 @@
* limitations under the License.
*/
-conns = vertx.sharedData().getSet('conns')
+def conns = vertx.sharedData().getSet('conns')
-eb = vertx.eventBus()
+def eb = vertx.eventBus()
server = vertx.createNetServer().connectHandler { socket ->
conns << socket.writeHandlerID
View
2  src/examples/groovy/https/Server.groovy
@@ -15,7 +15,7 @@
*/
package https
-server =
+def server =
vertx.createHttpServer(SSL: true, keyStorePath: 'server-keystore.jks', keyStorePassword: 'wibble')
server.requestHandler { req ->
View
4 src/examples/groovy/proxy/Proxy.groovy
@@ -15,9 +15,9 @@
*/
package proxy
-client = vertx.createHttpClient(port: 8282)
+def client = vertx.createHttpClient(port: 8282)
-server = vertx.createHttpServer().requestHandler { req ->
+def server = vertx.createHttpServer().requestHandler { req ->
println "Proxying request: ${req.uri}"
def c_req = client.request(req.method, req.uri) { c_res ->
View
2  src/examples/groovy/sockjs/SockJSExample.groovy
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-server = vertx.createHttpServer()
+def server = vertx.createHttpServer()
// Serve the index page
server.requestHandler { req ->
View
6 src/examples/groovy/ssl/Server.groovy
@@ -16,10 +16,10 @@
package ssl
-import org.vertx.groovy.core.streams.Pump
+import static org.vertx.groovy.core.streams.Pump.createPump
-server = vertx.createNetServer(SSL: true, keyStorePath: 'server-keystore.jks', keyStorePassword: 'wibble')
+def server = vertx.createNetServer(SSL: true, keyStorePath: 'server-keystore.jks', keyStorePassword: 'wibble')
server.connectHandler { sock ->
- Pump.createPump(sock, sock).start()
+ createPump(sock, sock).start()
}.listen(1234, "localhost")
View
11 src/examples/groovy/upload/Client.groovy
@@ -16,11 +16,12 @@
package upload
-import org.vertx.groovy.core.streams.Pump
+import static org.vertx.groovy.core.streams.Pump.createPump
+
+def req = vertx.createHttpClient(port: 8080).put("/someurl") { resp -> println "Response ${resp.statusCode}" }
+def filename = "upload/upload.txt"
+def fs = vertx.fileSystem()
-req = vertx.createHttpClient(port: 8080).put("/someurl") { resp -> println "Response ${resp.statusCode}" }
-filename = "upload/upload.txt"
-fs = vertx.fileSystem()
fs.props(filename) { ares ->
def props = ares.result
println "props is ${props}"
@@ -29,7 +30,7 @@ fs.props(filename) { ares ->
fs.open(filename) { ares2 ->
def file = ares2.result
def rs = file.readStream
- def pump = Pump.createPump(rs, req)
+ def pump = createPump(rs, req)
rs.endHandler { req.end() }
pump.start()
}
View
4 src/examples/groovy/upload/Server.groovy
@@ -16,14 +16,14 @@
package upload
-import org.vertx.groovy.core.streams.Pump
+import static org.vertx.groovy.core.streams.Pump.createPump
vertx.createHttpServer().requestHandler { req ->
req.pause()
def filename = "${UUID.randomUUID()}.uploaded"
vertx.fileSystem().open(filename) { ares ->
def file = ares.result
- def pump = Pump.createPump(req, file.writeStream)
+ def pump = createPump(req, file.writeStream)
req.endHandler {
file.close {
println "Uploaded ${pump.bytesPumped} bytes to $filename"
View
2  src/examples/groovy/webapp/OrderMgr.groovy
@@ -19,7 +19,7 @@ import groovy.json.JsonBuilder
eb = vertx.eventBus()
log = container.logger
-handler = { orderMsg ->
+def handler = { orderMsg ->
def order = orderMsg.body
log.info "Received order in order manager ${stringify(order)}"
View
2  src/examples/groovy/webapp/WebServer.groovy
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-server =
+def server =
vertx.createHttpServer(SSL: true, keyStorePath: 'server-keystore.jks', keyStorePassword: 'wibble')
// Serve the static resources
View
60 src/main/groovy/org/vertx/groovy/core/Vertx.groovy
@@ -45,29 +45,29 @@ import org.vertx.java.core.shareddata.SharedData
*/
class Vertx {
- private final VertxInternal jVertex;
- private final EventBus eventBus;
- private final org.vertx.groovy.core.file.FileSystem fileSystem;
+ private final VertxInternal jVertex
+ private final EventBus eventBus
+ private final org.vertx.groovy.core.file.FileSystem fileSystem
- public Vertx(VertxInternal jVertex) {
- this.jVertex = jVertex;
- this.eventBus = new EventBus(jVertex.eventBus());
- this.fileSystem = new org.vertx.groovy.core.file.FileSystem(jVertex.fileSystem());
+ Vertx(VertxInternal jVertex) {
+ this.jVertex = jVertex
+ this.eventBus = new EventBus(jVertex.eventBus())
+ this.fileSystem = new org.vertx.groovy.core.file.FileSystem(jVertex.fileSystem())
}
/**
* Create a non clustered Vertx instance
*/
- public static Vertx newVertx() {
- return new Vertx(new DefaultVertx());
+ static Vertx newVertx() {
+ return new Vertx(new DefaultVertx())
}
/**
* Create a clustered Vertx instance listening for cluster connections on the default port 25500
* @param hostname The hostname or ip address to listen for cluster connections
*/
- public static Vertx newVertx(String hostname) {
- return new Vertx(new DefaultVertx(hostname));
+ static Vertx newVertx(String hostname) {
+ return new Vertx(new DefaultVertx(hostname))
}
/**
@@ -75,64 +75,64 @@ class Vertx {
* @param port The port to listen for cluster connections
* @param hostname The hostname or ip address to listen for cluster connections
*/
- public static Vertx newVertx(int port, String hostname) {
- return new Vertx(new DefaultVertx(port, hostname));
+ static Vertx newVertx(int port, String hostname) {
+ return new Vertx(new DefaultVertx(port, hostname))
}
/**
* Create a TCP/SSL server
*/
- public NetServer createNetServer(Map props = null) {
- return new DefaultNetServer(jVertex, props);
+ NetServer createNetServer(Map props = null) {
+ return new DefaultNetServer(jVertex, props)
}
/**
* Create a TCP/SSL client
*/
- public NetClient createNetClient(Map props = null) {
- return new DefaultNetClient(jVertex, props);
+ NetClient createNetClient(Map props = null) {
+ return new DefaultNetClient(jVertex, props)
}
/*
* Create an HTTP/HTTPS server
*/
- public HttpServer createHttpServer(Map props = null) {
- return new DefaultHttpServer(jVertex, props);
+ HttpServer createHttpServer(Map props = null) {
+ return new DefaultHttpServer(jVertex, props)
}
/**
* Create a HTTP/HTTPS client
*/
- public HttpClient createHttpClient(Map props = null) {
- return new DefaultHttpClient(jVertex, props);
+ HttpClient createHttpClient(Map props = null) {
+ return new DefaultHttpClient(jVertex, props)
}
/**
* Create a SockJS server that wraps an HTTP server
*/
- public SockJSServer createSockJSServer(HttpServer httpServer) {
- return new DefaultSockJSServer(jVertex, httpServer);
+ SockJSServer createSockJSServer(HttpServer httpServer) {
+ return new DefaultSockJSServer(jVertex, httpServer)
}
/**
* The File system object
*/
- public org.vertx.groovy.core.file.FileSystem fileSystem() {
- return fileSystem;
+ org.vertx.groovy.core.file.FileSystem fileSystem() {
+ return fileSystem
}
/**
* The event bus
*/
- public EventBus eventBus() {
- return eventBus;
+ EventBus eventBus() {
+ return eventBus
}
/**
* The shared data object
*/
- public SharedData sharedData() {
- return jVertex.sharedData();
+ SharedData sharedData() {
+ return jVertex.sharedData()
}
/**
@@ -186,7 +186,7 @@ class Vertx {
}
org.vertx.java.core.Vertx toJavaVertx() {
- return jVertex;
+ return jVertex
}
}
View
10 src/main/groovy/org/vertx/groovy/core/buffer/Buffer.groovy
@@ -50,7 +50,7 @@ class Buffer extends org.vertx.java.core.buffer.Buffer {
* Create an empty buffer
*/
Buffer() {
- jBuffer = new JBuffer();
+ jBuffer = new JBuffer()
}
/**
@@ -61,28 +61,28 @@ class Buffer extends org.vertx.java.core.buffer.Buffer {
* automatic re-allocations as data is written to it.
*/
Buffer(int initialSizeHint) {
- jBuffer = new JBuffer(initialSizeHint);
+ jBuffer = new JBuffer(initialSizeHint)
}
/**
* Create a new Buffer that contains the contents of a {@code byte[]}
*/
Buffer(byte[] bytes) {
- jBuffer = new JBuffer(bytes);
+ jBuffer = new JBuffer(bytes)
}
/**
* Create a new Buffer that contains the contents of a {@code String str} encoded according to the encoding {@code enc}
*/
Buffer(String str, String enc) {
- jBuffer = new JBuffer(str, enc);
+ jBuffer = new JBuffer(str, enc)
}
/**
* Create a new Buffer that contains the contents of {@code String str} encoded with UTF-8 encoding
*/
Buffer(String str) {
- jBuffer = new JBuffer(str);
+ jBuffer = new JBuffer(str)
}
/**
View
12 src/main/groovy/org/vertx/groovy/core/eventbus/EventBus.groovy
@@ -51,11 +51,10 @@ import org.vertx.java.core.json.JsonObject
*/
class EventBus {
-
- private final JEventBus jEventBus;
+ private final JEventBus jEventBus
public EventBus(JEventBus jEventBus) {
- this.jEventBus = jEventBus;
+ this.jEventBus = jEventBus
}
private Map handlerMap = new ConcurrentHashMap()
@@ -157,12 +156,7 @@ class EventBus {
def wrapped = { replyHandler(new Message(it)) } as Handler
return wrapped
} else {
- return null;
+ return null
}
}
-
-
-
-
}
-
View
5 src/main/groovy/org/vertx/groovy/core/eventbus/Message.groovy
@@ -17,8 +17,8 @@
package org.vertx.groovy.core.eventbus
import org.vertx.java.core.eventbus.Message as JMessage
-
import org.vertx.java.core.json.JsonObject
+import groovy.transform.PackageScope
/*
* Represents a message delivered to a handler
@@ -33,7 +33,8 @@ class Message {
private JMessage jMessage
- private Message(JMessage jMessage) {
+ @PackageScope
+ Message(JMessage jMessage) {
if (jMessage.body instanceof JsonObject) {
this.body = jMessage.body.toMap()
} else {
View
4 src/main/groovy/org/vertx/groovy/core/file/FileSystem.groovy
@@ -38,10 +38,10 @@ class FileSystem {
static FileSystem instance = new FileSystem()
- private final JFileSystem jFS;
+ private final JFileSystem jFS
private FileSystem(JFileSystem jFS) {
- this.jFS = jFS;
+ this.jFS = jFS
}
/**
View
2  src/main/groovy/org/vertx/groovy/core/http/HttpClient.groovy
@@ -34,7 +34,7 @@ import org.vertx.java.core.http.WebSocketVersion
*/
abstract class HttpClient {
- protected org.vertx.java.core.http.HttpClient jClient;
+ protected org.vertx.java.core.http.HttpClient jClient
/**
* Set an exception handler
View
2  src/main/groovy/org/vertx/groovy/core/http/HttpClientRequest.groovy
@@ -60,7 +60,7 @@ import org.vertx.java.core.Handler
*/
class HttpClientRequest implements WriteStream {
- private final JHttpClientRequest jRequest;
+ private final JHttpClientRequest jRequest
protected HttpClientRequest(JHttpClientRequest jRequest) {
this.jRequest = jRequest
View
10 src/main/groovy/org/vertx/groovy/core/http/HttpServer.groovy
@@ -32,10 +32,10 @@ import org.vertx.java.core.Handler
*/
abstract class HttpServer {
- private reqHandler;
- private wsHandler;
+ private reqHandler
+ private wsHandler
- protected org.vertx.java.core.http.HttpServer jServer;
+ protected org.vertx.java.core.http.HttpServer jServer
/**
* Set the request handler for the server to {code requestHandler}. As HTTP requests are received by the server,
@@ -54,7 +54,7 @@ abstract class HttpServer {
* return The request handler
*/
Closure getRequestHandler() {
- return reqHandler;
+ return reqHandler
}
/**
@@ -74,7 +74,7 @@ abstract class HttpServer {
* return The websocket handler
*/
Closure getWebsocketHandler() {
- wsHandler;
+ wsHandler
}
/**
View
2  src/main/groovy/org/vertx/groovy/core/http/HttpServerResponse.groovy
@@ -106,7 +106,7 @@ class HttpServerResponse implements WriteStream {
* @param value The header value
* @return A reference to this, so multiple method calls can be chained.
*/
- public HttpServerResponse putHeader(String name, Object value) {
+ HttpServerResponse putHeader(String name, Object value) {
getHeaders().put(name, value)
this
}
View
10 src/main/groovy/org/vertx/groovy/core/http/ServerWebSocket.groovy
@@ -15,7 +15,7 @@
*/
-package org.vertx.groovy.core.http;
+package org.vertx.groovy.core.http
import org.vertx.java.core.http.ServerWebSocket as JServerWebSocket
@@ -26,13 +26,13 @@ import org.vertx.java.core.http.ServerWebSocket as JServerWebSocket
*
* @author <a href="http://tfox.org">Tim Fox</a>
*/
-public class ServerWebSocket extends WebSocket {
+class ServerWebSocket extends WebSocket {
- private final JServerWebSocket jSWS;
+ private final JServerWebSocket jSWS
protected ServerWebSocket(JServerWebSocket jSWS) {
- super(jSWS);
- this.jSWS = jSWS;
+ super(jSWS)
+ this.jSWS = jSWS
}
/**
View
4 src/main/groovy/org/vertx/groovy/core/http/WebSocket.groovy
@@ -36,7 +36,7 @@ import org.vertx.java.core.Handler
*/
class WebSocket implements ReadStream, WriteStream {
- private final JWebSocket jWS;
+ private final JWebSocket jWS
protected WebSocket(JWebSocket jWS) {
this.jWS = jWS
@@ -105,7 +105,7 @@ class WebSocket implements ReadStream, WriteStream {
* Close the websocket
*/
void close() {
- jWS.close();
+ jWS.close()
}
/** {@inheritDoc} */
View
2  src/main/groovy/org/vertx/groovy/core/http/impl/DefaultHttpServer.groovy
@@ -25,7 +25,7 @@ import org.vertx.java.core.impl.VertxInternal
class DefaultHttpServer extends HttpServer {
DefaultHttpServer(VertxInternal vertx, Map props = null) {
- jServer = new org.vertx.java.core.http.impl.DefaultHttpServer(vertx);
+ jServer = new org.vertx.java.core.http.impl.DefaultHttpServer(vertx)
if (props != null) {
props.each { k, v ->
setProperty(k, v)
View
2  src/main/groovy/org/vertx/groovy/core/net/NetClient.groovy
@@ -34,7 +34,7 @@ import org.vertx.java.core.Handler
*/
abstract class NetClient {
- protected org.vertx.java.core.net.NetClient jClient;
+ protected org.vertx.java.core.net.NetClient jClient
/**
* Attempt to open a connection to a server at the specific {@code port} and host {@code localhost}
View
2  src/main/groovy/org/vertx/groovy/core/net/NetServer.groovy
@@ -34,7 +34,7 @@ import org.vertx.java.core.Handler
*/
abstract class NetServer {
- protected org.vertx.java.core.net.NetServer jServer;
+ protected org.vertx.java.core.net.NetServer jServer
/**
* Supply a connect handler for this server. The server can only have at most one connect handler at any one time.
View
4 src/main/groovy/org/vertx/groovy/core/net/NetSocket.groovy
@@ -37,10 +37,10 @@ import org.vertx.java.core.Handler
*/
class NetSocket implements ReadStream, WriteStream {
- private JNetSocket jSocket;
+ private JNetSocket jSocket
protected NetSocket(JNetSocket jSocket) {
- this.jSocket = jSocket;
+ this.jSocket = jSocket
}
/** {@inheritDoc} */
View
2  src/main/groovy/org/vertx/groovy/core/net/impl/DefaultNetClient.groovy
@@ -24,7 +24,7 @@ import org.vertx.java.core.impl.VertxInternal
*/
class DefaultNetClient extends NetClient {
- public DefaultNetClient(VertxInternal vertx, Map props = null) {
+ DefaultNetClient(VertxInternal vertx, Map props = null) {
jClient = new org.vertx.java.core.net.impl.DefaultNetClient(vertx)
if (props != null) {
props.each { k, v ->
View
20 src/main/groovy/org/vertx/groovy/core/parsetools/RecordParser.groovy
@@ -62,7 +62,7 @@ class RecordParser {
* @param str
* @return The byte[] form of the string
*/
- public static byte[] latin1StringToBytes(String str) {
+ static byte[] latin1StringToBytes(String str) {
return JRecordParser.latin1StringToBytes(str)
}
@@ -71,7 +71,7 @@ class RecordParser {
* by the String {@code} delim endcoded in latin-1 . Don't use this if your String contains other than latin-1 characters.<p>
* {@code output} Will receive whole records which have been parsed.
*/
- public static RecordParser newDelimited(String delim, Closure output) {
+ static RecordParser newDelimited(String delim, Closure output) {
return new RecordParser(JRecordParser.newDelimited(delim, {output(new Buffer(it))} as Handler))
}
@@ -80,7 +80,7 @@ class RecordParser {
* by the {@code byte[]} delim.<p>
* {@code output} Will receive whole records which have been parsed.
*/
- public static RecordParser newDelimited(byte[] delim, Closure output) {
+ static RecordParser newDelimited(byte[] delim, Closure output) {
return new RecordParser(JRecordParser.newDelimited(delim, {output(new Buffer(it))} as Handler))
}
@@ -89,7 +89,7 @@ class RecordParser {
* by the {@code size} parameter.<p>
* {@code output} Will receive whole records which have been parsed.
*/
- public static RecordParser newFixed(int size, Closure output) {
+ static RecordParser newFixed(int size, Closure output) {
return new RecordParser(JRecordParser.newFixed(size, {output(new Buffer(it))} as Handler))
}
@@ -98,7 +98,7 @@ class RecordParser {
* by the String {@code delim} endcoded in latin-1 . Don't use this if your String contains other than latin-1 characters.<p>
* This method can be called multiple times with different values of delim while data is being parsed.
*/
- public void delimitedMode(String delim) {
+ void delimitedMode(String delim) {
jParser.delimitedMode(delim)
}
@@ -107,7 +107,7 @@ class RecordParser {
* by the delimiter {@code delim}.<p>
* This method can be called multiple times with different values of delim while data is being parsed.
*/
- public void delimitedMode(byte[] delim) {
+ void delimitedMode(byte[] delim) {
jParser.delimitedMode(delim)
}
@@ -115,7 +115,7 @@ class RecordParser {
* Flip the parser into fixed size mode, where the record size is specified by {@code size} in bytes.<p>
* This method can be called multiple times with different values of size while data is being parsed.
*/
- public void fixedSizeMode(int size) {
+ void fixedSizeMode(int size) {
jParser.fixedSizeMode(size)
}
@@ -123,15 +123,15 @@ class RecordParser {
* Convert to a closure so it can be plugged into data handlers
* @return a Closure
*/
- public Closure toClosure() {
+ Closure toClosure() {
return {jParser.handle(it.toJavaBuffer())}
}
- public void setOutput(Closure output) {
+ void setOutput(Closure output) {
jParser.setOutput({output(new Buffer(it))} as Handler)
}
- public void handle(Buffer data) {
+ void handle(Buffer data) {
jParser.handle(new Buffer(data))
}
}
View
10 src/main/groovy/org/vertx/groovy/core/sockjs/SockJSServer.groovy
@@ -64,7 +64,7 @@ abstract class SockJSServer {
* @param config The application configuration
* @param sockHandler A handler that will be called when new SockJS sockets are created
*/
- public void installApp(Map config, Closure sockHandler) {
+ void installApp(Map config, Closure sockHandler) {
jServer.installApp(new AppConfig(config), {
org.vertx.java.core.sockjs.SockJSSocket jSock = it
sockHandler(new SockJSSocket(jSock) {
@@ -114,11 +114,11 @@ abstract class SockJSServer {
* @param config The config for the app
* @param permitted A list of JSON objects which define permitted matches
*/
- public void bridge(Map config, List<Map<String, Object>> permitted = [[:]]) {
- List<JsonObject> jList = new ArrayList<>();
+ void bridge(Map config, List<Map<String, Object>> permitted = [[:]]) {
+ List<JsonObject> jList = new ArrayList<>()
for (Map<String, Object> map: permitted) {
- jList.add(new JsonObject(map));
+ jList.add(new JsonObject(map))
}
- jServer.bridge(new AppConfig(config), jList);
+ jServer.bridge(new AppConfig(config), jList)
}
}
View
2  src/main/groovy/org/vertx/groovy/core/sockjs/impl/DefaultSockJSServer.groovy
@@ -25,7 +25,7 @@ import org.vertx.java.core.impl.VertxInternal
*/
class DefaultSockJSServer extends SockJSServer {
- public DefaultSockJSServer(VertxInternal vertx, HttpServer httpServer) {
+ DefaultSockJSServer(VertxInternal vertx, HttpServer httpServer) {
jServer = new org.vertx.java.core.sockjs.impl.DefaultSockJSServer(vertx, httpServer.toJavaServer())
}
View
2  src/main/groovy/org/vertx/groovy/core/streams/Pump.groovy
@@ -123,6 +123,6 @@ class Pump {
ws.exceptionHandler({handler.handle(it)})
}
- });
+ })
}
}
View
2  src/main/groovy/org/vertx/groovy/core/streams/ReadStream.groovy
@@ -50,6 +50,6 @@ interface ReadStream {
/**
* Set an end handler. Once the stream has ended, and there is no more data to be read, this handler will be called.
*/
- void endHandler(Closure handler);
+ void endHandler(Closure handler)
}
View
2  src/main/groovy/org/vertx/groovy/core/streams/WriteStream.groovy
@@ -46,7 +46,7 @@ interface WriteStream {
/**
* This will return {@code true} if there are more bytes in the write queue than the value set using {@link #setWriteQueueMaxSize}
*/
- boolean writeQueueFull();
+ boolean writeQueueFull()
/**
* Set a drain handler on the stream. If the write queue is full, then the handler will be called when the write
Please sign in to comment.
Something went wrong with that request. Please try again.