Methods Summary |
---|
public void | accessENC()
// Obtain the enterprise beans environment naming context.
Context initCtx = new InitialContext();
Context myEnv = (Context) initCtx.lookup(Container.ENC_CTX_NAME + "/env");
// This bean should have the full ENC setup of the ENCBean
testJdbcDataSource(initCtx, myEnv);
testMail(initCtx, myEnv);
testJMS(initCtx, myEnv);
testResourceEnvEntries(initCtx, myEnv);
|
public void | remove()
|
private void | testJMS(javax.naming.Context initCtx, javax.naming.Context myEnv)
// JavaMail Session
Object obj = myEnv.lookup("jms/QueFactory");
if ((obj instanceof javax.jms.QueueConnectionFactory) == false)
throw new NamingException("mail/DefaultMail is not a javax.jms.QueueConnectionFactory");
log.info("Found jms queue resource ref");
|
private void | testJdbcDataSource(javax.naming.Context initCtx, javax.naming.Context myEnv)
// JDBC DataSource
Object obj = myEnv.lookup("jdbc/DefaultDS");
if ((obj instanceof javax.sql.DataSource) == false)
throw new NamingException("jdbc/DefaultDS is not a javax.sql.DataSource");
log.info("Found data source resource ref");
|
private void | testMail(javax.naming.Context initCtx, javax.naming.Context myEnv)
// JavaMail Session
Object obj = myEnv.lookup("mail/DefaultMail");
if ((obj instanceof javax.mail.Session) == false)
throw new NamingException("DefaultMail is not a javax.mail.Session");
log.info("Found mail resource ref");
|
private void | testResourceEnvEntries(javax.naming.Context initCtx, javax.naming.Context myEnv)
Object obj = myEnv.lookup("res/aQueue");
if ((obj instanceof javax.jms.Queue) == false)
throw new NamingException("res/aQueue is not a javax.jms.Queue");
log.info("Found jms queue resource env ref");
|