Skip to content

Instantly share code, notes, and snippets.

@sejersbol
sejersbol / SimpleSpeakQuery.java
Created February 26, 2011 08:29
Simple Stateless EJB
@Stateless
public class SimpleSpeakQuery implements SpeakQuery {
private String message = new String("Hello, ");
public String sayHello(String name) throws Exception {
return message + name;
}
}
@sejersbol
sejersbol / SpeakQuery.java
Created February 26, 2011 08:28
EJB interface
public interface SpeakQuery {
public String sayHello(String name) throws Exception;
}
@sejersbol
sejersbol / Ws.java
Created February 26, 2011 08:19
Simple web service with injected stateless bean.
@WebService
public class Ws {
@Inject SpeakQuery bean;
@WebMethod
public String sayHelloSlow(String name) throws Exception {
return bean.sayHello(name);
}
}