I have an application written in pure/basic Java without GUI. I have three classes with main methods, so each of them can run for themselves. Now I run them with ant in specific order.
In glassfish I deployed Web application only with RESTful service.
What I want to do now is to transfer the three classes into glassfish, so I will call them in exact same order as before from RESTful service.
I watched series of videos on youtube on Java EE 6 APIs, but I didn’t find anything that would help transfer pure Java application to glassfish. Should I use EJB API for this?
There is nothing special to do. Just package the three classes into the
.warfile with your web service. When the web service method is called, create an instance of each class and call the appropriate method.Of course you could also create EJBs for each class and inject an instance of each class into the web service class.