Java Adapters usually run in-process with the Lightstreamer Server, so you don't need to use the socket-based protocol. In such case, you will use the provided Java API (as introduced in this tutorial).

Only in case you have a requirement to make the Java Adapters run on a different machine than the Lightstreamer Server, you should actually open sockets by hand and implement the Lightstreamer network protocol.