http://jumpstart.doublenegative.com.au/jumpstart/

&

http://jumpstart.doublenegative.com.au/jumpstart/examples/state/atejb

Download jumpstart and have a look how Geoff has done it.






On Mon, 30 Mar 2015 19:34:29 +1100, Adam X <vbgnm3c...@gmail.com> wrote:

Hi,

I have a different JNDI lookup depending on exec env. I have an AppModule
with EJB sub:

@SubModule(EjbModule.class)
AppModule

And my EJB mod does all the EJB plumbing building the context and
delegating the looking up of EJBs to EjbLocatorModule. As far as building
my beans I would like to inject JNDI into my EJB builder methods as a
symbol:

@SubModule(EjbLocatorModule.class)
EjbModule {
// builds EjbContext and stuff
}

EjbLocatorModule.java:

public RegistrationDaoRemote buildRegistrationService(
  @InjectService("EjbContext") Context aEjbContext,
  @Inject @Value("${ejb.jndi.dao.registration}") String jndi)
{
// remote EJB dao lookup
}

So the symbol ${ejb.jndi.dao.registration} is different depending on
execution environmnet (prod, readiness, dev, local)

How it's best done in Tapestry?

* if-then-else in a single contribution method testing -D JVM arg? (ugly)
* different -D exec mode and different modules ? (will the contribution
load before submodule of the app module will) ?
* introduce another property file with a manual lookup?

Or yet a better solution? Please advise.

Adam


--
Using Opera's mail client: http://www.opera.com/mail/

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org

Reply via email to