JavaFX with GlassFish
December 13, 2013
Introduction to LightFish
Revival of rich clients by JavaFX
SOAP, REST and WebSocket
Using JAX-RS and WebSocket in JavaFX
Some plan how to combine JavaFX and
LightFish is a performance monitor
for GlassFish using JavaFX UI
LightFish is since 2012
by Adam Bien, a Java Champion in Germany
It’s an open source software licensed by Apache License 2.0
Using JAX-RS and WebSocket
Now, we should use JAX-RS and/or WebSocket for connect
JavaFX to GlassFish because of these simplify.
In this chapter, I’ll show some information it’s not important for
Java EE but requirement for Java SE and Java FX.
JSR 339 : JAX-RS 2.0
JAX-RS 1.1 (JSR 311) is so useful API.
JAX-RS 2.0 (JSR 339) is the extend speciﬁcation of JAX-RS
1.1. It added many useful features to JAX-RS 1.0.
It speciﬁes the Client API using both Java SE and EE.
Jersey 2.0 (RI) is now avaliable: https://jersey.java.net/
JAX-RS Client API Usage
Sample code for REST client (incl. JavaFX)
// Initialize Client object
// It needs many resource but it is reusable
Client client = ClientBuilder.newClient();
// send GET request to TARGET_URI
// and receive the response as String class
WebTarget target = client.target(TARGET_URI);
String message = target.request()
JSR 356 : Java API for WebSocket
JSR 356 is the API that is easy for us to use WebSocket on both
Java EE and Java SE.
In past times, many application servers implement WebSocket
features by its original way. JSR 356 has some useful features not
included in the other way.
Tyrus (RI) is now available: https://tyrus.java.net