[wildfly-dev] Application shutdown code: recommended approach?

Stuart Douglas stuart.w.douglas at gmail.com
Thu May 23 09:09:51 EDT 2013


What are you actually asking for?

I'm not really sure what your use case is, is there just one deployment? 
Can you be very specific as to what EJB's depend on other EJB's and why 
they have a dependency?

Reading your email it sounds like you expect us to magically determine a 
shutdown order, which does not sound possible based on what you describe.

Stuart




Thomas Segismont wrote:
> Hi,
>
> I recently created this BZ for EAP6.1:
>
> Bug 958217 - Unable to call Stateless bean methods from Singleton
> PreDestroy callback
> https://bugzilla.redhat.com/show_bug.cgi?id=958217
>
> I though I could call any EJB bean from a @Singleton @PreDestroy method
> but, as Jaikiran pointed out, the @DependsOn annotation is needed to
> prevent dependencies from being shutdown before this last call.
>
> While it is doable to manually list a few dependencies, it is obviously
> not an option if your shutdown code virtually needs any of your EJB
> beans to be available: in RHQ, we want to be able to shutdown a Quartz
> scheduler gracefully, and the jobs running at shutdown might depend on
> any EJB bean.
>
> I though of adding a DeploymentUnitProcessor which would automatically
> make a "special" @Singleton bean (marked with an annotation) depend on
> all over beans in the RHQ deployment.
>
> What do you think?
>
> Thanks and regards,
> Thomas
> _______________________________________________
> wildfly-dev mailing list
> wildfly-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/wildfly-dev


More information about the wildfly-dev mailing list