Am very New to jetty. I have a sample code that am practicing with. But i dont seem to understand which of the jetty classes in my code is used to create the client connection to the jetty server. For example in core java socket programming, the client can establish a connection with the server through the following code
Socket socket = serverSocket.accept();
where serverSocket is an instance of java ServerSocket class. My code works fine anyway But I want to know which of the classes in jetty is playing the part of Socket class in the one line code above.
Here is a sample of my code:
ServletContextHandler context = new ServletContextHandler(ServletContextHandler.SESSIONS);
context.setContextPath("/");
Server jettyServer = new Server(5500);
jettyServer.setHandler(context);
ServletHolder jerseyServlet = context.addServlet(org.glassfish.jersey.servlet.ServletContainer.class, "/*");
jerseyServlet.setInitOrder(0);
// Tells the Jersey Servlet which REST service/class to load.
jerseyServlet.setInitParameter("jersey.config.server.provider.classnames",
ModelInn.class.getCanonicalName() );
try {
jettyServer.start();
jettyServer.join();
} catch (Exception ex) {
Logger.getLogger(HandleClient.class.getName()).log(Level.SEVERE, null, ex);
} finally {
jettyServer.destroy();
}