Sparked off by feedback from Guillaume I have made a set of API
changes which affect the Java, JS, Ruby and Groovy apis.
The main things include
1) Vertx no longer uses singletons to get instances of objects like
Vertx, FileSystem, EventBus and SharedData. In fact singletons aren't
used anywhere any more, neither are static fields used to cache data.
Now you obtain an instance of Vertx then call methods on vertx to get
the various other objects.
If you're running in a container then a vertx instance will be
injected, otherwise if you're running embedded with Java or Groovy you
can create a vertx instance with Vertx.newVertx().
This should help with testing/mocking etc.
2) headers, params and trailers in the HTTP api are now maps
3) Bunch of other stuff
Anyway please take a look.
Groovy guys especially, please review again. I think we're pretty much
there now.
website docs still need to be updated. We can do that next week.
After which we can release another beta with the spanking new Groovy
api.
Happy Easter!
One last thing...
There's a place where you're calling a private constructor of a class.Currently, Groovy won't complain if you're doing this, but in future versions, it probably will, so better avoid it.
The Message class has a private constructor.And in EventBus, in the wrapHandler() method, you're calling new Message()
You could perhaps make the Message constructor package-scope instead?
Pull request sent.
I agree that it's often overkill to split everything into intf/impl, but if you look at the HttpServer/NetServer/EventBus... then it looks to me that the FileSystem can be handled the same way.
The same applies to SharedData as well. They can all be seen as some kind of internal component of the vertx system.
- Johan