Package ejava.examples.asyncmarket.web
Class JNDIHelper
- java.lang.Object
-
- ejava.examples.asyncmarket.web.JNDIHelper
-
public class JNDIHelper extends Object
This is a helper class used to help locate EJBs when running in a remote web container -- such as Jetty. TODO: factor out JNDI properties into a jndi.properties file
-
-
Field Summary
Fields Modifier and Type Field Description static String
AUCTION_MGMT_REMOTE_JNDI
static String
BUYER_REMOTE_JNDI
private Context
jndi
private static org.slf4j.Logger
log
static String
SELLER_REMOTE_JNDI
static String
USER_MGMT_REMOTE_JNDI
-
Constructor Summary
Constructors Constructor Description JNDIHelper()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
AuctionMgmt
getAuctionMgmt()
Buyer
getBuyer()
Seller
getSeller()
UserMgmt
getUserMgmt()
private <T> T
lookup(Class<T> lazz, Context jndi, String remoteJNDI)
-
-
-
Field Detail
-
log
private static final org.slf4j.Logger log
-
AUCTION_MGMT_REMOTE_JNDI
public static final String AUCTION_MGMT_REMOTE_JNDI
-
USER_MGMT_REMOTE_JNDI
public static final String USER_MGMT_REMOTE_JNDI
-
SELLER_REMOTE_JNDI
public static final String SELLER_REMOTE_JNDI
-
BUYER_REMOTE_JNDI
public static final String BUYER_REMOTE_JNDI
-
jndi
private Context jndi
-
-
Constructor Detail
-
JNDIHelper
public JNDIHelper() throws NamingException
- Throws:
NamingException
-
-
Method Detail
-
close
public void close()
-
getAuctionMgmt
public AuctionMgmt getAuctionMgmt() throws NamingException
- Throws:
NamingException
-
getUserMgmt
public UserMgmt getUserMgmt() throws NamingException
- Throws:
NamingException
-
getSeller
public Seller getSeller() throws NamingException
- Throws:
NamingException
-
getBuyer
public Buyer getBuyer() throws NamingException
- Throws:
NamingException
-
lookup
private <T> T lookup(Class<T> lazz, Context jndi, String remoteJNDI) throws NamingException
- Throws:
NamingException
-
-