This is the sixth of a series of posts on some of the personal projects I’ve been working on. As I hope you’ll see, they all fit together. The previous post covered MicroBean Main. The next post will cover MicroBean Grizzly HTTP Server CDI Integration.
This post covers MicroBean Jersey Container Grizzly HTTP CDI Integration. Its website is here, its source code is here and its binaries are available from Maven Central.
- A Jersey
GrizzlyHttpContainer(by way of a
- A Grizzly
HttpServer(by way of a
GrizzlyHttpServerFactory uses a
GrizzlyHttpContainer to build an
GrizzlyHttpContainer can be produced by a
ContainerFactory if it is supplied with
GrizzlyHttpContainer.class and an
To install MicroBean Jersey Container Grizzly HTTP CDI Integration, place it on the classpath.
By itself, this project doesn’t do much. As mentioned, it installs some producer methods that integrate some Jersey and Grizzly raw materials, but they themselves don’t do anything unless someone else asks for, say, an
HttpServer or a
GrizzlyHttpContainer. You are not likely to ask for these things directly in your own code (via
@Inject). And even if you do, you won’t get anything useful unless you have also placed an
Application bean into the same CDI environment.
So merely placing this project on the classpath won’t do anything.
But when it is combined with MicroBean Jersey Container Grizzly2 HTTP CDI Extension, the subject of the next post, things get more interesting. Specifically, as we’ll see, this combination allows you to simply supply an
Application, and thanks to the interaction of MicroBean Jersey Container Grizzly2 HTTP CDI Extension, MicroBean Jersey Container Grizzly HTTP CDI Integration, MicroBean Grizzly HTTP Server CDI Integration, MicroBean CDI Utilities, MicroBean Configuration CDI, MicroBean Configuration, MicroBean Main and MicroBean Configuration API, you can have a Jersey server running on a configured port as part of a CDI container started by a
public static void main(String) method you didn’t write, simply by placing projects on the classpath. I’ve written previously on this topic.
(I told you this would all start coming together.)