/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.demo;

import java.io.Serializable;
import javax.enterprise.context.ApplicationScoped;
import javax.enterprise.inject.Produces;

/**
 *
 * @author Administrator
 */
@ApplicationScoped
public class Generator implements Serializable {
    private java.util.Random random = new java.util.Random(
                System.currentTimeMillis());
    private int maxNumber = 100;

    java.util.Random getRandom() {
        return random;
    }

    @Produces
    @Random
    int next() {
        return getRandom()
                   .nextInt(maxNumber);
    }
}
