Hi Santiago,

On Thu, Aug 13, 2015 at 5:54 PM, Santiago Gonzalez Toral <
hernangt12...@gmail.com> wrote:
>
> Today, I figure out that after executing one of the REST services that my
> custom module has, the scheduled service starts. So, when I do this, the
> method annotated with @PostConstruct executes. Is there a way to run this
> method when CDI loads the module in the platform startup ?
>

Many IoC frameworks do only construct the beans when they're actually
required (e.g., they need to be injected by a service).

If you want to react when the platform actually starts up, you can observe
the event by adding to your service a method like:

    public void onSystemStartupEvent(@Observes SystemStartupEvent event) {
        //do whatever you want to do on startup
    }

Hope that helps.

Cheers,

-- 
Sergio Fernández
Partner Technology Manager
Redlink GmbH
m: +43 6602747925
e: sergio.fernan...@redlink.co
w: http://redlink.co

Reply via email to