OpenEJB

Wednesday April 29, 2009

Lookups into the openejb namespace

To ease the burden in looking up things from OpenEJB's internal JNDI tree, we've added a new "openejb" JNDI URL prefix which can be used in any context to do lookups.

The following will work in a TestCase or EJB or any code running in the same VM as the EJB Container.

InitialContext context = new InitialContext();

TransactionManager tm = (TransactionManager) context.lookup("openejb:TransactionManager");
DataSource dataSource = (DataSource) context.lookup("openejb:Resource/MyDataSource");

Comments:

Post a Comment:
  • HTML Syntax: NOT allowed

Calendar

Search

Hot Blogs (today's hits)

Tag Cloud

Categories

Feeds

Links

Navigation