users@glassfish.java.net

RE: Naming environment in a startup module

From: BRASSELY David <david.brassely_at_ineat-conseil.fr>
Date: Thu, 1 Mar 2012 07:41:22 +0000

Thanks for your advice.

Is this the only way to get it ? No way to get it from the naming environment and how ?
According to your answer, I had to enabled transaction recovery on startup and so access it after the all_application_loaded event, that's it ?

David

-----Message d'origine-----
De : Marina Vatkina [mailto:marina.vatkina_at_oracle.com]
Envoyé : jeudi 1 mars 2012 00:26
À : users_at_glassfish.java.net
Cc : users_at_glassfish.dev.java.net
Objet : Re: Naming environment in a startup module

You can inject
com.sun.enterprise.transaction.api.JavaEETransactionManager using HK2 API. But you need to be very careful with accessing it on startup - it shouldn't be started before all applications had been loaded if transaction recovery is enabled on startup.

-marina

forums_at_java.net wrote:
> Hi all,
>
> I'm currently writing a Startup module for Glassfish v3.1 by
> implementing the org.glassfish.api.Startup interface.
>
> I just want to get the java:appserver/TransactionManager from the
> naming environment.
>
>
>
> Is there any way to get a reference to the current InitialContext as
> it exists in the old fashion LifecycleListener event context
> : http://docs.oracle.com/cd/E18930_01/html/821-2418/beans.html#beanw [1].
>
> Otherwise, any other way to do this ?
>
> Thanks
>
>
>
>
> [1] http://docs.oracle.com/cd/E18930_01/html/821-2418/beans.html#beanw
>
> --
>
> [Message sent by forum member 'brasseld']
>
> View Post: http://forums.java.net/node/883879
>
>