i want to know from how many ways i can call my EJb bean without Jax-rs web service.I setup an EJB 3 interface/implementation looking like this...
UserService (interface)
package business;
public interface UserService {
public String doSomething();
}
UserServiceBean (implementation)
@Stateless
@Local
public class UserServiceBean implements UserService{
public UserServiceBean() {
}
@Override
public String doSomething() {
return "Work done!";
}
}
What i know: I know by calling my web service i can get output : "Work done!"
like this.
RestService (Web Service)
package webservices;
@Path("/service")
public class RestService {
@Inject
private UserService userService;
public RestService() {
// TODO Auto-generated constructor stub
}
@GET
@Produces(MediaType.TEXT_HTML)
@Path("/userService")
public String getUserServiceResponse(String json){
String response = userService.doSomething();
return response;
}
}
What I Want: I want a simple method/approach/shortcut etc you can say it. To call my EJB bean without any web service to get my expected output : "Work done!"
.
As like we uses public static void main method in java application.It is very clear question which i have asked.Hope you all got it.