// Collection of code snippets by Arne Vajhøj 
// (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) 
package test;

import java.io.PrintWriter;

import javax.enterprise.context.RequestScoped;
import javax.inject.Inject;

@RequestScoped
public class SomeThing {
    @Inject
    private X x;
    @Inject
    private A a;
    @Inject
    private B b;
    @Inject
    private C c;
    @Inject
    private D d;
    public void doit(PrintWriter pw) {
        pw.println("<html>");
        pw.println("<head>");
        pw.println("<title>CDI test</title>");
        pw.println("</head>");
        pw.println("<body>");
        pw.println("<h1>CDI test</h1>");
        pw.println("default: " + x + "<br>");
        pw.println("RequstScoped: " + a + "<br>");
        pw.println("SessionScoped: " + b + "<br>");
        pw.println("ApplicationScoped: " + c + "<br>");
        pw.println("MyScoped: " + d + "<br>");
        pw.println("</body>");
        pw.println("</html>");
    }
}
