if I move the code of the method annotated @ PreDestroy in the method
@Disposes  of cdi?????

for example for create a object @ApplicationScoped with cdi , i use a method
@Produces.
And for destuct it i use the method @Disposes.

When the application destruct the beans @Applicationscoped , the mehod with
the parameter @Disposes it is callled automatically .

i write a example of a method producer and a method that @Disposes the bean
.




@Produces @ManagerQueque @ApplicationScoped 
            public QueueSession createOrderSession(@Order QueueConnection conn)
throws JMSException {
                return conn.createQueueSession(true, Session.AUTO_ACKNOWLEDGE);
            }
         
            public void closeOrderSession(@Disposes @ManagerQueque 
QueueConnection
conn) throws JMSException {
                conn.close();
            }


you think that it is ok ? 
mauro



--
View this message in context: 
http://openejb.979440.n4.nabble.com/TomEE-undeploy-app-is-not-invoking-PreDestroy-on-CDI-ApplicationScoped-bean-tp4658744p4661403.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Reply via email to