Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [sisu-users] Should I be able to use @PostConstruct on an abstract class?

I've answered my own question:

https://bugs.eclipse.org/bugs/show_bug.cgi?id=428240

M3?

Can anyone tell me how to make IntelliJ and the sisu source get along?



On Fri, Feb 14, 2014 at 9:01 PM, Benson Margulies <benson@xxxxxxxxxxxxx> wrote:
The PostConstruct is not called. I'm using 0.2.M2

@Named
public abstract class AbstractWsBusComponent implements WsBusComponent {
    @Inject
    protected MetricRegistry metrics;
    private Timer requests;

    @PostConstruct
    public void postConstruct() {
        requests = metrics.timer(name(getClass(), "requests"));
    }


    @Override
    public final Text process(WsBusComponentInput input) {
        Timer.Context context = requests.time();
        try {
            return processImplementation(input);
        } finally {
            context.stop();
        }
    }

    protected abstract Text processImplementation(WsBusComponentInput input);
}


Back to the top